diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
4 files changed, 145 insertions, 50 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java new file mode 100644 index 0000000000..1b3af3a842 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -0,0 +1,59 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public final class TexturesGtTools { + + public final static CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER"); + + + + + + + + + + + + + public final static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; + protected final String mIconName; + + public CustomIcon(final String aIconName) { + mIconName = aIconName; + Utils.LOG_INFO("Constructing a Custom Texture. " + mIconName); + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public IIcon getIcon() { + return mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return mOverlay; + } + + @Override + public void run() { + mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + mIconName); + //Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g); + mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + mIconName + "_OVERLAY"); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index b63ea674ad..55eb19f80f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -4,37 +4,28 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.ToolDictNames; import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher; public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { - - public static final short TURBINE_SMALL = 10; - public static final short TURBINE = 12; - public static final short TURBINE_LARGE = 14; - public static final short HUGE_ITEM = 16; - public static final short TURBINE_BLADE = 18; - - public static final short HARDHAMMER = 20; - public static final short SOFTHAMMER = 22; - public static final short WRENCH = 24; - - public static GT_MetaGenerated_Tool_01 INSTANCE; - public MetaGeneratedGregtechTools() { - super("GT++_metatool"); - INSTANCE = GT_MetaGenerated_Tool_01.INSTANCE; - - GregTech_API.registerTool(addTool(7734, "Skookum Choocher", "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(), new Object[]{GregtechToolDictNames.craftingToolSkookumChoocher, ToolDictNames.craftingToolHardHammer, ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), GregTech_API.sWrenchList); - - - //GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", (Interface_ToolStats) new GT_Tool_Wrench(), new Object[]{ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), GregTech_API.sWrenchList); - - //addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small(), new Object[]{}); - //addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal(), new Object[]{}); - //addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large(), new Object[]{}); - //addTool(HUGE_ITEM, "Huge Item", "Item 4 for your power station", new TOOL_Gregtech_MaxEfficiencyMultiBlockItem(), new Object[]{}); + public static final short SKOOKUM_CHOOCHER = 7734; + public static MetaGeneratedGregtechTools INSTANCE; - } + public MetaGeneratedGregtechTools() { + super("++.metatool.01"); + INSTANCE = this; + GregTech_API.registerTool( + addTool( + SKOOKUM_CHOOCHER, "Skookum Choocher", + "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", + new TOOL_Gregtech_Choocher(), + new Object[]{GregtechToolDictNames.craftingToolSkookumChoocher, + ToolDictNames.craftingToolHardHammer, + ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), + GregTech_API.sWrenchList); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java new file mode 100644 index 0000000000..93bf8f4a65 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java @@ -0,0 +1,61 @@ +package gtPlusPlus.xmod.gregtech.common.items.behaviours; + +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.items.behaviors.Behaviour_None; +import gregtech.common.items.behaviors.Behaviour_Prospecting; +import gregtech.common.items.behaviors.Behaviour_Wrench; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class Behaviour_Choocher + extends Behaviour_None { + private final Behaviour_Wrench wrench = new Behaviour_Wrench(150); + private final Behaviour_Prospecting prospecting = new Behaviour_Prospecting(1, 1250); + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.choochering", "Wrench by default, Hold shift & Right click to prospect."); + + public Behaviour_Choocher() { + + } + + @Override + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + if (aWorld.isRemote) { + return false; + } + if (!aPlayer.isSneaking()){ + //Utils.LOG_INFO("Using Choocher as a wrench."); + wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ); + return false; + } + //Utils.LOG_INFO("Using Choocher as a hard hammer."); + prospecting.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + + return false; + } + + /*@Override + public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + if (aWorld.isRemote) { + return false; + } + if (!aPlayer.isSneaking()){ + Utils.LOG_INFO("Using Choocher as a wrench."); + wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ); + return false; + } + Utils.LOG_INFO("Using Choocher as a hard hammer."); + prospecting.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + + return false; + }*/ + + public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { + aList.add(this.mTooltip); + return aList; + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java index ce652bdda8..d2338c264e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -6,10 +6,8 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_Prospecting; -import gregtech.common.items.behaviors.Behaviour_Wrench; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; +import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher; import java.util.Arrays; import java.util.List; @@ -83,12 +81,12 @@ public class TOOL_Gregtech_Choocher @Override public String getCraftingSound() { - return null; + return (String) GregTech_API.sSoundList.get(Integer.valueOf(1)); } @Override public String getEntityHitSound() { - return null; + return (String) GregTech_API.sSoundList.get(Integer.valueOf(2)); } @Override @@ -163,29 +161,15 @@ public class TOOL_Gregtech_Choocher return TexturesGtTools.SKOOKUM_CHOOCHER; } - /* @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? Textures.ItemIcons.WIRE_CUTTER : Textures.ItemIcons.VOID; - }*/ - - -/* @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead ? Textures.class..ItemIcons.SKOOKUMCHOOCHER : null; - } -*/ - // - @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa; } - @Override + /*@Override public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) { - aItem.addItemBehavior(aID, new Behaviour_Wrench(150)); - aItem.addItemBehavior(aID, new Behaviour_Prospecting(1, 1250)); - } + aItem.addItemBehavior(aID, new Behaviour_Choocher()); + }*/ @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { @@ -205,7 +189,7 @@ public class TOOL_Gregtech_Choocher @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { - + aItem.addItemBehavior(aID, new Behaviour_Choocher()); } @Override |