mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-28 15:56:02 +00:00
58 lines
2.1 KiB
Diff
58 lines
2.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/potion/Potion.java
|
|
+++ ../src-work/minecraft/net/minecraft/potion/Potion.java
|
|
@@ -23,7 +23,7 @@
|
|
|
|
public class Potion
|
|
{
|
|
- public static final RegistryNamespaced<ResourceLocation, Potion> field_188414_b = new RegistryNamespaced();
|
|
+ public static final RegistryNamespaced<ResourceLocation, Potion> field_188414_b = net.minecraftforge.fml.common.registry.GameData.getPotionRegistry();
|
|
private final Map<IAttribute, AttributeModifier> attributeModifierMap = Maps.<IAttribute, AttributeModifier>newHashMap();
|
|
private final boolean isBadEffect;
|
|
private final int liquidColor;
|
|
@@ -195,7 +195,6 @@
|
|
return this.statusIconIndex;
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public boolean isBadEffect()
|
|
{
|
|
return this.isBadEffect;
|
|
@@ -266,7 +265,37 @@
|
|
return modifier.getAmount() * (double)(p_111183_1_ + 1);
|
|
}
|
|
|
|
+ /* ======================================== FORGE START =====================================*/
|
|
+
|
|
+ /**
|
|
+ * If the Potion effect should be displayed in the players inventory
|
|
+ * @param effect the active PotionEffect
|
|
+ * @return true to display it (default), false to hide it.
|
|
+ */
|
|
+ public boolean shouldRender(PotionEffect effect) { return true; }
|
|
+
|
|
+ /**
|
|
+ * If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
|
|
+ * @param effect the active PotionEffect
|
|
+ * @return true to draw the standard text
|
|
+ */
|
|
+ public boolean shouldRenderInvText(PotionEffect effect)
|
|
+ {
|
|
+ return true;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Called to draw the this Potion onto the player's inventory when it's active.
|
|
+ * This can be used to e.g. render Potion icons from your own texture.
|
|
+ * @param x the x coordinate
|
|
+ * @param y the y coordinate
|
|
+ * @param effect the active PotionEffect
|
|
+ * @param mc the Minecraft instance, for convenience
|
|
+ */
|
|
@SideOnly(Side.CLIENT)
|
|
+ public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { }
|
|
+
|
|
+ @SideOnly(Side.CLIENT)
|
|
public boolean func_188408_i()
|
|
{
|
|
return this.field_188415_h;
|