本文整理汇总了Java中net.minecraft.item.ItemAppleGold类的典型用法代码示例。如果您正苦于以下问题:Java ItemAppleGold类的具体用法?Java ItemAppleGold怎么用?Java ItemAppleGold使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemAppleGold类属于net.minecraft.item包,在下文中一共展示了ItemAppleGold类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: eatFood
import net.minecraft.item.ItemAppleGold; //导入依赖的package包/类
private void eatFood() {
for(int slot = 44; slot >= 9; slot--) {
ItemStack stack = Wrapper.getPlayer().inventoryContainer.getSlot(slot).getStack();
if(stack != null) {
if(slot >= 36 && slot <= 44) {
if(stack.getItem() instanceof ItemFood
&& !(stack.getItem() instanceof ItemAppleGold)) {
Wrapper.getPlayer().inventory.currentItem = slot - 36;
Wrapper.getMinecraft().gameSettings.keyBindUseItem.pressed = true;
return;
}
} else if(stack.getItem() instanceof ItemFood
&& !(stack.getItem() instanceof ItemAppleGold)) {
int itemSlot = slot;
int currentSlot = Wrapper.getPlayer().inventory.currentItem + 36;
Wrapper.getMinecraft().playerController.windowClick(0, slot, 0, ClickType.PICKUP, Wrapper.getPlayer());
Wrapper.getMinecraft().playerController.windowClick(0, currentSlot, 0, ClickType.PICKUP, Wrapper.getPlayer());
Wrapper.getMinecraft().playerController.windowClick(0, slot, 0, ClickType.PICKUP, Wrapper.getPlayer());
return;
}
}
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:AutoEat.java
示例2: eatGoldenApple
import net.minecraft.item.ItemAppleGold; //导入依赖的package包/类
/**
* @param event
*/
@SubscribeEvent
public void eatGoldenApple(PlayerUseItemEvent.Finish event)
{
EntityPlayer player = event.entityPlayer;
if (ConfigHandler.BACKPACK_ABILITIES)
{
if (event.item.getItem() instanceof ItemAppleGold &&
//((ItemAppleGold) event.item.getItem()).getRarity(event.item) == EnumRarity.epic &&
Wearing.isWearingTheRightBackpack(player, "Rainbow"))
{
InventoryBackpack inv = new InventoryBackpack(Wearing.getWearingBackpack(player));
if (inv.getLastTime() > 0) return;
inv.setLastTime(Utils.secondsToTicks(150));
inv.dirtyTime();
if (!player.worldObj.isRemote)
{
String nyanString =
EnumChatFormatting.RED + "N" +
EnumChatFormatting.GOLD + "Y" +
EnumChatFormatting.YELLOW + "A" +
EnumChatFormatting.GREEN + "N" +
EnumChatFormatting.AQUA + "C" +
EnumChatFormatting.BLUE + "A" +
EnumChatFormatting.DARK_PURPLE + "T";
player.addChatComponentMessage(new ChatComponentText(nyanString));
ModNetwork.sendToNearby(new EntitySoundPacket.Message(EntitySoundPacket.NYAN_SOUND, player), player);
}
}
}
if (event.item.getItem() instanceof ItemPotion
&& (event.item.getItem()).getDamage(event.item) == 0)
{
if (!player.worldObj.isRemote)
{
FluidEffectRegistry.executeFluidEffectsForFluid(FluidRegistry.WATER, player, player.getEntityWorld());
}
}
}
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:44,代码来源:GeneralEventHandler.java
示例3: isItemValid
import net.minecraft.item.ItemAppleGold; //导入依赖的package包/类
@Override
public boolean isItemValid(ItemStack itemStack) {
return itemStack.getItem() instanceof ItemAppleGold;
}
开发者ID:modmuss50,项目名称:Network,代码行数:5,代码来源:SlotUpgrade.java
注:本文中的net.minecraft.item.ItemAppleGold类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论