本文整理汇总了Java中net.minecraft.potion.Potion.getIdFromPotion方法的典型用法代码示例。如果您正苦于以下问题:Java Potion.getIdFromPotion方法的具体用法?Java Potion.getIdFromPotion怎么用?Java Potion.getIdFromPotion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.potion.Potion
的用法示例。
在下文中一共展示了Potion.getIdFromPotion方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMaxPotionId
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
private static int getMaxPotionId()
{
int i = 0;
for (ResourceLocation resourcelocation : Potion.REGISTRY.getKeys())
{
Potion potion = (Potion)Potion.REGISTRY.getObject(resourcelocation);
int j = Potion.getIdFromPotion(potion);
if (j > i)
{
i = j;
}
}
return i;
}
示例2: getPotionId
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
private static int getPotionId(String p_getPotionId_0_)
{
if (p_getPotionId_0_.equals("potion.water"))
{
return 0;
}
else
{
p_getPotionId_0_ = StrUtils.replacePrefix(p_getPotionId_0_, "potion.", "effect.");
for (ResourceLocation resourcelocation : Potion.REGISTRY.getKeys())
{
Potion potion = (Potion)Potion.REGISTRY.getObject(resourcelocation);
if (potion.getName().equals(p_getPotionId_0_))
{
return Potion.getIdFromPotion(potion);
}
}
return -1;
}
}
示例3: getPotionNameDamage
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
private static int getPotionNameDamage(String p_getPotionNameDamage_0_)
{
String s = "effect." + p_getPotionNameDamage_0_;
for (ResourceLocation resourcelocation : Potion.REGISTRY.getKeys())
{
Potion potion = (Potion)Potion.REGISTRY.getObject(resourcelocation);
String s1 = potion.getName();
if (s.equals(s1))
{
return Potion.getIdFromPotion(potion);
}
}
return -1;
}
示例4: getField
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public int getField(int id)
{
switch (id)
{
case 0:
return this.levels;
case 1:
return Potion.getIdFromPotion(this.primaryEffect);
case 2:
return Potion.getIdFromPotion(this.secondaryEffect);
default:
return 0;
}
}
示例5: SPacketEntityEffect
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public SPacketEntityEffect(int entityIdIn, PotionEffect effect)
{
this.entityId = entityIdIn;
this.effectId = (byte)(Potion.getIdFromPotion(effect.getPotion()) & 255);
this.amplifier = (byte)(effect.getAmplifier() & 255);
if (effect.getDuration() > 32767)
{
this.duration = 32767;
}
else
{
this.duration = effect.getDuration();
}
this.flags = 0;
if (effect.getIsAmbient())
{
this.flags = (byte)(this.flags | 1);
}
if (effect.doesShowParticles())
{
this.flags = (byte)(this.flags | 2);
}
}
示例6: getPotionColor
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public static int getPotionColor(Potion p_getPotionColor_0_, int p_getPotionColor_1_)
{
int i = 0;
if (p_getPotionColor_0_ != null)
{
i = Potion.getIdFromPotion(p_getPotionColor_0_);
}
return getPotionColor(i, p_getPotionColor_1_);
}
示例7: getField
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public int getField(int id)
{
switch (id)
{
case 0:
return this.levels;
case 1:
return Potion.getIdFromPotion(this.primaryEffect);
case 2:
return Potion.getIdFromPotion(this.secondaryEffect);
default:
return 0;
}
}
示例8: getIdFromEffect
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public static int getIdFromEffect(PotionEffect effect)
{
return Potion.getIdFromPotion(effect.getPotion());
}
示例9: getIdFromResourceLocation
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public static int getIdFromResourceLocation(String location)
{
return Potion
.getIdFromPotion(Potion.getPotionFromResourceLocation(location));
}
示例10: actionPerformed
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) throws IOException
{
if (button.id == -2)
{
this.mc.player.connection.sendPacket(new CPacketCloseWindow(this.mc.player.openContainer.windowId));
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == -1)
{
String s = "MC|Beacon";
PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
packetbuffer.writeInt(this.tileBeacon.getField(1));
packetbuffer.writeInt(this.tileBeacon.getField(2));
this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|Beacon", packetbuffer));
this.mc.player.connection.sendPacket(new CPacketCloseWindow(this.mc.player.openContainer.windowId));
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button instanceof GuiBeacon.PowerButton)
{
GuiBeacon.PowerButton guibeacon$powerbutton = (GuiBeacon.PowerButton)button;
if (guibeacon$powerbutton.isSelected())
{
return;
}
int i = Potion.getIdFromPotion(guibeacon$powerbutton.effect);
if (guibeacon$powerbutton.tier < 3)
{
this.tileBeacon.setField(1, i);
}
else
{
this.tileBeacon.setField(2, i);
}
this.buttonList.clear();
this.initGui();
this.updateScreen();
}
}
示例11: actionPerformed
import net.minecraft.potion.Potion; //导入方法依赖的package包/类
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) throws IOException
{
if (button.id == -2)
{
this.mc.thePlayer.connection.sendPacket(new CPacketCloseWindow(this.mc.thePlayer.openContainer.windowId));
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == -1)
{
String s = "MC|Beacon";
PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
packetbuffer.writeInt(this.tileBeacon.getField(1));
packetbuffer.writeInt(this.tileBeacon.getField(2));
this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|Beacon", packetbuffer));
this.mc.thePlayer.connection.sendPacket(new CPacketCloseWindow(this.mc.thePlayer.openContainer.windowId));
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button instanceof GuiBeacon.PowerButton)
{
GuiBeacon.PowerButton guibeacon$powerbutton = (GuiBeacon.PowerButton)button;
if (guibeacon$powerbutton.isSelected())
{
return;
}
int i = Potion.getIdFromPotion(guibeacon$powerbutton.effect);
if (guibeacon$powerbutton.tier < 3)
{
this.tileBeacon.setField(1, i);
}
else
{
this.tileBeacon.setField(2, i);
}
this.buttonList.clear();
this.initGui();
this.updateScreen();
}
}