当前位置: 首页>>代码示例>>Java>>正文


Java Potion.getIdFromPotion方法代码示例

本文整理汇总了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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:CustomColors.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:CustomColors.java

示例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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:CustomItems.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:TileEntityBeacon.java

示例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);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:SPacketEntityEffect.java

示例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_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:CustomColors.java

示例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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:TileEntityBeacon.java

示例8: getIdFromEffect

import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public static int getIdFromEffect(PotionEffect effect)
{
	return Potion.getIdFromPotion(effect.getPotion());
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12-OF,代码行数:5,代码来源:WPotion.java

示例9: getIdFromResourceLocation

import net.minecraft.potion.Potion; //导入方法依赖的package包/类
public static int getIdFromResourceLocation(String location)
{
	return Potion
		.getIdFromPotion(Potion.getPotionFromResourceLocation(location));
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12-OF,代码行数:6,代码来源:WPotion.java

示例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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:46,代码来源:GuiBeacon.java

示例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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:46,代码来源:GuiBeacon.java


注:本文中的net.minecraft.potion.Potion.getIdFromPotion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。