diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech')
64 files changed, 2 insertions, 7388 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index fee3c12277..efddb59ffb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -36,7 +36,6 @@ import gtPlusPlus.recipes.CokeAndPyrolyseOven; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; -import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; @@ -57,7 +56,6 @@ public class HANDLER_GT { public static GT_Config mMaterialProperties = null; public static GTPP_Config sCustomWorldgenFile = null; public static final List<WorldGen_GT> sWorldgenListEverglades = new ArrayList<>(); - public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<>(); public static GT_MetaGenerated_Tool sMetaGeneratedToolInstance; public static void preInit() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java deleted file mode 100644 index 78b5cced08..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java +++ /dev/null @@ -1,55 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.energy; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * Provides the ability to store energy on the implementing item. - * - * The item should have a maximum damage of 13. - */ -public interface IC2ElectricItem { - - /** - * Determine if the item can be used in a machine or as an armor part to supply energy. - * - * @return Whether the item can supply energy - */ - boolean canProvideEnergy(ItemStack itemStack); - - /** - * Get the item ID to use for a charge energy greater than 0. - * - * @return Item ID to use - */ - Item getChargedItem(ItemStack itemStack); - - /** - * Get the item ID to use for a charge energy of 0. - * - * @return Item ID to use - */ - Item getEmptyItem(ItemStack itemStack); - - /** - * Get the item's maximum charge energy in EU. - * - * @return Maximum charge energy - */ - double getMaxCharge(ItemStack itemStack); - - /** - * Get the item's tier, lower tiers can't send energy to higher ones. Batteries are Tier 1, Energy Crystals are Tier - * 2, Lapotron Crystals are Tier 3. - * - * @return Item's tier - */ - int getTier(ItemStack itemStack); - - /** - * Get the item's transfer limit in EU per transfer operation. - * - * @return Transfer limit - */ - double getTransferLimit(ItemStack itemStack); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java deleted file mode 100644 index 007d66de66..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java +++ /dev/null @@ -1,94 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.energy; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * This interface specifies a manager to handle the various tasks for electric items. - * - * The default implementation does the following: - store and retrieve the charge - handle charging, taking amount, - * tier, transfer limit, canProvideEnergy and simulate into account - replace item IDs if appropriate - * (getChargedItemId() and getEmptyItemId()) - update and manage the damage value for the visual charge indicator - * - * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the default implementations - * through ElectricItem.rawManager. The default implementation is designed to minimize its dependency on its own - * constraints/structure and delegates most work back to the more atomic features in the gateway manager. - */ -public interface IC2ElectricItemManager { - - /** - * Charge an item with a specified amount of energy. - * - * @param itemStack electric item's stack - * @param amount amount of energy to charge in EU - * @param tier tier of the charging device, has to be at least as high as the item to charge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value - * @return Energy transferred into the electric item - */ - double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); - - /** - * Discharge an item by a specified amount of energy - * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param tier tier of the discharging device, has to be at least as high as the item to discharge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param externally use the supplied item externally, i.e. to power something else as if it was a battery - * @param simulate don't actually discharge the item, just determine the return value - * @return Energy retrieved from the electric item - */ - double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, - boolean simulate); - - /** - * Determine the charge level for the specified item. - * - * @param itemStack ItemStack containing the electric item - * @return charge level in EU - */ - double getCharge(ItemStack stack); - - /** - * Determine if the specified electric item has at least a specific amount of EU. This is supposed to be used in the - * item code during operation, for example if you want to implement your own electric item. BatPacks are not taken - * into account. - * - * @param itemStack electric item's stack - * @param amount minimum amount of energy required - * @return true if there's enough energy - */ - boolean canUse(ItemStack stack, double amount); - - /** - * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. This is supposed to be - * used in the item code during operation, for example if you want to implement your own electric item. - * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param entity entity holding the item - * @return true if the operation succeeded - */ - boolean use(ItemStack stack, double amount, EntityLivingBase entity); - - /** - * Charge an item from the BatPack a player is wearing. This is supposed to be used in the item code during - * operation, for example if you want to implement your own electric item. use() already contains this - * functionality. - * - * @param itemStack electric item's stack - * @param entity entity holding the item - */ - void chargeFromArmor(ItemStack stack, EntityLivingBase entity); - - /** - * Get the tool tip to display for electric items. - * - * @param itemStack ItemStack to determine the tooltip for - * @return tool tip string or null for none - */ - String getToolTip(ItemStack stack); - - // TODO: add tier getter -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java deleted file mode 100644 index 74c9d9ee5b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java +++ /dev/null @@ -1,83 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.enums; - -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.core.lib.CORE; - -public class CustomGtTextures { - - public enum ItemIcons implements IIconContainer, Runnable { - - VOID, // The Empty Texture - RENDERING_ERROR, - PUMP, - SKOOKUMCHOOCHER; - - public static final ITexture[] ERROR_RENDERING = new ITexture[] { new GT_RenderedTexture(RENDERING_ERROR) }; - - protected IIcon mIcon, mOverlay; - - private ItemIcons() { - GregTech_API.sGTItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - - @Override - public void run() { - this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this); - this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY"); - } - - public static class CustomIcon implements IIconContainer, Runnable { - - protected IIcon mIcon, mOverlay; - protected String mIconName; - - public CustomIcon(final String aIconName) { - this.mIconName = aIconName; - GregTech_API.sGTItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public void run() { - this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName); - this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName + "_OVERLAY"); - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java deleted file mode 100644 index 87d85a578e..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java +++ /dev/null @@ -1,159 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.enums; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; - -public class GregtechTextureSet { - - public static final GregtechTextureSet SET_NONE = new GregtechTextureSet("NONE"), - SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), - SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), - SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), - SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), - SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), - SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), - SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), - SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), - SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), - SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), - SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), - SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), - SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), - SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL"); - - public final IIconContainer[] mTextures = new IIconContainer[128]; - public final String mSetName; - - public GregtechTextureSet(final String aSetName) { - this.mSetName = aSetName; - this.mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/turbineBlade"); - this.mTextures[1] = new Textures.ItemIcons.CustomIcon( - "materialicons/" + this.mSetName + "/toolHeadSkookumChoocher"); - this.mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - this.mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java deleted file mode 100644 index 1b9a88e230..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java +++ /dev/null @@ -1,188 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.enums; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_IconContainer; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_Texture; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; - -public class GregtechTextures { - - public enum BlockIcons implements Interface_IconContainer, Runnable { - - VOID, - - LARGECENTRIFUGE1, - LARGECENTRIFUGE2, - LARGECENTRIFUGE3, - LARGECENTRIFUGE4, - LARGECENTRIFUGE5, - LARGECENTRIFUGE6, - LARGECENTRIFUGE7, - LARGECENTRIFUGE8, - LARGECENTRIFUGE9, - LARGECENTRIFUGE_ACTIVE1, - LARGECENTRIFUGE_ACTIVE2, - LARGECENTRIFUGE_ACTIVE3, - LARGECENTRIFUGE_ACTIVE4, - LARGECENTRIFUGE_ACTIVE5, - LARGECENTRIFUGE_ACTIVE6, - LARGECENTRIFUGE_ACTIVE7, - LARGECENTRIFUGE_ACTIVE8, - LARGECENTRIFUGE_ACTIVE9; - - public static final Interface_IconContainer[] CENTRIFUGE = new Interface_IconContainer[] { LARGECENTRIFUGE1, - LARGECENTRIFUGE2, LARGECENTRIFUGE3, LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6, - LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9 }, - CENTRIFUGE_ACTIVE = new Interface_IconContainer[] { LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, - LARGECENTRIFUGE_ACTIVE3, LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, - LARGECENTRIFUGE_ACTIVE6, LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, - LARGECENTRIFUGE_ACTIVE9 }; - - public static Interface_Texture[] GT_CASING_BLOCKS = new Interface_Texture[64]; - - protected IIcon mIcon; - - private BlockIcons() { - Meta_GT_Proxy.GT_BlockIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public void run() { - this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(GTPlusPlus.ID + ":" + "iconsets/" + this); - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationBlocksTexture; - } - - public static class CustomIcon implements Interface_IconContainer, Runnable { - - protected IIcon mIcon; - protected String mIconName; - - public CustomIcon(final String aIconName) { - this.mIconName = aIconName; - Meta_GT_Proxy.GT_BlockIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public void run() { - this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(GTPlusPlus.ID + ":" + this.mIconName); - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationBlocksTexture; - } - } - } - - public enum ItemIcons implements Interface_IconContainer, Runnable { - - VOID, // The Empty Texture - RENDERING_ERROR, // The Purple/Black Texture - SKOOKUMCHOOCHER, // The Skookum Tool Texture - PUMP, // The Hand Pump Texture - 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; - - private ItemIcons() { - Meta_GT_Proxy.GT_ItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - - @Override - public void run() { - this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(GTPlusPlus.ID + ":" + "iconsets/" + this); - this.mOverlay = Meta_GT_Proxy.sItemIcons - .registerIcon(GTPlusPlus.ID + ":" + "iconsets/" + this + "_OVERLAY"); - } - - public static class CustomIcon implements Interface_IconContainer, Runnable { - - protected IIcon mIcon, mOverlay; - protected String mIconName; - - public CustomIcon(final String aIconName) { - this.mIconName = aIconName; - Meta_GT_Proxy.GT_ItemIconload.add(this); - } - - @Override - public IIcon getIcon() { - return this.mIcon; - } - - @Override - public IIcon getOverlayIcon() { - return this.mOverlay; - } - - @Override - public void run() { - this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(GTPlusPlus.ID + ":" + this.mIconName); - this.mOverlay = Meta_GT_Proxy.sItemIcons - .registerIcon(GTPlusPlus.ID + ":" + this.mIconName + "_OVERLAY"); - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationItemsTexture; - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java deleted file mode 100644 index eff3de28a3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java +++ /dev/null @@ -1,28 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces; - -import net.minecraftforge.common.util.ForgeDirection; - -import ic2.api.energy.tile.IHeatSource; - -public interface IHeatEntity extends IHeatSource, IHeatSink { - - public int getHeatBuffer(); - - public void setHeatBuffer(int HeatBuffer); - - public void addtoHeatBuffer(int heat); - - public int getTransmitHeat(); - - public int fillHeatBuffer(int maxAmount); - - public int getMaxHeatEmittedPerTick(); - - public void updateHeatEntity(); - - @Override - public int maxrequestHeatTick(ForgeDirection directionFrom); - - @Override - public int requestHeat(ForgeDirection directionFrom, int requestheat); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java deleted file mode 100644 index 9e671fe538..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatSink.java +++ /dev/null @@ -1,10 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces; - -import net.minecraftforge.common.util.ForgeDirection; - -public interface IHeatSink { - - int maxHeatInPerTick(ForgeDirection var1); - - int addHeat(ForgeDirection var1, int var2); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java deleted file mode 100644 index cb5d875071..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java +++ /dev/null @@ -1,12 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces; - -import java.util.ArrayList; - -import net.minecraft.tileentity.TileEntity; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; - -public interface IMetaTileEntityHeatPipe extends IMetaTileEntity { - - long transferHeat(byte var1, long var2, long var4, ArrayList<TileEntity> var6); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java deleted file mode 100644 index 2f4eaf4293..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -package gtPlusPlus.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(); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java deleted file mode 100644 index 230dc6ab8d..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java +++ /dev/null @@ -1,20 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces.internal; - -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.OrePrefixes; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; - -public interface Interface_OreRecipeRegistrator_GT { - - /** - * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did - * before. - * - * @param aPrefix always != null - * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based! - * @param aStack always != null - */ - public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, - ItemStack aStack); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java deleted file mode 100644 index 53d3055213..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.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(); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java deleted file mode 100644 index 91ad6d9d9c..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java +++ /dev/null @@ -1,617 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.items.tools; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.item.EntityMinecart; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.stats.AchievementList; -import net.minecraft.stats.StatList; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.GregTech_API; -import gregtech.api.enchants.Enchantment_Radioactivity; -import gregtech.api.enums.Materials; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -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 gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; - -/** - * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench: - * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, - * null); - */ -public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { - - /** - * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this - * Type, if useStandardMetaItemRenderer() returns true. - * <p/> - * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. - */ - public static final HashMap<String, GT_MetaGenTool> sInstances = new HashMap<>(); - - /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ - - public final HashMap<Short, IToolStats> mToolStats = new HashMap<>(); - - /** - * Creates the Item using these Parameters. - * - * @param aUnlocalized The Unlocalized Name of this Item. - */ - public GT_MetaGenTool(final String aUnlocalized) { - super(aUnlocalized); - GT_ModHandler.registerBoxableItemToToolBox(this); - this.setCreativeTab(GregTech_API.TAB_GREGTECH); - this.setMaxStackSize(1); - sInstances.put(this.getUnlocalizedName(), this); - } - - /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */ - - public static final Materials getPrimaryMaterialEx(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("GT.ToolStats"); - if (aNBT != null) { - return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial")); - } - } - return Materials._NULL; - } - - public static final Materials getSecondaryMaterialEx(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("GT.ToolStats"); - if (aNBT != null) { - return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial")); - } - } - return Materials._NULL; - } - - /** - * This adds a Custom Item to the ending Range. - * - * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven - * ID's are empty electric Items) - * @param aEnglish The Default Localized Name of the created Item - * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no - * ToolTip - * @param aToolStats The Food Value of this Item. Can be null as well. - * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft - * Aspects. - * @return An ItemStack containing the newly created Item, but without specific Stats. - */ - public final ItemStack addToolEx(final int aID, final String aEnglish, String aToolTip, final IToolStats aToolStats, - final Object... aOreDictNamesAndAspects) { - if (aToolTip == null) { - aToolTip = ""; - } - if ((aID >= 0) && (aID < 32766) && ((aID % 2) == 0)) { - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".name", aEnglish); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".tooltip", aToolTip); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + (aID + 1) + ".name", - aEnglish + " (Empty)"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip", - "You need to recharge it"); - this.mToolStats.put((short) aID, aToolStats); - this.mToolStats.put((short) (aID + 1), aToolStats); - aToolStats.onStatsAddedToTool(this, aID); - final ItemStack rStack = new ItemStack(this, 1, aID); - final List<TC_AspectStack> tAspects = new ArrayList<>(); - for (final Object tOreDictNameOrAspect : aOreDictNamesAndAspects) { - if (tOreDictNameOrAspect instanceof TC_AspectStack) { - ((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects); - } else { - GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack); - } - } - if (GregTech_API.sThaumcraftCompat != null) { - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); - } - return rStack; - } - return null; - } - - /** - * This Function gets an ItemStack Version of this Tool - * - * @param aToolID the ID of the Tool Class - * @param aAmount Amount of Items (well normally you only need 1) - * @param aPrimaryMaterial Primary Material of this Tool - * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool - * @param aElectricArray The Electric Stats of this Tool (or null if not electric) - */ - public final ItemStack getToolWithStatsEx(final int aToolID, final int aAmount, final Materials aPrimaryMaterial, - final Materials aSecondaryMaterial, final long[] aElectricArray) { - final ItemStack rStack = new ItemStack(this, aAmount, aToolID); - final IToolStats tToolStats = this.getToolStats(rStack); - if (tToolStats != null) { - final NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound(); - if (aPrimaryMaterial != null) { - tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.toString()); - tToolNBT.setLong( - "MaxDamage", - 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier())); - } - if (aSecondaryMaterial != null) { - tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString()); - } - - if (aElectricArray != null) { - tToolNBT.setBoolean("Electric", true); - tToolNBT.setLong("MaxCharge", aElectricArray[0]); - tToolNBT.setLong("Voltage", aElectricArray[1]); - tToolNBT.setLong("Tier", aElectricArray[2]); - tToolNBT.setLong("SpecialData", aElectricArray[3]); - } - - tMainNBT.setTag("GT.ToolStats", tToolNBT); - rStack.setTagCompound(tMainNBT); - } - this.isItemStackUsable(rStack); - return rStack; - } - - /** - * Called by the Block Harvesting Event within the GT_Proxy - */ - @Override - public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack, - final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, - final byte aMetaData, final int aFortune, final boolean aSilkTouch, - final BlockEvent.HarvestDropsEvent aEvent) { - final IToolStats tStats = this.getToolStats(aStack); - if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) { - this.doDamage( - aStack, - tStats.convertBlockDrops( - aDrops, - aStack, - aPlayer, - aBlock, - aX, - aY, - aZ, - aMetaData, - aFortune, - aSilkTouch, - aEvent) * tStats.getToolDamagePerDropConversion()); - } - } - - @Override - public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) { - final IToolStats tStats = this.getToolStats(aStack); - if ((tStats == null) || !this.isItemStackUsable(aStack)) { - return true; - } - GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F); - if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) { - return true; - } - if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { - final float tMagicDamage = tStats - .getMagicDamageAgainstEntity( - aEntity instanceof EntityLivingBase - ? EnchantmentHelper - .getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) - : 0.0F, - aEntity, - aStack, - aPlayer); - float tDamage = tStats.getNormalDamageAgainstEntity( - (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() - + this.getToolCombatDamage(aStack), - aEntity, - aStack, - aPlayer); - if ((tDamage + tMagicDamage) > 0.0F) { - final boolean tCriticalHit = (aPlayer.fallDistance > 0.0F) && !aPlayer.onGround - && !aPlayer.isOnLadder() - && !aPlayer.isInWater() - && !aPlayer.isPotionActive(Potion.blindness) - && (aPlayer.ridingEntity == null) - && (aEntity instanceof EntityLivingBase); - if (tCriticalHit && (tDamage > 0.0F)) { - tDamage *= 1.5F; - } - tDamage += tMagicDamage; - if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) { - if (aEntity instanceof EntityLivingBase) { - aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4); - } - final int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) - : 0); - if (tKnockcack > 0) { - aEntity.addVelocity( - -MathHelper.sin((aPlayer.rotationYaw * (float) Math.PI) / 180.0F) * tKnockcack * 0.5F, - 0.1D, - MathHelper.cos((aPlayer.rotationYaw * (float) Math.PI) / 180.0F) * tKnockcack * 0.5F); - aPlayer.motionX *= 0.6D; - aPlayer.motionZ *= 0.6D; - aPlayer.setSprinting(false); - } - if (tCriticalHit) { - aPlayer.onCriticalHit(aEntity); - } - if (tMagicDamage > 0.0F) { - aPlayer.onEnchantmentCritical(aEntity); - } - if (tDamage >= 18.0F) { - aPlayer.triggerAchievement(AchievementList.overkill); - } - aPlayer.setLastAttacker(aEntity); - if (aEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer); - } - EnchantmentHelper.func_151385_b(aPlayer, aEntity); - if (aEntity instanceof EntityLivingBase) { - aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); - } - aEntity.hurtResistantTime = Math - .max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); - aPlayer.addExhaustion(0.3F); - this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); - } - } - } - if (aStack.stackSize <= 0) { - aPlayer.destroyCurrentEquippedItem(); - } - return true; - } - - @Override - public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) { - final IToolStats tStats = this.getToolStats(aStack); - if ((tStats != null) && tStats.canBlock()) { - aPlayer.setItemInUse(aStack, 72000); - } - return super.onItemRightClick(aStack, aWorld, aPlayer); - } - - @Override - public Long[] getFluidContainerStats(final ItemStack aStack) { - return null; - } - - @Override - public Long[] getElectricStats(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("GT.ToolStats"); - if ((aNBT != null) && aNBT.getBoolean("Electric")) { - return new Long[] { aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), - aNBT.getLong("SpecialData") }; - } - } - return null; - } - - @Override - public float getToolCombatDamage(final ItemStack aStack) { - final IToolStats tStats = this.getToolStats(aStack); - if (tStats == null) { - return 0; - } - return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality; - } - - @Override - public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) { - if (!this.isItemStackUsable(aStack)) { - return 0.0F; - } - final IToolStats tStats = this.getToolStats(aStack); - if ((tStats == null) || (Math.max(0, this.getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData))) { - return 0.0F; - } - return tStats.isMinableBlock(aBlock, (byte) aMetaData) - ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) - : 0.0F; - } - - @Override - public boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX, - final int aY, final int aZ, final EntityLivingBase aPlayer) { - if (!this.isItemStackUsable(aStack)) { - return false; - } - final IToolStats tStats = this.getToolStats(aStack); - if (tStats == null) { - return false; - } - GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); - this.doDamage( - aStack, - (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); - return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F; - } - - private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) { - if (!this.isItemStackUsable(aStack)) { - return null; - } - aStack = GT_Utility.copyAmount(1, aStack); - final IToolStats tStats = this.getToolStats(aStack); - if (tStats == null) { - return null; - } - this.doDamage(aStack, tStats.getToolDamagePerContainerCraft()); - aStack = aStack.stackSize > 0 ? aStack : null; - if (playSound) { - // String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound(); - // GT_Utility.doSoundAtClient(sound, 1, 1.0F); - } - return aStack; - } - - @Override - public Interface_ToolStats getToolStats(final ItemStack aStack) { - this.isItemStackUsable(aStack); - return this.getToolStatsInternal(aStack); - } - - private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) { - return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage())); - } - - @Override - public float getSaplingModifier(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer, - final int aX, final int aY, final int aZ) { - final IToolStats tStats = this.getToolStats(aStack); - return (tStats != null) && tStats.isGrafter() ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F) - : 0.0F; - } - - @Override - public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, - final int aZ) { - if (!this.isItemStackUsable(aStack)) { - return false; - } - final IToolStats tStats = this.getToolStats(aStack); - return (tStats != null) && tStats.isCrowbar(); - } - - @Override - public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) { - final IToolStats tStats = this.getToolStats(aStack); - if (tStats != null) { - this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); - } - } - - @Override - public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) { - System.out.println("canWrench"); - if (player == null) { - return false; - } - if (player.getCurrentEquippedItem() == null) { - return false; - } - if (!this.isItemStackUsable(player.getCurrentEquippedItem())) { - return false; - } - final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem()); - return (tStats != null) && tStats.isWrench(); - } - - @Override - public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) { - if (player == null) { - return; - } - if (player.getCurrentEquippedItem() == null) { - return; - } - final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem()); - if (tStats != null) { - this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack()); - } - } - - @Override - public boolean canUse(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) { - return this.canWrench(player, x, y, z); - } - - @Override - public void used(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) { - this.wrenchUsed(player, x, y, z); - } - - @Override - public boolean shouldHideFacades(final ItemStack stack, final EntityPlayer player) { - if (player == null) { - return false; - } - if (player.getCurrentEquippedItem() == null) { - return false; - } - if (!this.isItemStackUsable(player.getCurrentEquippedItem())) { - return false; - } - final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem()); - return tStats.isWrench(); - } - - @Override - public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) { - if (!this.isItemStackUsable(aStack)) { - return false; - } - final IToolStats tStats = this.getToolStats(aStack); - return (tStats != null) && tStats.isCrowbar(); - } - - @Override - public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) { - final IToolStats tStats = this.getToolStats(aStack); - if (tStats != null) { - this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); - } - } - - @Override - public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) { - if (!this.isItemStackUsable(aStack)) { - return false; - } - final IToolStats tStats = this.getToolStats(aStack); - return (tStats != null) && tStats.isCrowbar(); - } - - @Override - public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) { - final IToolStats tStats = this.getToolStats(aStack); - if (tStats != null) { - this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); - } - } - - @Override - public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) { - final IToolStats tStats = this.getToolStats(aStack); - if ((tStats != null) && (aPlayer != null)) { - tStats.onToolCrafted(aStack, aPlayer); - } - super.onCreated(aStack, aWorld, aPlayer); - } - - @Override - public boolean isFull3D() { - return true; - } - - @Override - public boolean isItemStackUsable(final ItemStack aStack) { - final IToolStats tStats = this.getToolStatsInternal(aStack); - if (((aStack.getItemDamage() % 2) == 1) || (tStats == null)) { - final NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT.removeTag("ench"); - } - return false; - } - final Materials aMaterial = getPrimaryMaterial(aStack); - final HashMap<Integer, Integer> tMap = new HashMap<>(), tResult = new HashMap<>(); - if (aMaterial.mEnchantmentTools != null) { - tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel); - if (aMaterial.mEnchantmentTools == Enchantment.fortune) { - tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel); - } - if (aMaterial.mEnchantmentTools == Enchantment.knockback) { - tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel); - } - if (aMaterial.mEnchantmentTools == Enchantment.fireAspect) { - tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel); - } - } - final Enchantment[] tEnchants = tStats.getEnchantments(aStack); - final int[] tLevels = tStats.getEnchantmentLevels(aStack); - for (int i = 0; i < tEnchants.length; i++) { - if (tLevels[i] > 0) { - final Integer tLevel = tMap.get(tEnchants[i].effectId); - tMap.put( - tEnchants[i].effectId, - tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i])); - } - } - for (final Entry<Integer, Integer> tEntry : tMap.entrySet()) { - if ((tEntry.getKey() == 33) || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) - || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) { - tResult.put(tEntry.getKey(), tEntry.getValue()); - } else { - switch (Enchantment.enchantmentsList[tEntry.getKey()].type) { - case weapon: - if (tStats.isWeapon()) { - tResult.put(tEntry.getKey(), tEntry.getValue()); - } - break; - case all: - tResult.put(tEntry.getKey(), tEntry.getValue()); - break; - case armor: - case armor_feet: - case armor_head: - case armor_legs: - case armor_torso: - break; - case bow: - if (tStats.isRangedWeapon()) { - tResult.put(tEntry.getKey(), tEntry.getValue()); - } - break; - case breakable: - break; - case fishing_rod: - break; - case digger: - if (tStats.isMiningTool()) { - tResult.put(tEntry.getKey(), tEntry.getValue()); - } - break; - } - } - } - EnchantmentHelper.setEnchantments(tResult, aStack); - return true; - } - - @Override - public short getChargedMetaData(final ItemStack aStack) { - return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2)); - } - - @Override - public short getEmptyMetaData(final ItemStack aStack) { - final NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT.removeTag("ench"); - } - return (short) ((aStack.getItemDamage() + 1) - (aStack.getItemDamage() % 2)); - } - - @Override - public int getItemEnchantability() { - return 0; - } - - @Override - public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) { - return false; - } - - @Override - public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java deleted file mode 100644 index 463b6d9f7f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java +++ /dev/null @@ -1,96 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.items.types; - -import java.util.List; - -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; - -import gregtech.api.enums.SubTag; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; - -public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> { - - @Override - public boolean onLeftClickEntity(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, - final EntityPlayer aPlayer, final Entity aEntity) { - return false; - } - - @Override - public boolean onItemUse(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer, - final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, - final float hitY, final float hitZ) { - return false; - } - - @Override - public boolean onItemUseFirst(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, - final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, - final float hitX, final float hitY, final float hitZ) { - return false; - } - - @Override - public ItemStack onItemRightClick(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, - final EntityPlayer aPlayer) { - return aStack; - } - - @Override - public List<String> getAdditionalToolTips(final Gregtech_MetaItem_Base aItem, final List<String> aList, - final ItemStack aStack) { - return aList; - } - - @Override - public void onUpdate(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, - final Entity aPlayer, final int aTimer, final boolean aIsInHand) {} - - @Override - public boolean isItemStackUsable(final Gregtech_MetaItem_Base aItem, final ItemStack aStack) { - return true; - } - - @Override - public boolean canDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) { - return false; - } - - @Override - public ItemStack onDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, - final ItemStack aStack) { - final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); - final IPosition iposition = BlockDispenser.func_149939_a(aSource); - final ItemStack itemstack1 = aStack.splitStack(1); - BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition); - return aStack; - } - - @Override - public boolean hasProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, - final ItemStack aStack) { - return false; - } - - @Override - public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, - final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) { - return null; - } - - @Override - public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, - final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) { - return null; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java deleted file mode 100644 index c387c513a4..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java +++ /dev/null @@ -1,157 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.items.types; - -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; - -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; - -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(final int aVanillaCosts, final int aEUCosts) { - this.mVanillaCosts = aVanillaCosts; - this.mEUCosts = aEUCosts; - } - - public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, - final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, - final float hitY, final float hitZ) { - if (aWorld.isRemote) { - return false; - } - final Block aBlock = aWorld.getBlock(aX, aY, aZ); - if (aBlock == null) { - return false; - } - final 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, - 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, - 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; - final int tQuality = (aItem instanceof GT_MetaGenerated_Tool) - ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") - : 0; - - int i = 0; - for (final int j = 6 + tQuality; i < j; i++) { - tX -= ForgeDirection.getOrientation(aSide).offsetX; - tY -= ForgeDirection.getOrientation(aSide).offsetY; - tZ -= ForgeDirection.getOrientation(aSide).offsetZ; - - final 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; - } - } - final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide); - i = 0; - for (final 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); - final Block tBlock = aWorld.getBlock(tX, tY, tZ); - if ((tBlock instanceof GT_Block_Ores)) { - final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - final 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(final GT_MetaBase_Item aItem, final List<String> aList, - final ItemStack aStack) { - aList.add(this.mTooltip); - return aList; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java deleted file mode 100644 index e117c1b28e..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java +++ /dev/null @@ -1,188 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.items.types; - -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; - -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; - -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(final int aCosts) { - this.mCosts = aCosts; - } - - public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, - final World aWorld, final int aX, final int aY, final int aZ, final int ordinalSide, final float hitX, - final float hitY, final float hitZ) { - if (aWorld.isRemote) { - return false; - } - final ForgeDirection side = ForgeDirection.getOrientation(ordinalSide); - final Block aBlock = aWorld.getBlock(aX, aY, aZ); - if (aBlock == null) { - return false; - } - final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); - final ForgeDirection targetSide = GT_Utility.determineWrenchingSide(side, hitX, hitY, hitZ); - final byte ordinalTargetSide = (byte) targetSide.ordinal(); - final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); - try { - if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable wrenchable))) { - if (wrenchable.wrenchCanSetFacing(aPlayer, ordinalTargetSide)) { - if ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - wrenchable.setFacing(ordinalTargetSide); - GT_Utility - .sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) { - final 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 (final 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, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - return true; - } - } catch (final 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, GregTech_API.sSoundList.get(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, GregTech_API.sSoundList.get(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, GregTech_API.sSoundList.get(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, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (aMeta == ordinalTargetSide) { - 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, GregTech_API.sSoundList.get(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, ordinalTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(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 ((targetSide.offsetY == 0) && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ordinalTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (aBlock == Blocks.hopper) { - if ((targetSide != ForgeDirection.UP) && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ordinalTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - } - if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(targetSide)) - && ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) - || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) - && (aBlock.rotateBlock(aWorld, aX, aY, aZ, targetSide))) { - if (!aPlayer.capabilities.isCreativeMode) { - ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); - } - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); - } - return false; - } - - public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, - final ItemStack aStack) { - aList.add(this.mTooltip); - return aList; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java deleted file mode 100644 index a47ed592c4..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java +++ /dev/null @@ -1,81 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; - -public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntity_BasicMachine_GT_Recipe { - - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, - boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { - super( - aID, - aName, - aNameRegional, - aTier, - aDescription, - aRecipes, - aInputSlots, - aOutputSlots, - aTankCapacity, - aGUIParameterA, - aGUIParameterB, - aGUIName, - aSound, - aSharedTank, - aRequiresFluidForFiltering, - aSpecialEffect, - aOverlays, - aRecipe); - } - - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(String aName, int aTier, String aDescription, - GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, - int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, - String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { - super( - aName, - aTier, - aDescription, - aRecipes, - aInputSlots, - aOutputSlots, - aTankCapacity, - aAmperage, - aGUIParameterA, - aGUIParameterB, - aTextures, - aGUIName, - aNEIName, - aSound, - aSharedTank, - aRequiresFluidForFiltering, - aSpecialEffect); - } - - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(String aName, int aTier, String[] aDescription, - GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, - int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, - String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { - super( - aName, - aTier, - aDescription[0], - aRecipes, - aInputSlots, - aOutputSlots, - aTankCapacity, - aAmperage, - aGUIParameterA, - aGUIParameterB, - aTextures, - aGUIName, - aNEIName, - aSound, - aSharedTank, - aRequiresFluidForFiltering, - aSpecialEffect); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java deleted file mode 100644 index fea297a53d..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java +++ /dev/null @@ -1,220 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; - -import java.lang.reflect.Field; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import com.google.common.collect.BiMap; - -import gregtech.api.enums.Textures.BlockIcons; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Output { - - public final AutoMap<Fluid> mFluidsToUse = new AutoMap<Fluid>(); - public final int mFluidCapacity; - private int mTotalPlasmaSupported = -1; - - public GT_MetaTileEntity_Hatch_Plasma(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional, 6); - mFluidCapacity = 256000; - initHatch(); - } - - public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, 6, aDescription, aTextures); - mFluidCapacity = 256000; - initHatch(); - } - - public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String[] aDescription, - final ITexture[][][] aTextures) { - super(aName, 6, aDescription[0], aTextures); - mFluidCapacity = 256000; - initHatch(); - } - - private void initHatch() { - - // Get all Plasmas, but the easiest way to do this is to just ask the Fluid Registry what exists and filter - // through them lazily. - Field fluidNameCache; - - fluidNameCache = ReflectionUtils.getField(FluidRegistry.class, "fluidNames"); - - AutoMap<String> mValidPlasmaNameCache = new AutoMap<String>(); - if (fluidNameCache != null) { - try { - Object fluidNames = fluidNameCache.get(null); - if (fluidNames != null) { - try { - @SuppressWarnings("unchecked") - BiMap<Integer, String> fluidNamesMap = (BiMap<Integer, String>) fluidNames; - if (fluidNamesMap != null) { - for (String g : fluidNamesMap.values()) { - if (g.toLowerCase().contains("plasma")) { - mValidPlasmaNameCache.put(g); - } - } - } - } catch (ClassCastException e) {} - } - } catch (IllegalArgumentException | IllegalAccessException e) {} - } - - AutoMap<Fluid> mPlasmaCache = new AutoMap<Fluid>(); - if (!mValidPlasmaNameCache.isEmpty()) { - for (String y : mValidPlasmaNameCache) { - Fluid t = FluidRegistry.getFluid(y); - if (t != null) { - if (t.getTemperature() > 1000) { - mPlasmaCache.put(t); - } - } - } - } - - if (!mPlasmaCache.isEmpty()) { - for (Fluid w : mPlasmaCache) { - mFluidsToUse.put(w); - } - } - } - - @Override - public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture }; - } - - @Override - public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture }; - } - - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - if (side == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) { - for (Fluid f : mFluidsToUse) { - if (f != null) { - if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f) { - return true; - } - } - } - } - return false; - } - - @Override - public boolean isFluidInputAllowed(final FluidStack aFluid) { - for (Fluid f : mFluidsToUse) { - if (f != null) { - if (aFluid.getFluid() == f) { - return true; - } - } - } - return false; - } - - @Override - public int getCapacity() { - return this.mFluidCapacity; - } - - @Override - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Plasma(this.mName, this.mDescription, this.mTextures); - } - - @Override - public String[] getDescription() { - - if (mTotalPlasmaSupported < 0) { - if (mFluidsToUse.isEmpty()) { - mTotalPlasmaSupported = 0; - } else { - mTotalPlasmaSupported = mFluidsToUse.size(); - } - } - - String aX = EnumChatFormatting.GRAY + ""; - String a1 = EnumChatFormatting.GOLD + "Refined containment" + aX; - String a2 = EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.DARK_AQUA + getCapacity() + "L" + aX; - String a3 = EnumChatFormatting.GOLD + "Supports " - + EnumChatFormatting.DARK_RED - + mTotalPlasmaSupported - + EnumChatFormatting.GOLD - + " types of plasma" - + aX; - - String[] s2 = new String[] { a1, a2, a3, CORE.GT_Tooltip.get() }; - return s2; - } - - @Override - public boolean doesFillContainers() { - return true; - } - - @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - // TODO Auto-generated method stub - return super.getTextureSet(aTextures); - } - - private Field F1, F2; - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { - byte a1 = 0, a2 = 0; - try { - if (F1 == null) { - F1 = ReflectionUtils.getField(getClass(), "actualTexture"); - } - if (F2 == null) { - F2 = ReflectionUtils.getField(getClass(), "mTexturePage"); - } - - if (F1 != null) { - a1 = F1.getByte(this); - } - if (F2 != null) { - a2 = F2.getByte(this); - } - } catch (IllegalArgumentException | IllegalAccessException n) {} - - int textureIndex = a1 | a2 << 7; - byte texturePointer = (byte) (a1 & 127); - - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - ITexture g = textureIndex > 0 ? BlockIcons.casingTexturePages[a2][texturePointer] - : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]; - - return new ITexture[] { g }; - } - - return side != facing - ? (textureIndex > 0 ? new ITexture[] { BlockIcons.casingTexturePages[a2][texturePointer] } - : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }) - : (textureIndex > 0 - ? (aActive ? this.getTexturesActive(BlockIcons.casingTexturePages[a2][texturePointer]) - : this.getTexturesInactive(BlockIcons.casingTexturePages[a2][texturePointer])) - : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) - : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]))); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java deleted file mode 100644 index 0408469ecf..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java +++ /dev/null @@ -1,485 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; - -import static gregtech.api.enums.GT_Values.VN; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import cofh.api.energy.IEnergyReceiver; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.TextureSet; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; -import gregtech.api.interfaces.tileentity.IColoredTileEntity; -import gregtech.api.interfaces.tileentity.IEnergyConnected; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.MetaPipeEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Proxy; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import ic2.api.energy.tile.IEnergySink; - -public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements IMetaTileEntityCable { - - public final float mThickNess; - public final GT_Materials mMaterial; - public final long mCableLossPerMeter, mAmperage, mVoltage; - public final boolean mInsulated, mCanShock; - public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0; - public long mRestRF; - public short mOverheat; - public final int mWireHeatingTicks; - - public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional, - final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, - final long aVoltage, final boolean aInsulated, final boolean aCanShock) { - super(aID, aName, aNameRegional, 0); - this.mThickNess = aThickNess; - this.mMaterial = aMaterial; - this.mAmperage = aAmperage; - this.mVoltage = aVoltage; - this.mInsulated = aInsulated; - this.mCanShock = aCanShock; - this.mCableLossPerMeter = aCableLossPerMeter; - this.mWireHeatingTicks = this.getGT5Var(); - } - - public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial, - final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, - final boolean aCanShock) { - super(aName, 0); - this.mThickNess = aThickNess; - this.mMaterial = aMaterial; - this.mAmperage = aAmperage; - this.mVoltage = aVoltage; - this.mInsulated = aInsulated; - this.mCanShock = aCanShock; - this.mCableLossPerMeter = aCableLossPerMeter; - this.mWireHeatingTicks = this.getGT5Var(); - } - - private int getGT5Var() { - final Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass(); - final String lookingForValue = "mWireHeatingTicks"; - int temp = 4; - Field field; - try { - field = clazz.getClass().getField(lookingForValue); - final Class<?> clazzType = field.getType(); - if (clazzType.toString().equals("int")) { - temp = (field.getInt(clazz)); - } else { - temp = 4; - } - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - // - PLEASE REPORT THIS."); - Logger.WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); - Logger.ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); - temp = 4; - } - return temp; - } - - @Override - public byte getTileEntityBaseType() { - return (byte) (this.mInsulated ? 9 : 8); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaPipeEntityBase_Cable( - this.mName, - this.mThickNess, - this.mMaterial, - this.mCableLossPerMeter, - this.mAmperage, - this.mVoltage, - this.mInsulated, - this.mCanShock); - } - - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final byte aConnections, final int aColorIndex, final boolean aConnected, final boolean aRedstone) { - if (!this.mInsulated) { - return new ITexture[] { new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa) }; - } - if (aConnected) { - final float tThickNess = this.getThickNess(); - if (tThickNess < 0.37F) { - return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_TINY, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - if (tThickNess < 0.49F) { - return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_SMALL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - if (tThickNess < 0.74F) { - return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_MEDIUM, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - if (tThickNess < 0.99F) { - return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_LARGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_HUGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - return new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - } - - @Override - public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ, - final Entity aEntity) { - if (this.mCanShock && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0) - && (aEntity instanceof EntityLivingBase)) { - GT_Utility.applyElectricityDamage( - (EntityLivingBase) aEntity, - this.mTransferredVoltageLast20, - this.mTransferredAmperageLast20); - } - } - - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) { - if (!this.mCanShock) { - return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - } - return AxisAlignedBB - .getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isFacingValid(final ForgeDirection facing) { - return false; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return true; - } - - @Override - public final boolean renderInside(final ForgeDirection side) { - return false; - } - - @Override - public int getProgresstime() { - return (int) this.mTransferredAmperage * 64; - } - - @Override - public int maxProgresstime() { - return (int) this.mAmperage * 64; - } - - @Override - public long injectEnergyUnits(final ForgeDirection side, final long aVoltage, final long aAmperage) { - if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(side).letsEnergyIn( - side, - this.getBaseMetaTileEntity().getCoverIDAtSide(side), - this.getBaseMetaTileEntity().getCoverDataAtSide(side), - this.getBaseMetaTileEntity())) { - return 0; - } - return this.transferElectricity( - side, - aVoltage, - aAmperage, - new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity()))); - } - - @Override - public long transferElectricity(final ForgeDirection side, long aVoltage, final long aAmperage, - final ArrayList<TileEntity> aAlreadyPassedTileEntityList) { - long rUsedAmperes = 0; - aVoltage -= this.mCableLossPerMeter; - if (aVoltage > 0) { - for (final ForgeDirection targetSide : ForgeDirection.VALID_DIRECTIONS) { - if (rUsedAmperes > aAmperage) break; - final int ordinalTarget = targetSide.ordinal(); - if ((targetSide != side) && ((this.mConnections & (1 << ordinalTarget)) != 0) - && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(targetSide).letsEnergyOut( - targetSide, - this.getBaseMetaTileEntity().getCoverIDAtSide(targetSide), - this.getBaseMetaTileEntity().getCoverDataAtSide(targetSide), - this.getBaseMetaTileEntity())) { - final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(targetSide); - if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) { - aAlreadyPassedTileEntityList.add(tTileEntity); - if (tTileEntity instanceof IEnergyConnected) { - if (this.getBaseMetaTileEntity().getColorization() >= 0) { - final byte tColor = ((IEnergyConnected) tTileEntity).getColorization(); - if ((tColor >= 0) && (tColor != this.getBaseMetaTileEntity().getColorization())) { - continue; - } - } - if ((tTileEntity instanceof IGregTechTileEntity) - && (((IGregTechTileEntity) tTileEntity) - .getMetaTileEntity() instanceof IMetaTileEntityCable) - && ((IGregTechTileEntity) tTileEntity) - .getCoverBehaviorAtSide(targetSide.getOpposite()).letsEnergyIn( - targetSide.getOpposite(), - ((IGregTechTileEntity) tTileEntity) - .getCoverIDAtSide(targetSide.getOpposite()), - ((IGregTechTileEntity) tTileEntity) - .getCoverDataAtSide(targetSide.getOpposite()), - ((IGregTechTileEntity) tTileEntity))) { - if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) { - rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity) - .getMetaTileEntity()).transferElectricity( - targetSide.getOpposite(), - aVoltage, - aAmperage - rUsedAmperes, - aAlreadyPassedTileEntityList); - } - } else { - rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits( - targetSide.getOpposite(), - aVoltage, - aAmperage - rUsedAmperes); - } - - } else if (tTileEntity instanceof IEnergySink) { - final ForgeDirection oppositeDirection = targetSide.getOpposite(); - if (((IEnergySink) tTileEntity) - .acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(), oppositeDirection)) { - if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0) - && (((IEnergySink) tTileEntity) - .injectEnergy(oppositeDirection, aVoltage, aVoltage) < aVoltage)) { - rUsedAmperes++; - } - } - } else if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver)) { - final ForgeDirection oppositeDirection = targetSide.getOpposite(); - final int rfOut = (int) ((aVoltage * GregTech_API.mEUtoRF) / 100); - if (((IEnergyReceiver) tTileEntity).receiveEnergy(oppositeDirection, rfOut, true) - == rfOut) { - ((IEnergyReceiver) tTileEntity).receiveEnergy(oppositeDirection, rfOut, false); - rUsedAmperes++; - } else - if (((IEnergyReceiver) tTileEntity).receiveEnergy(oppositeDirection, rfOut, true) > 0) { - if (this.mRestRF == 0) { - final int RFtrans = ((IEnergyReceiver) tTileEntity) - .receiveEnergy(oppositeDirection, rfOut, false); - rUsedAmperes++; - this.mRestRF = rfOut - RFtrans; - } else { - final int RFtrans = ((IEnergyReceiver) tTileEntity) - .receiveEnergy(oppositeDirection, (int) this.mRestRF, false); - this.mRestRF = this.mRestRF - RFtrans; - } - } - if (GregTech_API.mRFExplosions - && (((IEnergyReceiver) tTileEntity).getMaxEnergyStored(oppositeDirection) - < (rfOut * 600))) { - if (rfOut > ((32 * GregTech_API.mEUtoRF) / 100)) { - this.doExplosion(rfOut); - } - } - } - } - } - } - } - - this.mTransferredAmperage += rUsedAmperes; - this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage); - this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage); - - if ((aVoltage > this.mVoltage) || (this.mTransferredAmperage > this.mAmperage)) { - if (this.mOverheat > (this.mWireHeatingTicks * 100)) { - this.getBaseMetaTileEntity().setToFire(); - } else { - this.mOverheat += 100; - } - return aAmperage; - } - - return rUsedAmperes; - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { - this.mTransferredAmperage = 0; - if (this.mOverheat > 0) { - this.mOverheat--; - } - - if ((aTick % 20) == 0) { - this.mTransferredVoltageLast20 = 0; - this.mTransferredAmperageLast20 = 0; - this.mConnections = 0; - for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - final int ordinalSide = side.ordinal(); - final ForgeDirection oppositeSide = side.getOpposite(); - if (aBaseMetaTileEntity.getCoverBehaviorAtSide(side).alwaysLookConnected( - side, - aBaseMetaTileEntity.getCoverIDAtSide(side), - aBaseMetaTileEntity.getCoverDataAtSide(side), - aBaseMetaTileEntity) - || aBaseMetaTileEntity.getCoverBehaviorAtSide(side).letsEnergyIn( - side, - aBaseMetaTileEntity.getCoverIDAtSide(side), - aBaseMetaTileEntity.getCoverDataAtSide(side), - aBaseMetaTileEntity) - || aBaseMetaTileEntity.getCoverBehaviorAtSide(side).letsEnergyOut( - side, - aBaseMetaTileEntity.getCoverIDAtSide(side), - aBaseMetaTileEntity.getCoverDataAtSide(side), - aBaseMetaTileEntity)) { - final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); - if (tTileEntity instanceof IColoredTileEntity) { - if (aBaseMetaTileEntity.getColorization() >= 0) { - final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization(); - if ((tColor >= 0) && (tColor != aBaseMetaTileEntity.getColorization())) { - continue; - } - } - } - if ((tTileEntity instanceof IEnergyConnected) - && (((IEnergyConnected) tTileEntity).inputEnergyFrom(oppositeSide) - || ((IEnergyConnected) tTileEntity).outputsEnergyTo(oppositeSide))) { - this.mConnections |= (1 << ordinalSide); - continue; - } - if ((tTileEntity instanceof IGregTechTileEntity) && (((IGregTechTileEntity) tTileEntity) - .getMetaTileEntity() instanceof IMetaTileEntityCable)) { - if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(oppositeSide) - .alwaysLookConnected( - oppositeSide, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity)) - || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(oppositeSide) - .letsEnergyIn( - oppositeSide, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity) - .getCoverDataAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity)) - || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(oppositeSide) - .letsEnergyOut( - oppositeSide, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity) - .getCoverDataAtSide(oppositeSide), - ((IGregTechTileEntity) tTileEntity))) { - this.mConnections |= (1 << ordinalSide); - continue; - } - } - if ((tTileEntity instanceof IEnergySink) && ((IEnergySink) tTileEntity) - .acceptsEnergyFrom((TileEntity) aBaseMetaTileEntity, oppositeSide)) { - this.mConnections |= (1 << ordinalSide); - continue; - } - if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver) - && ((IEnergyReceiver) tTileEntity).canConnectEnergy(oppositeSide)) { - this.mConnections |= (1 << ordinalSide); - continue; - } - - } - } - } - } - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public String[] getDescription() { - return new String[] { - "Max Voltage: " + EnumChatFormatting.GREEN - + this.mVoltage - + " (" - + VN[GT_Utility.getTier(this.mVoltage)] - + ")" - + EnumChatFormatting.GRAY, - "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY, - "Loss/Meter/Ampere: " + EnumChatFormatting.RED - + this.mCableLossPerMeter - + EnumChatFormatting.GRAY - + " EU-Volt" }; - } - - @Override - public float getThickNess() { - return this.mThickNess; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - // - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - // - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java index b50a40636a..714eb561d9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java @@ -24,7 +24,6 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false; public int mSuccess = 0, mTargetStackSize = 0; public UUID ownerUUID; - // UnbreakableBlockManager Xasda = new UnbreakableBlockManager(); private boolean value_last = false, value_current = false; public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java deleted file mode 100644 index b7f41b11c8..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java +++ /dev/null @@ -1,31 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.objects; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraftforge.fluids.Fluid; - -import gregtech.api.GregTech_API; - -public class GregtechFluid extends Fluid implements Runnable { - - public final String mTextureName; - private final short[] mRGBa; - - public GregtechFluid(final String aName, final String aTextureName, final short[] aRGBa) { - super(aName); - this.mRGBa = aRGBa; - this.mTextureName = aTextureName; - GregTech_API.sGTBlockIconload.add(this); - } - - @Override - public int getColor() { - return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) - | Math.max(0, Math.min(255, this.mRGBa[2])); - } - - @Override - public void run() { - this.setIcons(GregTech_API.sBlockIcons.registerIcon(GTPlusPlus.ID + ":" + "fluids/fluid." + this.mTextureName)); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java deleted file mode 100644 index 7f2fda6dd8..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java +++ /dev/null @@ -1,26 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.recipe; - -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.ToolDictNames; -import gregtech.api.interfaces.IOreRecipeRegistrator; -import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; - -public class ProcessingSkookumChoocherToolRecipes implements IOreRecipeRegistrator { - - public ProcessingSkookumChoocherToolRecipes() { - // GregtechOrePrefixes.toolSkookumChoocher.add(this); - } - - @Override - public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, - final String aModName, final ItemStack aStack) { - GT_ModHandler.addShapelessCraftingRecipe( - MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null), - new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), - ToolDictNames.craftingToolScrewdriver }); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java deleted file mode 100644 index bfbd4e6da3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java +++ /dev/null @@ -1,64 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile; - -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -public abstract class GTPP_Worldgen { - - public final String mWorldGenName; - public final boolean mEnabled; - private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>(); - - public GTPP_Worldgen(String aName, List aList, boolean aDefault) { - mWorldGenName = aName; - mEnabled = sCustomWorldgenFile.get("worldgen", mWorldGenName, aDefault); - if (mEnabled) aList.add(this); - } - - /** - * @param aWorld The World Object - * @param aRandom The Random Generator to use - * @param aBiome The Name of the Biome (always != null) - * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End - * @param aChunkX xCoord of the Chunk - * @param aChunkZ zCoord of the Chunk - * @return if the Worldgeneration has been successfully completed - */ - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - return false; - } - - /** - * @param aWorld The World Object - * @param aRandom The Random Generator to use - * @param aBiome The Name of the Biome (always != null) - * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End - * @param aChunkX xCoord of the Chunk - * @param aChunkZ zCoord of the Chunk - * @return if the Worldgeneration has been successfully completed - */ - public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - return false; - } - - public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - String aDimName = aWorld.provider.getDimensionName(); - Boolean tAllowed = mDimensionMap.get(aDimName); - if (tAllowed == null) { - boolean tValue = sCustomWorldgenFile - .get("worldgen.dimensions." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); - mDimensionMap.put(aDimName, tValue); - return tValue; - } - return tAllowed; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java deleted file mode 100644 index ffb1baf9f0..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java +++ /dev/null @@ -1,105 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -import gtPlusPlus.core.lib.CORE; - -public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore { - - public GTPP_Worldgen_Boulder(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { - super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) - && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { - for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); - Block tBlock = aWorld.getBlock(tX, tY - 7, tZ); - if (tBlock != null && tBlock.isOpaqueCube() - && aWorld.getBlock(tX, tY - 6, tZ).isAir(aWorld, tX, tY - 6, tZ)) { - float math_pi = CORE.PI; - float var6 = aRandom.nextFloat() * math_pi; - float var1b = mSize / 8.0F; - float var3b = MathHelper.sin(var6) * var1b; - float var4b = MathHelper.cos(var6) * var1b; - float var8b = -2 * var3b; - float var9b = -2 * var4b; - int var10b = (tX + 8); - int var11b = (tZ + 8); - float var7 = (var10b + var3b); - float var11 = (var11b + var4b); - int var5b = aRandom.nextInt(3); - int var6b = aRandom.nextInt(3); - int var7b = var6b - var5b; - float var15 = (tY + var5b - 2); - float var12b = math_pi / mSize; - - for (int var19 = 0; var19 <= mSize; ++var19) { - float var2b = var19 / mSize; - float var20 = var7 + var8b * var2b; - float var22 = var15 + var7b * var2b; - float var24 = var11 + var9b * var2b; - float var26 = aRandom.nextFloat() * mSize / 16.0F; - float var28 = ((MathHelper.sin(var19 * var12b) + 1.0F) * var26 + 1.0F) / 2.0F; - int var32 = MathHelper.floor_float(var20 - var28); - int var33 = MathHelper.floor_float(var22 - var28); - int var34 = MathHelper.floor_float(var24 - var28); - int var35 = MathHelper.floor_float(var20 + var28); - int var36 = MathHelper.floor_float(var22 + var28); - int var37 = MathHelper.floor_float(var24 + var28); - - for (int var38 = var32; var38 <= var35; ++var38) { - float var39 = (var38 + 0.5F - var20) / (var28); - float var13b = var39 * var39; - if (var13b < 1.0F) { - for (int var41 = var33; var41 <= var36; ++var41) { - float var42 = (var41 + 0.5F - var22) / (var28); - float var14b = var13b + var42 * var42; - if (var14b < 1.0F) { - for (int var44 = var34; var44 <= var37; ++var44) { - float var45 = (var44 + 0.5F - var24) / (var28); - Block block = aWorld.getBlock(var38, var41, var44); - if (var14b + var45 * var45 < 1.0F && ((mAllowToGenerateinVoid && aWorld - .getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) - || (block != null && !(block instanceof BlockContainer)))) { - aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); - } - } - } - } - } - } - } - } - } - return true; - } - return false; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java deleted file mode 100644 index 6e87662ef1..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java +++ /dev/null @@ -1,252 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.common.blocks.GT_TileEntity_Ores; -import gregtech.loaders.misc.GT_Achievements; -import gtPlusPlus.core.material.Material; - -public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { - - public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>(); - public static int sWeight = 0; - public final short mMinY; - public final short mMaxY; - public final short mWeight; - public final short mDensity; - public final short mSize; - public short mPrimaryMeta; - public short mSecondaryMeta; - public short mBetweenMeta; - public short mSporadicMeta; - public final String mRestrictBiome; - public final boolean mDarkWorld; - public final String aTextWorldgen = "worldgen.gtpp."; - - public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, boolean aOverworld, Materials aPrimary, Materials aSecondary, Materials aBetween, - Materials aSporadic) { - super(aName, sList, aDefault); - this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math - .max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - this.mPrimaryMeta = ((short) sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); - this.mSecondaryMeta = ((short) sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); - this.mBetweenMeta = ((short) sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); - this.mSporadicMeta = ((short) sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mRestrictBiome = sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); - - if (this.mEnabled) { - GT_Achievements.registerOre( - GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], - aMinY, - aMaxY, - aWeight, - false, - false, - false); - GT_Achievements.registerOre( - GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], - aMinY, - aMaxY, - aWeight, - false, - false, - false); - GT_Achievements.registerOre( - GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], - aMinY, - aMaxY, - aWeight, - false, - false, - false); - GT_Achievements.registerOre( - GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], - aMinY, - aMaxY, - aWeight, - false, - false, - false); - sWeight += this.mWeight; - } - } - - public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, - int aSize, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { - super(aName, sList, aDefault); - this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true); - this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math - .max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); - this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - /* - * this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", - * aPrimary.mMetaItemSubID)); this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + - * this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); this.mBetweenMeta = ((short) - * sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", - * aBetween.mMetaItemSubID)); this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + - * this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - */ this.mRestrictBiome = sCustomWorldgenFile - .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); - - if (this.mEnabled) { - /* - * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, - * aWeight, false, false, false); - * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, - * aWeight, false, false, false); GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta - * % 1000)], aMinY, aMaxY, aWeight, false, false, false); - * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, - * aWeight, false, false, false); - */ sWeight += this.mWeight; - } - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { - return false; // Not the correct biome for ore mix - } - if (!isGenerationAllowed( - aWorld, - aDimensionType, - ((aDimensionType == -1) && (false)) || ((aDimensionType == 0) && (this.mDarkWorld)) - || ((aDimensionType == 1) && (false)) - || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) - || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) ? aDimensionType - : aDimensionType ^ 0xFFFFFFFF)) { - return false; - } - int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); - - int cX = aChunkX - aRandom.nextInt(this.mSize); - int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); - for (int tX = cX; tX <= eX; tX++) { - int cZ = aChunkZ - aRandom.nextInt(this.mSize); - int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); - for (int tZ = cZ; tZ <= eZ; tZ++) { - if (this.mSecondaryMeta > 0) { - for (int i = tMinY - 1; i < tMinY + 2; i++) { - if ((aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0)) { - setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); - } - } - } - if ((this.mBetweenMeta > 0) && ((aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) - == 0) - || (aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0))) { - setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); - } - if (this.mPrimaryMeta > 0) { - for (int i = tMinY + 3; i < tMinY + 6; i++) { - if ((aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0)) { - setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); - } - } - } - if ((this.mSporadicMeta > 0) && ((aRandom.nextInt( - Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) - == 0) - || (aRandom.nextInt( - Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0))) { - setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); - } - } - } - if (GT_Values.D1) { - System.out.println("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); - } - return true; - } - - private Method mSetOre = null; - - private boolean setOreBlock(World world, int x, int y, int z, int secondarymeta, boolean bool) { - - if (mSetOre == null) { - try { - mSetOre = GT_TileEntity_Ores.class.getMethod( - "setOreBlock", - World.class, - int.class, - int.class, - int.class, - int.class, - boolean.class); - } catch (SecurityException | NoSuchMethodException e) { - try { - mSetOre = GT_TileEntity_Ores.class - .getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class); - } catch (SecurityException | NoSuchMethodException r) {} - } - } - - if (mSetOre != null) { - try { - return (boolean) mSetOre.invoke(world, x, y, z, secondarymeta, bool); - } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException t) { - return false; - } - } else { - return false; - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java deleted file mode 100644 index 8ed90b799f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java +++ /dev/null @@ -1,46 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import static gtPlusPlus.xmod.gregtech.api.world.WorldGenUtils.mOresToRegister; - -import gtPlusPlus.core.material.Material; - -public class GTPP_Worldgen_Handler implements Runnable { - - @Override - public void run() { - - for (GT_OreVein_Object ore : mOresToRegister) { - generateNewVein(ore); - } - } - - private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(final GT_OreVein_Object ore) { - return generateNewVein( - ore.mOreMixName, - ore.minY, - ore.maxY, - ore.weight, - ore.density, - ore.size, - ore.aPrimary, - ore.aSecondary, - ore.aBetween, - ore.aSporadic); - } - - private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(String mOreMixName, int minY, int maxY, int weight, - int density, int size, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { - return new GTPP_Worldgen_GT_Ore_Layer( - "ore.mix." + mOreMixName, // String aName, - true, // boolean aDefault, - minY, - maxY, // int aMinY, int aMaxY, - weight, // int aWeight, - density, // int aDensity, - size, // int aSize, - aPrimary, // Materials aPrimary, - aSecondary, // Materials aSecondary, - aBetween, // Materials aBetween, - aSporadic); // Materials aSporadic - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java deleted file mode 100644 index 22b64d6cfc..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java +++ /dev/null @@ -1,36 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile; - -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.block.Block; - -import gtPlusPlus.xmod.gregtech.HANDLER_GT; - -public abstract class GTPP_Worldgen_Ore extends GTPP_Worldgen { - - public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType; - public final Block mBlock; - public final Collection<String> mBiomeList; - public final boolean mAllowToGenerateinVoid; - private final String aTextWorldgen = "worldgen."; - - public GTPP_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { - super(aName, HANDLER_GT.sCustomWorldgenList, aDefault); - mDimensionType = aDimensionType; - mBlock = aBlock; - mBlockMeta = Math.min(Math.max(aBlockMeta, 0), 15); - mProbability = sCustomWorldgenFile.get(aTextWorldgen + mWorldGenName, "Probability", aProbability); - mAmount = sCustomWorldgenFile.get(aTextWorldgen + mWorldGenName, "Amount", aAmount); - mSize = sCustomWorldgenFile.get(aTextWorldgen + mWorldGenName, "Size", aSize); - mMinY = sCustomWorldgenFile.get(aTextWorldgen + mWorldGenName, "MinHeight", aMinY); - mMaxY = sCustomWorldgenFile.get(aTextWorldgen + mWorldGenName, "MaxHeight", aMaxY); - if (aBiomeList == null) mBiomeList = new ArrayList<String>(); - else mBiomeList = aBiomeList; - mAllowToGenerateinVoid = aAllowToGenerateinVoid; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java deleted file mode 100644 index b8113d5f86..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java +++ /dev/null @@ -1,120 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -import gtPlusPlus.core.lib.CORE; - -public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore { - - public GTPP_Worldgen_Ore_Normal(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { - super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); - } - - @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) - && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { - for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); - if (mAllowToGenerateinVoid || aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) { - float math_pi = CORE.PI; - float var1b = mSize / 8.0F; - float var6 = aRandom.nextFloat() * math_pi; - float var3b = MathHelper.sin(var6) * var1b; - float var4b = MathHelper.cos(var6) * var1b; - float var8b = -2 * var3b; - float var9b = -2 * var4b; - int var10b = (tX + 8); - int var11b = (tZ + 8); - float var7 = (var10b + var3b); - float var11 = (var11b + var4b); - int var5b = aRandom.nextInt(3); - int var6b = aRandom.nextInt(3); - int var7b = var6b - var5b; - float var15 = (tY + var5b - 2); - float var12b = math_pi / mSize; - - for (int var19 = 0; var19 <= mSize; ++var19) { - float var2b = var19 / mSize; - float var20 = var7 + var8b * var2b; - float var22 = var15 + var7b * var2b; - float var24 = var11 + var9b * var2b; - float var26 = aRandom.nextFloat() * mSize / 16.0F; - float var28 = ((MathHelper.sin(var19 * var12b) + 1.0F) * var26 + 1.0F) / 2.0F; - int var32 = MathHelper.floor_float(var20 - var28); - int var33 = MathHelper.floor_float(var22 - var28); - int var34 = MathHelper.floor_float(var24 - var28); - int var35 = MathHelper.floor_float(var20 + var28); - int var36 = MathHelper.floor_float(var22 + var28); - int var37 = MathHelper.floor_float(var24 + var28); - - for (int var38 = var32; var38 <= var35; ++var38) { - float var39 = (var38 + 0.5F - var20) / (var28); - float var13b = var39 * var39; - if (var13b < 1.0F) { - for (int var41 = var33; var41 <= var36; ++var41) { - float var42 = (var41 + 0.5F - var22) / (var28); - float var14b = var13b + var42 * var42; - if (var14b < 1.0F) { - for (int var44 = var34; var44 <= var37; ++var44) { - float var45 = (var44 + 0.5F - var24) / (var28); - Block block = aWorld.getBlock(var38, var41, var44); - if (var14b + var45 * var45 < 1.0F && ((mAllowToGenerateinVoid && aWorld - .getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) - || (block != null && (block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.stone) - || block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.end_stone) - || block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.netherrack))))) { - aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); - } - } - } - } - } - } - } - } - } - return true; - } - return false; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java deleted file mode 100644 index 65813693b3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java +++ /dev/null @@ -1,30 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import gtPlusPlus.core.material.Material; - -public class GT_OreVein_Object { - - final String mOreMixName; // String aName, - final int minY, maxY; // int aMinY, int aMaxY, - final int weight; // int aWeight, - final int density; // int aDensity, - final int size; // int aSize, - final Material aPrimary; // Materials aPrimary, - final Material aSecondary; // Materials aSecondary, - final Material aBetween; // Materials aBetween, - final Material aSporadic; // Materials aSporadic - - GT_OreVein_Object(String mOreMixName, int minY, int maxY, int weight, int density, int size, Material aPrimary, - Material aSecondary, Material aBetween, Material aSporadic) { - this.mOreMixName = mOreMixName; - this.minY = minY; - this.maxY = maxY; - this.weight = weight; - this.density = density; - this.size = size; - this.aPrimary = aPrimary; - this.aSecondary = aSecondary; - this.aBetween = aBetween; - this.aSporadic = aSporadic; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java deleted file mode 100644 index 5ca61cf4d7..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java +++ /dev/null @@ -1,32 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.world; - -import java.util.ArrayList; -import java.util.List; - -import gtPlusPlus.core.material.Material; - -public class WorldGenUtils { - - static List<GT_OreVein_Object> mOresToRegister = new ArrayList<GT_OreVein_Object>(); - - public static final void addNewOreMixForWorldgen(GT_OreVein_Object newVein) { - mOresToRegister.add(newVein); - } - - public static boolean generateNewOreVeinObject(String mOreMixName, int minY, int maxY, int weight, int density, - int size, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { - GT_OreVein_Object newVein = new GT_OreVein_Object( - mOreMixName, - minY, - maxY, - weight, - density, - size, - aPrimary, - aSecondary, - aBetween, - aSporadic); - addNewOreMixForWorldgen(newVein); - return true; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java deleted file mode 100644 index 13d58aac5f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java +++ /dev/null @@ -1,37 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public class GregtechMetaItemCasings1 extends GregtechMetaItemCasingsAbstract { - - public GregtechMetaItemCasings1(final Block par1) { - super(par1); - } - - @Override - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, - final boolean aF3_H) { - super.addInformation(aStack, aPlayer, aList, aF3_H); - switch (this.getDamage(aStack)) { - case 0: - aList.add(this.mCasing_Centrifuge); - break; - case 1: - aList.add(this.mCasing_CokeOven); - break; - case 2: - aList.add(this.mCasing_CokeCoil1); - break; - case 3: - aList.add(this.mCasing_CokeCoil2); - break; - default: - aList.add(this.mCasing_CokeCoil2); - break; - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index ae9f49c60a..ec1ee2a226 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -9,8 +9,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; public class CasingTextureHandler { - // private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); - // private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58(); private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock(); public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java deleted file mode 100644 index 5d907f7e3b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java +++ /dev/null @@ -1,532 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks.textures; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; - -public class TexturesGregtech59 { - - private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE1"); - private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST1"); - private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE2"); - private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST2"); - private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE3"); - private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST3"); - private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE4"); - private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST4"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST5"); - private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE6"); - private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST6"); - private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE7"); - private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST7"); - private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE8"); - private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST8"); - private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE9"); - private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST9"); - - private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1); - private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active); - private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2); - private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active); - private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3); - private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active); - private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4); - private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active); - private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5); - private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active); - private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6); - private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active); - private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7); - private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active); - private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8); - private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active); - private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9); - private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active); - - Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { frontFace_0, frontFace_1, - frontFace_2, frontFace_3, frontFace_4, frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - - Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { frontFaceActive_0, - frontFaceActive_1, frontFaceActive_2, frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, - frontFaceActive_6, frontFaceActive_7, frontFaceActive_8 }; - - public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, side, thisBlock); - } - - public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - final int ordinalSide = side.ordinal(); - if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { - return CasingTextureHandler.getIcon(ordinalSide, tMeta); - } - final int tStartIndex = tMeta == 6 ? 1 : 13; - if (tMeta == 0) { - if ((side == ForgeDirection.NORTH) || (side == ForgeDirection.SOUTH)) { - TileEntity tTileEntity; - IMetaTileEntity tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[0].getIcon(); - } - return this.TURBINE[0].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[3].getIcon(); - } - return this.TURBINE[3].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[6].getIcon(); - } - return this.TURBINE[6].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[1].getIcon(); - } - return this.TURBINE[1].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[7].getIcon(); - } - return this.TURBINE[7].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[8].getIcon(); - } - return this.TURBINE[8].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[5].getIcon(); - } - return this.TURBINE[5].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[2].getIcon(); - } - return this.TURBINE[2].getIcon(); - } - } else if ((side == ForgeDirection.WEST) || (side == ForgeDirection.EAST)) { - TileEntity tTileEntity; - Object tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[0].getIcon(); - } - return this.TURBINE[0].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[3].getIcon(); - } - return this.TURBINE[3].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[6].getIcon(); - } - return this.TURBINE[6].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[1].getIcon(); - } - return this.TURBINE[1].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[7].getIcon(); - } - return this.TURBINE[7].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[8].getIcon(); - } - return this.TURBINE[8].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[5].getIcon(); - } - return this.TURBINE[5].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[2].getIcon(); - } - return this.TURBINE[2].getIcon(); - } - } - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); - } - final boolean[] tConnectedSides = { - (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), - (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) }; - switch (side) { - case DOWN: - if (tConnectedSides[0]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[2])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[5]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case UP: - if (tConnectedSides[1]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case NORTH: - if (tConnectedSides[5]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case SOUTH: - if (tConnectedSides[3]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case WEST: - if (tConnectedSides[4]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - case EAST: - if (tConnectedSides[2]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - break; - } - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java deleted file mode 100644 index e246697285..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java +++ /dev/null @@ -1,185 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.covers; - -import java.lang.reflect.Field; -import java.util.HashMap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.minecraft.LangUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { - - public final int mInitialCapacity; - public final int mMaxItemCapacity; - - public static final Class sQuantumChest; - public static final Class sSuperChestGTPP; - public static final Class sSuperChestGTNH; - public static HashMap<Integer, Field> mItemAmountFields = new HashMap<Integer, Field>(); - public static HashMap<Integer, Field> mItemTypeFields = new HashMap<Integer, Field>(); - - static { - sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest"); - sSuperChestGTPP = ReflectionUtils - .getClass("gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); - sSuperChestGTNH = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); - if (sQuantumChest != null) { - mItemAmountFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemCount")); - mItemTypeFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemStack")); - } - if (sSuperChestGTPP != null) { - mItemAmountFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemCount")); - mItemTypeFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemStack")); - } - if (sSuperChestGTNH != null) { - mItemAmountFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemCount")); - mItemTypeFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemStack")); - } - } - - public GTPP_Cover_Overflow_Item(int aCapacity) { - this.mInitialCapacity = aCapacity; - this.mMaxItemCapacity = aCapacity * 1000; - } - - public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity, long aTimer) { - if (aCoverVariable == 0) { - return aCoverVariable; - } - - // Get the IGTTile - IGregTechTileEntity aGtTileEntity = aTileEntity - .getIGregTechTileEntity(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); - if (aGtTileEntity == null) { - return aCoverVariable; - } - - // Get the MetaTile - final IMetaTileEntity aMetaTileEntity = aGtTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return aCoverVariable; - } - boolean didHandle = false; - // Special Case for everything I want to support. /facepalm - if (sQuantumChest != null && sQuantumChest.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 0); - } else if (sSuperChestGTPP.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 1); - - } else if (sSuperChestGTNH != null && sSuperChestGTNH.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 2); - } - - return aCoverVariable; - } - - private boolean handleDigitalChest(IMetaTileEntity aTile, int aType) { - int aItemAmount = (int) ReflectionUtils.getFieldValue(mItemAmountFields.get(aType), aTile); - ItemStack aItemType = (ItemStack) ReflectionUtils.getFieldValue(mItemTypeFields.get(aType), aTile); - - if (aItemType == null || aItemAmount <= 0) { - return false; - } else { - if (aItemAmount > mInitialCapacity) { - int aNewItemAmount = mInitialCapacity; - ReflectionUtils.setField(aTile, mItemAmountFields.get(aType), aNewItemAmount); - } - } - return true; - } - - public int onCoverScrewdriverclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); - } else { - aCoverVariable -= (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); - } - if (aCoverVariable > mMaxItemCapacity) { - aCoverVariable = mInitialCapacity; - } - if (aCoverVariable <= 0) { - aCoverVariable = mMaxItemCapacity; - } - GT_Utility.sendChatToPlayer( - aPlayer, - LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); - return aCoverVariable; - } - - public boolean onCoverRightclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - boolean aShift = aPlayer.isSneaking(); - int aAmount = aShift ? 128 : 8; - if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aAmount; - } else { - aCoverVariable -= aAmount; - } - if (aCoverVariable > mMaxItemCapacity) { - aCoverVariable = mInitialCapacity; - } - if (aCoverVariable <= 0) { - aCoverVariable = mMaxItemCapacity; - } - GT_Utility.sendChatToPlayer( - aPlayer, - LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); - aTileEntity.setCoverDataAtSide(side, aCoverVariable); - return true; - } - - public boolean letsRedstoneGoIn(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsRedstoneGoOut(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyIn(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyOut(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsIn(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsOut(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { - return true; - } - - public boolean letsFluidIn(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { - return false; - } - - public boolean letsFluidOut(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { - return true; - } - - public boolean alwaysLookConnected(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public int getTickRate(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 5; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java deleted file mode 100644 index 0d85d6299f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.helpers; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Container; -import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; - -public class CraftingHelper { - - public final String mInventoryName; - public final int mPosX; - public final int mPosY; - public final int mPosZ; - public final GT4Entity_AutoCrafter crafter; - public final World world; - public final EntityPlayerMP player; - public final AC_Helper_Container inventory; - - public CraftingHelper(GT4Entity_AutoCrafter AC) { - Logger.INFO("[A-C] Created a crafting helper."); - crafter = AC; - AC_Helper_Utils.addCrafter(AC); - // Get some variables. - world = AC.getBaseMetaTileEntity().getWorld(); - mPosX = AC.getBaseMetaTileEntity().getXCoord(); - mPosY = AC.getBaseMetaTileEntity().getYCoord(); - mPosZ = AC.getBaseMetaTileEntity().getZCoord(); - // Create Fake player to handle crating. - - player = CORE.getFakePlayer(world); - // Set storage container - inventory = new AC_Helper_Container(player.inventory, world, mPosX, mPosY, mPosZ); - mInventoryName = inventory.getMatrix().getInventoryName(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java index 616475b66b..b866be1d87 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java @@ -8,8 +8,8 @@ import net.minecraftforge.oredict.OreDictionary; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.sys.Log; public class FlotationRecipeHandler { @@ -19,7 +19,7 @@ public class FlotationRecipeHandler { public static boolean registerOreType(Material aMaterial) { String aMaterialKey = aMaterial.getUnlocalizedName(); if (sMaterialMap.containsKey(aMaterialKey)) { - Log.warn("Tried to register a Flotation material already in use. Material: " + aMaterialKey); + Logger.WARNING("Tried to register a Flotation material already in use. Material: " + aMaterialKey); return false; } else { sMaterialMap.put(aMaterialKey, aMaterial); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java deleted file mode 100644 index b9ba13fa3f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java +++ /dev/null @@ -1,410 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.helpers.treefarm; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSapling; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Direction; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenAbstractTree; -import net.minecraftforge.common.util.ForgeDirection; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.FakeBlockPos; -import gtPlusPlus.api.objects.minecraft.FakeWorld; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; - -public class TreeGenerator { - - private static final FakeTreeInFakeWorldGenerator mTreeData; - - static { - Logger.WARNING("Created Fake Tree Generator."); - mTreeData = new FakeTreeInFakeWorldGenerator(); - } - - public TreeGenerator() { - if (!mTreeData.hasGenerated) { - mTreeData.generate(null, CORE.RANDOM, 0, 0, 0); - } - } - - public AutoMap<ItemStack> generateOutput(int aTreeSize) { - AutoMap<ItemStack> aOutputMap = mTreeData.getOutputFromTree(); - if (aOutputMap != null && aOutputMap.size() > 0) { - Logger.WARNING("Valid tree data output"); - return aOutputMap; - } - Logger.WARNING("Invalid tree data output"); - return new AutoMap<ItemStack>(); - } - - public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree { - - /** The minimum height of a generated tree. */ - private final int minTreeHeight; - /** True if this tree should grow Vines. */ - private final boolean vinesGrow; - /** The metadata value of the wood to use in tree generation. */ - private final int metaWood; - /** The metadata value of the leaves to use in tree generation. */ - private final int metaLeaves; - - private final AutoMap<FakeWorld> mFakeWorld; - private final int mTreesToGenerate; - - private int mCurrentGeneratorIteration = 0; - - private boolean hasGenerated = false; - private AutoMap<ItemStack> aOutputsFromGenerator = new AutoMap<ItemStack>(); - - public FakeTreeInFakeWorldGenerator() { - this(4, 0, 0, false, 5000); - } - - public FakeTreeInFakeWorldGenerator(int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, - int aTreeCount) { - super(false); - this.minTreeHeight = aMinHeight; - this.metaWood = aWoodMeta; - this.metaLeaves = aLeafMeta; - this.vinesGrow = aVines; - this.mFakeWorld = new AutoMap<FakeWorld>(); - this.mTreesToGenerate = aTreeCount; - Logger.WARNING("Created Fake Tree In Fake World Instance."); - } - - public AutoMap<ItemStack> getOutputFromTree() { - if (!hasGenerated) { - Logger.WARNING("Generating Tree sample data"); - generate(null, CORE.RANDOM, 0, 0, 0); - } - AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>(); - int aRandomTreeID = MathUtils.randInt(0, this.mFakeWorld.size() - 1); - FakeWorld aWorld = this.mFakeWorld.get(aRandomTreeID); - if (aWorld != null) { - // Logger.WARNING("Getting all block data from fake world"); - aOutputMap = aWorld.getAllBlocksStoredInFakeWorld(); - } - return aOutputMap; - } - - @Override - protected boolean func_150523_a(Block p_150523_1_) { - return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves - || p_150523_1_ == Blocks.grass - || p_150523_1_ == Blocks.dirt - || p_150523_1_ == Blocks.log - || p_150523_1_ == Blocks.log2 - || p_150523_1_ == Blocks.sapling - || p_150523_1_ == Blocks.vine; - } - - @Override - protected boolean isReplaceable(World world, int x, int y, int z) { - FakeWorld aWorld = getWorld(); - Block block = aWorld.getBlock(x, y, z); - return block.isAir(null, x, y, z) || block.isLeaves(null, x, y, z) - || block.isWood(null, x, y, z) - || func_150523_a(block); - } - - @Override - public boolean generate(World world, Random aRand, int aWorldX, int aWorldRealY, int aWorldZ) { - // Only Generate Once - This object is Cached - if (hasGenerated) { - return hasGenerated; - } else { - for (int yy = 0; yy < mTreesToGenerate; yy++) { - generateTree(0, 0, 0); - mCurrentGeneratorIteration++; - } - hasGenerated = true; - if (this.mFakeWorld.size() > 0) { - for (FakeWorld aWorld : this.mFakeWorld) { - for (ItemStack aBlockInFakeWorld : aWorld.getAllBlocksStoredInFakeWorld()) { - aOutputsFromGenerator.add(aBlockInFakeWorld); - } - } - return true; - } else { - return false; - } - } - } - - private FakeWorld aFakeWorld; - - public FakeWorld getWorld() { - FakeWorld aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration); - if (aWorld == null) { - this.mFakeWorld.set(mCurrentGeneratorIteration, new FakeWorld(200)); - aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration); - } - return aWorld; - } - - public boolean generateTree(int aWorldX, int aWorldRealY, int aWorldZ) { - FakeWorld aWorld = getWorld(); - - // Set some static values - - Logger.WARNING("Stepping through generateTree [0]"); - // Dummy Value - int aWorldY = 10; - - int l = CORE.RANDOM.nextInt(3) + this.minTreeHeight; - boolean flag = true; - - if (aWorldY >= 1 && aWorldY + l + 1 <= 256) { - Logger.WARNING("Stepping through generateTree [1]"); - byte b0; - int k1; - Block block; - - for (int i1 = aWorldY; i1 <= aWorldY + 1 + l; ++i1) { - b0 = 1; - - if (i1 == aWorldY) { - b0 = 0; - } - - if (i1 >= aWorldY + 1 + l - 2) { - b0 = 2; - } - - for (int j1 = aWorldX - b0; j1 <= aWorldX + b0 && flag; ++j1) { - for (k1 = aWorldZ - b0; k1 <= aWorldZ + b0 && flag; ++k1) { - if (i1 >= 0 && i1 < 256) { - block = aWorld.getBlock(j1, i1, k1); - - if (!this.isReplaceable(null, j1, i1, k1)) { - flag = false; - } - } else { - flag = false; - } - } - } - } - - if (!flag) { - Logger.WARNING("Stepping through generateTree [2]"); - return false; - } else { - Logger.WARNING("Stepping through generateTree [3]"); - Block block2 = aWorld.getBlock(aWorldX, aWorldY - 1, aWorldZ); - FakeBlockPos aBlockToGrowPlantOn = aWorld.getBlockAtCoords(aWorldX, aWorldY - 1, aWorldZ); - - boolean isSoil = block2.canSustainPlant( - aWorld, - aWorldX, - aWorldY - 1, - aWorldZ, - ForgeDirection.UP, - (BlockSapling) Blocks.sapling); - if ( - /* isSoil && */ aWorldY < 256 - l - 1) { - Logger.WARNING("Stepping through generateTree [4]"); - aBlockToGrowPlantOn - .onPlantGrow(aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ); - b0 = 3; - byte b1 = 0; - int l1; - int i2; - int j2; - int i3; - - for (k1 = aWorldY - b0 + l; k1 <= aWorldY + l; ++k1) { - i3 = k1 - (aWorldY + l); - l1 = b1 + 1 - i3 / 2; - - for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) { - j2 = i2 - aWorldX; - - for (int k2 = aWorldZ - l1; k2 <= aWorldZ + l1; ++k2) { - int l2 = k2 - aWorldZ; - - if (Math.abs(j2) != l1 || Math.abs(l2) != l1 - || CORE.RANDOM.nextInt(2) != 0 && i3 != 0) { - Block block1 = aWorld.getBlock(i2, k1, k2); - - if (block1.isAir(null, i2, k1, k2) || block1.isLeaves(null, i2, k1, k2)) { - this.setBlockAndNotifyAdequately( - aWorld, - i2, - k1, - k2, - Blocks.leaves, - this.metaLeaves); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [5]"); - - for (k1 = 0; k1 < l; ++k1) { - block = aWorld.getBlock(aWorldX, aWorldY + k1, aWorldZ); - - if (block.isAir(null, aWorldX, aWorldY + k1, aWorldZ) - || block.isLeaves(null, aWorldX, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ, - Blocks.log, - this.metaWood); - - if (this.vinesGrow && k1 > 0) { - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX - 1, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX - 1, - aWorldY + k1, - aWorldZ, - Blocks.vine, - 8); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX + 1, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX + 1, - aWorldY + k1, - aWorldZ, - Blocks.vine, - 2); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ - 1)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ - 1, - Blocks.vine, - 1); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ + 1)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ + 1, - Blocks.vine, - 4); - } - } - } - } - Logger.WARNING("Stepping through generateTree [6]"); - - if (this.vinesGrow) { - Logger.WARNING("Stepping through generateTree [7]"); - for (k1 = aWorldY - 3 + l; k1 <= aWorldY + l; ++k1) { - i3 = k1 - (aWorldY + l); - l1 = 2 - i3 / 2; - - for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) { - for (j2 = aWorldZ - l1; j2 <= aWorldZ + l1; ++j2) { - if (aWorld.getBlock(i2, k1, j2).isLeaves(null, i2, k1, j2)) { - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 - 1, k1, j2).isAir(null, i2 - 1, k1, j2)) { - this.growVines(aWorld, i2 - 1, k1, j2, 8); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 + 1, k1, j2).isAir(null, i2 + 1, k1, j2)) { - this.growVines(aWorld, i2 + 1, k1, j2, 2); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 - 1).isAir(null, i2, k1, j2 - 1)) { - this.growVines(aWorld, i2, k1, j2 - 1, 1); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 + 1).isAir(null, i2, k1, j2 + 1)) { - this.growVines(aWorld, i2, k1, j2 + 1, 4); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [8]"); - - if (CORE.RANDOM.nextInt(5) == 0 && l > 5) { - for (k1 = 0; k1 < 2; ++k1) { - for (i3 = 0; i3 < 4; ++i3) { - if (CORE.RANDOM.nextInt(4 - k1) == 0) { - l1 = CORE.RANDOM.nextInt(3); - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX + Direction.offsetX[Direction.rotateOpposite[i3]], - aWorldY + l - 5 + k1, - aWorldZ + Direction.offsetZ[Direction.rotateOpposite[i3]], - Blocks.cocoa, - l1 << 2 | i3); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [9]"); - return true; - } else { - Logger.WARNING("Stepping through generateTree [10]"); - return false; - } - } - } else { - Logger.WARNING("Stepping through generateTree [11]"); - return false; - } - } - - /** - * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length - */ - private void growVines(FakeWorld aWorld, int aX, int aY, int aZ, int aMeta) { - int aLoopSize = vinesGrow ? MathUtils.randInt(0, 4) : 0; - for (int i = 0; i < aLoopSize; i++) { - this.setBlockAndNotifyAdequately(aWorld, aX, aY, aZ, Blocks.vine, aMeta); - } - } - - @Override - protected void setBlockAndNotifyAdequately(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - setBlockAndNotifyAdequately(getWorld(), aX, aY, aZ, aBlock, aMeta); - } - - protected void setBlockAndNotifyAdequately(FakeWorld aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - if (aBlock != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) { - Logger.WARNING( - "Setting block " + aX - + ", " - + aY - + ", " - + aZ - + " | " - + aBlock.getLocalizedName() - + " | " - + aMeta); - aWorld.setBlockAtCoords(aX, aY, aZ, aBlock, aMeta); - // aOutputsFromGenerator.put(ItemUtils.simpleMetaStack(aBlock, aMeta, 1)); - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 292ecf807d..cc4503e46e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -446,47 +446,6 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Chip_MultiNerf_NoSpeedBonus .set(this.addItem(161, "No-Bonus Chip", "You won't like using this")); GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this")); - - /* - * GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", - * "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, - * "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, - * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, - * "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, - * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, - * "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new - * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), - * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - * GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", - * "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, - * "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new - * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), - * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144)); - */ } private boolean registerComponents_ULV() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java deleted file mode 100644 index 94a18c8f07..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java +++ /dev/null @@ -1,95 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.items.behaviours; - -import java.util.List; - -import net.minecraft.dispenser.IBlockSource; -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.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.IItemBehaviour; -import gregtech.api.items.GT_MetaBase_Item; - -public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> { - - @Override - public boolean onLeftClickEntity(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, Entity var4) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean onItemUse(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, int var6, - int var7, int var8, float var9, float var10, float var11) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean onItemUseFirst(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, - int var6, int var7, ForgeDirection side, float var9, float var10, float var11) { - // TODO Auto-generated method stub - return false; - } - - @Override - public ItemStack onItemRightClick(GT_MetaBase_Item var1, ItemStack var2, World var3, EntityPlayer var4) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List<String> getAdditionalToolTips(GT_MetaBase_Item var1, List<String> var2, ItemStack var3) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void onUpdate(GT_MetaBase_Item var1, ItemStack var2, World var3, Entity var4, int var5, boolean var6) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isItemStackUsable(GT_MetaBase_Item var1, ItemStack var2) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean canDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) { - // TODO Auto-generated method stub - return false; - } - - @Override - public ItemStack onDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean hasProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3) { - // TODO Auto-generated method stub - return false; - } - - @Override - public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5, - double var7, double var9) { - // TODO Auto-generated method stub - return null; - } - - @Override - public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, - EntityLivingBase var5, float var6) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java deleted file mode 100644 index 9d0bcf4314..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java +++ /dev/null @@ -1,196 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; - -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_ModHandler; -import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; -import gtPlusPlus.core.lib.CORE; - -public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { - - public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional, "Steam Power by the Sun"); - } - - public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", - CORE.GT_Tooltip.get() }; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - final ITexture[] tmp0 = { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][(i + 1)] = tmp0; - final ITexture[] tmp1 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) }; - rTextures[1][(i + 1)] = tmp1; - final ITexture[] tmp2 = { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][(i + 1)] = tmp2; - final ITexture[] tmp3 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; - rTextures[3][(i + 1)] = tmp3; - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[side.offsetY == 0 ? ((byte) (side != facing ? 2 : 3)) : side.ordinal()][aColorIndex + 1]; - } - - @Override - public int maxProgresstime() { - return 500; - } - - @Override - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); - } - - private int mRunTime = 0; - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("mRunTime", this.mRunTime); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mRunTime = aNBT.getInteger("mRunTime"); - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > 45) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - if (this.mSteam != null) { - final ForgeDirection side = aBaseMetaTileEntity.getFrontFacing(); - final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(side); - if (tTileEntity != null) { - final FluidStack tDrained = aBaseMetaTileEntity - .drain(side, Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - final int tFilledAmount = tTileEntity.fill(side.getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill( - side.getOpposite(), - aBaseMetaTileEntity.drain(side, tFilledAmount, true), - true); - } - } - } - } - if ((aTick % 25L) == 0L) { - if (this.mTemperature > 100) { - if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { - this.mHadNoWater = true; - } else { - if (this.mHadNoWater) { - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= 1; - this.mRunTime += 1; - int tOutput = 150; - if (this.mRunTime > 10000) { - tOutput = Math.max(50, 150 - ((this.mRunTime - 10000) / 100)); - } - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(tOutput); - } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += tOutput; - } else { - this.mSteam = GT_ModHandler.getSteam(tOutput); - } - } - } else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && (this.mSteam.amount > 16000)) { - this.sendSound((byte) 1); - this.mSteam.amount = 12000; - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) - && ((aTick % 256L) == 0L) - && (!aBaseMetaTileEntity.getWorld().isThundering())) { - final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() - && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); - this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) - || !aBaseMetaTileEntity.getSkyAtSide(ForgeDirection.UP) ? 0 - : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; - } - if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) { - this.mProcessingEnergy -= 1; - this.mTemperature += 1; - } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); - } - } - - @Override - protected int getPollution() { - return 0; - } - - @Override - protected int getProductionPerSecond() { - return 0; - } - - @Override - protected int getMaxTemperature() { - return 0; - } - - @Override - protected int getEnergyConsumption() { - return 0; - } - - @Override - protected int getCooldownInterval() { - return 0; - } - - @Override - protected void updateFuel(IGregTechTileEntity iGregTechTileEntity, long l) {} -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java deleted file mode 100644 index 7df64e3f3a..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java +++ /dev/null @@ -1,171 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocketFuelGeneratorBase { - - public int mEfficiency; - - public GregtechMetaTileEntityDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, - final int aTier) { - super( - aID, - aName, - aNameRegional, - aTier, - "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.", - new ITexture[0]); - this.onConfigLoad(); - } - - public GregtechMetaTileEntityDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - this.onConfigLoad(); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip.get() }; - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityDoubleFuelGeneratorBase( - this.mName, - this.mTier, - this.mDescription, - this.mTextures); - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipes() { - return GT_Recipe.GT_Recipe_Map.sDieselFuels; - } - - @Override - public int getCapacity() { - return 32000; - } - - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "RocketEngine.efficiency.tier." + this.mTier, - (100 - (this.mTier * 8))); - } - - @Override - public int getEfficiency() { - return this.mEfficiency; - } - - @Override - public int getFuelValue(final ItemStack aStack) { - int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack)); - if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { - rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); - } - return rValue; - } - - private GT_RenderedTexture getCasingTexture() { - if (this.mTier <= 4) { - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); - } else if (this.mTier == 5) { - - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced); - } else { - - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); - } - // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; - } - - @Override - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { super.getBack(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; - } - - @Override - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; - } - - @Override - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; - } - - @Override - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { super.getSides(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; - } - - @Override - public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; - } - - @Override - public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { super.getBackActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; - } - - @Override - public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; - } - - @Override - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; - } - - @Override - public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { super.getSidesActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; - } - - @Override - public int getPollution() { - return 250; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java deleted file mode 100644 index e25ebb5daa..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java +++ /dev/null @@ -1,270 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTileEntity { - - public GregtechMetaTileEntityThaumcraftResearcher(final int aID, final String aName, final String aNameRegional, - final int aTier, final String aDescription, final int aSlotCount) { - super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); - } - - public GregtechMetaTileEntityThaumcraftResearcher(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { - super(aName, aTier, aSlotCount, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Generates Thaumcraft research notes, because it's magic." }; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[10][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getFront(i); - rTextures[1][i + 1] = this.getBack(i); - rTextures[2][i + 1] = this.getBottom(i); - rTextures[3][i + 1] = this.getTop(i); - rTextures[4][i + 1] = this.getSides(i); - rTextures[5][i + 1] = this.getFrontActive(i); - rTextures[6][i + 1] = this.getBackActive(i); - rTextures[7][i + 1] = this.getBottomActive(i); - rTextures[8][i + 1] = this.getTopActive(i); - rTextures[9][i + 1] = this.getSidesActive(i); - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; - } - - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A) }; - } - - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B) }; - } - - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { getSides(aColor)[0] }; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) }; - } - - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getFrontActive(final byte aColor) { - return getFront(aColor); - } - - public ITexture[] getBackActive(final byte aColor) { - return getBack(aColor); - } - - public ITexture[] getBottomActive(final byte aColor) { - return getBottom(aColor); - } - - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; - } - - public ITexture[] getSidesActive(final byte aColor) { - return getSides(aColor); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityThaumcraftResearcher( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); - } - - @Override - public boolean isSimpleMachine() { - return false; - } - - @Override - public boolean isElectric() { - return true; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return true; - } - - @Override - public boolean isFacingValid(final ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return false; - } - - @Override - public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getBackFacing(); - } - - @Override - public boolean isTeleporterCompatible() { - return false; - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public long maxEUStore() { - return 512000; - } - - @Override - public int rechargerSlotStartIndex() { - return 0; - } - - @Override - public int dechargerSlotStartIndex() { - return 0; - } - - @Override - public int rechargerSlotCount() { - return 0; - } - - @Override - public int dechargerSlotCount() { - return 0; - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - @Override - public int getCapacity() { - return 128000; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - return true; - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return side == this.getBaseMetaTileEntity().getBackFacing(); - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return true; - } - - @Override - public String[] getInfoData() { - return new String[] { this.getLocalName(), }; - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public int getSizeInventory() { - return 2; - } - - @Override - public boolean isOverclockerUpgradable() { - return false; - } - - @Override - public boolean isTransformerUpgradable() { - return false; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - // aNBT.setInteger("mCurrentPollution", this.mCurrentPollution); - // aNBT.setInteger("mAveragePollution", this.mAveragePollution); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - // this.mCurrentPollution = aNBT.getInteger("mCurrentPollution"); - // this.mAveragePollution = aNBT.getInteger("mAveragePollution"); - } - - @Override - public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { - super.onFirstTick(aBaseMetaTileEntity); - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java deleted file mode 100644 index b93bde0f30..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; public class - * GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_MultiBlockBase { RenderBlocks asdasd = - * RenderBlocks.getInstance(); public GregtechMetaTileEntity_IndustrialSinter(final int aID, final String aName, final - * String aNameRegional) { super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_IndustrialSinter(final - * String aName) { super(aName); } - * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new - * GregtechMetaTileEntity_IndustrialSinter(this.mName); } - * @Override public String[] getDescription() { return new String[]{ - * "Controller Block for the Industrial Sinter Furnace", "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)", - * "2x Input Bus (side centered)", "2x Output Bus (side centered)", "1x Energy Hatch (top or bottom centered)", - * "1x Maintenance Hatch (back centered)", "Sinter Furnace Casings for the rest (32 at least!)", "Causes " + 20 * - * this.getPollutionPerTick(null) + " Pollution per second", CORE.GT_Tooltip.get() }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - * return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sWiremillRecipes; } - * @Override public boolean isCorrectMachinePart(final ItemStack aStack) { return true; } - * @Override public boolean isFacingValid(final ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = - * this.getStoredInputs(); for (final ItemStack tInput : tInputList) { final long tVoltage = this.getMaxInputVoltage(); - * final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); final GT_Recipe tRecipe = - * GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, - * gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); if (tRecipe != null) { if - * (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) { this.mEfficiency = (10000 - - * ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; if (tRecipe.mEUt <= 16) - * { this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); this.mMaxProgresstime = (tRecipe.mDuration / - * (1 << (tTier - 1))); } else { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = tRecipe.mDuration; while (this.mEUt - * <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } } if (this.mEUt > 0) - * { this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new - * ItemStack[]{tRecipe.getOutput(0)}; this.updateSlots(); return true; } } } return false; } - * @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { final - * int controllerX = aBaseMetaTileEntity.getXCoord(); final int controllerY = aBaseMetaTileEntity.getYCoord(); final int - * controllerZ = aBaseMetaTileEntity.getZCoord(); final byte tSide = this.getBaseMetaTileEntity().getBackFacing(); if - * ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && - * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && - * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) { int - * tAirCount = 0; for (byte i = -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { for - * (byte k = -1; k < 2; k = (byte) (k + 1)) { if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { - * Logger.INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); //if - * (aBaseMetaTileEntity.getWorld().isRemote){ //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, - * (controllerX+i), (controllerY+k), (controllerZ+k)); //UtilsRendering.drawBlockInWorld((controllerX+i), - * (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN); //} tAirCount++; } } } } if (tAirCount != 10) { - * Logger.INFO("False. Air != 10. Air == "+tAirCount); //return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { - * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN); - * IGregTechTileEntity tTileEntity; if ((null != (tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && (tTileEntity.getFrontFacing() == - * this.getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && - * ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter))) { - * //Utils.LOG_INFO("False 1"); return false; } } final int tX = this.getBaseMetaTileEntity().getXCoord(); final int tY - * = this.getBaseMetaTileEntity().getYCoord(); final int tZ = this.getBaseMetaTileEntity().getZCoord(); for (byte i = - * -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { if ((i != 0) || (j != 0)) { for (byte - * k = 0; k < 5; k = (byte) (k + 1)) { //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), - * (controllerZ+k), Color.ORANGE); if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { - * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.TOMATO); if - * ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : - * tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + - * (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i)) == - * this.getCasingMeta())) { } else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + - * (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i))) && - * (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide - * == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i))))) { Logger.INFO("False 2"); - * return false; } } else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + - * j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingBlock()) && - * (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : - * tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingMeta())) { } else { Logger.INFO("False 3"); return false; } - * } } } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) { - * Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != 2) || - * (this.mOutputBusses.size() != 2)) { Logger.INFO("Incorrect amount of Input & Output busses."); return false; } - * this.mMaintenanceHatches.clear(); final IGregTechTileEntity tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), - * 4); if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { if ((tTileEntity.getMetaTileEntity() - * instanceof GT_MetaTileEntity_Hatch_Maintenance)) { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) - * tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = - * this.getCasingTextureIndex(); } else { Logger.INFO("Maintenance hatch must be in the middle block on the back."); - * return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - * Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { Logger.INFO("False 5"); - * return false; } Logger.INFO("True"); return true; } - * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(final ItemStack aStack) { return 0; } - * @Override public int getDamageToComponent(final ItemStack aStack) { return 0; } public int getAmountOfOutputs() { - * return 1; } - * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } public Block - * getCasingBlock() { return ModBlocks.blockCasingsMisc; } public byte getCasingMeta() { return 6; } public byte - * getCasingTextureIndex() { return 1; //TODO } private boolean addToMachineList(final IGregTechTileEntity tTileEntity) - * { return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())) || - * (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addOutputToMachineList(tTileEntity, - * this.getCasingTextureIndex())) || (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))); } - * private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) { return - * ((this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex()))); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java deleted file mode 100644 index 2913e5bbed..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_FastNeutronReactor extends GregtechMeta_MultiBlockBase { private int mSuperEfficencyIncrease = 0; public - * GregtechMTE_FastNeutronReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - * public GregtechMTE_FastNeutronReactor(String mName) { super(mName); } - * @Override public String getMachineType() { return "Reactor"; } - * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_FastNeutronReactor(this.mName); } - * @Override public boolean isFacingValid(ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - * @Override public int getDamageToComponent(ItemStack aStack){ return 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { this.mSuperEfficencyIncrease=0; if - * (processing_Stage_1()) { if (processing_Stage_2()) { if (processing_Stage_3()) { if (processing_Stage_4()) { } else { - * //Stage 4 } } else { //Stage 3 } } else { //Stage 2 } } else { //Stage 1 } return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } public boolean processing_Stage_1() { //Deplete - * Water, Add More Progress Time for (GT_MetaTileEntity_Hatch_Input tRecipe : this.mInputHatches) { if - * (tRecipe.getFluid() != null){ FluidStack tFluid = FluidUtils.getFluidStack(tRecipe.getFluid(), 200); if (tFluid != - * null) { if (tFluid == GT_ModHandler.getDistilledWater(1)) { if (depleteInput(tFluid)) { this.mMaxProgresstime = - * Math.max(1, runtimeBoost(8 * 2)); this.mEUt = getEUt(); this.mEfficiencyIncrease = (this.mMaxProgresstime * - * getEfficiencyIncrease()); return true; } } } } } this.mMaxProgresstime = 0; this.mEUt = 0; return false; } public - * boolean processing_Stage_2() { return false; } public boolean processing_Stage_3() { return false; } public boolean - * processing_Stage_4() { return false; } - * @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if(this.mSuperEfficencyIncrease>0){ - * this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease); } int tGeneratedEU = (int) - * (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { long amount = (tGeneratedEU + 160) / 160; if - * (!depleteInput(GT_ModHandler.getDistilledWater(amount))) { explodeMultiblock(); } else { - * addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } } return true; } return true; } public int getEUt() { return 0; - * //Default 400 } public int getEfficiencyIncrease() { return 0; //Default 12 } int runtimeBoost(int mTime) { return - * mTime * 150 / 100; } - * @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return true; } - * @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } public int getAmountOfOutputs() { return 1; - * } - * @Override public String[] getTooltip() { return new String[]{ "Fukushima-Daiichi Reactor No. 6", - * "------------------------------------------", "Boiling Water Reactor", "Harness the power of Nuclear Fission", - * "------------------------------------------", "Consult user manual for more information", }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1)), new GT_RenderedTexture(aActive ? - * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : - * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; } return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1))}; } - * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) { return true; } - * public boolean damageFilter(){ return false; } - * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java deleted file mode 100644 index 5b190f09db..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> - * mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>(); public static String[] mCasingName = new String[5]; - * public static String mHatchName = "Naquadah Fuel Hatch"; private final int CASING_TEXTURE_ID = - * TAE.getIndexFromPage(0, 13); private final int META_BaseCasing = 0; //4 private final int META_ContainmentCasing = - * 15; //3 private final int META_Shielding = 13; //1 private final int META_PipeCasing = 1; //4 private final int - * META_IntegralCasing = 6; //0 private final int META_ContainmentChamberCasing = 2; //4 public - * GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - * mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); mCasingName[1] = - * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), - * 2); mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); mCasingName[4] = - * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); mHatchName = - * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } public GregtechMTE_LargeNaqReactor(String - * aName) { super(aName); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_LargeNaqReactor(this.mName); } public String[] getTooltip() { if - * (mCasingName[0].toLowerCase().contains(".name")) { mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), - * 0); } if (mCasingName[1].toLowerCase().contains(".name")) { mCasingName[1] = - * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); } if (mCasingName[2].toLowerCase().contains(".name")) { - * mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); } if - * (mCasingName[3].toLowerCase().contains(".name")) { mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), - * 15); } if (mCasingName[4].toLowerCase().contains(".name")) { mCasingName[4] = - * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); } if (mHatchName.toLowerCase().contains(".name")) { mHatchName = - * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } return new String[]{ - * "Naquadah reacts violently with potassium, ", "resulting in massive explosions with radioactive potential.", - * "Size: 3x4x12, WxHxL", "Bottom Layer: "+mCasingName[0]+"s, (30x min)", - * "Middle Layer: "+mCasingName[2]+"s (10x), with", " "+mCasingName[3]+"s on either side", - * " "+mCasingName[3]+"s also on each end (x26)", "Middle Layer2: "+mCasingName[1]+" (12x total), with", - * " "+mCasingName[4]+"s on either side (x24)", - * "Top: Single row of "+mCasingName[0]+" along the middle (x12) ", "", "1x " + mHatchName + - * " (Any bottom layer casing)", "1x " + "Maintenance Hatch" + " (Any bottom layer side casing)", "1x " + "Energy Hatch" - * + " (Any top layer casing)", }; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, - * byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return side == facing ? new - * ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)} : - * new ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0))}; } public GT_Recipe_Map getRecipeMap() { - * return null; } public boolean isCorrectMachinePart(ItemStack aStack) { return true; } public boolean - * isFacingValid(byte aFacing) { return aFacing == 1; } public boolean checkRecipe(ItemStack aStack) { return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } public void startSoundLoop(byte aIndex, double aX, - * double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { - * GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); } } - * @Override public String getSound() { return (String) GregTech_API.sSoundList.get(Integer.valueOf(212)); } private - * Block getCasing(int casingID) { if (casingID == 1) { return ModBlocks.blockCasingsMisc; } else if (casingID == 2) { - * return ModBlocks.blockCasings2Misc; } else if (casingID == 3) { return ModBlocks.blockCasings3Misc; } else if - * (casingID == 4) { return ModBlocks.blockCasings4Misc; } else { return ModBlocks.blockCasingsTieredGTPP; } } - * //Casing3, Meta 10 - "Grate Machine Casing"); //Casing2, Meta 0 - "Solid Steel Machine Casing" //Casing2, Meta 5 - - * "Assembling Line Casing" //Casing2, Meta 9 - "Assembler Machine Casing" //Magic Glass - blockAlloyGlass public - * boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; // Counts for all Casing Types int - * aBaseCasingCount = 0; int aContainmentCasingCount = 0; int aShieldingCount = 0; int aPipeCount = 0; int - * aIntegralCasingCount = 0; int aContainmentChamberCount = 0; // Bottom Layer aBaseCasingCount += - * checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir); - * log("Bottom Layer is Valid. Moving to Layer 1."); // Layer 1 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -6, xDir, zDir); aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, - * getCasing(0), this.META_IntegralCasing, -6, xDir, zDir); aContainmentChamberCount += - * checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir); - * log("Layer 1 is Valid. Moving to Layer 2."); // Layer 2 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -5, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), - * this.META_PipeCasing, -5, xDir, zDir); log("Layer 2 is Valid. Moving to Layer 3."); // Layer 3 - * aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, - * zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir); - * log("Layer 3 is Valid. Moving to Layer 4."); // Layer 4 aContainmentCasingCount += - * checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir); aPipeCount += - * checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir); - * log("Layer 4 is Valid. Moving to Layer 5."); // Layer 5 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -2, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), - * this.META_PipeCasing, -2, xDir, zDir); log("Layer 5 is Valid. Moving to Layer 6."); // Layer 6 aShieldingCount += - * checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir); aIntegralCasingCount += - * checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir); - * aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), - * this.META_ContainmentChamberCasing, -1, xDir, zDir); log("Layer 6 is Valid. Moving to Top Layer."); // Top Layer - * aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir); - * log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s"); log("Found "+aShieldingCount+" "+mCasingName[4]+"s"); - * log("Found "+aPipeCount+" "+mCasingName[1]+"s"); log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s"); - * log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s"); - * log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s"); // Try mesage player String aOwnerName = - * this.getBaseMetaTileEntity().getOwnerName(); EntityPlayer aOwner = null; if (aOwnerName != null && - * aOwnerName.length() > 0) { aOwner = PlayerUtils.getPlayer(aOwnerName); } if (aShieldingCount != 128) { - * log("Not enough "+mCasingName[4]+"s, require 128."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[4]+"s, require 128."); } return false; } if (aPipeCount != 20) { - * log("Not enough "+mCasingName[1]+"s, require 20."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[1]+"s, require 20."); } return false; } if (aContainmentCasingCount != 64) { - * log("Not enough "+mCasingName[3]+"s, require 64."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[3]+"s, require 64."); } return false; } if (aContainmentChamberCount != 42) { - * log("Not enough "+mCasingName[2]+"s, require 42."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[2]+"s, require 42."); } return false; } if (aBaseCasingCount < 140) { - * log("Not enough "+mCasingName[0]+"s, require 140 at a minimum."); if (aOwner != null) { - * PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum."); } return false; } if - * (aIntegralCasingCount != 48) { log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), - * 6)+"s, require 48."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48."); } return false; } - * log("LNR Formed."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Large Naquadah Reactor has formed successfully."); } return true; } public boolean - * addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { - * return false; } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == - * null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { - * this.updateTexture(aMetaTileEntity, aBaseCasingIndex); return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) - * aMetaTileEntity); } else { return false; } } } public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, - * Block aBlock, int aMeta, int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int - * z = -4; z < 5; z++) { int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = - * this.getBaseMetaTileEntity().getYCoord() + aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip - * the corners if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; - * } // Skip controller if (aY == 0 && x == 0 && z == 0) { continue; } Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int - * checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { int - * aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int z = -4; z < 5; z++) { int aOffsetX = - * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int - * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 4 && z == 4) || (x == -4 && z - * == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; } // If we are on the 5x5 ring, proceed if ((x > -4 - * && x < 4 ) && (z > -4 && z < 4)) { if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 - * && z == 3)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); } - * else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int - * aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && - * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, - * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); - * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } - * return aCasingCount; } public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, - * int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { int - * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + - * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 3 && z == 3) || (x == - * -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) { continue; } // If we are on the 5x5 ring, proceed if - * ((x > -3 && x < 3 ) && (z > -3 && z < 3)) { if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || - * (x == -2 && z == 2)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, - * aMeta, 3); } else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - * int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && - * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, - * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); - * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } - * return aCasingCount; } public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int - * aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -1; x < 2; x++) { for (int z = -1; z < 2; z++) { int - * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + - * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 1 && z == 1) || (x == - * -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) { Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Pipe has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; }; } } } return aCasingCount; } public int - * checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - * int aCasingCount = 0; for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { int aOffsetX = - * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int - * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 2 && z == 2) || (x == -2 && z - * == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) { continue; } Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int getMaxEfficiency(ItemStack - * aStack) { return 10000; } public int getPollutionPerTick(ItemStack aStack) { return 133; } public int - * getDamageToComponent(ItemStack aStack) { return 0; } public boolean explodesOnComponentBreak(ItemStack aStack) { - * return false; } - * @Override public String getMachineType() { return "Reactor"; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java deleted file mode 100644 index 4d245cedc3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase { public long currentVoltage = GT_Values.V[7]; public - * byte currentTier = 8; public void upvolt() { byte f = currentTier; if ((f+1) > 10) { f = 8; } else { f++; } - * this.currentTier = f; updateVoltage(); } public void downvolt() { byte f = currentTier; if ((f-1) < 8) { f = 10; } - * else { f--; } this.currentTier = f; updateVoltage(); } private long updateVoltage() { this.currentVoltage = - * GT_Values.V[this.currentTier-1]; return currentVoltage; } public GregtechMTE_MiniFusionPlant(String aName) { - * super(aName); } public GregtechMTE_MiniFusionPlant(int aID, String aName, String aNameRegional) { super(aID, aName, - * aNameRegional); } - * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_MiniFusionPlant(this.mName); } - * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - * @Override public int getDamageToComponent(ItemStack aStack) { return 0; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == - * this.getBaseMetaTileEntity().getBackFacing()) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - * Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]}; } if (side == ForgeDirection.UP) { return - * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()]}; } if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), new GT_RenderedTexture(aActive ? - * Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)}; } return - * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } - * @Override public String getMachineType() { return "Fusion Reactor"; } - * @Override public String[] getTooltip() { return new String[] { "Small scale fusion", - * "16x slower than using Multiblock of the same voltage", //"Input voltage can be changed within the GUI", - * "Place Input/Output Hatches on sides and bottom", "Power can only be inserted into the back", - * //e"Power can only be extracted from the top", TAG_HIDE_HATCHES }; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } - * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int xDir2 = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetX; int zDir2 = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetZ; int tAmount = 0; ForgeDirection aDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); //Require air in front, I think if - * (!aBaseMetaTileEntity.getAirOffset(xDir2, 0, zDir2)) { Logger.INFO("Did not find air in front"); return false; } else - * { for (int i = -1; i < 2; ++i) { for (int j = -1; j < 2; ++j) { for (int h = -1; h < 2; ++h) { if (h != 0 || (xDir + - * i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if (this.addToMachineList(tTileEntity, - * TAE.GTPP_INDEX(10))) { tAmount++; } } } } } } Logger.INFO("Tanks found: "+tAmount); return tAmount == 3; } - * @Override public boolean checkRecipe(ItemStack arg0) { ArrayList tFluidList = this.getStoredFluids(); int - * tFluidList_sS = tFluidList.size(); for (int tFluids = 0; tFluids < tFluidList_sS - 1; ++tFluids) { for (int tRecipe = - * tFluids + 1; tRecipe < tFluidList_sS; ++tRecipe) { if (GT_Utility.areFluidsEqual((FluidStack) - * tFluidList.get(tFluids), (FluidStack) tFluidList.get(tRecipe))) { if (((FluidStack) tFluidList.get(tFluids)).amount < - * ((FluidStack) tFluidList.get(tRecipe)).amount) { tFluidList.remove(tFluids--); tFluidList_sS = tFluidList.size(); - * break; } tFluidList.remove(tRecipe--); tFluidList_sS = tFluidList.size(); } } } int aStep = 0; - * //Logger.INFO("Step "+aStep++); if (tFluidList.size() > 1) { //Logger.INFO("Step "+aStep++); FluidStack[] arg5 = - * (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); GT_Recipe arg6 = - * getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), arg5, new - * ItemStack[0]); if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) - * arg6.mSpecialValue)) { //Logger.INFO("Bad Step "+aStep++); //this.turnCasingActive(false); this.mLastRecipe = null; - * return false; } //Logger.INFO("Step "+aStep++); if (this.mRunningOnLoad || (arg6 != null && - * arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) { //Logger.INFO("Step "+aStep++); this.mLastRecipe = arg6; - * this.mEUt = this.mLastRecipe.mEUt * 1; this.mMaxProgresstime = this.mLastRecipe.mDuration / 1; - * this.mEfficiencyIncrease = 10000; this.mOutputFluids = this.mLastRecipe.mFluidOutputs; //this.turnCasingActive(true); - * this.mRunningOnLoad = false; return true; } //Logger.INFO("Step "+aStep++); } //Logger.INFO("Step "+aStep++); return - * false; //return this.checkRecipeGeneric(this.getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); } - * @Override public int getMaxEfficiency(ItemStack arg0) { return 10000; } - * @Override public boolean drainEnergyInput(long aEU) { // Not applicable to this machine return true; } - * @Override public boolean addEnergyOutput(long aEU) { // Not applicable to this machine return true; } - * @Override public long maxEUStore() { return this.getMaxInputVoltage() * 256 * 512; } - * @Override public long getMinimumStoredEU() { return 0; } - * @Override public String[] getExtraInfoData() { String mode = EnumChatFormatting.BLUE + "" + currentVoltage + - * EnumChatFormatting.RESET; String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET; String - * storedEnergyText; if (this.getEUVar() > maxEUStore()) { storedEnergyText = EnumChatFormatting.RED + - * GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } else { storedEnergyText = - * EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } return new - * String[]{ "Stored EU: " + storedEnergyText, "Capacity: " + EnumChatFormatting.YELLOW + - * GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET, "Voltage: " + mode, "Output Voltage: " + - * aOutput }; } - * @Override public void explodeMultiblock() { super.explodeMultiblock(); } - * @Override public void doExplosion(long aExplosionPower) { super.doExplosion(aExplosionPower); } - * @Override public long getMaxInputVoltage() { return updateVoltage(); } - * @Override public long getInputTier() { return (long) GT_Utility.getTier(maxEUInput()); } - * @Override public boolean isElectric() { return true; } - * @Override public boolean isEnetInput() { return true; } - * @Override public boolean isEnetOutput() { return false; } - * @Override public boolean isInputFacing(ForgeDirection side) { return (aSide == - * this.getBaseMetaTileEntity().getBackFacing()); } - * @Override public boolean isOutputFacing(ForgeDirection side) { return side == ForgeDirection.UP; } - * @Override public long maxAmperesIn() { return 32; } - * @Override public long maxAmperesOut() { return 1; } - * @Override public long maxEUInput() { return updateVoltage(); } - * @Override public long maxEUOutput() { return mEUt > 0 ? mEUt : 0; } - * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; - * this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true; } - * @Override public boolean causeMaintenanceIssue() { return true; } - * @Override public int getControlCoreTier() { return this.currentTier; } - * @Override public int getPollutionPerTick(ItemStack arg0) { return 0; } - * @Override public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() { GT_MetaTileEntity_Hatch_ControlCore x = - * new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null); return (GT_MetaTileEntity_Hatch_ControlCore) x; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index ef1d88d05b..ac961f8fdc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -75,7 +75,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public static int CASING_TEXTURE_ID; public static String mCasingName = "Sterile Farm Casing"; - // public static TreeGenerator mTreeData; public static HashMap<String, ItemStack> sLogCache = new HashMap<>(); private static final int TICKS_PER_OPERATION = 100; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java deleted file mode 100644 index 97bd9dbce7..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class - * GregtechMetaTileEntity_BedrockMiningPlatform1 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public - * GregtechMetaTileEntity_BedrockMiningPlatform1(final int aID, final String aName, final String aNameRegional) { - * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform1(final String aName) { - * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("I"); } public IMetaTileEntity - * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new - * GregtechMetaTileEntity_BedrockMiningPlatform1(this.mName); } protected Material getFrameMaterial() { return - * ALLOY.INCONEL_690; } protected int getCasingTextureIndex() { return TAE.getIndexFromPage(0, 14); } protected int - * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { - * return (int) (420*(this.mProductionModifier/100)); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java deleted file mode 100644 index b4be6eb80f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class - * GregtechMetaTileEntity_BedrockMiningPlatform2 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public - * GregtechMetaTileEntity_BedrockMiningPlatform2(final int aID, final String aName, final String aNameRegional) { - * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform2(final String aName) { - * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("II"); } public IMetaTileEntity - * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new - * GregtechMetaTileEntity_BedrockMiningPlatform2(this.mName); } protected Material getFrameMaterial() { return - * ELEMENT.getInstance().AMERICIUM241; } protected int getCasingTextureIndex() { return 62; } protected int - * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { - * return 480; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java deleted file mode 100644 index 810be16b79..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ /dev/null @@ -1,621 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; - -import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.Thaumcraft; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.ORES; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.MiningUtils; -import gtPlusPlus.core.util.minecraft.OreDictUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; - -public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends GregtechMeta_MultiBlockBase { - - protected double mProductionModifier = 0; - - private static final ItemStack miningPipe; - private static final ItemStack miningPipeTip; - - private Block casingBlock; - private int casingMeta; - // private int frameMeta; - private int casingTextureIndex; - - private ForgeDirection back; - - private int xDrill; - private int yDrill; - private int zDrill; - - private int[] xCenter = new int[5]; - private int[] zCenter = new int[5]; - - public GregtechMetaTileEntity_BedrockMiningPlatformBase(final int aID, final String aName, - final String aNameRegional) { - super(aID, aName, aNameRegional); - this.initFields(); - } - - public GregtechMetaTileEntity_BedrockMiningPlatformBase(final String aName) { - super(aName); - this.initFields(); - } - - private void initFields() { - this.casingBlock = this.getCasingBlockItem().getBlock(); - this.casingMeta = this.getCasingBlockItem().get(0L, new Object[0]).getItemDamage(); - this.casingTextureIndex = this.getCasingTextureIndex(); - } - - @Override - protected IIconContainer getActiveOverlay() { - return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE; - } - - @Override - protected IIconContainer getInactiveOverlay() { - return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT; - } - - @Override - protected int getCasingTextureId() { - return this.casingTextureIndex; - } - - @Override - public int getAmountOfOutputs() { - return 1; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setDouble("mProductionModifier", mProductionModifier); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mProductionModifier = aNBT.getDouble("mProductionModifier"); - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - // this.setElectricityStats(); - - if (true) { - return false; - } - - boolean[] didWork = new boolean[5]; - - if (!this.tryConsumeDrillingFluid()) { - Logger.INFO("No drilling Fluid."); - return false; - } - - if (MathUtils.isNumberEven((int) this.mProductionModifier)) { - if (!this.tryConsumePyrotheum()) { - Logger.INFO("No tryConsumePyrotheum Fluid."); - return false; - } else { - mProductionModifier++; - } - } else { - if (!this.tryConsumeCryotheum()) { - Logger.INFO("No tryConsumeCryotheum Fluid."); - return false; - } else { - mProductionModifier++; - } - } - - for (int i = 0; i < 5; i++) { - process(); - didWork[i] = true; - } - - // Fail recipe handling if one pipe didn't handle properly, to try again - // next run. - for (boolean y : didWork) { - if (!y) { - Logger.INFO("[Bedrock Miner] Fail [x]"); - return false; - } - } - - this.lEUt = -8000; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 10000; - - return true; - } - - private boolean isEnergyEnough() { - long requiredEnergy = 512L + this.getMaxInputVoltage() * 4L; - for (final GT_MetaTileEntity_Hatch_Energy energyHatch : this.mEnergyHatches) { - requiredEnergy -= energyHatch.getEUVar(); - if (requiredEnergy <= 0L) { - return true; - } - } - return false; - } - - private void setElectricityStats() { - // this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); - this.mEfficiencyIncrease = 10000; - final int overclock = 8 << GT_Utility.getTier(this.getMaxInputVoltage()); - // this.mEUt = -12 * overclock * overclock; - Logger.INFO("Trying to set EU to " + (12 * overclock * overclock)); - int mCombinedAvgTime = 0; - for (int g = 0; g < 5; g++) { - mCombinedAvgTime += this.getBaseProgressTime() / overclock; - } - Logger.INFO("Trying to set Max Time to " + (mCombinedAvgTime)); - // this.mMaxProgresstime = (mCombinedAvgTime / 5); - } - - private boolean tryConsumeDrillingFluid() { - boolean consumed = false; - boolean g = (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 2 == 0); - consumed = (g ? tryConsumePyrotheum() : tryConsumeCryotheum()); - if (consumed) { - // increaseProduction(g ? 2 : 1); - } else { - // lowerProduction(g ? 5 : 3); - } - return consumed; - } - - private boolean tryConsumePyrotheum() { - return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 4)); - } - - private boolean tryConsumeCryotheum() { - return this.depleteInput(FluidUtils.getFluidStack("cryotheum", 4)); - } - - private void putMiningPipesFromInputsInController() { - final int maxPipes = 64; - if (this.isHasMiningPipes(maxPipes)) { - return; - } - ItemStack pipes = this.getStackInSlot(1); - for (final ItemStack storedItem : this.getStoredInputs()) { - if (!storedItem.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe)) { - continue; - } - if (pipes == null) { - this.setInventorySlotContents( - 1, - GT_Utility.copy(new Object[] { GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe })); - pipes = this.getStackInSlot(1); - } - if (pipes.stackSize == maxPipes) { - break; - } - final int needPipes = maxPipes - pipes.stackSize; - final int transferPipes = (storedItem.stackSize < needPipes) ? storedItem.stackSize : needPipes; - final ItemStack itemStack = pipes; - itemStack.stackSize += transferPipes; - final ItemStack itemStack2 = storedItem; - itemStack2.stackSize -= transferPipes; - } - this.updateSlots(); - } - - private boolean isHasMiningPipes(final int minCount) { - final ItemStack pipe = this.getStackInSlot(1); - return pipe != null && pipe.stackSize > minCount - 1 - && pipe.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe); - } - - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - this.updateCoordinates(); - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ; - int tAmount = 0; - if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { - return false; - } else { - - Block aCasing = Block.getBlockFromItem(getCasingBlockItem().getItem()); - - for (int i = -1; i < 2; ++i) { - for (int j = -1; j < 2; ++j) { - for (int h = -1; h < 2; ++h) { - if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - - if (!this.addToMachineList(tTileEntity, 48)) { - if (aBlock != aCasing) { - Logger.INFO("Found Bad Casing"); - return false; - } - if (aMeta != 3) { - Logger.INFO("Found Bad Meta"); - return false; - } - } - ++tAmount; - - } - } - } - } - return tAmount >= 10; - } - } - - private void updateCoordinates() { - this.xDrill = this.getBaseMetaTileEntity().getXCoord(); - this.yDrill = this.getBaseMetaTileEntity().getYCoord() - 1; - this.zDrill = this.getBaseMetaTileEntity().getZCoord(); - this.back = this.getBaseMetaTileEntity().getBackFacing(); - - // Middle - this.xCenter[0] = this.xDrill + this.back.offsetX; - this.zCenter[0] = this.zDrill + this.back.offsetZ; - - this.xCenter[1] = xCenter[0] + 1; - this.zCenter[1] = zCenter[0]; - - this.xCenter[2] = xCenter[0] - 1; - this.zCenter[2] = zCenter[0]; - - this.xCenter[3] = xCenter[0]; - this.zCenter[3] = zCenter[0] + 1; - - this.xCenter[4] = xCenter[0]; - this.zCenter[4] = zCenter[0] - 1; - } - - @Override - public boolean isCorrectMachinePart(final ItemStack aStack) { - return true; - } - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return 0; - } - - @Override - public int getDamageToComponent(final ItemStack aStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return false; - } - - protected GregtechItemList getCasingBlockItem() { - return GregtechItemList.Casing_BedrockMiner; - } - - protected abstract Material getFrameMaterial(); - - protected abstract int getCasingTextureIndex(); - - protected abstract int getRadiusInChunks(); - - protected abstract int getMinTier(); - - protected abstract int getBaseProgressTime(); - - protected String[] getDescriptionInternal(final String tierSuffix) { - final String casings = this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName(); - return new String[] { - "Controller Block for the Experimental Deep Earth Drilling Platform - MK " - + ((tierSuffix != null) ? tierSuffix : ""), - "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)", - "2x Input Hatch (Any bottom layer casing)", - "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)", - "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", - "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Radius is " + (this.getRadiusInChunks() << 4) + " blocks", - "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum", - "Pyrotheum is used to bore through the Mantle of the world", - "Cryotheum is used to keep the internal components cool", }; - } - - static { - miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0L); - miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0L); - } - - private AutoMap<ItemStack> mOutputs; - - public void process() { - ItemStack aOutput = generateOutputWithchance(); - if (aOutput != null) { - this.addOutput(aOutput); - Logger.INFO("Mined some " + aOutput.getDisplayName()); - } - this.updateSlots(); - } - - public ItemStack generateOutputWithchance() { - int aChance = MathUtils.randInt(0, 7500); - if (aChance < 100) { - return generateOutput(); - } else { - return null; - } - } - - public ItemStack generateOutput() { - AutoMap<ItemStack> aData = generateOreForOutput(); - int aMax = aData.size() - 1; - return aData.get(MathUtils.randInt(0, aMax)); - } - - /** - * Here we generate valid ores and also a basic loot set - */ - public AutoMap<ItemStack> generateOreForOutput() { - - if (mOutputs != null) { - return mOutputs; - } - - AutoMap<GT_Worldgen_GT_Ore_Layer> aOverWorldOres = MiningUtils.getOresForDim(0); - AutoMap<GT_Worldgen_GT_Ore_Layer> aNetherOres = MiningUtils.getOresForDim(-1); - AutoMap<GT_Worldgen_GT_Ore_Layer> aEndOres = MiningUtils.getOresForDim(1); - - AutoMap<ItemStack> aTempMap = new AutoMap<ItemStack>(); - Block tOreBlock = GregTech_API.sBlockOres1; - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Initial]"); - - for (GT_Worldgen_GT_Ore_Layer layer : aOverWorldOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Overworld]"); - for (GT_Worldgen_GT_Ore_Layer layer : aNetherOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Nether]"); - for (GT_Worldgen_GT_Ore_Layer layer : aEndOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [End]"); - - addOreTypeToMap(ELEMENT.getInstance().IRON, 200, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().COPPER, 175, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().TIN, 150, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().GOLD, 150, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().SILVER, 110, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().NICKEL, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().ZINC, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().LEAD, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().ALUMINIUM, 30, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().THORIUM, 20, aTempMap); - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Common Ores]"); - - AutoMap<Pair<String, Integer>> mMixedOreData = new AutoMap<Pair<String, Integer>>(); - mMixedOreData.put(new Pair<String, Integer>("oreRuby", 30)); - mMixedOreData.put(new Pair<String, Integer>("oreSapphire", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreEmerald", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40)); - mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40)); - - if (Thaumcraft.isModLoaded() || (OreDictUtils.containsValidEntries("oreAmber") - && OreDictUtils.containsValidEntries("oreCinnabar"))) { - mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20)); - } - if (Railcraft.isModLoaded() || OreDictUtils.containsValidEntries("oreSaltpeter")) { - mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10)); - } - mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10)); - if (OreDictUtils.containsValidEntries("oreSulfur")) { - mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15)); - } - if (OreDictUtils.containsValidEntries("oreSilicon")) { - mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15)); - } - if (OreDictUtils.containsValidEntries("oreApatite")) { - mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25)); - } - - mMixedOreData.put(new Pair<String, Integer>("oreFirestone", 2)); - mMixedOreData.put(new Pair<String, Integer>("oreBismuth", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreLithium", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreManganese", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreBeryllium", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreCoal", 75)); - mMixedOreData.put(new Pair<String, Integer>("oreLignite", 75)); - mMixedOreData.put(new Pair<String, Integer>("oreSalt", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreCalcite", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreBauxite", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreAlmandine", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreGraphite", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreGlauconite", 15)); - mMixedOreData.put(new Pair<String, Integer>("orePyrolusite", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreGrossular", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreTantalite", 15)); - - for (Pair<String, Integer> g : mMixedOreData) { - for (int i = 0; i < g.getValue(); i++) { - aTempMap.put(ItemUtils.getItemStackOfAmountFromOreDict(g.getKey(), 1)); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Mixed Ores]"); - - addOreTypeToMap(ELEMENT.STANDALONE.RUNITE, 2, aTempMap); - addOreTypeToMap(ELEMENT.STANDALONE.GRANITE, 8, aTempMap); - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [OSRS Ores]"); - - AutoMap<Material> aMyOreMaterials = new AutoMap<Material>(); - aMyOreMaterials.add(ORES.CROCROITE); - aMyOreMaterials.add(ORES.GEIKIELITE); - aMyOreMaterials.add(ORES.NICHROMITE); - aMyOreMaterials.add(ORES.TITANITE); - aMyOreMaterials.add(ORES.ZIMBABWEITE); - aMyOreMaterials.add(ORES.ZIRCONILITE); - aMyOreMaterials.add(ORES.GADOLINITE_CE); - aMyOreMaterials.add(ORES.GADOLINITE_Y); - aMyOreMaterials.add(ORES.LEPERSONNITE); - aMyOreMaterials.add(ORES.SAMARSKITE_Y); - aMyOreMaterials.add(ORES.SAMARSKITE_YB); - aMyOreMaterials.add(ORES.XENOTIME); - aMyOreMaterials.add(ORES.YTTRIAITE); - aMyOreMaterials.add(ORES.YTTRIALITE); - aMyOreMaterials.add(ORES.YTTROCERITE); - aMyOreMaterials.add(ORES.ZIRCON); - aMyOreMaterials.add(ORES.POLYCRASE); - aMyOreMaterials.add(ORES.ZIRCOPHYLLITE); - aMyOreMaterials.add(ORES.ZIRKELITE); - aMyOreMaterials.add(ORES.LANTHANITE_LA); - aMyOreMaterials.add(ORES.LANTHANITE_CE); - aMyOreMaterials.add(ORES.LANTHANITE_ND); - aMyOreMaterials.add(ORES.AGARDITE_Y); - aMyOreMaterials.add(ORES.AGARDITE_CD); - aMyOreMaterials.add(ORES.AGARDITE_LA); - aMyOreMaterials.add(ORES.AGARDITE_ND); - aMyOreMaterials.add(ORES.HIBONITE); - aMyOreMaterials.add(ORES.CERITE); - aMyOreMaterials.add(ORES.FLUORCAPHITE); - aMyOreMaterials.add(ORES.FLORENCITE); - aMyOreMaterials.add(ORES.CRYOLITE); - aMyOreMaterials.add(ORES.LAUTARITE); - aMyOreMaterials.add(ORES.LAFOSSAITE); - aMyOreMaterials.add(ORES.DEMICHELEITE_BR); - aMyOreMaterials.add(ORES.COMANCHEITE); - aMyOreMaterials.add(ORES.PERROUDITE); - aMyOreMaterials.add(ORES.HONEAITE); - aMyOreMaterials.add(ORES.ALBURNITE); - aMyOreMaterials.add(ORES.MIESSIITE); - aMyOreMaterials.add(ORES.KASHINITE); - aMyOreMaterials.add(ORES.IRARSITE); - aMyOreMaterials.add(ORES.RADIOBARITE); - aMyOreMaterials.add(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); - - for (Material aOreType : aMyOreMaterials) { - if (aOreType == ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT || aOreType == ORES.RADIOBARITE) { - addOreTypeToMap(aOreType, 4, aTempMap); - } else { - addOreTypeToMap(aOreType, 7, aTempMap); - } - } - - // Cleanup Map - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [GT++]"); - AutoMap<ItemStack> aCleanUp = new AutoMap<ItemStack>(); - for (ItemStack verify : aTempMap) { - if (!ItemUtils.checkForInvalidItems(verify)) { - aCleanUp.put(verify); - } - } - Logger.INFO("Cleanup Map contains " + aCleanUp.size() + " values."); - for (ItemStack remove : aCleanUp) { - aTempMap.remove(remove); - } - - // Generate Massive Map - AutoMap<ItemStack> aFinalMap = new AutoMap<ItemStack>(); - for (ItemStack aTempItem : aTempMap) { - int aTempMulti = MathUtils.randInt(20, 50); - for (int i = 0; i < aTempMulti; i++) { - aFinalMap.put(aTempItem.copy()); - } - } - Logger.INFO("Final Ore Map contains " + aFinalMap.size() + " values."); - mOutputs = aFinalMap; - return mOutputs; - } - - private static void addOreTypeToMap(Material aMaterial, int aAmount, AutoMap<ItemStack> aMap) { - for (int i = 0; i < aAmount; i++) { - aMap.add(aMaterial.getOre(1)); - } - } - - @Override - public String getMachineType() { - return "Miner"; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java deleted file mode 100644 index 8f81c180ad..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; public class - * GregtechMetaTileEntity_MultiTank extends GregtechMeta_MultiBlockBase { public GregtechMetaTileEntity_MultiTank(final - * int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } private short - * multiblockCasingCount = 0; private int mInternalSaveClock = 0; private final short storageMultiplier = 1; private int - * maximumFluidStorage = 128000; private FluidStack internalStorageTank = null; private final NBTTagCompound - * internalCraftingComponentsTag = new NBTTagCompound(); - * @Override public String getMachineType() { return "Fluid Tank"; } - * @Override public String[] getExtraInfoData() { final ArrayList<GT_MetaTileEntity_Hatch_Energy> mTier = - * this.mEnergyHatches; if (!mTier.isEmpty()){ final int temp = mTier.get(0).mTier; if (this.internalStorageTank == - * null) { return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", "Stored Fluid: No Fluid", - * "Internal | Current: "+Integer.toString(0) + "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + - * "L"}; } return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", - * "Stored Fluid: "+this.internalStorageTank.getLocalizedName(), - * "Internal | Current: "+Integer.toString(this.internalStorageTank.amount) + "L", - * "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } return new String[]{ - * "Voltage Tier not set -" +" Large Fluid Tank", "Stored Fluid: No Fluid", "Internal | Current: "+Integer.toString(0) + - * "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } - * @Override public void saveNBTData(final NBTTagCompound aNBT) { super.saveNBTData(aNBT); - */ -/* - * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); if - * (gtCraftingComponentsTag != null){ Utils.LOG_WARNING("Got Crafting Tag"); if (this.internalStorageTank != null){ - * Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data."); gtCraftingComponentsTag.setString("xFluid", - * this.internalStorageTank.getFluid().getName()); gtCraftingComponentsTag.setInteger("xAmount", - * this.internalStorageTank.amount); gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); - * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } else { - * Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data."); gtCraftingComponentsTag.removeTag("xFluid"); - * gtCraftingComponentsTag.removeTag("xAmount"); gtCraftingComponentsTag.removeTag("xAmountMax"); - * gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); aNBT.setTag("GT.CraftingComponents", - * gtCraftingComponentsTag); } } - *//* - * } - * @Override public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); - */ -/* - * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); String xFluid = null; - * int xAmount = 0; if (gtCraftingComponentsTag.hasNoTags()){ if (this.internalStorageTank != null){ - * Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data."); - * gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount); - * gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName()); - * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } } else { //internalCraftingComponentsTag = - * gtCraftingComponentsTag.getCompoundTag("backupTag"); if (gtCraftingComponentsTag.hasKey("xFluid")){ - * Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data."); xFluid = - * gtCraftingComponentsTag.getString("xFluid"); } if (gtCraftingComponentsTag.hasKey("xAmount")){ - * Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data."); xAmount = - * gtCraftingComponentsTag.getInteger("xAmount"); } if ((xFluid != null) && (xAmount != 0)){ - * Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid); this.setInternalTank(xFluid, xAmount); } - * } - *//* - * } private boolean setInternalTank(final String fluidName, final int amount){ final FluidStack temp = - * FluidUtils.getFluidStack(fluidName, amount); if (temp != null){ if (this.internalStorageTank == null){ - * this.internalStorageTank = temp; Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); } else{ - * Logger.WARNING("Retained Fluid."); - * Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); } - * this.markDirty(); return true; } return false; } - * @Override public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - * this.tryForceNBTUpdate(); super.onLeftclick(aBaseMetaTileEntity, aPlayer); } - * @Override public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer - * aPlayer, final float aX, final float aY, final float aZ) { this.tryForceNBTUpdate(); return - * super.onWrenchRightclick(side, aWrenchingSide, aPlayer, aX, aY, aZ); } - * @Override public void onRemoval() { this.tryForceNBTUpdate(); super.onRemoval(); } - * @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); if ((this.internalStorageTank != null) && - * this.internalStorageTank.amount >= this.maximumFluidStorage){ if (this.internalStorageTank.amount > - * this.maximumFluidStorage){ this.internalStorageTank.amount = this.maximumFluidStorage; } this.stopMachine(); } if - * (this.mInternalSaveClock != 20){ this.mInternalSaveClock++; } else { this.mInternalSaveClock = 0; - * this.tryForceNBTUpdate(); } } public GregtechMetaTileEntity_MultiTank(final String aName) { super(aName); } - * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new - * GregtechMetaTileEntity_MultiTank(this.mName); } - * @Override public String[] getTooltip() { return new String[]{ "Controller Block for the Multitank", - * "Size: 3xHx3 (Block behind controller must be air)", "Structure must be at least 4 blocks tall, maximum 20.", - * "Each casing within the structure adds 128000L storage.", "Multitank Exterior Casings (16 at least!)", - * "Controller (front centered)", "1x Input hatch", "1x Output hatch", "1x Energy Hatch", }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)}; } return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return null; } - * @Override public boolean isFacingValid(final ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = - * this.getStoredInputs(); for (int i = 0; i < (tInputList.size() - 1); i++) { for (int j = i + 1; j < - * tInputList.size(); j++) { if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { if - * (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { tInputList.remove(j--); } else { - * tInputList.remove(i--); break; } } } } final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new - * ItemStack[tInputList.size()]), 0, 2); final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); for (int i - * = 0; i < (tFluidList.size() - 1); i++) { for (int j = i + 1; j < tFluidList.size(); j++) { if - * (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { if (tFluidList.get(i).amount >= - * tFluidList.get(j).amount) { tFluidList.remove(j--); } else { tFluidList.remove(i--); break; } } } } final - * FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1); if (tFluids.length >= 2){ - * Logger.WARNING("Bad"); return false; } final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new - * ArrayList<>(); int slotInputCount = 0; for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - * boolean containsFluid = false; if (isValidMetaTileEntity(tHatch)) { slotInputCount++; for (int i=0; - * i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.canTankBeEmptied()){containsFluid=true;} } - * rList.add(new Pair<>(tHatch, containsFluid)); } } if ((tFluids.length <= 0) || (slotInputCount > 1)){ - * Logger.WARNING("Bad"); return false; } Logger.WARNING("Okay - 2"); if (this.internalStorageTank == null){ - * Logger.WARNING("Okay - 3"); if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > - * 0)){ Logger.WARNING("Okay - 4"); - * Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount - */ -/* +" internalStorageTank:"+internalStorageTank.amount *//* - * ); final FluidStack tempFluidStack = - * rList.get(0).getKey().mFluid; final Fluid tempFluid = - * tempFluidStack.getFluid(); this.internalStorageTank = - * FluidUtils.getFluidStack(tempFluid.getName(), - * tempFluidStack.amount); rList.get(0).getKey().mFluid.amount - * = 0; Logger.WARNING("Okay - 1.1" - * +" rList.get(0).getKey().mFluid.amount: "+rList.get(0). - * getKey().mFluid.amount - * +" internalStorageTank:"+this.internalStorageTank.amount); - * return true; } Logger.WARNING("No Fluid in hatch."); return - * false; } else if - * (this.internalStorageTank.isFluidEqual(rList.get(0).getKey() - * .mFluid)){ - * Logger.WARNING("Storing "+rList.get(0).getKey().mFluid. - * amount+"L"); - * Logger.WARNING("Contains "+this.internalStorageTank.amount+ - * "L"); int tempAdd = 0; tempAdd = - * rList.get(0).getKey().getFluidAmount(); - * rList.get(0).getKey().mFluid = null; - * Logger.WARNING("adding "+tempAdd); - * this.internalStorageTank.amount = - * this.internalStorageTank.amount + tempAdd; - * Logger.WARNING("Tank now Contains "+this.internalStorageTank - * .amount+"L of "+this.internalStorageTank.getFluid().getName( - * )+"."); //Utils.LOG_WARNING("Tank"); return true; } else { - * final FluidStack superTempFluidStack = - * rList.get(0).getKey().mFluid; - * Logger.WARNING("is input fluid equal to stored fluid? "+( - * this.internalStorageTank.isFluidEqual(superTempFluidStack))) - * ; if (superTempFluidStack != null) { - * Logger.WARNING("Input hatch[0] Contains " - * +superTempFluidStack.amount+"L of "+superTempFluidStack. - * getFluid().getName()+"."); } - * Logger.WARNING("Large Multi-Tank Contains "+this. - * internalStorageTank.amount+"L of "+this.internalStorageTank. - * getFluid().getName()+"."); if - * (this.internalStorageTank.amount <= 0){ - * Logger.WARNING("Internal Tank is empty, sitting idle."); - * return false; } if ((this.mOutputHatches.get(0).mFluid == - * null) || this.mOutputHatches.isEmpty() || - * (this.mOutputHatches.get(0).mFluid.isFluidEqual(this. - * internalStorageTank) && - * (this.mOutputHatches.get(0).mFluid.amount < - * this.mOutputHatches.get(0).getCapacity()))){ - * Logger.WARNING("Okay - 3"); final int tempCurrentStored = - * this.internalStorageTank.amount; int tempResult = 0; final - * int tempHatchSize = - * this.mOutputHatches.get(0).getCapacity(); final int - * tempHatchCurrentHolding = - * this.mOutputHatches.get(0).getFluidAmount(); final int - * tempHatchRemainingSpace = tempHatchSize - - * tempHatchCurrentHolding; final FluidStack tempOutputFluid = - * this.internalStorageTank; if (tempHatchRemainingSpace <= 0){ - * return false; } - * Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: " - * +tempHatchSize +" tempCurrentStored: " - * +tempCurrentStored+" output hatch holds: " - * +tempHatchCurrentHolding+" tank has " - * +tempHatchRemainingSpace+"L of space left."); if - * (tempHatchSize >= tempHatchRemainingSpace){ - * Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: " - * +tempHatchSize +" tempCurrentStored: " - * +tempCurrentStored+" output hatch holds: " - * +tempHatchCurrentHolding+" tank has " - * +tempHatchRemainingSpace+"L of space left."); int adder; if - * ((tempCurrentStored > 0) && (tempCurrentStored <= - * tempHatchSize)){ adder = tempCurrentStored; if (adder >= - * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } - * } else { adder = 0; if (tempCurrentStored >= - * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } - * } tempResult = adder; tempOutputFluid.amount = tempResult; - * Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult - * +" tempCurrentStored: "+tempCurrentStored + - * " filling output hatch with: "+tempOutputFluid. - * amount+"L of "+tempOutputFluid.getFluid().getName()); - * this.mOutputHatches.get(0).fill(tempOutputFluid, true); - * //mOutputHatches.get(0).mFluid.amount = tempResult; - * this.internalStorageTank.amount = (tempCurrentStored-adder); - * Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this. - * internalStorageTank.amount - * +"L | output hatch contains: "+this.mOutputHatches.get(0). - * mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid. - * getFluid().getName()); - */ -/* - * if (internalStorageTank.amount <= 0) internalStorageTank = null; - *//* - * } Logger.WARNING("Tank ok."); return true; } } //this.getBaseMetaTileEntity().(tFluids[0].amount, true); - * Logger.WARNING("Tank"); return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } - * @Override public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - * final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; final int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if - * (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { Logger.WARNING("Must be hollow."); return false; } int - * tAmount = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h - * != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) { final IGregTechTileEntity - * tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if - * ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, - * TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && - * (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if - * (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - * Logger.WARNING("Casing Expected."); return false; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + - * i, h, zDir + j) != 11) { if (h < 3){ Logger.WARNING("Wrong Meta."); return false; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if - * ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || - * aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - * Logger.WARNING("Found air"); } else { - * Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } - * } this.multiblockCasingCount = (short) tAmount; this.maximumFluidStorage = getMaximumTankStorage(tAmount); - * Logger.INFO("Your Multitank can be 20 blocks tall."); - * Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= - * 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); this.tryForceNBTUpdate(); return tAmount >= 16; } - */ -/* - * public int countCasings() { Utils.LOG_INFO("Counting Machine Casings"); try{ if - * (this.getBaseMetaTileEntity().getWorld() == null){ Utils.LOG_INFO("Tile Entity's world was null for casing count."); - * return 0; } if (this.getBaseMetaTileEntity() == null){ Utils.LOG_INFO("Tile Entity was null for casing count."); - * return 0; } } catch(NullPointerException r){ Utils.LOG_INFO("Null Pointer Exception caught."); return 0; } int xDir = - * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = - * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; if - * (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) { Utils.LOG_INFO("Failed due to air being misplaced."); - * Utils.LOG_WARNING("Must be hollow."); return 0; } int tAmount = 0; Utils.LOG_INFO("Casing Count set to 0."); for (int - * i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h != 0) || (((xDir + i != - * 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) { IGregTechTileEntity tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if - * ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, - * TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && - * (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if - * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - * Utils.LOG_WARNING("Casing Expected."); return 0; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if - * (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) { if (h < 3){ - * Utils.LOG_WARNING("Wrong Meta."); return 0; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if - * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || - * this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - * Utils.LOG_WARNING("Found air"); } else { - * Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } - * } Utils.LOG_INFO("Finished counting."); multiblockCasingCount = (short) tAmount; - * //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); - * Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= - * 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L"); return tAmount; } - *//* - * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(final ItemStack aStack) { return 5; } - * @Override public int getAmountOfOutputs() { return 1; } - * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } private static short - * getStorageMultiplier(final int casingCount){ final int tsm = 1*casingCount; if (tsm <= 0){ return 1; } return - * (short) tsm; } private static int getMaximumTankStorage(final int casingCount){ final int multiplier = - * getStorageMultiplier(casingCount); final int tempTankStorageMax = 128000*multiplier; if (tempTankStorageMax <= - * 0){return 128000;} return tempTankStorageMax; } private boolean tryForceNBTUpdate(){ - */ -/* - * //Block is invalid. if ((this == null) || (this.getBaseMetaTileEntity() == null)){ - * Utils.LOG_WARNING("Block was not valid for saving data."); return false; } //Don't need this to run clientside. if - * (!this.getBaseMetaTileEntity().isServerSide()) { return false; } //Internal Tag was not valid. try{ if - * (this.internalCraftingComponentsTag == null){ Utils.LOG_WARNING("Internal NBT data tag was null."); return false; } } - * catch (final NullPointerException x){ Utils.LOG_WARNING("Caught null NBT."); } //Internal tag was valid. - * this.saveNBTData(this.internalCraftingComponentsTag); //Mark block for update int x,y,z = 0; x = - * this.getBaseMetaTileEntity().getXCoord(); y = this.getBaseMetaTileEntity().getYCoord(); z = - * this.getBaseMetaTileEntity().getZCoord(); this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z); //Mark - * block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly) - * this.getBaseMetaTileEntity().markDirty(); - *//* - * return true; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java deleted file mode 100644 index 4f2ebd9a80..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java +++ /dev/null @@ -1,186 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tools; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; -import net.minecraft.util.IChatComponent; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.GregTech_API; -import gregtech.api.damagesources.GT_DamageSources; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; - -public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { - - public static final Enchantment[] FORTUNE_ENCHANTMENT = { Enchantment.fortune }; - public static final Enchantment[] LOOTING_ENCHANTMENT = { Enchantment.looting }; - public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0]; - public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0]; - - @Override - public int getToolDamagePerBlockBreak() { - return 100; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 800; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public int getHurtResistanceTime(final int aOriginalHurtResistance, final Entity aEntity) { - return aOriginalHurtResistance; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isWrench() { - return false; - } - - @Override - public boolean isWeapon() { - return false; - } - - @Override - public boolean isRangedWeapon() { - return false; - } - - @Override - public boolean isMiningTool() { - return true; - } - - @Override - public boolean isChainsaw() { - return false; - } - - @Override - public boolean isGrafter() { - return false; - } - - @Override - public DamageSource getDamageSource(final EntityLivingBase aPlayer, final Entity aEntity) { - return GT_DamageSources.getCombatDamage( - (aPlayer instanceof EntityPlayer) ? "player" : "mob", - aPlayer, - (aEntity instanceof EntityLivingBase) ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) - : null); - } - - public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer) - .func_151519_b(aEntity); - } - - @Override - public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, - final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, - final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { - return 0; - } - - @Override - public ItemStack getBrokenItem(final ItemStack aStack) { - return null; - } - - @Override - public Enchantment[] getEnchantments(final ItemStack aStack) { - return ZERO_ENCHANTMENTS; - } - - @Override - public int[] getEnchantmentLevels(final ItemStack aStack) { - return ZERO_ENCHANTMENT_LEVELS; - } - - @Override - public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) { - aPlayer.triggerAchievement(AchievementList.openInventory); - aPlayer.triggerAchievement(AchievementList.mineWood); - aPlayer.triggerAchievement(AchievementList.buildWorkBench); - } - - @Override - public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {} - - @Override - public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - return aOriginalDamage; - } - - @Override - public float getMagicDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - return aOriginalDamage; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java deleted file mode 100644 index e1248c0aae..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java +++ /dev/null @@ -1,9 +0,0 @@ -package gtPlusPlus.xmod.gregtech.loaders; - -import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures.ItemIcons.CustomIcon; - -public class Processing_Textures_Items { - - public static final CustomIcon itemSkookumChoocher = new CustomIcon("iconsets/SKOOKUMCHOOCHER"); - public static final CustomIcon itemElectricPump = new CustomIcon("iconsets/PUMP"); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java deleted file mode 100644 index e05e32331d..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java +++ /dev/null @@ -1,175 +0,0 @@ -package gtPlusPlus.xmod.gregtech.loaders.misc; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; -import net.minecraft.stats.AchievementList; -import net.minecraft.stats.StatBase; -import net.minecraftforge.common.AchievementPage; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.GT_Mod; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Recipe; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class AssLineAchievements { - - public static int assReg = -1; - public static ConcurrentHashMap<String, Achievement> mAchievementMap; - public static ConcurrentHashMap<String, Boolean> mIssuedAchievementMap; - public static int adjX = 5; - public static int adjY = 9; - private static boolean active = true; - - public AssLineAchievements() { - Logger.INFO( - active ? "Loading custom achievement page for Assembly Line recipes." : "Achievements are disabled."); - Utils.registerEvent(this); - } - - private static boolean ready = false; - private static int recipeTotal = 0; - private static int recipeCount = 0; - - private static void init() { - if (!ready) { - active = GT_Mod.gregtechproxy.mAchievements; - recipeTotal = GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.size(); - mAchievementMap = new ConcurrentHashMap<String, Achievement>(); - mIssuedAchievementMap = new ConcurrentHashMap<String, Boolean>(); - ready = true; - } - } - - public static void registerAchievements() { - if (active && mAchievementMap.size() > 0) { - AchievementPage.registerAchievementPage( - new AchievementPage( - "GT Assembly Line", - (Achievement[]) mAchievementMap.values().toArray(new Achievement[mAchievementMap.size()]))); - } else if (active) { - Logger.INFO("Unable to register custom achievement page for Assembly Line recipes."); - } - } - - public static Achievement registerAssAchievement(GT_Recipe recipe) { - init(); - String aSafeUnlocalName; - // Debugging - if (recipe == null) { - Logger.INFO( - "Someone tried to register an achievement for an invalid recipe. Please report this to Alkalus."); - return null; - } - if (recipe.getOutput(0) == null) { - Logger.INFO( - "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus."); - return null; - } - ItemStack aStack = recipe.getOutput(0); - try { - aSafeUnlocalName = aStack.getUnlocalizedName(); - } catch (Throwable t) { - aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack); - } - - Achievement aYouDidSomethingInGT; - if (mAchievementMap.get(aSafeUnlocalName) == null) { - assReg++; - recipeCount++; - aYouDidSomethingInGT = registerAchievement( - aSafeUnlocalName, - -(11 + assReg % 5), - ((assReg) / 5) - 8, - recipe.getOutput(0), - AchievementList.openInventory, - false); - } else { - aYouDidSomethingInGT = null; - } - if (recipeCount >= recipeTotal) { - Logger.INFO("Critical mass achieved. [" + recipeCount + "]"); - registerAchievements(); - } - - return aYouDidSomethingInGT; - } - - public static Achievement registerAchievement(String textId, int x, int y, ItemStack icon, Achievement requirement, - boolean special) { - if (!GT_Mod.gregtechproxy.mAchievements) { - return null; - } - Achievement achievement = new Achievement(textId, textId, adjX + x, adjY + y, icon, requirement); - if (special) { - achievement.setSpecial(); - } - achievement.registerStat(); - if (CORE.DEVENV) { - GT_Log.out.println("achievement." + textId + "="); - GT_Log.out.println("achievement." + textId + ".desc="); - } - mAchievementMap.put(textId, achievement); - return achievement; - } - - public static void issueAchievement(EntityPlayer entityplayer, String textId) { - if (entityplayer == null || !GT_Mod.gregtechproxy.mAchievements) { - return; - } - - entityplayer.triggerAchievement((StatBase) getAchievement(textId)); - } - - public static Achievement getAchievement(String textId) { - if (mAchievementMap.containsKey(textId)) { - Logger.INFO("Found Achivement: " + textId); - return (Achievement) mAchievementMap.get(textId); - } - return null; - } - - @SubscribeEvent - public void onItemPickup(EntityItemPickupEvent event) { - EntityPlayer player = event.entityPlayer; - ItemStack stack = event.item.getEntityItem(); - String aPickupUnlocalSafe = ItemUtils.getUnlocalizedItemName(stack); - if (player == null || stack == null) { - return; - } - - Logger.INFO("Trying to check for achievements"); - // Debug scanner unlocks all AL recipes in creative - if (player.capabilities.isCreativeMode && aPickupUnlocalSafe.equals("gt.metaitem.01.32761")) { - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) { - issueAchievement(player, recipe.getOutput(0).getUnlocalizedName()); - recipe.mHidden = false; - } - } - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) { - - String aSafeUnlocalName; - if (recipe.getOutput(0) == null) { - Logger.INFO( - "Someone tried to register an achievement for a recipe with null output. Please report this to Alkalus."); - continue; - } - ItemStack aStack = recipe.getOutput(0); - aSafeUnlocalName = ItemUtils.getUnlocalizedItemName(aStack); - if (aSafeUnlocalName.equals(aPickupUnlocalSafe)) { - issueAchievement(player, aSafeUnlocalName); - recipe.mHidden = false; - Logger.INFO("FOUND: " + aSafeUnlocalName + " | " + aPickupUnlocalSafe); - } else { - // Logger.INFO(aSafeUnlocalName + " | " + aPickupUnlocalSafe); - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 2cb2ed2c5f..88c2f90c3c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -31,7 +31,6 @@ import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG; import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntity_RTG; -import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator; public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @@ -116,7 +115,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aEUt, 0); GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(aRecipe); - RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java deleted file mode 100644 index cb0ec59f22..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java +++ /dev/null @@ -1,14 +0,0 @@ -package gtPlusPlus.xmod.gregtech.recipes.machines; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -public class RECIPEHANDLER_AssemblyLine { - - public static boolean addAssemblylineRecipe(ItemStack paramItemStack1, int paramInt1, - ItemStack[] paramArrayOfItemStack, FluidStack[] paramArrayOfFluidStack, ItemStack paramItemStack2, - int paramInt2, int paramInt3) { - - return false; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java deleted file mode 100644 index 599b98ed86..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java +++ /dev/null @@ -1,121 +0,0 @@ -package gtPlusPlus.xmod.gregtech.recipes.machines; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import gtPlusPlus.api.objects.Logger; - -public class RECIPEHANDLER_CokeOven { - - public static void debug1() { - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("Walking Through CokeOven Recipe Creation."); - Logger.WARNING("My name is Ralph and I will be your humble host."); - } - - public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - } - - public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.INFO( - "Successfully added a Coke Oven recipe for: " + aOutput.getDisplayName() - + " & " - + aFluidOutput.getFluid().getName() - + ", Using " - + aInput1.getDisplayName() - + " & " - + aInput2.getDisplayName() - + " & liquid " - + aFluidInput.getFluid().getName() - + ". This takes " - + (aDuration / 20) - + " seconds for " - + aEUt - + "eu/t."); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java deleted file mode 100644 index fc9ed99ffe..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.xmod.gregtech.recipes.machines; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class RECIPEHANDLER_Dehydrator { - - public static void debug1() { - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("Walking Through Chemical Dehydrator Recipe Creation."); - Logger.WARNING("My name is Willus and I will be your humble host."); - } - - public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - Logger.WARNING( - "aInput1:" + aInput1.toString() - + " aInput2:" - + aInput2.toString() - + " aFluidInput:" - + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aOutput:" - + aOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - } - - public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, - final FluidStack aFluidOutput, final ItemStack[] aOutput, final int aDuration, final int aEUt) { - - String inputAname; - String inputBname; - String inputFluidname; - String outputFluidName; - - if (aInput1 != null) { - inputAname = aInput1.getDisplayName(); - } else { - inputAname = "null"; - } - - if (aInput2 != null) { - inputBname = aInput2.getDisplayName(); - } else { - inputBname = "null"; - } - - if (aFluidInput != null) { - inputFluidname = aFluidInput.getFluid().getName(); - } else { - inputFluidname = "null"; - } - - if (aFluidOutput != null) { - outputFluidName = aFluidOutput.getFluid().getName(); - } else { - outputFluidName = "null"; - } - - Logger.INFO( - "Successfully added a Chemical Dehydrator recipe for: " + ItemUtils.getArrayStackNames(aOutput) - + " & " - + outputFluidName - + ", Using " - + inputAname - + " & " - + inputBname - + " & liquid " - + inputFluidname - + ". This takes " - + (aDuration / 20) - + " seconds for " - + aEUt - + "eu/t."); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java deleted file mode 100644 index ea2f4a95fe..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java +++ /dev/null @@ -1,101 +0,0 @@ -package gtPlusPlus.xmod.gregtech.recipes.machines; - -import net.minecraftforge.fluids.FluidStack; - -import gtPlusPlus.api.objects.Logger; - -public class RECIPEHANDLER_MatterFabricator { - - public static void debug1() { - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("Walking Through Matter Fabrication Recipe Creation."); - Logger.WARNING("My name is Ralph and I will be your humble host."); - } - - public static void debug2(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, - final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING( - "aFluidInput:" + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug3(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, - final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING( - "aFluidInput:" + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - } - - public static void debug4(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, - final int aEUt) { - Logger.WARNING("=================================================================================="); - Logger.WARNING("Taking a step forward."); - Logger.WARNING( - "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING( - "aFluidInput:" + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - Logger.WARNING("Passed."); - Logger.WARNING( - "aFluidInput:" + aFluidInput.toString() - + " aFluidOutput:" - + aFluidOutput.toString() - + " aDuration:" - + aDuration - + " aEU/t:" - + aEUt); - } - - public static void debug5(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, - final int aEUt) { - String a = "nothing"; - String b = ""; - - if (aFluidInput != null) { - a = aFluidInput.getFluid().getName(); - } - if (aFluidOutput != null) { - b = aFluidOutput.getFluid().getName(); - } - - Logger.INFO( - "Successfully added a Matter Fabrication recipe for: " + b - + ", Using " - + " liquid " - + a - + ". This takes " - + (aDuration / 20) - + " seconds for " - + aEUt - + "eu/t."); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - Logger.WARNING("=================================================================================="); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java deleted file mode 100644 index 592db618f2..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java +++ /dev/null @@ -1,6 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechBedrockPlatforms { //941-945 public - * static void run() { Logger.INFO("Gregtech5u Content | Registering Bedrock Mining Platform."); - * GregtechItemList.BedrockMiner_MKI.set(new GregtechMetaTileEntity_BedrockMiningPlatform1(941, - * "multimachine.tier.01.bedrockminer", "Experimental Deep Earth Drilling Platform - MK I").getStackForm(1)); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV deleted file mode 100644 index d063d85b1f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV +++ /dev/null @@ -1,15 +0,0 @@ - - -public class GregtechGeneratorsULV { - public static void run(){ - - GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator(960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0).getStackForm(1L)); - GregtechItemList.Generator_Gas_Turbine_ULV.set(new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0).getStackForm(1L)); - GregtechItemList.Generator_Steam_Turbine_ULV.set(new GT_MetaTileEntity_ULV_SteamTurbine(962, "basicgenerator.steam.tier.00", "Simple Steam Turbine", 0).getStackForm(1L)); - - GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_ULV, 'P', GregtechItemList.Electric_Piston_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'G', OrePrefixes.gearGt.get(Materials.Bronze)}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "RMR", aTextMotorWire, 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy)}); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "RMR", aTextMotorWire, 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.pipeMedium.get(Materials.Copper)}); - - } -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java deleted file mode 100644 index e17b8f22a2..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechIndustrialMultiTank { public static void - * run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - * Logger.INFO("Gregtech5u Content | Registering Industrial Multitank controller blocks."); if - * (CORE.ConfigSwitches.enableMultiblock_MultiTank) { run1(); } } } private static void run1() { - * GregtechItemList.Industrial_MultiTank .set(new GregtechMetaTileEntity_MultiTank(827, - * "multitank.controller.tier.single", "Gregtech Multitank") .getStackForm(1L)); // - * GregtechItemList.Industrial_MultiTankDense.set(new // GregtechMetaTileEntityMultiTankDense(828, // - * "multitankdense.controller.tier.single", "Gregtech Dense // Multitank").getStackForm(1L)); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java deleted file mode 100644 index ca2b1237c3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechMiniRaFusion { public static void run() - * { // Register the Simple Fusion Entity. GregtechItemList.Miniature_Fusion.set(new GregtechMTE_MiniFusionPlant(31015, - * "gtplusplus.fusion.single", "Helium Prime").getStackForm(1L)); GregtechItemList.Plasma_Tank.set(new - * GT_MetaTileEntity_Hatch_Plasma(31016, "gtplusplus.tank.plasma", "Plasma Tank").getStackForm(1L)); } public static - * boolean generateSlowFusionrecipes() { for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList){ if - * (x.mEnabled) { GT_Recipe y = x.copy(); y.mDuration *= 16; long z = y.mEUt * 4; if (z > Integer.MAX_VALUE) { - * y.mEnabled = false; continue; } y.mEUt = (int) Math.min(Math.max(0, z), Integer.MAX_VALUE); y.mCanBeBuffered = true; - * GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.add(y); } } int mRecipeCount = - * GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.mRecipeList.size(); if (mRecipeCount > 0) { - * Logger.INFO("[Pocket Fusion] Generated "+mRecipeCount+" recipes for the Pocket Fusion Reactor."); return true; } - * return false; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java deleted file mode 100644 index c98b023b08..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java +++ /dev/null @@ -1,7 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechNaqReactor { public static void run() { - * if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - * Logger.INFO("Gregtech5u Content | Registering Futuristic Naquadah Reactor {LNR]."); run1(); } } private static void - * run1() { // LFTR GregtechItemList.Controller_Naq_Reactor.set(new GregtechMTE_LargeNaqReactor(970, - * "lnr.controller.single", "Naquadah Reactor Mark XII").getStackForm(1L)); } } - */ |