From 208e5342461aef78e4023b82bccdcff505a88bc3 Mon Sep 17 00:00:00 2001 From: bot Date: Sun, 28 Apr 2024 22:35:44 +0200 Subject: [PATCH] add rotated icon while in debug mode --- .../item/ItemConstructableTrigger.java | 20 ++++++++++++++++++ .../items/itemConstructableTriggerDebug.png | Bin 0 -> 4627 bytes 2 files changed, 20 insertions(+) create mode 100644 src/main/resources/assets/structurelib/textures/items/itemConstructableTriggerDebug.png diff --git a/src/main/java/com/gtnewhorizon/structurelib/item/ItemConstructableTrigger.java b/src/main/java/com/gtnewhorizon/structurelib/item/ItemConstructableTrigger.java index da6a738e..98505845 100644 --- a/src/main/java/com/gtnewhorizon/structurelib/item/ItemConstructableTrigger.java +++ b/src/main/java/com/gtnewhorizon/structurelib/item/ItemConstructableTrigger.java @@ -2,9 +2,13 @@ import com.gtnewhorizon.structurelib.StructureLib; import com.gtnewhorizon.structurelib.alignment.constructable.ConstructableUtility; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -15,6 +19,10 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class ItemConstructableTrigger extends Item { + + @SideOnly(Side.CLIENT) + private IIcon debugModeIcon; + public ItemConstructableTrigger() { setUnlocalizedName("structurelib.constructableTrigger"); setTextureName(MOD_ID + ":itemConstructableTrigger"); @@ -39,6 +47,18 @@ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, return ConstructableUtility.handle(stack, player, world, x, y, z, side); } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + super.registerIcons(iconRegister); + this.debugModeIcon = iconRegister.registerIcon(MOD_ID + ":itemConstructableTriggerDebug"); + } + + @Override + public IIcon getIconIndex(ItemStack itemStack) { + return itemStack.getItemDamage() == 1 ? debugModeIcon : itemIcon; + } + @SuppressWarnings("unchecked") @Override public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { diff --git a/src/main/resources/assets/structurelib/textures/items/itemConstructableTriggerDebug.png b/src/main/resources/assets/structurelib/textures/items/itemConstructableTriggerDebug.png new file mode 100644 index 0000000000000000000000000000000000000000..ae53cc72056340a231404fdd7b09db6e7dd357a4 GIT binary patch literal 4627 zcmeHLdsGzH8J{Jhuoi0-qo@tzY6GIPGduepS$XX8Si>rh6$rJ7voo_WmEBopXW0dg z53r4*ts2vZ5YuR^#Tp++PHV!$gEkncMzQ8-)QF`R6PsA!)V9GVy)(PKjyb1?bDIB{ zJ$LV&@BZ%ZyZ3j$`>~hW?By9z^4W3-f}*UMmRwLz6-&fK@Ev=9fP^4fG*f7GTCE9C z1h7p8h6#`?gp-YEhsmCUo&)xspiGg4LDN9J3zTWVF5<;9TNW&a54HNsc%Y4foEpRBdnZL!TU6SU+P~ zSiSqrYr?XQnfX8MTa>!F`b@lHrz6Ju&aUd-{^pDghy9Viy1o8hr)tmhNO(jWS*9vwga{b;U=EW>|l)H10Rp-)q{pXZ_l=j#^b-N7c2~ox3poetT-urrR&%C;Tow z(Kfe0`_@03TF)fhLOv`yyjQsQ=T~MSUoJYA)evKzy|u6=LWa*i@Xo|Jkww1T#Wb6A z`&Mk(6GaovuiU$XlKDz@tV+5X`}p3K1e>kW`j_a7U-uYdspP=S68-nTcyzVwdR%f} z%=?#Go>orY^<=?`YnOX6PIl`&WnGs)Gj;QmX05{)TIroMc? z@~gYI{w3?kDX5#%-92>{n)jdP&Xz}2Rgb>TYG{kCF69s1H2mRp5XJ%4UMLjWvIvTE zDM^}hFv@_-Bkf{hQout}YZw7`FvYCfr08vFQ@|{3QWR)yn9XBmO4!Uwp2@3RZl@~O zP)1sjv{arLAOL}j5lA@TDs_8_fJq_o5}+-bQ3WhPgf%8bAqX}z$1|`-sZnA`T7WIb z6-(uCB2PPsTuXY00=$_NC4%4~P}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