From e6ecfb3505e79fab5e0dfa7e597d6efc30de5b14 Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Mon, 30 Dec 2019 18:26:48 +0100 Subject: fix space for fluid detection --- .../implementations/base/GregtechMeta_MultiBlockBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 4a6cad20c3..53068c68a1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -770,7 +770,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult // We have Fluid Stacks we did not merge. Do we have space? if (aOutputFluids.size() > 0) { // Not enough space to add fluids. - if (aOutputFluids.size() < aEmptyFluidHatches) { + if (aOutputFluids.size() > aEmptyFluidHatches) { Logger.INFO("Failed to find enough space for all fluid outputs."); return false; } -- cgit From a3777ddeab2cce237cf9a4a3891483c3aaf08d3d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 30 Dec 2019 20:32:05 +0000 Subject: + Implemented Blacklist for OB Glider. Closes #584. + Added default versioning file. --- src/Java/gtPlusPlus/xmod/ob/GliderHandler.java | 102 +++++++++++++++++++++ .../gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java | 38 ++++++++ 2 files changed, 140 insertions(+) create mode 100644 src/Java/gtPlusPlus/xmod/ob/GliderHandler.java create mode 100644 src/Java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java new file mode 100644 index 0000000000..b1874b7ed2 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java @@ -0,0 +1,102 @@ +package gtPlusPlus.xmod.ob; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerUseItemEvent; + +public class GliderHandler { + + private static final AutoMap mDimensionalBlacklist = new AutoMap(); + + @SubscribeEvent + public void onItemUsage(final PlayerUseItemEvent event) { + if (event != null) { + ItemStack aItem = event.item; + if (ItemUtils.checkForInvalidItems(aItem)) { + Class aItemGliderClass = ReflectionUtils.getClass("openblocks.common.item.ItemHangGlider"); + if (aItemGliderClass.isInstance(aItem.getItem())) { + if (!canPlayerGlideInThisDimension(event.entityPlayer)){ + event.setCanceled(true); + } + } + } + } + } + + private static final boolean canPlayerGlideInThisDimension(EntityPlayer aPlayer) { + World aWorld = aPlayer.worldObj; + if (aWorld == null) { + return false; + } + else { + if (aWorld.provider == null) { + return false; + } + else { + int aDimID = aWorld.provider.dimensionId; + for (int i : mDimensionalBlacklist) { + if (i == aDimID) { + return false; + } + } + } + } + return true; + } + + static final void populateBlacklist() { + if (!mDimensionalBlacklist.isEmpty()) { + return; + } + File aBlacklist = gtPlusPlus.core.util.data.FileUtils.getFile("config/GTplusplus/", "GliderBlacklist", "cfg"); + List lines = new ArrayList(); + try { + lines = org.apache.commons.io.FileUtils.readLines(aBlacklist, "utf-8"); + } catch (IOException e) { + e.printStackTrace(); + } + if (lines.isEmpty()) { + FileWriter fw; + try { + String aInfoTip = "# Add one dimension ID per line. Lines with a # are comments and are ignored."; + fw = new FileWriter(aBlacklist); + fw.write(aInfoTip); + fw.close(); + lines.add(aInfoTip); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (!lines.isEmpty()) { + for (String s : lines) { + if (s != null && !s.equals("") && !s.contains("#")) { + s = StringUtils.remove(s, " "); + s = StringUtils.trim(s); + s = StringUtils.remove(s, ","); + Integer g = Integer.decode(s); + if (g != null) { + mDimensionalBlacklist.add(g); + Logger.INFO("[OpenBlocks] Added Dimension with ID '"+g+"' to Blacklist for Glider."); + } + } + } + } + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java b/src/Java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java new file mode 100644 index 0000000000..c1b678f5ee --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java @@ -0,0 +1,38 @@ +package gtPlusPlus.xmod.ob; + +import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; + +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.base.BaseItemBurnable; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class HANDLER_OpenBlocks { + + public static void preInit() { + if (LoadedMods.OpenBlocks) { + + } + } + + public static void init() { + if (LoadedMods.OpenBlocks) { + GliderHandler.populateBlacklist(); + } + } + + public static void postInit() { + if (LoadedMods.OpenBlocks) { + Utils.registerEvent(new GliderHandler()); + } + } + +} -- cgit From 3a9f2400d30a319990e2ec792fef963cb2f1d3df Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 30 Dec 2019 23:19:38 +0000 Subject: + Added a Debug command for GT++ Chunkloading capabilities. % Retiered Chunkloaders. $ Potentially Fixed Chunkloaders. Thanks to @Repo-alt if such is the case. --- .../xmod/gregtech/api/enums/GregtechItemList.java | 2 +- .../GregtechMetaAtmosphericReconditioner.java | 2 - .../basic/GregtechMetaTileEntityChunkLoader.java | 529 +++++++++++---------- .../gregtech/GregtechTieredChunkloaders.java | 9 +- 4 files changed, 291 insertions(+), 251 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 7c395392a3..573937aeee 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -466,7 +466,7 @@ public enum GregtechItemList implements GregtechItemContainer { Super_Chest_LV, Super_Chest_MV, Super_Chest_HV, Super_Chest_EV, Super_Chest_IV, //Chunkloader - GT_Chunkloader_HV, GT_Chunkloader_EV, GT_Chunkloader_IV, + GT_Chunkloader_HV, GT_Chunkloader_ZPM, GT_Chunkloader_IV, //Wireless Chargers diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 10a1f96be7..33c6bacbd4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -71,13 +71,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); }*/ - @SuppressWarnings("deprecation") @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaAtmosphericReconditioner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); } - @SuppressWarnings("deprecation") @Override public String[] getDescription() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java index 10023722c0..2a2b6d5090 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java @@ -1,122 +1,165 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; +import static gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils.mPollution; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.Map; +import java.util.HashSet; import java.util.Set; -import java.util.UUID; -import com.google.common.collect.MapMaker; -import com.google.common.collect.UnmodifiableIterator; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.common.ForgeChunkManager; -import net.minecraftforge.common.ForgeChunkManager.Ticket; -import net.minecraftforge.common.ForgeChunkManager.Type; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.IGregtechPacketEntity; -import gtPlusPlus.core.handler.chunkloading.ChunkManager; -import gtPlusPlus.core.util.minecraft.network.PacketBuilder; - -public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_TieredMachineBlock implements IGregtechPacketEntity { - - @SuppressWarnings("unused") - private final static int yMin = 0; - private final static int yMax = 254; - private final int xMin, xMax; - private final int zMin, zMax; - - public GregtechMetaTileEntityChunkLoader(final int aID, final String aName, final String aNameRegional, final int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "Loads chunks: " + (16 + (48 * aTier)) + " powered"); - xMin = this.xCoord-47; - xMax = this.xCoord+47; - zMin = this.zCoord-47; - zMax = this.zCoord+47; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.interfaces.IChunkLoader; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.chunkloading.GTPP_ChunkManager; +import gtPlusPlus.core.chunkloading.StaticChunkFunctions; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMachine implements IChunkLoader { + + public GregtechMetaTileEntityChunkLoader(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 2, "Loads " + getMaxChunksToLoadForTier(aTier) + " chunks when powered", 0, 0, "Recycler.png", "", + new ITexture[]{ + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) + }); } - public GregtechMetaTileEntityChunkLoader(final String aName, final int aTier, final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - xMin = this.xCoord-47; - xMax = this.xCoord+47; - zMin = this.zCoord-47; - zMax = this.zCoord+47; + public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 2, aDescription, aTextures, 0, 0, aGUIName, aNEIName); } - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityChunkLoader(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); + public static int getMaxChunksToLoadForTier(int aTier) { + return (aTier * aTier); } @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)}; + public String[] getDescription() { + return new String[] { + this.mDescription, + }; } @Override - public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { - + 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 void onRemoval() { - + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; } - @Override - public boolean isSimpleMachine() { - return false; + + public ITexture[] getFront(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)}; } - @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing > 1; + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)}; } - @Override - public boolean isEnetInput() { - return true; + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)}; } - @Override - public boolean isInputFacing(final byte aSide) { - return true; + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)}; } - @Override - public boolean isTeleporterCompatible() { - return false; + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)}; } - @Override - public long getMinimumStoredEU() { - return 512; + + public ITexture[] getFrontActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)}; + } + + + public ITexture[] getBackActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)}; + } + + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)}; + } + + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)}; + } + + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)}; } @Override - public long maxEUStore() { - return 512 + (V[this.mTier] * 50); + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + PlayerUtils.messagePlayer(aPlayer, "Running every "+" minutes."); + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } @Override - public long maxEUInput() { - return V[this.mTier]; + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntityChunkLoader(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); } @Override - public long maxAmperesIn() { - return 2; + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()){ + return true; + } + this.showPollution(aPlayer.getEntityWorld(), aPlayer); + return true; + } + + private void showPollution(final World worldIn, final EntityPlayer playerIn){ + //PlayerUtils.messagePlayer(playerIn, "Running every "+mFrequency+" minutes. Owner: "+this.getBaseMetaTileEntity().getOwnerName()); + //PlayerUtils.messagePlayer(playerIn, "Last run: "+Utils.getSecondsFromMillis(aDiff)+" seconds ago."); } @Override @@ -129,230 +172,230 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_TieredM return false; } + @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - return new ITexture[0][0][0]; + public String[] getInfoData() { + return new String[] { + this.getLocalName() + }; } @Override - public void saveNBTData(final NBTTagCompound aNBT) { - + public boolean isGivingInformation() { + return true; } @Override - public void loadNBTData(final NBTTagCompound aNBT) { - + public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) { + return false; } - - - - - /** - * Chunkloading Code from Railcraft - */ - - private static final Map tickets = new MapMaker().makeMap(); - private static final byte MAX_CHUNKS = 25; - private static final byte ANCHOR_RADIUS = 1; - private int prevX; - private int prevY; - private int prevZ; - private Set chunks; - private boolean hasTicket; - private boolean refreshTicket; - private boolean powered; - private UUID uuid; - private int xCoord, yCoord, zCoord; - - public UUID getUUID() { - if (this.uuid == null) { - this.uuid = UUID.randomUUID(); - } - return this.uuid; + @Override + public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { + return false; } - private boolean sendClientUpdate = false; - - public void sendUpdateToClient(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { - this.sendClientUpdate = true; - } else { - PacketBuilder.instance().sendTileEntityPacket(aBaseMetaTileEntity); - } + @Override + public int getSizeInventory() { + return 0; + } + @Override + public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) { + return true; } - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { - super.onPostTick(aBaseMetaTileEntity, aTimer); - if (!aBaseMetaTileEntity.isServerSide()) { - return; - } - else { - if (this.xCoord != this.prevX || this.yCoord != this.prevY || this.zCoord != this.prevZ) { - this.releaseTicket(aBaseMetaTileEntity); - this.prevX = this.xCoord; - this.prevY = this.yCoord; - this.prevZ = this.zCoord; - } - - this.powered = meetsTicketRequirements(); - if (this.hasActiveTicket() && (this.getTicket().world != aBaseMetaTileEntity.getWorld() || this.refreshTicket || !this.powered)) { - this.releaseTicket(aBaseMetaTileEntity); - } - if (!this.hasActiveTicket()) { - this.requestTicket(aBaseMetaTileEntity); + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + + // Have we set the Chunk this Tile resides in yet? + if (mCurrentChunk == null) { + int xTile = getBaseMetaTileEntity().getXCoord(); + int zTile = getBaseMetaTileEntity().getZCoord(); + createInitialWorkingChunk(aBaseMetaTileEntity, xTile, zTile); + } + + // Try unload all chunks if fail to meet global chunkloading conditions. + if (StaticChunkFunctions.onPostTick(aBaseMetaTileEntity, aTick)) { + // Can this tile actively chunkload? + if (getChunkLoadingActive()) { + // Consume some power + this.setEUVar(this.getEUVar() - (maxEUInput() * maxAmperesIn())); + + // Do we need to re-request tickets? + if (getDoesWorkChunkNeedReload()) { + // Request ticket for current chunk. + GTPP_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), mCurrentChunk); + // Request a ticket for each chunk we have mapped out in a spiral pattern. + if (!mLoadedChunks.isEmpty()) { + for (ChunkCoordIntPair Y : mLoadedChunks) { + GTPP_ChunkManager.requestChunkLoad((TileEntity)getBaseMetaTileEntity(), Y); + } + } + setDoesWorkChunkNeedReload(false); + } + } - } - if (this.sendClientUpdate) { - this.sendClientUpdate = false; - PacketBuilder.instance().sendTileEntityPacket(aBaseMetaTileEntity); - } + } } - public void validate() { - this.refreshTicket = true; + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + StaticChunkFunctions.saveNBTDataForTileEntity(this.getBaseMetaTileEntity(), aNBT); } - protected void releaseTicket(IGregTechTileEntity aBaseMetaTileEntity) { - this.refreshTicket = false; - this.setTicket(aBaseMetaTileEntity, (Ticket) null); + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + StaticChunkFunctions.loadNBTDataForTileEntity(this.getBaseMetaTileEntity(), aNBT); } - protected void requestTicket(IGregTechTileEntity aBaseMetaTileEntity) { - if (this.meetsTicketRequirements()) { - Ticket chunkTicket = this.getTicketFromForge(aBaseMetaTileEntity); - if (chunkTicket != null) { - this.setTicketData(aBaseMetaTileEntity, chunkTicket); - this.forceChunkLoading(aBaseMetaTileEntity, chunkTicket); - } - } + @Override + public long maxAmperesIn() { + return 2; } - protected boolean meetsTicketRequirements() { - return this.getEUVar() > (V[this.mTier]*2); - } - - public Ticket getTicketFromForge(IGregTechTileEntity aBaseMetaTileEntity) { - return ForgeChunkManager.requestTicket(GTplusplus.instance, aBaseMetaTileEntity.getWorld(), Type.NORMAL); + @Override + public long getMinimumStoredEU() { + return V[mTier] * 2; } - protected void setTicketData(IGregTechTileEntity aBaseMetaTileEntity, Ticket chunkTicket) { - chunkTicket.getModData().setInteger("xCoord", this.xCoord); - chunkTicket.getModData().setInteger("yCoord", this.yCoord); - chunkTicket.getModData().setInteger("zCoord", this.zCoord); - chunkTicket.getModData().setString("type", "StandardChunkLoader"); + @Override + public long maxEUStore() { + return V[mTier] * 256; } - public boolean hasActiveTicket() { - return this.getTicket() != null; + @Override + public long maxEUInput() { + return V[mTier]; } - public Ticket getTicket() { - return (Ticket) tickets.get(this.getUUID()); + + /* + * Chunkloading Vars + */ + + private long mTicksRemainingForChunkloading = -1; + private ChunkCoordIntPair mCurrentChunk; + private Set mLoadedChunks = new HashSet(); + private boolean mRefreshChunkTickets = false; + + @Override + public long getTicksRemaining() { + return -1; } - public void setTicket(IGregTechTileEntity aBaseMetaTileEntity, Ticket t) { - boolean changed = false; - Ticket ticket = this.getTicket(); - if (ticket != t) { - if (ticket != null) { - if (ticket.world == aBaseMetaTileEntity.getWorld()) { - UnmodifiableIterator var4 = ticket.getChunkList().iterator(); - - while (var4.hasNext()) { - ChunkCoordIntPair chunk = (ChunkCoordIntPair) var4.next(); - if (ForgeChunkManager.getPersistentChunksFor(aBaseMetaTileEntity.getWorld()).keys().contains(chunk)) { - ForgeChunkManager.unforceChunk(ticket, chunk); - } - } - - ForgeChunkManager.releaseTicket(ticket); - } - - tickets.remove(this.getUUID()); - } - - changed = true; - } - - this.hasTicket = t != null; - if (this.hasTicket) { - tickets.put(this.getUUID(), t); - } - - if (changed) { - this.sendUpdateToClient(aBaseMetaTileEntity); - } - + @Override + public void setTicksRemaining(long aTicks) { + mTicksRemainingForChunkloading = aTicks; } - - public void forceChunkLoading(IGregTechTileEntity aBaseMetaTileEntity, Ticket ticket) { - this.setTicket(aBaseMetaTileEntity, ticket); - this.setupChunks(); - if (this.chunks != null) { - Iterator var2 = this.chunks.iterator(); - while (var2.hasNext()) { - ChunkCoordIntPair chunk = (ChunkCoordIntPair) var2.next(); - ForgeChunkManager.forceChunk(ticket, chunk); - } - } + + @Override + public ChunkCoordIntPair getResidingChunk() { + return mCurrentChunk; } - - public void setupChunks() { - if (!this.hasTicket) { - this.chunks = null; - } - else { - this.chunks = ChunkManager.getInstance().getChunksAround(this.xCoord >> 4, this.zCoord >> 4, 1); - } + + @Override + public void setResidingChunk(ChunkCoordIntPair aCurrentChunk) { + mCurrentChunk = aCurrentChunk; } @Override - public void onExplosion() { - this.releaseTicket(this.getBaseMetaTileEntity()); - super.onExplosion(); + public boolean getChunkLoadingActive() { + return this.getEUVar() >= maxEUInput() * maxAmperesIn(); } @Override - public void onValueUpdate(byte aValue) { - super.onValueUpdate(aValue); + public void setChunkLoadingActive(boolean aActive) { + } @Override - public void onMachineBlockUpdate() { - super.onMachineBlockUpdate(); + public boolean getDoesWorkChunkNeedReload() { + return mRefreshChunkTickets; } @Override - public void markDirty() { - this.refreshTicket = true; - super.markDirty(); + public void setDoesWorkChunkNeedReload(boolean aActive) { + mRefreshChunkTickets = aActive; } @Override - public boolean connectsToItemPipe(byte aSide) { - return false; + public boolean addChunkToLoadedList(ChunkCoordIntPair aActiveChunk) { + return mLoadedChunks.add(aActiveChunk); } @Override - public void doExplosion(long aExplosionPower) { - this.releaseTicket(this.getBaseMetaTileEntity()); - super.doExplosion(aExplosionPower); + public boolean removeChunkFromLoadedList(ChunkCoordIntPair aActiveChunk) { + return mLoadedChunks.remove(aActiveChunk); } - public void writePacketData(DataOutputStream data) throws IOException { - data.writeBoolean(this.hasTicket); + @Override + public Set getManagedChunks() { + return mLoadedChunks; } - public void readPacketData(DataInputStream data) throws IOException { - boolean tick = data.readBoolean(); - if (this.hasTicket != tick) { - this.hasTicket = tick; - this.markDirty(); + @Override + public void onRemoval() { + StaticChunkFunctions.onRemoval(getBaseMetaTileEntity()); + super.onRemoval(); + } + + public static Set spiralChunks(final IGregTechTileEntity aBaseMetaTileEntity, int X, int Z) { + World w = aBaseMetaTileEntity.getWorld(); + HashSet aSet = new HashSet(); + if (w == null) { + return aSet; } - this.setupChunks(); + Chunk thisChunk = w.getChunkFromBlockCoords(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getZCoord()); + ChunkCoordIntPair aChunkCo = new ChunkCoordIntPair(thisChunk.xPosition, thisChunk.zPosition); + int x,z,dx,dz; + x = z = dx =0; + dz = -1; + int t = Math.max(X,Z); + int maxI = t*t; + for(int i =0; i < maxI; i++){ + if ((-X/2 <= x) && (x <= X/2) && (-Z/2 <= z) && (z <= Z/2)){ + Chunk C = w.getChunkFromChunkCoords(aChunkCo.chunkXPos + x, aChunkCo.chunkZPos + z); + if (C != null) { + aSet.add(new ChunkCoordIntPair(C.xPosition, C.zPosition)); + } + } + if( (x == z) || ((x < 0) && (x == -z)) || ((x > 0) && (x == 1-z))){ + t = dx; + dx = -dz; + dz = t; + } + x += dx; + z += dz; + } + return aSet; } -} + + @Override + public int getChunkloaderTier() { + return mTier; + } + + public void createInitialWorkingChunk(IGregTechTileEntity aBaseMetaTileEntity, int aTileX, int aTileZ) { + final int centerX = aTileX >> 4; + final int centerZ = aTileZ >> 4; + addChunkToLoadedList(new ChunkCoordIntPair(centerX, centerZ)); + GTPP_ChunkManager.requestChunkLoad((TileEntity)aBaseMetaTileEntity.getMetaTileEntity(), getResidingChunk()); + // If this surrounding chunk map for this tile is empty, we spiral out and map chunks to keep loaded. + if (getManagedChunks().isEmpty()) { + int aChunks = GregtechMetaTileEntityChunkLoader.getMaxChunksToLoadForTier(getChunkloaderTier()); + mLoadedChunks.addAll(spiralChunks(aBaseMetaTileEntity, getChunkloaderTier(), getChunkloaderTier())); + } + if (!mLoadedChunks.isEmpty()) { + for (ChunkCoordIntPair Y : mLoadedChunks) { + GTPP_ChunkManager.requestChunkLoad((TileEntity)aBaseMetaTileEntity.getMetaTileEntity(), Y); + } + } + setDoesWorkChunkNeedReload(false); + } + + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java index 84f0adc275..bbfd568e54 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java @@ -11,7 +11,6 @@ public class GregtechTieredChunkloaders { Logger.INFO("Gregtech5u Content | Registering Chunk Loaders."); run1(); } - } private static void run1() { @@ -19,11 +18,11 @@ public class GregtechTieredChunkloaders { GregtechItemList.GT_Chunkloader_HV .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.01", "Chunkloader MK I", 3) .getStackForm(1L)); - GregtechItemList.GT_Chunkloader_EV - .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.02", "Chunkloader MK II", 4) - .getStackForm(1L)); GregtechItemList.GT_Chunkloader_IV - .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.03", "Chunkloader MK III", 5) + .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.02", "Chunkloader MK II", 5) + .getStackForm(1L)); + GregtechItemList.GT_Chunkloader_ZPM + .set(new GregtechMetaTileEntityChunkLoader(ID++, "chunkloader.tier.03", "Chunkloader MK III", 7) .getStackForm(1L)); } } -- cgit From 0ebbaf88ecce9a0e6fcd84498a0e4f1bcf387331 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 31 Dec 2019 15:22:02 +0000 Subject: + Added the Adv. DT. (Locked to T1 for now) + Added 10 new casing blocks, with assembler recipes. - Removed obsolete Chunkloading classes. --- .../xmod/gregtech/api/enums/GregtechItemList.java | 9 + .../blocks/GregtechMetaTieredCasingBlocks1.java | 111 ++++++ .../common/blocks/textures/TexturesGtBlock.java | 22 ++ ...egtechMetaTileEntity_Adv_DistillationTower.java | 374 +++++++++++++++++++++ .../xmod/gregtech/loaders/Gregtech_Blocks.java | 9 +- .../GregtechFactoryGradeReplacementMultis.java | 6 + .../gregtech/GregtechFluidReactor.java | 25 +- 7 files changed, 541 insertions(+), 15 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 573937aeee..28692e25cb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -132,6 +132,14 @@ public enum GregtechItemList implements GregtechItemContainer { * MultiBlocks */ + + // Tier GT++ Casings + GTPP_Casing_ULV, GTPP_Casing_LV, + GTPP_Casing_MV, GTPP_Casing_HV, + GTPP_Casing_EV, GTPP_Casing_IV, + GTPP_Casing_LuV, GTPP_Casing_ZPM, + GTPP_Casing_UV, GTPP_Casing_MAX, + //IronBlastFurnace Machine_Bronze_BlastFurnace Machine_Iron_BlastFurnace, Casing_IronPlatedBricks, @@ -288,6 +296,7 @@ public enum GregtechItemList implements GregtechItemContainer { Machine_Adv_BlastFurnace, Casing_Adv_BlastFurnace, Machine_Adv_ImplosionCompressor, + Machine_Adv_DistillationTower, //Advanced Vacuum Freezer diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java new file mode 100644 index 0000000000..94f97d8662 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -0,0 +1,111 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; + + +public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbstract { + + + private static class TieredCasingItemBlock extends GregtechMetaCasingItems { + + public TieredCasingItemBlock(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int aMeta = aStack.getItemDamage(); + if (aMeta < 10) { + aList.add("Tier: "+GT_Values.VN[aMeta]); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaTieredCasingBlocks1() { + super(TieredCasingItemBlock.class, "gtplusplus.blocktieredcasings.1", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + // Don't register these Textures, Hatches should never need to use their Textures. + } + int aIndex = 0; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Integral Encasement I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Integral Encasement II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Integral Encasement III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Integral Encasement IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Integral Encasement V"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Integral Framework I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Integral Framework II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Integral Framework III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Integral Framework IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Integral Framework V"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", " "); + + GregtechItemList.GTPP_Casing_ULV.set(new ItemStack(this, 1, 0)); + GregtechItemList.GTPP_Casing_LV.set(new ItemStack(this, 1, 1)); + GregtechItemList.GTPP_Casing_MV.set(new ItemStack(this, 1, 2)); + GregtechItemList.GTPP_Casing_HV.set(new ItemStack(this, 1, 3)); + GregtechItemList.GTPP_Casing_EV.set(new ItemStack(this, 1, 4)); + GregtechItemList.GTPP_Casing_IV.set(new ItemStack(this, 1, 5)); + GregtechItemList.GTPP_Casing_LuV.set(new ItemStack(this, 1, 6)); + GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7)); + GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8)); + GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9)); + + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 10)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 11)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 12)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 13)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 14)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 15)); + } + + public IIcon getIcon(int aSide, int aMeta) { + if (aMeta < 10) { + return TexturesGtBlock.TIERED_MACHINE_HULLS[aMeta].getIcon(); + } + switch (aMeta) { + case 10: + return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + case 11: + return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon(); + case 12: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 13: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 14: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 15: + return Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR.getIcon(); + } + return TexturesGtBlock.TEXTURE_CASING_TIERED_ULV.getIcon(); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 6cac1fddea..0e25057d35 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -408,6 +408,17 @@ public class TexturesGtBlock { private static final CustomIcon Internal_OVERLAY_AUTOMATION_SUPERBUFFER = new CustomIcon("iconsets/AUTOMATION_SUPERBUFFER"); public static final CustomIcon OVERLAY_AUTOMATION_SUPERBUFFER = Internal_OVERLAY_AUTOMATION_SUPERBUFFER; + // GT++ Tiered Hulls + public static final CustomIcon TEXTURE_CASING_TIERED_ULV = new CustomIcon("iconsets/TieredHulls/CASING_ULV"); + public static final CustomIcon TEXTURE_CASING_TIERED_LV = new CustomIcon("iconsets/TieredHulls/CASING_LV"); + public static final CustomIcon TEXTURE_CASING_TIERED_MV = new CustomIcon("iconsets/TieredHulls/CASING_MV"); + public static final CustomIcon TEXTURE_CASING_TIERED_HV = new CustomIcon("iconsets/TieredHulls/CASING_HV"); + public static final CustomIcon TEXTURE_CASING_TIERED_EV = new CustomIcon("iconsets/TieredHulls/CASING_EV"); + public static final CustomIcon TEXTURE_CASING_TIERED_IV = new CustomIcon("iconsets/TieredHulls/CASING_IV"); + public static final CustomIcon TEXTURE_CASING_TIERED_LuV = new CustomIcon("iconsets/TieredHulls/CASING_LuV"); + public static final CustomIcon TEXTURE_CASING_TIERED_ZPM = new CustomIcon("iconsets/TieredHulls/CASING_ZPM"); + public static final CustomIcon TEXTURE_CASING_TIERED_UV = new CustomIcon("iconsets/TieredHulls/CASING_UV"); + public static final CustomIcon TEXTURE_CASING_TIERED_MAX = new CustomIcon("iconsets/TieredHulls/CASING_MAX"); //Metroid related public static final CustomIcon TEXTURE_METAL_PANEL_A = new CustomIcon("metro/TEXTURE_METAL_PANEL_A"); @@ -566,6 +577,17 @@ public class TexturesGtBlock { TEXTURE_CASING_FUSION_COIL_II_7, TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, TEXTURE_CASING_FUSION_COIL_II_10, TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12}; + public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[]{ + TEXTURE_CASING_TIERED_ULV, + TEXTURE_CASING_TIERED_LV, + TEXTURE_CASING_TIERED_MV, + TEXTURE_CASING_TIERED_HV, + TEXTURE_CASING_TIERED_EV, + TEXTURE_CASING_TIERED_IV, + TEXTURE_CASING_TIERED_LuV, + TEXTURE_CASING_TIERED_ZPM, + TEXTURE_CASING_TIERED_UV, + TEXTURE_CASING_TIERED_MAX}; public static Object Casing_Material_Turbine; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java new file mode 100644 index 0000000000..9bed1846b7 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -0,0 +1,374 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; + +public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase { + + private static final int CASING_INDEX = 49; + + private short mControllerY = 0; + + private byte mMode = 0; + + public GregtechMetaTileEntity_Adv_DistillationTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_Adv_DistillationTower(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_DistillationTower(this.mName); + } + + public String[] getTooltip() { + String s = "Max parallel dictated by tower tier and mode"; + String s1 = "DTower Mode: T1=4, T2=12"; + String s2 = "Distilery Mode: Tower Tier * (4*InputTier)"; + return new String[]{ + "Controller Block for the Advanced Distillation Tower", + "T1 constructed identical to standard DT", + "T2 is not variable height", + "Size(WxHxD): 3x26x3", + "Controller (Front bottom)", + "1x Input Hatch (Any bottom layer casing)", + "24x Output Hatch (One per layer except bottom/top layer)", + "1x Output Bus (Any bottom layer casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Clean Stainless Steel Machine Casings for the rest ((7 x 25) - 5 at least!)", + s, + s1, + s2}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return mMode == 0 ? GT_Recipe.GT_Recipe_Map.sDistillationRecipes : GT_Recipe.GT_Recipe_Map.sDistilleryRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return this.mMode == 1 ? 12 : 24; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mMode", mMode); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mMode = aNBT.getByte("mMode"); + super.loadNBTData(aNBT); + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(203)); + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } + + @Override + public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mMode++; + if (mMode > 1){ + mMode = 0; + PlayerUtils.messagePlayer(aPlayer, "Now running in Distillation Tower Mode."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Now running in Distillery Mode."); + } + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + FluidStack tLiquid = aLiquid.copy(); + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1) { + int tAmount = tHatch.fill(tLiquid, false); + if (tAmount >= tLiquid.amount) { + return tHatch.fill(tLiquid, true) >= tLiquid.amount; + } else if (tAmount > 0) { + tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); + } + } + } + } + return false; + } + + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length; i++) { + if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) { + if (mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1 + i) { + mOutputHatches.get(i).fill(mOutputFluids2[i], true); + } + } + } + + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "DistillationTower"; + } + + @Override + public String getMachineType() { + return "Distillery, Distillation Tower"; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList tBusItems = new ArrayList(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + ItemStack[] inputs = new ItemStack[tBusItems.size()]; + int slot = 0; + for (ItemStack g : tBusItems) { + inputs[slot++] = g; + } + if (inputs.length > 0) { + int para = (4* GT_Utility.getTier(this.getMaxInputVoltage())); + log("Recipe. ["+inputs.length+"]["+para+"]"); + if (checkRecipeGeneric(inputs, new FluidStack[]{}, para, 100, 250, 10000)) { + log("Recipe 2."); + return true; + } + } + + } + return false; + } + + @Override + public int getMaxParallelRecipes() { + if (this.mMode == 0) { + return getTierOfTower() == 1 ? 4 : getTierOfTower() == 2 ? 12 : 0; + } + else if (this.mMode == 1) { + return getTierOfTower() * (4 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + return 0; + } + + @Override + public int getEuDiscountForParallelism() { + return 15; + } + + @Override + public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int aTier = getTierOfTower(); + if (aTier > 0) { + if (aTier == 1) { + return checkTierOneTower(aBaseMetaTileEntity, aStack); + } + else if (aTier == 2) { + return checkTierTwoTower(aBaseMetaTileEntity, aStack); + } + } + return false; + } + + private int getTierOfTower() { + return 1; + } + + private boolean checkTierOneTower(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mControllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int y = 0; //height + int casingAmount = 0; + boolean reachedTop = false; + + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + if (x != 0 || z != 0) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!addInputToMachineList(tileEntity, CASING_INDEX) + && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + + while (y < 12 && !reachedTop) { + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (aBaseMetaTileEntity.getAirOffset(x, y, z)) { + if (x != xDir || z != zDir) { + return false; + } + } else { + if (x == xDir && z == zDir) { + reachedTop = true; + } + if (!addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + } + return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; + } + + private boolean checkTierTwoTower(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mControllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int y = 0; //height + int casingAmount = 0; + boolean reachedTop = false; + + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + if (x != 0 || z != 0) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!addInputToMachineList(tileEntity, CASING_INDEX) + && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + + while (y < 12 && !reachedTop) { + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (aBaseMetaTileEntity.getAirOffset(x, y, z)) { + if (x != xDir || z != zDir) { + return false; + } + } else { + if (x == xDir && z == zDir) { + reachedTop = true; + } + if (!addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + } + return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index 375b63e584..361fadcb5a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -9,21 +9,24 @@ import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaTieredCasingBlocks1; public class Gregtech_Blocks { public static void run(){ - Logger.INFO("Expanding Gregtech Texture Array from 128 -> 1024."); + //Logger.INFO("Expanding Gregtech Texture Array from 128 -> 1024."); boolean didExpand = TAE.hookGtTextures(); - Logger.INFO("Did Texture Array expand correctly? "+didExpand); - Logger.INFO("|======| Texture Array New Length: "+Textures.BlockIcons.CASING_BLOCKS.length+" |======|"); + //Logger.INFO("Did Texture Array expand correctly? "+didExpand); + Logger.INFO("|======| Texture Array Length: "+Textures.BlockIcons.CASING_BLOCKS.length+" |======|"); //Casing Blocks ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks(); ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2(); ModBlocks.blockCasings3Misc = new GregtechMetaCasingBlocks3(); ModBlocks.blockCasings4Misc = new GregtechMetaCasingBlocks4(); + + ModBlocks.BlockTieredCasings1 = new GregtechMetaTieredCasingBlocks1(); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java index 2b683dd888..86cbdb75fa 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_DistillationTower; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Implosion; @@ -19,6 +20,11 @@ public class GregtechFactoryGradeReplacementMultis { GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2").getStackForm(1L)); GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer").getStackForm(1L)); GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV").getStackForm(1L)); + + + //31021 + GregtechItemList.Machine_Adv_DistillationTower.set(new GregtechMetaTileEntity_Adv_DistillationTower(31021, "multimachine.adv.distillationtower", "Dangote Distillus").getStackForm(1L)); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java index bd0edd9002..86146640fd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java @@ -7,18 +7,19 @@ public class GregtechFluidReactor { public static void run() { - GregtechItemList.FluidReactor_LV - .set(new GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", "Chemical Plant I", 1) - .getStackForm(1L)); - GregtechItemList.FluidReactor_HV - .set(new GregtechMetaTileEntity_ChemicalReactor(31022, "chemicalplant.01.tier.02", "Chemical Plant II", 3) - .getStackForm(1L)); - GregtechItemList.FluidReactor_IV - .set(new GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", "Chemical Plant III", 5) - .getStackForm(1L)); - GregtechItemList.FluidReactor_ZPM - .set(new GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", "Chemical Plant IV", 7) - .getStackForm(1L)); + /* + * GregtechItemList.FluidReactor_LV .set(new + * GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", + * "Chemical Plant I", 1) .getStackForm(1L)); GregtechItemList.FluidReactor_HV + * .set(new GregtechMetaTileEntity_ChemicalReactor(31022, + * "chemicalplant.01.tier.02", "Chemical Plant II", 3) .getStackForm(1L)); + * GregtechItemList.FluidReactor_IV .set(new + * GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", + * "Chemical Plant III", 5) .getStackForm(1L)); + * GregtechItemList.FluidReactor_ZPM .set(new + * GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", + * "Chemical Plant IV", 7) .getStackForm(1L)); + */ } } -- cgit From 48a078e6a9826cb58dd19cc3fb382f460114f8f7 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 31 Dec 2019 17:09:52 +0000 Subject: $ Changed access modifier of Tiered Casing Item Block inner class. --- .../xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java index 94f97d8662..f09285d514 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -28,7 +28,7 @@ import gtPlusPlus.xmod.gregtech.common.ti