本文整理汇总了Java中net.minecraft.item.ItemElytra.isUsable方法的典型用法代码示例。如果您正苦于以下问题:Java ItemElytra.isUsable方法的具体用法?Java ItemElytra.isUsable怎么用?Java ItemElytra.isUsable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.ItemElytra
的用法示例。
在下文中一共展示了ItemElytra.isUsable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateElytra
import net.minecraft.item.ItemElytra; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private void updateElytra() {
boolean flag = getFlag(7);
if (flag && !onGround && !isRiding()) {
ItemStack item = getFormLiving0(this);
if (item.getItem() == Items.ELYTRA && ItemElytra.isUsable(item)) {
flag = true;
if (!world.isRemote && (ticksElytraFlying + 1) % 20 == 0)
item.damageItem(1, this);
} else
flag = false;
} else
flag = false;
if (!world.isRemote)
setFlag(7, flag);
}
示例2: processEntityAction
import net.minecraft.item.ItemElytra; //导入方法依赖的package包/类
@Hook("net.minecraft.network.NetHandlerPlayServer#func_147357_a")
public static Hook.Result processEntityAction(NetHandlerPlayServer handler, CPacketEntityAction action) {
if (action.getAction() == Action.START_FALL_FLYING) {
PacketThreadUtil.checkThreadAndEnqueue(action, handler, handler.player.getServerWorld());
handler.player.markPlayerActive();
if (!handler.player.onGround && handler.player.motionY < 0.0D &&
!handler.player.isElytraFlying() && !handler.player.isInWater()) {
ItemStack item = getFormLiving0(handler.player);
if (item.getItem() == Items.ELYTRA && ItemElytra.isUsable(item))
handler.player.setElytraFlying();
} else
handler.player.clearElytraFlying();
return Hook.Result.NULL;
}
return Hook.Result.VOID;
}
示例3: onLivingUpdate_tail
import net.minecraft.item.ItemElytra; //导入方法依赖的package包/类
@Hook(value = "net.minecraft.client.entity.EntityPlayerSP#func_70636_d", type = Type.TAIL)
public static void onLivingUpdate_tail(EntityPlayerSP player) {
ItemStack item = getFormLiving0(player);
KeyBinding jump = Minecraft.getMinecraft().gameSettings.keyBindJump;
boolean flag = Keyboard.isKeyDown(jump.getKeyCode());
if (item.getItem() == Items.ELYTRA) {
if (flag && jump.getKeyConflictContext().isActive() && !HookClient.flag &&
player.motionY < 0.0D && !player.isElytraFlying() && !player.capabilities.isFlying)
if (ItemElytra.isUsable(item))
player.connection.sendPacket(new CPacketEntityAction(player, CPacketEntityAction.Action.START_FALL_FLYING));
}
HookClient.flag = flag;
}