Add shouldRender() to Potions that allows to hide them completely in the inventory

This commit is contained in:
Bernhard Bonigl committed 2015-12-05 10:09:02 +01:00
1 parent 30bc2653c5
commit 2324c2fd20
3 files changed
+60 -2

No files matched your search

@@ -0,0 +1,29 @@
package net.minecraftforge.debug;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@Mod( modid = NoPotionEffectRenderTest.modID, name = "No Potion Effect Render Test", version = "0.0.0" )
public class NoPotionEffectRenderTest {
public static final String modID = "nopotioneffect";
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
TestPotion INSTANCE = new TestPotion(30, new ResourceLocation(modID, "test_potion"), false, 0xff00ff);
}
public static class TestPotion extends Potion {
public TestPotion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) {
super(potionID, location, badEffect, potionColor);
}
@Override
public boolean shouldRender(PotionEffect effect) {
return false;
}
}
}