diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java b/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java new file mode 100644 index 0000000..23489d2 --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java @@ -0,0 +1,47 @@ +package makeo.gadomancy.common.potions; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; + +import java.awt.Color; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + * + * Created by HellFirePvP @ 07.12.2015 20:31 + */ +public abstract class PotionCustomTexture extends Potion { + + private ResourceLocation texture; + + protected PotionCustomTexture(int id, boolean isBad, int color, ResourceLocation texture) { + super(id, isBad, color); + this.texture = texture; + } + + @Override + public boolean hasStatusIcon() { + return false; + } + + @Override + public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) { + Tessellator tes = Tessellator.instance; + mc.renderEngine.bindTexture(texture); + tes.startDrawingQuads(); + Color c = new Color(getLiquidColor()); + tes.setColorRGBA(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()); + tes.addVertexWithUV(x + 6, y + 7, 0, 0, 0); + tes.addVertexWithUV(x + 6, y + 7 + 18, 0, 0, 1); + tes.addVertexWithUV(x + 6 + 18, y + 7 + 18, 0, 1, 1); + tes.addVertexWithUV(x + 6 + 18, y + 7, 0, 1, 0); + tes.draw(); + } + +} diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java b/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java new file mode 100644 index 0000000..359d92d --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java @@ -0,0 +1,20 @@ +package makeo.gadomancy.common.potions; + +import thaumcraft.api.aspects.Aspect; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by HellFirePvP @ 07.12.2015 20:05 + */ +public class PotionMiningLuck extends PotionCustomTexture { + + public PotionMiningLuck(int id) { + super(id, false, Aspect.MINE.getColor(), Aspect.MINE.getImage()); + setPotionName("potion.miningluck"); + } + +} diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java index 844114e..88b6a3e 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java @@ -1,5 +1,6 @@ package makeo.gadomancy.common.registration; +import makeo.gadomancy.common.potions.PotionMiningLuck; import makeo.gadomancy.common.utils.Injector; import net.minecraft.potion.Potion; @@ -12,7 +13,11 @@ import net.minecraft.potion.Potion; * Created by makeo @ 31.10.2015 23:09 */ public class RegisteredPotions { + + public static PotionMiningLuck POTION_MINING_LUCK; + public static void init() { + POTION_MINING_LUCK = registerPotion(PotionMiningLuck.class); } private static T registerPotion(Class potionClass) { diff --git a/src/main/resources/assets/gadomancy/lang/en_US.lang b/src/main/resources/assets/gadomancy/lang/en_US.lang index 31a3854..8b9d8be 100644 --- a/src/main/resources/assets/gadomancy/lang/en_US.lang +++ b/src/main/resources/assets/gadomancy/lang/en_US.lang @@ -189,4 +189,6 @@ gadomancy.info.ArcanePackager.disguisePackage=Disguise as loot bag gadomancy.info.RemoteJar.new=Created new jar network gadomancy.info.RemoteJar.clear=Disconnected from current jar network -gadomancy.info.RemoteJar.connected=Connected to existing jar network \ No newline at end of file +gadomancy.info.RemoteJar.connected=Connected to existing jar network + +potion.miningluck=Mining Luck \ No newline at end of file