net.minecraft.entity.player.PlayerAbilities Java Examples

The following examples show how to use net.minecraft.entity.player.PlayerAbilities. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ComparatorBlockMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Redirect(
    method = "onUse",
    at = @At(
        value = "FIELD",
        target = "Lnet/minecraft/entity/player/PlayerEntity;abilities:Lnet/minecraft/entity/player/PlayerAbilities;"
    )
)
private PlayerAbilities hasPlayerAbilities(final PlayerEntity player) {
    if(player == null) return new PlayerAbilities();
    return player.abilities;
}
 
Example #2
Source File: RepeaterBlockMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Redirect(
    method = "onUse",
    at = @At(
        value = "FIELD",
        target = "Lnet/minecraft/entity/player/PlayerEntity;abilities:Lnet/minecraft/entity/player/PlayerAbilities;"
    )
)
private PlayerAbilities hasPlayerAbilities(final PlayerEntity player) {
    if(player == null) return new PlayerAbilities();
    return player.abilities;
}