本文整理汇总了Java中net.minecraft.init.Items.SPLASH_POTION属性的典型用法代码示例。如果您正苦于以下问题:Java Items.SPLASH_POTION属性的具体用法?Java Items.SPLASH_POTION怎么用?Java Items.SPLASH_POTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.SPLASH_POTION属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPotion
public ItemStack getPotion()
{
ItemStack itemstack = (ItemStack)this.getDataManager().get(ITEM);
if (itemstack.getItem() != Items.SPLASH_POTION && itemstack.getItem() != Items.LINGERING_POTION)
{
if (this.world != null)
{
LOGGER.error("ThrownPotion entity {} has no item?!", new Object[] {Integer.valueOf(this.getEntityId())});
}
return new ItemStack(Items.SPLASH_POTION);
}
else
{
return itemstack;
}
}
示例2: canCombineItems
private boolean canCombineItems(ItemStack stackA, ItemStack stackB)
{
if (ItemStack.areItemsEqual(stackA, stackB)) return true;
if (stackA.getItem() == Items.POTIONITEM && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 0) return true;
if (stackA.getItem() == Items.SPLASH_POTION && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 1) return true;
if (stackA.getItem() == Items.LINGERING_POTION && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 2) return true;
if (stackB.getItem() == Items.POTIONITEM && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 0) return true;
if (stackB.getItem() == Items.SPLASH_POTION && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 1) return true;
if (stackB.getItem() == Items.LINGERING_POTION && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 2) return true;
if (stackA.getItem() == Items.TIPPED_ARROW && stackB.getItem() == Item.getByNameOrId("potioncore:custom_arrow")) return true;
if (stackB.getItem() == Items.TIPPED_ARROW && stackA.getItem() == Item.getByNameOrId("potioncore:custom_arrow")) return true;
return false;
}
示例3: getOutputStack
private ItemStack getOutputStack(ItemStack inputStack)
{
Item item = inputStack.getItem();
if (item == Items.POTIONITEM || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 0))
{
return new ItemStack(Items.POTIONITEM, 1, 0);
}
else if (item == Items.SPLASH_POTION || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 1))
{
return new ItemStack(Items.SPLASH_POTION, 1, 0);
}
else if (item == Items.LINGERING_POTION || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 2))
{
return new ItemStack(Items.LINGERING_POTION, 1, 0);
}
else if (item == Items.TIPPED_ARROW || item == Item.getByNameOrId("potioncore:custom_arrow"))
{
return new ItemStack(Items.TIPPED_ARROW, 1, 0);
}
else return ItemStack.EMPTY;
}
示例4: getPotion
public ItemStack getPotion()
{
ItemStack itemstack = (ItemStack)((Optional)this.getDataManager().get(ITEM)).orNull();
if (itemstack == null || itemstack.getItem() != Items.SPLASH_POTION && itemstack.getItem() != Items.LINGERING_POTION)
{
if (this.worldObj != null)
{
LOGGER.error("ThrownPotion entity {} has no item?!", new Object[] {Integer.valueOf(this.getEntityId())});
}
return new ItemStack(Items.SPLASH_POTION);
}
else
{
return itemstack;
}
}
示例5: getPotionDamage
private static int getPotionDamage(ItemStack p_getPotionDamage_0_)
{
NBTTagCompound nbttagcompound = p_getPotionDamage_0_.getTagCompound();
if (nbttagcompound == null)
{
return 0;
}
else
{
String s = nbttagcompound.getString("Potion");
if (s == null)
{
return 0;
}
else
{
Integer integer = (Integer)mapPotionDamages.get(s);
if (integer == null)
{
return -1;
}
else
{
int i = integer.intValue();
if (p_getPotionDamage_0_.getItem() == Items.SPLASH_POTION)
{
i |= 16384;
}
return i;
}
}
}
}
示例6: 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;
}
}
示例7: matches
@Override
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack tempStack = ItemStack.EMPTY;
int potionEffects = 0;
for (int i = 0; i < inv.getSizeInventory(); i++)
{
ItemStack stack = inv.getStackInSlot(i);
if (!stack.isEmpty())
{
Item item = stack.getItem();
if (item != Items.TIPPED_ARROW && item != Items.POTIONITEM && item != Items.SPLASH_POTION && item != Items.LINGERING_POTION) return false;
if (tempStack.isEmpty())
{
tempStack = stack.copy();
}
else
{
if (!ItemStack.areItemsEqual(tempStack, stack)) return false;
}
if (ModConfiguration.maxPotionEffects >= 0)
{
potionEffects += PotionUtils.getEffectsFromStack(stack).size();
if (potionEffects > ModConfiguration.maxPotionEffects) return false;
}
}
}
return true;
}
示例8: isInput
/**
* Code adapted from TileEntityBrewingStand.isItemValidForSlot(int index, ItemStack stack)
*/
@Override
public boolean isInput(ItemStack stack)
{
Item item = stack.getItem();
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
}
示例9: isSplashPotion
public static boolean isSplashPotion(ItemStack stack)
{
return stack.getItem() == Items.SPLASH_POTION;
}
示例10: createSplashPotion
public static ItemStack createSplashPotion()
{
return new ItemStack(Items.SPLASH_POTION);
}
示例11: canHoldPotion
public static boolean canHoldPotion(ItemStack stack)
{
Item item = stack.getItem();
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
}
示例12: getModelTextures
private String[] getModelTextures()
{
if (this.type == 1 && this.items.length == 1)
{
Item item = Item.getItemById(this.items[0]);
boolean flag = item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION;
if (flag && this.damage != null && this.damage.getCountRanges() > 0)
{
RangeInt rangeint = this.damage.getRange(0);
int i = rangeint.getMin();
boolean flag1 = (i & 16384) != 0;
String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay");
String s6 = null;
if (flag1)
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash");
}
else
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable");
}
return new String[] {s5, s6};
}
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER)
{
String s = "leather";
String s1 = "helmet";
if (itemarmor.armorType == EntityEquipmentSlot.HEAD)
{
s1 = "helmet";
}
if (itemarmor.armorType == EntityEquipmentSlot.CHEST)
{
s1 = "chestplate";
}
if (itemarmor.armorType == EntityEquipmentSlot.LEGS)
{
s1 = "leggings";
}
if (itemarmor.armorType == EntityEquipmentSlot.FEET)
{
s1 = "boots";
}
String s2 = s + "_" + s1;
String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2);
String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay");
return new String[] {s3, s4};
}
}
}
return new String[] {this.texture};
}