diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-19 19:29:29 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-19 19:29:29 +1000 |
commit | bcfabba1cf48fff83ab49c08399699669717412c (patch) | |
tree | 7d2947f86c0f71cef92de7ffe093348e8035fc76 /src/Java/miscutil/core/xmod | |
parent | 55ee2b01e25c7f7f6c4c893e18572150266ebd03 (diff) | |
download | GT5-Unofficial-bcfabba1cf48fff83ab49c08399699669717412c.tar.gz GT5-Unofficial-bcfabba1cf48fff83ab49c08399699669717412c.tar.bz2 GT5-Unofficial-bcfabba1cf48fff83ab49c08399699669717412c.zip |
> Attempted to implement a new GT-esque tool, the Skookum Choocher.
> Texture issues everywhere, but it's related to another issue from long ago.
> Think fixing one will fix the other.
Diffstat (limited to 'src/Java/miscutil/core/xmod')
17 files changed, 722 insertions, 61 deletions
diff --git a/src/Java/miscutil/core/xmod/gregtech/HANDLER_GT.java b/src/Java/miscutil/core/xmod/gregtech/HANDLER_GT.java index 7e027636fc..be30c8e9b7 100644 --- a/src/Java/miscutil/core/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/miscutil/core/xmod/gregtech/HANDLER_GT.java @@ -3,6 +3,7 @@ package miscutil.core.xmod.gregtech; import gregtech.api.util.GT_Config; import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import miscutil.core.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; +import miscutil.core.xmod.gregtech.common.items.MetaGeneratedGregtechTools; public class HANDLER_GT { @@ -12,6 +13,7 @@ public class HANDLER_GT { if (mMaterialProperties != null){ GT_Materials.init(mMaterialProperties); GregtechFluidHandler.run(); + new MetaGeneratedGregtechTools(); //new Processing_Ingot1(); //new Processing_Plate1(); //new Processing_Block(); diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 29621f7a23..67a3ff4332 100644 --- a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -67,6 +67,10 @@ public enum GregtechOrePrefixes { gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam + + toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + + batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java index 5f2f8b5236..c5473ea958 100644 --- a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java +++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java @@ -13,7 +13,7 @@ public class GregtechTextureSet { public GregtechTextureSet(String aSetName) { mSetName = aSetName; mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/turbineBlade"); - mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void"); + mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/toolHeadSkookumChoocher"); mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void"); mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void"); mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void"); diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java index eaa76c36e7..c927fea1a3 100644 --- a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java +++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java @@ -1,18 +1,18 @@ package miscutil.core.xmod.gregtech.api.enums; -import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK; import gregtech.api.GregTech_API; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_RenderedTexture; import miscutil.core.lib.CORE; +import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_IconContainer; +import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_Texture; +import miscutil.core.xmod.gregtech.api.objects.GregtechRenderedTexture; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; public class GregtechTextures { - public enum BlockIcons implements IIconContainer, Runnable { + public enum BlockIcons implements Interface_IconContainer, Runnable { + VOID, LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3, LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6, @@ -21,9 +21,9 @@ public class GregtechTextures { LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6, LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9; - public static final IIconContainer[] + public static final Interface_IconContainer[] - CENTRIFUGE = new IIconContainer[]{ + CENTRIFUGE = new Interface_IconContainer[]{ LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3, @@ -34,7 +34,7 @@ public class GregtechTextures { LARGECENTRIFUGE8, LARGECENTRIFUGE9 }, - CENTRIFUGE_ACTIVE = new IIconContainer[]{ + CENTRIFUGE_ACTIVE = new Interface_IconContainer[]{ LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3, @@ -46,8 +46,8 @@ public class GregtechTextures { LARGECENTRIFUGE_ACTIVE9 }; - public static ITexture[] - GT_CASING_BLOCKS = new ITexture[64]; + public static Interface_Texture[] + GT_CASING_BLOCKS = new Interface_Texture[64]; protected IIcon mIcon; @@ -67,7 +67,7 @@ public class GregtechTextures { @Override public void run() { - mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this); + mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this); } @Override @@ -75,7 +75,7 @@ public class GregtechTextures { return TextureMap.locationBlocksTexture; } - public static class CustomIcon implements IIconContainer, Runnable { + public static class CustomIcon implements Interface_IconContainer, Runnable { protected IIcon mIcon; protected String mIconName; @@ -96,7 +96,7 @@ public class GregtechTextures { @Override public void run() { - mIcon = CORE.GT_BlockIcons.registerIcon(CORE.RES_PATH_BLOCK + mIconName); + mIcon = CORE.GT_BlockIcons.registerIcon(CORE.MODID + ":" + mIconName); } @Override @@ -107,11 +107,35 @@ public class GregtechTextures { } - public enum ItemIcons implements IIconContainer, Runnable { - VOID, RENDERING_ERROR, // The Empty Texture - TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE; - - public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)}; + public enum ItemIcons implements Interface_IconContainer, Runnable { + VOID // The Empty Texture + , RENDERING_ERROR, SKOOKUMCHOOCHER, DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE; + + public static final Interface_IconContainer[] + DURABILITY_BAR = new Interface_IconContainer[]{ + DURABILITY_BAR_0, + DURABILITY_BAR_1, + DURABILITY_BAR_2, + DURABILITY_BAR_3, + DURABILITY_BAR_4, + DURABILITY_BAR_5, + DURABILITY_BAR_6, + DURABILITY_BAR_7, + DURABILITY_BAR_8, + }, + ENERGY_BAR = new Interface_IconContainer[]{ + ENERGY_BAR_0, + ENERGY_BAR_1, + ENERGY_BAR_2, + ENERGY_BAR_3, + ENERGY_BAR_4, + ENERGY_BAR_5, + ENERGY_BAR_6, + ENERGY_BAR_7, + ENERGY_BAR_8, + }; + + public static final Interface_Texture[] ERROR_RENDERING = new Interface_Texture[]{new GregtechRenderedTexture(RENDERING_ERROR)}; protected IIcon mIcon, mOverlay; @@ -136,35 +160,11 @@ public class GregtechTextures { @Override public void run() { - mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + "iconsets/" + this); - if (mIcon != null){ - //Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this); - } - else if (mIcon == null){ - mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this); - if (mIcon != null){ - //Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this); - } - else { - //Utils.LOG_INFO("Did not find Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this); - } - } - mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + "iconsets/" + this + "_OVERLAY"); - if (mOverlay != null){ - //Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this+ "_OVERLAY"); - } - else if (mOverlay == null){ - mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY"); - if (mOverlay != null){ - //Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY"); - } - else { - //Utils.LOG_INFO("Did not find Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY"); - } - } + mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this); + mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this + "_OVERLAY"); } - public static class CustomIcon implements IIconContainer, Runnable { + public static class CustomIcon implements Interface_IconContainer, Runnable { protected IIcon mIcon, mOverlay; protected String mIconName; @@ -185,8 +185,8 @@ public class GregtechTextures { @Override public void run() { - mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + mIconName); - mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + mIconName + "_OVERLAY"); + mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+ ":" + mIconName); + mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+ ":" + mIconName + "_OVERLAY"); } @Override diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechToolDictNames.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechToolDictNames.java new file mode 100644 index 0000000000..25831f9a48 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechToolDictNames.java @@ -0,0 +1,7 @@ +package miscutil.core.xmod.gregtech.api.enums; + +public enum GregtechToolDictNames { + + craftingToolSkookumChoocher; + +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java new file mode 100644 index 0000000000..4609a981dc --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java @@ -0,0 +1,21 @@ +package miscutil.core.xmod.gregtech.api.interfaces.internal; + +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public interface Interface_IconContainer { + /** + * @return A regular Icon. + */ + public IIcon getIcon(); + + /** + * @return Icon of the Overlay (or null if there is no Icon) + */ + public IIcon getOverlayIcon(); + + /** + * @return the Default Texture File for this Icon. + */ + public ResourceLocation getTextureFile(); +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_Texture.java new file mode 100644 index 0000000000..5e70e9b2b2 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_Texture.java @@ -0,0 +1,20 @@ +package miscutil.core.xmod.gregtech.api.interfaces.internal; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +public interface Interface_Texture { + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public boolean isValidTexture(); +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java index ff3952ba96..e2a7c4b5cf 100644 --- a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java +++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java @@ -152,4 +152,9 @@ public interface Interface_ToolStats { public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); + + /** + * Called when this gets added to a Tool Item + */ + //public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); }
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_Base.java b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_Base.java new file mode 100644 index 0000000000..e0899d22c0 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_Base.java @@ -0,0 +1,84 @@ +package miscutil.core.xmod.gregtech.api.items.types; + +import gregtech.api.enums.SubTag; + +import java.util.List; + +import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; +import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaItem_Base; +import net.minecraft.block.BlockDispenser; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> { + @Override + public boolean onLeftClickEntity(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { + return false; + } + + @Override + public boolean onItemUse(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + return false; + } + + @Override + public boolean onItemUseFirst(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + return false; + } + + @Override + public ItemStack onItemRightClick(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + return aStack; + } + + @Override + public List<String> getAdditionalToolTips(Gregtech_MetaItem_Base aItem, List<String> aList, ItemStack aStack) { + return aList; + } + + @Override + public void onUpdate(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + } + + @Override + public boolean isItemStackUsable(Gregtech_MetaItem_Base aItem, ItemStack aStack) { + return true; + } + + @Override + public boolean canDispense(Gregtech_MetaItem_Base aItem, IBlockSource aSource, ItemStack aStack) { + return false; + } + + @Override + public ItemStack onDispense(Gregtech_MetaItem_Base aItem, IBlockSource aSource, ItemStack aStack) { + EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); + IPosition iposition = BlockDispenser.func_149939_a(aSource); + ItemStack itemstack1 = aStack.splitStack(1); + BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition); + return aStack; + } + + @Override + public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack) { + return false; + } + + @Override + public EntityArrow getProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + return null; + } + + @Override + public EntityArrow getProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + return null; + } +} diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_HardHammer.java b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_HardHammer.java new file mode 100644 index 0000000000..ff9ef0a208 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_HardHammer.java @@ -0,0 +1,127 @@ +package miscutil.core.xmod.gregtech.api.items.types; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores; +import gregtech.common.blocks.GT_TileEntity_Ores; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidBlock; + +public class ToolType_HardHammer + extends ToolType_Base { + private final int mVanillaCosts; + private final int mEUCosts; + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); + + public ToolType_HardHammer(int aVanillaCosts, int aEUCosts) { + this.mVanillaCosts = aVanillaCosts; + this.mEUCosts = aEUCosts; + } + + 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; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) { + return false; + } + byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); + + + ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + return true; + } + if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) { + if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + int tX = aX; + int tY = aY; + int tZ = aZ; + int tMetaID = 0; + int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0; + + int i = 0; + for (int j = 6 + tQuality; i < j; i++) { + tX -= ForgeDirection.getOrientation(aSide).offsetX; + tY -= ForgeDirection.getOrientation(aSide).offsetY; + tZ -= ForgeDirection.getOrientation(aSide).offsetZ; + + Block tBlock = aWorld.getBlock(tX, tY, tZ); + if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) { + GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock."); + break; + } + if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) { + GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock."); + break; + } + if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) { + GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock."); + break; + } + if (tBlock != aBlock) { + if (i >= 4) { + break; + } + GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock."); + break; + } + } + Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide); + i = 0; + for (int j = 9 + 2 * tQuality; i < j; i++) { + tX = aX - 4 - tQuality + tRandom.nextInt(j); + tY = aY - 4 - tQuality + tRandom.nextInt(j); + tZ = aZ - 4 - tQuality + tRandom.nextInt(j); + Block tBlock = aWorld.getBlock(tX, tY, tZ); + if ((tBlock instanceof GT_Block_Ores)) { + TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)]; + if ((tMaterial != null) && (tMaterial != Materials._NULL)) { + GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); + return true; + } + } + } else { + tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); + tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + return true; + } + } + } + GT_Utility.sendChatToPlayer(aPlayer, "No Ores found."); + } + return true; + } + 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/miscutil/core/xmod/gregtech/api/items/types/ToolType_Wrench.java b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_Wrench.java new file mode 100644 index 0000000000..ade388b894 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/items/types/ToolType_Wrench.java @@ -0,0 +1,149 @@ +package miscutil.core.xmod.gregtech.api.items.types; + +import gregtech.api.GregTech_API; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import ic2.api.tile.IWrenchable; + +import java.util.Arrays; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class ToolType_Wrench + extends ToolType_Base { + private final int mCosts; + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); + + public ToolType_Wrench(int aCosts) { + this.mCosts = aCosts; + } + + 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; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) { + return false; + } + byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); + byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ); + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + try { + if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) { + if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + ((IWrenchable) aTileEntity).setFacing((short) aTargetSide); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) { + int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3; + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) { + ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer); + for (ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) { + if (tOutput == null) { + aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack)); + } else { + aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput)); + tOutput = null; + } + } + aWorld.setBlockToAir(aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + return true; + } + } catch (Throwable e) { + } + if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); + aWorld.setBlockToAir(aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if (aMeta == aTargetSide) { + if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); + aWorld.setBlockToAir(aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + } else { + if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { + if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) { + if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if (aBlock == Blocks.hopper) { + if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + } + if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) && + ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) && + (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { + if (!aPlayer.capabilities.isCreativeMode) { + ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); + } + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + } + 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/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java index 0f56400d0c..addc346f3e 100644 --- a/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java +++ b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java @@ -2,17 +2,17 @@ package miscutil.core.xmod.gregtech.api.objects; import gregtech.api.enums.Dyes; import gregtech.api.interfaces.IColorModulationContainer; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; import miscutil.core.util.Utils; +import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_IconContainer; +import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_Texture; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; -public class GregtechRenderedTexture implements ITexture, IColorModulationContainer { - private final IIconContainer mIconContainer; +public class GregtechRenderedTexture implements Interface_Texture, IColorModulationContainer { + private final Interface_IconContainer mIconContainer; private final boolean mAllowAlpha; /** * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! @@ -22,18 +22,18 @@ public class GregtechRenderedTexture implements ITexture, IColorModulationContai */ public short[] mRGBa; - public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + public GregtechRenderedTexture(Interface_IconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); mIconContainer = aIcon; mAllowAlpha = aAllowAlpha; mRGBa = aRGBa; } - public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa) { + public GregtechRenderedTexture(Interface_IconContainer aIcon, short[] aRGBa) { this(aIcon, aRGBa, true); } - public GregtechRenderedTexture(IIconContainer aIcon) { + public GregtechRenderedTexture(Interface_IconContainer aIcon) { this(aIcon, Dyes._NULL.mRGBa); } diff --git a/src/Java/miscutil/core/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java b/src/Java/miscutil/core/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java new file mode 100644 index 0000000000..036add9535 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java @@ -0,0 +1,19 @@ +package miscutil.core.xmod.gregtech.api.recipe; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.util.GT_ModHandler; +import gregtech.common.items.GT_MetaGenerated_Tool_01; +import net.minecraft.item.ItemStack; + +public class ProcessingSkookumChoocherToolRecipes implements gregtech.api.interfaces.IOreRecipeRegistrator { + public ProcessingSkookumChoocherToolRecipes() { + //GregtechOrePrefixes.toolSkookumChoocher.add(this); + } + + @Override + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(32, 1, aMaterial, aMaterial, null), new Object[]{aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), ToolDictNames.craftingToolScrewdriver}); + } +} diff --git a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index 94504290ac..9a4c40f809 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -1,7 +1,11 @@ package miscutil.core.xmod.gregtech.common.items; +import gregtech.api.GregTech_API; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.ToolDictNames; +import miscutil.core.xmod.gregtech.api.enums.GregtechToolDictNames; import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool; -import miscutil.core.xmod.gregtech.common.tools.TOOL_Gregtech_MaxEfficiencyMultiBlockItem; +import miscutil.core.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher; public class MetaGeneratedGregtechTools extends Gregtech_MetaTool { @@ -10,15 +14,26 @@ public class MetaGeneratedGregtechTools extends Gregtech_MetaTool { 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 MetaGeneratedGregtechTools INSTANCE; public MetaGeneratedGregtechTools() { super("MU-metaitem.02"); INSTANCE = this; + + 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[]{}); + //addTool(HUGE_ITEM, "Huge Item", "Item 4 for your power station", new TOOL_Gregtech_MaxEfficiencyMultiBlockItem(), new Object[]{}); } } diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java index 592b649fb4..92e236d782 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java @@ -7,6 +7,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -18,7 +19,6 @@ import miscutil.core.block.ModBlocks; import miscutil.core.util.Utils; import miscutil.core.xmod.gregtech.api.gui.GUI_MultiMachine; import miscutil.core.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import miscutil.core.xmod.gregtech.api.objects.GregtechRenderedTexture; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -71,9 +71,9 @@ extends GregtechMeta_MultiBlockBase { }*/ @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GregtechRenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GregtechRenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; - } + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java new file mode 100644 index 0000000000..f50e91c90e --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -0,0 +1,198 @@ +package miscutil.core.xmod.gregtech.common.tools; + +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +import java.util.Arrays; +import java.util.List; + +import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool; +import miscutil.core.xmod.gregtech.api.items.types.ToolType_HardHammer; +import miscutil.core.xmod.gregtech.api.items.types.ToolType_Wrench; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraftforge.event.world.BlockEvent; + +public class TOOL_Gregtech_Choocher + extends TOOL_Gregtech_Base { + + public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"}); + + + @Override + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + String tName = aEntity.getClass().getName(); + tName = tName.substring(tName.lastIndexOf(".") + 1); + return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; + } + + @Override + public int getToolDamagePerBlockBreak() { + return 50; + } + + @Override + public int getToolDamagePerDropConversion() { + return 100; + } + + @Override + public int getToolDamagePerContainerCraft() { + return 400; + } + + @Override + public int getToolDamagePerEntityAttack() { + return 100; + } + + @Override + public int getBaseQuality() { + return 0; + } + + @Override + public float getBaseDamage() { + return 4.0F; + } + + @Override + public float getSpeedMultiplier() { + return 0.85F; + } + + @Override + public float getMaxDurabilityMultiplier() { + return 1.2F; + } + + @Override + public String getCraftingSound() { + return null; + } + + @Override + public String getEntityHitSound() { + return null; + } + + @Override + public String getBreakingSound() { + return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + } + + @Override + public String getMiningSound() { + return null; + } + + @Override + public boolean canBlock() { + return true; + } + + @Override + public boolean isWrench(){ + return true; + } + + @Override + public boolean isCrowbar() { + return false; + } + + @Override + public boolean isWeapon() { + return true; + } + + @Override + public boolean isMinableBlock(Block aBlock, byte aMetaData) { + String tTool = aBlock.getHarvestTool(aMetaData); + return ((tTool != null) && ((tTool.equals("sword")) || (tTool.equals("wrench")) || (tTool.equals("hammer")) || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce) || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); + } + + @Override + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + int rConversions = 0; + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)}); + if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { + for (ItemStack tDrop : aDrops) { + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})}); + if (tRecipe != null) { + ItemStack tHammeringOutput = tRecipe.getOutput(0); + if (tHammeringOutput != null) { + rConversions += tDrop.stackSize; + tDrop.stackSize *= tHammeringOutput.stackSize; + tHammeringOutput.stackSize = tDrop.stackSize; + GT_Utility.setStack(tDrop, tHammeringOutput); + } + } + } + } else { + aDrops.clear(); + aDrops.add(tRecipe.getOutput(0)); + rConversions++; + } + return rConversions; + } + + @Override + public ItemStack getBrokenItem(ItemStack aStack) { + return null; + } + + @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 aIsToolHead ? Gregtech_MetaTool.getPrimaryMaterial(aStack).mRGBa : null; + } + + @Override + public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) { + aItem.addItemBehavior(aID, new ToolType_Wrench(150)); + aItem.addItemBehavior(aID, new ToolType_HardHammer(1, 1250)); + } + + @Override + public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { + super.onToolCrafted(aStack, aPlayer); + aPlayer.triggerAchievement(AchievementList.buildSword); + try { + GT_Mod.instance.achievements.issueAchievement(aPlayer, "tools"); + GT_Mod.instance.achievements.issueAchievement(aPlayer, "unitool"); + } catch (Exception e) { + } + } + + @Override + public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + } +} diff --git a/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Textures_Items.java b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Textures_Items.java new file mode 100644 index 0000000000..584e7455b8 --- /dev/null +++ b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Textures_Items.java @@ -0,0 +1,10 @@ +package miscutil.core.xmod.gregtech.loaders; + +import miscutil.core.xmod.gregtech.api.enums.GregtechTextures.ItemIcons.CustomIcon; + +public class Processing_Textures_Items { + + public static final CustomIcon itemSkookumChoocher = new CustomIcon("iconsets/SKOOKUMCHOOCHER"); + +} + |