本文整理汇总了Java中net.minecraft.init.Items.BLAZE_POWDER属性的典型用法代码示例。如果您正苦于以下问题:Java Items.BLAZE_POWDER属性的具体用法?Java Items.BLAZE_POWDER怎么用?Java Items.BLAZE_POWDER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.BLAZE_POWDER属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockActivated
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (this.getAge(state) >= getMaxAge())
return false;
if (player != null && player.getHeldItemMainhand() != null) {
ItemStack stack = player.getHeldItemMainhand();
if (stack.getItem() == Items.BLAZE_POWDER) {
if (!world.isRemote) {
world.setBlockState(pos, this.withAge(this.getAge(state) + 1), 2);
if (!player.capabilities.isCreativeMode)
stack.stackSize--;
}
UCPacketHandler.sendToNearbyPlayers(world, pos, new PacketUCEffect(EnumParticleTypes.VILLAGER_HAPPY, pos.getX() - 0.5D, pos.getY(), pos.getZ() - 0.5D, 6));
return true;
}
}
return false;
}
示例2: getLightLevel
public static int getLightLevel(ItemStack p_getLightLevel_0_)
{
if (p_getLightLevel_0_ == null)
{
return 0;
}
else
{
Item item = p_getLightLevel_0_.getItem();
if (item instanceof ItemBlock)
{
ItemBlock itemblock = (ItemBlock)item;
Block block = itemblock.getBlock();
if (block != null)
{
return block.getLightValue(block.getDefaultState());
}
}
return item == Items.LAVA_BUCKET ? Blocks.LAVA.getLightValue(Blocks.LAVA.getDefaultState()) : (item != Items.BLAZE_ROD && item != Items.BLAZE_POWDER ? (item == Items.GLOWSTONE_DUST ? 8 : (item == Items.PRISMARINE_CRYSTALS ? 8 : (item == Items.MAGMA_CREAM ? 8 : (item == Items.NETHER_STAR ? Blocks.BEACON.getLightValue(Blocks.BEACON.getDefaultState()) / 2 : 0)))) : 10);
}
}
示例3: ItemRenderTorchGun
public ItemRenderTorchGun()
{
torchGunModel = new ModelTorchGun();
rand = new Random();
flintSteel = new ItemStack(Items.FLINT_AND_STEEL);
powder = new ItemStack(Items.BLAZE_POWDER);
torch = new ItemStack(Blocks.TORCH);
}
示例4: isItemValidForSlot
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
* guis use Slot.isItemValid
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
if (index == 3)
{
return PotionHelper.isReagent(stack);
}
else
{
Item item = stack.getItem();
return index == 4 ? item == Items.BLAZE_POWDER : (item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE) && this.getStackInSlot(index) == ItemStack.field_190927_a;
}
}
示例5: isItemValidForSlot
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
* guis use Slot.isItemValid
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
if (index == 3)
{
return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack);
}
else
{
Item item = stack.getItem();
return index == 4 ? item == Items.BLAZE_POWDER : net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack);
}
}
示例6: isValidBrewingFuel
public static boolean isValidBrewingFuel(ItemStack itemStackIn)
{
return itemStackIn.getItem() == Items.BLAZE_POWDER;
}
示例7: update
/**
* Like the old updateEntity(), except more generic.
*/
public void update()
{
ItemStack itemstack = (ItemStack)this.brewingItemStacks.get(4);
if (this.fuel <= 0 && itemstack.getItem() == Items.BLAZE_POWDER)
{
this.fuel = 20;
itemstack.func_190918_g(1);
this.markDirty();
}
boolean flag = this.canBrew();
boolean flag1 = this.brewTime > 0;
ItemStack itemstack1 = (ItemStack)this.brewingItemStacks.get(3);
if (flag1)
{
--this.brewTime;
boolean flag2 = this.brewTime == 0;
if (flag2 && flag)
{
this.brewPotions();
this.markDirty();
}
else if (!flag)
{
this.brewTime = 0;
this.markDirty();
}
else if (this.ingredientID != itemstack1.getItem())
{
this.brewTime = 0;
this.markDirty();
}
}
else if (flag && this.fuel > 0)
{
--this.fuel;
this.brewTime = 400;
this.ingredientID = itemstack1.getItem();
this.markDirty();
}
if (!this.world.isRemote)
{
boolean[] aboolean = this.createFilledSlotsArray();
if (!Arrays.equals(aboolean, this.filledSlots))
{
this.filledSlots = aboolean;
IBlockState iblockstate = this.world.getBlockState(this.getPos());
if (!(iblockstate.getBlock() instanceof BlockBrewingStand))
{
return;
}
for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i)
{
iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], Boolean.valueOf(aboolean[i]));
}
this.world.setBlockState(this.pos, iblockstate, 2);
}
}
}
示例8: init
public static void init()
{
Predicate<ItemStack> predicate = new PotionHelper.ItemPredicateInstance(Items.NETHER_WART);
Predicate<ItemStack> predicate1 = new PotionHelper.ItemPredicateInstance(Items.GOLDEN_CARROT);
Predicate<ItemStack> predicate2 = new PotionHelper.ItemPredicateInstance(Items.REDSTONE);
Predicate<ItemStack> predicate3 = new PotionHelper.ItemPredicateInstance(Items.FERMENTED_SPIDER_EYE);
Predicate<ItemStack> predicate4 = new PotionHelper.ItemPredicateInstance(Items.RABBIT_FOOT);
Predicate<ItemStack> predicate5 = new PotionHelper.ItemPredicateInstance(Items.GLOWSTONE_DUST);
Predicate<ItemStack> predicate6 = new PotionHelper.ItemPredicateInstance(Items.MAGMA_CREAM);
Predicate<ItemStack> predicate7 = new PotionHelper.ItemPredicateInstance(Items.SUGAR);
Predicate<ItemStack> predicate8 = new PotionHelper.ItemPredicateInstance(Items.FISH, ItemFishFood.FishType.PUFFERFISH.getMetadata());
Predicate<ItemStack> predicate9 = new PotionHelper.ItemPredicateInstance(Items.SPECKLED_MELON);
Predicate<ItemStack> predicate10 = new PotionHelper.ItemPredicateInstance(Items.SPIDER_EYE);
Predicate<ItemStack> predicate11 = new PotionHelper.ItemPredicateInstance(Items.GHAST_TEAR);
Predicate<ItemStack> predicate12 = new PotionHelper.ItemPredicateInstance(Items.BLAZE_POWDER);
registerPotionItem(new PotionHelper.ItemPredicateInstance(Items.POTIONITEM));
registerPotionItem(new PotionHelper.ItemPredicateInstance(Items.SPLASH_POTION));
registerPotionItem(new PotionHelper.ItemPredicateInstance(Items.LINGERING_POTION));
registerPotionItemConversion(Items.POTIONITEM, new PotionHelper.ItemPredicateInstance(Items.GUNPOWDER), Items.SPLASH_POTION);
registerPotionItemConversion(Items.SPLASH_POTION, new PotionHelper.ItemPredicateInstance(Items.DRAGON_BREATH), Items.LINGERING_POTION);
registerPotionTypeConversion(PotionTypes.WATER, predicate9, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate11, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate4, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate12, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate10, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate7, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate6, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate5, PotionTypes.THICK);
registerPotionTypeConversion(PotionTypes.WATER, predicate2, PotionTypes.MUNDANE);
registerPotionTypeConversion(PotionTypes.WATER, predicate, PotionTypes.AWKWARD);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate1, PotionTypes.NIGHT_VISION);
registerPotionTypeConversion(PotionTypes.NIGHT_VISION, predicate2, PotionTypes.LONG_NIGHT_VISION);
registerPotionTypeConversion(PotionTypes.NIGHT_VISION, predicate3, PotionTypes.INVISIBILITY);
registerPotionTypeConversion(PotionTypes.LONG_NIGHT_VISION, predicate3, PotionTypes.LONG_INVISIBILITY);
registerPotionTypeConversion(PotionTypes.INVISIBILITY, predicate2, PotionTypes.LONG_INVISIBILITY);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate6, PotionTypes.FIRE_RESISTANCE);
registerPotionTypeConversion(PotionTypes.FIRE_RESISTANCE, predicate2, PotionTypes.LONG_FIRE_RESISTANCE);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate4, PotionTypes.LEAPING);
registerPotionTypeConversion(PotionTypes.LEAPING, predicate2, PotionTypes.LONG_LEAPING);
registerPotionTypeConversion(PotionTypes.LEAPING, predicate5, PotionTypes.STRONG_LEAPING);
registerPotionTypeConversion(PotionTypes.LEAPING, predicate3, PotionTypes.SLOWNESS);
registerPotionTypeConversion(PotionTypes.LONG_LEAPING, predicate3, PotionTypes.LONG_SLOWNESS);
registerPotionTypeConversion(PotionTypes.SLOWNESS, predicate2, PotionTypes.LONG_SLOWNESS);
registerPotionTypeConversion(PotionTypes.SWIFTNESS, predicate3, PotionTypes.SLOWNESS);
registerPotionTypeConversion(PotionTypes.LONG_SWIFTNESS, predicate3, PotionTypes.LONG_SLOWNESS);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate7, PotionTypes.SWIFTNESS);
registerPotionTypeConversion(PotionTypes.SWIFTNESS, predicate2, PotionTypes.LONG_SWIFTNESS);
registerPotionTypeConversion(PotionTypes.SWIFTNESS, predicate5, PotionTypes.STRONG_SWIFTNESS);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate8, PotionTypes.WATER_BREATHING);
registerPotionTypeConversion(PotionTypes.WATER_BREATHING, predicate2, PotionTypes.LONG_WATER_BREATHING);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate9, PotionTypes.HEALING);
registerPotionTypeConversion(PotionTypes.HEALING, predicate5, PotionTypes.STRONG_HEALING);
registerPotionTypeConversion(PotionTypes.HEALING, predicate3, PotionTypes.HARMING);
registerPotionTypeConversion(PotionTypes.STRONG_HEALING, predicate3, PotionTypes.STRONG_HARMING);
registerPotionTypeConversion(PotionTypes.HARMING, predicate5, PotionTypes.STRONG_HARMING);
registerPotionTypeConversion(PotionTypes.POISON, predicate3, PotionTypes.HARMING);
registerPotionTypeConversion(PotionTypes.LONG_POISON, predicate3, PotionTypes.HARMING);
registerPotionTypeConversion(PotionTypes.STRONG_POISON, predicate3, PotionTypes.STRONG_HARMING);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate10, PotionTypes.POISON);
registerPotionTypeConversion(PotionTypes.POISON, predicate2, PotionTypes.LONG_POISON);
registerPotionTypeConversion(PotionTypes.POISON, predicate5, PotionTypes.STRONG_POISON);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate11, PotionTypes.REGENERATION);
registerPotionTypeConversion(PotionTypes.REGENERATION, predicate2, PotionTypes.LONG_REGENERATION);
registerPotionTypeConversion(PotionTypes.REGENERATION, predicate5, PotionTypes.STRONG_REGENERATION);
registerPotionTypeConversion(PotionTypes.AWKWARD, predicate12, PotionTypes.STRENGTH);
registerPotionTypeConversion(PotionTypes.STRENGTH, predicate2, PotionTypes.LONG_STRENGTH);
registerPotionTypeConversion(PotionTypes.STRENGTH, predicate5, PotionTypes.STRONG_STRENGTH);
registerPotionTypeConversion(PotionTypes.WATER, predicate3, PotionTypes.WEAKNESS);
registerPotionTypeConversion(PotionTypes.WEAKNESS, predicate2, PotionTypes.LONG_WEAKNESS);
}
示例9: isValidBrewingFuel
/**
* Returns true if the given ItemStack is usable as a fuel in the brewing stand.
*/
public static boolean isValidBrewingFuel(@Nullable ItemStack itemStackIn)
{
return itemStackIn != null && itemStackIn.getItem() == Items.BLAZE_POWDER;
}
示例10: update
/**
* Like the old updateEntity(), except more generic.
*/
public void update()
{
if (this.fuel <= 0 && this.brewingItemStacks[4] != null && this.brewingItemStacks[4].getItem() == Items.BLAZE_POWDER)
{
this.fuel = 20;
--this.brewingItemStacks[4].stackSize;
if (this.brewingItemStacks[4].stackSize <= 0)
{
this.brewingItemStacks[4] = null;
}
this.markDirty();
}
boolean flag = this.canBrew();
boolean flag1 = this.brewTime > 0;
if (flag1)
{
--this.brewTime;
boolean flag2 = this.brewTime == 0;
if (flag2 && flag)
{
this.brewPotions();
this.markDirty();
}
else if (!flag)
{
this.brewTime = 0;
this.markDirty();
}
else if (this.ingredientID != this.brewingItemStacks[3].getItem())
{
this.brewTime = 0;
this.markDirty();
}
}
else if (flag && this.fuel > 0)
{
--this.fuel;
this.brewTime = 400;
this.ingredientID = this.brewingItemStacks[3].getItem();
this.markDirty();
}
if (!this.worldObj.isRemote)
{
boolean[] aboolean = this.createFilledSlotsArray();
if (!Arrays.equals(aboolean, this.filledSlots))
{
this.filledSlots = aboolean;
IBlockState iblockstate = this.worldObj.getBlockState(this.getPos());
if (!(iblockstate.getBlock() instanceof BlockBrewingStand))
{
return;
}
for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i)
{
iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], Boolean.valueOf(aboolean[i]));
}
this.worldObj.setBlockState(this.pos, iblockstate, 2);
}
}
}