本文整理汇总了Java中net.minecraft.init.PotionTypes.WATER属性的典型用法代码示例。如果您正苦于以下问题:Java PotionTypes.WATER属性的具体用法?Java PotionTypes.WATER怎么用?Java PotionTypes.WATER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.PotionTypes
的用法示例。
在下文中一共展示了PotionTypes.WATER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_190901_a
public ItemStack func_190901_a(EntityPlayer p_190901_1_, ItemStack p_190901_2_)
{
PotionType potiontype = PotionUtils.getPotionFromItem(p_190901_2_);
if (potiontype != PotionTypes.WATER && potiontype != PotionTypes.EMPTY)
{
this.player.addStat(AchievementList.POTION);
}
super.func_190901_a(p_190901_1_, p_190901_2_);
return p_190901_2_;
}
示例2: onPickupFromSlot
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
{
if (PotionUtils.getPotionFromItem(stack) != PotionTypes.WATER)
{
net.minecraftforge.event.ForgeEventFactory.onPlayerBrewedPotion(playerIn, stack);
this.player.addStat(AchievementList.POTION);
}
super.onPickupFromSlot(playerIn, stack);
}
示例3: getNewPotions
private List<ItemStack> getNewPotions(ArrayList<ItemStack> knownPotions, ArrayList<ItemStack> potionIngredients, ArrayList<DrawableRecipe> recipes) {
List<ItemStack> newPotions = new ArrayList<ItemStack>();
for (ItemStack potionInput : knownPotions) {
for (ItemStack potionIngredient : potionIngredients) {
ItemStack potionOutput = PotionHelper.doReaction(potionIngredient, potionInput.copy());
if (potionOutput == null) {
continue;
}
if (potionInput.getItem() == potionOutput.getItem()) {
PotionType potionOutputType = PotionUtils.getPotionFromItem(potionOutput);
if (potionOutputType == PotionTypes.WATER)
{
continue;
}
PotionType potionInputType = PotionUtils.getPotionFromItem(potionInput);
int inputId = PotionType.REGISTRY.getIDForObject(potionInputType);
int outputId = PotionType.REGISTRY.getIDForObject(potionOutputType);
if (inputId == outputId)
{
continue;
}
}
DrawableRecipeBrewing recipe = new DrawableRecipeBrewing(potionInput, potionIngredient, potionOutput);
if (!containsRecipe(recipe, recipes)) {
recipes.add(recipe);
newPotions.add(potionOutput);
}
}
}
return newPotions;
}
示例4: onPickupFromSlot
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
{
if (PotionUtils.getPotionFromItem(stack) != PotionTypes.WATER)
{
this.player.addStat(AchievementList.POTION);
}
super.onPickupFromSlot(playerIn, stack);
}
示例5: onImpact
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(RayTraceResult result)
{
if (!this.world.isRemote)
{
ItemStack itemstack = this.getPotion();
PotionType potiontype = PotionUtils.getPotionFromItem(itemstack);
List<PotionEffect> list = PotionUtils.getEffectsFromStack(itemstack);
boolean flag = potiontype == PotionTypes.WATER && list.isEmpty();
if (result.typeOfHit == RayTraceResult.Type.BLOCK && flag)
{
BlockPos blockpos = result.getBlockPos().offset(result.sideHit);
this.extinguishFires(blockpos);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
{
this.extinguishFires(blockpos.offset(enumfacing));
}
}
if (flag)
{
this.func_190545_n();
}
else if (!list.isEmpty())
{
if (this.isLingering())
{
this.func_190542_a(itemstack, potiontype);
}
else
{
this.func_190543_a(result, list);
}
}
int i = potiontype.hasInstantEffect() ? 2007 : 2002;
this.world.playEvent(i, new BlockPos(this), PotionUtils.func_190932_c(itemstack));
this.setDead();
}
}
示例6: getPotionTypeFromNBT
/**
* If no correct potion is found, returns the default one : PotionTypes.water
*/
public static PotionType getPotionTypeFromNBT(@Nullable NBTTagCompound tag)
{
return tag == null ? PotionTypes.WATER : PotionType.getPotionTypeForName(tag.getString("Potion"));
}