diff options
Diffstat (limited to 'src/main/java/gregtech/common')
349 files changed, 13305 insertions, 10828 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index e528323da4..d66972e882 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -9,33 +9,37 @@ import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.network.FMLNetworkEvent; import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.interfaces.IHasFluidDisplayItem; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.net.GT_Packet_ClientPreference; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_PlayedSound; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; +import gregtech.common.net.MessageUpdateFluidDisplayItem; import gregtech.common.render.*; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; @@ -58,7 +62,7 @@ public class GT_Client extends GT_Proxy } private final HashSet<String> mCapeList = new HashSet<>(); - public final static GT_PollutionRenderer mPollutionRenderer = new GT_PollutionRenderer(); + public static final GT_PollutionRenderer mPollutionRenderer = new GT_PollutionRenderer(); private final GT_CapeRenderer mCapeRenderer; private final List mPosR; private final List mPosG; @@ -80,8 +84,13 @@ public class GT_Client extends GT_Proxy /**This is the place to def the value used below**/ private long afterSomeTime; private boolean mAnimationDirection; + private int mLastUpdatedBlockX; + private int mLastUpdatedBlockY; + private int mLastUpdatedBlockZ; private boolean isFirstClientPlayerTick; private String mMessage; + private GT_ClientPreference mPreference; + private boolean mFirstTick = false; public GT_Client() { mCapeRenderer = new GT_CapeRenderer(mCapeList); mAnimationTick = 0L; @@ -249,26 +258,32 @@ public class GT_Client extends GT_Proxy drawGrid(aEvent, false); } + @Override public boolean isServerSide() { return true; } + @Override public boolean isClientSide() { return true; } + @Override public boolean isBukkitSide() { return false; } + @Override public EntityPlayer getThePlayer() { return Minecraft.getMinecraft().thePlayer; } + @Override public int addArmor(String aPrefix) { return RenderingRegistry.addNewArmourRendererPrefix(aPrefix); } + @Override public void onPreLoad() { super.onPreLoad(); String arr$[] = { @@ -294,8 +309,11 @@ public class GT_Client extends GT_Proxy (new Thread(this)).start(); mPollutionRenderer.preLoad(); + + mPreference = new GT_ClientPreference(GregTech_API.sClientDataFile); } + @Override public void onLoad() { super.onLoad(); new GT_Renderer_Block(); @@ -307,6 +325,7 @@ public class GT_Client extends GT_Proxy new GT_FluidDisplayStackRenderer(); } + @Override public void onPostLoad() { super.onPostLoad(); try { @@ -315,8 +334,10 @@ public class GT_Client extends GT_Proxy do { if (i >= GregTech_API.METATILEENTITIES.length) continue label0; - if (GregTech_API.METATILEENTITIES[i] != null) + if (GregTech_API.METATILEENTITIES[i] != null) { GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); + GT_Log.out.println("META " + i + " " + GregTech_API.METATILEENTITIES[i].getMetaName()); + } i++; } while (true); } catch (Throwable e) {e.printStackTrace(GT_Log.err);} @@ -333,6 +354,7 @@ public class GT_Client extends GT_Proxy // } } + @Override public void run() { try { GT_Log.out.println("GT_Mod: Downloading Cape List."); @@ -376,7 +398,13 @@ public class GT_Client extends GT_Proxy } catch (Throwable e) { }**/ } - + + @Override + @SubscribeEvent + public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) { + mFirstTick = true; + } + @SubscribeEvent public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) { mCapeRenderer.receiveRenderSpecialsEvent(aEvent); @@ -385,15 +413,19 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { + if (mFirstTick) { + mFirstTick = false; + GT_Values.NW.sendToServer(new GT_Packet_ClientPreference(mPreference)); + } afterSomeTime++; - if(afterSomeTime>=100L){ + if(afterSomeTime>=100L) { afterSomeTime=0; StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); try { - for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ - recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) { + recipe.mHidden=GT_Values.hideAssLineRecipes && !sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); } - }catch (Exception e){} + } catch (Exception ignored){} } ArrayList<GT_PlayedSound> tList = new ArrayList(); for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { @@ -407,30 +439,25 @@ public class GT_Client extends GT_Proxy for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) { tKey = (GT_PlayedSound) i$.next(); } - if(GregTech_API.mServerStarted == false)GregTech_API.mServerStarted = true; - /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) { - this.isFirstClientPlayerTick = false; - GT_FluidStack.fixAllThoseFuckingFluidIDs(); - if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) { - aEvent.player.addChatComponentMessage(new ChatComponentText(this.mMessage)); - } - try { - int tVersion = Integer.parseInt(((String) Class.forName("ic2.core.IC2").getField("VERSION").get(null)).substring(4, 7)); - if (GT_Values.D1) { - GT_Log.out.println("Industrialcraft Version: " + tVersion); - } - if (tVersion < 624) { - aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please update your IndustrialCraft here:")); - aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/")); - } else if (tVersion > GT_Mod.MAX_IC2) { - aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please downgrade your IndustrialCraft here:")); - aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + GT_Mod.MAX_IC2 + "/")); + if(!GregTech_API.mServerStarted) GregTech_API.mServerStarted = true; + if (GT_Values.updateFluidDisplayItems) { + MovingObjectPosition trace = Minecraft.getMinecraft().objectMouseOver; + if (trace != null && trace.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && + (mLastUpdatedBlockX != trace.blockX && + mLastUpdatedBlockY != trace.blockY && + mLastUpdatedBlockZ != trace.blockZ || afterSomeTime % 10 == 0)) { + mLastUpdatedBlockX = trace.blockX; + mLastUpdatedBlockY = trace.blockY; + mLastUpdatedBlockZ = trace.blockZ; + TileEntity tileEntity = aEvent.player.worldObj.getTileEntity(trace.blockX, trace.blockY, trace.blockZ); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity; + if (gtTile.getMetaTileEntity() instanceof IHasFluidDisplayItem) { + GT_Values.NW.sendToServer(new MessageUpdateFluidDisplayItem(trace.blockX, trace.blockY, trace.blockZ, gtTile.getWorld().provider.dimensionId)); + } } - } catch (Throwable e) { - aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:")); - aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/")); } - }*/ + } } } @@ -583,6 +610,7 @@ public class GT_Client extends GT_Proxy } } + @Override public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) { if (GT_Utility.isStackInvalid(aStack)) return; @@ -657,13 +685,28 @@ public class GT_Client extends GT_Proxy tString = (new StringBuilder()).append(tString).append("wherearewenow").toString(); break; } - if (tString.startsWith("streaming.")) - aWorld.playRecord(tString.substring(10, tString.length()), (int) aX, (int) aY, (int) aZ); - else - aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false); + if (tString.startsWith("streaming.")){ + new WorldSpawnedEventBuilder.RecordEffectEventBuilder() + .setIdentifier(tString.substring(10)) + .setPosition(aX, aY, aZ) + .run(); + } + else{ + new WorldSpawnedEventBuilder.SoundEventBuilder() + .setVolume(3f) + .setPitch(tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F) + .setIdentifier(tString) + .setPosition(aX, aY, aZ) + .run(); + } } public static int hideValue=0; + + /** <p>Client tick counter that is set to 5 on hiding pipes and covers.</p> + * <p>It triggers a texture update next client tick when reaching 4, with provision for 3 more update tasks, + * spreading client change detection related work and network traffic on different ticks, until it reaches 0.</p> + */ public static int changeDetected=0; private static int shouldHeldItemHideThings() { diff --git a/src/main/java/gregtech/common/GT_DummyWorld.java b/src/main/java/gregtech/common/GT_DummyWorld.java index b2c15c6a0d..baab96510a 100644 --- a/src/main/java/gregtech/common/GT_DummyWorld.java +++ b/src/main/java/gregtech/common/GT_DummyWorld.java @@ -18,8 +18,7 @@ import net.minecraft.world.storage.WorldInfo; import java.io.File; -public class GT_DummyWorld - extends World { +public class GT_DummyWorld extends World { public GT_IteratorRandom mRandom = new GT_IteratorRandom(); public ItemStack mLastSetBlock = null; @@ -30,73 +29,78 @@ public class GT_DummyWorld public GT_DummyWorld() { this(new ISaveHandler() { + @Override public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { } + @Override public void saveWorldInfo(WorldInfo var1) { } + @Override public WorldInfo loadWorldInfo() { return null; } + @Override public IPlayerFileData getSaveHandler() { return null; } + @Override public File getMapFileFromName(String var1) { return null; } + @Override public IChunkLoader getChunkLoader(WorldProvider var1) { return null; } + @Override public void flush() { } + @Override public void checkSessionLock() { } + @Override public String getWorldDirectoryName() { return null; } + @Override public File getWorldDirectory() { return null; } }, "DUMMY_DIMENSION", null, -// new WorldProvider(), -// -// -// -// new WorldSettings(new WorldInfo(new NBTTagCompound())) -// { -// public String getDimensionName() -// { -// return "DUMMY_DIMENSION"; -// } -// } + new WorldSettings(new WorldInfo(new NBTTagCompound())), new Profiler()); } + @Override protected IChunkProvider createChunkProvider() { return null; } + @Override public Entity getEntityByID(int aEntityID) { return null; } + @Override public boolean setBlock(int aX, int aY, int aZ, Block aBlock, int aMeta, int aFlags) { this.mLastSetBlock = new ItemStack(aBlock, 1, aMeta); return true; } + @Override public float getSunBrightnessFactor(float p_72967_1_) { return 1.0F; } + @Override public BiomeGenBase getBiomeGenForCoords(int aX, int aZ) { if ((aX >= 16) && (aZ >= 16) && (aX < 32) && (aZ < 32)) { return BiomeGenBase.plains; @@ -104,10 +108,12 @@ public class GT_DummyWorld return BiomeGenBase.ocean; } + @Override public int getFullBlockLightValue(int aX, int aY, int aZ) { return 10; } + @Override public Block getBlock(int aX, int aY, int aZ) { if ((aX >= 16) && (aZ >= 16) && (aX < 32) && (aZ < 32)) { return aY == 64 ? Blocks.grass : Blocks.air; @@ -115,10 +121,12 @@ public class GT_DummyWorld return Blocks.air; } + @Override public int getBlockMetadata(int aX, int aY, int aZ) { return 0; } + @Override public boolean canBlockSeeTheSky(int aX, int aY, int aZ) { if ((aX >= 16) && (aZ >= 16) && (aX < 32) && (aZ < 32)) { return aY > 64; @@ -126,6 +134,7 @@ public class GT_DummyWorld return true; } + @Override protected int func_152379_p() { return 0; } diff --git a/src/main/java/gregtech/common/GT_IteratorRandom.java b/src/main/java/gregtech/common/GT_IteratorRandom.java index 79b8c2ae37..1141da4deb 100644 --- a/src/main/java/gregtech/common/GT_IteratorRandom.java +++ b/src/main/java/gregtech/common/GT_IteratorRandom.java @@ -2,11 +2,11 @@ package gregtech.common; import java.util.Random; -public class GT_IteratorRandom - extends Random { +public class GT_IteratorRandom extends Random { private static final long serialVersionUID = 1L; public int mIterationStep = 2147483647; + @Override public int nextInt(int aParameter) { if ((this.mIterationStep == 0) || (this.mIterationStep > aParameter)) { this.mIterationStep = aParameter; diff --git a/src/main/java/gregtech/common/GT_MinableOreGenerator.java b/src/main/java/gregtech/common/GT_MinableOreGenerator.java index c5249f1f25..2a1191b07e 100644 --- a/src/main/java/gregtech/common/GT_MinableOreGenerator.java +++ b/src/main/java/gregtech/common/GT_MinableOreGenerator.java @@ -8,8 +8,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; import java.util.Random; -public class GT_MinableOreGenerator - extends WorldGenerator { +public class GT_MinableOreGenerator extends WorldGenerator { private Block minableBlockId; private Block mBlock; private int minableBlockMeta = 0; @@ -28,6 +27,7 @@ public class GT_MinableOreGenerator this.mBlock = aBlock; } + @Override public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { float math_pi = 3.141593F;//FB: CNT - CNT_ROUGH_CONSTANT_VALUE float var6 = par2Random.nextFloat() * math_pi; diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java index 5fd315b7ce..c9c57676ad 100644 --- a/src/main/java/gregtech/common/GT_Network.java +++ b/src/main/java/gregtech/common/GT_Network.java @@ -11,6 +11,8 @@ import gregtech.api.enums.GT_Values; import gregtech.api.net.*; import gregtech.common.blocks.GT_Packet_Ores; import gregtech.common.net.MessageSetFlaskCapacity; +import gregtech.common.net.MessageUpdateFluidDisplayItem; +import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; @@ -27,51 +29,62 @@ import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; @ChannelHandler.Sharable -public class GT_Network - extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> - implements IGT_NetworkHandler { +@SuppressWarnings("deprecation") +public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { private final EnumMap<Side, FMLEmbeddedChannel> mChannel; private final GT_Packet[] mSubChannels; public GT_Network() { - this.mChannel = NetworkRegistry.INSTANCE.newChannel("GregTech", new ChannelHandler[]{this, new HandlerShared()}); - this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores(), new GT_Packet_Pollution(), new MessageSetFlaskCapacity(), new GT_Packet_TileEntityCover(), new GT_Packet_TileEntityCoverGUI()}; + this.mChannel = NetworkRegistry.INSTANCE.newChannel("GregTech", this, new HandlerShared()); + this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores(), new GT_Packet_Pollution(), new MessageSetFlaskCapacity(), new GT_Packet_TileEntityCover(), new GT_Packet_TileEntityCoverGUI(), new MessageUpdateFluidDisplayItem(), new GT_Packet_ClientPreference(), new GT_Packet_WirelessRedstoneCover()}; } + @Override protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception { - aOutput.add(new FMLProxyPacket(Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + ByteBuf tBuf = Unpooled.buffer().writeByte(aPacket.getPacketID()); + aPacket.encode(tBuf); + aOutput.add(new FMLProxyPacket(tBuf, aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } + @Override protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput) throws Exception { ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); - aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); + GT_Packet tPacket = this.mSubChannels[aData.readByte()].decode(aData); + tPacket.setINetHandler(aPacket.handler()); + aOutput.add(tPacket); } + @Override public void sendToPlayer(GT_Packet aPacket, EntityPlayerMP aPlayer) { - if(aPacket==null){ - GT_FML_LOGGER.info("packet null");return; - } - if(aPlayer==null){ - GT_FML_LOGGER.info("player null");return; - } - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + if (aPacket == null) { + GT_FML_LOGGER.info("packet null"); + return; + } + if (aPlayer == null) { + GT_FML_LOGGER.info("player null"); + return; + } + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } + @Override public void sendToAllAround(GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + this.mChannel.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + this.mChannel.get(Side.SERVER).writeAndFlush(aPacket); } + @Override public void sendToServer(GT_Packet aPacket) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); + this.mChannel.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + this.mChannel.get(Side.CLIENT).writeAndFlush(aPacket); } + @Override public void sendPacketToAllPlayersInRange(World aWorld, GT_Packet aPacket, int aX, int aZ) { if (!aWorld.isRemote) { for (Object tObject : aWorld.playerEntities) { @@ -90,8 +103,8 @@ public class GT_Network @ChannelHandler.Sharable static final class HandlerShared extends SimpleChannelInboundHandler<GT_Packet> { - protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) - throws Exception { + @Override + protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) { EntityPlayer aPlayer = GT_Values.GT.getThePlayer(); aPacket.process(aPlayer == null ? null : GT_Values.GT.getThePlayer().worldObj); } diff --git a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java index 7c275e76df..c6b9cb60d2 100644 --- a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java +++ b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java @@ -5,8 +5,8 @@ import gregtech.api.util.GT_Log; import java.util.ArrayList; -public class GT_PlayerActivityLogger - implements Runnable { +public class GT_PlayerActivityLogger implements Runnable { + @Override public void run() { try { for (; ; ) { diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index be49e57e4a..7b1ad90d52 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -11,7 +11,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; @@ -29,9 +28,11 @@ import java.util.HashMap; import java.util.List; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import static gregtech.common.GT_Proxy.*; +import static gregtech.common.GT_Proxy.GTPOLLUTION; +import static gregtech.common.GT_Proxy.dimensionWiseChunkData; +import static gregtech.common.GT_Proxy.dimensionWisePollution; +import static gregtech.common.GT_Proxy.getDefaultChunkDataOnCreation; -//import net.minecraft.entity.EntityLiving; public class GT_Pollution { /** @@ -62,7 +63,9 @@ public class GT_Pollution { * * Machine Explosion(100,000) * - * Muffler Hatch Pollution reduction: + * Other Random Shit: lots and lots + * + * Muffler Hatch Pollution reduction: ** inaccurate ** * LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%) */ private List<ChunkCoordIntPair> pollutionList = new ArrayList<>();//chunks left to process @@ -310,6 +313,7 @@ public class GT_Pollution { public class GT_PollutionEventHandler { @SubscribeEvent public void chunkWatch(ChunkWatchEvent.Watch event) { + if(!GT_Mod.gregtechproxy.mPollution) return; if (chunkData.containsKey(event.chunk)) { int pollution = chunkData.get(event.chunk)[GTPOLLUTION]; if (pollution > POLLUTIONPACKET_MINVALUE) diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 5b762d6d58..636d78be51 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1,6 +1,10 @@ package gregtech.common; -import cpw.mods.fml.common.*; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.IFuelHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; @@ -11,8 +15,16 @@ import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.genetics.AlleleManager; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.enums.ToolDictNames; import gregtech.api.interfaces.IBlockOnWalkOver; import gregtech.api.interfaces.IProjectileItem; import gregtech.api.interfaces.internal.IGT_Mod; @@ -21,15 +33,12 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.net.GT_Packet_Pollution; import gregtech.api.objects.*; import gregtech.api.util.*; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.gui.GT_ContainerVolumetricFlask; import gregtech.common.gui.GT_GUIContainerVolumetricFlask; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.armor.ModularArmor_Item; -import gregtech.common.items.armor.gui.*; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -39,7 +48,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -82,7 +90,22 @@ import org.apache.commons.lang3.text.WordUtils; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.text.DateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.stream.Collectors; +import java.util.concurrent.locks.ReentrantLock; import static gregtech.api.enums.GT_Values.debugEntityCramming; @@ -92,12 +115,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD, OreGenEvent.GenerateMinable.EventType.DIAMOND, OreGenEvent.GenerateMinable.EventType.REDSTONE, OreGenEvent.GenerateMinable.EventType.LAPIS, OreGenEvent.GenerateMinable.EventType.QUARTZ); - public final HashSet<ItemStack> mRegisteredOres = new HashSet<ItemStack>(10000); - public final ArrayList<String> mSoundNames = new ArrayList<String>(); - public final ArrayList<ItemStack> mSoundItems = new ArrayList<ItemStack>(); - public final ArrayList<Integer> mSoundCounts = new ArrayList<Integer>(); - private final Collection<OreDictEventContainer> mEvents = new HashSet<OreDictEventContainer>(); - private final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList("itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", + public final HashSet<ItemStack> mRegisteredOres = new HashSet<>(10000); + public final ArrayList<String> mSoundNames = new ArrayList<>(); + public final ArrayList<ItemStack> mSoundItems = new ArrayList<>(); + public final ArrayList<Integer> mSoundCounts = new ArrayList<>(); + private final Collection<OreDictEventContainer> mEvents = new HashSet<>(); + private final Collection<String> mIgnoredItems = new HashSet<>(Arrays.asList( + "itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber", "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium", "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium", @@ -108,7 +132,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream", "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake", "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor")); - private final Collection<String> mIgnoredNames = new HashSet<String>(Arrays.asList("grubBee", "chainLink", "candyCane", "bRedString", "bVial", + private final Collection<String> mIgnoredNames = new HashSet<>(Arrays.asList("grubBee", "chainLink", "candyCane", "bRedString", "bVial", "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth", "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch", "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead", @@ -125,8 +149,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste", "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium", "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite", - "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal","shardFire","shardWater","shardAir","shardEarth","ingotRefinedIron","blockMarble","ingotUnstable")); - private final Collection<String> mInvalidNames = new HashSet<String>(Arrays.asList("diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre", + "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal", "shardFire", "shardWater", "shardAir", "shardEarth", "ingotRefinedIron", "blockMarble", "ingotUnstable")); + private final Collection<String> mInvalidNames = new HashSet<>(Arrays.asList("diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre", "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore", "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem", "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot", @@ -200,7 +224,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mTEMachineRecipes = false; public boolean mEnableAllMaterials = false; public boolean mEnableAllComponents = false; - public boolean mAddGTRecipesToIC2Machines = true; public boolean mEnableCleanroom = true; public boolean mLowGravProcessing = false; public boolean mAprilFool = false; @@ -219,8 +242,74 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean gt6Cable = true; public boolean ic2EnergySourceCompat = true; public boolean costlyCableConnection = false; + + /** + * This enables ambient-occlusion smooth lighting on tiles + */ + public boolean mRenderTileAmbientOcclusion = true; + + /** + * This enables rendering of glowing textures + */ + public boolean mRenderGlowTextures = true; + public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15 + public static Map<String, Integer> oreDictBurnTimes = new HashMap<>(); + + // Locking + public static ReentrantLock TICK_LOCK = new ReentrantLock(); + + private final ConcurrentMap<UUID, GT_ClientPreference> mClientPrefernces = new ConcurrentHashMap<>(); + + static { + oreDictBurnTimes.put("dustTinyWood", 11); + oreDictBurnTimes.put("dustTinySodium", 44); + oreDictBurnTimes.put("dustSmallWood", 25); + oreDictBurnTimes.put("dustSmallSodium", 100); + oreDictBurnTimes.put("dustWood", 100); + oreDictBurnTimes.put("dustTinyCoal", 177); + oreDictBurnTimes.put("dustTinyCharcoal", 177); + oreDictBurnTimes.put("dustTinyLignite", 166); + oreDictBurnTimes.put("plateWood", 300); + oreDictBurnTimes.put("dustSmallLignite", 375); + oreDictBurnTimes.put("dustSodium", 400); + oreDictBurnTimes.put("dustSmallCoal", 400); + oreDictBurnTimes.put("dustSmallCharcoal", 400); + oreDictBurnTimes.put("dustTinyLithium", 888); + oreDictBurnTimes.put("dustTinyCaesium", 888); + oreDictBurnTimes.put("gemLignite", 1200); + oreDictBurnTimes.put("crushedLignite", 1200); + oreDictBurnTimes.put("dustImpureLignite", 1200); + oreDictBurnTimes.put("dustLignite", 1200); + oreDictBurnTimes.put("dustSulfur", 1600); + oreDictBurnTimes.put("gemCoal", 1600); + oreDictBurnTimes.put("crushedCoal", 1600); + oreDictBurnTimes.put("dustImpureCoal", 1600); + oreDictBurnTimes.put("dustCoal", 1600); + oreDictBurnTimes.put("gemCharcoal", 1600); + oreDictBurnTimes.put("crushedCharcoal", 1600); + oreDictBurnTimes.put("dustImpureCharcoal", 1600); + oreDictBurnTimes.put("dustCharcoal", 1600); + oreDictBurnTimes.put("dustSmallLithium", 2000); + oreDictBurnTimes.put("dustSmallCaesium", 2000); + oreDictBurnTimes.put("gemSodium", 4000); + oreDictBurnTimes.put("crushedSodium", 4000); + oreDictBurnTimes.put("dustImpureSodium", 4000); + oreDictBurnTimes.put("gemLithium", 6000); + oreDictBurnTimes.put("crushedLithium", 6000); + oreDictBurnTimes.put("dustImpureLithium", 6000); + oreDictBurnTimes.put("dustLithium", 6000); + oreDictBurnTimes.put("gemCaesium", 6000); + oreDictBurnTimes.put("crushedCaesium", 6000); + oreDictBurnTimes.put("dustImpureCaesium", 6000); + oreDictBurnTimes.put("dustCaesium", 6000); + oreDictBurnTimes.put("blockLignite", 12000); + oreDictBurnTimes.put("blockCharcoal", 16000); + } + + + public GT_Proxy() { GameRegistry.registerFuelHandler(this); MinecraftForge.EVENT_BUS.register(this); @@ -687,8 +776,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } aEvent.bow.damageItem(1, aEvent.entityPlayer); aEvent.bow.getItem(); - aEvent.entityPlayer.worldObj.playSoundAtEntity(aEvent.entityPlayer, "random.bow", 1.0F, 0.64893958288F + tSpeed - * 0.5F); + + new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() + .setPitch(0.64893958288F + tSpeed * 0.5F) + .setVolume(1f) + .setIdentifier("random.bow") + .setEntity(aEvent.entityPlayer) + .setWorld(aEvent.entityPlayer.worldObj) + .run(); tArrowEntity.canBePickedUp = 1; if (!aEvent.entityPlayer.capabilities.isCreativeMode) { @@ -982,7 +1077,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aMaterial.add(GT_Utility.copyAmount(1L, aEvent.Ore)); if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial) && !aPrefix.isIgnored(aMaterial)) { - List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>(); + List<TC_AspectStack> tAspects = new ArrayList<>(); for (TC_AspectStack tAspect : aPrefix.mAspects) tAspect.addToAspectList(tAspects); if (aPrefix.mMaterialAmount >= 3628800 || aPrefix.mMaterialAmount < 0) for (TC_AspectStack tAspect : aMaterial.mAspects) tAspect.addToAspectList(tAspects); GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1, aEvent.Ore), tAspects, aEvent.Name); @@ -1241,6 +1336,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + if (aEvent.side.isServer()) { + if (aEvent.phase == TickEvent.Phase.START) { + TICK_LOCK.lock(); + } else { + TICK_LOCK.unlock(); + } + } + } @SubscribeEvent @@ -1282,8 +1385,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { Class tClass = tEntity.getClass(); int tEntityCount = 1; if (tList != null) { - for (int j = 0; j < tList.size(); j++) { - if ((tList.get(j) != null) && (tList.get(j).getClass() == tClass)) { + for (Object o : tList) { + if ((o != null) && (o.getClass() == tClass)) { tEntityCount++; } } @@ -1493,35 +1596,22 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } + public GT_ClientPreference getClientPreference(UUID aPlayerID) { + return mClientPrefernces.get(aPlayerID); + } + + public void setClientPreference(UUID aPlayerID, GT_ClientPreference aPreference) { + mClientPrefernces.put(aPlayerID, aPreference); + } + + @Override public Object getServerGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { if(aID>=1000){ int ID = aID-1000; - switch(ID){ - case 0: - return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())); - case 1: - return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())); - case 2: - return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())); - case 10: - return new GT_ContainerVolumetricFlask(aPlayer.inventory); - default: - return getRightItem(aPlayer, ID); + if (ID == 10) { + return new GT_ContainerVolumetricFlask(aPlayer.inventory); } - } - if(aID>=100){ - int tSlot = aID / 100; - int ID = aID%100; - switch(ID){ - case 0: - return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); - case 1: - return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); - case 2: - return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); - default: - return getRightItem(aPlayer, ID); - } + return null; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { @@ -1536,52 +1626,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return null; } - public Object getRightItem(EntityPlayer player, int ID){ - ItemStack mStack = player.getEquipmentInSlot(ID/100); - if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null; - - switch(ID % 100){ - case 0: - return new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack)); - case 1: - return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)); - case 2: - return new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)); - } - return null; - - } - @Override public Object getClientGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { if(aID>=1000){ int ID = aID-1000; - switch(ID){ - case 0: - return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer); - case 1: - return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer); - case 2: - return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getCurrentEquippedItem())), aPlayer); - case 10: - return new GT_GUIContainerVolumetricFlask(new GT_ContainerVolumetricFlask(aPlayer.inventory)); - default: - return getRightItemGui(aPlayer, ID); + if (ID == 10) { + return new GT_GUIContainerVolumetricFlask(new GT_ContainerVolumetricFlask(aPlayer.inventory)); } - } - if(aID>=100){ - int tSlot = aID / 100; - int ID = aID%100; - switch(ID){ - case 0: - return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); - case 1: - return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); - case 2: - return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); - default: - return getRightItem(aPlayer, ID); - } + return null; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { @@ -1604,139 +1656,45 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return null; } - public Object getRightItemGui(EntityPlayer player, int ID){ - ItemStack mStack = player.getEquipmentInSlot(ID/100); - if(mStack==null||!(mStack.getItem() instanceof ModularArmor_Item))return null; - - switch(ID % 100){ - case 0: - return new GuiModularArmor(new ContainerBasicArmor(player, new InventoryArmor(ModularArmor_Item.class, mStack)),player); - case 1: - return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player); - case 2: - return new GuiElectricArmor1(new ContainerElectricArmor1(player, new InventoryArmor(ModularArmor_Item.class, mStack)), player); - } - return null; + private static List<String> getOreDictNames(ItemStack stack) { + return Arrays.stream(OreDictionary.getOreIDs(stack)).mapToObj(OreDictionary::getOreName).collect(Collectors.toList()); + } - } + @Override public int getBurnTime(ItemStack aFuel) { if ((aFuel == null) || (aFuel.getItem() == null)) { return 0; } int rFuelValue = 0; if ((aFuel.getItem() instanceof GT_MetaGenerated_Item)) { - Short tFuelValue = ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get(Short.valueOf((short) aFuel.getItemDamage())); + Short tFuelValue = ((GT_MetaGenerated_Item) aFuel.getItem()).mBurnValues.get((short) aFuel.getItemDamage()); if (tFuelValue != null) { - rFuelValue = Math.max(rFuelValue, tFuelValue.shortValue()); + rFuelValue = Math.max(rFuelValue, tFuelValue); } } NBTTagCompound tNBT = aFuel.getTagCompound(); if (tNBT != null) { + // See if we have something defined by NBT short tValue = tNBT.getShort("GT.ItemFuelValue"); rFuelValue = Math.max(rFuelValue, tValue); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemSodium")) { - rFuelValue = Math.max(rFuelValue, 4000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedSodium")) { - rFuelValue = Math.max(rFuelValue, 4000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureSodium")) { - rFuelValue = Math.max(rFuelValue, 4000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSodium")) { - rFuelValue = Math.max(rFuelValue, 400); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallSodium")) { - rFuelValue = Math.max(rFuelValue, 100); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) { - rFuelValue = Math.max(rFuelValue, 44); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSulfur")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLithium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLithium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLithium")) { - rFuelValue = Math.max(rFuelValue, 2000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLithium")) { - rFuelValue = Math.max(rFuelValue, 888); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCaesium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCaesium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCaesium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCaesium")) { - rFuelValue = Math.max(rFuelValue, 6000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCaesium")) { - rFuelValue = Math.max(rFuelValue, 2000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCaesium")) { - rFuelValue = Math.max(rFuelValue, 888); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) { - rFuelValue = Math.max(rFuelValue, 1200); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) { - rFuelValue = Math.max(rFuelValue, 1200); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) { - rFuelValue = Math.max(rFuelValue, 1200); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) { - rFuelValue = Math.max(rFuelValue, 1200); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) { - rFuelValue = Math.max(rFuelValue, 375); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) { - rFuelValue = Math.max(rFuelValue, 166); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCoal")) { - rFuelValue = Math.max(rFuelValue, 400); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) { - rFuelValue = Math.max(rFuelValue, 177); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureCharcoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCharcoal")) { - rFuelValue = Math.max(rFuelValue, 1600); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCharcoal")) { - rFuelValue = Math.max(rFuelValue, 400); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCharcoal")) { - rFuelValue = Math.max(rFuelValue, 177); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustWood")) { - rFuelValue = Math.max(rFuelValue, 100); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallWood")) { - rFuelValue = Math.max(rFuelValue, 25); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyWood")) { - rFuelValue = Math.max(rFuelValue, 11); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "plateWood")) { - rFuelValue = Math.min(rFuelValue, 300); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockLignite")) { - rFuelValue = Math.max(rFuelValue, 12000); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "blockCharcoal")) { - rFuelValue = Math.max(rFuelValue, 16000); - } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) { - rFuelValue = Math.max(rFuelValue, 150); - } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) { - rFuelValue = Math.max(rFuelValue, 100); - } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) { - rFuelValue = Math.max(rFuelValue, 600); - } else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) { - rFuelValue = Math.max(rFuelValue, 600); - } else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1))) { - rFuelValue = Math.max(rFuelValue, 150000); - } - if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) { - rFuelValue = Math.max(rFuelValue, 100000); + } else { + // If not check the ore dict + rFuelValue = Math.max(rFuelValue, getOreDictNames(aFuel).stream().mapToInt(f -> oreDictBurnTimes.getOrDefault(f, 0)).max().orElse(0)); } - - return rFuelValue; + + // If we have something from the GT MetaGenerated_Item, ItemFuelValue, or OreDict return + if (rFuelValue > 0) return rFuelValue; + + // Otherwise a few more checks + if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.wooden_button, 1))) return 150; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Blocks.ladder, 1))) return 100; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.sign, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) return 600; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1))) return 150000; + else if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1))) return 100000; + + return 0; } public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ @@ -1954,6 +1912,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public void activateOreDictHandler() { this.mOreDictActivated = true; ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size()); + if (Loader.isModLoaded("betterloadingscreen")){ GT_Values.cls_enabled = true; try { @@ -1964,6 +1923,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } else GT_Proxy.stepMaterialsVanilla(this.mEvents,progressBar); + } public static final HashMap<Integer,HashMap<ChunkCoordIntPair,int []>> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved @@ -2002,11 +1962,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void handleChunkLoadEvent(ChunkDataEvent.Load event) { final int worldID=event.world.provider.dimensionId; - HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.get(worldID); - if (chunkData == null){ - chunkData=new HashMap<>(1024); - dimensionWiseChunkData.put(worldID, chunkData); - } + HashMap<ChunkCoordIntPair, int[]> chunkData = dimensionWiseChunkData.computeIfAbsent(worldID, k -> new HashMap<>(1024)); if (dimensionWisePollution.get(worldID) == null) dimensionWisePollution.put(worldID, new GT_Pollution(event.world)); diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 96c1374059..0e421843a9 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -33,6 +33,7 @@ import static gregtech.GT_Mod.GT_FML_LOGGER; public class GT_RecipeAdder implements IGT_RecipeAdder { + @Override @Deprecated public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { return false; @@ -50,18 +51,22 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration) { return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, 5); } + @Override public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); } + @Override public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { return addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt, false); } + @Override public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; @@ -79,6 +84,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -90,10 +96,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { return addElectrolyzerRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); } + @Override public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; @@ -108,28 +116,35 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration) { return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt) { return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration, aEUt); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, 30); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, 30); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUTick) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, GT_Values.NI, aDuration, aEUTick); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false); } + @Override public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { return false; @@ -154,6 +169,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { return false; @@ -165,6 +181,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { return false; @@ -198,10 +215,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } + @Override public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { return addBlastRecipe(aInput1, aInput2, null, null, aOutput1, aOutput2, aDuration, aEUt, aLevel); } + @Override public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -214,6 +233,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration) { if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) { return false; @@ -249,6 +269,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -265,6 +286,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false); } + @Override public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) { if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) { return false; @@ -282,6 +304,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override @Deprecated public boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { @@ -293,6 +316,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -315,6 +339,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { return addCutterRecipe(aInput,null,aOutput1,aOutput2,aDuration,aEUt,aCleanroom); } @@ -325,14 +350,17 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addCutterRecipe(aInput,GT_Utility.getIntegratedCircuit(aCircuit),aOutput1,aOutput2,aDuration,aEUt,aCleanroom); } + @Override public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { return addCutterRecipe(aInput, aOutput1, aOutput2, aDuration, aEUt,false); } + @Override public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt,false); } + @Override public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { return addCutterRecipe(new ItemStack[]{aInput,aCircuit},new ItemStack[]{aOutput1,aOutput2},aDuration,aEUt,aCleanroom ? -200 : 0); } @@ -341,6 +369,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addCutterRecipe(aInputs, aOutputs, aDuration, aEUt, aCleanroom ? -200 : 0); } + @Override public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial) { if ((aInputs == null) || (aOutputs == null) || aInputs.length == 0 || aOutputs.length == 0) { return false; @@ -358,16 +387,18 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } - public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict,int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ - for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + @Override + public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ + for(ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)){ if(GT_Utility.isStackValid(tStack)) addAssemblerRecipe(aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt); } return true; } + @Override public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ - for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + for(ItemStack tStack : GT_OreDictUnificator.getOresImmutable(aOreDict)){ if(GT_Utility.isStackValid(tStack)) { ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1]; System.arraycopy(aInputs, 0, extendedInputs, 0, aInputs.length); @@ -378,44 +409,29 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { - /*if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); - return true; - */ return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null,aOutput1, aDuration, aEUt, false); } + @Override public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt); } + @Override public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { - /*if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { - return false; - } - if (aOutput1 == null) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); - */ return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); } + @Override public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { if(aInput2==null) return addAssemblerRecipe(new ItemStack[]{aInput1},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom); return addAssemblerRecipe(new ItemStack[]{aInput1,aInput2},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom); } + @Override public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { @@ -450,7 +466,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { String odName = OreDictionary.getOreName(oreID); if (odName.contains("circuit")) { - for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(odName)) { if (!GT_Utility.isStackValid(tStack)) continue; aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); @@ -491,6 +507,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } + @Override public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; @@ -502,6 +519,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; @@ -513,6 +531,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addBenderRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -524,6 +543,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aShape == null) || (aOutput == null)) { return false; @@ -535,6 +555,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aShape == null) || (aOutput == null)) { return false; @@ -546,6 +567,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt) { if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { return false; @@ -557,6 +579,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -582,16 +605,9 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override @Deprecated public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { -// if ((aInput1 == null) || (aOutput1 == null)) { -// return false; -// } -// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) { -// return false; -// } -// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt); -// return true; return false; } @@ -605,6 +621,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addDistillationTowerRecipe(aInput, aOutputs, aOutput2, aDuration, aEUt); } + @Override public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { if (aInput == null || aOutputs == null || aOutputs.length < 1 || aOutputs.length > 11) { return false; @@ -616,6 +633,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } + @Override public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -627,6 +645,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -638,11 +657,13 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override @Deprecated public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) { return false; } + @Override public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) { if (aInput1 == null) { return false; @@ -651,6 +672,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addSonictronSound(ItemStack aItemStack, String aSoundName) { if ((aItemStack == null) || (aSoundName == null) || (aSoundName.equals(""))) { return false; @@ -665,6 +687,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -676,6 +699,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt) { if ((aContainedItem == null) || (aFullBox == null)) { return false; @@ -687,6 +711,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt) { if ((aFullBox == null) || (aContainedItem == null)) { return false; @@ -698,6 +723,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt) { if ((aInput == null) || (aOutput1 == null)) { return false; @@ -709,6 +735,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted) { if ((aAmplifierItem == null) || (aAmplifierAmountOutputted <= 0)) { return false; @@ -720,6 +747,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aIngredient == null) || (aInput == null) || (aOutput == null)) { return false; @@ -734,10 +762,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden) { return addBrewingRecipe(aIngredient, aInput, aOutput, 128, 4, aHidden); } + @Override public boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; @@ -752,6 +782,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; @@ -766,10 +797,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden) { return addFermentingRecipe(aInput, aOutput, aDuration, 2, aHidden); } + @Override public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { if ((aInput == null) || (aOutput == null)) { return false; @@ -815,18 +848,22 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { return addDistilleryRecipe(aCircuit, aInput, aOutput, null, aDuration, aEUt, aHidden); } + @Override public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aSolidOutput, aDuration, aEUt, aHidden); } + @Override public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aDuration, aEUt, aHidden); } + @Override public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aMold == null) || (aInput == null) || (aOutput == null)) { return false; @@ -849,6 +886,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addFluidSmelterRecipe(aInput, aRemains, aOutput, aChance, aDuration, aEUt, false); } + @Override public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden) { if ((aInput == null) || (aOutput == null)) { return false; @@ -869,6 +907,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; @@ -886,13 +925,11 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -905,11 +942,9 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -922,6 +957,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aBathingFluid == null) || (aOutput1 == null)) { return false; @@ -933,6 +969,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutput1 == null)) { return false; @@ -944,6 +981,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; @@ -955,6 +993,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aFluid == null) || (aOutput == null)) { return false; @@ -966,10 +1005,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { return addAutoclaveRecipe(aInput, aFluid, aOutput,aChance, aDuration, aEUt); } + @Override public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) { return addAutoclaveRecipe(aInput, null, aFluid, aOutput, aChance, aDuration, aEUt, false); } @@ -978,8 +1019,14 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addAutoclaveRecipe(aInput, aCircuit, aFluid, aOutput, aChance, aDuration, aEUt, false); } - public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { - if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + @Override + public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + return addAutoclaveRecipe(aInput, aCircuit, aFluidIn, null, aOutput, aChance, aDuration, aEUt,aCleanroom); + } + + @Override + public boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + if ((aInput == null) || (aFluidIn == null) || (aOutput == null)) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { @@ -988,14 +1035,16 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (!GT_Mod.gregtechproxy.mEnableCleanroom){ aCleanroom = false; } - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput, aCircuit}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidIn}, new FluidStack[]{aFluidOut}, aDuration, aEUt, aCleanroom ? -200 : 0); return true; } + @Override public boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { return addAutoclaveRecipe(aInput, aFluid, aOutput, aChance, aDuration, aEUt, aCleanroom); } + @Override public boolean addAutoclaveSpaceRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { if ((aInput == null) || (aFluid == null) || (aOutput == null)) { return false; @@ -1010,15 +1059,18 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, null, null, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); } + @Override public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); } - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8,ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + @Override + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) { return false; } @@ -1032,10 +1084,12 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt) { return addLaserEngraverRecipe( aItemToEngrave, aLens, aEngravedItem, aDuration, aEUt, false); } + @Override public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom) { if ((aItemToEngrave == null) || (aLens == null) || (aEngravedItem == null)) { return false; @@ -1050,6 +1104,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt) { if ((aItemToImprint == null) || (aForm == null) || (aImprintedItem == null)) { return false; @@ -1061,6 +1116,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { if ((aInput == null) || (aOutput == null)) { return false; @@ -1072,6 +1128,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt) { if ((aItemToSift == null) || (aSiftedItems == null)) { return false; @@ -1093,7 +1150,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); } - public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { + @Override + public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { if ((aInput == null) || (aOutputs == null)) { return false; } @@ -1121,6 +1179,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } + @Override public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; @@ -1137,6 +1196,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } + @Override public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; @@ -1153,6 +1213,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } + @Override public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt) { if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { return false; @@ -1174,6 +1235,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addPulveriserRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); } + @Override public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { if ((aInput == null) || (aOutputs == null)) { return false; @@ -1208,16 +1270,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { @Override @Deprecated public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { - //if ((aInput == null) || (aOutput == null)) { - // return false; - // } - // if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { - // return false; - // } - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0); - // return true; return false; } @@ -1309,6 +1361,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return addCircuitAssemblerRecipe(aInputs, aFluidInput, aOutput,aDuration,aEUt, false); } + @Override public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) { if (this.areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { @@ -1339,7 +1392,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { String odName = OreDictionary.getOreName(oreID); if (odName.contains("circuit")) { - for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + for (ItemStack tStack : GT_OreDictUnificator.getOresImmutable(odName)) { if (!GT_Utility.isStackValid(tStack)) continue; aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); diff --git a/src/main/java/gregtech/common/GT_Server.java b/src/main/java/gregtech/common/GT_Server.java index 831ec4666a..51bf9e898b 100644 --- a/src/main/java/gregtech/common/GT_Server.java +++ b/src/main/java/gregtech/common/GT_Server.java @@ -4,27 +4,32 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class GT_Server - extends GT_Proxy { +public class GT_Server extends GT_Proxy { + @Override public boolean isServerSide() { return true; } + @Override public boolean isClientSide() { return false; } + @Override public boolean isBukkitSide() { return false; } + @Override public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) { } + @Override public int addArmor(String aPrefix) { return 0; } + @Override public EntityPlayer getThePlayer() { return null; } diff --git a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java index aa3d120357..bc6372e41c 100644 --- a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java +++ b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java @@ -27,8 +27,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -public class GT_ThaumcraftCompat - implements IThaumcraftCompat { +public class GT_ThaumcraftCompat implements IThaumcraftCompat { public GT_ThaumcraftCompat() { TC_Aspects.AER.mAspect = Aspect.AIR; TC_Aspects.ALIENIS.mAspect = Aspect.ELDRITCH; @@ -102,6 +101,7 @@ public class GT_ThaumcraftCompat return rAspects; } + @Override public Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List<TC_Aspects.TC_AspectStack> aAspects, ItemStack[] aResearchTriggers, Object[] aPages) { if (!GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.researches, aResearch, true)) { return null; @@ -177,6 +177,7 @@ public class GT_ThaumcraftCompat return rResearch.registerResearchItem(); } + @Override public Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List<TC_Aspects.TC_AspectStack> aAspects) { if ((GT_Utility.isStringInvalid(aResearch)) || (aInput == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { return null; @@ -184,6 +185,7 @@ public class GT_ThaumcraftCompat return ThaumcraftApi.addCrucibleRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}), ((aInput instanceof ItemStack)) || ((aInput instanceof ArrayList)) ? aInput : aInput.toString(), getAspectList(aAspects)); } + @Override public Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, int aInstability, List<TC_Aspects.TC_AspectStack> aAspects) { if ((GT_Utility.isStringInvalid(aResearch)) || (aMainInput == null) || (aSideInputs == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { return null; @@ -191,13 +193,15 @@ public class GT_ThaumcraftCompat return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}), aInstability, getAspectList(aAspects), aMainInput, aSideInputs); } - public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { + @Override + public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { if (aAspects.isEmpty()) return false; ThaumcraftApi.registerObjectTag(aOreDict, (AspectList)getAspectList(aAspects)); return true; } - public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) { + @Override + public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) { if (aAspects.isEmpty()) return false; if (aAdditive) { ThaumcraftApi.registerComplexObjectTag(aStack, (AspectList)getAspectList(aAspects)); @@ -210,6 +214,7 @@ public class GT_ThaumcraftCompat return true; } + @Override public boolean registerPortholeBlacklistedBlock(Block aBlock) { ThaumcraftApi.portableHoleBlackList.add(aBlock); return true; diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 995984158f..214661ae67 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -18,8 +18,7 @@ import static gregtech.api.enums.GT_Values.debugOrevein; import static gregtech.api.enums.GT_Values.oreveinPlacerOres; import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier; -public class GT_Worldgen_GT_Ore_Layer - extends GT_Worldgen { +public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { public static ArrayList<GT_Worldgen_GT_Ore_Layer> sList = new ArrayList(); public static int sWeight = 0; public final short mMinY; @@ -77,21 +76,8 @@ public class GT_Worldgen_GT_Ore_Layer this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic)); this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); - if (this.mEnabled) { - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); sWeight += this.mWeight; - //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ - // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); - //} - } } @@ -106,9 +92,6 @@ public class GT_Worldgen_GT_Ore_Layer this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); - //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); - //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); - //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); if (mMaxY < (this.mMinY + 9)) { @@ -128,24 +111,12 @@ public class GT_Worldgen_GT_Ore_Layer this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); - if (this.mEnabled) { - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); sWeight += this.mWeight; - //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ - // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); - //} - } } + @Override public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if( mWorldGenName.equals("NoOresInVein") ) { if (debugOrevein) GT_Log.out.println( @@ -234,7 +205,7 @@ public class GT_Worldgen_GT_Ore_Layer // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt(). int localDensity = Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2))) ); - // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop + // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop // Now we do bottom-level-first oregen, and work our way upwards. // Layer -1 Secondary and Sporadic int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure. diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 85c0eb2d07..2e17873980 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -27,7 +27,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces public final String aTextWorldgen = "worldgen."; public static ArrayList<GT_Worldgen_GT_Ore_SmallPieces> sList = new ArrayList<GT_Worldgen_GT_Ore_SmallPieces>(); - //TODO CHECk IF INSTANTIATION IS CORRECT + //TODO CHECK IF INSTANTIATION IS CORRECT public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { super(aName, GregTech_API.sWorldgenList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); @@ -38,7 +38,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - this.sList.add(this); + sList.add(this); } public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary) { @@ -51,11 +51,12 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - this.sList.add(this); + sList.add(this); } - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (!this.mBiome.equals("None") && !(this.mBiome.equals(aBiome))) { return false; //Not the correct biome for ore mix } diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index a354a813fe..d4992c3c16 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -19,8 +19,7 @@ import java.util.Random; import static gregtech.api.enums.GT_Values.debugStones; -public class GT_Worldgen_Stone - extends GT_Worldgen_Ore { +public class GT_Worldgen_Stone extends GT_Worldgen_Ore { static final double sizeConversion[] = { 1, 1, 1.333333, 1.333333, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; // Bias the sizes towards skinnier boulders, ie more "shafts" than dikes or sills. @@ -46,6 +45,7 @@ public class GT_Worldgen_Stone 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) { XSTR stoneRNG = new XSTR(); ArrayList<ValidSeeds> stones = new ArrayList(); diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 00bdb0d879..0911f257b4 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -1,17 +1,5 @@ package gregtech.common; -import static gregtech.api.enums.GT_Values.debugOrevein; -import static gregtech.api.enums.GT_Values.debugWorldGen; -import static gregtech.api.enums.GT_Values.oreveinAttempts; -import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; -import static gregtech.api.enums.GT_Values.oreveinPercentage; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Random; - import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; @@ -26,18 +14,23 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -// Disabled for hardcoded value. import static gregtech.api.enums.GT_Values.oreveinMaxSize; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Random; + +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.debugWorldGen; +import static gregtech.api.enums.GT_Values.oreveinAttempts; +import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; +import static gregtech.api.enums.GT_Values.oreveinPercentage; -public class GT_Worldgenerator -implements IWorldGenerator { - //public static boolean sAsteroids = true; +public class GT_Worldgenerator implements IWorldGenerator { private static int mEndAsteroidProbability = 300; - //private static int mGCAsteroidProbability = 50; private static int mSize = 100; private static int endMinSize = 50; private static int endMaxSize = 200; - //private static int gcMinSize = 100; - //private static int gcMaxSize = 400; private static boolean endAsteroids = true; public static List<Runnable> mList = new ArrayList(); public static HashSet<Long> ProcChunks = new HashSet<Long>(); @@ -46,7 +39,6 @@ implements IWorldGenerator { public static Hashtable<Long, GT_Worldgen_GT_Ore_Layer> validOreveins = new Hashtable(1024); public boolean mIsGenerating = false; public static final Object listLock = new Object(); - //private static boolean gcAsteroids = true; public GT_Worldgenerator() { @@ -54,10 +46,6 @@ implements IWorldGenerator { endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50); endMaxSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMaxSize", 200); mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300); - //gcAsteroids = GregTech_API.sWorldgenFile.get("gcasteroids", "GenerateGCAsteroids", true); - //gcMinSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMinSize", 100); - //gcMaxSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMaxSize", 400); - //mGCAsteroidProbability = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidProbability", 300); GameRegistry.registerWorldGenerator(this, 1073741823); if (debugWorldGen) { GT_Log.out.println( @@ -66,36 +54,37 @@ implements IWorldGenerator { } } + @Override public void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { synchronized (listLock) { - this.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); + mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); if (debugWorldGen) GT_Log.out.println( "ADD WorldSeed:"+aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId + " chunk x:" + aX + " z:" + aZ + - " SIZE: " + this.mList.size() + " SIZE: " + mList.size() ); } if (!this.mIsGenerating) { this.mIsGenerating = true; - int mList_sS=this.mList.size(); + int mList_sS= mList.size(); mList_sS = Math.min(mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later. for (int i = 0; i < mList_sS; i++) { - WorldGenContainer toRun = (WorldGenContainer) this.mList.get(0); + WorldGenContainer toRun = (WorldGenContainer) mList.get(0); if (debugWorldGen) GT_Log.out.println( "RUN WorldSeed:"+aWorld.getSeed()+ " DimId" + aWorld.provider.dimensionId + " chunk x:" + toRun.mX + " z:" + toRun.mZ + - " SIZE: " + this.mList.size() + + " SIZE: " + mList.size() + " i: " + i ); synchronized (listLock) { - this.mList.remove(0); + mList.remove(0); } toRun.run(); } @@ -339,6 +328,7 @@ implements IWorldGenerator { } } + @Override public void run() { long startTime = System.nanoTime(); int oreveinMaxSize; @@ -480,16 +470,7 @@ implements IWorldGenerator { } else if (ranOre < 10) { GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false); } else { - //if (tDimensionType == 1) {//TODO CHECK mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); - //} else if (tDimensionName.equals("Asteroids")) { - ////int asteroidType = aRandom.nextInt(20); - ////if (asteroidType == 19) { //Rare Asteroid? - ////mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); - ////} else { - //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); - ////} - //} } } } diff --git a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java index e1db4c2ac0..4a47bfa46e 100644 --- a/src/main/java/gregtech/common/bees/GT_AlleleHelper.java +++ b/src/main/java/gregtech/common/bees/GT_AlleleHelper.java @@ -23,6 +23,7 @@ public class GT_AlleleHelper extends AlleleHelper { private Map<Class<?>, Map<?, ? extends IAllele>> alleleMaps = new HashMap<>(); + @Override public void init() { if (PluginManager.Module.APICULTURE.isEnabled()) { createAlleles(EnumAllele.Fertility.class, EnumBeeChromosome.FERTILITY); diff --git a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java index ca919e7cf2..b088f724f5 100644 --- a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java +++ b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java @@ -76,4 +76,4 @@ public class GT_Bee_Mutation extends BeeMutation { } return mutationChance; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java index eb7c399eb0..2f8e248117 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java @@ -2,14 +2,13 @@ package gregtech.common.blocks; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -public class GT_Block_Casings1 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { /** * Texture Index Information @@ -28,8 +27,8 @@ public class GT_Block_Casings1 public GT_Block_Casings1() { super(GT_Item_Casings1.class, "gt.blockcasings", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[0][i] = new GT_CopiedBlockTexture(this, 6, i); + for (int i = 0; i < 16; i++) { + Textures.BlockIcons.casingTexturePages[0][i] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "ULV Machine Casing"); @@ -66,6 +65,7 @@ public class GT_Block_Casings1 ItemList.Casing_Coil_Superconductor.set(new ItemStack(this, 1, 15)); } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { @@ -93,6 +93,7 @@ public class GT_Block_Casings1 return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } + @Override public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) { return aWorld.getBlockMetadata(aX, aY, aZ) > 9 ? super.colorMultiplier(aWorld, aX, aY, aZ) : gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java index 6da2195921..f4f478b7be 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java @@ -3,7 +3,7 @@ package gregtech.common.blocks; import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -11,18 +11,18 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; -public class GT_Block_Casings2 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings2 extends GT_Block_Casings_Abstract { public GT_Block_Casings2() { super(GT_Item_Casings2.class, "gt.blockcasings2", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - if (i != 6){ - Textures.BlockIcons.casingTexturePages[0][(i + 16)] = new GT_CopiedBlockTexture(this, 6, i); - } - } + for (int i = 0; i < 16; i++) { + if (i != 6) { + Textures.BlockIcons.casingTexturePages[0][(i + 16)] = TextureFactory.of(this, i); + } + } //Special handler for Pyrolyse Oven Casing on hatches... - Textures.BlockIcons.casingTexturePages[0][22] = new GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0,Dyes.MACHINE_METAL.mRGBa); + Textures.BlockIcons.casingTexturePages[0][22] = TextureFactory.of(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 0, ForgeDirection.UNKNOWN, Dyes.MACHINE_METAL.mRGBa); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Solid Steel Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Frost Proof Machine Casing"); @@ -59,6 +59,7 @@ public class GT_Block_Casings2 } + @Override public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { case 0: @@ -97,6 +98,7 @@ public class GT_Block_Casings2 return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } + @Override public float getExplosionResistance(Entity aTNT, World aWorld, int aX, int aY, int aZ, double eX, double eY, double eZ) { return aWorld.getBlockMetadata(aX, aY, aZ) == 8 ? Blocks.bedrock.getExplosionResistance(aTNT) : super.getExplosionResistance(aTNT, aWorld, aX, aY, aZ, eX, eY, eZ); } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java index fde793522a..81be342822 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java @@ -2,17 +2,16 @@ package gregtech.common.blocks; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class GT_Block_Casings3 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings3 extends GT_Block_Casings_Abstract { public GT_Block_Casings3() { super(GT_Item_Casings3.class, "gt.blockcasings3", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[0][(i + 32)] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[0][(i + 32)] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Yellow Stripes Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Yellow Stripes Block"); @@ -48,6 +47,7 @@ public class GT_Block_Casings3 ItemList.Casing_Firebox_TungstenSteel.set(new ItemStack(this, 1, 15)); } + @Override public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { case 0: diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 0dbf5e9f54..6fb40784c1 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -6,7 +6,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; import net.minecraft.item.ItemStack; @@ -14,14 +14,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -public class GT_Block_Casings4 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { public static boolean mConnectedMachineTextures = true; public GT_Block_Casings4() { super(GT_Item_Casings4.class, "gt.blockcasings4", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[0][(i + 48)] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[0][(i + 48)] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); @@ -56,6 +55,7 @@ public class GT_Block_Casings4 ItemList.Casing_Firebricks.set(new ItemStack(this, 1, 15)); } + @Override public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { case 0: @@ -111,6 +111,7 @@ public class GT_Block_Casings4 } } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) { int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java index 55492c961c..296bf765b0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java @@ -2,20 +2,25 @@ package gregtech.common.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.interfaces.IHeatingCoil; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class GT_Block_Casings5 - extends GT_Block_Casings_Abstract { +import java.util.function.Consumer; + +import static gregtech.api.enums.HeatingCoilLevel.*; + +public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHeatingCoil { + public GT_Block_Casings5() { super(GT_Item_Casings5.class, "gt.blockcasings5", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[1][i] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[1][i] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Cupronickel Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Kanthal Coil Block"); @@ -26,6 +31,8 @@ public class GT_Block_Casings5 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Naquadah Alloy Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Electrum Flux Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Awakened Draconium Coil Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "HSS-S Coil Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Trinium Coil Block"); ItemList.Casing_Coil_Cupronickel.set(new ItemStack(this, 1, 0)); ItemList.Casing_Coil_Kanthal.set(new ItemStack(this, 1, 1)); @@ -36,7 +43,10 @@ public class GT_Block_Casings5 ItemList.Casing_Coil_NaquadahAlloy.set(new ItemStack(this, 1, 6)); ItemList.Casing_Coil_ElectrumFlux.set(new ItemStack(this, 1, 7)); ItemList.Casing_Coil_AwakenedDraconium.set(new ItemStack(this, 1, 8)); + ItemList.Casing_Coil_HSSS.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Coil_Trinium.set(new ItemStack(this, 1, 10)); } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int aSide, int aMeta) { @@ -59,7 +69,62 @@ public class GT_Block_Casings5 return Textures.BlockIcons.MACHINE_COIL_ELECTRUMFLUX.getIcon(); case 8: return Textures.BlockIcons.MACHINE_COIL_AWAKENEDDRACONIUM.getIcon(); + case 9: + return Textures.BlockIcons.MACHINE_COIL_HSSS.getIcon(); + case 10: + return Textures.BlockIcons.MACHINE_COIL_TRINIUM.getIcon(); } return Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon(); } + + /*--------------- COIL CHECK IMPL. ------------*/ + + public static HeatingCoilLevel getCoilHeatFromDamage(int meta) { + switch (meta) { + case 0: + return LV; + case 1: + return MV; + case 2: + return HV; + case 3: + return EV; + case 4: + return IV; + case 5: + return ZPM; + case 6: + return UV; + case 7: + return UEV; + case 8: + return UIV; + case 9: + return LuV; + case 10: + return UHV; + default: + return None; + } + } + + @Override + public HeatingCoilLevel getCoilHeat(int meta) { + getOnCoilCheck().accept(this); + return getCoilHeatFromDamage(meta); + } + + /*--------------- CALLBACK ------------*/ + + private Consumer<IHeatingCoil> callback = coil -> {}; + + @Override + public void setOnCoilCheck(Consumer<IHeatingCoil> callback) { + this.callback = callback; + } + + @Override + public Consumer<IHeatingCoil> getOnCoilCheck() { + return this.callback; + } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java index d7e8ad23f0..96b7890fd7 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java @@ -4,18 +4,17 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -public class GT_Block_Casings6 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings6 extends GT_Block_Casings_Abstract { public GT_Block_Casings6() { super(GT_Item_Casings6.class, "gt.blockcasings6", GT_Material_Casings.INSTANCE); for (int i = 0; i < 16; i = (i + 1)) { - Textures.BlockIcons.casingTexturePages[8][i + 112] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[8][i + 112] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Hermetic Casing"); @@ -97,6 +96,7 @@ public class GT_Block_Casings6 } } + @Override public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) { return gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java index 0f3aac4518..bb151afafa 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -4,19 +4,18 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class GT_Block_Casings8 - extends GT_Block_Casings_Abstract { +public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { //WATCH OUT FOR TEXTURE ID's public GT_Block_Casings8() { super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE); for (int i = 0; i < 5; i = (i + 1)) { - Textures.BlockIcons.casingTexturePages[1][i+48] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[1][i+48] = TextureFactory.of(this, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "PTFE Pipe Casing"); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 830a407777..49f15e328c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -22,8 +22,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.Random; -public abstract class GT_Block_Casings_Abstract - extends GT_Generic_Block { +public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block { public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { super(aItemClass, aName, aMaterial); setStepSound(soundTypeMetal); @@ -32,86 +31,106 @@ public abstract class GT_Block_Casings_Abstract GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); } + @Override public String getHarvestTool(int aMeta) { return "wrench"; } + @Override public int getHarvestLevel(int aMeta) { return 2; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); } + @Override public float getExplosionResistance(Entity aTNT) { return Blocks.iron_block.getExplosionResistance(aTNT); } + @Override protected boolean canSilkHarvest() { return false; } + @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } + @Override public String getUnlocalizedName() { return this.mUnlocalizedName; } + @Override public String getLocalizedName() { return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } + @Override public boolean renderAsNormalBlock() { return true; } + @Override public boolean isOpaqueCube() { return true; } + @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } + @Override public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return false; } + @Override public int damageDropped(int par1) { return par1; } + @Override public int getDamageValue(World par1World, int par2, int par3, int par4) { return par1World.getBlockMetadata(par2, par3, par4); } + @Override public int quantityDropped(Random par1Random) { return 1; } + @Override public Item getItemDropped(int par1, Random par2Random, int par3) { return Item.getItemFromBlock(this); } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister aIconRegister) { } + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java index 7bd4398ed7..0c98bab9c0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java @@ -11,8 +11,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; -public class GT_Block_Concretes - extends GT_Block_Stones_Abstract implements IBlockOnWalkOver{ +public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlockOnWalkOver{ public GT_Block_Concretes() { super(GT_Item_Concretes.class, "gt.blockconcretes"); setResistance(20.0F); @@ -51,14 +50,17 @@ public class GT_Block_Concretes GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Concrete, new ItemStack(this, 1, 15)); } + @Override public int getHarvestLevel(int aMeta) { return 1; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ); } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { return gregtech.api.enums.Textures.BlockIcons.CONCRETES[aMeta].getIcon(); @@ -73,29 +75,4 @@ public class GT_Block_Concretes aEntity.motionX *= tSpeed; aEntity.motionZ *= tSpeed; } } - - /** - public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) { - Block tBlock = aWorld.getBlock(aX, aY + 1, aZ); - if (((aEntity instanceof EntityLivingBase)) && (!(tBlock instanceof IFluidBlock)) && (!(tBlock instanceof BlockLiquid)) && (aEntity.onGround) && (!aEntity.isInWater()) && (!aEntity.isWet())) { - if (aEntity.isSneaking()) { - aEntity.motionX *= 0.8999999761581421D; - aEntity.motionZ *= 0.8999999761581421D; - } else { - if (aEntity.motionX < 6.0 && aEntity.motionZ < 6.0) { - aEntity.motionX *= 1.100000023841858D; - aEntity.motionZ *= 1.100000023841858D; - } - } - } - } - - public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - Block tBlock = aWorld.getBlock(aX, aY + 1, aZ); - if (((tBlock instanceof IFluidBlock)) || ((tBlock instanceof BlockLiquid))) { - return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - } - return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 0.875D, aZ + 1); - } - **/ } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Granites.java b/src/main/java/gregtech/common/blocks/GT_Block_Granites.java index 39d68ce933..5c98c18920 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Granites.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Granites.java @@ -12,8 +12,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class GT_Block_Granites - extends GT_Block_Stones_Abstract { +public class GT_Block_Granites extends GT_Block_Stones_Abstract { public GT_Block_Granites() { super(GT_Item_Granites.class, "gt.blockgranites"); setResistance(60.0F); @@ -51,14 +50,17 @@ public class GT_Block_Granites GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.GraniteRed, new ItemStack(this, 1, 15)); } + @Override public int getHarvestLevel(int aMeta) { return 3; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F; } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { return gregtech.api.enums.Textures.BlockIcons.GRANITES[aMeta].getIcon(); @@ -66,6 +68,7 @@ public class GT_Block_Granites return gregtech.api.enums.Textures.BlockIcons.GRANITES[0].getIcon(); } + @Override public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { return !(entity instanceof EntityWither); } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 0b0d065789..0d673a020e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -39,15 +39,15 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -public class GT_Block_Machines - extends GT_Generic_Block - implements IDebugableBlock, ITileEntityProvider { - public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal(); +public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider { + private static final ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal<>(); + private boolean renderAsNormalBlock; public GT_Block_Machines() { super(GT_Item_Machines.class, "gt.blockmachines", new GT_Material_Machines()); @@ -57,8 +57,11 @@ public class GT_Block_Machines setStepSound(soundTypeMetal); setCreativeTab(GregTech_API.TAB_GREGTECH); this.isBlockContainer = true; + this.renderAsNormalBlock = true; + this.useNeighborBrightness = true; } + @Override public String getHarvestTool(int aMeta) { if (aMeta >= 8 && aMeta <= 11) { return "cutter"; @@ -66,14 +69,17 @@ public class GT_Block_Machines return "wrench"; } + @Override public int getHarvestLevel(int aMeta) { return aMeta % 4; } + @Override protected boolean canSilkHarvest() { return false; } + @Override public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof BaseTileEntity)) { @@ -81,6 +87,7 @@ public class GT_Block_Machines } } + @Override public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof BaseMetaPipeEntity)) { @@ -88,6 +95,7 @@ public class GT_Block_Machines } } + @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { super.onBlockAdded(aWorld, aX, aY, aZ); if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { @@ -95,22 +103,27 @@ public class GT_Block_Machines } } + @Override public String getUnlocalizedName() { return "gt.blockmachines"; } + @Override public String getLocalizedName() { return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); } + @Override public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { return 0; } + @Override public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { - return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0) ? 100 : 0; + return GregTech_API.sMachineFlammable && (aWorld.getBlockMetadata(aX, aY, aZ) == 0) ? 100 : 0; } + @Override public int getRenderType() { if (GT_Renderer_Block.INSTANCE == null) { return super.getRenderType(); @@ -118,80 +131,109 @@ public class GT_Block_Machines return GT_Renderer_Block.INSTANCE.mRenderID; } + @Override public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) { - return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); + return GregTech_API.sMachineFlammable && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); } + @Override public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { - return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); + return GregTech_API.sMachineFlammable && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); } + @Override public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) { return true; } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean hasTileEntity(int aMeta) { return true; } + @Override public boolean hasComparatorInputOverride() { return true; } + @Override public boolean renderAsNormalBlock() { - return false; + return renderAsNormalBlock; + } + + public GT_Block_Machines setRenderAsNormalBlock(boolean aBool) { + renderAsNormalBlock = aBool; + return this; } + @Override public boolean canProvidePower() { return true; } + @Override public boolean isOpaqueCube() { return false; } + @Override public TileEntity createNewTileEntity(World aWorld, int aMeta) { return createTileEntity(aWorld, aMeta); } + @SideOnly(Side.CLIENT) + @Override public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon(); } + @SideOnly(Side.CLIENT) + @Override public IIcon getIcon(int aSide, int aMeta) { return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon(); } + @Override public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) { super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false; + return tTileEntity != null && tTileEntity.receiveClientEvent(aData1, aData2); } - public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + @SuppressWarnings("unchecked") // Old API uses raw List type + @Override + public void addCollisionBoxesToList( + World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { - ((IGregTechTileEntity) tTileEntity).addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + if (tTileEntity instanceof IGregTechTileEntity && + ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + ((IGregTechTileEntity) tTileEntity) + .addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); return; } super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); } + @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + if (tTileEntity instanceof IGregTechTileEntity && + ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); @@ -199,10 +241,10 @@ public class GT_Block_Machines @Override @SideOnly(Side.CLIENT) - public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) - { + public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + if (tTileEntity instanceof IGregTechTileEntity && + ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); @@ -211,27 +253,32 @@ public class GT_Block_Machines @Override //THIS public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { - AxisAlignedBB bbb=((IGregTechTileEntity)tTileEntity).getCollisionBoundingBoxFromPool(((IGregTechTileEntity)tTileEntity).getWorld(), 0, 0, 0); - minX=bbb.minX;//This essentially sets block bounds - minY=bbb.minY; - minZ=bbb.minZ; - maxX=bbb.maxX; - maxY=bbb.maxY; - maxZ=bbb.maxZ; + if (tTileEntity instanceof IGregTechTileEntity && + (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity) + .getCollisionBoundingBoxFromPool( + ((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0); + minX = bbb.minX; //This essentially sets block bounds + minY = bbb.minY; + minZ = bbb.minZ; + maxX = bbb.maxX; + maxY = bbb.maxY; + maxZ = bbb.maxZ; return; } - super.setBlockBoundsBasedOnState(blockAccess,aX,aY,aZ); + super.setBlockBoundsBasedOnState(blockAccess, aX, aY, aZ); } @Override public void setBlockBoundsForItemRender() { - super.setBlockBounds(0,0,0,1,1,1); + super.setBlockBounds(0, 0, 0, 1, 1, 1); } + @Override public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + if (tTileEntity instanceof IGregTechTileEntity && + ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); return; } @@ -239,69 +286,74 @@ public class GT_Block_Machines } @SideOnly(Side.CLIENT) + @Override public void registerBlockIcons(IIconRegister aIconRegister) { - if (GregTech_API.sPostloadFinished) { - GT_Log.out.println("GT_Mod: Setting up Icon Register for Blocks"); - GregTech_API.sBlockIcons = aIconRegister; - - GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures"); - try { - for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) { - if (tMetaTileEntity != null) { - tMetaTileEntity.registerIcons(aIconRegister); - } - } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} - GT_Log.out.println("GT_Mod: Registering Crop specific Textures"); - try { - for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) { - tCrop.registerSprites(aIconRegister); + if (!GregTech_API.sPostloadFinished) return; + GT_Log.out.println("GT_Mod: Setting up Icon Register for Blocks"); + GregTech_API.setBlockIconRegister(aIconRegister); + + GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures"); + try { + for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) { + if (tMetaTileEntity != null) { + tMetaTileEntity.registerIcons(aIconRegister); } - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); } - GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase"); - GT_FML_LOGGER.info("GT_Mod: Starting Block Icon Load Phase"); - try { - for (Runnable tRunnable : GregTech_API.sGTBlockIconload) { - tRunnable.run(); - } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} - GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase"); - GT_FML_LOGGER.info("GT_Mod: Finished Block Icon Load Phase"); + } catch (Exception e) { + e.printStackTrace(GT_Log.err); } + GT_Log.out.println("GT_Mod: Registering Crop specific Textures"); + try { + for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) { + tCrop.registerSprites(aIconRegister); + } + } catch (Exception e) { + e.printStackTrace(GT_Log.err); + } + GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Starting Block Icon Load Phase"); + try { + for (Runnable tRunnable : GregTech_API.sGTBlockIconload) { + tRunnable.run(); + } + } catch (Exception e) { + e.printStackTrace(GT_Log.err); + } + GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Finished Block Icon Load Phase"); } - public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { - return super.getBlockHardness(aWorld, aX, aY, aZ); - } - + @Override public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof BaseMetaTileEntity)) && (((BaseMetaTileEntity) tTileEntity).privateAccess()) && (!((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true))) { - return -1.0F; - } - return super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity && + ((BaseMetaTileEntity) tTileEntity).privateAccess() && + !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) ? + -1.0F : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); } - public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) { + @Override + public boolean onBlockActivated( + World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity == null) { return false; } - if(aPlayer.isSneaking()){ - ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if(tCurrentItem!=null){ - if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)){ - return false; - } - } + if (aPlayer.isSneaking()) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if ( + tCurrentItem != null && + !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && + !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && + !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) && + !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList) + ) return false; } if ((tTileEntity instanceof IGregTechTileEntity)) { if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) { return false; } - if ((!aWorld.isRemote) && (!((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer))) { + if ((!aWorld.isRemote) && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer)) { return true; } return ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, par1, par2, par3); @@ -309,46 +361,55 @@ public class GT_Block_Machines return false; } + @Override public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity))) { + if (tTileEntity instanceof IGregTechTileEntity) { ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer); } } + @Override public int getDamageValue(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof IGregTechTileEntity)) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getMetaTileID(); } return 0; } + @Override public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BaseMetaTileEntity)) { - GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: " + aWorld.provider.dimensionId+ " due to near explosion!"); + if (tTileEntity instanceof BaseMetaTileEntity) { + GT_Log.exp.printf("Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", + aX, aY, aZ, aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion); } + @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof IGregTechTileEntity)) { + if (tTileEntity instanceof IGregTechTileEntity) { IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; mTemporaryTileEntity.set(tGregTechTileEntity); for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) { - EntityItem tItemEntity = new EntityItem(aWorld, aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + EntityItem tItemEntity = new EntityItem(aWorld, + aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } - tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D); - tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D); - tItemEntity.motionZ = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D); + tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.05D); + tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.25D); + tItemEntity.motionZ = (XSTR_INSTANCE.nextGaussian() * 0.05D); aWorld.spawnEntityInWorld(tItemEntity); tItem.stackSize = 0; tGregTechTileEntity.setInventorySlotContents(i, null); @@ -359,65 +420,76 @@ public class GT_Block_Machines aWorld.removeTileEntity(aX, aY, aZ); } + @Override public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { return ((IGregTechTileEntity) tTileEntity).getDrops(); } - return mTemporaryTileEntity.get() == null ? new ArrayList() : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops(); + IGregTechTileEntity tGregTechTileEntity = mTemporaryTileEntity.get(); + ArrayList<ItemStack> tDrops; + if (tGregTechTileEntity == null) { + tDrops = (ArrayList<ItemStack>) Collections.<ItemStack>emptyList(); + } else { + tDrops = tGregTechTileEntity.getDrops(); + mTemporaryTileEntity.remove(); + } + return tDrops; } + @Override public boolean removedByPlayer(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, boolean aWillHarvest) { - if (aWillHarvest) { - return true; // This delays deletion of the block until after getDrops - } else { - return super.removedByPlayer(aWorld, aPlayer, aX, aY, aZ, false); - } + // This delays deletion of the block until after getDrops + return aWillHarvest || super.removedByPlayer(aWorld, aPlayer, aX, aY, aZ, false); } @Override - public void harvestBlock(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, int aMeta) - { + public void harvestBlock(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, int aMeta) { super.harvestBlock(aWorld, aPlayer, aX, aY, aZ, aMeta); aWorld.setBlockToAir(aX, aY, aZ); } - + + @Override public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity))) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide); } return 0; } + @Override public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { - if ((aSide < 0) || (aSide > 5)) { + if (aSide < 0 || aSide > 5) { return 0; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity))) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); } return 0; } + @Override public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { - if ((aSide < 0) || (aSide > 5)) { + if (aSide < 0 || aSide > 5) { return 0; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity))) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); } return 0; } + @Override public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) { if (!aWorld.isRemote) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && (chance < 1.0F)) { - if (((tTileEntity instanceof BaseMetaTileEntity)) && (GregTech_API.sMachineNonWrenchExplosions)) { - GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: "+ aWorld.provider.dimensionId+ " due to NonWrench picking/Rain!"); + if (tTileEntity != null && (chance < 1.0F)) { + if (tTileEntity instanceof BaseMetaTileEntity && (GregTech_API.sMachineNonWrenchExplosions)) { + GT_Log.exp.printf("Explosion at : %d | %d | %d DIMID: %s NonWrench picking/Rain!%n", + aX, aY, aZ, aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } } else { @@ -426,44 +498,60 @@ public class GT_Block_Machines } } + @Override public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) { if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) { return true; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null) { - if ((tTileEntity instanceof BaseMetaTileEntity)) { - return true; - } - if (((tTileEntity instanceof BaseMetaPipeEntity)) && ((((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0)) { + if (tTileEntity instanceof BaseMetaTileEntity) { return true; } - if (((tTileEntity instanceof ICoverable)) && (((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0)) { + if (tTileEntity instanceof BaseMetaPipeEntity && + (((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0) { return true; } + return tTileEntity instanceof ICoverable && + ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0; } return false; } + @Override + public boolean isBlockNormalCube() { + return true; + } + + /** + * Returns the default ambient occlusion value based on block opacity + */ + @SideOnly(Side.CLIENT) + @Override + public float getAmbientOcclusionLightValue() + { + return this.renderAsNormalBlock() ? 0.2F : 0.5F; + } + + @Override public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity == null) { - return 0; - } - if ((tTileEntity instanceof IGregTechTileEntity)) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getLightOpacity(); } return aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0; } + @Override public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BaseMetaTileEntity)) { + if (tTileEntity instanceof BaseMetaTileEntity) { return ((BaseMetaTileEntity) tTileEntity).getLightValue(); } return 0; } + @Override public TileEntity createTileEntity(World aWorld, int aMeta) { if (aMeta < 4) { return GregTech_API.constructBaseMetaTileEntity(); @@ -471,76 +559,87 @@ public class GT_Block_Machines return new BaseMetaPipeEntity(); } - public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { + @Override + public float getExplosionResistance( + Entity par1Entity, World aWorld, int aX, int aY, int aZ, + double explosionX, double explosionY, double explosionZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof IGregTechTileEntity))) { + if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); } return 10.0F; } @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + @Override + @SuppressWarnings("unchecked") // Old API uses raw List type + public void getSubBlocks(Item par1Item, CreativeTabs par2CreativeTabs, List par3List) { for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { if (GregTech_API.METATILEENTITIES[i] != null) { - par3List.add(new ItemStack(par1, 1, i)); + par3List.add(new ItemStack(par1Item, 1, i)); } } } + @Override public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity == null) { + if (!(tTileEntity instanceof IGregTechTileEntity)) { return; } - if ((tTileEntity instanceof IGregTechTileEntity)) { - IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity; - if (aPlayer == null) { - var6.setFrontFacing((byte) 1); - } else { - int var7 = MathHelper.floor_double(aPlayer.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3; - int var8 = Math.round(aPlayer.rotationPitch); - if ((var8 >= 65) && (var6.isValidFacing((byte) 1))) { - var6.setFrontFacing((byte) 1); - } else if ((var8 <= -65) && (var6.isValidFacing((byte) 0))) { - var6.setFrontFacing((byte) 0); - } else { - switch (var7) { - case 0: - var6.setFrontFacing((byte) 2); - break; - case 1: - var6.setFrontFacing((byte) 5); - break; - case 2: - var6.setFrontFacing((byte) 3); - break; - case 3: - var6.setFrontFacing((byte) 4); - } - } - } + IGregTechTileEntity iGregTechTileEntity = (IGregTechTileEntity) tTileEntity; + if (aPlayer == null) { + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.UP.ordinal()); + return; + } + int yawQuadrant = MathHelper.floor_double(aPlayer.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3; + int pitch = Math.round(aPlayer.rotationPitch); + if (pitch >= 65 && iGregTechTileEntity.isValidFacing((byte) ForgeDirection.UP.ordinal())) { + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.UP.ordinal()); + return; + } + if (pitch <= -65 && iGregTechTileEntity.isValidFacing((byte) ForgeDirection.DOWN.ordinal())) { + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.DOWN.ordinal()); + return; + } + switch (yawQuadrant) { + case 0: + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.NORTH.ordinal()); + break; + case 1: + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.EAST.ordinal()); + break; + case 2: + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.SOUTH.ordinal()); + break; + case 3: + iGregTechTileEntity.setFrontFacing((byte) ForgeDirection.WEST.ordinal()); + break; + default: + break; } } - public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) { + @Override + public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) { TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BaseMetaTileEntity)) { + if (tTileEntity instanceof BaseMetaTileEntity) { return ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel); } - if ((tTileEntity instanceof BaseMetaPipeEntity)) { + if (tTileEntity instanceof BaseMetaPipeEntity) { return ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel); } - return null; + return (ArrayList<String>) Collections.<String>emptyList(); } + @Override public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof IGregTechTileEntity)) { - if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) ((aColor ^ 0xFFFFFFFF) & 0xF)) { + if (tTileEntity instanceof IGregTechTileEntity) { + if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) ((~aColor) & 0xF)) { return false; } - ((IGregTechTileEntity) tTileEntity).setColorization((byte) ((aColor ^ 0xFFFFFFFF) & 0xF)); + ((IGregTechTileEntity) tTileEntity).setColorization((byte) ((~aColor) & 0xF)); return true; } return false; diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index abcc92a795..7fcfd7a29a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -15,13 +15,14 @@ public class GT_Block_Metal extends GT_Block_Storage { public OrePrefixes mPrefix; public IIconContainer[] mBlockIcons; public boolean mHideBlocks; + public static boolean mNEIisLoaded = Loader.isModLoaded("NotEnoughItems"); public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) { super(GT_Item_Storage.class, aName, Material.iron); mMats = aMats; mPrefix = aPrefix; mBlockIcons = aBlockIcons; - mHideBlocks = Loader.isModLoaded("NotEnoughItems"); + mHideBlocks = mNEIisLoaded; for (int i = 0; i < aMats.length; i++) { if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) { @@ -29,11 +30,12 @@ public class GT_Block_Metal extends GT_Block_Storage { GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); } } - if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) { + if (aMats.length<16 && mNEIisLoaded) { for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); } } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) { return mBlockIcons[aMeta].getIcon(); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index bab31d85ed..c3f53a7bc5 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -4,14 +4,19 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; +import java.util.Arrays; + +import static gregtech.api.enums.Textures.BlockIcons.BASALT_STONE; +import static gregtech.api.enums.Textures.BlockIcons.GRANITE_BLACK_STONE; +import static gregtech.api.enums.Textures.BlockIcons.GRANITE_RED_STONE; +import static gregtech.api.enums.Textures.BlockIcons.MARBLE_STONE; + public class GT_Block_Ores extends GT_Block_Ores_Abstract { public GT_Block_Ores() { super("gt.blockores", 7, false, Material.rock); @@ -57,7 +62,15 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { } @Override - public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)}; + public ITexture[] getTextureSet() { + final ITexture[] rTextures = new ITexture[16]; //Must have 16 entries. + Arrays.fill(rTextures, TextureFactory.of(Blocks.stone)); + rTextures[1] = TextureFactory.of(Blocks.netherrack); + rTextures[2] = TextureFactory.of(Blocks.end_stone); + rTextures[3] = TextureFactory.builder().addIcon(GRANITE_BLACK_STONE).stdOrient().build(); + rTextures[4] = TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build(); + rTextures[5] = TextureFactory.builder().addIcon(MARBLE_STONE).stdOrient().build(); + rTextures[6] = TextureFactory.builder().addIcon(BASALT_STONE).stdOrient().build(); + return rTextures; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 512136f1f8..48cd41187d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -77,6 +77,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return 0; } + @Override public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { if (!FUCKING_LOCK) { FUCKING_LOCK = true; @@ -88,6 +89,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements FUCKING_LOCK = false; } + @Override public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) { if (!FUCKING_LOCK) { FUCKING_LOCK = true; @@ -132,42 +134,52 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return aMaterial.getDefaultLocalizedNameForItem(getLocalizedNameFormat(aMaterial)); } + @Override public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; } + @Override public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { return (!(entity instanceof EntityDragon)) && (super.canEntityDestroy(world, x, y, z, entity)); } + @Override public String getHarvestTool(int aMeta) { return aMeta < 8 ? "pickaxe" : "shovel"; } + @Override public int getHarvestLevel(int aMeta) { return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; } + @Override public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; } + @Override protected boolean canSilkHarvest() { return false; } + @Override public abstract String getUnlocalizedName(); + @Override public String getLocalizedName() { return StatCollector.translateToLocal(getUnlocalizedName() + aTextName); } + @Override public int getRenderType() { if (GT_Renderer_Block.INSTANCE == null) { return super.getRenderType(); @@ -175,42 +187,52 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return GT_Renderer_Block.INSTANCE.mRenderID; } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } + @Override public boolean hasTileEntity(int aMeta) { return true; } + @Override public boolean renderAsNormalBlock() { return true; } + @Override public boolean isOpaqueCube() { return true; } + @Override public TileEntity createNewTileEntity(World aWorld, int aMeta) { return createTileEntity(aWorld, aMeta); } + @Override public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { return Blocks.stone.getIcon(0, 0); } + @Override public IIcon getIcon(int aSide, int aMeta) { return Blocks.stone.getIcon(0, 0); } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister aIconRegister) { } + @Override public int getDamageValue(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (((tTileEntity instanceof GT_TileEntity_Ores))) { @@ -219,6 +241,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return 0; } + @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { @@ -236,6 +259,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null. + @Override public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { @@ -244,6 +268,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune); } + @Override public TileEntity createTileEntity(World aWorld, int aMeta) { return new GT_TileEntity_Ores(); } @@ -274,4 +299,4 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java index bea2320f01..6749f8d136 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java @@ -5,7 +5,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -50,6 +50,6 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { @Override public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)}; + return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java index d3278f0cb4..5d78ab0aa3 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java @@ -5,7 +5,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -50,6 +50,6 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { @Override public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)}; + return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java index 7942d80b22..e4111af1c5 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java @@ -5,7 +5,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -50,6 +50,6 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { @Override public ITexture[] getTextureSet() { //Must have 16 entries. - return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)}; + return new ITexture[]{TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7)}; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index ec31cb212c..fc49ecc597 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -8,9 +8,10 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.items.GT_Generic_Block; -import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.WorldSpawnedEventBuilder; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -38,8 +39,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { super(GT_Item_Storage.class, aName, new GT_Material_Reinforced()); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[1][i + 80] = new GT_CopiedBlockTexture(this, 6, i); + for (int i = 0; i < 16; i++) { + Textures.BlockIcons.casingTexturePages[1][i + 80] = TextureFactory.of(this, i); } setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH); @@ -58,7 +59,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Raw Deep Dark Portal Block"); ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); - ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(40.0f).setResistance(100.0f), 1, 2)); + ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(5.0f).setResistance(6.0f), 1, 2)); ItemList.Block_TungstenSteelReinforced.set(new ItemStack(this.setHardness(250.0f).setResistance(400.0f), 1, 3)); ItemList.Block_BrittleCharcoal.set(new ItemStack(this.setHardness(0.5f).setResistance(8.0f), 1, 4)); ItemList.Block_Powderbarrel.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 5)); @@ -69,20 +70,19 @@ public class GT_Block_Reinforced extends GT_Generic_Block { ItemList.Block_NaquadahPlate.set(new ItemStack(this.setHardness(500.0f).setResistance(1000.0f), 1, 10)); ItemList.Block_NeutroniumPlate.set(new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); ItemList.Block_BedrockiumCompressed.set(new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); - //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteBlack)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteRed)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Block_IridiumTungstensteel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hBP", 'P', OrePrefixes.plate.get(Materials.Iridium), 'B', ItemList.Block_TungstenSteelReinforced.get(1L, new Object[0])}); - //GT_OreDictUnificator.setItemData(ItemList.Block_IridiumTungstensteel.get(1, new Object[0]), new ItemData(new MaterialStack(Materials.Iridium, OrePrefixes.plate.mMaterialAmount), new MaterialStack(Materials.TungstenSteel, 2*OrePrefixes.plate.mMaterialAmount),new MaterialStack(Materials.Concrete, OrePrefixes.dust.mMaterialAmount))); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal, 1, 1), new Object[]{ItemList.Block_BrittleCharcoal.get(1, new Object[0])}); - GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal, 1, 1), new Object[]{ItemList.Block_BrittleCharcoal.get(1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)}); } + @Override public String getHarvestTool(int aMeta) { if (aMeta == 5 || aMeta == 4 || aMeta == 6 || aMeta == 7) return "axe"; + if (aMeta == 2) return "wrench"; return "pickaxe"; } + @Override public int getHarvestLevel(int aMeta) { if (aMeta == 4||aMeta == 5 || aMeta == 6 || aMeta == 7) return 1; if (aMeta == 2) return 2; @@ -91,6 +91,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 4; } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { @@ -125,6 +126,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { if (aWorld == null) { return 0.0F; @@ -140,7 +142,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 400.0F; } if (tMeta == 2) { - return 40.0F; + return 5.0F; } if (tMeta == 3) { return 250.0F; @@ -163,6 +165,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); } + @Override public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { if (world == null) { return 0.0F; @@ -175,7 +178,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 600.0F; } if (tMeta == 2) { - return 100.0F; + return 6.0F; } if (tMeta == 3) { return 400.0F; @@ -202,50 +205,62 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); } + @Override public String getUnlocalizedName() { return this.mUnlocalizedName; } + @Override public String getLocalizedName() { return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } + @Override public boolean renderAsNormalBlock() { return true; } + @Override public boolean isOpaqueCube() { return true; } + @Override public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return false; } + @Override public int damageDropped(int par1) { return par1; } + @Override public int getDamageValue(World par1World, int par2, int par3, int par4) { return par1World.getBlockMetadata(par2, par3, par4); } + @Override public int quantityDropped(Random par1Random) { return 1; } + @Override public Item getItemDropped(int par1, Random par2Random, int par3) { return Item.getItemFromBlock(this); } + @Override public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) { if (par5 == 4) { this.dropBlockAsItem(aWorld, aX, aY, aZ, new ItemStack(Items.coal, XSTR_INSTANCE.nextInt(2) + 1, 1)); @@ -254,19 +269,26 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } + @Override public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player); world.spawnEntityInWorld(entitytntprimed); - world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); - + new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() + .setPitch(1f) + .setVolume(1f) + .setIdentifier("game.tnt.primed") + .setEntity(entitytntprimed) + .setWorld(world) + .run(); world.setBlockToAir(x, y, z); return false; } return super.removedByPlayer(world, player, x, y, z); } + @Override public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); @@ -275,6 +297,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } + @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) { if (world.isBlockIndirectlyGettingPowered(x, y, z)&&world.getBlockMetadata(x, y, z)==5) { @@ -282,6 +305,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } + @Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { if (!world.isRemote && world.getBlockMetadata(x, y, z)==5){ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy()); @@ -291,6 +315,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { super.onBlockExploded(world, x, y, z, explosion); } + @Override public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset) { if ((player.getCurrentEquippedItem() != null) && (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel)&&par1World.getBlockMetadata(x, y, z)==5) @@ -302,10 +327,12 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return super.onBlockActivated(par1World, x, y, z, player, side, xOffset, yOffset, zOffset); } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister aIconRegister) { } + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { @@ -314,6 +341,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } + @Override public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { return !(entity instanceof EntityWither); } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java index efac529b18..3838f30f0b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java @@ -36,14 +36,17 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract { } } + @Override public int getHarvestLevel(int aMeta) { return 2; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F; } + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { return gregtech.api.enums.Textures.BlockIcons.STONES[aMeta].getIcon(); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index c9c31dae54..2f816b93c0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -24,9 +24,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class GT_Block_Stones_Abstract - extends GT_Generic_Block - implements IOreRecipeRegistrator { +public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRecipeRegistrator { public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) { super(aItemClass, aName, Material.rock); OrePrefixes.crafting.add(this); @@ -66,6 +64,7 @@ public class GT_Block_Stones_Abstract GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 15)}); } + @Override public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) { GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 7), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 6), 50, 16); @@ -133,14 +132,17 @@ public class GT_Block_Stones_Abstract return 1; } + @Override public Item getItemDropped(int par1, Random par2Random, int par3) { return Item.getItemFromBlock(this); } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister aIconRegister) { } + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java index 768fed6619..0a05ab300c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java @@ -28,70 +28,87 @@ public class GT_Block_Storage extends GT_Generic_Block { setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); } + @Override public String getHarvestTool(int aMeta) { return "pickaxe"; } + @Override public int getHarvestLevel(int aMeta) { return 1; } + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); } + @Override public float getExplosionResistance(Entity aTNT) { return Blocks.iron_block.getExplosionResistance(aTNT); } + @Override public String getUnlocalizedName() { return this.mUnlocalizedName; } + @Override public String getLocalizedName() { return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); } + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } + @Override public boolean renderAsNormalBlock() { return true; } + @Override public boolean isOpaqueCube() { return true; } + @Override public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return true; } + @Override public int damageDropped(int par1) { return par1; } + @Override public int getDamageValue(World par1World, int par2, int par3, int par4) { return par1World.getBlockMetadata(par2, par3, par4); } + @Override public int quantityDropped(Random par1Random) { return 1; } + @Override public Item getItemDropped(int par1, Random par2Random, int par3) { return Item.getItemFromBlock(this); } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister aIconRegister) { } + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java index 680942d9fd..bcb50b2176 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java @@ -9,8 +9,7 @@ import net.minecraft.util.EnumChatFormatting; import java.util.List; -public class GT_Item_Casings1 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings1 extends GT_Item_Casings_Abstract { public GT_Item_Casings1(Block par1) { super(par1); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java index 1d069d94f7..ed705d0c57 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java @@ -6,12 +6,12 @@ import net.minecraft.item.ItemStack; import java.util.List; -public class GT_Item_Casings2 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings2 extends GT_Item_Casings_Abstract { public GT_Item_Casings2(Block par1) { super(par1); } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); switch (getDamage(aStack)) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java index 5ecf0a9da6..b9eac8252a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java @@ -2,8 +2,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; -public class GT_Item_Casings3 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings3 extends GT_Item_Casings_Abstract { public GT_Item_Casings3(Block par1) { super(par1); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java index 05da650a51..10b39e3ea8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java @@ -2,8 +2,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; -public class GT_Item_Casings4 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings4 extends GT_Item_Casings_Abstract { public GT_Item_Casings4(Block par1) { super(par1); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java index 759fcafb5e..f3e58d2acc 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java @@ -2,48 +2,30 @@ package gregtech.common.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import java.util.List; -public class GT_Item_Casings5 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings5 extends GT_Item_Casings_Abstract { public GT_Item_Casings5(Block par1) { super(par1); } + + protected static final String mCoilHeatTooltip = GT_LanguageManager.addStringLocalization("gt.coilheattooltip", "Base Heating Capacity = "); + protected static final String mCoilUnitTooltip = GT_LanguageManager.addStringLocalization("gt.coilunittooltip", " Kelvin"); + protected static final String mCoilTierTooltip = GT_LanguageManager.addStringLocalization("gt.coiltiertooltip", "Coil Tier = "); + @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); - switch (getDamage(aStack)) { - case 0: - aList.add(this.mCoil01Tooltip); - break; - case 1: - aList.add(this.mCoil02Tooltip); - break; - case 2: - aList.add(this.mCoil03Tooltip); - break; - case 3: - aList.add(this.mCoil04Tooltip); - break; - case 4: - aList.add(this.mCoil05Tooltip); - break; - case 5: - aList.add(this.mCoil06Tooltip); - break; - case 6: - aList.add(this.mCoil07Tooltip); - break; - case 7: - aList.add(this.mCoil08Tooltip); - break; - case 8: - aList.add(this.mCoil09Tooltip); - } + HeatingCoilLevel coilLevel = GT_Block_Casings5.getCoilHeatFromDamage(aStack.getItemDamage()); + aList.add(mCoilHeatTooltip + coilLevel.getHeat() + mCoilUnitTooltip); + aList.add(mCoilTierTooltip + coilLevel.getTierName()); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java index f29e907827..ebeab2f0aa 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java @@ -2,9 +2,8 @@ package gregtech.common.blocks; import net.minecraft.block.Block; -public class GT_Item_Casings6 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings6 extends GT_Item_Casings_Abstract { public GT_Item_Casings6(Block par1) { super(par1); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java index f1609ef684..19ca06d5ac 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java @@ -2,8 +2,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; -public class GT_Item_Casings8 - extends GT_Item_Casings_Abstract { +public class GT_Item_Casings8 extends GT_Item_Casings_Abstract { public GT_Item_Casings8(Block par1) { super(par1); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java index 1ca55d499f..0468da20d8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java @@ -9,8 +9,7 @@ import net.minecraft.item.ItemStack; import java.util.List; -public abstract class GT_Item_Casings_Abstract - extends ItemBlock { +public abstract class GT_Item_Casings_Abstract extends ItemBlock { protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); protected final String mCoil01Tooltip = GT_LanguageManager.addStringLocalization("gt.coil01tooltip", "Base Heating Capacity = 1800 Kelvin"); @@ -25,6 +24,7 @@ public abstract class GT_Item_Casings_Abstract protected final String mCoilOverheated1Tooltip = GT_LanguageManager.addStringLocalization("gt.coil.overheated1.tooltip", "These coils are deprecated"); protected final String mCoilOverheated2Tooltip = GT_LanguageManager.addStringLocalization("gt.coil.overheated2.tooltip", "Place in crafting grid to get regular coils"); protected final String mBlastProofTooltip = GT_LanguageManager.addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); + public GT_Item_Casings_Abstract(Block par1) { super(par1); setMaxDamage(0); @@ -32,14 +32,17 @@ public abstract class GT_Item_Casings_Abstract setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); } + @Override public int getMetadata(int aMeta) { return aMeta; } + @Override public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(this.mNoMobsToolTip); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java index 22a732a507..bf8957afb4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java @@ -7,14 +7,14 @@ import net.minecraft.item.ItemStack; import java.util.List; -public class GT_Item_Concretes - extends GT_Item_Stones_Abstract { +public class GT_Item_Concretes extends GT_Item_Stones_Abstract { private final String mRunFasterToolTip = GT_LanguageManager.addStringLocalization("gt.runfastertooltip", "You can walk faster on this Block"); public GT_Item_Concretes(Block par1) { super(par1); } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(this.mRunFasterToolTip); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Granites.java b/src/main/java/gregtech/common/blocks/GT_Item_Granites.java index 71faf3b759..d14474c17f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Granites.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Granites.java @@ -2,8 +2,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; -public class GT_Item_Granites - extends GT_Item_Stones_Abstract { +public class GT_Item_Granites extends GT_Item_Stones_Abstract { public GT_Item_Granites(Block par1) { super(par1); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java new file mode 100644 index 0000000000..e376933623 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java @@ -0,0 +1,39 @@ +package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class GT_Item_LongDistancePipe extends ItemBlock { + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + public GT_Item_LongDistancePipe(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + } + + @Override + public int getMetadata(int aMeta) { + return aMeta; + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + aList.add(this.mNoMobsToolTip); + aList.add(this.mNoTileEntityToolTip); + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index bf6b12b5cd..39eecdd5e4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -4,7 +4,9 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IConnectable; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame; @@ -23,8 +25,7 @@ import net.minecraft.world.World; import java.util.List; -public class GT_Item_Machines - extends ItemBlock { +public class GT_Item_Machines extends ItemBlock { private static final String[] directionNames = {"Bottom", "Top", "North", "South", "West", "East"}; @@ -35,6 +36,7 @@ public class GT_Item_Machines setCreativeTab(GregTech_API.TAB_GREGTECH); } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { try { int tDamage = getDamage(aStack); @@ -46,29 +48,33 @@ public class GT_Item_Machines IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); if (tTileEntity.getDescription() != null) { int i = 0; + IMetaTileEntity metaTileEntity = tTileEntity.getMetaTileEntity(); + String suffix = (metaTileEntity instanceof MetaTileEntity && ((MetaTileEntity) metaTileEntity).isDisplaySecondaryDescription()) ? "Secondary_" : ""; for (String tDescription : tTileEntity.getDescription()) { if (GT_Utility.isStringValid(tDescription)) { - if(tDescription.contains("%%%")){ - String[] tString = tDescription.split("%%%"); - if(tString.length>=2){ - StringBuffer tBuffer = new StringBuffer(); - Object tRep[] = new String[tString.length / 2]; - for (int j = 0; j < tString.length; j++) - if (j % 2 == 0) tBuffer.append(tString[j]); - else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];} - aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep)); - } - }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); - aList.add(tTranslated.equals("") ? tDescription : tTranslated);} + if(tDescription.contains("%%%")){ + String[] tString = tDescription.split("%%%"); + if(tString.length>=2){ + StringBuffer tBuffer = new StringBuffer(); + Object tRep[] = new String[tString.length / 2]; + for (int j = 0; j < tString.length; j++) + if (j % 2 == 0) tBuffer.append(tString[j]); + else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];} + aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_" + suffix + "DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished ), tRep)); + } + }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_" + suffix + "DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); + aList.add(tTranslated.equals("") ? tDescription : tTranslated);} }else i++; } } if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); + int inputTier = GT_Utility.getTier(tTileEntity.getInputVoltage()); + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.TIER_COLORS[inputTier] + GT_Values.VN[inputTier] + EnumChatFormatting.GREEN +")" + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); + int outputTier = GT_Utility.getTier(tTileEntity.getOutputVoltage()); + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.TIER_COLORS[outputTier] + GT_Values.VN[outputTier] + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputAmperage() > 1L) { aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); @@ -111,10 +117,12 @@ public class GT_Item_Machines } } + @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { return false; } + @Override public String getUnlocalizedName(ItemStack aStack) { short tDamage = (short) getDamage(aStack); if ((tDamage < 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { @@ -126,6 +134,7 @@ public class GT_Item_Machines return ""; } + @Override public String getItemStackDisplayName(ItemStack aStack) { String aName = super.getItemStackDisplayName(aStack); short aDamage = (short) getDamage(aStack); @@ -147,6 +156,7 @@ public class GT_Item_Machines return aName; } + @Override public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { super.onCreated(aStack, aWorld, aPlayer); short tDamage = (short) getDamage(aStack); @@ -155,6 +165,7 @@ public class GT_Item_Machines } } + @Override public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 8d53cfe513..ab31233abc 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -8,8 +8,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class GT_Item_Ores - extends ItemBlock { +public class GT_Item_Ores extends ItemBlock { public GT_Item_Ores(Block par1) { super(par1); setMaxDamage(0); @@ -17,14 +16,17 @@ public class GT_Item_Ores setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); } + @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { return false; } + @Override public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); } + @Override public String getItemStackDisplayName(ItemStack aStack) { String aName = super.getItemStackDisplayName(aStack); if (this.field_150939_a instanceof GT_Block_Ores_Abstract) { @@ -33,6 +35,7 @@ public class GT_Item_Ores return aName; } + @Override public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java index 6e42569e6f..5170b1cbeb 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java @@ -9,8 +9,7 @@ import net.minecraft.item.ItemStack; import java.util.List; -public class GT_Item_Stones_Abstract - extends ItemBlock { +public class GT_Item_Stones_Abstract extends ItemBlock { private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); public GT_Item_Stones_Abstract(Block par1) { @@ -20,14 +19,17 @@ public class GT_Item_Stones_Abstract setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); } + @Override public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); } + @Override public int getMetadata(int aMeta) { return aMeta; } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack.getItemDamage() % 8 >= 3) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java index 8cf838f538..3696cd4fc2 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -16,10 +16,12 @@ public class GT_Item_Storage extends ItemBlock { setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); } + @Override public String getUnlocalizedName(ItemStack aStack) { return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); } + @Override public String getItemStackDisplayName(ItemStack aStack) { String aName = super.getItemStackDisplayName(aStack); if (this.field_150939_a instanceof GT_Block_Metal) { @@ -31,11 +33,13 @@ public class GT_Item_Storage extends ItemBlock { return aName; } + @Override public int getMetadata(int aMeta) { return aMeta; } + @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java index c81f382f5d..3b6cd37f9c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java @@ -3,8 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; -public class GT_Material_Casings - extends Material { +public class GT_Material_Casings extends Material { public static final Material INSTANCE = new GT_Material_Casings(); private GT_Material_Casings() { @@ -12,6 +11,7 @@ public class GT_Material_Casings setRequiresTool(); } + @Override public boolean isOpaque() { return true; } diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Machines.java b/src/main/java/gregtech/common/blocks/GT_Material_Machines.java index e55720f9fa..d51e588522 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Machines.java @@ -3,8 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; -public class GT_Material_Machines - extends Material { +public class GT_Material_Machines extends Material { public GT_Material_Machines() { super(MapColor.ironColor); setRequiresTool(); @@ -12,7 +11,8 @@ public class GT_Material_Machines setAdventureModeExempt(); } + @Override public boolean isOpaque() { - return false; + return true; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java index 4aa9ba6931..38de5dbee7 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java @@ -3,14 +3,14 @@ package gregtech.common.blocks; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; -public class GT_Material_Reinforced - extends Material { +public class GT_Material_Reinforced extends Material { public GT_Material_Reinforced() { super(MapColor.stoneColor); setRequiresTool(); setAdventureModeExempt(); } + @Override public boolean isOpaque() { return true; } diff --git a/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java b/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java index b026e60dac..657ac9b934 100644 --- a/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java @@ -1,15 +1,13 @@ package gregtech.common.blocks; import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class GT_Packet_Ores - extends GT_Packet { +public class GT_Packet_Ores extends GT_Packet_New { private int mX; private int mZ; private short mY; @@ -27,21 +25,20 @@ public class GT_Packet_Ores this.mMetaData = aMetaData; } - public byte[] encode() { - ByteArrayDataOutput tOut = ByteStreams.newDataOutput(12); - - tOut.writeInt(this.mX); - tOut.writeShort(this.mY); - tOut.writeInt(this.mZ); - tOut.writeShort(this.mMetaData); - - return tOut.toByteArray(); + @Override + public void encode(ByteBuf aOut) { + aOut.writeInt(this.mX); + aOut.writeShort(this.mY); + aOut.writeInt(this.mZ); + aOut.writeShort(this.mMetaData); } - public GT_Packet decode(ByteArrayDataInput aData) { + @Override + public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_Ores(aData.readInt(), aData.readShort(), aData.readInt(), aData.readShort()); } + @Override public void process(IBlockAccess aWorld) { if (aWorld != null) { TileEntity tTileEntity = aWorld.getTileEntity(this.mX, this.mY, this.mZ); @@ -54,6 +51,7 @@ public class GT_Packet_Ores } } + @Override public byte getPacketID() { return 3; } diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 2eb100599b..66dd4b7277 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -7,9 +7,8 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -23,6 +22,8 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.Random; +import static gregtech.api.enums.TextureSet.SET_NONE; + public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntity { public short mMetaData = 0; public boolean mNatural = false; @@ -31,7 +32,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public static byte getHarvestData(short aMetaData, int aBaseBlockHarvestLevel) { Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)]; byte tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); - if(GT_Mod.gregtechproxy.mChangeHarvestLevels ) { + if (GT_Mod.gregtechproxy.mChangeHarvestLevels) { tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(GT_Mod.gregtechproxy.mMaxHarvestLevel, GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] - (aMetaData < 16000 ? 0 : 1))); } return tByte; @@ -111,12 +112,14 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit return false; } + @Override public void readFromNBT(NBTTagCompound aNBT) { super.readFromNBT(aNBT); this.mMetaData = aNBT.getShort("m"); this.mNatural = aNBT.getBoolean("n"); } + @Override public void writeToNBT(NBTTagCompound aNBT) { super.writeToNBT(aNBT); aNBT.setShort("m", this.mMetaData); @@ -130,6 +133,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } } + @Override public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) { if (!(this.mBlocked = ( @@ -147,38 +151,38 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) { - if(this.worldObj == null || blockType==null)return; - this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); - if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { - this.mMetaData = ((short) (this.mMetaData + 1000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { - this.mMetaData = ((short) (this.mMetaData + 2000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { - if (aOverridingStoneBlock == GregTech_API.sBlockGranites) { - if (aOverridingStoneMeta < 8) { - this.mMetaData = ((short) (this.mMetaData + 3000)); - } else { - this.mMetaData = ((short) (this.mMetaData + 4000)); - } - } else { + if (this.worldObj == null || blockType == null) return; + this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); + if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { + this.mMetaData = ((short) (this.mMetaData + 1000)); + } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { + this.mMetaData = ((short) (this.mMetaData + 2000)); + } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { + if (aOverridingStoneBlock == GregTech_API.sBlockGranites) { + if (aOverridingStoneMeta < 8) { this.mMetaData = ((short) (this.mMetaData + 3000)); - } - } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) { - if (aOverridingStoneBlock == GregTech_API.sBlockStones) { - if (aOverridingStoneMeta < 8) { - this.mMetaData = ((short) (this.mMetaData + 5000)); - } else { - this.mMetaData = ((short) (this.mMetaData + 6000)); - } } else { + this.mMetaData = ((short) (this.mMetaData + 4000)); + } + } else { + this.mMetaData = ((short) (this.mMetaData + 3000)); + } + } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) { + if (aOverridingStoneBlock == GregTech_API.sBlockStones) { + if (aOverridingStoneMeta < 8) { this.mMetaData = ((short) (this.mMetaData + 5000)); + } else { + this.mMetaData = ((short) (this.mMetaData + 6000)); } + } else { + this.mMetaData = ((short) (this.mMetaData + 5000)); } - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0); + } + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0); } public void convertOreBlock(World aWorld, int aX, int aY, int aZ) { - short aMeta = ((short) (int) (this.mMetaData % 1000 + (this.mMetaData / 16000 * 16000))); + short aMeta = ((short) (this.mMetaData % 1000 + (this.mMetaData / 16000 * 16000))); aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof GT_TileEntity_Ores) { @@ -191,12 +195,13 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit return this.mMetaData; } + @Override public boolean canUpdate() { return false; } public ArrayList<ItemStack> getDrops(Block aDroppedOre, int aFortune) { - ArrayList<ItemStack> rList = new ArrayList(); + ArrayList<ItemStack> rList = new ArrayList<>(); if (this.mMetaData <= 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; @@ -214,7 +219,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } if (aMaterial != null) { Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); - ArrayList<ItemStack> tSelector = new ArrayList(); + ArrayList<ItemStack> tSelector = new ArrayList<>(); ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); @@ -259,28 +264,40 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit tSelector.add(tStack); } } - if (tSelector.size() > 0) { + if (!tSelector.isEmpty()) { int i = 0; for (int j = Math.max(1, aMaterial.mOreMultiplier + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) / 2); i < j; i++) { - rList.add(GT_Utility.copyAmount(1L, new Object[]{tSelector.get(tRandom.nextInt(tSelector.size()))})); + rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } } if (tRandom.nextInt(3 + aFortune) > 1) { Materials dustMat = ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 % 16]; - if (dustMat != null) rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); + if (dustMat != null) + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); } } return rList; } + @Override public ITexture[] getTexture(Block aBlock, byte aSide) { Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)]; if ((aMaterial != null) && (this.mMetaData < 32000)) { - GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa); + ITexture iTexture = TextureFactory.builder() + .addIcon(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? + OrePrefixes.ore.mTextureIndex : + OrePrefixes.oreSmall.mTextureIndex]) + .setRGBA(aMaterial.mRGBa) + .stdOrient() + .build(); if (aBlock instanceof GT_Block_Ores_Abstract) { - return new ITexture[]{((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], aIconSet}; + return new ITexture[]{ + ((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], iTexture}; } } - return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; + return new ITexture[]{ + TextureFactory.of(Blocks.stone, 0), + TextureFactory.builder().addIcon(SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]).stdOrient().build() + }; } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index 77558e001d..c686f99c0b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -17,20 +17,20 @@ import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Arm - extends GT_CoverBehavior { +public class GT_Cover_Arm extends GT_CoverBehavior { public final int mTickRate; //msb converted, 2nd : direction (1=export) //right 14 bits: internalSlot, next 14 bits adjSlot, 0 = all, slot = -1 - protected final static int EXPORT_MASK = 0x40000000; - protected final static int SLOT_ID_MASK = 0x3FFF; - protected final static int SLOT_ID_MIN = 0; - protected final static int CONVERTED_BIT = 0x80000000; + protected static final int EXPORT_MASK = 0x40000000; + protected static final int SLOT_ID_MASK = 0x3FFF; + protected static final int SLOT_ID_MIN = 0; + protected static final int CONVERTED_BIT = 0x80000000; public GT_Cover_Arm(int aTickRate) { this.mTickRate = aTickRate; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress) aTileEntity).isAllowedToWork()))) { return aCoverVariable; @@ -43,15 +43,6 @@ public class GT_Cover_Arm aCoverVariable = CONVERTED_BIT | Math.min(Math.abs(aCoverVariable-1), SLOT_ID_MASK); } - boolean usePower = false; - if (aTileEntity.getUniversalEnergyCapacity() >= 128L) { - if (aTileEntity.isUniversalEnergyStored(256L)) { - usePower = true; - } else { - return aCoverVariable; - } - } - TileEntity toTile, fromTile; int toSlot, fromSlot; @@ -98,12 +89,10 @@ public class GT_Cover_Arm movedItems = GT_Utility.moveOneItemStack(fromTile, toTile, fromSide, toSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); } - if (usePower) - aTileEntity.decreaseStoredEnergyUnits(4*movedItems, true); - return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { int step = 0; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { @@ -116,6 +105,7 @@ public class GT_Cover_Arm return aCoverVariable; } + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { int step = (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) ? 1 : -1; aCoverVariable = getNewVar(aCoverVariable, step); @@ -157,42 +147,52 @@ public class GT_Cover_Arm return CONVERTED_BIT | export | ((adjSlot & SLOT_ID_MASK) << 14) | (intSlot & SLOT_ID_MASK); } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return this.mTickRate; } @@ -218,10 +218,10 @@ public class GT_Cover_Arm private GT_GuiFakeItemButton intSlotIcon, adjSlotIcon; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; private final String ANY_TEXT = trans("ANY", "Any"); @@ -402,33 +402,5 @@ public class GT_Cover_Arm return !export; return export; } - -// getStackInSlot wasn't available client side.. -// private void updateInventorySlots() { -// updateInventorySlot(intSlotIcon, internalSlotID, true); -// updateInventorySlot(adjSlotIcon, adjacentSlotID, false); -// } -// -// private void updateInventorySlot(GT_GuiFakeItemButton button, int slotID, boolean internal) { -// if (slotID == SLOT_ID_ANY) { -// button.setItem(null); -// return; -// } -// -// if (super.tile instanceof TileEntity && !super.tile.isDead()) { -// TileEntity tile; -// if (internal) -// tile = (TileEntity) super.tile; -// else -// tile = super.tile.getTileEntityAtSide(side); -// -// if (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() >= slotID) { -// ItemStack item = ((IInventory) tile).getStackInSlot(slotID); -// button.setItem(item); -// return; -// } -// } -// button.setItem(null); -// } } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java b/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java deleted file mode 100644 index 77647a43d8..0000000000 --- a/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java +++ /dev/null @@ -1,21 +0,0 @@ -package gregtech.common.covers; - -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.util.GT_CoverBehavior; - -public class GT_Cover_Blastproof - extends GT_CoverBehavior { - private final float mLevel; - - public GT_Cover_Blastproof(float aLevel) { - this.mLevel = aLevel; - } - - public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return this.mLevel; - } - - public boolean isSimpleCover() { - return true; - } -} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index 9624b68464..8b24bf3f8e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -13,43 +14,63 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_ControlsWork - extends GT_CoverBehavior { +public class GT_Cover_ControlsWork extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aTileEntity instanceof IMachineProgress) { - if ((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2) - ((IMachineProgress) aTileEntity).enableWorking(); - else + if (aCoverVariable < 2) { + if ((aInputRedstone > 0) == (aCoverVariable == 0)) + ((IMachineProgress) aTileEntity).enableWorking(); + else + ((IMachineProgress) aTileEntity).disableWorking(); + ((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone); + } + else if (aCoverVariable == 2) { ((IMachineProgress) aTileEntity).disableWorking(); - ((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone); + } else { + if (((IMachineProgress) aTileEntity).wasShutdown()) { + ((IMachineProgress) aTileEntity).disableWorking(); + GT_Utility.sendChatToPlayer(lastPlayer, aTileEntity.getInventoryName() + "at " + String.format("(%d,%d,%d)", aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) + " shut down."); + return 2; + } else { + return 3 + doCoverThings(aSide,aInputRedstone, aCoverID, aCoverVariable - 3, aTileEntity, aTimer); + } + } } return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { if ((aTileEntity instanceof IMachineProgress)) { ((IMachineProgress) aTileEntity).enableWorking(); @@ -58,21 +79,30 @@ public class GT_Cover_ControlsWork return true; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3; + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 5; if(aCoverVariable <0){aCoverVariable = 2;} if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, trans("003", "Normal")); + GT_Utility.sendChatToPlayer(aPlayer, trans("003", "Enable with Signal")); } if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, trans("004", "Inverted")); + GT_Utility.sendChatToPlayer(aPlayer, trans("004", "Disable with Signal")); } if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, trans("005", "No Work at all")); + GT_Utility.sendChatToPlayer(aPlayer, trans("005", "Disabled")); } + if (aCoverVariable == 3) { + GT_Utility.sendChatToPlayer(aPlayer, trans("505", "Enable with Signal (Safe)")); + } + if (aCoverVariable == 4) { + GT_Utility.sendChatToPlayer(aPlayer, trans("506", "Disable with Signal (Safe)")); + } + // TODO: Set lastPlayer return aCoverVariable; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } @@ -96,10 +126,10 @@ public class GT_Cover_ControlsWork private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -107,10 +137,11 @@ public class GT_Cover_ControlsWork this.coverID = aCoverID; this.coverVariable = aCoverVariable; - GuiButton b; - b = new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.REDSTONE_ON); - b = new GT_GuiIconButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF); - b = new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CROSS); + new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.REDSTONE_ON); + new GT_GuiIconButton(this, 1, startX + spaceX * 0, startY + spaceY * 1, GT_GuiIcon.REDSTONE_OFF); + new GT_GuiIconButton(this, 2, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CROSS); + + new GT_GuiIconCheckButton(this, 3, startX + spaceX * 0, startY + spaceY * 3, GT_GuiIcon.CHECKMARK, GT_GuiIcon.CROSS).setChecked(aCoverVariable > 2); } @Override @@ -119,6 +150,7 @@ public class GT_Cover_ControlsWork this.fontRendererObj.drawString(trans("243", "Enable with Redstone"), 3+startX + spaceX*1, 4+startY+spaceY*0, 0xFF555555); this.fontRendererObj.drawString(trans("244", "Disable with Redstone"),3+startX + spaceX*1, 4+startY+spaceY*1, 0xFF555555); this.fontRendererObj.drawString(trans("245", "Disable machine"), 3+startX + spaceX*1, 4+startY+spaceY*2, 0xFF555555); + this.fontRendererObj.drawString(trans("507", "Safe Mode"), 3+startX + spaceX*1, 4+startY+spaceY*3, 0xFF555555); } @Override @@ -126,9 +158,17 @@ public class GT_Cover_ControlsWork updateButtons(); } + @Override public void buttonClicked(GuiButton btn) { if (getClickable(btn.id)) { - coverVariable = getNewCoverVariable(btn.id); + int bID = btn.id; + if (bID == 3) { + ((GT_GuiIconCheckButton) btn).setChecked(!((GT_GuiIconCheckButton) btn).isChecked()); + } else { + coverVariable = getNewCoverVariable(bID); + } + adjustCoverVariable(); + // TODO: Set lastPlayer; GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); } updateButtons(); @@ -147,7 +187,18 @@ public class GT_Cover_ControlsWork } private boolean getClickable(int id) { - return id != coverVariable; + return ((id != coverVariable && id != coverVariable - 3) || id == 3); } + + private void adjustCoverVariable() { + boolean safeMode = ((GT_GuiIconCheckButton) buttonList.get(3)).isChecked(); + if (safeMode && coverVariable < 2) { + coverVariable += 3; + } + if (!safeMode && coverVariable > 2) { + coverVariable -= 3; + } + } + } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index aee46b7aab..b86f950e23 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -30,6 +30,7 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { this.mMaxStacks = maxStacks; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { @@ -41,36 +42,13 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { toEntity = aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity; byte fromSide = aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, toSide = aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide; - boolean costsEnergy = ((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L); - byte moved; - - - if (costsEnergy) { - long tStoredEnergy = aTileEntity.getUniversalEnergyStored(); - int tMaxStacks = (int)(tStoredEnergy/(4*64*this.mMaxStacks)); - if (tMaxStacks > this.mMaxStacks) - tMaxStacks = this.mMaxStacks; - int tCost = moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,tMaxStacks); - aTileEntity.decreaseStoredEnergyUnits(4 * tCost, true); - } else { - moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,this.mMaxStacks); - } - -// for(int i=0 ; i < this.mMaxStacks ; i++) { -// // Costs energy but we don't have enough, bail -// if ((costsEnergy && !aTileEntity.isUniversalEnergyStored(256L))) -// break; -// -// moved = GT_Utility.moveOneItemStack(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); -// -// if(moved == 0) -// break; -// } + moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,this.mMaxStacks); return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; if(aCoverVariable <0){aCoverVariable = 11;} @@ -91,42 +69,52 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { return aCoverVariable; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return (aCoverVariable >= 6) || (aCoverVariable % 2 != 0); } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return (aCoverVariable >= 6) || (aCoverVariable % 2 == 0); } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return this.mTickRate; } @@ -150,10 +138,10 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -184,6 +172,7 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (getClickable(btn.id)){ coverVariable = getNewCoverVariable(btn.id); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java index adc84a0e94..3cf0742d52 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java @@ -7,13 +7,14 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.network.play.server.S2DPacketOpenWindow; -public class GT_Cover_Crafting - extends GT_CoverBehavior { +public class GT_Cover_Crafting extends GT_CoverBehavior { + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if ((aPlayer instanceof EntityPlayerMP)) { ((EntityPlayerMP) aPlayer).getNextWindowId(); ((EntityPlayerMP) aPlayer).playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(((EntityPlayerMP) aPlayer).currentWindowId, 1, "Crafting", 9, true)); ((EntityPlayerMP) aPlayer).openContainer = new ContainerWorkbench(((EntityPlayerMP) aPlayer).inventory, ((EntityPlayerMP) aPlayer).worldObj, aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) { + @Override public boolean canInteractWith(EntityPlayer par1EntityPlayer) { return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index f2a37dd3cc..fbbaa32472 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -14,8 +14,8 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_DoesWork - extends GT_CoverBehavior { +public class GT_Cover_DoesWork extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aTileEntity instanceof IMachineProgress)) { if (aCoverVariable < 2) { @@ -34,6 +34,7 @@ public class GT_Cover_DoesWork return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4; if(aCoverVariable <0){aCoverVariable = 3;} @@ -46,34 +47,42 @@ public class GT_Cover_DoesWork return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } @@ -97,10 +106,10 @@ public class GT_Cover_DoesWork private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -135,6 +144,7 @@ public class GT_Cover_DoesWork updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (getClickable(btn.id)){ boolean state = false; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java index e26d7bb4a2..5fa2244761 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -14,8 +14,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_Drain - extends GT_CoverBehavior { +public class GT_Cover_Drain extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) { @@ -57,6 +57,7 @@ public class GT_Cover_Drain return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 6; if(aCoverVariable <0){aCoverVariable = 5;} @@ -71,14 +72,17 @@ public class GT_Cover_Drain return aCoverVariable; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return ((IMachineProgress) aTileEntity).isAllowedToWork() == aCoverVariable < 2; } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return aCoverVariable < 3 ? 50 : 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index d12034d3a7..3af57ad081 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -19,8 +19,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_EUMeter - extends GT_CoverBehavior { +public class GT_Cover_EUMeter extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { long tScale = 0L; if (aCoverVariable < 2) { @@ -96,6 +96,7 @@ public class GT_Cover_EUMeter return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; if(aCoverVariable <0){aCoverVariable = 11;} @@ -116,34 +117,42 @@ public class GT_Cover_EUMeter return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20; } @@ -167,10 +176,10 @@ public class GT_Cover_EUMeter private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -223,6 +232,7 @@ public class GT_Cover_EUMeter updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (btn.id == 6 || !isEnabled(btn.id)){ coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java index f5eaca9a74..6326cbbe41 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -7,8 +7,8 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_EnergyOnly - extends GT_CoverBehavior { +public class GT_Cover_EnergyOnly extends GT_CoverBehavior { + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + 1) % 3; switch(aCoverVariable) { @@ -19,18 +19,22 @@ public class GT_Cover_EnergyOnly return aCoverVariable; } + @Override public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20.0F; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork()) { @@ -40,6 +44,7 @@ public class GT_Cover_EnergyOnly return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork()) { @@ -49,34 +54,42 @@ public class GT_Cover_EnergyOnly return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return false; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return false; } + @Override public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } + @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index 39c87669f1..d68b29e61b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -16,131 +16,181 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; +/** + * Cover variable + * <pre> + * 1111 1111 1111 1111 1111 1111 1111 1111 + * |- interval-| |- flow rate 2 compl. -| + * ^ export? + * </pre> + * Concat export and flow rate 2 compl. together to get actual flow rate. + * A positive actual flow rate is export, and vice versa. + * <p> + * Interval is an unsigned 11 bit integer minus 1, so the range is 1~2048. + * The stored bits will be flipped bitwise if speed is negative. + * This way, `0` means 1tick interval, while `-1` means 1 tick interval as well, preserving the legacy behavior. + */ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { + private static final int SPEED_LENGTH = 20; + private static final int TICK_RATE_LENGTH = Integer.SIZE - SPEED_LENGTH - 1; + private static final int TICK_RATE_MIN = 1; + private static final int TICK_RATE_MAX = (-1 >>> (Integer.SIZE - TICK_RATE_LENGTH)) + TICK_RATE_MIN; + private static final int TICK_RATE_BITMASK = (TICK_RATE_MAX - TICK_RATE_MIN) << SPEED_LENGTH; + public final int mTransferRate; + private boolean allowFluid = false; public GT_Cover_FluidRegulator(int aTransferRate) { + if (aTransferRate > (-1 >>> (Integer.SIZE - SPEED_LENGTH))) + throw new IllegalArgumentException("aTransferRate too big: " + aTransferRate); this.mTransferRate = aTransferRate; } - public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { - if (aCoverVariable == 0) { + private static int getSpeed(int aCoverVariable) { + // positive or 0 -> interval bits need to be set to zero + // negative -> interval bits need to be set to one + return aCoverVariable >= 0 ? aCoverVariable & ~TICK_RATE_BITMASK : aCoverVariable | TICK_RATE_BITMASK; + } + + private static int getTickRate(int aCoverVariable) { + // range: TICK_RATE_MIN ~ TICK_RATE_MAX + return ((Math.abs(aCoverVariable) & TICK_RATE_BITMASK) >>> SPEED_LENGTH) + TICK_RATE_MIN; + } + + private static int generateNewCoverVariable(int aFlowRate, int aTickRate) { + int tToStoreRaw = aTickRate - TICK_RATE_MIN; + int tToStore = aFlowRate >= 0 ? tToStoreRaw : ~tToStoreRaw; + return aFlowRate & ~TICK_RATE_BITMASK | (tToStore << SPEED_LENGTH); + } + + @Override + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { + int tSpeed = getSpeed(aCoverVariable); + if (tSpeed == 0) { return aCoverVariable; } if ((aTileEntity instanceof IFluidHandler)) { IFluidHandler tTank1; IFluidHandler tTank2; - ForgeDirection directionFrom; - ForgeDirection directionTo; - if (aCoverVariable > 0) { + ForgeDirection directionFrom; + ForgeDirection directionTo; + if (tSpeed > 0) { tTank2 = aTileEntity.getITankContainerAtSide(aSide); tTank1 = (IFluidHandler) aTileEntity; - directionFrom = ForgeDirection.UNKNOWN; - directionTo = ForgeDirection.getOrientation(aSide).getOpposite(); + directionFrom = ForgeDirection.getOrientation(aSide); + directionTo = ForgeDirection.getOrientation(aSide).getOpposite(); } else { tTank1 = aTileEntity.getITankContainerAtSide(aSide); tTank2 = (IFluidHandler) aTileEntity; - directionFrom = ForgeDirection.getOrientation(aSide).getOpposite(); - directionTo = ForgeDirection.UNKNOWN; + directionFrom = ForgeDirection.getOrientation(aSide).getOpposite(); + directionTo = ForgeDirection.getOrientation(aSide); } if (tTank1 != null && tTank2 != null) { - FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aCoverVariable), false); + allowFluid = true; + FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(tSpeed), false); if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank2.fill(directionTo, tLiquid, false); if (tLiquid.amount > 0) { - if (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10)) { - if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { - aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); - tTank2.fill(directionTo, tTank1.drain(directionFrom, tLiquid.amount, true), true); - } - } else { - tTank2.fill(directionTo, tTank1.drain(directionFrom, tLiquid.amount, true), true); - } + tTank2.fill(directionTo, tTank1.drain(directionFrom, tLiquid.amount, true), true); } } + allowFluid = false; } } return aCoverVariable; } - public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aPlayer.isSneaking() ? 256 : 16; - } else { - aCoverVariable -= aPlayer.isSneaking() ? 256 : 16; - } - if (aCoverVariable > mTransferRate) { - aCoverVariable = mTransferRate; + private int adjustSpeed(EntityPlayer aPlayer, int aCoverVariable, int scale) { + int tSpeed = getSpeed(aCoverVariable); + tSpeed += scale; + int tTickRate = getTickRate(aCoverVariable); + if (Math.abs(tSpeed) > mTransferRate * tTickRate) { + tSpeed = mTransferRate * tTickRate * (tSpeed > 0 ? 1 : -1); + GT_Utility.sendChatToPlayer(aPlayer, trans("219", "Pump speed limit reached!")); } - if (aCoverVariable < (0 - mTransferRate)) { - aCoverVariable = (0 - mTransferRate); + if (tTickRate == 1) { + GT_Utility.sendChatToPlayer(aPlayer, + trans("048", "Pump speed: ") + tSpeed + trans("049", "L/tick ") + tSpeed * 20 + trans("050", "L/sec")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, + String.format(trans("207", "Pump speed: %dL every %d ticks, %.2f L/sec on average"), tSpeed, tTickRate, tSpeed * 20d / tTickRate)); } - GT_Utility.sendChatToPlayer(aPlayer, - trans("048", "Pump speed: ") + aCoverVariable + trans("049", "L/tick ") + aCoverVariable * 20 + trans("050", "L/sec")); - return aCoverVariable; + return generateNewCoverVariable(tSpeed, tTickRate); } - public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + @Override + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable++; + return adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? 256 : 16); } else { - aCoverVariable--; + return adjustSpeed(aPlayer, aCoverVariable, aPlayer.isSneaking() ? -256 : -16); } - if (aCoverVariable > mTransferRate) { - aCoverVariable = mTransferRate; - } - if (aCoverVariable < (0 - mTransferRate)) { - aCoverVariable = (0 - mTransferRate); + } + + @Override + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { + aCoverVariable = adjustSpeed(aPlayer, aCoverVariable, 1); + } else { + aCoverVariable = adjustSpeed(aPlayer, aCoverVariable, -1); } - GT_Utility.sendChatToPlayer(aPlayer, - trans("048", "Pump speed: ") + aCoverVariable + trans("049", "L/tick ") + aCoverVariable * 20 + trans("050", "L/sec")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return false; - } + return allowFluid; + } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return false; - } + return allowFluid; + } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } + return true; + } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 1; - } + return getTickRate(aCoverVariable); + } /** * GUI Stuff @@ -162,13 +212,16 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { private GT_GuiIntegerTextBox tBox, lBox; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; private int speed; private boolean export; + private int tickRate; + + private boolean warn = false; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -176,26 +229,32 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { this.coverID = aCoverID; this.coverVariable = aCoverVariable; - this.speed = Math.abs(coverVariable); - this.export = coverVariable >= 0; - new GT_GuiIconButton(this, 0,startX + spaceX*0,startY+spaceY*0, GT_GuiIcon.EXPORT).setTooltipText(trans("006","Export")); - new GT_GuiIconButton(this, 1,startX + spaceX*1,startY+spaceY*0, GT_GuiIcon.IMPORT).setTooltipText(trans("007","Import")); + int speed = getSpeed(coverVariable); + this.speed = Math.abs(speed); + this.export = speed >= 0; + this.tickRate = getTickRate(coverVariable); + new GT_GuiIconButton(this, 0, startX + spaceX * 0, startY + spaceY * 0, GT_GuiIcon.EXPORT).setTooltipText(trans("006", "Export")); + new GT_GuiIconButton(this, 1, startX + spaceX * 1, startY + spaceY * 0, GT_GuiIcon.IMPORT).setTooltipText(trans("007", "Import")); - tBox = new GT_GuiIntegerTextBox(this, 2,startX + spaceX*0,startY+spaceY*1 + 2, spaceX*4-3,12); - tBox.setText(String.valueOf(speed)); + tBox = new GT_GuiIntegerTextBox(this, 2, startX + spaceX * 0, startY + spaceY * 1 + 2, spaceX * 4 - 3, 12); + tBox.setText(String.valueOf(this.speed)); tBox.setMaxStringLength(10); - lBox = new GT_GuiIntegerTextBox(this, 3,startX + spaceX*0,startY+spaceY*2 + 2, spaceX*4-3,12); - lBox.setText(String.valueOf(speed*20L)); - lBox.setMaxStringLength(10); + lBox = new GT_GuiIntegerTextBox(this, 3, startX + spaceX * 0, startY + spaceY * 2 + 2, spaceX * 4 - 3, 12); + lBox.setText(String.valueOf(this.tickRate)); + lBox.setMaxStringLength(4); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.getFontRenderer().drawString(trans("229","Import/Export" ), startX + spaceX*4, 4+startY+spaceY*0, 0xFF555555); - this.getFontRenderer().drawString(trans("049", "L/tick "), startX + spaceX*4, 4+startY+spaceY*1, 0xFF555555); - this.getFontRenderer().drawString(trans("050", "L/sec"), startX + spaceX*4, 4+startY+spaceY*2, 0xFF555555); + this.getFontRenderer().drawString(trans("229", "Import/Export"), startX + spaceX * 4, 4 + startY + spaceY * 0, 0xFF555555); + this.getFontRenderer().drawString(trans("200", " L"), startX + spaceX * 4, 4 + startY + spaceY * 1, 0xFF555555); + this.getFontRenderer().drawString(trans("209", " ticks"), startX + spaceX * 4, 4 + startY + spaceY * 2, 0xFF555555); + if (warn) + this.getFontRenderer().drawString(String.format(trans("210", "Average: %.2f L/sec"), speed * 20d / tickRate), startX + spaceX * 0, 4 + startY + spaceY * 3, 0xffff0000); + else + this.getFontRenderer().drawString(String.format(trans("210", "Average: %.2f L/sec"), speed * 20d / tickRate), startX + spaceX * 0, 4 + startY + spaceY * 3, 0xFF555555); } @Override @@ -204,7 +263,8 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { tBox.setFocused(true); } - public void buttonClicked(GuiButton btn){ + @Override + public void buttonClicked(GuiButton btn){ if (getClickable(btn.id)){ coverVariable = getNewCoverVariable(btn.id); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); @@ -247,18 +307,27 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { return; } - if (box.id == 3) - i = i / 20; - - if (i > mTransferRate) - i = mTransferRate; - else if (i <= 0) - i = 0; - - speed = (int) i; - - tBox.setText(String.valueOf(speed)); - lBox.setText(String.valueOf(speed*20)); + warn = false; + if (box.id == 2) { + if (i > (long) mTransferRate * tickRate) { + i = (long) mTransferRate * tickRate; + warn = true; + } else if (i < 0) { + i = 0; + } + speed = (int) i; + } else if (box.id == 3) { + if (i > TICK_RATE_MAX) { + i = tickRate; + } else if (speed > mTransferRate * i) { + i = Math.min(TICK_RATE_MAX, (speed + mTransferRate - 1) / mTransferRate); + warn = true; + } else if (i < TICK_RATE_MIN) { + i = 1; + } + tickRate = (int) i; + } + box.setText(String.valueOf(i)); coverVariable = getNewCoverVariable(2); GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); @@ -266,7 +335,10 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { @Override public void resetTextBox(GT_GuiIntegerTextBox box) { - box.setText(String.valueOf(speed)); + if (box.id == 2) + box.setText(String.valueOf(speed)); + else if (box.id == 3) + box.setText(String.valueOf(tickRate)); } private void updateButtons(){ @@ -281,15 +353,12 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior { switch (id) { case 0: export = true; - return speed; + return generateNewCoverVariable(speed, tickRate); case 1: export = false; - return -speed; + return generateNewCoverVariable(-speed, tickRate); case 2: - if (export) - return speed; - else - return -speed; + return generateNewCoverVariable(export ? speed : -speed, tickRate); } return coverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index bc966d3f54..0c0cb27d1f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -28,6 +28,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { private final int ANY_INPUT_FILTER_OUTPUT = 6; // 110 private final int ANY_INPUT_INVERT_OUTPUT = 7; // 111 + @Override public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { int aFilterMode = aCoverVariable & 7; int aFilterFluid = aCoverVariable >>> 3; @@ -39,6 +40,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @@ -58,6 +60,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { int aFilterMode = aCoverVariable & 7; aCoverVariable ^= aFilterMode; @@ -73,6 +76,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { return aCoverVariable; } + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { //GT_FML_LOGGER.info("rightclick"); if ( @@ -143,10 +147,12 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 0; } @@ -171,10 +177,10 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { private final GT_GuiFakeItemButton fluidFilterButton; protected String fluidFilterName; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GT_FluidFilterGUICover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -239,6 +245,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (getClickable(btn.id)){ coverVariable = getNewCoverVariable(btn.id); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java new file mode 100644 index 0000000000..90c09f8168 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java @@ -0,0 +1,223 @@ +package gregtech.common.covers; + +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiFakeItemButton; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.net.GT_Packet_TileEntityCover; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.Fluid; + +import java.util.Collections; +import java.util.List; + +import static gregtech.api.util.GT_Utility.*; + +public class GT_Cover_ItemFilter extends GT_CoverBehavior { + + private final boolean mExport; + + public GT_Cover_ItemFilter(boolean isExport){ + this.mExport = isExport; + } + + @Override + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); + Object fromEntity = mExport ? aTileEntity : tTileEntity, + toEntity = !mExport ? aTileEntity : tTileEntity; + byte fromSide = !mExport ? GT_Utility.getOppositeSide(aSide) : aSide, + toSide = mExport ? GT_Utility.getOppositeSide(aSide) : aSide; + + int FilterId = aCoverVariable >>> 1; + List<ItemStack> Filter = Collections.singletonList(intToStack(FilterId)); + + boolean isWhiteList = (aCoverVariable & 1) != 0; + + moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, Filter, isWhiteList, (byte) 64, (byte) 1, (byte) 64, (byte) 1,64); + + return aCoverVariable; + } + + @Override + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ){ + ItemStack tStack = aPlayer.inventory.getCurrentItem(); + if (tStack != null){ + aCoverVariable = (stackToInt(tStack) << 1) + (aCoverVariable & 1); + aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); + GT_Utility.sendChatToPlayer(aPlayer, trans("301", "Item Filter: ") + tStack.getDisplayName()); + } + else{ + aCoverVariable = aCoverVariable & 1; + aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); + GT_Utility.sendChatToPlayer(aPlayer, trans("300", "Filter Cleared!")); + } + return true; + } + + @Override + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + int mode = aCoverVariable & 1; + if (mode == 1) mode = 0; + else mode = 1; + if (mode == 1){ + GT_Utility.sendChatToPlayer(aPlayer, trans("124", "Blacklist Mode")); + } + else{ + GT_Utility.sendChatToPlayer(aPlayer, trans("125", "Whitelist Mode")); + } + aCoverVariable = (aCoverVariable & ~0x1) + mode; + return aCoverVariable; + } + + @Override + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return false; + } + + @Override + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return false; + } + + @Override + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return 1; + } + + /** + * GUI Stuff + */ + + @Override + public boolean hasCoverGUI() { + return true; + } + + @Override + public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + return new GT_Cover_ItemFilter.GUI(aSide, aCoverID, coverData, aTileEntity); + } + + private class GUI extends GT_GUICover { + private final byte side; + private final int coverID; + private int coverVariable; + private final GT_GuiFakeItemButton itemFilterButtons; + + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; + + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); + this.side = aSide; + this.coverID = aCoverID; + this.coverVariable = aCoverVariable; + + GT_GuiIconButton b; + b = new GT_GuiIconButton(this, 0, startX + spaceX*0, startY+spaceY*0, GT_GuiIcon.WHITELIST).setTooltipText(trans("125","Whitelist Mode")); + b = new GT_GuiIconButton(this, 1, startX + spaceX*1, startY+spaceY*0, GT_GuiIcon.BLACKLIST).setTooltipText(trans("124","Blacklist Mode")); + + itemFilterButtons = new GT_GuiFakeItemButton(this ,startX + spaceX*0, startY+spaceY*2, GT_GuiIcon.SLOT_GRAY); + } + + @Override + public void drawExtras(int mouseX, int mouseY, float parTicks) { + super.drawExtras(mouseX, mouseY, parTicks); + this.fontRendererObj.drawString(trans("303", "Filter: "), startX + spaceX*0, 3+startY+spaceY*1, 0xFF555555); + this.fontRendererObj.drawString(trans("302", "Check Mode"), startX + spaceX*2, 3+startY+spaceY*0, 0xFF555555); + } + + @Override + protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { + updateButtons(); + } + + @Override + public void buttonClicked(GuiButton btn){ + if (getClickable(btn.id)){ + coverVariable = getNewCoverVariable(btn.id); + GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + } + updateButtons(); + } + + private void updateButtons(){ + GuiButton b; + for (Object o : buttonList) { + b = (GuiButton) o; + b.enabled = getClickable(b.id); + } + ItemStack tItemStack = intToStack(coverVariable >>> 1); + if (tItemStack != null){ + itemFilterButtons.setItem(tItemStack); + return; + } + itemFilterButtons.setItem(null); + } + + private int getNewCoverVariable(int id) { + switch (id) { + case 0: + return coverVariable & ~0x1; + case 1: + return coverVariable | 0x1; + } + return coverVariable; + } + + private boolean getClickable(int id) { + switch (id) { + case 0: + return (0x1 & coverVariable) != 0; + case 1: + return (0x1 & coverVariable) == 0; + } + return false; + } + } +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 83b03b65a5..5d26f2079e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -10,20 +10,22 @@ import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalChestBase; + import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_ItemMeter - extends GT_CoverBehavior { +public class GT_Cover_ItemMeter extends GT_CoverBehavior { // format: private static final int SLOT_MASK = 0x3FFFFFF; // 0 = all, 1 = 0 ... private static final int CONVERTED_BIT = 0x80000000; private static final int INVERT_BIT = 0x40000000; + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { //Convert from ver. 5.09.33.50 if ((CONVERTED_BIT & aCoverVariable) == 0) @@ -34,20 +36,26 @@ public class GT_Cover_ItemMeter else if (aCoverVariable > 1) aCoverVariable = CONVERTED_BIT | Math.min((aCoverVariable - 2), SLOT_MASK); - int[] tSlots; - if ((aCoverVariable & SLOT_MASK) > 0) - tSlots = new int[]{(aCoverVariable & SLOT_MASK) - 1}; - else - tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); - - int tMax = 0; - int tUsed = 0; - for (int i : tSlots) { - if (i >= 0 && i < aTileEntity.getSizeInventory()) { - tMax+=64; - ItemStack tStack = aTileEntity.getStackInSlot(i); - if (tStack != null) - tUsed += (tStack.stackSize<<6)/tStack.getMaxStackSize(); + long tMax = 0; + long tUsed = 0; + if (aTileEntity instanceof GT_MetaTileEntity_DigitalChestBase) { + GT_MetaTileEntity_DigitalChestBase dc = (GT_MetaTileEntity_DigitalChestBase)aTileEntity; + tMax = dc.getMaxItemCount(); // currently it is limited by int, but there is not much reason for that + ItemStack[] inv = dc.getStoredItemData(); + if (inv != null && inv.length > 1 && inv[1] != null) + tUsed = inv[1].stackSize; + } else { + int[] tSlots = (aCoverVariable & SLOT_MASK) > 0 ? + new int[] {(aCoverVariable & SLOT_MASK) - 1} : + aTileEntity.getAccessibleSlotsFromSide(aSide); + + for (int i : tSlots) { + if (i >= 0 && i < aTileEntity.getSizeInventory()) { + tMax += 64; + ItemStack tStack = aTileEntity.getStackInSlot(i); + if (tStack != null) + tUsed += (tStack.stackSize << 6) / tStack.getMaxStackSize(); + } } } @@ -61,6 +69,7 @@ public class GT_Cover_ItemMeter return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { if ((aCoverVariable & INVERT_BIT) == INVERT_BIT) { @@ -85,34 +94,42 @@ public class GT_Cover_ItemMeter return CONVERTED_BIT | (aCoverVariable & INVERT_BIT) | slot; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } @@ -139,10 +156,10 @@ public class GT_Cover_ItemMeter private final GT_GuiFakeItemButton intSlotIcon; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; private final int maxSlot; @@ -169,7 +186,7 @@ public class GT_Cover_ItemMeter else maxSlot = -1; - if (maxSlot == -1) + if (maxSlot == -1 || tile instanceof GT_MetaTileEntity_DigitalChestBase) intSlot.setEnabled(false); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java index 85f61e8b74..347a6acfcc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java @@ -3,14 +3,14 @@ package gregtech.common.covers; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; -public class GT_Cover_Lens - extends GT_CoverBehavior { +public class GT_Cover_Lens extends GT_CoverBehavior { private final byte mColor; public GT_Cover_Lens(byte aColor) { this.mColor = aColor; } + @Override public byte getLensColor(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return this.mColor; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 9ca2f77d62..9fa819cd33 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -16,8 +16,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_LiquidMeter - extends GT_CoverBehavior { +public class GT_Cover_LiquidMeter extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aTileEntity instanceof IFluidHandler)) { FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN); @@ -46,6 +46,7 @@ public class GT_Cover_LiquidMeter return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aCoverVariable == 0) { GT_Utility.sendChatToPlayer(aPlayer, trans("055", "Normal")); @@ -55,34 +56,42 @@ public class GT_Cover_LiquidMeter return aCoverVariable == 0 ? 1 : 0; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 5; } @@ -105,10 +114,10 @@ public class GT_Cover_LiquidMeter private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -135,6 +144,7 @@ public class GT_Cover_LiquidMeter updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ boolean state = false; if (btn.id == 0) @@ -164,4 +174,4 @@ public class GT_Cover_LiquidMeter return coverVariable; } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index 43160aa908..5a5d02b71d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -23,6 +23,7 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { return !(aRotor == null || !(aRotor.getItem() instanceof GT_MetaGenerated_Tool) || aRotor.getItemDamage() < 170 || aRotor.getItemDamage() > 176); } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { boolean needsRepair = false; if (aTileEntity instanceof IGregTechTileEntity) { @@ -62,6 +63,7 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking() ? -1 : 1)) % 14; if (aCoverVariable < 0) { @@ -114,34 +116,42 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 60; } @@ -187,10 +197,10 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { trans("NORMAL","Normal"), }; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -231,6 +241,7 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (btn.id == 7 || !isEnabled(btn.id)){ coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index 57f52ab42d..5857c92dab 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -19,6 +19,7 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private String placer = ""; private int range = 8; + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { boolean playerDetected = false; @@ -58,6 +59,7 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3; if(aCoverVariable <0){aCoverVariable = 2;} @@ -69,34 +71,42 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20; } @@ -119,10 +129,10 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -154,6 +164,7 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (!isEnabled(btn.id)){ coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index a6f7d653b9..a5b860c0a4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -16,14 +16,14 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_Pump - extends GT_CoverBehavior{ +public class GT_Cover_Pump extends GT_CoverBehavior{ public final int mTransferRate; public GT_Cover_Pump(int aTransferRate) { this.mTransferRate = aTransferRate; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { @@ -40,15 +40,8 @@ public class GT_Cover_Pump if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); - if (tLiquid.amount > 0) { - if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { - if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { - aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); - tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); - } - } else { - tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); - } + if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { + tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); } } } else { @@ -56,15 +49,8 @@ public class GT_Cover_Pump if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); - if (tLiquid.amount > 0) { - if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { - if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { - aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); - tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); - } - } else { - tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); - } + if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { + tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); } } } @@ -73,6 +59,11 @@ public class GT_Cover_Pump return aCoverVariable; } + protected boolean canTransferFluid(FluidStack fluid) { + return true; + } + + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; if(aCoverVariable <0){aCoverVariable = 11;} @@ -93,30 +84,37 @@ public class GT_Cover_Pump return aCoverVariable; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { @@ -126,6 +124,7 @@ public class GT_Cover_Pump return (aCoverVariable >= 6) || (aCoverVariable % 2 != 0); } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { @@ -135,10 +134,12 @@ public class GT_Cover_Pump return (aCoverVariable >= 6) || (aCoverVariable % 2 == 0); } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } @@ -162,10 +163,10 @@ public class GT_Cover_Pump private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GT_PumpGUICover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -196,6 +197,7 @@ public class GT_Cover_Pump updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (getClickable(btn.id)){ coverVariable = getNewCoverVariable(btn.id); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java index d942c944aa..41d1861ca1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -6,8 +6,8 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_RedstoneConductor - extends GT_CoverBehavior { +public class GT_Cover_RedstoneConductor extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aCoverVariable == 0) { aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getStrongestRedstone()); @@ -17,6 +17,7 @@ public class GT_Cover_RedstoneConductor return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 7; if(aCoverVariable <0){aCoverVariable = 6;} @@ -32,34 +33,42 @@ public class GT_Cover_RedstoneConductor return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java index d76cda3ede..0bf008419b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java @@ -3,17 +3,19 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneReceiverExternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneReceiverExternal extends GT_Cover_RedstoneWirelessBase { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { aTileEntity.setOutputRedstoneSignal(aSide, GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue()); return aCoverVariable; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java index 84f0ba36f7..2173014509 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java @@ -4,8 +4,8 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; -public class GT_Cover_RedstoneReceiverInternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneReceiverInternal extends GT_Cover_RedstoneWirelessBase { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aTileEntity instanceof IMachineProgress) { if (getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity) >0) @@ -17,10 +17,12 @@ public class GT_Cover_RedstoneReceiverInternal return aCoverVariable; } + @Override public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue(); } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index 114fd8b3dc..cf322e78f1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -7,8 +7,8 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_RedstoneSignalizer - extends GT_CoverBehavior { +public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior { + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + 1) % 48; switch(aCoverVariable / 16) { @@ -19,34 +19,42 @@ public class GT_Cover_RedstoneSignalizer return aCoverVariable; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { if (aCoverVariable < 16) { return (byte) (aCoverVariable & 0xF); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java index d4a334e18e..cd8f1f4ffc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java @@ -3,17 +3,19 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneTransmitterExternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneTransmitterExternal extends GT_Cover_RedstoneWirelessBase { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aInputRedstone)); return aCoverVariable; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java index f632561994..1c683966f9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -3,21 +3,24 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneTransmitterInternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirelessBase { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide))); return aCoverVariable; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index 1407311b88..93a729d0c2 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -3,26 +3,38 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; +import gregtech.api.gui.widgets.GT_GuiIcon; +import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.interfaces.IGuiScreen; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCover; +import gregtech.api.net.GT_Packet_WirelessRedstoneCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public abstract class GT_Cover_RedstoneWirelessBase - extends GT_CoverBehavior { +public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { + + private static final int MAX_CHANNEL = 65535; + private static final int PRIVATE_MASK = 0xFFFE0000; + private static final int PUBLIC_MASK = 0x0000FFFF; + private static final int CHECKBOX_MASK = 0x00010000; + + @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0)); return true; } + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D)))) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0)); - aCoverVariable = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem()); + aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | (((Integer)GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem())).hashCode() & PUBLIC_MASK); + aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); GT_Utility.sendChatToPlayer(aPlayer, trans("081", "Frequency: ") + aCoverVariable); return true; @@ -30,56 +42,80 @@ public abstract class GT_Cover_RedstoneWirelessBase return false; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((((aZ <= 0.375D) || (aZ >= 0.625D))))))) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0)); float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); + + short tAdjustVal = 0; + switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) { case 0: - aCoverVariable -= 32; + tAdjustVal = -32; break; case 1: - aCoverVariable += 32; + tAdjustVal = 32; break; case 2: - aCoverVariable -= 1024; + tAdjustVal = -1024; break; case 3: - aCoverVariable += 1024; + tAdjustVal = 1024; + } + + int tPublicChannel = (aCoverVariable & PUBLIC_MASK) + tAdjustVal; + + if (tPublicChannel < 0) { + aCoverVariable = aCoverVariable & ~PUBLIC_MASK; + } + else if (tPublicChannel > MAX_CHANNEL) { + aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | MAX_CHANNEL; + } + else { + aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | tPublicChannel; } } GT_Utility.sendChatToPlayer(aPlayer, trans("081", "Frequency: ") + aCoverVariable); return aCoverVariable; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return true; } + @Override public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return trans("081", "Frequency: ") + aCoverVariable; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } @@ -103,10 +139,10 @@ public abstract class GT_Cover_RedstoneWirelessBase private GT_GuiIntegerTextBox fBox; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { @@ -115,21 +151,25 @@ public abstract class GT_Cover_RedstoneWirelessBase this.coverID = aCoverID; this.coverVariable = aCoverVariable; - fBox = new GT_GuiIntegerTextBoxWithMinus(this, 2,startX + spaceX*0,startY+spaceY*0 + 2, spaceX*4-3,12); - fBox.setText(String.valueOf(coverVariable)); + fBox = new GT_GuiShortTextBox(this, 2,startX + spaceX*0,startY+spaceY*0 + 2, spaceX*4-3,12); + fBox.setText(String.valueOf(coverVariable & PUBLIC_MASK)); fBox.setMaxStringLength(12); + GuiButton b; + b = new GT_GuiIconCheckButton(this, 0, startX + spaceX * 0, startY + spaceY * 2, GT_GuiIcon.CHECKMARK, null); } @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); this.getFontRenderer().drawString(trans("246","Frequency" ), startX + spaceX*4, 4+startY+spaceY*0, 0xFF555555); + this.getFontRenderer().drawString(trans("601", "Use Private Frequency"), startX + spaceX * 1, startY + spaceY * 2 + 4, 0xFF555555); } @Override protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { fBox.setFocused(true); + ((GT_GuiIconCheckButton) buttonList.get(0)).setChecked((coverVariable & CHECKBOX_MASK) > 0); } @Override @@ -138,19 +178,19 @@ public abstract class GT_Cover_RedstoneWirelessBase if (box.isFocused()) { int step = Math.max(1, Math.abs(delta / 120)); step = (isShiftKeyDown() ? 1000 : isCtrlKeyDown() ? 50 : 1) * (delta > 0 ? step : -step); - long i; + long tCoverVariable; try { - i = Long.parseLong(box.getText()); + tCoverVariable = Long.parseLong(box.getText()); } catch (NumberFormatException e) { return; } - i = i + step; - if (i > Integer.MAX_VALUE) - i = Integer.MAX_VALUE; - else if (i < Integer.MIN_VALUE) - i = Integer.MIN_VALUE; + tCoverVariable = tCoverVariable + step; + if (tCoverVariable > MAX_CHANNEL) + tCoverVariable = MAX_CHANNEL; + else if (tCoverVariable < 0) + tCoverVariable = 0; - box.setText(String.valueOf(i)); + box.setText(String.valueOf(tCoverVariable)); return; } } @@ -158,42 +198,84 @@ public abstract class GT_Cover_RedstoneWirelessBase @Override public void applyTextBox(GT_GuiIntegerTextBox box) { - long i; + int tPublicChannel; String s = box.getText().trim(); try { - i = Long.parseLong(s); + tPublicChannel = Integer.parseInt(s); } catch (NumberFormatException e) { resetTextBox(box); return; } - if (i > Integer.MAX_VALUE) - i = Integer.MAX_VALUE; - else if (i < Integer.MIN_VALUE) - i = Integer.MIN_VALUE; + if (tPublicChannel > MAX_CHANNEL) + tPublicChannel = MAX_CHANNEL; + else if (tPublicChannel < 0) + tPublicChannel = 0; + int tCheckBoxValue = ((GT_GuiIconCheckButton)this.buttonList.get(0)).isChecked() ? CHECKBOX_MASK : 0; - coverVariable = (int) i; - fBox.setText(String.valueOf(coverVariable)); - GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); + coverVariable = tCheckBoxValue | tPublicChannel; + + fBox.setText(Integer.toString(tPublicChannel)); + GT_Values.NW.sendToServer(new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); } @Override public void resetTextBox(GT_GuiIntegerTextBox box) { - box.setText(String.valueOf(coverVariable)); + box.setText(String.valueOf(coverVariable & PUBLIC_MASK)); + } + + @Override + public void buttonClicked(GuiButton btn) { + + final GT_GuiIconCheckButton tBtn = (GT_GuiIconCheckButton) btn; + + tBtn.setChecked(!tBtn.isChecked()); + + int tPublicChannel = 0; + String tText = fBox.getText().trim(); + + if (tText.length() > 0) { + tPublicChannel = Integer.parseInt(tText); + } + + int tCheckBoxValue = tBtn.isChecked() ? CHECKBOX_MASK : 0; + + coverVariable = tCheckBoxValue | tPublicChannel; + + GT_Values.NW.sendToServer(new GT_Packet_WirelessRedstoneCover(side, coverID, tile, tPublicChannel, tCheckBoxValue)); } - private class GT_GuiIntegerTextBoxWithMinus extends GT_GuiIntegerTextBox { + private class GT_GuiShortTextBox extends GT_GuiIntegerTextBox { - public GT_GuiIntegerTextBoxWithMinus(IGuiScreen gui, int id, int x, int y, int width, int height) { + public GT_GuiShortTextBox(IGuiScreen gui, int id, int x, int y, int width, int height) { super(gui, id, x, y, width, height); } @Override - public boolean validChar(char c, int key) { - if (getCursorPosition() == 0 && key == 12) // minus first allowed. - return true; - return super.validChar(c, key); + public boolean textboxKeyTyped(char c, int key) { + int tValue = 0; + + if(!super.textboxKeyTyped(c, key)) + return false; + + int cursorPos = this.getCursorPosition(); + + String tText = getText().trim(); + if (tText.length() > 0) { + try { + tValue = Integer.parseInt(tText); + } catch (NumberFormatException ignored) {} + + if (tValue > MAX_CHANNEL) + setText(String.valueOf(MAX_CHANNEL)); + else + setText(String.valueOf(tValue)); + + setCursorPosition(cursorPos); + } + + return true; } } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java index 866102212c..afa79b5993 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java @@ -5,60 +5,73 @@ import gregtech.api.util.GT_CoverBehavior; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Screen - extends GT_CoverBehavior { +public class GT_Cover_Screen extends GT_CoverBehavior { + @Override public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20.0F; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { return false; } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return false; } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { return false; } + @Override public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; } + @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } + @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { return true; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return 0; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index b1c0c5c3af..fbf5ccca33 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -13,12 +13,13 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Shutter - extends GT_CoverBehavior { +public class GT_Cover_Shutter extends GT_CoverBehavior { + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return aCoverVariable; } + @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4; if(aCoverVariable <0){aCoverVariable = 3;} @@ -31,42 +32,52 @@ public class GT_Cover_Shutter return aCoverVariable; } + @Override public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } + @Override public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } + @Override public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } + @Override public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } + @Override public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } + @Override public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } + @Override public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } + @Override public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 0; } @@ -90,10 +101,10 @@ public class GT_Cover_Shutter private final int coverID; private int coverVariable; - private final static int startX = 10; - private final static int startY = 25; - private final static int spaceX = 18; - private final static int spaceY = 18; + private static final int startX = 10; + private static final int startY = 25; + private static final int spaceX = 18; + private static final int spaceY = 18; public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); @@ -125,6 +136,7 @@ public class GT_Cover_Shutter updateButtons(); } + @Override public void buttonClicked(GuiButton btn){ if (!isEnabled(btn.id)){ coverVariable = getNewCoverVariable(btn.id, ((GT_GuiIconCheckButton) btn).isChecked()); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java index f7c7a95ca3..001dc3c023 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java @@ -9,14 +9,14 @@ import net.minecraft.item.ItemStack; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -public class GT_Cover_SolarPanel - extends GT_CoverBehavior { +public class GT_Cover_SolarPanel extends GT_CoverBehavior { private final int mVoltage; public GT_Cover_SolarPanel(int aVoltage) { this.mVoltage = aVoltage; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if(aSide != 1)return 0; int coverState=aCoverVariable&0x3; @@ -43,7 +43,7 @@ public class GT_Cover_SolarPanel } } } - if (coverState == 1 /*|| (coverState == 2 && aTimer % 8L == 0L)*/) { + if (coverState == 1 ) { aTileEntity.injectEnergyUnits((byte) 6, ((100L-(long)coverNum)*((long)this.mVoltage))/100L, 1L); } @@ -74,10 +74,12 @@ public class GT_Cover_SolarPanel return false; } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 1; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java new file mode 100644 index 0000000000..8ac8a0dae9 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java @@ -0,0 +1,16 @@ +package gregtech.common.covers; + +import gregtech.api.util.GT_ModHandler; +import net.minecraftforge.fluids.FluidStack; + +public class GT_Cover_SteamValve extends GT_Cover_Pump { + + public GT_Cover_SteamValve(int aTransferRate) { + super(aTransferRate); + } + + @Override + protected boolean canTransferFluid(FluidStack fluid) { + return GT_ModHandler.isAnySteam(fluid); + } +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java index 598188138f..869235e011 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java @@ -5,14 +5,14 @@ import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; -public class GT_Cover_Vent - extends GT_CoverBehavior { +public class GT_Cover_Vent extends GT_CoverBehavior { private final int mEfficiency; public GT_Cover_Vent(int aEfficiency) { this.mEfficiency = aEfficiency; } + @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aTileEntity instanceof IMachineProgress)) { if ((((IMachineProgress) aTileEntity).hasThingsToDo()) && (aCoverVariable != ((IMachineProgress) aTileEntity).getProgress()) && @@ -24,10 +24,12 @@ public class GT_Cover_Vent return 0; } + @Override public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } + @Override public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 100; } diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java index 814ab3f8fa..b7c87b4860 100644 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java @@ -4,6 +4,7 @@ import com.mojang.authlib.GameProfile; import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; @@ -29,8 +30,7 @@ import net.minecraftforge.common.util.FakePlayerFactory; import java.util.List; import java.util.UUID; -public class GT_Entity_Arrow - extends EntityArrow { +public class GT_Entity_Arrow extends EntityArrow { private int mHitBlockX = -1; private int mHitBlockY = -1; private int mHitBlockZ = -1; @@ -62,6 +62,7 @@ public class GT_Entity_Arrow setArrowItem(aStack); } + @Override public void onUpdate() { onEntityUpdate(); if ((this.mArrow == null) && (!this.worldObj.isRemote)) { @@ -242,10 +243,19 @@ public class GT_Entity_Arrow } } } + WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setWorld(this.worldObj); + if (getIsCritical()) { - for (int i = 0; i < 4; i++) { - this.worldObj.spawnParticle("crit", this.posX + this.motionX * i / 4.0D, this.posY + this.motionY * i / 4.0D, this.posZ + this.motionZ * i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); - } + events.setIdentifier("crit") + .setMotion(-this.motionX, -this.motionY + 0.2D, -this.motionZ) + .<WorldSpawnedEventBuilder.ParticleEventBuilder>times(4, (x, i) -> + x.setPosition( + this.posX + this.motionX * i / 4.0D, + this.posY + this.motionY * i / 4.0D, + this.posZ + this.motionZ * i / 4.0D + ).run() + ); } this.posX += this.motionX; this.posY += this.motionY; @@ -267,9 +277,14 @@ public class GT_Entity_Arrow this.rotationYaw = (this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F); float tFrictionMultiplier = 0.99F; if (isInWater()) { - for (int l = 0; l < 4; l++) { - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ); - } + events.setMotion(-this.motionX, -this.motionY + 0.2D, -this.motionZ) + .setIdentifier("bubble") + .setPosition( + this.posX - this.motionX * 0.25D, + this.posY - this.motionY * 0.25D, + this.posZ - this.motionZ * 0.25D + ) + .times(4, Runnable::run); tFrictionMultiplier = 0.8F; } if (isWet()) { @@ -284,6 +299,7 @@ public class GT_Entity_Arrow } } + @Override public void writeEntityToNBT(NBTTagCompound aNBT) { super.writeEntityToNBT(aNBT); aNBT.setShort("xTile", (short) this.mHitBlockX); @@ -299,6 +315,7 @@ public class GT_Entity_Arrow aNBT.setTag("mArrow", this.mArrow == null ? null : this.mArrow.writeToNBT(new NBTTagCompound())); } + @Override public void readEntityFromNBT(NBTTagCompound aNBT) { super.readEntityFromNBT(aNBT); this.mHitBlockX = aNBT.getShort("xTile"); @@ -314,6 +331,7 @@ public class GT_Entity_Arrow this.mArrow = GT_Utility.loadItem(aNBT, "mArrow"); } + @Override public void onCollideWithPlayer(EntityPlayer aPlayer) { if ((!this.worldObj.isRemote) && (this.inGround) && (this.arrowShake <= 0) && (this.canBePickedUp == 1) && (aPlayer.inventory.addItemStackToInventory(getArrowItem()))) { playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); @@ -327,17 +345,18 @@ public class GT_Entity_Arrow } public ItemStack getArrowItem() { - return GT_Utility.copy(new Object[]{this.mArrow}); + return GT_Utility.copy(this.mArrow); } public void setArrowItem(ItemStack aStack) { - this.mArrow = GT_Utility.updateItemStack(GT_Utility.copyAmount(1L, new Object[]{aStack})); + this.mArrow = GT_Utility.updateItemStack(GT_Utility.copyAmount(1L, aStack)); } public boolean breaksOnImpact() { return false; } + @Override public void setKnockbackStrength(int aKnockback) { this.mKnockback = aKnockback; } diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java index d026f8184b..ccf645bf1c 100644 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java @@ -7,8 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -public class GT_Entity_Arrow_Potion - extends GT_Entity_Arrow { +public class GT_Entity_Arrow_Potion extends GT_Entity_Arrow { private int[] mPotions = new int[0]; public GT_Entity_Arrow_Potion(World aWorld) { @@ -23,16 +22,19 @@ public class GT_Entity_Arrow_Potion super(aWorld, aEntity, aSpeed); } + @Override public void writeEntityToNBT(NBTTagCompound aNBT) { super.writeEntityToNBT(aNBT); aNBT.setIntArray("mPotions", this.mPotions); } + @Override public void readEntityFromNBT(NBTTagCompound aNBT) { super.readEntityFromNBT(aNBT); setPotions(aNBT.getIntArray("mPotions")); } + @Override public boolean breaksOnImpact() { return true; } @@ -47,6 +49,7 @@ public class GT_Entity_Arrow_Potion } } + @Override public int[] onHitEntity(Entity aHitEntity, Entity aShootingEntity, ItemStack aArrow, int aRegularDamage, int aMagicDamage, int aKnockback, int aFireDamage, int aHitTimer) { if ((aHitEntity instanceof EntityLivingBase)) { for (int i = 3; i < this.mPotions.length; i += 4) { diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java index 70c4fc7b5b..f8c784fb70 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java @@ -9,10 +9,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -import java.util.Iterator; - -public class GT_Container_Boiler - extends GT_ContainerMetaTile_Machine { +public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine { private int mSteamCapacity = 0;//FB: UR - UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR public int mWaterAmount = 0; public int mSteamAmount = 0; @@ -23,6 +20,7 @@ public class GT_Container_Boiler this.mSteamCapacity = aSteamCapacity; } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62)); addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26)); @@ -30,14 +28,17 @@ public class GT_Container_Boiler addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26)); } + @Override public int getSlotCount() { return 4; } + @Override public int getShiftClickSlotCount() { return 1; } + @Override public void detectAndSendChanges() { super.detectAndSendChanges(); if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { @@ -53,9 +54,8 @@ public class GT_Container_Boiler this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / 15900)); this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); - Iterator var2 = this.crafters.iterator(); - while (var2.hasNext()) { - ICrafting var1 = (ICrafting) var2.next(); + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; var1.sendProgressBarUpdate(this, 100, this.mTemperature); var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy); var1.sendProgressBarUpdate(this, 102, this.mSteamAmount); @@ -63,6 +63,7 @@ public class GT_Container_Boiler } } + @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); diff --git a/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java index 41e63a78ec..ac2f18f561 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java @@ -6,12 +6,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; -public class GT_Container_BronzeBlastFurnace - extends GT_ContainerMetaTile_Machine { +public class GT_Container_BronzeBlastFurnace extends GT_ContainerMetaTile_Machine { public GT_Container_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16)); addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34)); @@ -19,10 +19,12 @@ public class GT_Container_BronzeBlastFurnace addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25)); } + @Override public int getSlotCount() { return 4; } + @Override public int getShiftClickSlotCount() { return 2; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java index d465134d5e..64731c652f 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java @@ -10,12 +10,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class GT_Container_ChestBuffer - extends GT_ContainerMetaTile_Machine { +public class GT_Container_ChestBuffer extends GT_ContainerMetaTile_Machine { public GT_Container_ChestBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { @@ -28,6 +28,7 @@ public class GT_Container_ChestBuffer addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 62, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 27) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -77,10 +78,12 @@ public class GT_Container_ChestBuffer return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public int getSlotCount() { return 27; } + @Override public int getShiftClickSlotCount() { return 27; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java index bfe8578623..cc3efaefb7 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Filter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Filter.java @@ -10,12 +10,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class GT_Container_Filter - extends GT_ContainerMetaTile_Machine { +public class GT_Container_Filter extends GT_ContainerMetaTile_Machine { public GT_Container_Filter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new Slot(this.mTileEntity, 0, 98, 5)); addSlotToContainer(new Slot(this.mTileEntity, 1, 116, 5)); @@ -44,6 +44,7 @@ public class GT_Container_Filter addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 80, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 9) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -117,10 +118,12 @@ public class GT_Container_Filter return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public int getSlotCount() { return 9; } + @Override public int getShiftClickSlotCount() { return 9; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java b/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java index f0acb3ed97..0ee3cc1d44 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java +++ b/src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java @@ -10,12 +10,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class GT_Container_ItemDistributor - extends GT_ContainerMetaTile_Machine { +public class GT_Container_ItemDistributor extends GT_ContainerMetaTile_Machine { public GT_Container_ItemDistributor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { @@ -27,6 +27,7 @@ public class GT_Container_ItemDistributor addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 27) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -67,11 +68,13 @@ public class GT_Container_ItemDistributor return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public int getSlotCount() { return 27; } + @Override public int getShiftClickSlotCount() { return 27; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java index 3bd32c24a2..0e5cc35e02 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java @@ -12,10 +12,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - -public class GT_Container_MicrowaveEnergyTransmitter - extends GT_ContainerMetaTile_Machine { +public class GT_Container_MicrowaveEnergyTransmitter extends GT_ContainerMetaTile_Machine { public int mEgg = 0; public int mTargetD = 0; public int mTargetZ = 0; @@ -121,9 +118,8 @@ public class GT_Container_MicrowaveEnergyTransmitter this.mTargetD = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).mTargetD; this.mEgg = (((GT_MetaTileEntity_MicrowaveEnergyTransmitter) this.mTileEntity.getMetaTileEntity()).hasDimensionalTeleportCapability() ? 1 : 0); - Iterator var2 = this.crafters.iterator(); - while (var2.hasNext()) { - ICrafting var1 = (ICrafting) var2.next(); + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; var1.sendProgressBarUpdate(this, 100, this.mTargetX & 0xFFFF); var1.sendProgressBarUpdate(this, 101, this.mTargetX >>> 16); var1.sendProgressBarUpdate(this, 102, this.mTargetY & 0xFFFF); @@ -136,6 +132,7 @@ public class GT_Container_MicrowaveEnergyTransmitter } } + @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); diff --git a/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java index 5ef8441027..7aebadf31e 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java @@ -13,6 +13,7 @@ public class GT_Container_PrimitiveBlastFurnace extends GT_ContainerMetaTile_Mac super(inventoryPlayer, tileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { for (int i = 0; i < GT_MetaTileEntity_PrimitiveBlastFurnace.INPUT_SLOTS; i++) { addSlotToContainer(new Slot(this.mTileEntity, i, 34, 16 + 18 * i)); @@ -22,12 +23,14 @@ public class GT_Container_PrimitiveBlastFurnace extends GT_ContainerMetaTile_Mac } } + @Override public int getSlotCount() { return GT_MetaTileEntity_PrimitiveBlastFurnace.INPUT_SLOTS + GT_MetaTileEntity_PrimitiveBlastFurnace.OUTPUT_SLOTS; } + @Override public int getShiftClickSlotCount() { return GT_MetaTileEntity_PrimitiveBlastFurnace.INPUT_SLOTS; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java index c63c8fda89..c50bb5ce52 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java +++ b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java @@ -12,8 +12,6 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -import java.util.Iterator; - public class GT_Container_QuantumChest extends GT_ContainerMetaTile_Machine { public int mContent = 0; @@ -42,9 +40,8 @@ public class GT_Container_QuantumChest extends GT_ContainerMetaTile_Machine { mContent = 0; } - Iterator var2 = this.crafters.iterator(); - while (var2.hasNext()) { - ICrafting var1 = (ICrafting) var2.next(); + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; var1.sendProgressBarUpdate(this, 100, mContent & 65535); var1.sendProgressBarUpdate(this, 101, mContent >>> 16); } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java index ecd371893d..f432c9b5d5 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -13,16 +13,14 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - -public class GT_Container_Regulator - extends GT_ContainerMetaTile_Machine { +public class GT_Container_Regulator extends GT_ContainerMetaTile_Machine { public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0}; public GT_Container_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { this.mTargetSlots = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -61,6 +59,7 @@ public class GT_Container_Regulator addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 8, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 10) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -106,6 +105,7 @@ public class GT_Container_Regulator return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public void detectAndSendChanges() { super.detectAndSendChanges(); if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { @@ -115,15 +115,15 @@ public class GT_Container_Regulator for (int i = 0; i < 9; i++) { this.mTargetSlots[i] = ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[i]; } - Iterator var2 = this.crafters.iterator(); - while (var2.hasNext()) { - ICrafting var1 = (ICrafting) var2.next(); + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; for (int i = 0; i < 9; i++) { var1.sendProgressBarUpdate(this, 100 + i, this.mTargetSlots[i]); } } } + @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); @@ -157,10 +157,12 @@ public class GT_Container_Regulator } } + @Override public int getSlotCount() { return 10; } + @Override public int getShiftClickSlotCount() { return 10; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java index 530e64aa68..0b61a0910d 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java @@ -10,12 +10,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class GT_Container_SuperBuffer - extends GT_ContainerMetaTile_Machine { +public class GT_Container_SuperBuffer extends GT_ContainerMetaTile_Machine { public GT_Container_SuperBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 8, 63, false, true, 1)); addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 26, 63, false, true, 1)); @@ -23,6 +23,7 @@ public class GT_Container_SuperBuffer addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 62, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 0) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -72,10 +73,12 @@ public class GT_Container_SuperBuffer return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public int getSlotCount() { return 0; } + @Override public int getShiftClickSlotCount() { return 0; } diff --git a/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java b/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java index f655c2d2bf..2337a21c12 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Teleporter.java @@ -14,8 +14,7 @@ import net.minecraft.item.ItemStack; import java.util.Iterator; -public class GT_Container_Teleporter - extends GT_ContainerMetaTile_Machine { +public class GT_Container_Teleporter extends GT_ContainerMetaTile_Machine { public int mEgg = 0; public int mTargetD = 0; public int mTargetZ = 0; @@ -136,6 +135,7 @@ public class GT_Container_Teleporter } } + @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); diff --git a/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java index 59c6edfeea..762a9868bf 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java +++ b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java @@ -11,12 +11,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class GT_Container_TypeFilter - extends GT_ContainerMetaTile_Machine { +public class GT_Container_TypeFilter extends GT_ContainerMetaTile_Machine { public GT_Container_TypeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } + @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new Slot(this.mTileEntity, 0, 98, 5)); addSlotToContainer(new Slot(this.mTileEntity, 1, 116, 5)); @@ -37,6 +37,7 @@ public class GT_Container_TypeFilter addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 80, 63, false, true, 1)); } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { if (aSlotIndex < 9) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -99,10 +100,12 @@ public class GT_Container_TypeFilter return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + @Override public int getSlotCount() { return 9; } + @Override public int getShiftClickSlotCount() { return 9; } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java index 779fced498..6d346fc445 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java @@ -38,6 +38,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { this.container = container; } + @Override public void initGui() { super.initGui(); @@ -65,6 +66,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } + @Override protected final void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(BACKGROUND); @@ -81,6 +83,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } + @Override protected void keyTyped(char character, int key) { if (!checkHotbarKeys(key)) { if (key == 28) @@ -104,7 +107,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { amount.setText("1"); } - } catch (NumberFormatException localNumberFormatException) { + } catch (NumberFormatException ignored) { } } else { super.keyTyped(character, key); @@ -112,6 +115,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } } + @Override protected void actionPerformed(GuiButton btn) { try { if (btn == apply) { @@ -159,7 +163,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { out = Long.toString(result); Integer.parseInt(out); amount.setText(out); - } catch (NumberFormatException localNumberFormatException) { + } catch (NumberFormatException ignored) { } } @@ -168,7 +172,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { try { DecimalFormat df = new DecimalFormat("+#;-#"); return df.parse(btn.displayString).intValue(); - } catch (ParseException e) { + } catch (ParseException ignored) { } return 0; @@ -187,6 +191,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } + @Override public void writeText(String selectedText) { String original = getText(); super.writeText(selectedText); @@ -204,6 +209,7 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } + @Override public void setText(String s) { try { int i = Integer.parseInt(s); @@ -219,4 +225,4 @@ public final class GT_GUIContainerVolumetricFlask extends GuiContainer { } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java index 459fc32388..45406faec7 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java @@ -4,16 +4,17 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_Boiler - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_Boiler extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity) { super(new GT_Container_Boiler(aInventoryPlayer, aTileEntity, aSteamCapacity), "gregtech:textures/gui/" + aTextureName); } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString("Boiler", 8, 4, 4210752); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java index 187ca93de0..a43de53e2f 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java @@ -4,16 +4,17 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_BronzeBlastFurnace - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_BronzeBlastFurnace extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_BronzeBlastFurnace(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BronzeBlastFurnace.png"); } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString("Bronze Blast Furnace", 8, 4, 4210752); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java index 1081badc51..149f120771 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java @@ -4,12 +4,12 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_ChestBuffer - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_ChestBuffer extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_ChestBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_ChestBuffer(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/ChestBuffer.png"); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java index 9ca7cc413b..20a8f59894 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java @@ -4,12 +4,12 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_Filter - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_Filter extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_Filter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Filter(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/Filter.png"); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java index 8ee028b53d..c1efb6ab58 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java @@ -56,4 +56,4 @@ public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machi drawTexturedModalRect(x + 5, y + 156, 0, 251, Math.min(147, (int) (tScale * 148)), 5); } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java index 637d4abfa1..ca94379c5a 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java @@ -4,16 +4,16 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_ItemDistributor - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_ItemDistributor extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_ItemDistributor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_ItemDistributor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/ItemDistributor.png"); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java index 7e5e43dbc7..db27fb8016 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java @@ -7,12 +7,12 @@ import net.minecraft.entity.player.InventoryPlayer; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -public class GT_GUIContainer_MicrowaveEnergyTransmitter - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_MicrowaveEnergyTransmitter extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_MicrowaveEnergyTransmitter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString("Teleporter", 46, 8, 16448255); if (this.mContainer != null) { @@ -26,6 +26,7 @@ public class GT_GUIContainer_MicrowaveEnergyTransmitter } } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java index 2817c32192..5f93197f05 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java @@ -4,8 +4,7 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTile_Machine { - private String name; +public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTile_Machine { private String name; public String mNEI; public GT_GUIContainer_PrimitiveBlastFurnace(InventoryPlayer inventoryPlayer, IGregTechTileEntity tileEntity, String name, String aNEI) { @@ -15,10 +14,12 @@ public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTi this.mNEI = aNEI; } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString(name, 8, 4, 4210752); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; @@ -26,7 +27,7 @@ public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTi drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); if ((this.mContainer != null) && (this.mContainer.mProgressTime > 0)) { drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (1) - + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), + + this.mContainer.mProgressTime * 20 / (Math.max(this.mContainer.mMaxProgressTime, 1)))), 11); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java index 8adee5fbe0..9a237a517f 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java @@ -4,12 +4,12 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_Regulator - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_Regulator extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Regulator(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/Regulator.png"); } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[0]), 120, 9, 16448255); this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[1]), 137, 9, 16448255); @@ -22,6 +22,7 @@ public class GT_GUIContainer_Regulator this.fontRendererObj.drawString(String.valueOf(((GT_Container_Regulator) this.mContainer).mTargetSlots[8]), 155, 43, 16448255); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java index 43d279ca0e..f4cb165cf9 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java @@ -4,12 +4,12 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_SuperBuffer - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_SuperBuffer extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_SuperBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_SuperBuffer(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/SuperBuffer.png"); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java index 5f89f60e49..8c02897738 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java @@ -7,12 +7,12 @@ import net.minecraft.entity.player.InventoryPlayer; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -public class GT_GUIContainer_Teleporter - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_Teleporter extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_Teleporter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Teleporter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString("Teleporter", 46, 8, 16448255); if (this.mContainer != null) { @@ -26,6 +26,7 @@ public class GT_GUIContainer_Teleporter } } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java index b2fb51c242..d312c0b76a 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java @@ -4,12 +4,12 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -public class GT_GUIContainer_TypeFilter - extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_TypeFilter extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_TypeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_TypeFilter(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/TypeFilter.png"); } + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/gregtech/common/items/CombType.java b/src/main/java/gregtech/common/items/CombType.java index 6f7ea9141d..34c3872edf 100644 --- a/src/main/java/gregtech/common/items/CombType.java +++ b/src/main/java/gregtech/common/items/CombType.java @@ -103,7 +103,7 @@ public enum CombType { DOB("d-o-b", true, Materials._NULL, 50,0x007700, 0x002400), THORIUM("thorium", true, Materials.Thorium, 75,0x001E00, 0x005000), LUTETIUM("lutetium", true, Materials.Lutetium, 10,0xE6FFE6, 0xFFFFFF), - AMERICUM("americum", true, Materials.Americium, 5,0xE6E6FF, 0xC8C8C8), + AMERICIUM("americium", true, Materials.Americium, 5,0xE6E6FF, 0xC8C8C8), NEUTRONIUM("neutronium", true, Materials.Neutronium, 2,0xFFF0F0, 0xFAFAFA), //Twilight @@ -181,11 +181,11 @@ public enum CombType { } public String getName() { -// return "gt.comb."+this.name; + return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb"); } public int[] getColours() { return color == null || color.length != 2 ? new int[]{0,0} : color; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/DropType.java b/src/main/java/gregtech/common/items/DropType.java index 1316b01601..f3ea945016 100644 --- a/src/main/java/gregtech/common/items/DropType.java +++ b/src/main/java/gregtech/common/items/DropType.java @@ -40,11 +40,11 @@ public enum DropType { } public String getName() { -// return "gt.comb."+this.name; + return GT_LanguageManager.addStringLocalization("drop." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Drop"); } public int[] getColours() { return colours[this.ordinal()]; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java b/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java index 9d23d09587..056ab796fa 100644 --- a/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java +++ b/src/main/java/gregtech/common/items/GT_DepletetCell_Item.java @@ -10,29 +10,36 @@ public class GT_DepletetCell_Item extends GT_RadioactiveCellIC_Item { super(aUnlocalized, aEnglish, 1, 1, 0, aRadiation, 0, null, false); } + @Override public void processChamber(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, boolean paramBoolean) { } + @Override public boolean acceptUraniumPulse(IReactor paramIReactor, ItemStack paramItemStack1, ItemStack paramItemStack2, int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean) { return false; } + @Override public boolean canStoreHeat(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2) { return false; } + @Override public int getMaxHeat(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2) { return 0; } + @Override public int getCurrentHeat(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2) { return 0; } + @Override public int alterHeat(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3) { return 0; } + @Override public float influenceExplosion(IReactor paramIReactor, ItemStack paramItemStack) { return 0.0F; } diff --git a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java index ba50f99d2e..a8487651b4 100644 --- a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java +++ b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java @@ -28,6 +28,7 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { ItemList.Display_Fluid.set(this); } + @Override protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { NBTTagCompound aNBT = aStack.getTagCompound(); if (GT_Values.D1) { @@ -46,10 +47,12 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { } } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { } + @Override public IIcon getIconFromDamage(int aMeta) { return Stream.of(FluidRegistry.getFluid(aMeta), FluidRegistry.WATER) .filter(Objects::nonNull) @@ -59,16 +62,19 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { .orElseThrow(IllegalStateException::new); } + @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack aStack, int aRenderPass) { Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage()); return tFluid == null ? 16777215 : tFluid.getColor(); } + @Override public int getSpriteNumber() { return 0; } + @Override public String getUnlocalizedName(ItemStack aStack) { if (aStack != null) { return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), false); @@ -76,6 +82,7 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { return ""; } + @Override public String getItemStackDisplayName(ItemStack aStack) { if (aStack != null) { return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), true); @@ -83,6 +90,7 @@ public class GT_FluidDisplayItem extends GT_Generic_Item { return ""; } + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item aItem, CreativeTabs aTab, List aList) { if (GT_Values.D1) { diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 710dc0bf8f..9cbdb2b832 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -24,7 +24,7 @@ import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; public class GT_IntegratedCircuit_Item extends GT_Generic_Item { - private final static String aTextEmptyRow = " "; + private static final String aTextEmptyRow = " "; protected IIcon[] mIconDamage = new IIcon[25]; public GT_IntegratedCircuit_Item() { super("integrated_circuit", "Programmed Circuit", ""); @@ -83,15 +83,18 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { return getModeString(aMetaData) + " " + (byte) (aMetaData & 0xFF); } + @Override public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".configuration").toString(), "Configuration: ") + getConfigurationString(getDamage(aStack))); } + @Override public String getUnlocalizedName(ItemStack aStack) { return getUnlocalizedName(); } + @Override @SideOnly(Side.CLIENT) public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { aList.add(new ItemStack(this, 1, 0)); diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index ad2457b721..f0904485d4 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -2,18 +2,37 @@ package gregtech.common.items; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; import gregtech.api.interfaces.IItemBehaviour; -import gregtech.api.interfaces.ITexture; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Item_X32; -import gregtech.api.objects.GT_MultiTexture; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; -import gregtech.api.util.*; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_FoodStat; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gregtech.common.covers.*; -import gregtech.common.items.behaviors.*; +import gregtech.common.items.behaviors.Behaviour_Arrow_Potion; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import gregtech.common.items.behaviors.Behaviour_DataStick; +import gregtech.common.items.behaviors.Behaviour_Lighter; +import gregtech.common.items.behaviors.Behaviour_PrintedPages; +import gregtech.common.items.behaviors.Behaviour_Scanner; +import gregtech.common.items.behaviors.Behaviour_SensorKit; +import gregtech.common.items.behaviors.Behaviour_Sonictron; +import gregtech.common.items.behaviors.Behaviour_Spray_Color; +import gregtech.common.items.behaviors.Behaviour_WrittenBook; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.item.EntityItem; @@ -25,16 +44,23 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.util.MathHelper; -import java.util.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_01 INSTANCE; private final String mToolTipPurify = GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify", "Throw into Cauldron to get clean Dust"); - private final static String aTextArrow = " A";private final static String aTextStick = " S ";private final static String aTextFeather = "F "; - private final static String aTextEmptyRow = " "; private final static String aTextShape = " P "; + private static final String aTextArrow = " A"; + private static final String aTextStick = " S "; + private static final String aTextFeather = "F "; + private static final String aTextEmptyRow = " "; private static final String aTextShape = " P "; public GT_MetaGenerated_Item_01() { - super("metaitem.01", new OrePrefixes[]{OrePrefixes.dustTiny, OrePrefixes.dustSmall, OrePrefixes.dust, OrePrefixes.dustImpure, OrePrefixes.dustPure, OrePrefixes.crushed, OrePrefixes.crushedPurified, OrePrefixes.crushedCentrifuged, OrePrefixes.gem, OrePrefixes.nugget, null, OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.ingotDouble, OrePrefixes.ingotTriple, OrePrefixes.ingotQuadruple, OrePrefixes.ingotQuintuple, OrePrefixes.plate, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.plateDense, OrePrefixes.stick, OrePrefixes.lens, OrePrefixes.round, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, OrePrefixes.cell, OrePrefixes.cellPlasma}); + super("metaitem.01", OrePrefixes.dustTiny, OrePrefixes.dustSmall, OrePrefixes.dust, OrePrefixes.dustImpure, OrePrefixes.dustPure, OrePrefixes.crushed, OrePrefixes.crushedPurified, OrePrefixes.crushedCentrifuged, OrePrefixes.gem, OrePrefixes.nugget, null, OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.ingotDouble, OrePrefixes.ingotTriple, OrePrefixes.ingotQuadruple, OrePrefixes.ingotQuintuple, OrePrefixes.plate, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.plateDense, OrePrefixes.stick, OrePrefixes.lens, OrePrefixes.round, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, OrePrefixes.cell, OrePrefixes.cellPlasma); INSTANCE = this; int tLastID = 0; @@ -42,536 +68,507 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { setBurnValue(17000 + Materials.Wood.mMetaItemSubID, 1600); GT_OreDictUnificator.addToBlacklist(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID)); GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 8L), new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID)); - GregTech_API.registerCover(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID), new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE), null); + GregTech_API.registerCover(new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID), TextureFactory.of(COVER_WOOD_PLATE), null); ItemStack tStack = new ItemStack(this, 1, 17000 + Materials.Wood.mMetaItemSubID); tStack.setStackDisplayName("The holy Planks of Sengir"); GT_Utility.ItemNBT.addEnchantment(tStack, Enchantment.smite, 10); GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XXX", "XDX", "XXX", 'X', OrePrefixes.gem.get(Materials.NetherStar), 'D', new ItemStack(Blocks.dragon_egg, 1, 32767)}); - ItemList.Credit_Greg_Copper.set(addItem(tLastID = 0, "Copper GT Credit", "0.125 Credits", new Object[0])); - ItemList.Credit_Greg_Cupronickel.set(addItem(tLastID = 1, "Cupronickel GT Credit", "1 Credit", new Object[]{new ItemData(Materials.Cupronickel, 907200L, new MaterialStack[0])})); - ItemList.Credit_Greg_Silver.set(addItem(tLastID = 2, "Silver GT Credit", "8 Credits", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)})); - ItemList.Credit_Greg_Gold.set(addItem(tLastID = 3, "Gold GT Credit", "64 Credits", new Object[0])); - ItemList.Credit_Greg_Platinum.set(addItem(tLastID = 4, "Platinum GT Credit", "512 Credits", new Object[0])); - ItemList.Credit_Greg_Osmium.set(addItem(tLastID = 5, "Osmium GT Credit", "4096 Credits", new Object[0])); - ItemList.Credit_Greg_Naquadah.set(addItem(tLastID = 6, "Naquadah GT Credit", "32768 Credits", new Object[0])); - ItemList.Credit_Greg_Neutronium.set(addItem(tLastID = 7, "Neutronium GT Credit", "262144 Credits", new Object[0])); - ItemList.Coin_Gold_Ancient.set(addItem(tLastID = 8, "Ancient Gold Coin", "Found in ancient Ruins", new Object[]{new ItemData(Materials.Gold, 907200L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 8L)})); - ItemList.Coin_Doge.set(addItem(tLastID = 9, "Doge Coin", "wow much coin how money so crypto plz mine v rich very currency wow", new Object[]{new ItemData(Materials.Brass, 907200L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)})); - ItemList.Coin_Chocolate.set(addItem(tLastID = 10, "Chocolate Coin", "Wrapped in Gold", new Object[]{new ItemData(Materials.Gold, OrePrefixes.foil.mMaterialAmount, new MaterialStack[0]), new GT_FoodStat(1, 0.1F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L), true, false, false, new int[]{Potion.moveSpeed.id, 200, 1, 100})})); - ItemList.Credit_Copper.set(addItem(tLastID = 11, "Industrial Copper Credit", "0.125 Credits", new Object[0])); - - ItemList.Credit_Silver.set(addItem(tLastID = 13, "Industrial Silver Credit", "8 Credits", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)})); - ItemList.Credit_Gold.set(addItem(tLastID = 14, "Industrial Gold Credit", "64 Credits", new Object[0])); - ItemList.Credit_Platinum.set(addItem(tLastID = 15, "Industrial Platinum Credit", "512 Credits", new Object[0])); - ItemList.Credit_Osmium.set(addItem(tLastID = 16, "Industrial Osmium Credit", "4096 Credits", new Object[0])); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Coin_Chocolate.get(1L, new Object[0]), new Object[]{OrePrefixes.dust.get(Materials.Cocoa), OrePrefixes.dust.get(Materials.Milk), OrePrefixes.dust.get(Materials.Sugar), OrePrefixes.foil.get(Materials.Gold)}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Copper.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Osmium}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Osmium.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Copper.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(8L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Neutronium}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Neutronium.get(1L, new Object[0]), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah}); - - ItemList.Component_Minecart_Wheels_Iron.set(addItem(tLastID = 100, "Iron Minecart Wheels", "To get things rolling", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L)})); - ItemList.Component_Minecart_Wheels_Steel.set(addItem(tLastID = 101, "Steel Minecart Wheels", "To get things rolling", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Iron.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.AnyIron), 'S', OrePrefixes.stick.get(Materials.AnyIron)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Steel.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel)}); + ItemList.Credit_Greg_Copper.set(addItem(tLastID = 0, "Copper GT Credit", "0.125 Credits")); + ItemList.Credit_Greg_Cupronickel.set(addItem(tLastID = 1, "Cupronickel GT Credit", "1 Credit", new ItemData(Materials.Cupronickel, 907200L))); + ItemList.Credit_Greg_Silver.set(addItem(tLastID = 2, "Silver GT Credit", "8 Credits", new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Credit_Greg_Gold.set(addItem(tLastID = 3, "Gold GT Credit", "64 Credits")); + ItemList.Credit_Greg_Platinum.set(addItem(tLastID = 4, "Platinum GT Credit", "512 Credits")); + ItemList.Credit_Greg_Osmium.set(addItem(tLastID = 5, "Osmium GT Credit", "4096 Credits")); + ItemList.Credit_Greg_Naquadah.set(addItem(tLastID = 6, "Naquadah GT Credit", "32768 Credits")); + ItemList.Credit_Greg_Neutronium.set(addItem(tLastID = 7, "Neutronium GT Credit", "262144 Credits")); + ItemList.Coin_Gold_Ancient.set(addItem(tLastID = 8, "Ancient Gold Coin", "Found in ancient Ruins", new ItemData(Materials.Gold, 907200L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 8L))); + ItemList.Coin_Doge.set(addItem(tLastID = 9, "Doge Coin", "wow much coin how money so crypto plz mine v rich very currency wow", new ItemData(Materials.Brass, 907200L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Coin_Chocolate.set(addItem(tLastID = 10, "Chocolate Coin", "Wrapped in Gold", new ItemData(Materials.Gold, OrePrefixes.foil.mMaterialAmount), new GT_FoodStat(1, 0.1F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Gold, 1L), true, false, false, Potion.moveSpeed.id, 200, 1, 100))); + ItemList.Credit_Copper.set(addItem(tLastID = 11, "Industrial Copper Credit", "0.125 Credits")); + + ItemList.Credit_Silver.set(addItem(tLastID = 13, "Industrial Silver Credit", "8 Credits", new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Credit_Gold.set(addItem(tLastID = 14, "Industrial Gold Credit", "64 Credits")); + ItemList.Credit_Platinum.set(addItem(tLastID = 15, "Industrial Platinum Credit", "512 Credits")); + ItemList.Credit_Osmium.set(addItem(tLastID = 16, "Industrial Osmium Credit", "4096 Credits")); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Coin_Chocolate.get(1L), new Object[]{OrePrefixes.dust.get(Materials.Cocoa), OrePrefixes.dust.get(Materials.Milk), OrePrefixes.dust.get(Materials.Sugar), OrePrefixes.foil.get(Materials.Gold)}); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Copper.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Osmium}); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Iron.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper, ItemList.Credit_Copper}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Silver.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron, ItemList.Credit_Iron}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Gold.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver, ItemList.Credit_Silver}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Platinum.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold, ItemList.Credit_Gold}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Osmium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum, ItemList.Credit_Platinum}); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Copper.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(8L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Neutronium}); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Cupronickel.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper, ItemList.Credit_Greg_Copper}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Silver.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel, ItemList.Credit_Greg_Cupronickel}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Gold.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver, ItemList.Credit_Greg_Silver}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Platinum.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold, ItemList.Credit_Greg_Gold}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Osmium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum, ItemList.Credit_Greg_Platinum}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Naquadah.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium, ItemList.Credit_Greg_Osmium}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Credit_Greg_Neutronium.get(1L), GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah, ItemList.Credit_Greg_Naquadah}); + + ItemList.Component_Minecart_Wheels_Iron.set(addItem(tLastID = 100, "Iron Minecart Wheels", "To get things rolling", new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + ItemList.Component_Minecart_Wheels_Steel.set(addItem(tLastID = 101, "Steel Minecart Wheels", "To get things rolling", new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Iron.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.AnyIron), 'S', OrePrefixes.stick.get(Materials.AnyIron)}); + GT_ModHandler.addCraftingRecipe(ItemList.Component_Minecart_Wheels_Steel.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", "RSR", " w ", 'R', OrePrefixes.ring.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel)}); ItemList.CompressedFireclay.set(addItem(tLastID = 110, "Compressed Fireclay", "Brick-shaped")); ItemList.Firebrick.set(addItem(tLastID = 111, "Firebrick", "Heat resistant")); - ItemList.Arrow_Head_Glass_Emtpy.set(addItem(tLastID = 200, "Empty Glass Arrow Head", "Fill with Potions before use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Arrow_Head_Glass_Poison.set(addItem(tLastID = 201, "Poison Glass Arrow Head", "Glass Arrow filled with Poison", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Poison_Long.set(addItem(tLastID = 202, "Poison Glass Arrow Head", "Glass Arrow filled with stretched Poison", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Poison_Strong.set(addItem(tLastID = 203, "Poison Glass Arrow Head", "Glass Arrow filled with strong Poison", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Slowness.set(addItem(tLastID = 204, "Slowness Glass Arrow Head", "Glass Arrow filled with Laming Brew", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Slowness_Long.set(addItem(tLastID = 205, "Slowness Glass Arrow Head", "Glass Arrow filled with stretched Laming Brew", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Weakness.set(addItem(tLastID = 206, "Weakness Glass Arrow Head", "Glass Arrow filled with Weakening Brew", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Weakness_Long.set(addItem(tLastID = 207, "Weakness Glass Arrow Head", "Glass Arrow filled with stretched Weakening Brew", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Head_Glass_Holy_Water.set(addItem(tLastID = 208, "Holy Water Glass Arrow Head", "Glass Arrow filled with Holy Water", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L)})); - - ItemList.Arrow_Wooden_Glass_Emtpy.set(addItem(tLastID = 225, "Regular Glass Vial Arrow", "Empty Glass Arrow", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Arrow_Wooden_Glass_Poison.set(addItem(tLastID = 226, "Regular Poison Arrow", "Glass Arrow filled with Poison", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.poison.id, 450, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Poison_Long.set(addItem(tLastID = 227, "Regular Poison Arrow", "Glass Arrow filled with stretched Poison", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.poison.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Poison_Strong.set(addItem(tLastID = 228, "Regular Poison Arrow", "Glass Arrow filled with strong Poison", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.poison.id, 450, 1, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Slowness.set(addItem(tLastID = 229, "Regular Slowness Arrow", "Glass Arrow filled with Laming Brew", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.moveSlowdown.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Slowness_Long.set(addItem(tLastID = 230, "Regular Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.moveSlowdown.id, 1800, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Weakness.set(addItem(tLastID = 231, "Regular Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.weakness.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Weakness_Long.set(addItem(tLastID = 232, "Regular Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, new int[]{Potion.weakness.id, 1800, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Wooden_Glass_Holy_Water.set(addItem(tLastID = 233, "Regular Holy Water Arrow", "Glass Arrow filled with Holy Water", new Object[]{new Behaviour_Arrow_Potion(1.0F, 6.0F, Enchantment.smite, 10, new int[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L)})); - - ItemList.Arrow_Plastic_Glass_Emtpy.set(addItem(tLastID = 250, "Light Glass Vial Arrow", "Empty Glass Arrow", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Arrow_Plastic_Glass_Poison.set(addItem(tLastID = 251, "Light Poison Arrow", "Glass Arrow filled with Poison", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.poison.id, 450, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Poison_Long.set(addItem(tLastID = 252, "Light Poison Arrow", "Glass Arrow filled with stretched Poison", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.poison.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Poison_Strong.set(addItem(tLastID = 253, "Light Poison Arrow", "Glass Arrow filled with strong Poison", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.poison.id, 450, 1, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Slowness.set(addItem(tLastID = 254, "Light Slowness Arrow", "Glass Arrow filled with Laming Brew", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.moveSlowdown.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Slowness_Long.set(addItem(tLastID = 255, "Light Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.moveSlowdown.id, 1800, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Weakness.set(addItem(tLastID = 256, "Light Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.weakness.id, 900, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Weakness_Long.set(addItem(tLastID = 257, "Light Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, new int[]{Potion.weakness.id, 1800, 0, 100}), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L)})); - ItemList.Arrow_Plastic_Glass_Holy_Water.set(addItem(tLastID = 258, "Light Holy Water Arrow", "Glass Arrow filled with Holy Water", new Object[]{new Behaviour_Arrow_Potion(1.5F, 6.0F, Enchantment.smite, 10, new int[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Emtpy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Strong.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Holy_Water.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); - - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Emtpy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Strong.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness_Long.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Holy_Water.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); - - ItemList.Shape_Empty.set(addItem(tLastID = 300, "Empty Shape Plate", "Raw Plate to make Molds and Extruder Shapes", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)})); + ItemList.Arrow_Head_Glass_Emtpy.set(addItem(tLastID = 200, "Empty Glass Arrow Head", "Fill with Potions before use", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Head_Glass_Poison.set(addItem(tLastID = 201, "Poison Glass Arrow Head", "Glass Arrow filled with Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Poison_Long.set(addItem(tLastID = 202, "Poison Glass Arrow Head", "Glass Arrow filled with stretched Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Poison_Strong.set(addItem(tLastID = 203, "Poison Glass Arrow Head", "Glass Arrow filled with strong Poison", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Slowness.set(addItem(tLastID = 204, "Slowness Glass Arrow Head", "Glass Arrow filled with Laming Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Slowness_Long.set(addItem(tLastID = 205, "Slowness Glass Arrow Head", "Glass Arrow filled with stretched Laming Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Weakness.set(addItem(tLastID = 206, "Weakness Glass Arrow Head", "Glass Arrow filled with Weakening Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Weakness_Long.set(addItem(tLastID = 207, "Weakness Glass Arrow Head", "Glass Arrow filled with stretched Weakening Brew", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Head_Glass_Holy_Water.set(addItem(tLastID = 208, "Holy Water Glass Arrow Head", "Glass Arrow filled with Holy Water", new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + ItemList.Arrow_Wooden_Glass_Emtpy.set(addItem(tLastID = 225, "Regular Glass Vial Arrow", "Empty Glass Arrow", new Behaviour_Arrow_Potion(1.0F, 6.0F), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Wooden_Glass_Poison.set(addItem(tLastID = 226, "Regular Poison Arrow", "Glass Arrow filled with Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Poison_Long.set(addItem(tLastID = 227, "Regular Poison Arrow", "Glass Arrow filled with stretched Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Poison_Strong.set(addItem(tLastID = 228, "Regular Poison Arrow", "Glass Arrow filled with strong Poison", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.poison.id, 450, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Slowness.set(addItem(tLastID = 229, "Regular Slowness Arrow", "Glass Arrow filled with Laming Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Slowness_Long.set(addItem(tLastID = 230, "Regular Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Weakness.set(addItem(tLastID = 231, "Regular Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Weakness_Long.set(addItem(tLastID = 232, "Regular Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Behaviour_Arrow_Potion(1.0F, 6.0F, Potion.weakness.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Wooden_Glass_Holy_Water.set(addItem(tLastID = 233, "Regular Holy Water Arrow", "Glass Arrow filled with Holy Water", new Behaviour_Arrow_Potion(1.0F, 6.0F, Enchantment.smite, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + ItemList.Arrow_Plastic_Glass_Emtpy.set(addItem(tLastID = 250, "Light Glass Vial Arrow", "Empty Glass Arrow", new Behaviour_Arrow_Potion(1.5F, 6.0F), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Arrow_Plastic_Glass_Poison.set(addItem(tLastID = 251, "Light Poison Arrow", "Glass Arrow filled with Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Poison_Long.set(addItem(tLastID = 252, "Light Poison Arrow", "Glass Arrow filled with stretched Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Poison_Strong.set(addItem(tLastID = 253, "Light Poison Arrow", "Glass Arrow filled with strong Poison", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.poison.id, 450, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Slowness.set(addItem(tLastID = 254, "Light Slowness Arrow", "Glass Arrow filled with Laming Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Slowness_Long.set(addItem(tLastID = 255, "Light Slowness Arrow", "Glass Arrow filled with stretched Laming Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.moveSlowdown.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Weakness.set(addItem(tLastID = 256, "Light Weakness Arrow", "Glass Arrow filled with Weakening Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 900, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Weakness_Long.set(addItem(tLastID = 257, "Light Weakness Arrow", "Glass Arrow filled with stretched Weakening Brew", new Behaviour_Arrow_Potion(1.5F, 6.0F, Potion.weakness.id, 1800, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L))); + ItemList.Arrow_Plastic_Glass_Holy_Water.set(addItem(tLastID = 258, "Light Holy Water Arrow", "Glass Arrow filled with Holy Water", new Behaviour_Arrow_Potion(1.5F, 6.0F, Enchantment.smite, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Emtpy.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Poison_Strong.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Slowness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Weakness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Wooden_Glass_Holy_Water.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Wood)}); + + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Emtpy.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Emtpy, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Poison_Strong.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Poison_Strong, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Slowness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Slowness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Weakness_Long.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Weakness_Long, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Arrow_Plastic_Glass_Holy_Water.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextArrow, aTextStick, aTextFeather, 'A', ItemList.Arrow_Head_Glass_Holy_Water, 'F', OreDictNames.craftingFeather, 'S', OrePrefixes.stick.get(Materials.Plastic)}); + + ItemList.Shape_Empty.set(addItem(tLastID = 300, "Empty Shape Plate", "Raw Plate to make Molds and Extruder Shapes", new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Empty.get(1L, new Object[0]), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hf", "PP", "PP", 'P', OrePrefixes.plate.get(Materials.Steel)}); - ItemList.Shape_Mold_Plate.set(addItem(tLastID = 301, "Mold (Plate)", "Mold for making Plates", new Object[0])); - ItemList.Shape_Mold_Casing.set(addItem(tLastID = 302, "Mold (Casing)", "Mold for making Item Casings", new Object[0])); - ItemList.Shape_Mold_Gear.set(addItem(tLastID = 303, "Mold (Gear)", "Mold for making Gears", new Object[0])); - ItemList.Shape_Mold_Credit.set(addItem(tLastID = 304, "Mold (Coinage)", "Secure Mold for making Coins (Don't lose it!)", new Object[0])); - ItemList.Shape_Mold_Bottle.set(addItem(tLastID = 305, "Mold (Bottle)", "Mold for making Bottles", new Object[0])); - ItemList.Shape_Mold_Ingot.set(addItem(tLastID = 306, "Mold (Ingot)", "Mold for making Ingots", new Object[0])); - ItemList.Shape_Mold_Ball.set(addItem(tLastID = 307, "Mold (Ball)", "Mold for making Balls", new Object[0])); - ItemList.Shape_Mold_Block.set(addItem(tLastID = 308, "Mold (Block)", "Mold for making Blocks", new Object[0])); - ItemList.Shape_Mold_Nugget.set(addItem(tLastID = 309, "Mold (Nuggets)", "Mold for making Nuggets", new Object[0])); - ItemList.Shape_Mold_Bun.set(addItem(tLastID = 310, "Mold (Buns)", "Mold for shaping Buns", new Object[0])); - ItemList.Shape_Mold_Bread.set(addItem(tLastID = 311, "Mold (Bread)", "Mold for shaping Breads", new Object[0])); - ItemList.Shape_Mold_Baguette.set(addItem(tLastID = 312, "Mold (Baguette)", "Mold for shaping Baguettes", new Object[0])); - ItemList.Shape_Mold_Cylinder.set(addItem(tLastID = 313, "Mold (Cylinder)", "Mold for shaping Cylinders", new Object[0])); - ItemList.Shape_Mold_Anvil.set(addItem(tLastID = 314, "Mold (Anvil)", "Mold for shaping Anvils", new Object[0])); - ItemList.Shape_Mold_Name.set(addItem(tLastID = 315, "Mold (Name)", "Mold for naming Items (rename Mold with Anvil)", new Object[0])); - ItemList.Shape_Mold_Arrow.set(addItem(tLastID = 316, "Mold (Arrow Head)", "Mold for making Arrow Heads", new Object[0])); - ItemList.Shape_Mold_Gear_Small.set(addItem(tLastID = 317, "Mold (Small Gear)", "Mold for making small Gears", new Object[0])); - ItemList.Shape_Mold_Rod.set(addItem(tLastID = 318, "Mold (Rod)", "Mold for making Rods", new Object[0])); - ItemList.Shape_Mold_Bolt.set(addItem(tLastID = 319, "Mold (Bolt)", "Mold for making Bolts", new Object[0])); - ItemList.Shape_Mold_Round.set(addItem(tLastID = 320, "Mold (Round)", "Mold for making Rounds", new Object[0])); - ItemList.Shape_Mold_Screw.set(addItem(tLastID = 321, "Mold (Screw)", "Mold for making Screws", new Object[0])); - ItemList.Shape_Mold_Ring.set(addItem(tLastID = 322, "Mold (Ring)", "Mold for making Rings", new Object[0])); - ItemList.Shape_Mold_Rod_Long.set(addItem(tLastID = 323, "Mold (Long Rod)", "Mold for making Long Rods", new Object[0])); - ItemList.Shape_Mold_Rotor.set(addItem(tLastID = 324, "Mold (Rotor)", "Mold for making a Rotor", new Object[0])); - ItemList.Shape_Mold_Turbine_Blade.set(addItem(tLastID = 325, "Mold (Turbine Blade)", "Mold for making a Turbine Blade", new Object[0])); - ItemList.Shape_Mold_Pipe_Tiny.set(addItem(tLastID = 326, "Mold (Tiny Pipe)", "Mold for making tiny Pipes", new Object[0])); - ItemList.Shape_Mold_Pipe_Small.set(addItem(tLastID = 327, "Mold (Small Pipe)", "Mold for making small Pipes", new Object[0])); - ItemList.Shape_Mold_Pipe_Medium.set(addItem(tLastID = 328, "Mold (Normal Pipe)", "Mold for making Pipes", new Object[0])); - ItemList.Shape_Mold_Pipe_Large.set(addItem(tLastID = 329, "Mold (Large Pipe)", "Mold for making large Pipes", new Object[0])); - ItemList.Shape_Mold_Pipe_Huge.set(addItem(tLastID = 330, "Mold (Huge Pipe)", "Mold for making full Block Pipes", new Object[0])); - GT_ModHandler.removeRecipe(new ItemStack[]{new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass)}); - - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Credit.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"h ", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Plate.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h ", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Casing.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" h", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Gear.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, " Ph", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Bottle.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, " h", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Ingot.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, " h ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Ball.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, "h ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Block.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, "hP ", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Nugget.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P h", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Bun.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", " h", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Bread.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", aTextEmptyRow, " h", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Baguette.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", aTextEmptyRow, " h ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Cylinder.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, " h", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Anvil.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, " h ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Name.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, "h ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Arrow.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", "h ", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Mold_Gear_Small.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextEmptyRow, "h P", 'P', ItemList.Shape_Empty}); - - ItemList.Shape_Extruder_Plate.set(addItem(tLastID = 350, "Extruder Shape (Plate)", "Extruder Shape for making Plates", new Object[0])); - ItemList.Shape_Extruder_Rod.set(addItem(tLastID = 351, "Extruder Shape (Rod)", "Extruder Shape for making Rods", new Object[0])); - ItemList.Shape_Extruder_Bolt.set(addItem(tLastID = 352, "Extruder Shape (Bolt)", "Extruder Shape for making Bolts", new Object[0])); - ItemList.Shape_Extruder_Ring.set(addItem(tLastID = 353, "Extruder Shape (Ring)", "Extruder Shape for making Rings", new Object[0])); - ItemList.Shape_Extruder_Cell.set(addItem(tLastID = 354, "Extruder Shape (Cell)", "Extruder Shape for making Cells", new Object[0])); - ItemList.Shape_Extruder_Ingot.set(addItem(tLastID = 355, "Extruder Shape (Ingot)", "Extruder Shape for, wait, can't we just use a Furnace?", new Object[0])); - ItemList.Shape_Extruder_Wire.set(addItem(tLastID = 356, "Extruder Shape (Wire)", "Extruder Shape for making Wires", new Object[0])); - ItemList.Shape_Extruder_Casing.set(addItem(tLastID = 357, "Extruder Shape (Casing)", "Extruder Shape for making Item Casings", new Object[0])); - ItemList.Shape_Extruder_Pipe_Tiny.set(addItem(tLastID = 358, "Extruder Shape (Tiny Pipe)", "Extruder Shape for making tiny Pipes", new Object[0])); - ItemList.Shape_Extruder_Pipe_Small.set(addItem(tLastID = 359, "Extruder Shape (Small Pipe)", "Extruder Shape for making small Pipes", new Object[0])); - ItemList.Shape_Extruder_Pipe_Medium.set(addItem(tLastID = 360, "Extruder Shape (Normal Pipe)", "Extruder Shape for making Pipes", new Object[0])); - ItemList.Shape_Extruder_Pipe_Large.set(addItem(tLastID = 361, "Extruder Shape (Large Pipe)", "Extruder Shape for making large Pipes", new Object[0])); - ItemList.Shape_Extruder_Pipe_Huge.set(addItem(tLastID = 362, "Extruder Shape (Huge Pipe)", "Extruder Shape for making full Block Pipes", new Object[0])); - ItemList.Shape_Extruder_Block.set(addItem(tLastID = 363, "Extruder Shape (Block)", "Extruder Shape for making Blocks", new Object[0])); - ItemList.Shape_Extruder_Sword.set(addItem(tLastID = 364, "Extruder Shape (Sword Blade)", "Extruder Shape for making Swords", new Object[0])); - ItemList.Shape_Extruder_Pickaxe.set(addItem(tLastID = 365, "Extruder Shape (Pickaxe Head)", "Extruder Shape for making Pickaxes", new Object[0])); - ItemList.Shape_Extruder_Shovel.set(addItem(tLastID = 366, "Extruder Shape (Shovel Head)", "Extruder Shape for making Shovels", new Object[0])); - ItemList.Shape_Extruder_Axe.set(addItem(tLastID = 367, "Extruder Shape (Axe Head)", "Extruder Shape for making Axes", new Object[0])); - ItemList.Shape_Extruder_Hoe.set(addItem(tLastID = 368, "Extruder Shape (Hoe Head)", "Extruder Shape for making Hoes", new Object[0])); - ItemList.Shape_Extruder_Hammer.set(addItem(tLastID = 369, "Extruder Shape (Hammer Head)", "Extruder Shape for making Hammers", new Object[0])); - ItemList.Shape_Extruder_File.set(addItem(tLastID = 370, "Extruder Shape (File Head)", "Extruder Shape for making Files", new Object[0])); - ItemList.Shape_Extruder_Saw.set(addItem(tLastID = 371, "Extruder Shape (Saw Blade)", "Extruder Shape for making Saws", new Object[0])); - ItemList.Shape_Extruder_Gear.set(addItem(tLastID = 372, "Extruder Shape (Gear)", "Extruder Shape for making Gears", new Object[0])); - ItemList.Shape_Extruder_Bottle.set(addItem(tLastID = 373, "Extruder Shape (Bottle)", "Extruder Shape for making Bottles", new Object[0])); - ItemList.Shape_Extruder_Rotor.set(addItem(tLastID = 374, "Extruder Shape (Rotor)", "Extruder Shape for a Rotor", new Object[0])); - ItemList.Shape_Extruder_Small_Gear.set(addItem(tLastID = 375, "Extruder Shape (Small Gear)", "Extruder Shape for a Small Gear", new Object[0])); - ItemList.Shape_Extruder_Turbine_Blade.set(addItem(tLastID = 376, "Extruder Shape (Turbine Blade)", "Extruder Shape for a Turbine Blade", new Object[0])); - - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Bolt.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"x ", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Cell.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" x ", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Ingot.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" x", aTextShape, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Ring.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, " Px", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Rod.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, " x", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Wire.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, " x ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Casing.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextShape, "x ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Plate.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, "xP ", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Block.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P x", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pipe_Small.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", " x", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pipe_Large.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", aTextEmptyRow, " x", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pipe_Medium.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P ", aTextEmptyRow, " x ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Sword.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, " x", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pickaxe.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, " x ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Shovel.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", aTextEmptyRow, "x ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Axe.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" P", "x ", aTextEmptyRow, 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Hoe.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, aTextEmptyRow, "x P", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Hammer.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, "x ", " P", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_File.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"x ", aTextEmptyRow, " P", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Saw.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" x ", aTextEmptyRow, " P", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Gear.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"x ", aTextEmptyRow, "P ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pipe_Tiny.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" x ", aTextEmptyRow, "P ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Pipe_Huge.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" x", aTextEmptyRow, "P ", 'P', ItemList.Shape_Empty}); - //GT_ModHandler.addCraftingRecipe(ItemList.Shape_Extruder_Bottle.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{aTextEmptyRow, " x", "P ", 'P', ItemList.Shape_Empty}); - - ItemList.Shape_Slicer_Flat.set(addItem(tLastID = 398, "Slicer Blade (Flat)", "Slicer Blade for cutting Flat", new Object[0])); - ItemList.Shape_Slicer_Stripes.set(addItem(tLastID = 399, "Slicer Blade (Stripes)", "Slicer Blade for cutting Stripes", new Object[0])); - - GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Flat.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", aTextShape, "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Stripes.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); - - ItemList.Fuel_Can_Plastic_Empty.set(addItem(tLastID = 400, "Empty Plastic Fuel Can", "Used to store Fuels", new Object[]{new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)})); - ItemList.Fuel_Can_Plastic_Filled.set(addItem(tLastID = 401, "Plastic Fuel Can", "Burns well in Diesel Generators", new Object[]{new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Fuel_Can_Plastic_Empty.get(7L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" PP", "P P", "PPP", 'P', OrePrefixes.plate.get(Materials.Plastic)}); - - ItemList.Spray_Empty.set(addItem(tLastID = 402, "Empty Spray Can", "Used for making Sprays", new Object[]{new ItemData(Materials.Tin, OrePrefixes.plate.mMaterialAmount * 2L, Materials.Redstone, OrePrefixes.dust.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)})); - - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), ItemList.Spray_Empty.get(1L, new Object[0]), 800, 1); - - ItemList.Crate_Empty.set(addItem(tLastID = 403, "Empty Crate", "To Package lots of Material", new Object[]{new ItemData(Materials.Wood, 3628800L, Materials.Iron, OrePrefixes.screw.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.AnyIron)}); - GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.Steel)}); - - ItemList.ThermosCan_Empty.set(addItem(tLastID = 404, "Empty Thermos Can", "Keeping hot things hot and cold things cold", new Object[]{new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 1L + 2L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L)})); - - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Aluminium, 2L), ItemList.ThermosCan_Empty.get(1L, new Object[0]), 800, 1); - - ItemList.Large_Fluid_Cell_Steel.set(addItem(tLastID = 405, "Large Steel Fluid Cell", "", new Object[]{new ItemData(Materials.Steel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Bronze, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)})); + ItemList.Shape_Mold_Plate.set(addItem(tLastID = 301, "Mold (Plate)", "Mold for making Plates")); + ItemList.Shape_Mold_Casing.set(addItem(tLastID = 302, "Mold (Casing)", "Mold for making Item Casings")); + ItemList.Shape_Mold_Gear.set(addItem(tLastID = 303, "Mold (Gear)", "Mold for making Gears")); + ItemList.Shape_Mold_Credit.set(addItem(tLastID = 304, "Mold (Coinage)", "Secure Mold for making Coins (Don't lose it!)")); + ItemList.Shape_Mold_Bottle.set(addItem(tLastID = 305, "Mold (Bottle)", "Mold for making Bottles")); + ItemList.Shape_Mold_Ingot.set(addItem(tLastID = 306, "Mold (Ingot)", "Mold for making Ingots")); + ItemList.Shape_Mold_Ball.set(addItem(tLastID = 307, "Mold (Ball)", "Mold for making Balls")); + ItemList.Shape_Mold_Block.set(addItem(tLastID = 308, "Mold (Block)", "Mold for making Blocks")); + ItemList.Shape_Mold_Nugget.set(addItem(tLastID = 309, "Mold (Nuggets)", "Mold for making Nuggets")); + ItemList.Shape_Mold_Bun.set(addItem(tLastID = 310, "Mold (Buns)", "Mold for shaping Buns")); + ItemList.Shape_Mold_Bread.set(addItem(tLastID = 311, "Mold (Bread)", "Mold for shaping Breads")); + ItemList.Shape_Mold_Baguette.set(addItem(tLastID = 312, "Mold (Baguette)", "Mold for shaping Baguettes")); + ItemList.Shape_Mold_Cylinder.set(addItem(tLastID = 313, "Mold (Cylinder)", "Mold for shaping Cylinders")); + ItemList.Shape_Mold_Anvil.set(addItem(tLastID = 314, "Mold (Anvil)", "Mold for shaping Anvils")); + ItemList.Shape_Mold_Name.set(addItem(tLastID = 315, "Mold (Name)", "Mold for naming Items (rename Mold with Anvil)")); + ItemList.Shape_Mold_Arrow.set(addItem(tLastID = 316, "Mold (Arrow Head)", "Mold for making Arrow Heads")); + ItemList.Shape_Mold_Gear_Small.set(addItem(tLastID = 317, "Mold (Small Gear)", "Mold for making small Gears")); + ItemList.Shape_Mold_Rod.set(addItem(tLastID = 318, "Mold (Rod)", "Mold for making Rods")); + ItemList.Shape_Mold_Bolt.set(addItem(tLastID = 319, "Mold (Bolt)", "Mold for making Bolts")); + ItemList.Shape_Mold_Round.set(addItem(tLastID = 320, "Mold (Round)", "Mold for making Rounds")); + ItemList.Shape_Mold_Screw.set(addItem(tLastID = 321, "Mold (Screw)", "Mold for making Screws")); + ItemList.Shape_Mold_Ring.set(addItem(tLastID = 322, "Mold (Ring)", "Mold for making Rings")); + ItemList.Shape_Mold_Rod_Long.set(addItem(tLastID = 323, "Mold (Long Rod)", "Mold for making Long Rods")); + ItemList.Shape_Mold_Rotor.set(addItem(tLastID = 324, "Mold (Rotor)", "Mold for making a Rotor")); + ItemList.Shape_Mold_Turbine_Blade.set(addItem(tLastID = 325, "Mold (Turbine Blade)", "Mold for making a Turbine Blade")); + ItemList.Shape_Mold_Pipe_Tiny.set(addItem(tLastID = 326, "Mold (Tiny Pipe)", "Mold for making tiny Pipes")); + ItemList.Shape_Mold_Pipe_Small.set(addItem(tLastID = 327, "Mold (Small Pipe)", "Mold for making small Pipes")); + ItemList.Shape_Mold_Pipe_Medium.set(addItem(tLastID = 328, "Mold (Normal Pipe)", "Mold for making Pipes")); + ItemList.Shape_Mold_Pipe_Large.set(addItem(tLastID = 329, "Mold (Large Pipe)", "Mold for making large Pipes")); + ItemList.Shape_Mold_Pipe_Huge.set(addItem(tLastID = 330, "Mold (Huge Pipe)", "Mold for making full Block Pipes")); + GT_ModHandler.removeRecipe(new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass)); + + ItemList.Shape_Extruder_Plate.set(addItem(tLastID = 350, "Extruder Shape (Plate)", "Extruder Shape for making Plates")); + ItemList.Shape_Extruder_Rod.set(addItem(tLastID = 351, "Extruder Shape (Rod)", "Extruder Shape for making Rods")); + ItemList.Shape_Extruder_Bolt.set(addItem(tLastID = 352, "Extruder Shape (Bolt)", "Extruder Shape for making Bolts")); + ItemList.Shape_Extruder_Ring.set(addItem(tLastID = 353, "Extruder Shape (Ring)", "Extruder Shape for making Rings")); + ItemList.Shape_Extruder_Cell.set(addItem(tLastID = 354, "Extruder Shape (Cell)", "Extruder Shape for making Cells")); + ItemList.Shape_Extruder_Ingot.set(addItem(tLastID = 355, "Extruder Shape (Ingot)", "Extruder Shape for, wait, can't we just use a Furnace?")); + ItemList.Shape_Extruder_Wire.set(addItem(tLastID = 356, "Extruder Shape (Wire)", "Extruder Shape for making Wires")); + ItemList.Shape_Extruder_Casing.set(addItem(tLastID = 357, "Extruder Shape (Casing)", "Extruder Shape for making Item Casings")); + ItemList.Shape_Extruder_Pipe_Tiny.set(addItem(tLastID = 358, "Extruder Shape (Tiny Pipe)", "Extruder Shape for making tiny Pipes")); + ItemList.Shape_Extruder_Pipe_Small.set(addItem(tLastID = 359, "Extruder Shape (Small Pipe)", "Extruder Shape for making small Pipes")); + ItemList.Shape_Extruder_Pipe_Medium.set(addItem(tLastID = 360, "Extruder Shape (Normal Pipe)", "Extruder Shape for making Pipes")); + ItemList.Shape_Extruder_Pipe_Large.set(addItem(tLastID = 361, "Extruder Shape (Large Pipe)", "Extruder Shape for making large Pipes")); + ItemList.Shape_Extruder_Pipe_Huge.set(addItem(tLastID = 362, "Extruder Shape (Huge Pipe)", "Extruder Shape for making full Block Pipes")); + ItemList.Shape_Extruder_Block.set(addItem(tLastID = 363, "Extruder Shape (Block)", "Extruder Shape for making Blocks")); + ItemList.Shape_Extruder_Sword.set(addItem(tLastID = 364, "Extruder Shape (Sword Blade)", "Extruder Shape for making Swords")); + ItemList.Shape_Extruder_Pickaxe.set(addItem(tLastID = 365, "Extruder Shape (Pickaxe Head)", "Extruder Shape for making Pickaxes")); + ItemList.Shape_Extruder_Shovel.set(addItem(tLastID = 366, "Extruder Shape (Shovel Head)", "Extruder Shape for making Shovels")); + ItemList.Shape_Extruder_Axe.set(addItem(tLastID = 367, "Extruder Shape (Axe Head)", "Extruder Shape for making Axes")); + ItemList.Shape_Extruder_Hoe.set(addItem(tLastID = 368, "Extruder Shape (Hoe Head)", "Extruder Shape for making Hoes")); + ItemList.Shape_Extruder_Hammer.set(addItem(tLastID = 369, "Extruder Shape (Hammer Head)", "Extruder Shape for making Hammers")); + ItemList.Shape_Extruder_File.set(addItem(tLastID = 370, "Extruder Shape (File Head)", "Extruder Shape for making Files")); + ItemList.Shape_Extruder_Saw.set(addItem(tLastID = 371, "Extruder Shape (Saw Blade)", "Extruder Shape for making Saws")); + ItemList.Shape_Extruder_Gear.set(addItem(tLastID = 372, "Extruder Shape (Gear)", "Extruder Shape for making Gears")); + ItemList.Shape_Extruder_Bottle.set(addItem(tLastID = 373, "Extruder Shape (Bottle)", "Extruder Shape for making Bottles")); + ItemList.Shape_Extruder_Rotor.set(addItem(tLastID = 374, "Extruder Shape (Rotor)", "Extruder Shape for a Rotor")); + ItemList.Shape_Extruder_Small_Gear.set(addItem(tLastID = 375, "Extruder Shape (Small Gear)", "Extruder Shape for a Small Gear")); + ItemList.Shape_Extruder_Turbine_Blade.set(addItem(tLastID = 376, "Extruder Shape (Turbine Blade)", "Extruder Shape for a Turbine Blade")); + + ItemList.Shape_Slicer_Flat.set(addItem(tLastID = 398, "Slicer Blade (Flat)", "Slicer Blade for cutting Flat")); + ItemList.Shape_Slicer_Stripes.set(addItem(tLastID = 399, "Slicer Blade (Stripes)", "Slicer Blade for cutting Stripes")); + + GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Flat.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", aTextShape, "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Shape_Slicer_Stripes.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", 'P', ItemList.Shape_Extruder_Block, 'X', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel)}); + + ItemList.Fuel_Can_Plastic_Empty.set(addItem(tLastID = 400, "Empty Plastic Fuel Can", "Used to store Fuels", new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + ItemList.Fuel_Can_Plastic_Filled.set(addItem(tLastID = 401, "Plastic Fuel Can", "Burns well in Diesel Generators", new ItemData(Materials.Plastic, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Fuel_Can_Plastic_Empty.get(7L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" PP", "P P", "PPP", 'P', OrePrefixes.plate.get(Materials.Plastic)}); + + ItemList.Spray_Empty.set(addItem(tLastID = 402, "Empty Spray Can", "Used for making Sprays", new ItemData(Materials.Tin, OrePrefixes.plate.mMaterialAmount * 2L, Materials.Redstone, OrePrefixes.dust.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), ItemList.Spray_Empty.get(1L), 800, 1); + + ItemList.Crate_Empty.set(addItem(tLastID = 403, "Empty Crate", "To Package lots of Material", new ItemData(Materials.Wood, 3628800L, Materials.Iron, OrePrefixes.screw.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.AnyIron)}); + GT_ModHandler.addCraftingRecipe(ItemList.Crate_Empty.get(4L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"SWS", "WdW", "SWS", 'W', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.screw.get(Materials.Steel)}); + + ItemList.ThermosCan_Empty.set(addItem(tLastID = 404, "Empty Thermos Can", "Keeping hot things hot and cold things cold", new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 1L + 2L * OrePrefixes.ring.mMaterialAmount), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L))); + + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Aluminium, 2L), ItemList.ThermosCan_Empty.get(1L), 800, 1); + + ItemList.Large_Fluid_Cell_Steel.set(addItem(tLastID = 405, "Large Steel Fluid Cell", "", new ItemData(Materials.Steel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Bronze, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); setFluidContainerStats(32000 + tLastID, 8000L, 64L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnyBronze, 4L), ItemList.Large_Fluid_Cell_Steel.get(1L, new Object[0]), 200, 30); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnyBronze, 4L), ItemList.Large_Fluid_Cell_Steel.get(1L), 200, 30); - ItemList.Large_Fluid_Cell_TungstenSteel.set(addItem(tLastID = 406, "Large Tungstensteel Fluid Cell", "", new Object[]{new ItemData(Materials.TungstenSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Platinum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 9L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 7L)})); + ItemList.Large_Fluid_Cell_TungstenSteel.set(addItem(tLastID = 406, "Large Tungstensteel Fluid Cell", "", new ItemData(Materials.TungstenSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Platinum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 9L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 7L))); setFluidContainerStats(32000 + tLastID, 512000L, 32L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Platinum, 4L), ItemList.Large_Fluid_Cell_TungstenSteel.get(1L, new Object[0]), 200, 480); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Platinum, 4L), ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), 200, 480); - ItemList.Large_Fluid_Cell_Aluminium.set(addItem(tLastID = 407, "Large Aluminium Fluid Cell", "", new Object[]{new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Silver, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 5L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 3L)})); + ItemList.Large_Fluid_Cell_Aluminium.set(addItem(tLastID = 407, "Large Aluminium Fluid Cell", "", new ItemData(Materials.Aluminium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Silver, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 5L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 3L))); setFluidContainerStats(32000 + tLastID, 32000L, 64L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Silver, 4L), ItemList.Large_Fluid_Cell_Aluminium.get(1L, new Object[0]), 200, 64); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Silver, 4L), ItemList.Large_Fluid_Cell_Aluminium.get(1L), 200, 64); - ItemList.Large_Fluid_Cell_StainlessSteel.set(addItem(tLastID = 408, "Large Stainless Steel Fluid Cell", "", new Object[]{new ItemData(Materials.StainlessSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Electrum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L)})); + ItemList.Large_Fluid_Cell_StainlessSteel.set(addItem(tLastID = 408, "Large Stainless Steel Fluid Cell", "", new ItemData(Materials.StainlessSteel, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Electrum, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); setFluidContainerStats(32000 + tLastID, 64000L, 64L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.StainlessSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Electrum, 4L), ItemList.Large_Fluid_Cell_StainlessSteel.get(1L, new Object[0]), 200, 120); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.StainlessSteel, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Electrum, 4L), ItemList.Large_Fluid_Cell_StainlessSteel.get(1L), 200, 120); - ItemList.Large_Fluid_Cell_Titanium.set(addItem(tLastID = 409, "Large Titanium Fluid Cell", "", new Object[]{new ItemData(Materials.Titanium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.RoseGold, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 7L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 5L)})); + ItemList.Large_Fluid_Cell_Titanium.set(addItem(tLastID = 409, "Large Titanium Fluid Cell", "", new ItemData(Materials.Titanium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.RoseGold, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 7L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 5L))); setFluidContainerStats(32000 + tLastID, 128000L, 64L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Titanium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.RoseGold, 4L), ItemList.Large_Fluid_Cell_Titanium.get(1L, new Object[0]), 200, 256); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Titanium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.RoseGold, 4L), ItemList.Large_Fluid_Cell_Titanium.get(1L), 200, 256); - ItemList.Large_Fluid_Cell_Chrome.set(addItem(tLastID = 410, "Large Chrome Fluid Cell", "", new Object[]{new ItemData(Materials.Chrome, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Palladium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 6L)})); + ItemList.Large_Fluid_Cell_Chrome.set(addItem(tLastID = 410, "Large Chrome Fluid Cell", "", new ItemData(Materials.Chrome, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Palladium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 6L))); setFluidContainerStats(32000 + tLastID, 2048000L, 8L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Chrome, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Palladium, 4L), ItemList.Large_Fluid_Cell_Chrome.get(1L, new Object[0]), 200, 1024); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Chrome, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Palladium, 4L), ItemList.Large_Fluid_Cell_Chrome.get(1L), 200, 1024); - ItemList.Large_Fluid_Cell_Iridium.set(addItem(tLastID = 411, "Large Iridium Fluid Cell", "", new Object[]{new ItemData(Materials.Iridium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Naquadah, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 10L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L)})); + ItemList.Large_Fluid_Cell_Iridium.set(addItem(tLastID = 411, "Large Iridium Fluid Cell", "", new ItemData(Materials.Iridium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Naquadah, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 10L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); setFluidContainerStats(32000 + tLastID, 8192000L, 2L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Naquadah, 4L), ItemList.Large_Fluid_Cell_Iridium.get(1L, new Object[0]), 200, 1920); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Naquadah, 4L), ItemList.Large_Fluid_Cell_Iridium.get(1L), 200, 1920); - ItemList.Large_Fluid_Cell_Osmium.set(addItem(tLastID = 412, "Large Osmium Fluid Cell", "", new Object[]{new ItemData(Materials.Osmium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.ElectrumFlux, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 11L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 9L)})); + ItemList.Large_Fluid_Cell_Osmium.set(addItem(tLastID = 412, "Large Osmium Fluid Cell", "", new ItemData(Materials.Osmium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.ElectrumFlux, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 11L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 9L))); setFluidContainerStats(32000 + tLastID, 32768000L, 1L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.ElectrumFlux, 4L), ItemList.Large_Fluid_Cell_Osmium.get(1L, new Object[0]), 200, 4096); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.ElectrumFlux, 4L), ItemList.Large_Fluid_Cell_Osmium.get(1L), 200, 4096); - ItemList.Large_Fluid_Cell_Neutronium.set(addItem(tLastID = 413, "Large Neutronium Fluid Cell", "", new Object[]{new ItemData(Materials.Neutronium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Draconium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 12L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 10L)})); + ItemList.Large_Fluid_Cell_Neutronium.set(addItem(tLastID = 413, "Large Neutronium Fluid Cell", "", new ItemData(Materials.Neutronium, OrePrefixes.plateDouble.mMaterialAmount * 4L, new MaterialStack(Materials.Draconium, OrePrefixes.ring.mMaterialAmount * 4L)), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 12L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 10L))); setFluidContainerStats(32000 + tLastID, 131072000L, 1L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Draconium, 4L), ItemList.Large_Fluid_Cell_Neutronium.get(1L, new Object[0]), 200, 7680); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Draconium, 4L), ItemList.Large_Fluid_Cell_Neutronium.get(1L), 200, 7680); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - ItemList.SPRAY_CAN_DYES[i].set(addItem(tLastID = 430 + 2 * i, "Spray Can (" + Dyes.get(i).mName + ")", "Full", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L)})); - ItemList.SPRAY_CAN_DYES_USED[i].set(addItem(tLastID + 1, "Spray Can (" + Dyes.get(i).mName + ")", "Used", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 3L), SubTag.INVISIBLE})); - IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Spray_Color(ItemList.Spray_Empty.get(1L, new Object[0]), ItemList.SPRAY_CAN_DYES_USED[i].get(1L, new Object[0]), ItemList.SPRAY_CAN_DYES[i].get(1L, new Object[0]), 512L, i); + ItemList.SPRAY_CAN_DYES[i].set(addItem(tLastID = 430 + 2 * i, "Spray Can (" + Dyes.get(i).mName + ")", "Full", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.SPRAY_CAN_DYES_USED[i].set(addItem(tLastID + 1, "Spray Can (" + Dyes.get(i).mName + ")", "Used", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 3L), SubTag.INVISIBLE)); + IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Spray_Color(ItemList.Spray_Empty.get(1L), ItemList.SPRAY_CAN_DYES_USED[i].get(1L), ItemList.SPRAY_CAN_DYES[i].get(1L), 512L, i); addItemBehavior(32000 + tLastID, tBehaviour); addItemBehavior(32001 + tLastID, tBehaviour); } - ItemList.Tool_Matches.set(addItem(tLastID = 471, "Match", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Tool_MatchBox_Used.set(addItem(tLastID = 472, "Match Box", "This is not a Car", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE})); - ItemList.Tool_MatchBox_Full.set(addItem(tLastID = 473, "Match Box (Full)", "This is not a Car", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Tool_Matches.set(addItem(tLastID = 471, "Match", "", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_MatchBox_Used.set(addItem(tLastID = 472, "Match Box", "This is not a Car", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); + ItemList.Tool_MatchBox_Full.set(addItem(tLastID = 473, "Match Box (Full)", "This is not a Car", new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_Matches.get(1L, new Object[0]), ItemList.Tool_Matches.get(1L, new Object[0]), 1L); + IItemBehaviour<GT_MetaBase_Item> tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_Matches.get(1L), ItemList.Tool_Matches.get(1L), 1L); addItemBehavior(32471, tBehaviour); - tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_MatchBox_Used.get(1L, new Object[0]), ItemList.Tool_MatchBox_Full.get(1L, new Object[0]), 16L); + tBehaviour = new Behaviour_Lighter(null, ItemList.Tool_MatchBox_Used.get(1L), ItemList.Tool_MatchBox_Full.get(1L), 16L); addItemBehavior(32472, tBehaviour); addItemBehavior(32473, tBehaviour); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Phosphorus, 1L), ItemList.Tool_Matches.get(1L, new Object[0]), 16, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.TricalciumPhosphate, 1L), ItemList.Tool_Matches.get(1L, new Object[0]), 16, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Phosphorus, 1L), ItemList.Tool_Matches.get(4L, new Object[0]), 64, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TricalciumPhosphate, 1L), ItemList.Tool_Matches.get(4L, new Object[0]), 64, 16); - GT_Values.RA.addBoxingRecipe(ItemList.Tool_Matches.get(16L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L), ItemList.Tool_MatchBox_Full.get(1L, new Object[0]), 64, 16); - GT_Values.RA.addUnboxingRecipe(ItemList.Tool_MatchBox_Full.get(1L, new Object[0]), ItemList.Tool_Matches.get(16L, new Object[0]), null, 32, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Phosphorus, 1L), ItemList.Tool_Matches.get(1L), 16, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.TricalciumPhosphate, 1L), ItemList.Tool_Matches.get(1L), 16, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Phosphorus, 1L), ItemList.Tool_Matches.get(4L), 64, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Wood, 4L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.TricalciumPhosphate, 1L), ItemList.Tool_Matches.get(4L), 64, 16); + GT_Values.RA.addBoxingRecipe(ItemList.Tool_Matches.get(16L), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Paper, 1L), ItemList.Tool_MatchBox_Full.get(1L), 64, 16); + GT_Values.RA.addUnboxingRecipe(ItemList.Tool_MatchBox_Full.get(1L), ItemList.Tool_Matches.get(16L), null, 32, 16); - ItemList.Tool_Lighter_Invar_Empty.set(addItem(tLastID = 474, "Lighter (Empty)", "", new Object[]{new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Tool_Lighter_Invar_Used.set(addItem(tLastID = 475, "Lighter", "", new Object[]{new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE})); - ItemList.Tool_Lighter_Invar_Full.set(addItem(tLastID = 476, "Lighter (Full)", "", new Object[]{new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Tool_Lighter_Invar_Empty.set(addItem(tLastID = 474, "Lighter (Empty)", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_Lighter_Invar_Used.set(addItem(tLastID = 475, "Lighter", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); + ItemList.Tool_Lighter_Invar_Full.set(addItem(tLastID = 476, "Lighter (Full)", "", new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Invar_Empty.get(1L, new Object[0]), ItemList.Tool_Lighter_Invar_Used.get(1L, new Object[0]), ItemList.Tool_Lighter_Invar_Full.get(1L, new Object[0]), 100L); + tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Invar_Empty.get(1L), ItemList.Tool_Lighter_Invar_Used.get(1L), ItemList.Tool_Lighter_Invar_Full.get(1L), 100L); addItemBehavior(32475, tBehaviour); addItemBehavior(32476, tBehaviour); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 2L), new ItemStack(Items.flint, 1), ItemList.Tool_Lighter_Invar_Empty.get(1L, new Object[0]), 256, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 2L), new ItemStack(Items.flint, 1), ItemList.Tool_Lighter_Invar_Empty.get(1L), 256, 16); - ItemList.Tool_Lighter_Platinum_Empty.set(addItem(tLastID = 477, "Platinum Lighter (Empty)", "A known Prank Master is engraved on it", new Object[]{new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Tool_Lighter_Platinum_Used.set(addItem(tLastID = 478, "Platinum Lighter", "A known Prank Master is engraved on it", new Object[]{new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE})); - ItemList.Tool_Lighter_Platinum_Full.set(addItem(tLastID = 479, "Platinum Lighter (Full)", "A known Prank Master is engraved on it", new Object[]{new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Tool_Lighter_Platinum_Empty.set(addItem(tLastID = 477, "Platinum Lighter (Empty)", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Tool_Lighter_Platinum_Used.set(addItem(tLastID = 478, "Platinum Lighter", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), SubTag.INVISIBLE)); + ItemList.Tool_Lighter_Platinum_Full.set(addItem(tLastID = 479, "Platinum Lighter (Full)", "A known Prank Master is engraved on it", new ItemData(Materials.Platinum, OrePrefixes.plate.mMaterialAmount * 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); - tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Platinum_Empty.get(1L, new Object[0]), ItemList.Tool_Lighter_Platinum_Used.get(1L, new Object[0]), ItemList.Tool_Lighter_Platinum_Full.get(1L, new Object[0]), 1000L); + tBehaviour = new Behaviour_Lighter(ItemList.Tool_Lighter_Platinum_Empty.get(1L), ItemList.Tool_Lighter_Platinum_Used.get(1L), ItemList.Tool_Lighter_Platinum_Full.get(1L), 1000L); addItemBehavior(32478, tBehaviour); addItemBehavior(32479, tBehaviour); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Platinum, 2L), new ItemStack(Items.flint, 1), ItemList.Tool_Lighter_Platinum_Empty.get(1L, new Object[0]), 256, 256); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Platinum, 2L), new ItemStack(Items.flint, 1), ItemList.Tool_Lighter_Platinum_Empty.get(1L), 256, 256); if (Loader.isModLoaded("GalacticraftMars")) { - ItemList.Ingot_Heavy1.set(addItem(tLastID = 462, "Heavy Duty Alloy Ingot T1", "Used to make Heavy Duty Plates T1", new Object[0])); - ItemList.Ingot_Heavy2.set(addItem(tLastID = 463, "Heavy Duty Alloy Ingot T2", "Used to make Heavy Duty Plates T2", new Object[0])); - ItemList.Ingot_Heavy3.set(addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3", new Object[0])); + ItemList.Ingot_Heavy1.set(addItem(tLastID = 462, "Heavy Duty Alloy Ingot T1", "Used to make Heavy Duty Plates T1")); + ItemList.Ingot_Heavy2.set(addItem(tLastID = 463, "Heavy Duty Alloy Ingot T2", "Used to make Heavy Duty Plates T2")); + ItemList.Ingot_Heavy3.set(addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3")); //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B', OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A', OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)}); } - ItemList.Ingot_IridiumAlloy.set(addItem(tLastID = 480, "Iridium Alloy Ingot", "Used to make Iridium Plates", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)})); + ItemList.Ingot_IridiumAlloy.set(addItem(tLastID = 480, "Iridium Alloy Ingot", "Used to make Iridium Plates", new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L))); //GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); //GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A', OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)}); - ItemList.Paper_Printed_Pages.set(addItem(tLastID = 481, "Printed Pages", "Used to make written Books", new Object[]{new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), new Behaviour_PrintedPages(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - ItemList.Paper_Magic_Empty.set(addItem(tLastID = 482, "Magic Paper", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 1L)})); - ItemList.Paper_Magic_Page.set(addItem(tLastID = 483, "Enchanted Page", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 2L)})); - ItemList.Paper_Magic_Pages.set(addItem(tLastID = 484, "Enchanted Pages", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4L)})); - ItemList.Paper_Punch_Card_Empty.set(addItem(tLastID = 485, "Punch Card", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L)})); - ItemList.Paper_Punch_Card_Encoded.set(addItem(tLastID = 486, "Punched Card", "", new Object[]{SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - ItemList.Book_Written_01.set(addItem(tLastID = 487, "Book", "", new Object[]{new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - ItemList.Book_Written_02.set(addItem(tLastID = 488, "Book", "", new Object[]{new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - ItemList.Book_Written_03.set(addItem(tLastID = 489, "Book", "", new Object[]{new ItemData(Materials.Paper, 10886400L, new MaterialStack[0]), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - - ItemList.Schematic.set(addItem(tLastID = 490, "Schematic", "EMPTY", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 1L)})); - ItemList.Schematic_Crafting.set(addItem(tLastID = 491, "Schematic (Crafting)", "Crafts the Programmed Recipe", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)})); - ItemList.Schematic_1by1.set(addItem(tLastID = 495, "Schematic (1x1)", "Crafts 1 Items as 1x1 (use in Packager)", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)})); - ItemList.Schematic_2by2.set(addItem(tLastID = 496, "Schematic (2x2)", "Crafts 4 Items as 2x2 (use in Packager)", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)})); - ItemList.Schematic_3by3.set(addItem(tLastID = 497, "Schematic (3x3)", "Crafts 9 Items as 3x3 (use in Packager)", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)})); - ItemList.Schematic_Dust.set(addItem(tLastID = 498, "Schematic (Dusts)", "Combines Dusts (use in Packager)", new Object[]{new ItemData(Materials.StainlessSteel, 7257600L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_1by1.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_2by2.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_3by3.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); - GT_ModHandler.addCraftingRecipe(ItemList.Schematic_Dust.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{aTextEmptyRow, aTextShape, " d", 'P', ItemList.Schematic}); - - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Crafting}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_1by1}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_2by2}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_3by3}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Dust}); - - ItemList.Battery_Hull_LV.set(addItem(500, "Small Battery Hull", "An empty LV Battery Hull", new Object[]{new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 1L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Battery_Hull_MV.set(addItem(501, "Medium Battery Hull", "An empty MV Battery Hull", new Object[]{new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 3L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - ItemList.Battery_Hull_HV.set(addItem(502, "Large Battery Hull", "An empty HV Battery Hull", new Object[]{new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 9L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"C", "P", "P", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireTin}); - GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"C C", "PPP", "PPP", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireCopper}); - - ItemList.Battery_RE_ULV_Tantalum.set(addItem(tLastID = 499, "Tantalum Capacitor", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)})); + ItemList.Paper_Printed_Pages.set(addItem(tLastID = 481, "Printed Pages", "Used to make written Books", new ItemData(Materials.Paper, 10886400L), new Behaviour_PrintedPages(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Paper_Magic_Empty.set(addItem(tLastID = 482, "Magic Paper", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 1L))); + ItemList.Paper_Magic_Page.set(addItem(tLastID = 483, "Enchanted Page", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 3628800L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 2L))); + ItemList.Paper_Magic_Pages.set(addItem(tLastID = 484, "Enchanted Pages", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 10886400L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4L))); + ItemList.Paper_Punch_Card_Empty.set(addItem(tLastID = 485, "Punch Card", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); + ItemList.Paper_Punch_Card_Encoded.set(addItem(tLastID = 486, "Punched Card", "", SubTag.INVISIBLE, new ItemData(Materials.Paper, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_01.set(addItem(tLastID = 487, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_02.set(addItem(tLastID = 488, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Book_Written_03.set(addItem(tLastID = 489, "Book", "", new ItemData(Materials.Paper, 10886400L), "bookWritten", OreDictNames.craftingBook, new Behaviour_WrittenBook(), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + + ItemList.Schematic.set(addItem(tLastID = 490, "Schematic", "EMPTY", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 1L))); + ItemList.Schematic_Crafting.set(addItem(tLastID = 491, "Schematic (Crafting)", "Crafts the Programmed Recipe", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_1by1.set(addItem(tLastID = 495, "Schematic (1x1)", "Crafts 1 Items as 1x1 (use in Packager)", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_2by2.set(addItem(tLastID = 496, "Schematic (2x2)", "Crafts 4 Items as 2x2 (use in Packager)", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_3by3.set(addItem(tLastID = 497, "Schematic (3x3)", "Crafts 9 Items as 3x3 (use in Packager)", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + ItemList.Schematic_Dust.set(addItem(tLastID = 498, "Schematic (Dusts)", "Combines Dusts (use in Packager)", new ItemData(Materials.StainlessSteel, 7257600L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Schematic_1by1.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe(ItemList.Schematic_2by2.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d ", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe(ItemList.Schematic_3by3.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" d", aTextShape, aTextEmptyRow, 'P', ItemList.Schematic}); + GT_ModHandler.addCraftingRecipe(ItemList.Schematic_Dust.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{aTextEmptyRow, aTextShape, " d", 'P', ItemList.Schematic}); + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Crafting}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_1by1}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_2by2}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_3by3}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Schematic_Dust}); + + ItemList.Battery_Hull_LV.set(addItem(500, "Small Battery Hull", "An empty LV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Battery_Hull_MV.set(addItem(501, "Medium Battery Hull", "An empty MV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + ItemList.Battery_Hull_HV.set(addItem(502, "Large Battery Hull", "An empty HV Battery Hull", new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 9L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_LV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"C", "P", "P", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireTin}); + GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_MV.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"C C", "PPP", "PPP", 'P', OrePrefixes.plate.get(Materials.BatteryAlloy), 'C', OreDictNames.craftingWireCopper}); + + ItemList.Battery_RE_ULV_Tantalum.set(addItem(tLastID = 499, "Tantalum Capacitor", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); setElectricStats(32000 + tLastID, 1000L, GT_Values.V[0], 0L, -3L, false); - ItemList.Battery_SU_LV_SulfuricAcid.set(addItem(tLastID = 510, "Small Acid Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Battery_SU_LV_SulfuricAcid.set(addItem(tLastID = 510, "Small Acid Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 18000L, GT_Values.V[1], 1L, -2L, true); - ItemList.Battery_SU_LV_Mercury.set(addItem(tLastID = 511, "Small Mercury Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Battery_SU_LV_Mercury.set(addItem(tLastID = 511, "Small Mercury Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 32000L, GT_Values.V[1], 1L, -2L, true); - ItemList.Battery_RE_LV_Cadmium.set(addItem(tLastID = 517, "Small Cadmium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY"})); + ItemList.Battery_RE_LV_Cadmium.set(addItem(tLastID = 517, "Small Cadmium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY")); setElectricStats(32000 + tLastID, 75000L, GT_Values.V[1], 1L, -3L, true); - ItemList.Battery_RE_LV_Lithium.set(addItem(tLastID = 518, "Small Lithium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY"})); + ItemList.Battery_RE_LV_Lithium.set(addItem(tLastID = 518, "Small Lithium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY")); setElectricStats(32000 + tLastID, 100000L, GT_Values.V[1], 1L, -3L, true); - ItemList.Battery_RE_LV_Sodium.set(addItem(tLastID = 519, "Small Sodium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY"})); + ItemList.Battery_RE_LV_Sodium.set(addItem(tLastID = 519, "Small Sodium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), "calclavia:ADVANCED_BATTERY")); setElectricStats(32000 + tLastID, 50000L, GT_Values.V[1], 1L, -3L, true); - ItemList.Battery_SU_MV_SulfuricAcid.set(addItem(tLastID = 520, "Medium Acid Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L)})); + ItemList.Battery_SU_MV_SulfuricAcid.set(addItem(tLastID = 520, "Medium Acid Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 72000L, GT_Values.V[2], 2L, -2L, true); - ItemList.Battery_SU_MV_Mercury.set(addItem(tLastID = 521, "Medium Mercury Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L)})); + ItemList.Battery_SU_MV_Mercury.set(addItem(tLastID = 521, "Medium Mercury Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 128000L, GT_Values.V[2], 2L, -2L, true); - ItemList.Battery_RE_MV_Cadmium.set(addItem(tLastID = 527, "Medium Cadmium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Battery_RE_MV_Cadmium.set(addItem(tLastID = 527, "Medium Cadmium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 300000L, GT_Values.V[2], 2L, -3L, true); - ItemList.Battery_RE_MV_Lithium.set(addItem(tLastID = 528, "Medium Lithium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Battery_RE_MV_Lithium.set(addItem(tLastID = 528, "Medium Lithium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 400000L, GT_Values.V[2], 2L, -3L, true); - ItemList.Battery_RE_MV_Sodium.set(addItem(tLastID = 529, "Medium Sodium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)})); + ItemList.Battery_RE_MV_Sodium.set(addItem(tLastID = 529, "Medium Sodium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); setElectricStats(32000 + tLastID, 200000L, GT_Values.V[2], 2L, -3L, true); - ItemList.Battery_SU_HV_SulfuricAcid.set(addItem(tLastID = 530, "Large Acid Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L)})); + ItemList.Battery_SU_HV_SulfuricAcid.set(addItem(tLastID = 530, "Large Acid Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); setElectricStats(32000 + tLastID, 288000L, GT_Values.V[3], 3L, -2L, true); - ItemList.Battery_SU_HV_Mercury.set(addItem(tLastID = 531, "Large Mercury Battery", "Single Use", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L)})); + ItemList.Battery_SU_HV_Mercury.set(addItem(tLastID = 531, "Large Mercury Battery", "Single Use", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L))); setElectricStats(32000 + tLastID, 512000L, GT_Values.V[3], 3L, -2L, true); - ItemList.Battery_RE_HV_Cadmium.set(addItem(tLastID = 537, "Large Cadmium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L)})); + ItemList.Battery_RE_HV_Cadmium.set(addItem(tLastID = 537, "Large Cadmium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 1200000L, GT_Values.V[3], 3L, -3L, true); - ItemList.Battery_RE_HV_Lithium.set(addItem(tLastID = 538, "Large Lithium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L)})); + ItemList.Battery_RE_HV_Lithium.set(addItem(tLastID = 538, "Large Lithium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 1600000L, GT_Values.V[3], 3L, -3L, true); - ItemList.Battery_RE_HV_Sodium.set(addItem(tLastID = 539, "Large Sodium Battery", "Reusable", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L)})); + ItemList.Battery_RE_HV_Sodium.set(addItem(tLastID = 539, "Large Sodium Battery", "Reusable", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L))); setElectricStats(32000 + tLastID, 800000L, GT_Values.V[3], 3L, -3L, true); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_SulfuricAcid.get(1L, new Object[0]), ItemList.Battery_Hull_LV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_Mercury.get(1L, new Object[0]), ItemList.Battery_Hull_LV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_SulfuricAcid.get(1L, new Object[0]), ItemList.Battery_Hull_MV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_Mercury.get(1L, new Object[0]), ItemList.Battery_Hull_MV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_SulfuricAcid.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_Mercury.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_LV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_LV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_LV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_MV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_MV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_MV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(1L, new Object[0])); - GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(1L, new Object[0])); - - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 2L), ItemList.Battery_Hull_LV.get(1L, new Object[0]), ItemList.Battery_RE_LV_Cadmium.get(1L, new Object[0]), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 2L), ItemList.Battery_Hull_LV.get(1L, new Object[0]), ItemList.Battery_RE_LV_Lithium.get(1L, new Object[0]), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 2L), ItemList.Battery_Hull_LV.get(1L, new Object[0]), ItemList.Battery_RE_LV_Sodium.get(1L, new Object[0]), null, 100, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 8L), ItemList.Battery_Hull_MV.get(1L, new Object[0]), ItemList.Battery_RE_MV_Cadmium.get(1L, new Object[0]), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 8L), ItemList.Battery_Hull_MV.get(1L, new Object[0]), ItemList.Battery_RE_MV_Lithium.get(1L, new Object[0]), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 8L), ItemList.Battery_Hull_MV.get(1L, new Object[0]), ItemList.Battery_RE_MV_Sodium.get(1L, new Object[0]), null, 400, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 32L), ItemList.Battery_Hull_HV.get(1L, new Object[0]), ItemList.Battery_RE_HV_Cadmium.get(1L, new Object[0]), null, 1600, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 32L), ItemList.Battery_Hull_HV.get(1L, new Object[0]), ItemList.Battery_RE_HV_Lithium.get(1L, new Object[0]), null, 1600, 2); - GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 32L), ItemList.Battery_Hull_HV.get(1L, new Object[0]), ItemList.Battery_RE_HV_Sodium.get(1L, new Object[0]), null, 1600, 2); - - ItemList.Energy_LapotronicOrb.set(addItem(tLastID = 597, "Lapotronic Energy Orb", "Reusable battery", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate)})); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_SulfuricAcid.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_LV_Mercury.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_SulfuricAcid.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_MV_Mercury.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_SulfuricAcid.get(1L), ItemList.Battery_Hull_HV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_SU_HV_Mercury.get(1L), ItemList.Battery_Hull_HV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Cadmium.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Lithium.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_LV_Sodium.get(1L), ItemList.Battery_Hull_LV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Cadmium.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Lithium.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_MV_Sodium.get(1L), ItemList.Battery_Hull_MV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Cadmium.get(1L), ItemList.Battery_Hull_HV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Lithium.get(1L), ItemList.Battery_Hull_HV.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Battery_RE_HV_Sodium.get(1L), ItemList.Battery_Hull_HV.get(1L)); + + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Cadmium.get(1L), null, 100, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L), null, 100, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 2L), ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_RE_LV_Sodium.get(1L), null, 100, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Cadmium.get(1L), null, 400, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Lithium.get(1L), null, 400, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 8L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_RE_MV_Sodium.get(1L), null, 400, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cadmium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Cadmium.get(1L), null, 1600, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lithium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Lithium.get(1L), null, 1600, 2); + GT_Values.RA.addCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 32L), ItemList.Battery_Hull_HV.get(1L), ItemList.Battery_RE_HV_Sodium.get(1L), null, 1600, 2); + + ItemList.Energy_LapotronicOrb.set(addItem(tLastID = 597, "Lapotronic Energy Orb", "Reusable battery", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 100000000L, GT_Values.V[5], 5L, -3L, true); - ItemList.ZPM.set(addItem(tLastID = 598, "Zero Point Module", "Single use battery", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L)})); + ItemList.ZPM.set(addItem(tLastID = 598, "Zero Point Module", "Single use battery", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, 2000000000000L, GT_Values.V[7], 7L, -2L, true); - ItemList.Energy_LapotronicOrb2.set(addItem(tLastID = 599, "Lapotronic Energy Orb Cluster", "Reusable battery", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate)})); + ItemList.Energy_LapotronicOrb2.set(addItem(tLastID = 599, "Lapotronic Energy Orb Cluster", "Reusable battery", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 1000000000L, GT_Values.V[6], 6L, -3L, true); - ItemList.ZPM2.set(addItem(tLastID = 605, "Ultimate Battery", "Fill this to win minecraft", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L)})); + ItemList.ZPM2.set(addItem(tLastID = 605, "Ultimate Battery", "Fill this to win minecraft", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, Long.MAX_VALUE, GT_Values.V[8], 8L, -3L, true); - ItemList.ZPM3.set(addItem(tLastID = 609, "Really Ultimate Battery", "Fill this to be way older", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L)})); + ItemList.ZPM3.set(addItem(tLastID = 609, "Really Ultimate Battery", "Fill this to be way older", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, Long.MAX_VALUE, GT_Values.V[12], 12L, -3L, true); - ItemList.Energy_Module.set(addItem(tLastID = 736, "Energy Module", "Reusable battery", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate)})); + ItemList.Energy_Module.set(addItem(tLastID = 736, "Energy Module", "Reusable battery", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), OrePrefixes.battery.get(Materials.Ultimate))); setElectricStats(32000 + tLastID, 10000000000L, GT_Values.V[7], 7L, -3L, true); - ItemList.Energy_Cluster.set(addItem(tLastID = 737, "Energy Cluster", "Reusable battery", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L)})); + ItemList.Energy_Cluster.set(addItem(tLastID = 737, "Energy Cluster", "Reusable battery", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L))); setElectricStats(32000 + tLastID, 100000000000L, GT_Values.V[8], 8L, -3L, true); - ItemList.Electric_Motor_LV.set(addItem(600, "Electric Motor (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)})); - ItemList.Electric_Motor_MV.set(addItem(601, "Electric Motor (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)})); - ItemList.Electric_Motor_HV.set(addItem(602, "Electric Motor (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)})); - ItemList.Electric_Motor_EV.set(addItem(603, "Electric Motor (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L)})); - ItemList.Electric_Motor_IV.set(addItem(604, "Electric Motor (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L)})); - ItemList.Electric_Motor_LuV.set(addItem(606, "Electric Motor (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L)})); - ItemList.Electric_Motor_ZPM.set(addItem(607, "Electric Motor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L)})); - ItemList.Electric_Motor_UV.set(addItem(608, "Electric Motor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L)})); - ItemList.Electric_Motor_UHV.set(addItem(596, "Electric Motor (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L)})); - ItemList.Electric_Motor_UEV.set(addItem(595, "Electric Motor (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.IronMagnetic), 'R', OrePrefixes.stick.get(Materials.AnyIron), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Steel), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Aluminium), 'W', OrePrefixes.wireGt02.get(Materials.Cupronickel), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.StainlessSteel), 'W', OrePrefixes.wireGt04.get(Materials.Electrum), 'C', OrePrefixes.cableGt02.get(Materials.Silver)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.Titanium), 'W', OrePrefixes.wireGt04.get(Materials.AnnealedCopper), 'C', OrePrefixes.cableGt02.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.TungstenSteel), 'W', OrePrefixes.wireGt04.get(Materials.Graphene), 'C', OrePrefixes.cableGt02.get(Materials.Tungsten)}); - - ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", "640 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L)})); - ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", "2560 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)})); - ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", "10240 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L)})); - ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", "40.960 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L)})); - ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", "163.840 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L)})); - ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", "655.360 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L)})); - ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", "2.621.440 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L)})); - ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", "10.485.760 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L)})); - ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", "20.971.520 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L)})); - ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", "41.943.040 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L)})); - - GregTech_API.registerCover(ItemList.Electric_Pump_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(32)); - GregTech_API.registerCover(ItemList.Electric_Pump_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(128)); - GregTech_API.registerCover(ItemList.Electric_Pump_HV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(512)); - GregTech_API.registerCover(ItemList.Electric_Pump_EV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(2048)); - GregTech_API.registerCover(ItemList.Electric_Pump_IV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(8192)); - GregTech_API.registerCover(ItemList.Electric_Pump_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(32768)); - GregTech_API.registerCover(ItemList.Electric_Pump_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072)); - GregTech_API.registerCover(ItemList.Electric_Pump_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288)); - GregTech_API.registerCover(ItemList.Electric_Pump_UHV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[9][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(1048576)); - GregTech_API.registerCover(ItemList.Electric_Pump_UEV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[9][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(2097152)); - - ItemList.FluidRegulator_LV.set(addItem(tLastID = 660, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_MV.set(addItem(tLastID = 661, "Fluid Regulator (MV)", "Configuable up to 2.560 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_HV.set(addItem(tLastID = 662, "Fluid Regulator (HV)", "Configuable up to 10.240 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_EV.set(addItem(tLastID = 663, "Fluid Regulator (EV)", "Configuable up to 40.960 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_IV.set(addItem(tLastID = 664, "Fluid Regulator (IV)", "Configuable up to 163.840 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_LuV.set(addItem(tLastID = 665, "Fluid Regulator (LuV)", "Configuable up to 655.360 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_ZPM.set(addItem(tLastID = 666, "Fluid Regulator (ZPM)", "Configuable up to 2.621.440 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - ItemList.FluidRegulator_UV.set(addItem(tLastID = 667, "Fluid Regulator (UV)", "Configuable up to 10.485.760 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click", new Object[]{})); - - GregTech_API.registerCover(ItemList.FluidRegulator_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(32)); - GregTech_API.registerCover(ItemList.FluidRegulator_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(128)); - GregTech_API.registerCover(ItemList.FluidRegulator_HV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(512)); - GregTech_API.registerCover(ItemList.FluidRegulator_EV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(2048)); - GregTech_API.registerCover(ItemList.FluidRegulator_IV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(8192)); - GregTech_API.registerCover(ItemList.FluidRegulator_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(32768)); - GregTech_API.registerCover(ItemList.FluidRegulator_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(131072)); - GregTech_API.registerCover(ItemList.FluidRegulator_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_FluidRegulator(524288)); - - ItemList.FluidFilter.set(addItem(669, "Fluid Filter Cover", "Set with Fluid Container to only accept one Fluid Type", new Object[]{})); - GregTech_API.registerCover(ItemList.FluidFilter.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SHUTTER)}), new GT_Cover_Fluidfilter()); - - /**ItemList.Rotor_LV.set(addItem(tLastID = 620, "Tin Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Tin), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L) })); + ItemList.Electric_Motor_LV.set(addItem(600, "Electric Motor (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.Electric_Motor_MV.set(addItem(601, "Electric Motor (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.Electric_Motor_HV.set(addItem(602, "Electric Motor (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); + ItemList.Electric_Motor_EV.set(addItem(603, "Electric Motor (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); + ItemList.Electric_Motor_IV.set(addItem(604, "Electric Motor (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); + ItemList.Electric_Motor_LuV.set(addItem(606, "Electric Motor (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); + ItemList.Electric_Motor_ZPM.set(addItem(607, "Electric Motor (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); + ItemList.Electric_Motor_UV.set(addItem(608, "Electric Motor (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); + ItemList.Electric_Motor_UHV.set(addItem(596, "Electric Motor (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); + ItemList.Electric_Motor_UEV.set(addItem(595, "Electric Motor (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.IronMagnetic), 'R', OrePrefixes.stick.get(Materials.AnyIron), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Steel), 'W', OrePrefixes.wireGt01.get(Materials.AnyCopper), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.Aluminium), 'W', OrePrefixes.wireGt02.get(Materials.Cupronickel), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.SteelMagnetic), 'R', OrePrefixes.stick.get(Materials.StainlessSteel), 'W', OrePrefixes.wireGt04.get(Materials.Electrum), 'C', OrePrefixes.cableGt02.get(Materials.Silver)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.Titanium), 'W', OrePrefixes.wireGt04.get(Materials.AnnealedCopper), 'C', OrePrefixes.cableGt02.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Motor_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", 'I', OrePrefixes.stick.get(Materials.NeodymiumMagnetic), 'R', OrePrefixes.stick.get(Materials.TungstenSteel), 'W', OrePrefixes.wireGt04.get(Materials.Graphene), 'C', OrePrefixes.cableGt02.get(Materials.Tungsten)}); + + ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", "640 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", "2560 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", "10240 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", "40.960 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", "163.840 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", "655.360 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); + ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", "2.621.440 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); + ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", "10.485.760 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); + ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", "20.971.520 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); + ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", "41.943.040 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + + GregTech_API.registerCover(ItemList.Electric_Pump_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(32)); + GregTech_API.registerCover(ItemList.Electric_Pump_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(128)); + GregTech_API.registerCover(ItemList.Electric_Pump_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(512)); + GregTech_API.registerCover(ItemList.Electric_Pump_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(2048)); + GregTech_API.registerCover(ItemList.Electric_Pump_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(8192)); + GregTech_API.registerCover(ItemList.Electric_Pump_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(32768)); + GregTech_API.registerCover(ItemList.Electric_Pump_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(131072)); + GregTech_API.registerCover(ItemList.Electric_Pump_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(524288)); + GregTech_API.registerCover(ItemList.Electric_Pump_UHV.get(1L), TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(1048576)); + GregTech_API.registerCover(ItemList.Electric_Pump_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_Pump(2097152)); + + ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", "20.480 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", "40.960 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", "81.920 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", "163.840 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", "327.680 L/sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + + GregTech_API.registerCover(ItemList.Steam_Valve_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(1024)); + GregTech_API.registerCover(ItemList.Steam_Valve_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(2048)); + GregTech_API.registerCover(ItemList.Steam_Valve_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(4096)); + GregTech_API.registerCover(ItemList.Steam_Valve_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(8192)); + GregTech_API.registerCover(ItemList.Steam_Valve_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(16384)); + + ItemList.FluidRegulator_LV.set(addItem(tLastID = 660, "Fluid Regulator (LV)", "Configuable up to 640 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_MV.set(addItem(tLastID = 661, "Fluid Regulator (MV)", "Configuable up to 2.560 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_HV.set(addItem(tLastID = 662, "Fluid Regulator (HV)", "Configuable up to 10.240 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_EV.set(addItem(tLastID = 663, "Fluid Regulator (EV)", "Configuable up to 40.960 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_IV.set(addItem(tLastID = 664, "Fluid Regulator (IV)", "Configuable up to 163.840 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_LuV.set(addItem(tLastID = 665, "Fluid Regulator (LuV)", "Configuable up to 655.360 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_ZPM.set(addItem(tLastID = 666, "Fluid Regulator (ZPM)", "Configuable up to 2.621.440 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + ItemList.FluidRegulator_UV.set(addItem(tLastID = 667, "Fluid Regulator (UV)", "Configuable up to 10.485.760 L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click")); + + GregTech_API.registerCover(ItemList.FluidRegulator_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(32)); + GregTech_API.registerCover(ItemList.FluidRegulator_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(128)); + GregTech_API.registerCover(ItemList.FluidRegulator_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(512)); + GregTech_API.registerCover(ItemList.FluidRegulator_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(2048)); + GregTech_API.registerCover(ItemList.FluidRegulator_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(8192)); + GregTech_API.registerCover(ItemList.FluidRegulator_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(32768)); + GregTech_API.registerCover(ItemList.FluidRegulator_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(131072)); + GregTech_API.registerCover(ItemList.FluidRegulator_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_PUMP)), new GT_Cover_FluidRegulator(524288)); + + ItemList.FluidFilter.set(addItem(669, "Fluid Filter Cover", "Set with Fluid Container to only accept one Fluid Type")); + GregTech_API.registerCover(ItemList.FluidFilter.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), new GT_Cover_Fluidfilter()); + ItemList.ItemFilter_Export.set(addItem(270,"Item Filter Cover (Export)", "Right click with an item to set filter (Only supports Export Mode)")); + GregTech_API.registerCover(ItemList.ItemFilter_Export.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_ItemFilter(true)); + ItemList.ItemFilter_Import.set(addItem(271,"Item Filter Cover (Import)", "Right click with an item to set filter (Only supports Import Mode)")); + GregTech_API.registerCover(ItemList.ItemFilter_Import.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_ItemFilter(false)); + + /*ItemList.Rotor_LV.set(addItem(tLastID = 620, "Tin Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Tin), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L) })); ItemList.Rotor_MV.set(addItem(tLastID = 621, "Bronze Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Bronze), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L) })); ItemList.Rotor_HV.set(addItem(tLastID = 622, "Steel Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Steel), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L) })); ItemList.Rotor_EV.set(addItem(tLastID = 623, "Stainless Steel Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.StainlessSteel), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L) })); @@ -580,284 +577,289 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.Rotor_ZPM.set(ItemList.Rotor_LuV.get(1L, new Object[0])); ItemList.Rotor_UV.set(ItemList.Rotor_ZPM.get(1L, new Object[0]));**/ - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_LV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Tin), 'S', OrePrefixes.screw.get(Materials.Tin), 'W', OrePrefixes.cableGt01.get(Materials.Tin), 'P', OrePrefixes.pipeMedium.get(Materials.Bronze)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_MV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Bronze), 'S', OrePrefixes.screw.get(Materials.Bronze), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'P', OrePrefixes.pipeMedium.get(Materials.Steel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_HV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Steel), 'S', OrePrefixes.screw.get(Materials.Steel), 'W', OrePrefixes.cableGt01.get(Materials.Gold), 'P', OrePrefixes.pipeMedium.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_EV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium), 'P', OrePrefixes.pipeMedium.get(Materials.Titanium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_IV, 'O', OrePrefixes.ring.get(Materials.AnySyntheticRubber), 'X', OrePrefixes.rotor.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten), 'P', OrePrefixes.pipeMedium.get(Materials.TungstenSteel)}); - - ItemList.Conveyor_Module_LV.set(addItem(630, "Conveyor Module (LV)", "1 Stack every 20 secs (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)})); - ItemList.Conveyor_Module_MV.set(addItem(631, "Conveyor Module (MV)", "1 Stack every 5 secs (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)})); - ItemList.Conveyor_Module_HV.set(addItem(632, "Conveyor Module (HV)", "1 Stack every 1 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L)})); - ItemList.Conveyor_Module_EV.set(addItem(633, "Conveyor Module (EV)", "1 Stack every 1/5 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L)})); - ItemList.Conveyor_Module_IV.set(addItem(634, "Conveyor Module (IV)", "1 Stack every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L)})); - ItemList.Conveyor_Module_LuV.set(addItem(635, "Conveyor Module (LuV)", "2 Stacks every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L)})); - ItemList.Conveyor_Module_ZPM.set(addItem(636, "Conveyor Module (ZPM)", "4 Stacks every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L)})); - ItemList.Conveyor_Module_UV.set(addItem(637, "Conveyor Module (UV)", "8 Stacks every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L)})); - ItemList.Conveyor_Module_UHV.set(addItem(638, "Conveyor Module (UHV)", "16 Stacks every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L)})); - ItemList.Conveyor_Module_UEV.set(addItem(639, "Conveyor Module (UEV)", "32 Stacks every 1/20 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten), 'R', OrePrefixes.plate.get(Materials.AnySyntheticRubber)}); - - GregTech_API.registerCover(ItemList.Conveyor_Module_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(400, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(100, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_HV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(20, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_EV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(4, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_IV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 1)); - GregTech_API.registerCover(ItemList.Conveyor_Module_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 2)); - GregTech_API.registerCover(ItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 4)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 8)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UHV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[9][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 16)); - GregTech_API.registerCover(ItemList.Conveyor_Module_UEV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[10][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(1, 32)); - - ItemList.Electric_Piston_LV.set(addItem(640, "Electric Piston (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)})); - ItemList.Electric_Piston_MV.set(addItem(641, "Electric Piston (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)})); - ItemList.Electric_Piston_HV.set(addItem(642, "Electric Piston (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)})); - ItemList.Electric_Piston_EV.set(addItem(643, "Electric Piston (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L)})); - ItemList.Electric_Piston_IV.set(addItem(644, "Electric Piston (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L)})); - ItemList.Electric_Piston_LuV.set(addItem(645,"Electric Piston (LuV)","", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L)})); - ItemList.Electric_Piston_ZPM.set(addItem(646, "Electric Piston (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L)})); - ItemList.Electric_Piston_UV.set(addItem(647, "Electric Piston (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L)})); - ItemList.Electric_Piston_UHV.set(addItem(648, "Electric Piston (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L)})); - ItemList.Electric_Piston_UEV.set(addItem(649, "Electric Piston (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel), 'G', OrePrefixes.gearGtSmall.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium), 'G', OrePrefixes.gearGtSmall.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Titanium), 'S', OrePrefixes.stick.get(Materials.Titanium), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - ItemList.Robot_Arm_LV.set(addItem(650, "Robot Arm (LV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L)})); - ItemList.Robot_Arm_MV.set(addItem(651, "Robot Arm (MV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)})); - ItemList.Robot_Arm_HV.set(addItem(652, "Robot Arm (HV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L)})); - ItemList.Robot_Arm_EV.set(addItem(653, "Robot Arm (EV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 8L)})); - ItemList.Robot_Arm_IV.set(addItem(654, "Robot Arm (IV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 16L)})); - ItemList.Robot_Arm_LuV.set(addItem(655, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 32L)})); - ItemList.Robot_Arm_ZPM.set(addItem(656, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 64L)})); - ItemList.Robot_Arm_UV.set(addItem(657, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 128L)})); - ItemList.Robot_Arm_UHV.set(addItem(658, "Robot Arm (UHV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 256L)})); - ItemList.Robot_Arm_UEV.set(addItem(659, "Robot Arm (UEV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'P', ItemList.Electric_Piston_LV, 'E', OrePrefixes.circuit.get(Materials.Basic), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'P', ItemList.Electric_Piston_MV, 'E', OrePrefixes.circuit.get(Materials.Good), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'P', ItemList.Electric_Piston_HV, 'E', OrePrefixes.circuit.get(Materials.Advanced), 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'P', ItemList.Electric_Piston_EV, 'E', OrePrefixes.circuit.get(Materials.Data), 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'P', ItemList.Electric_Piston_IV, 'E', OrePrefixes.circuit.get(Materials.Elite), 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - GregTech_API.registerCover(ItemList.Robot_Arm_LV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(400)); - GregTech_API.registerCover(ItemList.Robot_Arm_MV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(100)); - GregTech_API.registerCover(ItemList.Robot_Arm_HV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(20)); - GregTech_API.registerCover(ItemList.Robot_Arm_EV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(4)); - GregTech_API.registerCover(ItemList.Robot_Arm_IV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - GregTech_API.registerCover(ItemList.Robot_Arm_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - GregTech_API.registerCover(ItemList.Robot_Arm_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - GregTech_API.registerCover(ItemList.Robot_Arm_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - GregTech_API.registerCover(ItemList.Robot_Arm_UHV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[9][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - GregTech_API.registerCover(ItemList.Robot_Arm_UEV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[10][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(1)); - - ItemList.QuantumEye.set(addItem(tLastID = 724, "Quantum Eye", "Improved Ender Eye", new Object[0])); - ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star", new Object[0])); - ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star", new Object[0])); - - ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); - ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); - ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); - ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); - ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); - ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); - ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); - ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); - ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); - ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); - - ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)})); - ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)})); - ItemList.Emitter_HV.set(addItem(682, "Emitter (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L)})); - ItemList.Emitter_EV.set(addItem(683, "Emitter (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 8L)})); - ItemList.Emitter_IV.set(addItem(684, "Emitter (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 16L)})); - ItemList.Emitter_LuV.set(addItem(685, "Emitter (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 32L)})); - ItemList.Emitter_ZPM.set(addItem(686, "Emitter (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 64L)})); - ItemList.Emitter_UV.set(addItem(687, "Emitter (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 128L)})); - ItemList.Emitter_UHV.set(addItem(688, "Emitter (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 256L)})); - ItemList.Emitter_UEV.set(addItem(689, "Emitter (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'C', OrePrefixes.circuit.get(Materials.Basic), 'W', OrePrefixes.cableGt01.get(Materials.Tin)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderPearl), 'S', OrePrefixes.stick.get(Materials.Electrum), 'C', OrePrefixes.circuit.get(Materials.Good), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'C', OrePrefixes.circuit.get(Materials.Advanced), 'W', OrePrefixes.cableGt01.get(Materials.Gold)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'C', OrePrefixes.circuit.get(Materials.Data), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(ItemList.Emitter_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - - ItemList.Sensor_LV.set(addItem(690, "Sensor (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L)})); - ItemList.Sensor_MV.set(addItem(691, "Sensor (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L)})); - ItemList.Sensor_HV.set(addItem(692, "Sensor (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L)})); - ItemList.Sensor_EV.set(addItem(693, "Sensor (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 8L)})); - ItemList.Sensor_IV.set(addItem(694, "Sensor (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 16L)})); - ItemList.Sensor_LuV.set(addItem(695, "Sensor (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 32L)})); - ItemList.Sensor_ZPM.set(addItem(696, "Sensor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 64L)})); - ItemList.Sensor_UV.set(addItem(697, "Sensor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 128L)})); - ItemList.Sensor_UHV.set(addItem(698, "Sensor (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 256L)})); - ItemList.Sensor_UEV.set(addItem(699, "Sensor (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'P', OrePrefixes.plate.get(Materials.Steel), 'C', OrePrefixes.circuit.get(Materials.Basic)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gemFlawless.get(Materials.Emerald), 'S', OrePrefixes.stick.get(Materials.Electrum), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'C', OrePrefixes.circuit.get(Materials.Good)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'C', OrePrefixes.circuit.get(Materials.Advanced)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'P', OrePrefixes.plate.get(Materials.Titanium), 'C', OrePrefixes.circuit.get(Materials.Data)}); - GT_ModHandler.addCraftingRecipe(ItemList.Sensor_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'C', OrePrefixes.circuit.get(Materials.Elite)}); - - ItemList.Circuit_Primitive.set(addItem(tLastID = 700, "Vacuum Tube", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Parts_Vacuum_Tube.set(ItemList.Circuit_Primitive.get(1,new Object[0])); - ItemList.Circuit_Basic.set(addItem(tLastID = 701, "Integrated Logic Circuit", "A Basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Good.set(addItem(tLastID = 702, "Good Electronic Circuit", "A Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Processor Assembly", "An Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Computer.set(ItemList.Circuit_Advanced.get(1,new Object[0])); - ItemList.Circuit_Data.set(addItem(tLastID = 704, "Workstation", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Elite.set(addItem(tLastID = 705, "Mainframe", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Master.set(addItem(tLastID = 706, "Nanoprocessor Mainframe", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); - ItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", new Object[]{SubTag.NO_UNIFICATION, new Behaviour_DataOrb()})); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_LV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Tin), 'S', OrePrefixes.screw.get(Materials.Tin), 'W', OrePrefixes.cableGt01.get(Materials.Tin), 'P', OrePrefixes.pipeMedium.get(Materials.Bronze)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_MV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Bronze), 'S', OrePrefixes.screw.get(Materials.Bronze), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'P', OrePrefixes.pipeMedium.get(Materials.Steel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_HV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.Steel), 'S', OrePrefixes.screw.get(Materials.Steel), 'W', OrePrefixes.cableGt01.get(Materials.Gold), 'P', OrePrefixes.pipeMedium.get(Materials.StainlessSteel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_EV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium), 'P', OrePrefixes.pipeMedium.get(Materials.Titanium)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_IV, 'O', OrePrefixes.ring.get(Materials.AnySyntheticRubber), 'X', OrePrefixes.rotor.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten), 'P', OrePrefixes.pipeMedium.get(Materials.TungstenSteel)}); + + ItemList.Conveyor_Module_LV.set(addItem(630, "Conveyor Module (LV)", "1 Stack every 20 secs (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + ItemList.Conveyor_Module_MV.set(addItem(631, "Conveyor Module (MV)", "1 Stack every 5 secs (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L))); + ItemList.Conveyor_Module_HV.set(addItem(632, "Conveyor Module (HV)", "1 Stack every 1 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L))); + ItemList.Conveyor_Module_EV.set(addItem(633, "Conveyor Module (EV)", "1 Stack every 1/5 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L))); + ItemList.Conveyor_Module_IV.set(addItem(634, "Conveyor Module (IV)", "1 Stack every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L))); + ItemList.Conveyor_Module_LuV.set(addItem(635, "Conveyor Module (LuV)", "2 Stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L))); + ItemList.Conveyor_Module_ZPM.set(addItem(636, "Conveyor Module (ZPM)", "4 Stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L))); + ItemList.Conveyor_Module_UV.set(addItem(637, "Conveyor Module (UV)", "8 Stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L))); + ItemList.Conveyor_Module_UHV.set(addItem(638, "Conveyor Module (UHV)", "16 Stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L))); + ItemList.Conveyor_Module_UEV.set(addItem(639, "Conveyor Module (UEV)", "32 Stacks every 1/20 sec (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium), 'R', OrePrefixes.plate.get(Materials.AnyRubber)}); + GT_ModHandler.addCraftingRecipe(ItemList.Conveyor_Module_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten), 'R', OrePrefixes.plate.get(Materials.AnySyntheticRubber)}); + + GregTech_API.registerCover(ItemList.Conveyor_Module_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(400, 1)); + GregTech_API.registerCover(ItemList.Conveyor_Module_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(100, 1)); + GregTech_API.registerCover(ItemList.Conveyor_Module_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(20, 1)); + GregTech_API.registerCover(ItemList.Conveyor_Module_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(4, 1)); + GregTech_API.registerCover(ItemList.Conveyor_Module_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 1)); + GregTech_API.registerCover(ItemList.Conveyor_Module_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 2)); + GregTech_API.registerCover(ItemList.Conveyor_Module_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 4)); + GregTech_API.registerCover(ItemList.Conveyor_Module_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 8)); + GregTech_API.registerCover(ItemList.Conveyor_Module_UHV.get(1L), TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 16)); + GregTech_API.registerCover(ItemList.Conveyor_Module_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_CONVEYOR)), new GT_Cover_Conveyor(1, 32)); + + ItemList.Electric_Piston_LV.set(addItem(640, "Electric Piston (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.Electric_Piston_MV.set(addItem(641, "Electric Piston (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.Electric_Piston_HV.set(addItem(642, "Electric Piston (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L))); + ItemList.Electric_Piston_EV.set(addItem(643, "Electric Piston (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L))); + ItemList.Electric_Piston_IV.set(addItem(644, "Electric Piston (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L))); + ItemList.Electric_Piston_LuV.set(addItem(645, "Electric Piston (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L))); + ItemList.Electric_Piston_ZPM.set(addItem(646, "Electric Piston (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L))); + ItemList.Electric_Piston_UV.set(addItem(647, "Electric Piston (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L))); + ItemList.Electric_Piston_UHV.set(addItem(648, "Electric Piston (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L))); + ItemList.Electric_Piston_UEV.set(addItem(649, "Electric Piston (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel), 'G', OrePrefixes.gearGtSmall.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium), 'G', OrePrefixes.gearGtSmall.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Titanium), 'S', OrePrefixes.stick.get(Materials.Titanium), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); + + ItemList.Robot_Arm_LV.set(addItem(650, "Robot Arm (LV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L))); + ItemList.Robot_Arm_MV.set(addItem(651, "Robot Arm (MV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L))); + ItemList.Robot_Arm_HV.set(addItem(652, "Robot Arm (HV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L))); + ItemList.Robot_Arm_EV.set(addItem(653, "Robot Arm (EV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 8L))); + ItemList.Robot_Arm_IV.set(addItem(654, "Robot Arm (IV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 16L))); + ItemList.Robot_Arm_LuV.set(addItem(655, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 32L))); + ItemList.Robot_Arm_ZPM.set(addItem(656, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 64L))); + ItemList.Robot_Arm_UV.set(addItem(657, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 128L))); + ItemList.Robot_Arm_UHV.set(addItem(658, "Robot Arm (UHV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 256L))); + ItemList.Robot_Arm_UEV.set(addItem(659, "Robot Arm (UEV)", "Inserts into specific Slots (as Cover)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Steel), 'M', ItemList.Electric_Motor_LV, 'P', ItemList.Electric_Piston_LV, 'E', OrePrefixes.circuit.get(Materials.Basic), 'C', OrePrefixes.cableGt01.get(Materials.Tin)}); + GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Aluminium), 'M', ItemList.Electric_Motor_MV, 'P', ItemList.Electric_Piston_MV, 'E', OrePrefixes.circuit.get(Materials.Good), 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); + GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'P', ItemList.Electric_Piston_HV, 'E', OrePrefixes.circuit.get(Materials.Advanced), 'C', OrePrefixes.cableGt01.get(Materials.Gold)}); + GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'P', ItemList.Electric_Piston_EV, 'E', OrePrefixes.circuit.get(Materials.Data), 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(ItemList.Robot_Arm_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'P', ItemList.Electric_Piston_IV, 'E', OrePrefixes.circuit.get(Materials.Elite), 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); + + GregTech_API.registerCover(ItemList.Robot_Arm_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(400)); + GregTech_API.registerCover(ItemList.Robot_Arm_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(100)); + GregTech_API.registerCover(ItemList.Robot_Arm_HV.get(1L), TextureFactory.of(MACHINE_CASINGS[3][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(20)); + GregTech_API.registerCover(ItemList.Robot_Arm_EV.get(1L), TextureFactory.of(MACHINE_CASINGS[4][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(4)); + GregTech_API.registerCover(ItemList.Robot_Arm_IV.get(1L), TextureFactory.of(MACHINE_CASINGS[5][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + GregTech_API.registerCover(ItemList.Robot_Arm_LuV.get(1L), TextureFactory.of(MACHINE_CASINGS[6][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + GregTech_API.registerCover(ItemList.Robot_Arm_ZPM.get(1L), TextureFactory.of(MACHINE_CASINGS[7][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + GregTech_API.registerCover(ItemList.Robot_Arm_UV.get(1L), TextureFactory.of(MACHINE_CASINGS[8][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + GregTech_API.registerCover(ItemList.Robot_Arm_UHV.get(1L), TextureFactory.of(MACHINE_CASINGS[9][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + GregTech_API.registerCover(ItemList.Robot_Arm_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_ARM)), new GT_Cover_Arm(1)); + + ItemList.QuantumEye.set(addItem(tLastID = 724, "Quantum Eye", "Improved Ender Eye")); + ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star")); + ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star")); + + ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); + ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); + ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L))); + ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L))); + ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L))); + ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L))); + ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L))); + ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L))); + ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L))); + + ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L))); + ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L))); + ItemList.Emitter_HV.set(addItem(682, "Emitter (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L))); + ItemList.Emitter_EV.set(addItem(683, "Emitter (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 8L))); + ItemList.Emitter_IV.set(addItem(684, "Emitter (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 16L))); + ItemList.Emitter_LuV.set(addItem(685, "Emitter (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 32L))); + ItemList.Emitter_ZPM.set(addItem(686, "Emitter (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 64L))); + ItemList.Emitter_UV.set(addItem(687, "Emitter (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 128L))); + ItemList.Emitter_UHV.set(addItem(688, "Emitter (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 256L))); + ItemList.Emitter_UEV.set(addItem(689, "Emitter (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Emitter_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'C', OrePrefixes.circuit.get(Materials.Basic), 'W', OrePrefixes.cableGt01.get(Materials.Tin)}); + GT_ModHandler.addCraftingRecipe(ItemList.Emitter_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderPearl), 'S', OrePrefixes.stick.get(Materials.Electrum), 'C', OrePrefixes.circuit.get(Materials.Good), 'W', OrePrefixes.cableGt01.get(Materials.AnyCopper)}); + GT_ModHandler.addCraftingRecipe(ItemList.Emitter_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'C', OrePrefixes.circuit.get(Materials.Advanced), 'W', OrePrefixes.cableGt01.get(Materials.Gold)}); + GT_ModHandler.addCraftingRecipe(ItemList.Emitter_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'C', OrePrefixes.circuit.get(Materials.Data), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(ItemList.Emitter_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten)}); + + ItemList.Sensor_LV.set(addItem(690, "Sensor (LV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + ItemList.Sensor_MV.set(addItem(691, "Sensor (MV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L))); + ItemList.Sensor_HV.set(addItem(692, "Sensor (HV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.Sensor_EV.set(addItem(693, "Sensor (EV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 8L))); + ItemList.Sensor_IV.set(addItem(694, "Sensor (IV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 16L))); + ItemList.Sensor_LuV.set(addItem(695, "Sensor (LuV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 32L))); + ItemList.Sensor_ZPM.set(addItem(696, "Sensor (ZPM)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 64L))); + ItemList.Sensor_UV.set(addItem(697, "Sensor (UV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 128L))); + ItemList.Sensor_UHV.set(addItem(698, "Sensor (UHV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 256L))); + ItemList.Sensor_UEV.set(addItem(699, "Sensor (UEV)", "", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 512L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Sensor_LV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.CertusQuartz), 'S', OrePrefixes.stick.get(Materials.Brass), 'P', OrePrefixes.plate.get(Materials.Steel), 'C', OrePrefixes.circuit.get(Materials.Basic)}); + GT_ModHandler.addCraftingRecipe(ItemList.Sensor_MV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gemFlawless.get(Materials.Emerald), 'S', OrePrefixes.stick.get(Materials.Electrum), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'C', OrePrefixes.circuit.get(Materials.Good)}); + GT_ModHandler.addCraftingRecipe(ItemList.Sensor_HV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', OrePrefixes.gem.get(Materials.EnderEye), 'S', OrePrefixes.stick.get(Materials.Chrome), 'P', OrePrefixes.plate.get(Materials.StainlessSteel), 'C', OrePrefixes.circuit.get(Materials.Advanced)}); + GT_ModHandler.addCraftingRecipe(ItemList.Sensor_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumEye, 'S', OrePrefixes.stick.get(Materials.Platinum), 'P', OrePrefixes.plate.get(Materials.Titanium), 'C', OrePrefixes.circuit.get(Materials.Data)}); + GT_ModHandler.addCraftingRecipe(ItemList.Sensor_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", 'Q', ItemList.QuantumStar, 'S', OrePrefixes.stick.get(Materials.Iridium), 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'C', OrePrefixes.circuit.get(Materials.Elite)}); + + ItemList.Circuit_Primitive.set(addItem(tLastID = 700, "Vacuum Tube", "A very simple Circuit", OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Parts_Vacuum_Tube.set(ItemList.Circuit_Primitive.get(1)); + ItemList.Circuit_Basic.set(addItem(tLastID = 701, "Integrated Logic Circuit", "A Basic Circuit", OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Good.set(addItem(tLastID = 702, "Good Electronic Circuit", "A Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Processor Assembly", "An Advanced Circuit", OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Computer.set(ItemList.Circuit_Advanced.get(1)); + ItemList.Circuit_Data.set(addItem(tLastID = 704, "Workstation", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Elite.set(addItem(tLastID = 705, "Mainframe", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Master.set(addItem(tLastID = 706, "Nanoprocessor Mainframe", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", SubTag.NO_UNIFICATION, new Behaviour_DataOrb())); //ItemList.Circuit_Ultimate.set(ItemList.Tool_DataOrb.get(1L, new Object[0])); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L, new Object[0])}); - ItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", new Object[]{SubTag.NO_UNIFICATION, new Behaviour_DataStick()})); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L, new Object[0])}); - - ItemList.Circuit_Board_Basic.set(addItem(tLastID = 710, "Coated Circuit Board", "A Basic Board", new Object[0])); ItemList.Circuit_Board_Coated.set(ItemList.Circuit_Board_Basic.get(1,new Object[0])); - ItemList.Circuit_Board_Advanced.set(addItem(tLastID = 711, "Epoxy Circuit Board", "An Advanced Board", new Object[0])); ItemList.Circuit_Board_Epoxy.set(ItemList.Circuit_Board_Advanced.get(1,new Object[0])); - ItemList.Circuit_Board_Elite.set(addItem(tLastID = 712, "Multilayer Fiber-Reinforced Circuit Board", "An Elite Board", new Object[0])); ItemList.Circuit_Board_Multifiberglass.set(ItemList.Circuit_Board_Elite.get(1,new Object[0])); - ItemList.Circuit_Parts_Crystal_Chip_Elite.set(addItem(tLastID = 713, "Engraved Crystal Chip", "Needed for Circuits", new Object[0])); - ItemList.Circuit_Parts_Crystal_Chip_Master.set(addItem(tLastID = 714, "Engraved Lapotron Chip", "Needed for Circuits", new Object[0])); - ItemList.Circuit_Parts_Advanced.set(addItem(tLastID = 715, "Diode", "Basic Electronic Component", new Object[0])); ItemList.Circuit_Parts_Diode.set(ItemList.Circuit_Parts_Advanced.get(1,new Object[0])); - ItemList.Circuit_Parts_Wiring_Basic.set(addItem(tLastID = 716, "Resistor", "Basic Electronic Component", new Object[0])); ItemList.Circuit_Parts_Resistor.set(ItemList.Circuit_Parts_Wiring_Basic.get(1,new Object[0])); - ItemList.Circuit_Parts_Wiring_Advanced.set(addItem(tLastID = 717, "Transistor", "Basic Electronic Component", new Object[0])); ItemList.Circuit_Parts_Transistor.set(ItemList.Circuit_Parts_Wiring_Advanced.get(1,new Object[0])); - ItemList.Circuit_Parts_Wiring_Elite.set(addItem(tLastID = 718, "Capacitor", "Electronic Component", new Object[0])); ItemList.Circuit_Parts_Capacitor.set(ItemList.Circuit_Parts_Wiring_Elite.get(1,new Object[0])); - ItemList.Empty_Board_Basic.set(addItem(tLastID = 719, "Phenolic Circuit Board", "A Good Board", new Object[0])); ItemList.Circuit_Board_Phenolic.set(ItemList.Empty_Board_Basic.get(1,new Object[0])); - ItemList.Empty_Board_Elite.set(addItem(tLastID = 720, "Fiber-Reinforced Circuit Board", "An Extreme Board", new Object[0])); ItemList.Circuit_Board_Fiberglass.set(ItemList.Empty_Board_Elite.get(1,new Object[0])); - - ItemList.Component_Sawblade_Diamond.set(addItem(tLastID = 721, "Diamond Sawblade", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4L), OreDictNames.craftingDiamondBlade})); - ItemList.Component_Grinder_Diamond.set(addItem(tLastID = 722, "Diamond Grinding Head", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6L), OreDictNames.craftingGrinder})); - ItemList.Component_Grinder_Tungsten.set(addItem(tLastID = 723, "Tungsten Grinding Head", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 6L), OreDictNames.craftingGrinder})); - - //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', OrePrefixes.gem.get(Materials.EnderPearl), 'C', OrePrefixes.circuit.get(Materials.Basic), 'W', OrePrefixes.wireGt01.get(Materials.Osmium)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', OrePrefixes.gem.get(Materials.EnderEye), 'C', OrePrefixes.circuit.get(Materials.Good), 'W', OrePrefixes.wireGt02.get(Materials.Osmium)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', ItemList.QuantumEye.get(1L, new Object[0]), 'C', OrePrefixes.circuit.get(Materials.Advanced), 'W', OrePrefixes.wireGt04.get(Materials.Osmium)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', OrePrefixes.gem.get(Materials.NetherStar), 'C', OrePrefixes.circuit.get(Materials.Data), 'W', OrePrefixes.wireGt08.get(Materials.Osmium)}); - //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', ItemList.QuantumStar.get(1L, new Object[0]), 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.wireGt16.get(Materials.Osmium)}); - - GT_ModHandler.addCraftingRecipe(ItemList.Component_Sawblade_Diamond.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" D ", "DGD", " D ", 'D', OrePrefixes.dustSmall.get(Materials.Diamond), 'G', OrePrefixes.gearGt.get(Materials.CobaltBrass)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Diamond.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"DSD", "SIS", "DSD", 'I', OrePrefixes.gem.get(Materials.Diamond), 'D', OrePrefixes.dust.get(Materials.Diamond), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Tungsten.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"TST", "SIS", "TST", 'I', OreDictNames.craftingIndustrialDiamond, 'T', OrePrefixes.plate.get(Materials.Tungsten), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); - - ItemList.Upgrade_Muffler.set(addItem(tLastID = 727, "Muffler Upgrade", "Makes Machines silent", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L)})); - ItemList.Upgrade_Lock.set(addItem(tLastID = 728, "Lock Upgrade", "Protects your Machines", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); - - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L, new Object[0]), 1600, 2); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L, new Object[0]), 6400, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L, new Object[0]), 6400, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L, new Object[0]), 6400, 16); - - ItemList.Component_Filter.set(addItem(tLastID = 729, "Item Filter", "", new Object[]{new ItemData(Materials.Zinc, OrePrefixes.foil.mMaterialAmount * 16L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), OreDictNames.craftingFilter})); - - ItemList.Cover_Controller.set(addItem(tLastID = 730, "Machine Controller Cover", "Turns Machines ON/OFF", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - ItemList.Cover_ActivityDetector.set(addItem(tLastID = 731, "Activity Detector Cover", "Gives out Activity as Redstone", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - ItemList.Cover_FluidDetector.set(addItem(tLastID = 732, "Fluid Detector Cover", "Gives out Fluid Amount as Redstone", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L)})); - ItemList.Cover_ItemDetector.set(addItem(tLastID = 733, "Item Detector Cover", "Gives out Item Amount as Redstone", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1L)})); - ItemList.Cover_EnergyDetector.set(addItem(tLastID = 734, "Energy Detector Cover", "Gives out Energy Amount as Redstone", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)})); - ItemList.Cover_PlayerDetector.set(addItem(tLastID = 735, "Player Detector Cover", "Gives out close Players as Redstone", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), ItemList.Cover_PlayerDetector.get(1L, new Object[0]), 3200, 128); - - GregTech_API.registerCover(ItemList.Cover_Controller.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONTROLLER)}), new GT_Cover_ControlsWork()); - GregTech_API.registerCover(ItemList.Cover_ActivityDetector.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR)}), new GT_Cover_DoesWork()); - GregTech_API.registerCover(ItemList.Cover_FluidDetector.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FLUIDDETECTOR)}), new GT_Cover_LiquidMeter()); - GregTech_API.registerCover(ItemList.Cover_ItemDetector.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ITEMDETECTOR)}), new GT_Cover_ItemMeter()); - GregTech_API.registerCover(ItemList.Cover_EnergyDetector.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ENERGYDETECTOR)}), new GT_Cover_EUMeter()); - GregTech_API.registerCover(ItemList.Cover_PlayerDetector.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR)}), new GT_Cover_PlayerDetector()); - - ItemList.Cover_Screen.set(addItem(tLastID = 740, "Computer Monitor Cover", "Displays Data and GUI", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L)})); - ItemList.Cover_Crafting.set(addItem(tLastID = 744, "Crafting Table Cover", "Better than a wooden Workbench", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L)})); - ItemList.Cover_Drain.set(addItem(tLastID = 745, "Drain Module Cover", "Absorbs Fluids and collects Rain", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)})); - - ItemList.Cover_Shutter.set(addItem(tLastID = 749, "Shutter Module Cover", "Blocks Inventory/Tank Side. Use together with Machine Controller.", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)})); - - GT_ModHandler.addCraftingRecipe(ItemList.Cover_Screen.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"AGA", "RPB", "ALA", 'A', OrePrefixes.plate.get(Materials.Aluminium), 'L', OrePrefixes.dust.get(Materials.Glowstone), 'R', Dyes.dyeRed, 'G', Dyes.dyeLime, 'B', Dyes.dyeBlue, 'P', OrePrefixes.plate.get(Materials.Glass)}); - - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_Drain.get(1L, new Object[0]), ItemList.Cover_Shutter.get(1L, new Object[0]), 200, 64); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), ItemList.Cover_Drain.get(1L, new Object[0]), ItemList.Cover_Shutter.get(1L, new Object[0]), 800, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), ItemList.Cover_Drain.get(1L, new Object[0]), ItemList.Cover_Shutter.get(1L, new Object[0]), 400, 30); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L, new Object[0]), 200, 64); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L, new Object[0]), 800, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L, new Object[0]), 400, 30); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L, new Object[0]), 200, 64); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L, new Object[0]), 800, 16); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L, new Object[0]), 800, 16); - GT_Values.RA.addAssemblerRecipe(ItemList.Cover_Shutter.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 2), ItemList.FluidFilter.get(1L, new Object[0]), 800, 4); - - GregTech_API.registerCover(ItemList.Cover_Screen.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCREEN)}), new GT_Cover_Screen()); - GregTech_API.registerCover(ItemList.Cover_Crafting.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CRAFTING)}), new GT_Cover_Crafting()); - GregTech_API.registerCover(ItemList.Cover_Drain.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[0][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DRAIN)}), new GT_Cover_Drain()); - GregTech_API.registerCover(ItemList.Cover_Shutter.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SHUTTER)}), new GT_Cover_Shutter()); - - ItemList.Cover_SolarPanel.set(addItem(tLastID = 750, "Solar Panel", "May the Sun be with you (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 1L)})); - ItemList.Cover_SolarPanel_8V.set(addItem(tLastID = 751, "Solar Panel (8V)", "8 Volt Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 2L)})); - ItemList.Cover_SolarPanel_LV.set(addItem(tLastID = 752, "Solar Panel (LV)", "Low Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 4L)})); - ItemList.Cover_SolarPanel_MV.set(addItem(tLastID = 753, "Solar Panel (MV)", "Medium Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 8L)})); - ItemList.Cover_SolarPanel_HV.set(addItem(tLastID = 754, "Solar Panel (HV)", "High Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 16L)})); - ItemList.Cover_SolarPanel_EV.set(addItem(tLastID = 755, "Solar Panel (EV)", "Extreme Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 32L)})); - ItemList.Cover_SolarPanel_IV.set(addItem(tLastID = 756, "Solar Panel (IV)", "Insane Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L)})); - ItemList.Cover_SolarPanel_LuV.set(addItem(tLastID = 757, "Solar Panel (LuV)", "Ludicrous Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L)})); - ItemList.Cover_SolarPanel_ZPM.set(addItem(tLastID = 758, "Solar Panel (ZPM)", "ZPM Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L)})); - ItemList.Cover_SolarPanel_UV.set(addItem(tLastID = 759, "Solar Panel (UV)", "Ultimate Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L)})); - - GregTech_API.registerCover(ItemList.Cover_SolarPanel.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL), new GT_Cover_SolarPanel(1)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_8V.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V), new GT_Cover_SolarPanel(8)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_LV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV), new GT_Cover_SolarPanel(32)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_MV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV), new GT_Cover_SolarPanel(128)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_HV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV), new GT_Cover_SolarPanel(512)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_EV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV), new GT_Cover_SolarPanel(2048)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_IV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV), new GT_Cover_SolarPanel(8192)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_LuV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV), new GT_Cover_SolarPanel(32768)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_ZPM.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM), new GT_Cover_SolarPanel(131072)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV), new GT_Cover_SolarPanel(524288)); - - ItemList.Tool_Sonictron.set(addItem(tLastID = 760, "Sonictron", "Bring your Music with you", new Object[]{Behaviour_Sonictron.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L)})); - ItemList.Tool_Cheat.set(addItem(tLastID = 761, "Debug Scanner", "Also an Infinite Energy Source", new Object[]{Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 64L)})); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L)}); + ItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", SubTag.NO_UNIFICATION, new Behaviour_DataStick())); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L)}); + + ItemList.Circuit_Board_Basic.set(addItem(tLastID = 710, "Coated Circuit Board", "A Basic Board")); ItemList.Circuit_Board_Coated.set(ItemList.Circuit_Board_Basic.get(1)); + ItemList.Circuit_Board_Advanced.set(addItem(tLastID = 711, "Epoxy Circuit Board", "An Advanced Board")); ItemList.Circuit_Board_Epoxy.set(ItemList.Circuit_Board_Advanced.get(1)); + ItemList.Circuit_Board_Elite.set(addItem(tLastID = 712, "Multilayer Fiber-Reinforced Circuit Board", "An Elite Board")); ItemList.Circuit_Board_Multifiberglass.set(ItemList.Circuit_Board_Elite.get(1)); + ItemList.Circuit_Parts_Crystal_Chip_Elite.set(addItem(tLastID = 713, "Engraved Crystal Chip", "Needed for Circuits")); + ItemList.Circuit_Parts_Crystal_Chip_Master.set(addItem(tLastID = 714, "Engraved Lapotron Chip", "Needed for Circuits")); + ItemList.Circuit_Parts_Advanced.set(addItem(tLastID = 715, "Diode", "Basic Electronic Component")); ItemList.Circuit_Parts_Diode.set(ItemList.Circuit_Parts_Advanced.get(1)); + ItemList.Circuit_Parts_Wiring_Basic.set(addItem(tLastID = 716, "Resistor", "Basic Electronic Component")); ItemList.Circuit_Parts_Resistor.set(ItemList.Circuit_Parts_Wiring_Basic.get(1)); + ItemList.Circuit_Parts_Wiring_Advanced.set(addItem(tLastID = 717, "Transistor", "Basic Electronic Component")); ItemList.Circuit_Parts_Transistor.set(ItemList.Circuit_Parts_Wiring_Advanced.get(1)); + ItemList.Circuit_Parts_Wiring_Elite.set(addItem(tLastID = 718, "Capacitor", "Electronic Component")); ItemList.Circuit_Parts_Capacitor.set(ItemList.Circuit_Parts_Wiring_Elite.get(1)); + ItemList.Empty_Board_Basic.set(addItem(tLastID = 719, "Phenolic Circuit Board", "A Good Board")); ItemList.Circuit_Board_Phenolic.set(ItemList.Empty_Board_Basic.get(1)); + ItemList.Empty_Board_Elite.set(addItem(tLastID = 720, "Fiber-Reinforced Circuit Board", "An Extreme Board")); ItemList.Circuit_Board_Fiberglass.set(ItemList.Empty_Board_Elite.get(1)); + + ItemList.Component_Sawblade_Diamond.set(addItem(tLastID = 721, "Diamond Sawblade", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4L), OreDictNames.craftingDiamondBlade)); + ItemList.Component_Grinder_Diamond.set(addItem(tLastID = 722, "Diamond Grinding Head", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6L), OreDictNames.craftingGrinder)); + ItemList.Component_Grinder_Tungsten.set(addItem(tLastID = 723, "Tungsten Grinding Head", "", new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 6L), OreDictNames.craftingGrinder)); + + GT_ModHandler.addCraftingRecipe(ItemList.Component_Sawblade_Diamond.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" D ", "DGD", " D ", 'D', OrePrefixes.dustSmall.get(Materials.Diamond), 'G', OrePrefixes.gearGt.get(Materials.CobaltBrass)}); + GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Diamond.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"DSD", "SIS", "DSD", 'I', OrePrefixes.gem.get(Materials.Diamond), 'D', OrePrefixes.dust.get(Materials.Diamond), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Tungsten.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"TST", "SIS", "TST", 'I', OreDictNames.craftingIndustrialDiamond, 'T', OrePrefixes.plate.get(Materials.Tungsten), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); + + ItemList.Upgrade_Muffler.set(addItem(tLastID = 727, "Muffler Upgrade", "Makes Machines silent", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L))); + ItemList.Upgrade_Lock.set(addItem(tLastID = 728, "Lock Upgrade", "Protects your Machines", new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L))); + + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Plastic, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L), ItemList.Upgrade_Muffler.get(1L), 1600, 2); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L), 6400, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L), 6400, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), ItemList.Upgrade_Lock.get(1L), 6400, 16); + + ItemList.Component_Filter.set(addItem(tLastID = 729, "Item Filter", "", new ItemData(Materials.Zinc, OrePrefixes.foil.mMaterialAmount * 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), OreDictNames.craftingFilter)); + + ItemList.Cover_Controller.set(addItem(tLastID = 730, "Machine Controller Cover", "Turns Machines ON/OFF", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_ActivityDetector.set(addItem(tLastID = 731, "Activity Detector Cover", "Gives out Activity as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_FluidDetector.set(addItem(tLastID = 732, "Fluid Detector Cover", "Gives out Fluid Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Cover_ItemDetector.set(addItem(tLastID = 733, "Item Detector Cover", "Gives out Item Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1L))); + ItemList.Cover_EnergyDetector.set(addItem(tLastID = 734, "Energy Detector Cover", "Gives out Energy Amount as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Cover_PlayerDetector.set(addItem(tLastID = 735, "Player Detector Cover", "Gives out close Players as Redstone", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), ItemList.Cover_PlayerDetector.get(1L), 3200, 128); + + GregTech_API.registerCover(ItemList.Cover_Controller.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_CONTROLLER)), new GT_Cover_ControlsWork()); + GregTech_API.registerCover(ItemList.Cover_ActivityDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_DoesWork()); + GregTech_API.registerCover(ItemList.Cover_FluidDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_LiquidMeter()); + GregTech_API.registerCover(ItemList.Cover_ItemDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ITEMDETECTOR)), new GT_Cover_ItemMeter()); + GregTech_API.registerCover(ItemList.Cover_EnergyDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_ENERGYDETECTOR)), new GT_Cover_EUMeter()); + GregTech_API.registerCover(ItemList.Cover_PlayerDetector.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_PlayerDetector()); + + ItemList.Cover_Screen.set(addItem(tLastID = 740, "Computer Monitor Cover", "Displays Data and GUI", new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L))); + ItemList.Cover_Crafting.set(addItem(tLastID = 744, "Crafting Table Cover", "Better than a wooden Workbench", new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L))); + ItemList.Cover_Drain.set(addItem(tLastID = 745, "Drain Module Cover", "Absorbs Fluids and collects Rain", new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + + ItemList.Cover_Shutter.set(addItem(tLastID = 749, "Shutter Module Cover", "Blocks Inventory/Tank Side. Use together with Machine Controller.", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L))); + + GT_ModHandler.addCraftingRecipe(ItemList.Cover_Screen.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"AGA", "RPB", "ALA", 'A', OrePrefixes.plate.get(Materials.Aluminium), 'L', OrePrefixes.dust.get(Materials.Glowstone), 'R', Dyes.dyeRed, 'G', Dyes.dyeLime, 'B', Dyes.dyeBlue, 'P', OrePrefixes.plate.get(Materials.Glass)}); + + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_Drain.get(1L), ItemList.Cover_Shutter.get(1L), 200, 64); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), ItemList.Cover_Drain.get(1L), ItemList.Cover_Shutter.get(1L), 800, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), ItemList.Cover_Drain.get(1L), ItemList.Cover_Shutter.get(1L), 400, 30); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L), 200, 64); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L), 800, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 2L), new ItemStack(Blocks.iron_bars, 2), ItemList.Cover_Drain.get(1L), 400, 30); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L), 200, 64); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L), 800, 16); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 1L), new ItemStack(Blocks.crafting_table, 1), ItemList.Cover_Crafting.get(1L), 800, 16); + GT_Values.RA.addAssemblerRecipe(ItemList.Cover_Shutter.get(1L), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 2), ItemList.FluidFilter.get(1L), 800, 4); + + GregTech_API.registerCover(ItemList.Cover_Screen.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_SCREEN), TextureFactory.builder().addIcon(OVERLAY_SCREEN_GLOW).glow().build())), new GT_Cover_Screen()); + GregTech_API.registerCover(ItemList.Cover_Crafting.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_CRAFTING)), new GT_Cover_Crafting()); + GregTech_API.registerCover(ItemList.Cover_Drain.get(1L), TextureFactory.of(MACHINE_CASINGS[0][0], TextureFactory.of(OVERLAY_DRAIN)), new GT_Cover_Drain()); + GregTech_API.registerCover(ItemList.Cover_Shutter.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_SHUTTER)), new GT_Cover_Shutter()); + + ItemList.Cover_SolarPanel.set(addItem(tLastID = 750, "Solar Panel", "May the Sun be with you (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 1L))); + ItemList.Cover_SolarPanel_8V.set(addItem(tLastID = 751, "Solar Panel (8V)", "8 Volt Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 2L))); + ItemList.Cover_SolarPanel_LV.set(addItem(tLastID = 752, "Solar Panel (LV)", "Low Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 4L))); + ItemList.Cover_SolarPanel_MV.set(addItem(tLastID = 753, "Solar Panel (MV)", "Medium Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 8L))); + ItemList.Cover_SolarPanel_HV.set(addItem(tLastID = 754, "Solar Panel (HV)", "High Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 16L))); + ItemList.Cover_SolarPanel_EV.set(addItem(tLastID = 755, "Solar Panel (EV)", "Extreme Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 32L))); + ItemList.Cover_SolarPanel_IV.set(addItem(tLastID = 756, "Solar Panel (IV)", "Insane Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_LuV.set(addItem(tLastID = 757, "Solar Panel (LuV)", "Ludicrous Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_ZPM.set(addItem(tLastID = 758, "Solar Panel (ZPM)", "ZPM Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + ItemList.Cover_SolarPanel_UV.set(addItem(tLastID = 759, "Solar Panel (UV)", "Ultimate Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 64L))); + + GregTech_API.registerCover(ItemList.Cover_SolarPanel.get(1L), TextureFactory.of(SOLARPANEL), new GT_Cover_SolarPanel(1)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_8V.get(1L), TextureFactory.of(SOLARPANEL_8V), new GT_Cover_SolarPanel(8)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_LV.get(1L), TextureFactory.of(SOLARPANEL_LV), new GT_Cover_SolarPanel(32)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_MV.get(1L), TextureFactory.of(SOLARPANEL_MV), new GT_Cover_SolarPanel(128)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_HV.get(1L), TextureFactory.of(SOLARPANEL_HV), new GT_Cover_SolarPanel(512)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_EV.get(1L), TextureFactory.of(SOLARPANEL_EV), new GT_Cover_SolarPanel(2048)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_IV.get(1L), TextureFactory.of(SOLARPANEL_IV), new GT_Cover_SolarPanel(8192)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_LuV.get(1L), TextureFactory.of(SOLARPANEL_LuV), new GT_Cover_SolarPanel(32768)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_ZPM.get(1L), TextureFactory.of(SOLARPANEL_ZPM), new GT_Cover_SolarPanel(131072)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UV.get(1L), TextureFactory.of(SOLARPANEL_UV), new GT_Cover_SolarPanel(524288)); + + ItemList.Tool_Sonictron.set(addItem(tLastID = 760, "Sonictron", "Bring your Music with you", Behaviour_Sonictron.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L))); + ItemList.Tool_Cheat.set(addItem(tLastID = 761, "Debug Scanner", "Also an Infinite Energy Source", Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 64L))); setElectricStats(32000 + tLastID, -2000000000L, 1000000000L, -1L, -3L, false); - ItemList.Tool_Scanner.set(addItem(tLastID = 762, "Portable Scanner", "Tricorder", new Object[]{Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L)})); + ItemList.Tool_Scanner.set(addItem(tLastID = 762, "Portable Scanner", "Tricorder", Behaviour_Scanner.INSTANCE, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 6L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 6L))); setElectricStats(32000 + tLastID, 400000L, GT_Values.V[2], 2L, -1L, false); - GT_ModHandler.addCraftingRecipe(ItemList.Tool_Scanner.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"EPR", "CSC", "PBP", 'C', OrePrefixes.circuit.get(Materials.Advanced), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'E', ItemList.Emitter_MV, 'R', ItemList.Sensor_MV, 'S', ItemList.Cover_Screen, 'B', ItemList.Battery_RE_MV_Lithium}); - ItemList.NC_SensorKit.set(addItem(tLastID = 763, "GregTech Sensor Kit", "", new Object[]{new Behaviour_SensorKit()})); - ItemList.Duct_Tape.set(addItem(tLastID = 764, "BrainTech Aerospace Advanced Reinforced Duct Tape FAL-84", "If you can't fix it with this, use more of it!", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), OreDictNames.craftingDuctTape})); - ItemList.McGuffium_239.set(addItem(tLastID = 765, "Mc Guffium 239", "42% better than Phlebotnium", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SPIRITUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITIUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.RADIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 8L)})); - - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 4L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 2L), ItemList.Schematic.get(1L, new Object[0]), 3200, 4); - GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_LV.get(1L, new Object[0]), ItemList.Emitter_LV.get(1L, new Object[0]), ItemList.NC_SensorKit.get(1L, new Object[0]), 1600, 2); - - ItemList.Cover_RedstoneTransmitterExternal.set(addItem(tLastID = 741, "Redstone Transmitter (Out)", "Transfers Redstonesignals wireless", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - ItemList.Cover_RedstoneTransmitterInternal.set(addItem(tLastID = 742, "Redstone Transmitter (In)", "Transfers Redstonesignals wireless", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - ItemList.Cover_RedstoneReceiverExternal.set(addItem(tLastID = 746, "Redstone Receiver (Out)", "Transfers Redstonesignals wireless", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - ItemList.Cover_RedstoneReceiverInternal.set(addItem(tLastID = 747, "Redstone Receiver (In)", "Transfers Redstonesignals wireless", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - - GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterExternal.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR)}), new GT_Cover_RedstoneTransmitterExternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterInternal.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR)}), new GT_Cover_RedstoneTransmitterInternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverExternal.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FLUIDDETECTOR)}), new GT_Cover_RedstoneReceiverExternal()); - GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverInternal.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FLUIDDETECTOR)}), new GT_Cover_RedstoneReceiverInternal()); - - GT_Values.RA.addAssemblerRecipe(ItemList.Emitter_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), ItemList.Cover_RedstoneTransmitterExternal.get(1L, new Object[0]), 3200, 128); - GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), ItemList.Cover_RedstoneReceiverExternal.get(1L, new Object[0]), 3200, 128); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterInternal.get(1L, new Object[0]), new Object[]{ItemList.Cover_RedstoneTransmitterExternal.get(1L, new Object[0])}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverInternal.get(1L, new Object[0]), new Object[]{ItemList.Cover_RedstoneReceiverExternal.get(1L, new Object[0])}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterExternal.get(1L, new Object[0]), new Object[]{ItemList.Cover_RedstoneTransmitterInternal.get(1L, new Object[0])}); - GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverExternal.get(1L, new Object[0]), new Object[]{ItemList.Cover_RedstoneReceiverInternal.get(1L, new Object[0])}); - - ItemList.Cover_NeedsMaintainance.set(addItem(tLastID = 748, "Needs Maintenance Cover", "Attach to Multiblock Controller. Emits Redstone Signal if needs Maintenance", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L)})); - GregTech_API.registerCover(ItemList.Cover_NeedsMaintainance.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR)}), new GT_Cover_NeedMaintainance()); - GT_Values.RA.addAssemblerRecipe(ItemList.Emitter_MV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_NeedsMaintainance.get(1L, new Object[0]), 600, 24); + GT_ModHandler.addCraftingRecipe(ItemList.Tool_Scanner.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"EPR", "CSC", "PBP", 'C', OrePrefixes.circuit.get(Materials.Advanced), 'P', OrePrefixes.plate.get(Materials.Aluminium), 'E', ItemList.Emitter_MV, 'R', ItemList.Sensor_MV, 'S', ItemList.Cover_Screen, 'B', ItemList.Battery_RE_MV_Lithium}); + ItemList.NC_SensorKit.set(addItem(tLastID = 763, "GregTech Sensor Kit", "", new Behaviour_SensorKit())); + ItemList.Duct_Tape.set(addItem(tLastID = 764, "BrainTech Aerospace Advanced Reinforced Duct Tape FAL-84", "If you can't fix it with this, use more of it!", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), OreDictNames.craftingDuctTape)); + ItemList.McGuffium_239.set(addItem(tLastID = 765, "Mc Guffium 239", "42% better than Phlebotnium", new TC_Aspects.TC_AspectStack(TC_Aspects.ALIENIS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SPIRITUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITIUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.RADIO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.STRONTIO, 8L))); + + GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_LV.get(1L), ItemList.Emitter_LV.get(1L), ItemList.NC_SensorKit.get(1L), 1600, 2); + + ItemList.Cover_RedstoneTransmitterExternal.set(addItem(tLastID = 741, "Redstone Transmitter (Out)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneTransmitterInternal.set(addItem(tLastID = 742, "Redstone Transmitter (In)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneReceiverExternal.set(addItem(tLastID = 746, "Redstone Receiver (Out)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + ItemList.Cover_RedstoneReceiverInternal.set(addItem(tLastID = 747, "Redstone Receiver (In)", "Transfers Redstonesignals wireless", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + + GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterExternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_RedstoneTransmitterExternal()); + GregTech_API.registerCover(ItemList.Cover_RedstoneTransmitterInternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_RedstoneTransmitterInternal()); + GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverExternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_RedstoneReceiverExternal()); + GregTech_API.registerCover(ItemList.Cover_RedstoneReceiverInternal.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_FLUIDDETECTOR)), new GT_Cover_RedstoneReceiverInternal()); + + GT_Values.RA.addAssemblerRecipe(ItemList.Emitter_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), ItemList.Cover_RedstoneTransmitterExternal.get(1L), 3200, 128); + GT_Values.RA.addAssemblerRecipe(ItemList.Sensor_EV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 1L), ItemList.Cover_RedstoneReceiverExternal.get(1L), 3200, 128); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterInternal.get(1L), new Object[]{ItemList.Cover_RedstoneTransmitterExternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverInternal.get(1L), new Object[]{ItemList.Cover_RedstoneReceiverExternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneTransmitterExternal.get(1L), new Object[]{ItemList.Cover_RedstoneTransmitterInternal.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Cover_RedstoneReceiverExternal.get(1L), new Object[]{ItemList.Cover_RedstoneReceiverInternal.get(1L)}); + + ItemList.Cover_NeedsMaintainance.set(addItem(tLastID = 748, "Needs Maintenance Cover", "Attach to Multiblock Controller. Emits Redstone Signal if needs Maintenance", new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L))); + GregTech_API.registerCover(ItemList.Cover_NeedsMaintainance.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(TextureFactory.of(OVERLAY_ACTIVITYDETECTOR), TextureFactory.builder().addIcon(OVERLAY_ACTIVITYDETECTOR_GLOW).glow().build())), new GT_Cover_NeedMaintainance()); + GT_Values.RA.addAssemblerRecipe(ItemList.Emitter_MV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_NeedsMaintainance.get(1L), 600, 24); + + GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Export.get(1L),new Object[]{"SPS","dIC","SPS",'P',OrePrefixes.plateDouble.get(Materials.StainlessSteel),'S',OrePrefixes.screw.get(Materials.StainlessSteel),'I',ItemList.Component_Filter,'C',ItemList.Conveyor_Module_HV}); + GT_ModHandler.addCraftingRecipe(ItemList.ItemFilter_Import.get(1L),new Object[]{"SPS","CId","SPS",'P',OrePrefixes.plateDouble.get(Materials.StainlessSteel),'S',OrePrefixes.screw.get(Materials.StainlessSteel),'I',ItemList.Component_Filter,'C',ItemList.Conveyor_Module_HV}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.ItemFilter_Export.get(1L),new Object[]{ItemList.ItemFilter_Import.get(1L)}); + GT_ModHandler.addShapelessCraftingRecipe(ItemList.ItemFilter_Import.get(1L),new Object[]{ItemList.ItemFilter_Export.get(1L)}); + + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(1)},Materials.SolderingAlloy.getMolten(72L),ItemList.ItemFilter_Export.get(1L),100,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(1)},Materials.Tin.getMolten(144L),ItemList.ItemFilter_Export.get(1L),100,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(1)},Materials.Lead.getMolten(288L),ItemList.ItemFilter_Export.get(1L),100,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(2)},Materials.SolderingAlloy.getMolten(72L),ItemList.ItemFilter_Import.get(1L),100,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(2)},Materials.Tin.getMolten(144L),ItemList.ItemFilter_Import.get(1L),100,30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.plateDouble,Materials.StainlessSteel,2L),ItemList.Component_Filter.get(1L),ItemList.Conveyor_Module_HV.get(1L),GT_Utility.getIntegratedCircuit(2)},Materials.Lead.getMolten(288L),ItemList.ItemFilter_Import.get(1L),100,30); } private static final Map<Materials,Materials> cauldronRemap =new HashMap<>(); @@ -866,6 +868,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { cauldronRemap.put(in,out); } + @Override public boolean onEntityItemUpdate(EntityItem aItemEntity) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage < 32000) && (aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { @@ -898,7 +901,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(ItemList.Food_Dough.get(aItemEntity.getEntityItem().stackSize, new Object[]{})); + aItemEntity.setEntityItemStack(ItemList.Food_Dough.get(aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -908,6 +911,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { return false; } + @Override protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); int aDamage = aStack.getItemDamage(); @@ -935,14 +939,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { return false; } + @Override public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { return (aDoShowAllItems) || (((aPrefix != OrePrefixes.gem) || (!aMaterial.mName.startsWith("Infused"))) && (aPrefix != OrePrefixes.dustTiny) && (aPrefix != OrePrefixes.dustSmall) && (aPrefix != OrePrefixes.dustImpure) && (aPrefix != OrePrefixes.dustPure) && (aPrefix != OrePrefixes.crushed) && (aPrefix != OrePrefixes.crushedPurified) && (aPrefix != OrePrefixes.crushedCentrifuged) && (aPrefix != OrePrefixes.ingotHot) && !(aPrefix == OrePrefixes.cellPlasma && !isPlasmaCellUsed(aPrefix, aMaterial))); } + @Override public ItemStack getContainerItem(ItemStack aStack) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 32430) && (aDamage <= 32461)) { - return ItemList.Spray_Empty.get(1L, new Object[0]); + return ItemList.Spray_Empty.get(1L); } if ((aDamage == 32479) || (aDamage == 32476)) { return new ItemStack(this, 1, aDamage - 2); @@ -953,7 +959,8 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { return super.getContainerItem(aStack); } + @Override public boolean doesMaterialAllowGeneration(OrePrefixes aPrefix, Materials aMaterial) { return (super.doesMaterialAllowGeneration(aPrefix, aMaterial)); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java index d1bc513328..344cacefe1 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java @@ -1,11 +1,21 @@ package gregtech.common.items; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; import gregtech.api.items.GT_MetaGenerated_Item_X32; -import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_FoodStat; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_Arrow; import net.minecraft.dispenser.IBlockSource; import net.minecraft.enchantment.Enchantment; @@ -24,7 +34,7 @@ import net.minecraft.world.World; public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_02 INSTANCE; - private final static String aTextCover = "Usable as Cover"; private final static String aTextForestry = "Forestry"; + private static final String aTextCover = "Usable as Cover"; private static final String aTextForestry = "Forestry"; public GT_MetaGenerated_Item_02() { super("metaitem.02", OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, null, OrePrefixes.itemCasing, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt); @@ -241,36 +251,36 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addCraftingRecipe(ItemList.Plank_Maple.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6)}); GT_ModHandler.addCraftingRecipe(ItemList.Plank_Citrus.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7)}); - GregTech_API.registerCover(ItemList.Plank_Oak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 0), null); - GregTech_API.registerCover(ItemList.Plank_Spruce.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 1), null); - GregTech_API.registerCover(ItemList.Plank_Birch.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 2), null); - GregTech_API.registerCover(ItemList.Plank_Jungle.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 3), null); - GregTech_API.registerCover(ItemList.Plank_Acacia.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 4), null); - GregTech_API.registerCover(ItemList.Plank_DarkOak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 5), null); - GregTech_API.registerCover(ItemList.Plank_Larch.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null); - GregTech_API.registerCover(ItemList.Plank_Teak.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null); - GregTech_API.registerCover(ItemList.Plank_Acacia_Green.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null); - GregTech_API.registerCover(ItemList.Plank_Lime.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null); - GregTech_API.registerCover(ItemList.Plank_Chestnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null); - GregTech_API.registerCover(ItemList.Plank_Wenge.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null); - GregTech_API.registerCover(ItemList.Plank_Baobab.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null); - GregTech_API.registerCover(ItemList.Plank_Sequoia.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null); - GregTech_API.registerCover(ItemList.Plank_Kapok.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), 0, 8), null); - GregTech_API.registerCover(ItemList.Plank_Ebony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), 0, 9), null); - GregTech_API.registerCover(ItemList.Plank_Mahagony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), 0, 10), null); - GregTech_API.registerCover(ItemList.Plank_Balsa.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), 0, 11), null); - GregTech_API.registerCover(ItemList.Plank_Willow.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), 0, 12), null); - GregTech_API.registerCover(ItemList.Plank_Walnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), 0, 13), null); - GregTech_API.registerCover(ItemList.Plank_Greenheart.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), 0, 14), null); - GregTech_API.registerCover(ItemList.Plank_Cherry.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), 0, 15), null); - GregTech_API.registerCover(ItemList.Plank_Mahoe.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null); - GregTech_API.registerCover(ItemList.Plank_Poplar.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null); - GregTech_API.registerCover(ItemList.Plank_Palm.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null); - GregTech_API.registerCover(ItemList.Plank_Papaya.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null); - GregTech_API.registerCover(ItemList.Plank_Pine.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null); - GregTech_API.registerCover(ItemList.Plank_Plum.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null); - GregTech_API.registerCover(ItemList.Plank_Maple.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null); - GregTech_API.registerCover(ItemList.Plank_Citrus.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null); + GregTech_API.registerCover(ItemList.Plank_Oak.get(1L), TextureFactory.of(Blocks.planks, 0), null); + GregTech_API.registerCover(ItemList.Plank_Spruce.get(1L), TextureFactory.of(Blocks.planks, 1), null); + GregTech_API.registerCover(ItemList.Plank_Birch.get(1L), TextureFactory.of(Blocks.planks, 2), null); + GregTech_API.registerCover(ItemList.Plank_Jungle.get(1L), TextureFactory.of(Blocks.planks, 3), null); + GregTech_API.registerCover(ItemList.Plank_Acacia.get(1L), TextureFactory.of(Blocks.planks, 4), null); + GregTech_API.registerCover(ItemList.Plank_DarkOak.get(1L), TextureFactory.of(Blocks.planks, 5), null); + GregTech_API.registerCover(ItemList.Plank_Larch.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), 0), null); + GregTech_API.registerCover(ItemList.Plank_Teak.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), 1), null); + GregTech_API.registerCover(ItemList.Plank_Acacia_Green.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), 2), null); + GregTech_API.registerCover(ItemList.Plank_Lime.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), 3), null); + GregTech_API.registerCover(ItemList.Plank_Chestnut.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), 4), null); + GregTech_API.registerCover(ItemList.Plank_Wenge.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), 5), null); + GregTech_API.registerCover(ItemList.Plank_Baobab.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), 6), null); + GregTech_API.registerCover(ItemList.Plank_Sequoia.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), 7), null); + GregTech_API.registerCover(ItemList.Plank_Kapok.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), 8), null); + GregTech_API.registerCover(ItemList.Plank_Ebony.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), 9), null); + GregTech_API.registerCover(ItemList.Plank_Mahagony.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), 10), null); + GregTech_API.registerCover(ItemList.Plank_Balsa.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), 11), null); + GregTech_API.registerCover(ItemList.Plank_Willow.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), 12), null); + GregTech_API.registerCover(ItemList.Plank_Walnut.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), 13), null); + GregTech_API.registerCover(ItemList.Plank_Greenheart.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), 14), null); + GregTech_API.registerCover(ItemList.Plank_Cherry.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), 15), null); + GregTech_API.registerCover(ItemList.Plank_Mahoe.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), 0), null); + GregTech_API.registerCover(ItemList.Plank_Poplar.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), 1), null); + GregTech_API.registerCover(ItemList.Plank_Palm.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), 2), null); + GregTech_API.registerCover(ItemList.Plank_Papaya.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), 3), null); + GregTech_API.registerCover(ItemList.Plank_Pine.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), 4), null); + GregTech_API.registerCover(ItemList.Plank_Plum.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), 5), null); + GregTech_API.registerCover(ItemList.Plank_Maple.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), 6), null); + GregTech_API.registerCover(ItemList.Plank_Citrus.get(1L), TextureFactory.of(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), 7), null); ItemList.Crop_Drop_Plumbilia.set(addItem(tLastID = 500, "Plumbilia Leaf", "Source of Lead", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 1L))); ItemList.Crop_Drop_Argentia.set(addItem(tLastID = 501, "Argentia Leaf", "Source of Silver", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); @@ -394,6 +404,7 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { ItemList.Display_ITS_FREE.set(addItem(tLastID = 766, "ITS FREE", "(or at least almost free)", SubTag.INVISIBLE, new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); } + @Override public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { super.onLeftClickEntity(aStack, aPlayer, aEntity); int aDamage = aStack.getItemDamage(); @@ -406,11 +417,13 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { return false; } + @Override public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) { int aDamage = aStack.getItemDamage(); return ((aDamage >= 25000) && (aDamage < 27000)) || (super.hasProjectile(aProjectileType, aStack)); } + @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 25000) && (aDamage < 27000)) { @@ -422,6 +435,7 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ); } + @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 25000) && (aDamage < 27000)) { @@ -433,6 +447,7 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed); } + @Override public boolean isItemStackUsable(ItemStack aStack) { int aDamage = aStack.getItemDamage(); Materials aMaterial = GregTech_API.sGeneratedMaterials[(aDamage % 1000)]; @@ -450,10 +465,12 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { return super.isItemStackUsable(aStack); } + @Override public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { return (aDoShowAllItems) || (!aPrefix.name().startsWith("toolHead")); } + @Override public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) { int aDamage = aStack.getItemDamage(); if ((aDamage >= 25000) && (aDamage < 27000)) { @@ -465,6 +482,7 @@ public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { return super.onDispense(aSource, aStack); } + @Override public final ItemStack getContainerItem(ItemStack aStack) { int aDamage = aStack.getItemDamage(); if (aDamage < 32000) { diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java index f0cb4024d5..251842334a 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java @@ -1,17 +1,25 @@ package gregtech.common.items; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; import gregtech.api.items.GT_MetaGenerated_Item_X32; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.common.covers.GT_Cover_SolarPanel; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UEV; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UHV; +import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UIV; + public class GT_MetaGenerated_Item_03 extends GT_MetaGenerated_Item_X32 { public static GT_MetaGenerated_Item_03 INSTANCE; public GT_MetaGenerated_Item_03() { - super("metaitem.03", new OrePrefixes[]{OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate}); + super("metaitem.03", OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate); INSTANCE = this; int tLastID = 0; Object[] o = new Object[0]; @@ -25,11 +33,6 @@ public class GT_MetaGenerated_Item_03 * fiberglass circuit board (simple + multilayer) / glass + plastic + electrum foil + sulfurci acid * wetware lifesupport board / fiberglass CB + teflon + */ -// ItemList.Circuit_Board_Coated.set(addItem(tLastID = 1, "Coated Circuit Board", "A basic Board", o)); -// ItemList.Circuit_Board_Phenolic.set(addItem(tLastID = 2, "Phenolic Circuit Board", "A good Board", o)); -// ItemList.Circuit_Board_Epoxy.set(addItem(tLastID = 3, "Epoxy Circuit Board", "An advanced Board", o)); -// ItemList.Circuit_Board_Fiberglass.set(addItem(tLastID = 4, "Fiberglass Circuit Board", "An advanced Board", o)); -// ItemList.Circuit_Board_Multifiberglass.set(addItem(tLastID = 5, "Multilayer Fiberglass Circuit Board", "A elite Board", o)); ItemList.Circuit_Board_Wetware.set(addItem(tLastID = 6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); ItemList.Circuit_Board_Plastic.set(addItem(tLastID = 7, "Plastic Circuit Board", "A Good Board", o)); ItemList.Circuit_Board_Bio.set(addItem(tLastID = 8, "Bio Circuit Board", "Bio genetic mutated Board", o)); @@ -44,16 +47,11 @@ public class GT_MetaGenerated_Item_03 * capacitors normal+smd * Glass Fibers */ -// ItemList.Circuit_Parts_Resistor.set(addItem(tLastID = 10, "Resistor", "Basic Electronic Component", o)); //wiring mv ItemList.Circuit_Parts_ResistorSMD.set(addItem(tLastID = 11, "SMD Resistor", "Electronic Component", o)); ItemList.Circuit_Parts_Glass_Tube.set(addItem(tLastID = 12, "Glass Tube", "", o)); -// ItemList.Circuit_Parts_Vacuum_Tube.set(addItem(tLastID = 13, "Vacuum Tube", "Basic Electronic Component", o)); //Circuit_Primitive ItemList.Circuit_Parts_Coil.set(addItem(tLastID = 14, "Small Coil", "Basic Electronic Component", o)); -// ItemList.Circuit_Parts_Diode.set(addItem(tLastID = 15, "Diode", "Basic Electronic Component", o)); ItemList.Circuit_Parts_DiodeSMD.set(addItem(tLastID = 16, "SMD Diode", "Electronic Component", o)); -// ItemList.Circuit_Parts_Transistor.set(addItem(tLastID = 17, "Transistor", "Basic Electronic Component", o)); //wiring hv ItemList.Circuit_Parts_TransistorSMD.set(addItem(tLastID = 18, "SMD Transistor", "Electronic Component", o)); -// ItemList.Circuit_Parts_Capacitor.set(addItem(tLastID = 19, "Capacitor", "Electronic Component", o)); //wiring ev ItemList.Circuit_Parts_CapacitorSMD.set(addItem(tLastID = 20, "SMD Capacitor", "Electronic Component", o)); ItemList.Circuit_Parts_GlassFiber.set(addItem(tLastID = 21, "Glass Fiber", Materials.BorosilicateGlass.mChemicalFormula, o)); ItemList.Circuit_Parts_PetriDish.set(addItem(tLastID = 22, "Petri Dish", "For cultivating cells", o)); @@ -164,47 +162,47 @@ public class GT_MetaGenerated_Item_03 ItemList.Circuit_Chip_BioCPU.set(addItem(tLastID = 77, "Bio Processing Unit", "Bio CPU", o)); //Nand Chip - ItemList.NandChip.set(addItem(tLastID = 75, "Nand Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION})); + ItemList.NandChip.set(addItem(tLastID = 75, "NAND Chip", "A very simple Circuit", OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION)); //Vacuum Tube Item01 //Basic Circuit IC2 //Good Circuit Item01 //Integrated Logic Circuit Item01 - ItemList.Circuit_Integrated_Good.set(addItem(tLastID = 79, "Good Integrated Circuit", "Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Integrated_Good.set(addItem(tLastID = 79, "Good Integrated Circuit", "Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); //Good Integrated Circuit Item01 //Advanced Circuit IC2 - ItemList.Circuit_Microprocessor.set(addItem(tLastID = 78, "Microprocessor", "A Basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "A Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Microprocessor.set(addItem(tLastID = 78, "Microprocessor", "A Basic Circuit", OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "A Good Circuit", OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION)); //ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); //Workstation/ Item01 Datacircuit //Mainframe Item01 DataProcessor - ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "An Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Nanocomputer.set(addItem(tLastID = 83, "Nanoprocessor Assembly", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Elitenanocomputer.set(addItem(tLastID = 84, "Elite Nanocomputer", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "An Advanced Circuit", OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Nanocomputer.set(addItem(tLastID = 83, "Nanoprocessor Assembly", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Elitenanocomputer.set(addItem(tLastID = 84, "Elite Nanocomputer", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); //Nanoprocessor Mainframe Item01 Energy Flow Circuit - ItemList.Circuit_Quantumprocessor.set(addItem(tLastID = 85, "Quantumprocessor", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Quantumcomputer.set(addItem(tLastID = 86, "Quantumprocessor Assembly", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Masterquantumcomputer.set(addItem(tLastID = 87, "Master Quantumcomputer", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Quantumprocessor.set(addItem(tLastID = 85, "Quantumprocessor", "An Extreme Circuit", OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Quantumcomputer.set(addItem(tLastID = 86, "Quantumprocessor Assembly", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Masterquantumcomputer.set(addItem(tLastID = 87, "Master Quantumcomputer", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "An Elite Circuit", OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L, new Object[0]));//maybe should be removed - ItemList.Circuit_Biowarecomputer.set(addItem(tLastID = 98, "Biowareprocessor Assembly", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); - ItemList.Circuit_Biowaresupercomputer.set(addItem(tLastID = 99, "Bioware Supercomputer", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "A Master Circuit", OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "An Infinite Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L));//maybe should be removed + ItemList.Circuit_Biowarecomputer.set(addItem(tLastID = 98, "Biowareprocessor Assembly", "A Super Circuit", OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION)); + ItemList.Circuit_Biowaresupercomputer.set(addItem(tLastID = 99, "Bioware Supercomputer", "An Infinite Circuit", OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION)); - ItemList.Circuit_Bioprocessor.set(addItem(tLastID = 97, "Bioprocessor", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Bioprocessor.set(addItem(tLastID = 97, "Bioprocessor", "An Ultimate Circuit", OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION)); ItemList.Circuit_Board_Coated_Basic.set(addItem(tLastID = 100, "Circuit Board", "A basic Circuit Board", o)); ItemList.Circuit_Board_Phenolic_Good.set(addItem(tLastID = 101, "Good Circuit Board", "A good Circuit Board", o)); @@ -214,17 +212,17 @@ public class GT_MetaGenerated_Item_03 ItemList.Circuit_Board_Wetware_Extreme.set(addItem(tLastID = 105, "Extreme Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); ItemList.Circuit_Board_Plastic_Advanced.set(addItem(tLastID = 106, "Plastic Circuit Board", "A good Board", o)); ItemList.Circuit_Board_Bio_Ultra.set(addItem(tLastID = 107, "Ultra Bio Mutated Circuit Board", "Bio genetic mutated Board", o)); - ItemList.Circuit_Biomainframe.set(addItem(tLastID = 120, "Bio Mainframe", "A Bio Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Biomainframe.set(addItem(tLastID = 120, "Bio Mainframe", "A Bio Circuit", OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION)); ItemList.Tube_Wires.set(addItem(tLastID = 110, "Tube Wires", "For the Vacuum Tubes", o)); - ItemList.Cover_SolarPanel_UHV.set(addItem(tLastID = 130, "Solar Panel (UHV)", "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L)})); - ItemList.Cover_SolarPanel_UEV.set(addItem(tLastID = 131, "Solar Panel (UEV)", "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L)})); - ItemList.Cover_SolarPanel_UIV.set(addItem(tLastID = 132, "Solar Panel (UIV)", "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L)})); + ItemList.Cover_SolarPanel_UHV.set(addItem(tLastID = 130, "Solar Panel (UHV)", "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L))); + ItemList.Cover_SolarPanel_UEV.set(addItem(tLastID = 131, "Solar Panel (UEV)", "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L))); + ItemList.Cover_SolarPanel_UIV.set(addItem(tLastID = 132, "Solar Panel (UIV)", "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L))); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UHV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UHV), new GT_Cover_SolarPanel(2097152)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UEV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UEV), new GT_Cover_SolarPanel(8388608)); - GregTech_API.registerCover(ItemList.Cover_SolarPanel_UIV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UIV), new GT_Cover_SolarPanel(33554432)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UHV.get(1L), TextureFactory.of(SOLARPANEL_UHV), new GT_Cover_SolarPanel(2097152)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UEV.get(1L), TextureFactory.of(SOLARPANEL_UEV), new GT_Cover_SolarPanel(8388608)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UIV.get(1L), TextureFactory.of(SOLARPANEL_UIV), new GT_Cover_SolarPanel(33554432)); ItemList.ULV_Coil.set(addItem(tLastID = 140, "Ultra Low Voltage Coil", "Primitive Coil", o)); ItemList.LV_Coil.set(addItem(tLastID = 141, "Low Voltage Coil", "Basic Coil", o)); @@ -238,7 +236,8 @@ public class GT_MetaGenerated_Item_03 ItemList.UHV_Coil.set(addItem(tLastID = 149, "Highly Ultimate Voltage Coil", "Infinite Coil", o)); } + @Override public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { return aDoShowAllItems; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java index e9e406dbc8..2b94d96cb0 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_99.java @@ -21,8 +21,7 @@ import java.util.List; import static gregtech.api.enums.GT_Values.M; import static gregtech.api.enums.OrePrefixes.cellMolten; -public class GT_MetaGenerated_Item_99 - extends GT_MetaGenerated_Item { +public class GT_MetaGenerated_Item_99 extends GT_MetaGenerated_Item { public static GT_MetaGenerated_Item_99 INSTANCE; private BitSet enabled=new BitSet(); @@ -166,4 +165,4 @@ public class GT_MetaGenerated_Item_99 public int getItemStackLimit(ItemStack aStack) { return cellMolten.mDefaultStackSize; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java index 7bfdfad6a9..fdb29f15c8 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java @@ -145,22 +145,22 @@ public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(HOE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(KNIFE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), new ItemStack(Items.flint, 1), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Iron), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.WroughtIron), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.RedSteel), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlueSteel), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlackSteel), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.DamascusSteel), Character.valueOf('S'), OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Thaumium), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.plank.get(Materials.Wood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Wood)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Plastic), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Plastic)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel)}); - GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.IronWood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.IronWood)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Plastic), 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.IronWood), 'S', OrePrefixes.stick.get(Materials.IronWood)}); if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Coal", true)) { GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.coal, 1)}); diff --git a/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java b/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java index 805754996a..255b705f5c 100644 --- a/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java +++ b/src/main/java/gregtech/common/items/GT_NeutronReflector_Item.java @@ -5,15 +5,14 @@ import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; import net.minecraft.item.ItemStack; -public class GT_NeutronReflector_Item - extends GT_Generic_Item - implements IReactorComponent { +public class GT_NeutronReflector_Item extends GT_Generic_Item implements IReactorComponent { public GT_NeutronReflector_Item(String aUnlocalized, String aEnglish, int aMaxDamage) { super(aUnlocalized, aEnglish, "Undestructable"); this.setMaxStackSize(64); this.setMaxDamage(aMaxDamage); } + @Override public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) { if (!heatrun) { ((IReactorComponent) pulsingStack.getItem()).acceptUraniumPulse(reactor, pulsingStack, yourStack, pulseX, pulseY, youX, youY, heatrun); @@ -21,26 +20,32 @@ public class GT_NeutronReflector_Item return true; } + @Override public boolean canStoreHeat(IReactor aReactor, ItemStack aStack, int x, int y) { return false; } + @Override public int getMaxHeat(IReactor aReactor, ItemStack aStack, int x, int y) { return 0; } + @Override public int getCurrentHeat(IReactor aReactor, ItemStack aStack, int x, int y) { return 0; } + @Override public float influenceExplosion(IReactor aReactor, ItemStack aStack) { return -1.0F; } + @Override public int alterHeat(IReactor aReactor, ItemStack aStack, int x, int y, int aHeat) { return aHeat; } + @Override public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) { } } diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java index 87be9515ae..852babb52a 100644 --- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java +++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java @@ -20,9 +20,7 @@ import java.util.LinkedList; import java.util.List; import java.util.UUID; -public class GT_SensorCard_Item - extends GT_Generic_Item - implements IRemoteSensor, IPanelDataSource { +public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor, IPanelDataSource { private static final UUID CARD_TYPE = new UUID(0L, 41L); private int strCount; @@ -32,6 +30,7 @@ public class GT_SensorCard_Item setMaxStackSize(1); } + @Override public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); if (aStack != null) { @@ -40,7 +39,7 @@ public class GT_SensorCard_Item aList.add(trans("014", "Missing Coodinates!")); } else { aList.add(trans("015", "Device at:")); - aList.add(String.format("x: %d, y: %d, z: %d", new Object[]{Integer.valueOf(tNBT.getInteger("x")), Integer.valueOf(tNBT.getInteger("y")), Integer.valueOf(tNBT.getInteger("z"))})); + aList.add(String.format("x: %d, y: %d, z: %d", tNBT.getInteger("x"), tNBT.getInteger("y"), tNBT.getInteger("z"))); } } } @@ -66,6 +65,7 @@ public class GT_SensorCard_Item return CardState.NO_TARGET; } + @Override public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) { List<PanelString> rList = new LinkedList<>(); for (int i = 0; i < (strCount=aCard.getInt("mString")); i++) { @@ -78,6 +78,7 @@ public class GT_SensorCard_Item return rList; } + @Override public List<PanelSetting> getSettingsList() { List<PanelSetting> rList = new ArrayList<>(); for (int i = 0; i < strCount; i++) { @@ -86,10 +87,12 @@ public class GT_SensorCard_Item return rList; } + @Override public UUID getCardType() { return CARD_TYPE; } + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item var1, CreativeTabs aTab, List aList) { } diff --git a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java index 5ab6b3395e..c0dcb45943 100644 --- a/src/main/java/gregtech/common/items/GT_VolumetricFlask.java +++ b/src/main/java/gregtech/common/items/GT_VolumetricFlask.java @@ -43,12 +43,14 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain setNoRepair(); } + @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (!world.isRemote && isEmpty(stack) && getMovingObjectPositionFromPlayer(world, player, true) == null) player.openGui(GT_Values.GT, 1010, world, 0, 0, 0); return super.onItemRightClick(stack, world, player); } + @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { if (player instanceof FakePlayer) { return false; @@ -100,6 +102,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain return this.maxCapacity; } + @Override public int getCapacity(ItemStack stack) { int capacity = 1000; if (stack.hasTagCompound()) { @@ -126,6 +129,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain nbt.setInteger("Capacity", capacity); } + @Override public FluidStack getFluid(ItemStack stack) { if (stack.hasTagCompound()) { NBTTagCompound nbt = stack.getTagCompound(); @@ -153,6 +157,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain } } + @Override public int fill(ItemStack stack, FluidStack resource, boolean doFill) { if (stack.stackSize != 1) return 0; @@ -173,6 +178,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain return amount; } + @Override public FluidStack drain(ItemStack stack, int maxDrain, boolean doDrain) { if (stack.stackSize != 1) return null; @@ -187,6 +193,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain return new FluidStack(fluidStack, maxDrain); } + @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean b) { super.addInformation(stack, player, info, b); @@ -199,6 +206,7 @@ public class GT_VolumetricFlask extends GT_Generic_Item implements IFluidContain info.add("Rightclick on air to set volume (only while empty)"); } + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs creativeTabs, List itemList) { itemList.add(new ItemStack(this)); diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java index 0b88ec41ae..5317bfca88 100644 --- a/src/main/java/gregtech/common/items/ItemComb.java +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -1,13 +1,13 @@ package gregtech.common.items; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; import forestry.api.recipes.RecipeManagers; import gregtech.GT_Mod; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -23,10 +23,17 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import java.util.List; +import java.util.Arrays; import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.NF; +import static gregtech.api.enums.GT_Values.NI; +import static gregtech.api.enums.GT_Values.RA; +import static gregtech.api.enums.GT_Values.V; public class ItemComb extends Item { @SideOnly(Side.CLIENT) @@ -69,7 +76,8 @@ public class ItemComb extends Item { return 2; } - @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0"); this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1"); @@ -98,775 +106,466 @@ public class ItemComb extends Item { return CombType.values()[stack.getItemDamage()].getName(); } public void initCombsRecipes() { - ItemStack tComb; - - //Organic - tComb = getStackForType(CombType.LIGNIE); - addSpecialCentLV(tComb,GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), 90); - addProcessLV(tComb, Materials.Lignite, 100); - tComb = getStackForType(CombType.COAL); - addSpecialCentLV(tComb,GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), 5, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), 100); - addProcessLV(tComb, Materials.Coal, 100); - tComb = getStackForType(CombType.STICKY); - addSpecialCentLV(tComb, ItemList.IC2_Resin.get(1, new Object[0]), 50, ItemList.IC2_Plantball.get(1, new Object[0]), 15); - tComb = getStackForType(CombType.OIL); - addSpecialCentLV(tComb, ItemList.Crop_Drop_OilBerry.get(1, new Object[0]), 70, GT_Bees.drop.getStackForType(DropType.OIL), 100); - addProcessLV(tComb, Materials.Oilsands, 100); - tComb = getStackForType(CombType.APATITE); - addProcessLV(tComb, Materials.Apatite, 100); - addProcessLV(tComb, Materials.Phosphate, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Phosphate.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Phosphate, 4), 10000, (int) (Materials.Phosphate.getMass() * 128), 384, false); - tComb = getStackForType(CombType.ASH); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 5000, 5000}, 128, 5); + //Organic + addProcessGT(CombType.LIGNIE, new Materials[] {Materials.Lignite}, Voltage.LV); + addProcessGT(CombType.COAL, new Materials[] {Materials.Coal}, Voltage.LV); + addCentrifugeToItemStack(CombType.STICKY, new ItemStack[] { ItemList.IC2_Resin.get(1), ItemList.IC2_Plantball.get(1), ItemList.FR_Wax.get(1) }, new int[] {50 * 100, 15 * 100, 50 * 100}, Voltage.ULV); + addProcessGT(CombType.OIL, new Materials[] {Materials.Oilsands}, Voltage.LV); + addProcessGT(CombType.APATITE, new Materials[] {Materials.Apatite, Materials.Phosphate}, Voltage.LV); + addCentrifugeToMaterial(CombType.ASH, new Materials[] {Materials.DarkAsh, Materials.Ash}, new int[] { 50*100, 50*100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack(CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GT_Bees.drop.getStackForType(DropType.OIL), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + }else { + addCentrifugeToItemStack(CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GT_Bees.drop.getStackForType(DropType.OIL), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Oilsands, 1), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToMaterial(CombType.APATITE, new Materials[] { Materials.Apatite, Materials.Phosphate }, new int[] {100 * 100, 80 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + //ic2 - tComb = getStackForType(CombType.COOLANT); - addSpecialCentHV(tComb, GT_Bees.drop.getStackForType(DropType.COOLANT), 100, ItemList.FR_Wax.get(1, new Object[0]), 100); - tComb = getStackForType(CombType.ENERGY); - addSpecialCentHV(tComb, GT_Bees.drop.getStackForType(DropType.HOT_COOLANT), 20, ItemList.IC2_Energium_Dust.get(1L), 20, ItemList.FR_RefractoryWax.get(1, new Object[0]), 50); - tComb = getStackForType(CombType.LAPOTRON); - addSpecialCentHV(tComb, GT_Bees.drop.getStackForType(DropType.LAPIS), 20, GT_ModHandler.getModItem("dreamcraft", "item.LapotronDust", 1, 0), 15, GT_ModHandler.getModItem("MagicBees", "wax", 1, 2), 40); - tComb = getStackForType(CombType.PYROTHEUM); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.dustTiny,Materials.Blizz,1), GT_OreDictUnificator.get(OrePrefixes.dustTiny,Materials.Pyrotheum,1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{3000, 2500, 2000, 0, 0, 0}, 384, 480); - tComb = getStackForType(CombType.CRYOTHEUM); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.dustTiny,Materials.Blaze,1), GT_OreDictUnificator.get(OrePrefixes.dustTiny,Materials.Cryotheum,1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{3000, 2500, 2000, 0, 0, 0}, 384, 480); - //Alloy - tComb = getStackForType(CombType.REDALLOY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.RedAlloy, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 10000}, 128, 5); - addProcessLV(tComb, Materials.Redstone, 75); - addProcessLV(tComb, Materials.Copper, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Copper.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Copper, 4), 10000, (int) (Materials.Copper.getMass() * 128), 384, false); - tComb = getStackForType(CombType.REDSTONEALLOY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.RedstoneAlloy, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 10000}, 128, 5); - addProcessLV(tComb, Materials.Redstone, 90); - addProcessLV(tComb, Materials.Silicon, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Silicon.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Silicon, 4), 10000, (int) (Materials.Silicon.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Coal, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Coal.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Coal, 4), 10000, (int) (Materials.Coal.getMass() * 128), 384, false); - tComb = getStackForType(CombType.CONDUCTIVEIRON); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.ConductiveIron, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 9000}, 256, 120); - addProcessMV(tComb, Materials.Silver, 55); - addProcessMV(tComb, Materials.Iron, 65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Iron.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Iron, 4), 10000, (int) (Materials.Iron.getMass() * 128), 768, false); - tComb = getStackForType(CombType.VIBRANTALLOY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.VibrantAlloy, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 7000}, 384, 480); - addProcessHV(tComb, Materials.Chrome, 50); - tComb = getStackForType(CombType.ENERGETICALLOY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.EnergeticAlloy, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 8000}, 384, 480); - addProcessHV(tComb, Materials.Gold, 60); - tComb = getStackForType(CombType.ELECTRICALSTEEL); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.ElectricalSteel, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 10000}, 128, 5); - addProcessLV(tComb, Materials.Silicon, 75); - addProcessLV(tComb, Materials.Coal, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Coal.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Coal, 4), 10000, (int) (Materials.Coal.getMass() * 128), 384, false); - tComb = getStackForType(CombType.DARKSTEEL); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkSteel, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 10000}, 256, 120); - addProcessMV(tComb, Materials.Coal, 75); - tComb = getStackForType(CombType.PULSATINGIRON); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.PulsatingIron, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 8000}, 384, 480); - addProcessHV(tComb, Materials.Iron, 75); - tComb = getStackForType(CombType.STAINLESSSTEEL); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]),GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.StainlessSteel, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 5000}, 384, 480); - addProcessHV(tComb, Materials.Iron, 75); - addProcessHV(tComb, Materials.Chrome, 55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Chrome.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Chrome, 4), 10000, (int) (Materials.Chrome.getMass() * 128), 1536, false); - addProcessHV(tComb, Materials.Manganese, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Manganese.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Manganese, 4), 10000, (int) (Materials.Manganese.getMass() * 128), 1536, false); - addProcessHV(tComb, Materials.Nickel, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Nickel.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Nickel, 4), 10000, (int) (Materials.Nickel.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.ENDERIUM); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_RefractoryWax.get(1, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 3000, 5000}, 384, 480); - + addCentrifugeToItemStack(CombType.COOLANT, new ItemStack[] { GT_Bees.drop.getStackForType(DropType.COOLANT), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100}, Voltage.HV, 196); + addCentrifugeToItemStack(CombType.ENERGY, new ItemStack[] {GT_Bees.drop.getStackForType(DropType.HOT_COOLANT), ItemList.IC2_Energium_Dust.get(1L), ItemList.FR_RefractoryWax.get(1)}, new int[] {20 * 100, 20 * 100, 50 * 100}, Voltage.HV, 196); + addCentrifugeToItemStack(CombType.LAPOTRON, new ItemStack[] {GT_Bees.drop.getStackForType(DropType.LAPIS), GT_ModHandler.getModItem("dreamcraft", "item.LapotronDust", 1, 0), GT_ModHandler.getModItem("MagicBees", "wax", 1, 2) }, new int[] {20 * 100, 15 * 100, 40 * 100}, Voltage.HV, 196); + addCentrifugeToMaterial(CombType.PYROTHEUM, new Materials[] {Materials.Blaze, Materials.Pyrotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.CRYOTHEUM, new Materials[] {Materials.Blizz, Materials.Cryotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + //Alloy + addProcessGT(CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, Voltage.LV); + addProcessGT(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, Voltage.LV); + addProcessGT(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, Voltage.MV); + addProcessGT(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, Voltage.HV); + addProcessGT(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, Voltage.HV); + addProcessGT(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, Voltage.LV); + addProcessGT(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, Voltage.MV); + addProcessGT(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, Voltage.HV); + addProcessGT(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, Voltage.HV); + addCentrifugeToItemStack(CombType.ENDERIUM, new ItemStack[] {ItemList.FR_RefractoryWax.get(1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1) }, new int[] {50 * 100, 30 * 100, 50 * 100 }, Voltage.HV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron }, new int[] {90 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy }, new int[] {70 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel }, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel }, new int[] {100 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel }, new int[] {50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + }else { + addCentrifugeToMaterial(CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, new int[] {100 * 100, 75 * 100, 90 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, new int[] {100 * 100, 90 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, new int[] {90 * 100, 55 * 100, 65 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, new int[] {70 * 100, 50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, new int[] {80 * 100, 60 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, new int[] {80 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, new int[] {50 * 100, 75 * 100, 55 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + } + //Thaumic - tComb = getStackForType(CombType.THAUMIUMDUST); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 10000}, 256, 120); - addProcessMV(tComb, Materials.Iron, 75); - tComb = getStackForType(CombType.THAUMIUMSHARD); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), new int[] {2000, 2000, 2000, 2000, 2000, 2000 }, 128, 5); - tComb = getStackForType(CombType.AMBER); - addProcessLV(tComb, Materials.Amber, 100); - tComb = getStackForType(CombType.QUICKSILVER); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 1000}, 128, 5); - addProcessLV(tComb, Materials.Cinnabar, 85); - tComb = getStackForType(CombType.SALISMUNDUS); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 1000}, 256, 120); - tComb = getStackForType(CombType.TAINTED); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), new int[] {1500, 1500, 1500, 1500, 1500, 5000}, 128, 5); - tComb = getStackForType(CombType.MITHRIL); - addProcessHV(tComb, Materials.Mithril, 75); - addProcessHV(tComb, Materials.Platinum, 55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Platinum.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Platinum, 4), 10000, (int) (Materials.Platinum.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.ASTRALSILVER); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.AstralSilver, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 2000, 1000}, 384, 480); - addProcessHV(tComb, Materials.Silver, 75); - tComb = getStackForType(CombType.THAUMINITE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 2000, 1000}, 384, 480); - tComb = getStackForType(CombType.SHADOWMETAL); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Shadow, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.ShadowSteel, 1), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {5000, 2000, 1000}, 384, 480); - addProcessHV(tComb, Materials.Shadow, 75); - tComb = getStackForType(CombType.DIVIDED); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1), GT_Values.NI, GT_Values.NI, new int[] {5000, 2000, 1000, 500}, 384, 480); - addProcessHV(tComb, Materials.Iron, 75); - addProcessHV(tComb, Materials.Diamond, 55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Diamond.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Diamond, 4), 10000, (int) (Materials.Diamond.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.SPARKELING); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("MagicBees", "miscResources", 1, 5), GT_ModHandler.getModItem("MagicBees", "miscResources", 1, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1), GT_Values.NI, GT_Values.NI, new int[] {5000, 1000, 500, 1000}, 512, 1920); - addProcessEV(tComb, Materials.NetherStar, 50); - + addProcessGT(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, Voltage.MV); + addCentrifugeToItemStack(CombType.THAUMIUMSHARD, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) }, new int[] {20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 50 * 100 }, Voltage.ULV); + addProcessGT(CombType.AMBER, new Materials[] {Materials.Amber}, Voltage.LV); + addProcessGT(CombType.QUICKSILVER, new Materials[] {Materials.Cinnabar }, Voltage.LV); + addCentrifugeToItemStack(CombType.SALISMUNDUS, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {100 * 100, 50 * 100}, Voltage.MV); + addCentrifugeToItemStack(CombType.TAINTED, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {15 * 100, 15 * 100, 15 * 100, 15 * 100, 15 * 100, 50 * 100}, Voltage.ULV); + addProcessGT(CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum }, Voltage.HV); + addProcessGT(CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver }, Voltage.HV); + addCentrifugeToMaterial(CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver}, new int[] {20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(CombType.THAUMINITE, new ItemStack[] {GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {20 * 100, 10 * 100, 50 *100}, Voltage.HV); + addProcessGT(CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel }, Voltage.HV); + addCentrifugeToMaterial(CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 20:75) * 100, 10 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) , 50 * 100); + addProcessGT(CombType.DIVIDED, new Materials[] {Materials.Iron, Materials.Diamond }, Voltage.HV); + addCentrifugeToItemStack(CombType.DIVIDED, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1)}, new int[] {50 * 100, 20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 5:55) * 100}, Voltage.HV); + addProcessGT(CombType.SPARKELING, new Materials[] {Materials.NetherStar}, Voltage.EV); + addCentrifugeToItemStack(CombType.SPARKELING, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("MagicBees", "miscResources", 2, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1)}, new int[] {50 * 100, 10 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:50) * 100}, Voltage.EV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium }, new int[] {100 * 100}, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5) }, new int[] {50 * 100, 100 * 100 }, Voltage.ULV); + }else { + addCentrifugeToMaterial(CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToMaterial(CombType.AMBER, new Materials[] {Materials.Amber }, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Cinnabar, 1) }, new int[] {50 * 100, 100 * 100, 85 * 100 }, Voltage.ULV); + addCentrifugeToMaterial(CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum}, new int[] {75 * 100, 55 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + } + //Gem Line - tComb = getStackForType(CombType.STONE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.GraniteBlack,1), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.GraniteRed,1), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.Basalt,1), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.Marble,1), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.Redrock,1), new int[] {7000, 5000, 5000, 5000, 5000, 5000}, 128, 5); - addProcessLV(tComb, Materials.Soapstone, 95); - addProcessLV(tComb, Materials.Talc, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Talc.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Talc, 4), 10000, (int) (Materials.Talc.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Apatite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Apatite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Apatite, 4), 10000, (int) (Materials.Apatite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Phosphate, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Phosphate.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Phosphate, 4), 10000, (int) (Materials.Phosphate.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.TricalciumPhosphate, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.TricalciumPhosphate.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.TricalciumPhosphate, 4), 10000, (int) (Materials.TricalciumPhosphate.getMass() * 128), 384, false); - tComb = getStackForType(CombType.CERTUS); - addProcessLV(tComb, Materials.CertusQuartz, 100); - addProcessLV(tComb, Materials.Quartzite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Quartzite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Quartzite, 4), 10000, (int) (Materials.Quartzite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Barite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Barite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Barite, 4), 10000, (int) (Materials.Barite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.FLUIX); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF,ItemList.FR_Wax.get(1, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.dust,Materials.Fluix,1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {3000, 2500}, 128, 5); - addProcessLV(tComb, Materials.Redstone, 90); - addProcessLV(tComb, Materials.CertusQuartz, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.CertusQuartz.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.CertusQuartz, 4), 10000, (int) (Materials.CertusQuartz.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.NetherQuartz, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.NetherQuartz.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.NetherQuartz, 4), 10000, (int) (Materials.NetherQuartz.getMass() * 128), 384, false); - tComb = getStackForType(CombType.REDSTONE); - addProcessLV(tComb, Materials.Redstone, 100); - addProcessLV(tComb, Materials.Cinnabar, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Cinnabar.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Cinnabar, 4), 10000, (int) (Materials.Cinnabar.getMass() * 128), 384, false); - tComb = getStackForType(CombType.RAREEARTH); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF,ItemList.FR_Wax.get(1, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.dustTiny,Materials.RareEarth,1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] {3000, 10000}, 128, 5); - tComb = getStackForType(CombType.LAPIS); - addProcessLV(tComb, Materials.Lapis, 100); - addProcessLV(tComb, Materials.Sodalite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Sodalite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Sodalite, 4), 10000, (int) (Materials.Sodalite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Lazurite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lazurite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lazurite, 4), 10000, (int) (Materials.Lazurite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Calcite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Calcite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Calcite, 4), 10000, (int) (Materials.Calcite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.RUBY); - addProcessLV(tComb, Materials.Ruby, 100); - addProcessLV(tComb, Materials.Redstone, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Redstone.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Redstone, 4), 10000, (int) (Materials.Redstone.getMass() * 128), 384, false); - tComb = getStackForType(CombType.REDGARNET); - addProcessLV(tComb, Materials.GarnetRed, 100); - addProcessLV(tComb, Materials.GarnetYellow, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.GarnetYellow.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.GarnetYellow, 4), 10000, (int) (Materials.GarnetYellow.getMass() * 128), 384, false); - tComb = getStackForType(CombType.YELLOWGARNET); - addProcessLV(tComb, Materials.GarnetYellow, 100); - addProcessLV(tComb, Materials.GarnetRed, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.GarnetRed.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.GarnetRed, 4), 10000, (int) (Materials.GarnetRed.getMass() * 128), 384, false); - tComb = getStackForType(CombType.SAPPHIRE); - addProcessLV(tComb, Materials.Sapphire, 100); - addProcessLV(tComb, Materials.GreenSapphire, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.GreenSapphire.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.GreenSapphire, 4), 10000, (int) (Materials.GreenSapphire.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Almandine, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Almandine.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Almandine, 4), 10000, (int) (Materials.Almandine.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Pyrope, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrope.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrope, 4), 10000, (int) (Materials.Pyrope.getMass() * 128), 384, false); - tComb = getStackForType(CombType.DIAMOND); - addProcessLV(tComb, Materials.Diamond, 100); - addProcessLV(tComb, Materials.Graphite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Graphite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Graphite, 4), 10000, (int) (Materials.Graphite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.OLIVINE); - addProcessLV(tComb, Materials.Olivine, 100); - addProcessLV(tComb, Materials.Bentonite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Bentonite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Bentonite, 4), 10000, (int) (Materials.Bentonite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Magnesite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnesite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnesite, 4), 10000, (int) (Materials.Magnesite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Glauconite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Glauconite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Glauconite, 4), 10000, (int) (Materials.Glauconite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.EMERALD); - addProcessLV(tComb, Materials.Emerald, 100); - addProcessLV(tComb, Materials.Beryllium, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Beryllium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Beryllium, 4), 10000, (int) (Materials.Beryllium.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Thorium, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Thorium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Thorium, 4), 10000, (int) (Materials.Thorium.getMass() * 128), 384, false); - tComb = getStackForType(CombType.FIRESTONE); - addProcessLV(tComb, Materials.Firestone, 100); - tComb = getStackForType(CombType.PYROPE); - addProcessLV(tComb, Materials.Pyrope, 100); - addProcessLV(tComb, Materials.Aluminium, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Aluminium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Aluminium, 4), 10000, (int) (Materials.Aluminium.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Magnesium, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnesium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnesium, 4), 10000, (int) (Materials.Magnesium.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Silicon, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Silicon.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Silicon, 4), 10000, (int) (Materials.Silicon.getMass() * 128), 384, false); - tComb = getStackForType(CombType.GROSSULAR); - addProcessLV(tComb, Materials.Grossular, 100); - addProcessLV(tComb, Materials.Aluminium, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Aluminium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Aluminium, 4), 10000, (int) (Materials.Aluminium.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Silicon, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Silicon.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Silicon, 4), 10000, (int) (Materials.Silicon.getMass() * 128), 384, false); + addProcessGT(CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, Voltage.LV); + addProcessGT(CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, Voltage.LV); + addProcessGT(CombType.FLUIX, new Materials[] {Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, Voltage.LV); + addProcessGT(CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar}, Voltage.LV); + addCentrifugeToMaterial(CombType.RAREEARTH, new Materials[] {Materials.RareEarth}, new int[] {100 * 100}, new int[] { 1}, Voltage.ULV, NI, 30 * 100); + addProcessGT(CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, Voltage.LV); + addProcessGT(CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, Voltage.LV); + addProcessGT(CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, Voltage.LV); + addProcessGT(CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, Voltage.LV); + addProcessGT(CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, Voltage.LV); + addProcessGT(CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, Voltage.LV); + addProcessGT(CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, Voltage.LV); + addProcessGT(CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, Voltage.LV); + addProcessGT(CombType.FIRESTONE, new Materials[] {Materials.Firestone}, Voltage.LV); + addProcessGT(CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, Voltage.LV); + addProcessGT(CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, Voltage.LV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.STONE, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Basalt, Materials.Marble, Materials.Redrock}, new int[] {70 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100}, new int[] { 9, 9, 9, 9, 9, 9}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(CombType.FLUIX, new Materials[] {Materials.Fluix}, new int[] {25 * 100}, new int[] { 9}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, new int[] {95 * 100, 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(CombType.FLUIX, new Materials[] {Materials.Fluix, Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, new int[] {25 * 100, 90 * 100, 90 * 100, 90 * 100}, new int[] { 9, 1, 1, 1}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar }, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, new int[] {100 * 100, 90 * 100, 90 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, new int[] {100 * 100, 90 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, new int[] {100 * 100, 90 * 100, 90 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, new int[] {100 * 100, 90 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, new int[] {100 * 100, 85 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.FIRESTONE, new Materials[] {Materials.Firestone}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 30 * 100); + addCentrifugeToMaterial(CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + // Metals Line - tComb = getStackForType(CombType.SLAG); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1), 50,GT_OreDictUnificator.get(OrePrefixes.dust, Materials.GraniteBlack, 1), 20,GT_OreDictUnificator.get(OrePrefixes.dust, Materials.GraniteRed, 1), 20); - addProcessLV(tComb, Materials.Salt, 100); - addProcessLV(tComb, Materials.RockSalt, 100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.RockSalt.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.RockSalt, 4), 10000, (int) (Materials.RockSalt.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Lepidolite, 100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lepidolite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lepidolite, 4), 10000, (int) (Materials.Lepidolite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Spodumene, 100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Spodumene.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Spodumene, 4), 10000, (int) (Materials.Spodumene.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Monazite, 100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Monazite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Monazite, 4), 10000, (int) (Materials.Monazite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.COPPER); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Copper, 1), 70); - addProcessLV(tComb, Materials.Copper, 100); - addProcessLV(tComb, Materials.Tetrahedrite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Tetrahedrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 4), 10000, (int) (Materials.Tetrahedrite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Chalcopyrite, 95); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Chalcopyrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 4), 10000, (int) (Materials.Chalcopyrite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Malachite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Malachite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Malachite, 4), 10000, (int) (Materials.Malachite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Pyrite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrite, 4), 10000, (int) (Materials.Pyrite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Stibnite, 65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(6), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Stibnite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Stibnite, 4), 10000, (int) (Materials.Stibnite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.TIN); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1), 60); - addProcessLV(tComb, Materials.Tin, 100); - addProcessLV(tComb, Materials.Cassiterite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Cassiterite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Cassiterite, 4), 10000, (int) (Materials.Cassiterite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.CassiteriteSand, 65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.CassiteriteSand.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.CassiteriteSand, 4), 10000, (int) (Materials.CassiteriteSand.getMass() * 128), 384, false); - tComb = getStackForType(CombType.LEAD); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1), 45); - addProcessLV(tComb, Materials.Lead, 100); - addProcessLV(tComb, Materials.Galena, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Galena.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Galena, 4), 10000, (int) (Materials.Galena.getMass() * 128), 384, false); - tComb = getStackForType(CombType.IRON); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), 30); - addProcessLV(tComb, Materials.Iron, 100); - addProcessLV(tComb, Materials.Magnetite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnetite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnetite, 4), 10000, (int) (Materials.Magnetite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.BrownLimonite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.BrownLimonite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.BrownLimonite, 4), 10000, (int) (Materials.BrownLimonite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.YellowLimonite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.YellowLimonite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.YellowLimonite, 4), 10000, (int) (Materials.YellowLimonite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.VanadiumMagnetite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.VanadiumMagnetite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.VanadiumMagnetite, 4), 10000, (int) (Materials.VanadiumMagnetite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.BandedIron, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(6), Materials.UUMatter.getFluid(Math.max(1, ((Materials.BandedIron.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.BandedIron, 4), 10000, (int) (Materials.BandedIron.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Pyrite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(7), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrite, 4), 10000, (int) (Materials.Pyrite.getMass() * 128), 384, false); - if (ProcessingModSupport.aEnableGCMarsMats) - addProcessLV(tComb, Materials.MeteoricIron, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(8), Materials.UUMatter.getFluid(Math.max(1, ((Materials.MeteoricIron.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.MeteoricIron, 4), 10000, (int) (Materials.MeteoricIron.getMass() * 128), 384, false); - tComb = getStackForType(CombType.STEEL); - addProcessLV(tComb, Materials.Iron, Materials.Iron, 100); - addProcessLV(tComb, Materials.Magnetite, Materials.Magnetite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnetite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnetite, 4), 10000, (int) (Materials.Magnetite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.BrownLimonite, Materials.YellowLimonite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.BrownLimonite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.BrownLimonite, 4), 10000, (int) (Materials.BrownLimonite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.YellowLimonite, Materials.BrownLimonite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.YellowLimonite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.YellowLimonite, 4), 10000, (int) (Materials.YellowLimonite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.VanadiumMagnetite, Materials.VanadiumMagnetite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.VanadiumMagnetite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.VanadiumMagnetite, 4), 10000, (int) (Materials.VanadiumMagnetite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.BandedIron, Materials.BandedIron, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(6), Materials.UUMatter.getFluid(Math.max(1, ((Materials.BandedIron.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.BandedIron, 4), 10000, (int) (Materials.BandedIron.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Pyrite, Materials.Pyrite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(7), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrite, 4), 10000, (int) (Materials.Pyrite.getMass() * 128), 384, false); - if (ProcessingModSupport.aEnableGCMarsMats) - addProcessLV(tComb, Materials.MeteoricIron, Materials.MeteoricIron, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(8), Materials.UUMatter.getFluid(Math.max(1, ((Materials.MeteoricIron.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.MeteoricIron, 4), 10000, (int) (Materials.MeteoricIron.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Molybdenite, 65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(9), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Molybdenite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Molybdenite, 4), 10000, (int) (Materials.Molybdenite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Molybdenum, 65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(10), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Molybdenum.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Molybdenum, 4), 10000, (int) (Materials.Molybdenum.getMass() * 128), 384, false); - tComb = getStackForType(CombType.NICKEL); - addProcessLV(tComb, Materials.Nickel, 100); - addProcessLV(tComb, Materials.Garnierite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Garnierite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Garnierite, 4), 10000, (int) (Materials.Garnierite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Pentlandite, 85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pentlandite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pentlandite, 4), 10000, (int) (Materials.Pentlandite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Cobaltite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Cobaltite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Cobaltite, 4), 10000, (int) (Materials.Cobaltite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Wulfenite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Wulfenite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Wulfenite, 4), 10000, (int) (Materials.Wulfenite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Powellite, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(6), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Powellite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Powellite, 4), 10000, (int) (Materials.Powellite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.ZINC); - addProcessLV(tComb, Materials.Zinc, 100); - addProcessLV(tComb, Materials.Sphalerite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Sphalerite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Sphalerite, 4), 10000, (int) (Materials.Sphalerite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Sulfur, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Sulfur.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Sulfur, 4), 10000, (int) (Materials.Sulfur.getMass() * 128), 384, false); - tComb = getStackForType(CombType.SILVER); - addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1), 80); - addProcessLV(tComb, Materials.Silver, 100); - addProcessLV(tComb, Materials.Galena, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Galena.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Galena, 4), 10000, (int) (Materials.Galena.getMass() * 128), 384, false); - tComb = getStackForType(CombType.GOLD); - addProcessLV(tComb, Materials.Gold, 100); - addProcessLV(tComb, Materials.Magnetite, Materials.Gold, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnetite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnetite, 4), 10000, (int) (Materials.Magnetite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.SULFUR); - addProcessLV(tComb, Materials.Sulfur, 100); - addProcessLV(tComb, Materials.Pyrite, 90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrite, 4), 10000, (int) (Materials.Pyrite.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Sphalerite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Sphalerite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Sphalerite, 4), 10000, (int) (Materials.Sphalerite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.GALLIUM); - addProcessLV(tComb, Materials.Gallium, 80); - addProcessLV(tComb, Materials.Niobium, 75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Niobium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Niobium, 4), 10000, (int) (Materials.Niobium.getMass() * 128), 384, false); - tComb = getStackForType(CombType.ARSENIC); - addProcessLV(tComb, Materials.Arsenic, 80); - addProcessLV(tComb, Materials.Bismuth, 70); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Bismuth.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Bismuth, 4), 10000, (int) (Materials.Bismuth.getMass() * 128), 384, false); - addProcessLV(tComb, Materials.Antimony, 70); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Antimony.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Antimony, 4), 10000, (int) (Materials.Antimony.getMass() * 128), 384, false); + addProcessGT(CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, Voltage.LV); + addProcessGT(CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, Voltage.LV); + addProcessGT(CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, Voltage.LV); + addProcessGT(CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, Voltage.LV); + addProcessGT(CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, Voltage.LV); + addProcessGT(CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sulfur}, Voltage.LV); + addProcessGT(CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, Voltage.LV); + addProcessGT(CombType.GOLD, new Materials[] {Materials.Gold, Materials.Magnetite}, Voltage.LV); + addChemicalProcess(CombType.GOLD, Materials.Magnetite, Materials.Gold, Voltage.LV); + addProcessGT(CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, Voltage.LV); + addProcessGT(CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, Voltage.LV); + addProcessGT(CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, Voltage.LV); + if (ProcessingModSupport.aEnableGCMarsMats) { + addProcessGT(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron}, Voltage.LV); + addProcessGT(CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); + }else { + addProcessGT(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite}, Voltage.LV); + addProcessGT(CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); + } + addChemicalProcess(CombType.STEEL, Materials.BrownLimonite, Materials.YellowLimonite, Voltage.LV); + addChemicalProcess(CombType.STEEL, Materials.YellowLimonite, Materials.BrownLimonite, Voltage.LV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.SLAG, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed}, new int[] {50 * 100, 20 * 100, 20 * 100}, new int[] { 9, 9, 9}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.COPPER, new Materials[] {Materials.Copper}, new int[] {70 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.TIN, new Materials[] {Materials.Tin}, new int[] {60 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Lead}, new int[] {45 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron}, new int[] {30 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.STEEL, new Materials[] {Materials.Steel}, new int[] {40 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.SILVER, new Materials[] {Materials.Silver}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, new int[] {100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, new int[] {100 * 100, 85 * 100, 95 * 100, 80 * 100, 75 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, new int[] {100 * 100, 85 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + if (ProcessingModSupport.aEnableGCMarsMats) { + addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.MeteoricIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LEAD, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Molybdenite, Materials.Molybdenum, Materials.MeteoricIron }, new int[] {100 * 100, 90 * 100, 80 * 100, 65 * 100, 65 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.STEEL, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Molybdenite, Materials.Molybdenum }, new int[] {100 * 100, 90 * 100, 80 * 100, 85 * 100, 65 * 100, 65 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + addCentrifugeToMaterial(CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, new int[] {100 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sphalerite, Materials.Sulfur}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.GOLD, new Materials[] {Materials.Gold}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, new int[] {100 * 100, 90 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, new int[] { 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, new int[] {80 * 100, 70 * 100, 70 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + } // Rare Metals Line - tComb = getStackForType(CombType.BAUXITE); - addProcessLV(tComb, Materials.Bauxite, 75); - addProcessLV(tComb,Materials.Aluminium,55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Aluminium.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Aluminium, 4), 10000, (int) (Materials.Aluminium.getMass() * 128), 384, false); - tComb = getStackForType(CombType.ALUMINIUM); - addProcessLV(tComb,Materials.Aluminium,60); - addProcessLV(tComb,Materials.Bauxite,80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Bauxite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Bauxite, 4), 10000, (int) (Materials.Bauxite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.MANGANESE); - addProcessLV(tComb,Materials.Manganese,30); - addProcessLV(tComb,Materials.Grossular,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Grossular.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Grossular, 4), 10000, (int) (Materials.Grossular.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Spessartine,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Spessartine.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Spessartine, 4), 10000, (int) (Materials.Spessartine.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Pyrolusite,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrolusite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrolusite, 4), 10000, (int) (Materials.Pyrolusite.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Tantalite,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Tantalite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Tantalite, 4), 10000, (int) (Materials.Tantalite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.TITANIUM); - addProcessEV(tComb,Materials.Titanium,90); - addProcessEV(tComb,Materials.Ilmenite,80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Ilmenite.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Ilmenite, 4), 10000, (int) (Materials.Ilmenite.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Bauxite,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Bauxite.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Bauxite, 4), 10000, (int) (Materials.Bauxite.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Rutile,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Rutile.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Rutile, 4), 10000, (int) (Materials.Rutile.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.MAGNESIUM); - addProcessLV(tComb,Materials.Magnesium,100); - addProcessLV(tComb,Materials.Magnesite,80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Magnesite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Magnesite, 4), 10000, (int) (Materials.Magnesite.getMass() * 128), 384, false); - tComb = getStackForType(CombType.CHROME); - addProcessHV(tComb,Materials.Chrome,50); - addProcessHV(tComb,Materials.Ruby,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Ruby.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Ruby, 4), 10000, (int) (Materials.Ruby.getMass() * 128), 1536, false); - addProcessHV(tComb,Materials.Chromite,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Chromite.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Chromite, 4), 10000, (int) (Materials.Chromite.getMass() * 128), 1536, false); - addProcessHV(tComb,Materials.Redstone,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Redstone.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Redstone, 4), 10000, (int) (Materials.Redstone.getMass() * 128), 1536, false); - addProcessHV(tComb, Materials.Neodymium, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Neodymium.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Neodymium, 4), 10000, (int) (Materials.Neodymium.getMass() * 128), 1536, false); - addProcessHV(tComb, Materials.Bastnasite, 80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(6), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Bastnasite.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Bastnasite, 4), 10000, (int) (Materials.Bastnasite.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.TUNGSTEN); - addProcessIV(tComb,Materials.Tungstate,80); - addProcessIV(tComb,Materials.Scheelite,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Scheelite.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Scheelite, 4), 10000, (int) (Materials.Scheelite.getMass() * 128), 6144, true); - addProcessIV(tComb,Materials.Lithium,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lithium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lithium, 4), 10000, (int) (Materials.Lithium.getMass() * 128), 6144, true); - addProcessIV(tComb,Materials.Tungsten,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Tungsten.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Tungsten, 4), 10000, (int) (Materials.Tungsten.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.PLATINUM); - addProcessHV(tComb,Materials.Platinum,40); - addProcessHV(tComb,Materials.Cooperite,40); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Cooperite.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Cooperite, 4), 10000, (int) (Materials.Cooperite.getMass() * 128), 1536, false); - addProcessHV(tComb,Materials.Palladium,40); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Palladium.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Palladium, 4), 10000, (int) (Materials.Palladium.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.MOLYBDENUM); - addProcessLV(tComb,Materials.Molybdenum,100); - addProcessLV(tComb,Materials.Molybdenite,90); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Molybdenite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Molybdenite, 4), 10000, (int) (Materials.Molybdenite.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Powellite,80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Powellite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Powellite, 4), 10000, (int) (Materials.Powellite.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Wulfenite,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Wulfenite.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Wulfenite, 4), 10000, (int) (Materials.Wulfenite.getMass() * 128), 384, false); - addProcessIV(tComb,Materials.Osmium,15); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(5), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Osmium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Osmium, 4), 10000, (int) (Materials.Osmium.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.IRIDIUM); - addProcessIV(tComb,Materials.Iridium,20); - addProcessIV(tComb,Materials.Osmium,15); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Osmium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Osmium, 4), 10000, (int) (Materials.Osmium.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.OSMIUM); - addProcessIV(tComb,Materials.Osmium,25); - addProcessIV(tComb,Materials.Iridium,15); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Iridium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Iridium, 4), 10000, (int) (Materials.Iridium.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.LITHIUM); - addProcessMV(tComb,Materials.Lithium,85); - addProcessMV(tComb,Materials.Aluminium,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Aluminium.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Aluminium, 4), 10000, (int) (Materials.Aluminium.getMass() * 128), 768, false); - - tComb = getStackForType(CombType.SALT); - addProcessMV(tComb,Materials.Salt,100); - addSpecialCentMV(tComb, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), 100, GT_ModHandler.getModItem("dreamcraft", "item.EdibleSalt", 1L, 0), 50); - addProcessMV(tComb,Materials.RockSalt,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.RockSalt.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.RockSalt, 4), 10000, (int) (Materials.RockSalt.getMass() * 128), 768, false); - addProcessMV(tComb,Materials.Saltpeter,65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Saltpeter.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Saltpeter, 4), 10000, (int) (Materials.Saltpeter.getMass() * 128), 768, false); - tComb = getStackForType(CombType.ELECTROTINE); - addProcessHV(tComb,Materials.Electrotine,80); - addProcessHV(tComb,Materials.Electrum,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Electrum.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Electrum, 4), 10000, (int) (Materials.Electrum.getMass() * 128), 1536, false); - addProcessHV(tComb,Materials.Redstone,65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Redstone.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Redstone, 4), 10000, (int) (Materials.Redstone.getMass() * 128), 1536, false); - + addProcessGT(CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, Voltage.LV); + addProcessGT(CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, Voltage.LV); + addProcessGT(CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, Voltage.LV); + addProcessGT(CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, Voltage.EV); + addProcessGT(CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, Voltage.LV); + addProcessGT(CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, Voltage.HV); + addProcessGT(CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, Voltage.IV); + addProcessGT(CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, Voltage.HV); + addProcessGT(CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, Voltage.LV); + addChemicalProcess(CombType.MOLYBDENUM, Materials.Osmium, Materials.Osmium, Voltage.IV); + addAutoclaveProcess(CombType.MOLYBDENUM, Materials.Osmium, Voltage.IV, 5); + addProcessGT(CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, Voltage.IV); + addProcessGT(CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, Voltage.IV); + addProcessGT(CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, Voltage.MV); + addProcessGT(CombType.SALT, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Saltpeter}, Voltage.MV); + addProcessGT(CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, Voltage.MV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack(CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem("dreamcraft", "item.EdibleSalt", 1L, 0), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 50 * 100}, Voltage.MV, 160); + }else { + addCentrifugeToMaterial(CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, new int[] { 75 * 100, 55 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, new int[] { 60 * 100, 80 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, new int[] { 30 * 100, 100 * 100, 100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, new int[] { 100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, new int[] { 50 * 100, 100 * 100, 50 * 100, 100 * 100, 80 * 100, 80 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, new int[] { 50 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, new int[] { 40 * 100, 40 * 100, 40 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, new int[] { 100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, new int[] { 20 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, new int[] { 25 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, new int[] { 85 * 100, 75 * 100}, new int[] {}, Voltage.MV, NI, 30 * 100); + addCentrifugeToItemStack(CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem("dreamcraft", "item.EdibleSalt", 1L, 0),GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.RockSalt, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Saltpeter, 1), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 75 * 100, 65 * 100, 50 * 100}, Voltage.MV, 160); + addCentrifugeToMaterial(CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, new int[] { 80, 75, 65}, new int[] {}, Voltage.MV, NI, 30 * 100); + } + //Radioactive Line - tComb = getStackForType(CombType.ALMANDINE); - addProcessLV(tComb,Materials.Almandine,90); - addProcessLV(tComb,Materials.Pyrope,80); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pyrope.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pyrope, 4), 10000, (int) (Materials.Pyrope.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.Sapphire,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Sapphire.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Sapphire, 4), 10000, (int) (Materials.Sapphire.getMass() * 128), 384, false); - addProcessLV(tComb,Materials.GreenSapphire,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.GreenSapphire.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.GreenSapphire, 4), 10000, (int) (Materials.GreenSapphire.getMass() * 128), 384, false); - tComb = getStackForType(CombType.URANIUM); - addProcessEV(tComb,Materials.Uranium,50); - addProcessEV(tComb,Materials.Pitchblende,65); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Pitchblende.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Pitchblende, 4), 10000, (int) (Materials.Pitchblende.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Uraninite,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Uraninite.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Uraninite, 4), 10000, (int) (Materials.Uraninite.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Uranium235,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(4), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Uranium235.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Uranium235, 4), 10000, (int) (Materials.Uranium235.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.PLUTONIUM); - addProcessEV(tComb,Materials.Plutonium,10); - addProcessEV(tComb,Materials.Uranium235, Materials.Plutonium,5); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Uranium235.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Uranium235, 4), 10000, (int) (Materials.Uranium235.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.NAQUADAH); - addProcessIV(tComb,Materials.Naquadah,10); - addProcessIV(tComb, Materials.NaquadahEnriched,5); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.NaquadahEnriched.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.NaquadahEnriched, 4), 10000, (int) (Materials.NaquadahEnriched.getMass() * 128), 6144, true); - addProcessIV(tComb, Materials.Naquadria,5); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Naquadria.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Naquadria, 4), 10000, (int) (Materials.NaquadahEnriched.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.NAQUADRIA); - addProcessLUV(tComb, Materials.Naquadria,10); - addProcessLUV(tComb, Materials.NaquadahEnriched,10); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.NaquadahEnriched.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.NaquadahEnriched, 4), 10000, (int) (Materials.NaquadahEnriched.getMass() * 128), 24576, true); - addProcessLUV(tComb,Materials.Naquadah,15); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Naquadah.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Naquadah, 4), 10000, (int) (Materials.Naquadah.getMass() * 128), 24576, true); - tComb = getStackForType(CombType.THORIUM); - addProcessEV(tComb,Materials.Thorium,75); - addProcessEV(tComb,Materials.Uranium,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Uranium.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Uranium, 4), 10000, (int) (Materials.Uranium.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Coal,95); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Coal.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Coal, 4), 10000, (int) (Materials.Coal.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.LUTETIUM); - addProcessIV(tComb,Materials.Lutetium,35); - addProcessIV(tComb,Materials.Thorium,55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Thorium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Thorium, 4), 10000, (int) (Materials.Thorium.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.AMERICUM); - addProcessLUV(tComb,Materials.Americium,25); - addProcessLUV(tComb,Materials.Lutetium,45); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lutetium.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lutetium, 4), 10000, (int) (Materials.Lutetium.getMass() * 128), 24576, true); - tComb = getStackForType(CombType.NEUTRONIUM); - addProcessUV(tComb,Materials.Neutronium,15); - addProcessUV(tComb,Materials.Americium,35); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Americium.getMass()+54)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Americium, 4), 10000, (int) (Materials.Americium.getMass() * 128), 100000, true); - + addProcessGT(CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, Voltage.LV); + addProcessGT(CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, Voltage.EV); + addProcessGT(CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, Voltage.EV); + addChemicalProcess(CombType.PLUTONIUM, Materials.Uranium235, Materials.Plutonium, Voltage.EV); + addProcessGT(CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, Voltage.IV); + addProcessGT(CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, Voltage.LUV); + addProcessGT(CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, Voltage.EV); + addProcessGT(CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, Voltage.IV); + addProcessGT(CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, Voltage.LUV); + addProcessGT(CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, Voltage.UV); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, new int[] { 50 * 100, 65 * 100, 75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, new int[] {10, 5}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, new int[] {10 * 100, 5 * 100, 5 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, new int[] {10 * 100, 10 * 100, 15 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, new int[] {75 * 100, 75 * 100 * 100, 95 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, new int[] {35 * 100, 55 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, new int[] {25 * 100, 45 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, new int[] {15 * 100, 35 * 100}, new int[] {}, Voltage.UV, NI, 30 * 100); + } + // Twilight - tComb = getStackForType(CombType.NAGA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), GT_ModHandler.getModItem("dreamcraft", "item.NagaScaleChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.NagaScaleFragment", 1L, 0), GT_Values.NI, GT_Values.NI, new int[]{3000, 500, 3300, 800, 0, 0}, 256, 120); - tComb = getStackForType(CombType.LICH); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), GT_ModHandler.getModItem("dreamcraft", "item.LichBoneChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.LichBoneFragment", 1L, 0), GT_Values.NI, GT_Values.NI, new int[]{3000, 500, 3300, 800, 0, 0}, 384, 480); - tComb = getStackForType(CombType.HYDRA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), GT_ModHandler.getModItem("dreamcraft", "item.FieryBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.HYDRA), GT_Values.NI, GT_Values.NI, new int[]{3000, 500, 3300, 1000, 0, 0}, 384, 480); - tComb = getStackForType(CombType.URGHAST); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), GT_ModHandler.getModItem("dreamcraft", "item..CarminiteChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CarminiteFragment",1L, 0), GT_Values.NI, GT_Values.NI, new int[]{3000, 500, 3300, 800, 0, 0}, 512, 1920); - tComb = getStackForType(CombType.SNOWQUEEN); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), GT_ModHandler.getModItem("dreamcraft", "item.SnowQueenBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.SNOW_QUEEN), GT_Values.NI, GT_Values.NI, new int[]{3000, 500, 3300, 1000, 0, 0}, 512, 1920); + addCentrifugeToItemStack(CombType.NAGA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), GT_ModHandler.getModItem("dreamcraft", "item.NagaScaleChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.NagaScaleFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.MV); + addCentrifugeToItemStack(CombType.LICH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), GT_ModHandler.getModItem("dreamcraft", "item.LichBoneChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.LichBoneFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); + addCentrifugeToItemStack(CombType.HYDRA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), GT_ModHandler.getModItem("dreamcraft", "item.FieryBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.HYDRA), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); + addCentrifugeToItemStack(CombType.URGHAST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), GT_ModHandler.getModItem("dreamcraft", "item.CarminiteChip", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CarminiteFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); + addCentrifugeToItemStack(CombType.SNOWQUEEN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), GT_ModHandler.getModItem("dreamcraft", "item.SnowQueenBloodDrop", 1L, 0), GT_Bees.drop.getStackForType(DropType.SNOW_QUEEN), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); // HEE - tComb = getStackForType(CombType.ENDDUST); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.End), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{2000, 1500, 1000}, 384, 480); - tComb = getStackForType(CombType.STARDUST); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Stardust), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{2000, 1500, 1000}, 384, 480); - tComb = getStackForType(CombType.ECTOPLASMA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Ectoplasma), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{2500, 1000, 1500}, 512, 1920); - tComb = getStackForType(CombType.ARCANESHARD); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Arcaneshard), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{2500, 1000,1500}, 512, 1920); - tComb = getStackForType(CombType.DRAGONESSENCE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Dragonessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{3000, 750, 2000}, 640, 7680); - tComb = getStackForType(CombType.ENDERMAN); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Enderman), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{3000, 750, 2000}, 640, 7680); - tComb = getStackForType(CombType.SILVERFISH); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Silverfish), GT_Bees.drop.getStackForType(DropType.ENDERGOO), new ItemStack(Items.spawn_egg, 1,60), GT_Values.NI, GT_Values.NI, new int[]{2500, 1000, 2000, 1500}, 512, 1920); - tComb = getStackForType(CombType.ENDIUM); - addProcessHV(tComb,Materials.HeeEndium,50); - tComb = getStackForType(CombType.RUNEI); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfPowerFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfAgilityFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfVigorFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfDefenseFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfMagicFragment", 1L, 0), new int[]{2500, 500, 500, 500, 500, 500}, 640, 7680); - tComb = getStackForType(CombType.RUNEII); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfVoidFragment", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 250}, 640, 7680); - tComb = getStackForType(CombType.FIREESSENSE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Fireessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{3000, 750, 2000}, 640, 7680); + addCentrifugeToItemStack(CombType.ENDDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.End), GT_Bees.drop.getStackForType(DropType.ENDERGOO), }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); + addCentrifugeToItemStack(CombType.STARDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Stardust), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); + addCentrifugeToItemStack(CombType.ECTOPLASMA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Ectoplasma), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); + addCentrifugeToItemStack(CombType.ARCANESHARD, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Arcaneshard), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); + addCentrifugeToItemStack(CombType.DRAGONESSENCE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Dragonessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); + addCentrifugeToItemStack(CombType.ENDERMAN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Enderman), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{3000, 750, 2000}, Voltage.IV); + addCentrifugeToItemStack(CombType.SILVERFISH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Silverfish), GT_Bees.drop.getStackForType(DropType.ENDERGOO), new ItemStack(Items.spawn_egg, 1,60) }, new int[]{25 * 100, 10 * 100, 20 * 100, 15 * 100}, Voltage.EV); + addProcessGT(CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, Voltage.HV); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, new int[] {50 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), 20 * 100); + } + addCentrifugeToItemStack(CombType.RUNEI, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfPowerFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfAgilityFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfVigorFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfDefenseFragment", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfMagicFragment", 1L, 0) }, new int[]{25 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100}, Voltage.IV); + addCentrifugeToItemStack(CombType.RUNEII, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.RuneOfVoidFragment", 1L, 0) }, new int[]{50 * 100, (int) (2.5 * 100)}, Voltage.IV); + addCentrifugeToItemStack(CombType.FIREESSENSE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_Bees.propolis.getStackForType(PropolisType.Fireessence), GT_Bees.drop.getStackForType(DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); //Space Line - tComb = getStackForType(CombType.SPACE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), ItemList.FR_RefractoryWax.get(1L), GT_Bees.drop.getStackForType(DropType.OXYGEN), GT_ModHandler.getModItem("dreamcraft", "item.CoinSpace", 1L, 0), GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 1500, 500, 0, 0}, 384, 480); - tComb = getStackForType(CombType.METEORICIRON); - addProcessHV(tComb,Materials.MeteoricIron,85); - addProcessHV(tComb,Materials.Iron,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2),Materials.UUMatter.getFluid(Math.max(1, ((Materials.Iron.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Iron, 4), 10000, (int) (Materials.Iron.getMass() * 128), 1536, false); - tComb = getStackForType(CombType.DESH); - addProcessEV(tComb,Materials.Desh,75); - addProcessEV(tComb,Materials.Titanium,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Titanium.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Titanium, 4), 10000, (int) (Materials.Titanium.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.LEDOX); - addProcessEV(tComb,Materials.Ledox,65); - addProcessEV(tComb,Materials.CallistoIce,55); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.CallistoIce.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.CallistoIce, 4), 10000, (int) (Materials.CallistoIce.getMass() * 128), 3072, true); - addProcessEV(tComb,Materials.Lead,85); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lead.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lead, 4), 10000, (int) (Materials.Lead.getMass() * 128), 3072, true); - tComb = getStackForType(CombType.CALLISTOICE); - addProcessIV(tComb,Materials.CallistoIce,65); - addProcessIV(tComb,Materials.Ledox,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Ledox.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Ledox, 4), 10000, (int) (Materials.Ledox.getMass() * 128), 6144, true); - addProcessIV(tComb,Materials.Lead,100); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(3), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lead.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lead, 4), 10000, (int) (Materials.Lead.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.MYTRYL); - addProcessIV(tComb,Materials.Mytryl,55); - addProcessIV(tComb,Materials.Mithril,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Mithril.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Mithril, 4), 10000, (int) (Materials.Mithril.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.QUANTIUM); - addProcessIV(tComb,Materials.Quantium,50); - addProcessIV(tComb,Materials.Osmium,60); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Osmium.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Osmium, 4), 10000, (int) (Materials.Osmium.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.ORIHARUKON); - addProcessIV(tComb,Materials.Oriharukon,50); - addProcessIV(tComb,Materials.Lead,75); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Lead.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Lead, 4), 10000, (int) (Materials.Lead.getMass() * 128), 6144, true); - tComb = getStackForType(CombType.MYSTERIOUSCRYSTAL); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.MysteriousCrystal, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Emerald, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 1000, 1500, 0, 0, 0}, 512, 30720); - addProcessLUV(tComb,Materials.Emerald,50); - addProcessLUV(tComb,Materials.MysteriousCrystal,40); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.MysteriousCrystal.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.MysteriousCrystal, 4), 10000, (int) (Materials.MysteriousCrystal.getMass() * 128), 24576, true); - tComb = getStackForType(CombType.BLACKPLUTONIUM); - addProcessLUV(tComb,Materials.BlackPlutonium,25); - addProcessLUV(tComb,Materials.Plutonium,50); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Plutonium.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Plutonium, 4), 10000, (int) (Materials.Plutonium.getMass() * 128), 24576, true); - tComb = getStackForType(CombType.TRINIUM); - addProcessZPM(tComb,Materials.Trinium,35); - addProcessZPM(tComb,Materials.Iridium,45); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(2), Materials.UUMatter.getFluid(Math.max(1, ((Materials.Iridium.getMass()+45)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, Materials.Iridium, 4), 10000, (int) (Materials.Iridium.getMass() * 128), 100000, true); - + addCentrifugeToItemStack(CombType.SPACE, new ItemStack[] { ItemList.FR_Wax.get(1L), ItemList.FR_RefractoryWax.get(1L), GT_Bees.drop.getStackForType(DropType.OXYGEN), GT_ModHandler.getModItem("dreamcraft", "item.CoinSpace", 1L, 0)}, new int[]{50 * 100, 30 * 100, 15 * 100, 5 * 100}, Voltage.HV); + addProcessGT(CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, Voltage.HV); + addProcessGT(CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, Voltage.EV); + addProcessGT(CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, Voltage.EV); + addProcessGT(CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, Voltage.IV); + addProcessGT(CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, Voltage.IV); + addProcessGT(CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, Voltage.IV); + addProcessGT(CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, Voltage.IV); + addProcessGT(CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, Voltage.LUV); + addCentrifugeToMaterial(CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 40) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 15 : 50) * 100}, new int[] {}, Voltage.LUV, 512, NI, 50 * 100); + addProcessGT(CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, Voltage.LUV); + addProcessGT(CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, Voltage.ZPM); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, new int[] {85 * 100, 100 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, new int[] {75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, new int[] {65 * 100, 55 * 100, 85 *100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, new int[] {65 * 100, 75 * 100, 100 *100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, new int[] {55 * 100, 50 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, new int[] {50 * 100, 60 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, new int[] {50 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, new int[] {25 * 100, 50 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, new int[] {35 * 100, 45 * 100}, new int[] {}, Voltage.ZPM, NI, 30 * 100); + } //Planet Line - tComb = getStackForType(CombType.MOON); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MoonStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 120); - tComb = getStackForType(CombType.MARS); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MarsStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 480); - tComb = getStackForType(CombType.JUPITER); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.GanymedStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1L, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), new int[]{3000, 3000, 3000, 3000, 3000, 500}, 300, 480); - tComb = getStackForType(CombType.MERCURY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MercuryCoreDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.MercuryStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 1920); - tComb = getStackForType(CombType.VENUS); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.VenusStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 1920); - tComb = getStackForType(CombType.SATURN); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 7680); - tComb = getStackForType(CombType.URANUS); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 7680); - tComb = getStackForType(CombType.NEPTUN); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 7680); - tComb = getStackForType(CombType.PLUTO); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.PlutoStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.PlutoIceDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 30720); - tComb = getStackForType(CombType.HAUMEA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.HaumeaStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 30720); - tComb = getStackForType(CombType.MAKEMAKE); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MakeMakeStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 30720); - tComb = getStackForType(CombType.CENTAURI); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CentauriAStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 122880); - tComb = getStackForType(CombType.TCETI); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 122880); - tComb = getStackForType(CombType.BARNARDA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 3000, 0, 0, 0}, 300, 122880); - tComb = getStackForType(CombType.VEGA); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1L, 0), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 3000, 0, 0, 0, 0}, 300, 122880); - //Infinity Line - tComb = getStackForType(CombType.COSMICNEUTRONIUM); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CosmicNeutronium, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Neutronium, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 50, 100, 0, 0, 0}, 12000, 2000000); - tComb = getStackForType(CombType.INFINITYCATALYST); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.InfinityCatalyst, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Neutronium, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 5, 100, 0, 0, 0}, 48000, 8000000); - tComb = getStackForType(CombType.INFINITY); - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Infinity, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.InfinityCatalyst, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 1, 5, 0, 0, 0}, 96000, 24000000); + addCentrifugeToItemStack(CombType.MOON, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MoonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.MV, 300); + addCentrifugeToItemStack(CombType.MARS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MarsStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.HV, 300); + addCentrifugeToItemStack(CombType.JUPITER, new ItemStack[] { GT_ModHandler.getModItem("dreamcraft", "item.IoStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.EuropaIceDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.EuropaStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.GanymedeStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CallistoStoneDust", 1L, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), ItemList.FR_Wax.get(1L)}, new int[]{30 * 100, 30 * 100, 30 * 100, 30 * 100, 30 * 100, 5 * 100, 50 * 100 }, Voltage.HV, 300); + addCentrifugeToItemStack(CombType.MERCURY, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MercuryCoreDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.MercuryStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.EV, 300); + addCentrifugeToItemStack(CombType.VENUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.VenusStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.EV, 300); + addCentrifugeToItemStack(CombType.SATURN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.EnceladusStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.TitanStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(CombType.URANUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MirandaStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.OberonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(CombType.NEPTUN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.ProteusStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.TritonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(CombType.PLUTO, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.PlutoStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.PlutoIceDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(CombType.HAUMEA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.HaumeaStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(CombType.MAKEMAKE, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.MakeMakeStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(CombType.CENTAURI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.CentauriASurfaceDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.CentauriAStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(CombType.TCETI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.TCetiEStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(CombType.BARNARDA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.BarnardaEStoneDust", 1L, 0), GT_ModHandler.getModItem("dreamcraft", "item.BarnardaFStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(CombType.VEGA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem("dreamcraft", "item.VegaBStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); - } - public void addSpecialCentLV(ItemStack tComb, ItemStack aOutput, int chance){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 5000 }, 128, 5); - RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + //Infinity Line + addCentrifugeToMaterial(CombType.COSMICNEUTRONIUM, new Materials[] {Materials.CosmicNeutronium, Materials.Neutronium}, new int[] {(int) (0.5 * 100), 1 * 100}, new int[] {}, Voltage.UHV, 12000, NI, 50 * 100); + addCentrifugeToMaterial(CombType.INFINITYCATALYST, new Materials[] {Materials.InfinityCatalyst, Materials.Neutronium}, new int[] {(int) (0.05 * 100), 1 * 100}, new int[] {}, Voltage.UEV, 48000, NI, 50 * 100); + addCentrifugeToMaterial(CombType.INFINITY, new Materials[] {Materials.Infinity, Materials.InfinityCatalyst}, new int[] {(int) (0.01 * 100), (int) (0.05 * 100)}, new int[] {}, Voltage.UIV, 96000, NI, 50 * 100); } - public void addSpecialCentLV(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), aOutput2, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 5000, chance2 * 100 }, 128, 5); - RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f)); + /** + * Currently use for STEEL, GOLD, MOLYBDENUM, PLUTONIUM + * **/ + public void addChemicalProcess(CombType comb, Materials aInMaterial, Materials aOutMaterial, Voltage volt){ + if(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4) == NI) return; + RA.addChemicalRecipe(GT_Utility.copyAmount(9, getStackForType(comb)), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), volt.getComplexChemical(), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), NI, volt.getComplexTime(), volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0); } - public void addSpecialCentLV(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2, ItemStack aOutput3, int chance3){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, ItemList.FR_Wax.get(1, new Object[0]), aOutput2, aOutput3, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 5000, chance2 * 100, chance3*100 }, 128, 5); - RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(aOutput, chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f,aOutput2,chance2 * 0.01f,aOutput3,chance3*0.01f)); + /** + * Currently only used for CombType.MOLYBDENUM + * @param circuitNumber should not conflict with addProcessGT + * + * **/ + public void addAutoclaveProcess(CombType comb, Materials aMaterial, Voltage volt, int circuitNumber){ + if(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4) == NI) return; + RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, getStackForType(comb)), GT_Utility.getIntegratedCircuit(circuitNumber), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); } - public void addSpecialCentMV(ItemStack tComb, ItemStack aOutput, int chance){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput,GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 7000 }, 160, 120); - } - - public void addSpecialCentMV(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, aOutput2, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, chance2 * 100}, 160, 120); - } - - public void addSpecialCentHV(ItemStack tComb, ItemStack aOutput, int chance){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput,GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 7000 }, 196, 480); - } - - public void addSpecialCentHV(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, aOutput2, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, chance2 * 100}, 196, 480); - } - - public void addSpecialCentHV(ItemStack tComb, ItemStack aOutput, int chance, ItemStack aOutput2, int chance2, ItemStack aOutput3, int chance3){ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, aOutput, aOutput2, aOutput3, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, chance2 * 100, chance3 * 100 }, 196, 480); - } - - public void addProcessLV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Water.getFluid(1000), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,96, 24); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 384, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 128, 5); - RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + + /** + * this only adds Chemical and AutoClave process. + * If you need Centrifuge recipe. use addCentrifugeToMaterial or addCentrifugeToItemStack + * @param volt This determine the required Tier of process for this recipes. This decide the required aEU/t, progress time, required additional UU-Matter, requirement of cleanRoom, needed fluid stack for Chemical. + * @param aMaterial result of Material that should be generated by this process. + * **/ + public void addProcessGT(CombType comb, Materials[] aMaterial, Voltage volt) { + ItemStack tComb = getStackForType(comb); + for(int i=0; i < aMaterial.length; i++) { + if(GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4)!= NI) { + RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial[i], 1), volt.getComplexChemical(), aMaterial[i].mOreByProducts.isEmpty() ? null : aMaterial[i].mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), NI, volt.getComplexTime(), volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0); + RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i+1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass()+volt.getUUAmplifier())/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0); + } } } - public void addProcessMV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), GT_ModHandler.getDistilledWater(1000L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,128, 96); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 768, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 160, 120); + + /** + * this method only adds Centrifuge based on Material. If volt is lower than MV than it will also adds forestry centrifuge recipe. + * @param comb BeeComb + * @param aMaterial resulting Material of processing. can be more than 6. but over 6 will be ignored in Gregtech Centrifuge. + * @param chance chance to get result, 10000 == 100% + * @param volt required Voltage Tier for this recipe, this also affect the duration, amount of UU-Matter, and needed liquid type and amount for chemical reactor + * @param stackSize This parameter can be null, in that case stack size will be just 1. This handle the stackSize of the resulting Item, and Also the Type of Item. if this value is multiple of 9, than related Material output will be dust, if this value is multiple of 4 than output will be Small dust, else the output will be Tiny dust + * @param beeWax if this is null, than the comb will product default Bee wax. But if aMaterial is more than 5, beeWax will be ignored in Gregtech Centrifuge. + * @param waxChance have same format like "chance" + **/ + public void addCentrifugeToMaterial(CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, ItemStack beeWax, int waxChance) { + addCentrifugeToMaterial(comb, aMaterial, chance, stackSize, volt, volt.getSimpleTime(), beeWax, waxChance); + } + public void addCentrifugeToMaterial(CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, int duration, ItemStack beeWax, int waxChance) { + ItemStack[] aOutPut = new ItemStack[aMaterial.length+1]; + stackSize = Arrays.copyOf(stackSize, aMaterial.length); + chance = Arrays.copyOf(chance, aOutPut.length); + chance[chance.length - 1] = waxChance; + for(int i = 0; i < (aMaterial.length); i++) { + if(chance[i] == 0) { + continue; + } + if(Math.max(1, stackSize[i]) % 9 == 0) { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i])/9) ); + }else if(Math.max(1, stackSize[i]) % 4 == 0) { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial[i], (Math.max(1, stackSize[i])/4) ); + }else { + aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial[i], Math.max(1, stackSize[i])); } - } - public void addProcessHV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Mercury.getFluid(144L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,160, 384); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1),Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 1536, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 192, 480); } - } - public void addProcessEV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Mercury.getFluid(288L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,192, 1536); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 3072, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 224, 1920); + if(beeWax != NI) { + aOutPut[aOutPut.length - 1] = beeWax; + }else { + aOutPut[aOutPut.length - 1] = ItemList.FR_Wax.get(1); } + + addCentrifugeToItemStack(comb, aOutPut, chance, volt, duration); } - public void addProcessIV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Mercury.getFluid(576L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,224, 6144); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 6144, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 256, 7680); + + /** + * @param volt required Tier of system. If it's lower than MV, it will also add forestry centrifuge. + * @param aItem can be more than 6. but Over 6 will be ignored in Gregtech Centrifuge. + **/ + public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt) { + addCentrifugeToItemStack(comb, aItem, chance, volt, volt.getSimpleTime()); + } + public void addCentrifugeToItemStack(CombType comb, ItemStack[] aItem, int[] chance, Voltage volt, int duration) { + ItemStack tComb = getStackForType(comb); + Builder<ItemStack,Float> Product = new ImmutableMap.Builder<ItemStack, Float>(); + for(int i=0; i < aItem.length; i++) { + if(aItem[i] == NI) { continue; } + Product.put(aItem[i],chance[i]/10000.0f); } - } - public void addProcessLUV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 144), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,256, 24576, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 24576, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 288, 30720); + + if(volt.compareTo(Voltage.MV) < 0 || !GT_Mod.gregtechproxy.mNerfedCombs) { + RecipeManagers.centrifugeManager.addRecipe(40, tComb, Product.build()); } - } - public void addProcessZPM(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 288), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI, 288, 100000, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+45)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 100000, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 320, 122880); + + aItem = Arrays.copyOf(aItem, 6); + if(aItem.length > 6) { + chance = Arrays.copyOf(chance, 6); } + + RA.addCentrifugeRecipe(tComb, NI, NF, NF, aItem[0], aItem[1], aItem[2], aItem[3], aItem[4], aItem[5], chance, duration, volt.getSimpleEnergy()); } - public void addProcessUV(ItemStack tComb, Materials aMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 576), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,320, 400000, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+54)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 100000, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 352, 500000); + + enum Voltage { + ULV, LV, MV, + HV, EV, IV, + LUV, ZPM, UV, + UHV, UEV, UIV, + UMV, UXV, OpV, + MAX; + public int getVoltage() { + return (int) V[this.ordinal()]; } - } - - public void addProcessLV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance) { - if (GT_Mod.gregtechproxy.mNerfedCombs) { - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), Materials.Water.getFluid(1000L), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI, 96, 24); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass() +9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 384, false); - } else { - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{chance * 100, 3000}, 128, 5); - RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of(GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), chance * 0.01f, ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + /**@return aEU/t needed for chemical and autoclave process related to the Tier**/ + public int getChemicalEnergy() { + return this.getVoltage()*3/4; } - } - public void addProcessMV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), GT_ModHandler.getDistilledWater(1000L), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI,128, 96); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 768, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 160, 120); - } - - } - public void addProcessHV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), Materials.Mercury.getFluid(144L), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI,160, 384); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 1536, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 192, 480); + public int getAutoClaveEnergy() { + return (int) ((this.getVoltage()*3/4) * (Math.max(1, Math.pow(2, 5 - this.ordinal())))); } - - } - public void addProcessEV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 3072, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 224, 1920, true); + /**@return FluidStack needed for chemical process related to the Tier**/ + public FluidStack getComplexChemical() { + if(this.compareTo(Voltage.MV) < 0) { + return Materials.Water.getFluid((this.compareTo(Voltage.ULV) > 0) ? 1000 : 500); + }else if(this.compareTo(Voltage.HV) < 0) { + return GT_ModHandler.getDistilledWater(1000L); + }else if(this.compareTo(Voltage.LUV) < 0) { + return Materials.Mercury.getFluid((long) (Math.pow(2, this.compareTo(Voltage.HV)) * L)); + }else if(this.compareTo(Voltage.UHV) < 0) { + return FluidRegistry.getFluidStack("mutagen", (int) (Math.pow(2, this.compareTo(Voltage.LUV)) * L)); + }else { + return NF; + } } - - } - public void addProcessIV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 6144, false); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 256, 7680, true); + /**@return additional required UU-Matter amount for Autoclave process related to the Tier**/ + public int getUUAmplifier() { + return 9 * ( (this.compareTo(Voltage.MV) < 0) ? 1 : this.compareTo(Voltage.MV)); } - - } - public void addProcessLUV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), FluidRegistry.getFluidStack("mutagen", 144), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI, 256, 12288, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 24576, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 288, 30720, true); + /**@return duration needed for Chemical process related to the Tier**/ + public int getComplexTime() { + return 64 + this.ordinal() * 32; } - - } - public void addProcessZPM(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), FluidRegistry.getFluidStack("mutagen", 288), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI, 288, 500000, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+45)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 100000, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 320, 122880, true); + /**@return duration needed for Centrifuge process related to the Tier**/ + public int getSimpleTime() { + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + return 96 + this.ordinal() * 32; + } else { + //ULV, LV needs 128ticks, MV need 256 ticks, HV need 384 ticks, EV need 512 ticks, IV need 640 ticks + return 128 * (Math.max(1, this.ordinal())); + } } - - } - public void addProcessUV(ItemStack tComb, Materials aInMaterial, Materials aOutMaterial, int chance){ - if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), FluidRegistry.getFluidStack("mutagen", 576), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), GT_Values.NI, 320, 2000000, true); - GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(1), Materials.UUMatter.getFluid(Math.max(1, ((aOutMaterial.getMass()+54)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), 10000, (int) (aOutMaterial.getMass() * 128), 100000, true); - }else{ - GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aOutMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 352, 500000, true); + /**@return aEU/t needed for Centrifuge process related to the Tier**/ + public int getSimpleEnergy() { + if(this == Voltage.ULV) { + return 5; + }else { + return (int) (this.getVoltage() / 16) * 15; + } } - } } diff --git a/src/main/java/gregtech/common/items/ItemDrop.java b/src/main/java/gregtech/common/items/ItemDrop.java index 8452242049..61a81c678a 100644 --- a/src/main/java/gregtech/common/items/ItemDrop.java +++ b/src/main/java/gregtech/common/items/ItemDrop.java @@ -62,7 +62,8 @@ public class ItemDrop extends Item { return 2; } - @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0"); this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1"); @@ -129,4 +130,4 @@ public class ItemDrop extends Item { public void addProcessHV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance) { GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 480, 480); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/ItemPollen.java b/src/main/java/gregtech/common/items/ItemPollen.java index c3da0e7c1d..eaef49e02a 100644 --- a/src/main/java/gregtech/common/items/ItemPollen.java +++ b/src/main/java/gregtech/common/items/ItemPollen.java @@ -55,7 +55,8 @@ public class ItemPollen extends Item { return 2; } - @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:pollen.0"); this.secondIcon = par1IconRegister.registerIcon("forestry:pollen.1"); diff --git a/src/main/java/gregtech/common/items/ItemPropolis.java b/src/main/java/gregtech/common/items/ItemPropolis.java index 20d18d4470..289536c2aa 100644 --- a/src/main/java/gregtech/common/items/ItemPropolis.java +++ b/src/main/java/gregtech/common/items/ItemPropolis.java @@ -51,7 +51,8 @@ public class ItemPropolis extends Item { } - @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:propolis.0"); } diff --git a/src/main/java/gregtech/common/items/PollenType.java b/src/main/java/gregtech/common/items/PollenType.java index 5bfb38e599..a4d670a0d0 100644 --- a/src/main/java/gregtech/common/items/PollenType.java +++ b/src/main/java/gregtech/common/items/PollenType.java @@ -24,11 +24,10 @@ public enum PollenType { } public String getName() { -// return "gt.comb."+this.name; return GT_LanguageManager.addStringLocalization("pollen." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Pollen"); } public int[] getColours() { return colours[this.ordinal()]; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/PropolisType.java b/src/main/java/gregtech/common/items/PropolisType.java index 3ea14555a0..04550e899b 100644 --- a/src/main/java/gregtech/common/items/PropolisType.java +++ b/src/main/java/gregtech/common/items/PropolisType.java @@ -48,4 +48,4 @@ public enum PropolisType { public int getColours() { return colours[this.ordinal()]; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/items/armor/ArmorCalculation.java b/src/main/java/gregtech/common/items/armor/ArmorCalculation.java deleted file mode 100644 index 8ecc5766ba..0000000000 --- a/src/main/java/gregtech/common/items/armor/ArmorCalculation.java +++ /dev/null @@ -1,52 +0,0 @@ -package gregtech.common.items.armor; - -import gregtech.api.util.GT_ModHandler; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - -public class ArmorCalculation { - public static float[] calculateArmor(ItemStack[] parts) { - return new float[32]; - } - - public static int deChargeBatterys(ItemStack[] parts, int amount) { - int decharged = 0; - for (int i = 0; decharged < amount && i < parts.length; i++) { - if (GT_ModHandler.isChargerItem(parts[i])) { - decharged = (int) (decharged + ic2.api.item.ElectricItem.manager.discharge(parts[i], amount - decharged, 10, false, false, false)); - } - } - return decharged; - } - - public static FluidStack getFluid(ItemStack[] parts, int tankCap) { - int fluidAmount; - if (parts.length > 12 && parts[12] != null) { - NBTTagCompound nbt = parts[12].getTagCompound(); - if (nbt != null) { - fluidAmount = (int) nbt.getLong("mFluidDisplayAmount"); - if (fluidAmount > tankCap) { - nbt.setLong("mFluidDisplayAmount", tankCap); - parts[12].setTagCompound(nbt); - fluidAmount = tankCap; - } - return new FluidStack(parts[12].getItemDamage(), fluidAmount); - } - - } - return null; - } - - public static void useFluid(ItemStack[] parts, int usedAmount) { - int fluidAmount; - if (parts.length > 12 && parts[12] != null) { - NBTTagCompound nbt = parts[12].getTagCompound(); - if (nbt != null) { - fluidAmount = (int) nbt.getLong("mFluidDisplayAmount"); - nbt.setLong("mFluidDisplayAmount", fluidAmount - usedAmount); - parts[12].setTagCompound(nbt); - } - } - } -} diff --git a/src/main/java/gregtech/common/items/armor/ArmorData.java b/src/main/java/gregtech/common/items/armor/ArmorData.java deleted file mode 100644 index c8061db988..0000000000 --- a/src/main/java/gregtech/common/items/armor/ArmorData.java +++ /dev/null @@ -1,418 +0,0 @@ -package gregtech.common.items.armor; - -import gregtech.api.util.GT_LanguageManager; -import gregtech.common.items.armor.components.ArmorComponent; -import gregtech.common.items.armor.components.StatType; -import gregtech.common.items.armor.gui.ContainerBasicArmor; -import gregtech.common.items.armor.gui.ContainerModularArmor; -import gregtech.common.items.armor.gui.InventoryArmor; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.text.NumberFormat; -import java.util.*; - -import static gregtech.GT_Mod.GT_FML_LOGGER; - -public class ArmorData { - - public int type; // 0 = helmet; 1 = chestplate; 2 = leggings; 3 = boots; - public int armorTier; // 0 = Basic Modular Armor; 1 = Modular Exoskeleton; 2= Modular Nanosuit; 3 = Heavy Power Armor - public List info; // needs Localization - public boolean isTopItem; - public int tooltipUpdate; - public boolean openGui; - - public ArmorData helmet; - public ArmorData chestplate; - public ArmorData leggings; - public ArmorData boots; - - public Map<StatType,Float> mStat = new HashMap<StatType,Float>(); - public Map<StatType,Boolean> mBStat = new HashMap<StatType,Boolean>(); - static ArrayList<StatType> updateArmorStatTypeList; -// public boolean fullArmor; -// public boolean fullRadiationDef; -// public boolean fullElectricDef; -// -// public float fallDef; -// public float physicalDef; -// public float projectileDef; -// public float fireDef; -// public float magicDef; -// public float explosionDef; -// public float radiationDef; -// public float electricDef; -// public float witherDef; -// -// public float thorns; -// public float thornsSingle; -// public int magnet; -// public int magnetSingle; -// -// public int partsCharge; - public int maxCharge; - public int charge; -// public boolean thaumicGoggles; -// public boolean nightVision; -// public boolean potionInjector; -// public boolean autoFeeder; - - public FluidStack fluid; -// public int tankCap; -// -// public int weight; - public float maxWeight; -// public int processingPower; -// public int processingPowerUsed; -// public int partProcessing; -// public int partProcessingUsed; -// -// public int motorPower; -// public int motorEUusage; -// public int pistonJumpboost; -// public int pistonEUusage; -// public int electrolyzerProd; -// public int electrolyzerEUusage; -// public int fieldGenCap; -// public int fieldGenEUusage; -// -// public int jetpackMaxWeight; -// public int antiGravMaxWeight; - - public ArmorData(EntityPlayer player, ItemStack stack, int type, int tier) { - if(updateArmorStatTypeList == null) - { - updateArmorStatTypeList = new ArrayList<StatType>(); - updateArmorStatTypeList.add(StatType.MAGNET); - updateArmorStatTypeList.add(StatType.THORNS); - updateArmorStatTypeList.add(StatType.PROCESSINGPOWER); - updateArmorStatTypeList.add(StatType.PROCESSINGPOWERUSED); - } - this.type = type; - this.armorTier = tier; - ContainerModularArmor tmp = new ContainerBasicArmor((EntityPlayer) player, new InventoryArmor(ModularArmor_Item.class, stack)); - calculateArmor(tmp.mInvArmor.parts); - switch (tier) { - case 0: - maxCharge = 0; - break; - case 1: - maxCharge = 250000; - break; - case 2: - maxCharge = 1000000; - } - readNBT(stack.getTagCompound()); - } - - private void readNBT(NBTTagCompound nbt) { - if (nbt == null) { - return; - } - if (nbt.hasKey("Charge")) { - this.charge = nbt.getInteger("Charge"); - } - } - - public void writeToNBT(NBTTagCompound nbt) { - if (nbt == null) { - return; - } - nbt.setInteger("Charge", this.charge); - } - - public ArmorData calculateArmor(ItemStack[] parts) { - mStat.clear(); - mBStat.clear(); - for(ItemStack tPart : parts){ - if(tPart!=null && ArmorComponent.mStacks.containsKey(tPart.getUnlocalizedName())) - ArmorComponent.mStacks.get(tPart.getUnlocalizedName()).calculateArmor(this); - } - for(StatType tType : StatType.values())if(!mStat.containsKey(tType))mStat.put(tType, .0f); - for(StatType tType : StatType.values())if(!mBStat.containsKey(tType))mBStat.put(tType, false); - updateTooltip(); - return this; - } - - public void updateTooltip() { - List<String> tagList = new ArrayList<String>(); - String tmp2 = ""; - if (maxWeight > 4000) { - tmp2 = " " + GT_LanguageManager.getTranslation("Too Heavy"); - } - if (maxCharge != 0) { - DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US); - DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); - symbols.setGroupingSeparator(' '); - if (type == 0) { - if (mBStat.get(StatType.THAUMICGOGGLES)) { - tagList.add(GT_LanguageManager.getTranslation("Thaumic Goggles installed")); - } - if (mBStat.get(StatType.NIGHTVISION)) { - tagList.add(GT_LanguageManager.getTranslation("Nightvision installed")); - } - } - tagList.add("EU: " + formatter.format(charge + mStat.get(StatType.PARTSCHARGE))); - if (type == 2) { - tagList.add(GT_LanguageManager.getTranslation("Jumpboost") + ": " + mStat.get(StatType.PISTONJUMPBOOST) / 3 + "m"); - } - if (type == 2 && mStat.get(StatType.PISTONJUMPBOOST) > 0) { - tagList.add(GT_LanguageManager.getTranslation("Uphill step assist active")); - } - if (type == 2 && mStat.get(StatType.MOTPRPOWER) > 0) { - tagList.add(GT_LanguageManager.getTranslation("Speedup") + ": " + mStat.get(StatType.MOTPRPOWER)); - tagList.add(GT_LanguageManager.getTranslation("Motor energy usage") + ": " + mStat.get(StatType.MOTOREUUSAGE) + " EU"); - if (maxWeight > 4000) { - tagList.add(GT_LanguageManager.getTranslation("Too Heavy!!!")); - } - } - tagList.add(GT_LanguageManager.getTranslation("Processing power ") + " " + mStat.get(StatType.PARTPROCESSING) + " " + GT_LanguageManager.getTranslation("")); - tagList.add(GT_LanguageManager.getTranslation("Processing power used") + ": " + mStat.get(StatType.PARTPROCESSINGUSED) + " " + GT_LanguageManager.getTranslation("")); - if (type == 0 && mStat.get(StatType.ELECTROLYZERPROD) > 0) { - tagList.add(GT_LanguageManager.getTranslation("Electrolyzer produces ") + " " + mStat.get(StatType.ELECTROLYZERPROD) / 2 + GT_LanguageManager.getTranslation("per second")); - } - if (mStat.get(StatType.TANKCAP) > 0) { - if (fluid != null) { - tagList.add(GT_LanguageManager.getTranslation("Tank Capacity") + ": " + fluid.getLocalizedName() + " " + fluid.amount + "L (" + mStat.get(StatType.TANKCAP) + ")"); - } else { - tagList.add(GT_LanguageManager.getTranslation("tankcap") + ": " + mStat.get(StatType.TANKCAP)); - } - } - } - tagList.add(GT_LanguageManager.getTranslation("Weight") + ": " + mStat.get(StatType.WEIGHT) + tmp2); - tagList.add(GT_LanguageManager.getTranslation("Physical Defence") + ": " + (Math.round(mStat.get(StatType.PHYSICALDEFENCE) * 1000) / 10.0) + "%"); - tagList.add(GT_LanguageManager.getTranslation("Projectile Defence") + ": " + (Math.round(mStat.get(StatType.PROJECTILEDEFENCE) * 1000) / 10.0) + "%"); - tagList.add(GT_LanguageManager.getTranslation("Fire Defence") + ": " + (Math.round(mStat.get(StatType.FIREDEFENCE) * 1000) / 10.0) + "%"); - tagList.add(GT_LanguageManager.getTranslation("Magic Defence") + ": " + (Math.round(mStat.get(StatType.MAGICDEFENCE) * 1000) / 10.0) + "%"); - tagList.add(GT_LanguageManager.getTranslation("Explosive Defence") + ": " + (Math.round(mStat.get(StatType.EXPLOSIONDEFENCE) * 1000) / 10.0) + "%"); - if (mStat.get(StatType.FALLDEFENCE) > 0 && type == 3) { - tagList.add(GT_LanguageManager.getTranslation("Absorbs") + " " + mStat.get(StatType.FALLDEFENCE) + GT_LanguageManager.getTranslation(" m of Fall Defence")); - } - if (mStat.get(StatType.THORNS) > 0) { - tagList.add(GT_LanguageManager.getTranslation("Thorns") + ": " + mStat.get(StatType.THORNS)); - } - if (mStat.get(StatType.MAGNET) > 0) { - tagList.add(GT_LanguageManager.getTranslation("Magnet") + ": " + mStat.get(StatType.MAGNET) + "m"); - } - if (mBStat.get(StatType.FULLRADIATIONARMOR)) { - tagList.add(GT_LanguageManager.getTranslation("Is Full Radiation Defence")); - } else { - if (mStat.get(StatType.RADIATIONDEFENCE) > 0.01d) { - tagList.add(GT_LanguageManager.getTranslation("Radiation Defence") + ": " + (Math.round(mStat.get(StatType.RADIATIONDEFENCE) * 1000) / 10.0) + "%"); - } - } - info = tagList; - } - - public void armorPartsEquipped(EntityPlayer aPlayer) { - helmet = null; - chestplate = null; - leggings = null; - boots = null; - for (int i = 1; i < 5; i++) { - ItemStack stack = aPlayer.getEquipmentInSlot(i); - if (stack != null && stack.getItem() instanceof ModularArmor_Item) { - ModularArmor_Item tmp = (ModularArmor_Item) stack.getItem(); - ContainerModularArmor tmp2 = new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, stack)); - if ((this.type + i) == 4) { - fluid = ArmorCalculation.getFluid(tmp2.mInvArmor.parts, Math.round(mStat.get(StatType.TANKCAP))); - } - if (maxCharge > 0 && charge < maxCharge) { - int loaded = ArmorCalculation.deChargeBatterys(tmp2.mInvArmor.parts, maxCharge - charge); - charge = charge + loaded; - change(mStat, StatType.PARTSCHARGE, -loaded); - - } - switch (tmp.armorType) { - case 0: - helmet = tmp.data; - break; - case 1: - chestplate = tmp.data; - break; - case 2: - leggings = tmp.data; - break; - case 3: - boots = tmp.data; - break; - default: - break; - } - writeToNBT(stack.getTagCompound()); - } - } - if (helmet != null && chestplate != null && leggings != null && boots != null) { - set(mBStat, StatType.FULLARMOR, true); - boolean helmHasFullRadiationDefence=false; - boolean chestplateHasFullRadiationDefence=false; - boolean leggingsHasFullRadiationDefence=false; - boolean bootsHasFullRadiationDefence=false; - - boolean helmHasFullElectricalDefenceDefence=false; - boolean chestplateHasFullElectricalDefenceDefence=false; - boolean leggingsHasFullElectricalDefenceDefence=false; - boolean bootsHasFullElectricalDefenceDefence=false; - //Check each armor pieces for valid mStat value and verify that the Hash contains the StatType key - if(helmet.mStat!= null) - { - if(helmet.mStat.containsKey(StatType.RADIATIONDEFENCE)) - { - helmHasFullRadiationDefence = helmet.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - if(helmet.mStat.containsKey(StatType.ELECTRICALDEFENCE)) - { - helmHasFullElectricalDefenceDefence = helmet.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - } - if(chestplate.mStat!= null) - { - if(chestplate.mStat.containsKey(StatType.RADIATIONDEFENCE)) - { - chestplateHasFullRadiationDefence = chestplate.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - if(chestplate.mStat.containsKey(StatType.ELECTRICALDEFENCE)) - { - chestplateHasFullElectricalDefenceDefence = chestplate.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - } - if(leggings.mStat!= null) - { - if(leggings.mStat.containsKey(StatType.RADIATIONDEFENCE)) - { - leggingsHasFullRadiationDefence = leggings.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - if(leggings.mStat.containsKey(StatType.ELECTRICALDEFENCE)) - { - leggingsHasFullElectricalDefenceDefence = leggings.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - } - if(boots.mStat!= null) - { - if(boots.mStat.containsKey(StatType.RADIATIONDEFENCE)) - { - bootsHasFullRadiationDefence = boots.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - if(boots.mStat.containsKey(StatType.ELECTRICALDEFENCE)) - { - bootsHasFullElectricalDefenceDefence = boots.mStat.get(StatType.RADIATIONDEFENCE)> 0.9f; - } - } - //Set Status of Full Armor types - set(mBStat, StatType.FULLRADIATIONARMOR, helmHasFullRadiationDefence&&chestplateHasFullRadiationDefence&&leggingsHasFullRadiationDefence &&bootsHasFullRadiationDefence); - set(mBStat, StatType.FULLELECTRICARMOR, helmHasFullElectricalDefenceDefence&&chestplateHasFullElectricalDefenceDefence&&leggingsHasFullElectricalDefenceDefence &&bootsHasFullElectricalDefenceDefence); - } else { - //Reset Full armor type status to false for all types if StatType.FULLARMOR is false - set(mBStat, StatType.FULLARMOR, false); - set(mBStat, StatType.FULLRADIATIONARMOR, false); - set(mBStat, StatType.FULLELECTRICARMOR, false); - } - - - set(mBStat, StatType.MAGNET, 0); - set(mBStat, StatType.THORNS, 0); - set(mBStat, StatType.PROCESSINGPOWER, 0); - set(mBStat, StatType.PROCESSINGPOWERUSED, 0); - - if (helmet != null) { - updateArmorStats(helmet,updateArmorStatTypeList ); - } - if (chestplate != null) { - updateArmorStats(chestplate,updateArmorStatTypeList ); - - } - if (leggings != null) { - updateArmorStats(leggings,updateArmorStatTypeList ); - - } - if (boots != null) { - updateArmorStats(boots,updateArmorStatTypeList ); - - } - isTopItem = false; - if (type == 0) { - isTopItem = true; - } else if (helmet == null && type == 1) { - isTopItem = true; - } else if (helmet == null && chestplate == null && type == 2) { - isTopItem = true; - } else if (helmet == null && chestplate == null && leggings == null && type == 3) { - isTopItem = true; - } - if (helmet != null) { - maxWeight = helmet.mStat.get(StatType.WEIGHT); - } - if (chestplate != null) { - maxWeight += chestplate.mStat.get(StatType.WEIGHT); - } - if (leggings != null) { - maxWeight += leggings.mStat.get(StatType.WEIGHT); - } - if (boots != null) { - maxWeight += boots.mStat.get(StatType.WEIGHT); - } - } - - private void updateArmorStats(ArmorData armorData, ArrayList<StatType> statTypes) { - for (StatType statType : statTypes) { - if(armorData == null || armorData.mStat == null || !armorData.mStat.containsKey(statType)) - continue; -// if(armorData != null && armorData.mStat != null && armorData.mStat.containsKey(statType)) -// { - set(mStat, statType, armorData.mStat.get(statType)); -// } - /*change(mStat, StatType.MAGNET, armorData.mStat.get(StatType.MAGNET)); - change(mStat, StatType.THORNS, armorData.mStat.get(StatType.THORNS)); - change(mStat, StatType.PROCESSINGPOWER, armorData.mStat.get(StatType.PROCESSINGPOWER)); - change(mStat, StatType.PROCESSINGPOWERUSED, armorData.mStat.get(StatType.PROCESSINGPOWERUSED));*/ - } - - - } - - public void set(Map aMap, StatType aType, boolean aSet){ - if(aMap.containsKey(aType))aMap.remove(aType); - aMap.put(aType, aSet); - } - - public void set(Map aMap, StatType aType, float aSet){ - if(aMap.containsKey(aType))aMap.remove(aType); - aMap.put(aType, aSet); - } - - public void change(Map aMap, StatType aType, float aChange){ - float tChange = 0; - if(aMap==null) - GT_FML_LOGGER.info("changeMapnull"); - if(aMap.containsKey(aType)){ - Object value = aMap.get(aType); - tChange = value != null ? (float) aMap.get(aType) : 0.0f; - aMap.remove(aType); - } - aMap.put(aType, (tChange + aChange)); - } - - public void dechargeComponents(int aCharge){ - - } - - public double getBaseAbsorptionRatio() { - switch (this.type) { - case 0: - return 0.15; - case 1: - return 0.40; - case 2: - return 0.30; - case 3: - return 0.15; - default: - return 0.00; - } - } -} diff --git a/src/main/java/gregtech/common/items/armor/ElectricModularArmor1.java b/src/main/java/gregtech/common/items/armor/ElectricModularArmor1.java deleted file mode 100644 index d310fa4c96..0000000000 --- a/src/main/java/gregtech/common/items/armor/ElectricModularArmor1.java +++ /dev/null @@ -1,37 +0,0 @@ -package gregtech.common.items.armor; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ElectricModularArmor1 extends ModularArmor_Item{ - - public boolean mChargeProvider=false; - - public ElectricModularArmor1(int aArmorIndex, int aType, String name,int gui) { - super(aArmorIndex, aType, name,gui); - } - - public boolean canProvideEnergy(ItemStack aStack) { - return mChargeProvider; - } - - public Item getChargedItem(ItemStack aStack) { - return this; - } - - public Item getEmptyItem(ItemStack aStack) { - return this; - } - - public int getMaxCharge(ItemStack aStack) { - return data.charge; - } - - public int getTier(ItemStack aStack) { - return 2; - } - - public int getTransferLimit(ItemStack aStack) { - return openGuiNr==1?128:512; - } -} diff --git a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java deleted file mode 100644 index be0596fc92..0000000000 --- a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java +++ /dev/null @@ -1,460 +0,0 @@ -package gregtech.common.items.armor; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.damagesources.GT_DamageSources; -import gregtech.api.enums.GT_Values; -import gregtech.common.items.armor.components.StatType; -import gregtech.common.items.armor.gui.ContainerBasicArmor; -import gregtech.common.items.armor.gui.ContainerModularArmor; -import gregtech.common.items.armor.gui.InventoryArmor; -import ic2.core.IC2; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.ISpecialArmor; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingFallEvent; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; - -import java.util.LinkedList; -import java.util.List; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -@Optional.InterfaceList(value = { @Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft", striprefs = true), - @Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft", striprefs = true) }) -public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGoggles, IRevealer { - - public String mName; - public int timer = 160; - public Item repairMaterial; - public int openGuiNr; - public ArmorData data; - public int jumpticks; - public int fail = 0; - - // public int maxEU; - - public ModularArmor_Item(int aArmorIndex, int aType, String name, int gui) { - super(ArmorMaterial.DIAMOND, aArmorIndex, aType); - MinecraftForge.EVENT_BUS.register(this); - setUnlocalizedName("gregtech:" + name); - GameRegistry.registerItem(this, name); - mName = name; - int mMaxDamage = (gui + 1) * 1024; - mMaxDamage *= getBaseAbsorptionRatio() * 2.5; - setMaxDamage(mMaxDamage); - repairMaterial = Items.leather; - openGuiNr = gui; - } - - @Override - public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - if (data == null) { - data = fillArmorData(aPlayer, aStack); - } - if (!aWorld.isRemote) { - aPlayer.openGui(GT_Values.GT, openGuiNr+1000, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ); - } - return aStack; - } - - @Override - public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - if (data == null) { - data = fillArmorData((EntityPlayer) player, armor); - } - if (player != null && armor != null && source != null) { - try{ - double tmp = 0.0d; - if (source.isMagicDamage()) { - tmp = data.mStat.get(StatType.MAGICDEFENCE); - } else if (source == GT_DamageSources.getRadioactiveDamage()) { - tmp = data.mStat.get(StatType.RADIATIONDEFENCE); - } else if (source == GT_DamageSources.getElectricDamage()) { - tmp = data.mStat.get(StatType.ELECTRICALDEFENCE); - } else if (source == DamageSource.wither) { - tmp = data.mStat.get(StatType.WITHERDEFENCE); - } else if (source.isFireDamage() || source == GT_DamageSources.getHeatDamage()) { - tmp = data.mStat.get(StatType.FIREDEFENCE); - } else if (source.isExplosion()) { - tmp = data.mStat.get(StatType.EXPLOSIONDEFENCE); - } else if (source.isProjectile()) { - tmp = data.mStat.get(StatType.PROJECTILEDEFENCE); - } else { - tmp = data.mStat.get(StatType.PHYSICALDEFENCE); - } - if (data.mStat.get(StatType.THORNS) > 0.1d && source != DamageSource.fall && source.getSourceOfDamage() != null) { - source.getSourceOfDamage().attackEntityFrom(new DamageSource("Thorns"), data.mStat.get(StatType.THORNS)); - } - - // fallDamage - if (source == DamageSource.fall) { - int fallDef = 0; - ItemStack stack = player.getEquipmentInSlot(1); - if (stack != null && stack.getItem() instanceof ModularArmor_Item) { - fallDef = Math.round(data.boots.mStat.get(StatType.FALLDEFENCE)); - } - tmp = 1.0d - (fallDef > damage ? 0.0d : (1.0d - tmp) * 0.5d); - } - if (tmp == 0.0d) { - tmp = data.mStat.get(StatType.PHYSICALDEFENCE); - } - if (openGuiNr == 2) { - tmp = 1.0f - ((1.0f - tmp) / 2.0f); - } - return new ISpecialArmor.ArmorProperties(0, data.getBaseAbsorptionRatio() * tmp, 1000); - }catch(Exception e){System.err.println(e); - return new ISpecialArmor.ArmorProperties(0, 0, 0); - } - - } else { - return new ISpecialArmor.ArmorProperties(0, 0, 0); - } - } - - @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - if (data == null) { - data = fillArmorData(player, armor); - } - int tmp = (int) -Math.floor(-(data.getBaseAbsorptionRatio() * 20 * data.mStat.get(StatType.PHYSICALDEFENCE))); - - return tmp; - } - - public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { - if (data == null) { - data = fillArmorData(player, itemStack); - } - if (data.info != null) - info.addAll(data.info); - } - - @Override - public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) { - if (data == null) { - data = fillArmorData((EntityPlayer) entity, stack); - } - stack.damageItem(damage, entity); - ContainerModularArmor tmp = new ContainerBasicArmor((EntityPlayer) entity, new InventoryArmor(ModularArmor_Item.class, stack)); - if (stack.getItemDamage() > stack.getMaxDamage() / 2 && XSTR_INSTANCE.nextInt(100) < 5) { - tmp.getSlot(XSTR_INSTANCE.nextInt(tmp.getSlotCount())).decrStackSize(1); - tmp.mInvArmor.onGuiSaved((EntityPlayer) entity); - - /*public void eject(ItemStack drop) - { - if ((!IC2.platform.isSimulating()) || (drop == null)) { - return; - } - float f = 0.7F; - double d = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D; - double d1 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D; - double d2 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D; - EntityItem entityitem = new EntityItem(this.worldObj, this.xCoord + d, this.yCoord + d1, this.zCoord + d2, drop); - entityitem.delayBeforeCanPickup = 10; - this.worldObj.spawnEntityInWorld(entityitem); - }*/ - - } - } - - @SubscribeEvent - public void onEntityLivingFallEvent(LivingFallEvent event) { - if (FMLCommonHandler.instance().getEffectiveSide().isServer() && event.entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entity; - ItemStack armor = player.inventory.armorInventory[0]; - if (data != null && event != null && data.type == 3 && data.charge >= data.mStat.get(StatType.PISTONEUUSAGE) && event.distance - 3 <= data.mStat.get(StatType.FALLDEFENCE)) { - event.setCanceled(true); - } else if (data != null && event != null && data.type == 3 && data.charge >= data.mStat.get(StatType.PISTONEUUSAGE)) { - event.distance -= data.mStat.get(StatType.FALLDEFENCE); - } - } - } - - @Override - public void onArmorTick(World aWorld, EntityPlayer aPlayer, ItemStack aStack) { - if(fail>0){ - fail--; - return; - } - try{ - if (data == null) { - data = fillArmorData(aPlayer, aStack); - } - if (data.tooltipUpdate > 40) { - data.armorPartsEquipped(aPlayer); - data.tooltipUpdate = 0; - data.updateTooltip(); - } else { - data.tooltipUpdate++; - } - if (aPlayer.onGround) { - jumpticks = 4; - } else { - jumpticks--; - } - - // Breathing - if (data.type == 0 && aPlayer.getAir() < 100 && data.fluid != null) { - int air = 0; - if (data.fluid.getUnlocalizedName().equals("fluid.oxygen") && data.fluid.amount >= 150) { - aPlayer.setAir(aPlayer.getAir() + 150); - air = 150; - } else if (data.fluid.getUnlocalizedName().equals("fluid.air") && data.fluid.amount >= 500) { - aPlayer.setAir(aPlayer.getAir() + 100); - air = 500; - } - if (air > 0) { - data.fluid.amount -= air; - ItemStack stack = aPlayer.getEquipmentInSlot(4); - if (stack != null && stack.getItem() instanceof ModularArmor_Item) { - ModularArmor_Item tmp = (ModularArmor_Item) stack.getItem(); - ContainerModularArmor tmp2 = new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, stack)); - ArmorCalculation.useFluid(tmp2.mInvArmor.parts, air); - } - } - } - // Fill Air Tank - if (data.tooltipUpdate == 40 && data.mStat.get(StatType.PROCESSINGPOWER) > data.mStat.get(StatType.PROCESSINGPOWERUSED) && data.type == 0 && data.fluid != null - && data.fluid.getUnlocalizedName().equals("oxygen") && data.fluid.amount < data.mStat.get(StatType.TANKCAP) && data.charge > data.mStat.get(StatType.ELECTROLYZEREUUSAGE)) { - data.charge -= data.mStat.get(StatType.ELECTROLYZEREUUSAGE); - ItemStack stack = aPlayer.getEquipmentInSlot(4); - if (stack != null && stack.getItem() instanceof ModularArmor_Item) { - ModularArmor_Item tmp = (ModularArmor_Item) stack.getItem(); - ContainerModularArmor tmp2 = new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, stack)); - ArmorCalculation.useFluid(tmp2.mInvArmor.parts, -Math.round(data.mStat.get(StatType.ELECTROLYZERPROD))); - } - } - - if (data.isTopItem) { - if(IC2.keyboard.isModeSwitchKeyDown(aPlayer)&&!aWorld.isRemote){ - int typeMod=0; - switch(data.type){ - case 0: - typeMod=400; - break; - case 1: - typeMod=300; - break; - case 2: - typeMod=200; - break; - case 3: - typeMod=100; - break; - } - aPlayer.openGui(GT_Values.GT, openGuiNr+(typeMod), aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ); - } -// if(data.helmet!=null&&data.helmet.openGui){data.helmet.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+400, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -// if(data.chestplate!=null&&data.chestplate.openGui){data.chestplate.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+300, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -// if(data.leggings!=null&&data.leggings.openGui){data.leggings.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+200, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -// if(data.boots!=null&&data.boots.openGui){data.boots.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+100, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} - // Night Vision - if (timer >= 200) { - timer = 0; - if (data.mStat.get(StatType.PROCESSINGPOWER) > data.mStat.get(StatType.PROCESSINGPOWERUSED) && data.helmet != null && data.helmet.mBStat.get(StatType.NIGHTVISION) && data.charge > 3) { - aPlayer.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 500, -3)); - data.charge -= 4; - } else { - PotionEffect nv = aPlayer.getActivePotionEffect(Potion.nightVision); - if (nv != null && nv.getAmplifier() == -3) { - if (aPlayer.worldObj.isRemote) { - aPlayer.removePotionEffectClient(Potion.nightVision.id); - } else { - aPlayer.removePotionEffect(Potion.nightVision.id); - } - } - } - } else { - timer++; - } - - // Item Magnet - if (data.mStat.get(StatType.MAGNET) > 1) { - double x = aPlayer.posX; - double y = aPlayer.posY - (aPlayer.worldObj.isRemote ? 1.62 : 0) + 0.75; - double z = aPlayer.posZ; - int tMagnet = Math.round(data.mStat.get(StatType.MAGNET)); - List<EntityItem> items = aPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, - AxisAlignedBB.getBoundingBox(x - tMagnet, y - tMagnet, z - tMagnet, x + tMagnet, y + tMagnet, z + tMagnet)); - for (EntityItem item : items) { - ItemStack stack = item.getEntityItem(); - if (!item.isDead && stack != null) { - setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F); - } - } - } - // Weight limit calcuation - double motorSpeed = 0; - if (data.leggings != null) { - motorSpeed = data.leggings.mStat.get(StatType.MOTPRPOWER); - } - if (data.maxWeight > 4000) { - if (data.leggings != null && data.leggings.charge > data.leggings.mStat.get(StatType.MOTOREUUSAGE)) { - motorSpeed -= data.maxWeight - 4000; - data.leggings.charge -= (data.leggings.mStat.get(StatType.MOTOREUUSAGE) / 100); - } else { - aPlayer.motionX *= (4000.0d / data.maxWeight); - aPlayer.motionZ *= (4000.0d / data.maxWeight); - } - } - if (data.leggings != null && data.leggings.charge > data.leggings.mStat.get(StatType.MOTOREUUSAGE) && data.mStat.get(StatType.PROCESSINGPOWER) > data.mStat.get(StatType.PROCESSINGPOWERUSED) && motorSpeed > 0 - && aPlayer.isSprinting() && jumpticks > 0 - && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D)) { - data.leggings.charge -= data.leggings.mStat.get(StatType.MOTOREUUSAGE); - motorSpeed = Math.sqrt(motorSpeed) / 3; - - float var7 = (float) (0.02f * motorSpeed); - if (aPlayer.isInWater()) { - var7 = 0.1F; - if (aPlayer.motionY > 0) { - aPlayer.motionY += 0.10000000149011612D; - } - } - - if (var7 > 0.0F) { - aPlayer.moveFlying(0.0F, 1.0F, var7); - } - } - - // jump+step up assist - if (data.mStat.get(StatType.PROCESSINGPOWER) > data.mStat.get(StatType.PROCESSINGPOWERUSED) && data.leggings != null) { - double stepup = data.leggings.mStat.get(StatType.PISTONJUMPBOOST); - if (stepup > 1) { - aPlayer.stepHeight = 1.0f; - } - if (aWorld.isRemote && GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindJump)) { - if (stepup > 0 && jumpticks > 0) { - if (data.maxWeight > 2000) { - stepup *= 2000.0D / data.maxWeight; - } - aPlayer.motionY += 0.04 * stepup; - } - aPlayer.jumpMovementFactor = aPlayer.getAIMoveSpeed() * .2f; - } - - } - - // immune effect removal - List<PotionEffect> effects = new LinkedList(aPlayer.getActivePotionEffects()); - for (PotionEffect effect : effects) { - int id = effect.getPotionID(); - if (id == 24 && data.mBStat.get(StatType.FULLRADIATIONARMOR)) { - aPlayer.removePotionEffect(id); - } - } - } - }catch(Exception e){System.err.print(e); - fail = 200; - } - } - - public void setEntityMotionFromVector(Entity entity, Vector3 originalPosVector, float modifier) { - Vector3 entityVector = Vector3.fromEntityCenter(entity); - Vector3 finalVector = originalPosVector.copy().subtract(entityVector); - if (finalVector.mag() > 1) - finalVector.normalize(); - entity.motionX = finalVector.x * modifier; - entity.motionY = finalVector.y * modifier; - entity.motionZ = finalVector.z * modifier; - } - - @Override - public int getItemEnchantability() { - return 0; - } - - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - return false; - } - - @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aIconRegister) { - this.itemIcon = aIconRegister.registerIcon(GT_Values.MOD_ID+":" + mName); - } - - @SideOnly(Side.CLIENT) - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - String armor=GT_Values.RES_PATH_ITEM+"armorhelmet.png"; - String tier=""; - try{ - if (data == null) { - data = fillArmorData((EntityPlayer) entity, stack); - } - if(this.data.armorTier==0){ - tier="basic"; - }else if(this.data.armorTier==1){ - tier="e1"; - }else if(this.data.armorTier==2){ - tier="e2"; - } - if(this.data.type==0||this.data.type==1||this.data.type==3){ - armor = GT_Values.RES_PATH_MODEL+"armor/"+tier+"_helmet_chest.png"; - }else{ - armor = GT_Values.RES_PATH_MODEL+"armor/"+tier+"_leggings_boots.png"; - }}catch(Exception e){System.err.println(e);} - return armor; - } - - @Override - public boolean showNodes(ItemStack aStack, EntityLivingBase aPlayer) { - if (data == null) { - data = fillArmorData((EntityPlayer) aPlayer, aStack); - } - return data.mBStat.get(StatType.THAUMICGOGGLES) && data.armorTier > 0 && data.charge > 0; - } - - @Override - public boolean showIngamePopups(ItemStack aStack, EntityLivingBase aPlayer) { - if (data == null) { - data = fillArmorData((EntityPlayer) aPlayer, aStack); - } - return data.mBStat.get(StatType.THAUMICGOGGLES) && data.armorTier > 0 && data.charge > 0; - } - - public ArmorData fillArmorData(EntityPlayer player, ItemStack stack) { - return new ArmorData(player, stack, this.armorType, openGuiNr); - } - - public double getBaseAbsorptionRatio() { - switch (this.armorType) { - case 0: - return 0.15; - case 1: - return 0.40; - case 2: - return 0.30; - case 3: - return 0.15; - default: - return 0.00; - } - } -} diff --git a/src/main/java/gregtech/common/items/armor/Vector3.java b/src/main/java/gregtech/common/items/armor/Vector3.java deleted file mode 100644 index 2f79ff4c69..0000000000 --- a/src/main/java/gregtech/common/items/armor/Vector3.java +++ /dev/null @@ -1,279 +0,0 @@ -package gregtech.common.items.armor; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.vector.Vector3f; -import org.lwjgl.util.vector.Vector4f; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Vector3 { - public static Vector3 zero = new Vector3(); - public static Vector3 one = new Vector3(1, 1, 1); - public static Vector3 center = new Vector3(0.5, 0.5, 0.5); - public double x; - public double y; - public double z; - - public Vector3() { - } - - public Vector3(double d, double d1, double d2) { - x = d; - y = d1; - z = d2; - } - - public Vector3(Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; - } - - public Vector3(Vec3 vec) { - x = vec.xCoord; - y = vec.yCoord; - z = vec.zCoord; - } - - public Vector3 copy() { - return new Vector3(this); - } - - public static Vector3 fromEntity(Entity e) { - return new Vector3(e.posX, e.posY, e.posZ); - } - - public static Vector3 fromEntityCenter(Entity e) { - return new Vector3(e.posX, e.posY - e.yOffset + e.height / 2, e.posZ); - } - - public static Vector3 fromTileEntity(TileEntity e) { - return new Vector3(e.xCoord, e.yCoord, e.zCoord); - } - - public static Vector3 fromTileEntityCenter(TileEntity e) { - return new Vector3(e.xCoord + 0.5, e.yCoord + 0.5, e.zCoord + 0.5); - } - - public Vector3 set(double d, double d1, double d2) { - x = d; - y = d1; - z = d2; - return this; - } - - public Vector3 set(Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; - return this; - } - - public double dotProduct(Vector3 vec) { - double d = vec.x * x + vec.y * y + vec.z * z; - if (d > 1 && d < 1.00001) - d = 1; - else if (d < -1 && d > -1.00001) - d = -1; - return d; - } - - public double dotProduct(double d, double d1, double d2) { - return d * x + d1 * y + d2 * z; - } - - public Vector3 crossProduct(Vector3 vec) { - double d = y * vec.z - z * vec.y; - double d1 = z * vec.x - x * vec.z; - double d2 = x * vec.y - y * vec.x; - x = d; - y = d1; - z = d2; - return this; - } - - public Vector3 add(double d, double d1, double d2) { - x += d; - y += d1; - z += d2; - return this; - } - - public Vector3 add(Vector3 vec) { - x += vec.x; - y += vec.y; - z += vec.z; - return this; - } - - public Vector3 add(double d) { - return add(d, d, d); - } - - public Vector3 sub(Vector3 vec) { - return subtract(vec); - } - - public Vector3 subtract(Vector3 vec) { - x -= vec.x; - y -= vec.y; - z -= vec.z; - return this; - } - - public Vector3 negate(Vector3 vec) { - x = -x; - y = -y; - z = -z; - return this; - } - - public Vector3 multiply(double d) { - x *= d; - y *= d; - z *= d; - return this; - } - - public Vector3 multiply(Vector3 f) { - x *= f.x; - y *= f.y; - z *= f.z; - return this; - } - - public Vector3 multiply(double fx, double fy, double fz) { - x *= fx; - y *= fy; - z *= fz; - return this; - } - - public double mag() { - return Math.sqrt(x * x + y * y + z * z); - } - - public double magSquared() { - return x * x + y * y + z * z; - } - - public Vector3 normalize() { - double d = mag(); - if (d != 0) - multiply(1 / d); - return this; - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Vector3(" + new BigDecimal(x, cont) + ", " + new BigDecimal(y, cont) + ", " + new BigDecimal(z, cont) + ")"; - } - - public Vector3 perpendicular() { - if (z == 0) - return zCrossProduct(); - return xCrossProduct(); - } - - public Vector3 xCrossProduct() { - double d = z; - double d1 = -y; - x = 0; - y = d; - z = d1; - return this; - } - - public Vector3 zCrossProduct() { - double d = y; - double d1 = -x; - x = d; - y = d1; - z = 0; - return this; - } - - public Vector3 yCrossProduct() { - double d = -z; - double d1 = x; - x = d; - y = 0; - z = d1; - return this; - } - - public Vec3 toVec3D() { - return Vec3.createVectorHelper(x, y, z); - } - - public double angle(Vector3 vec) { - return Math.acos(copy().normalize().dotProduct(vec.copy().normalize())); - } - - public boolean isInside(AxisAlignedBB aabb) { - return x >= aabb.minX && y >= aabb.maxY && z >= aabb.minZ && x < aabb.maxX && y < aabb.maxY && z < aabb.maxZ; - } - - public boolean isZero() { - return x == 0 && y == 0 && z == 0; - } - - public boolean isAxial() { - return x == 0 ? y == 0 || z == 0 : y == 0 && z == 0; - } - - @SideOnly(Side.CLIENT) - public Vector3f vector3f() { - return new Vector3f((float) x, (float) y, (float) z); - } - - @SideOnly(Side.CLIENT) - public Vector4f vector4f() { - return new Vector4f((float) x, (float) y, (float) z, 1); - } - - @SideOnly(Side.CLIENT) - public void glVertex() { - GL11.glVertex3d(x, y, z); - } - - public Vector3 negate() { - x = -x; - y = -y; - z = -z; - return this; - } - - public double scalarProject(Vector3 b) { - double l = b.mag(); - return l == 0 ? 0 : dotProduct(b) / l; - } - - public Vector3 project(Vector3 b) { - double l = b.magSquared(); - if (l == 0) { - set(0, 0, 0); - return this; - } - double m = dotProduct(b) / l; - set(b).multiply(m); - return this; - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof Vector3)) - return false; - Vector3 v = (Vector3) o; - return x == v.x && y == v.y && z == v.z; - } -} diff --git a/src/main/java/gregtech/common/items/armor/components/ArmorComponent.java b/src/main/java/gregtech/common/items/armor/components/ArmorComponent.java deleted file mode 100644 index ea2f0184dd..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/ArmorComponent.java +++ /dev/null @@ -1,63 +0,0 @@ -package gregtech.common.items.armor.components; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashMap; -import java.util.Map; - -public abstract class ArmorComponent implements IArmorComponent { - public ItemStack mStack; - public String mOreDict; - public String mConfigName; - public static Map<String, ArmorComponent> mOreDicts = new HashMap<String, ArmorComponent>(); - public static Map<String, ArmorComponent> mStacks = new HashMap<String, ArmorComponent>(); - public Map<StatType,Float> mStat = new HashMap<StatType,Float>(); - public Map<StatType,Boolean> mBStat = new HashMap<StatType,Boolean>(); - - public ArmorComponent(String aName, String aOreDict, boolean aElectric, float aWeight){ - mConfigName = aName; - if(!GregTech_API.sModularArmor.get( mConfigName, "Enabled", true))return; - mOreDict = GregTech_API.sModularArmor.get( mConfigName, "OreDict", aOreDict); - mBStat.put(StatType.ELECTRIC, aElectric); - mOreDicts.put(aOreDict, this); - for(ItemStack tStack : OreDictionary.getOres(aOreDict))if(tStack!=null)mStacks.put(tStack.getUnlocalizedName(), this); - mStat.put(StatType.WEIGHT, (float) GregTech_API.sModularArmor.get( mConfigName, "Weight", aWeight)); - } - - public ArmorComponent(String aName, ItemStack aStack, boolean aElectric, float aWeight){ - mConfigName = aName; - String tStackName = GregTech_API.sModularArmor.get( mConfigName, "Stack", GameRegistry.findUniqueIdentifierFor(aStack.getItem()).toString()+(aStack.getItemDamage()==0 ? "" : ":"+aStack.getItemDamage())); - mStack = GameRegistry.findItemStack(tStackName.split(":")[0], tStackName.split(":")[1], 1); - if(tStackName.split(":").length>2)mStack.setItemDamage(Integer.parseInt(tStackName.split(":")[2])); - if(!GregTech_API.sModularArmor.get( mConfigName, "Enabled", true))return; - mStack = aStack; - mBStat.put(StatType.ELECTRIC, aElectric); - mStacks.put(aStack.getUnlocalizedName(), this); - mStat.put(StatType.WEIGHT, (float) GregTech_API.sModularArmor.get( mConfigName, "Weight", aWeight)); - } - - @Override - public boolean isArmorComponent(ItemStack aStack) { - if(mStack!=null && GT_Utility.areStacksEqual(mStack, aStack, true)){return true;} - if(mOreDict!=null){ - for(ItemStack tStack : OreDictionary.getOres(mOreDict)) - if(GT_Utility.areStacksEqual(tStack, aStack, true))return true;} - return false; - } - - public void addVal(StatType aType, ArmorData aArmorData){ - float tArmorDef = 0.0f; - if(aArmorData.mStat.containsKey(aType)){ - tArmorDef = aArmorData.mStat.get(aType); - aArmorData.mStat.remove(aType);} - aArmorData.mStat.put(aType, tArmorDef + mStat.get(aType)); - } - - public abstract void calculateArmor(ArmorData aArmorData); - -} diff --git a/src/main/java/gregtech/common/items/armor/components/ArmorComponentBattery.java b/src/main/java/gregtech/common/items/armor/components/ArmorComponentBattery.java deleted file mode 100644 index 15946863fb..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/ArmorComponentBattery.java +++ /dev/null @@ -1,18 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.api.GregTech_API; -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; - -public class ArmorComponentBattery extends ArmorComponent{ - public ArmorComponentBattery(String aName, ItemStack aStack, boolean aElectric, float aWeight, float aBatteryCapacity) { - super(aName, aStack, aElectric, aWeight); - mStat.put(StatType.BATTERYCAPACITY, (float) GregTech_API.sModularArmor.get( mConfigName, "ProcessingUsed", aBatteryCapacity)); - } - - @Override - public void calculateArmor(ArmorData aArmorData) { - addVal(StatType.BATTERYCAPACITY, aArmorData); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/components/ArmorComponentFunction.java b/src/main/java/gregtech/common/items/armor/components/ArmorComponentFunction.java deleted file mode 100644 index dcdc59d19c..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/ArmorComponentFunction.java +++ /dev/null @@ -1,21 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.api.GregTech_API; -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; - -public class ArmorComponentFunction extends ArmorComponent{ - StatType mType; - public ArmorComponentFunction(String aName, ItemStack aStack, boolean aElectric, float aWeight, StatType aType, float aProcessingUsed) { - super(aName, aStack, aElectric, aWeight); - mType = StatType.valueOf(GregTech_API.sModularArmor.get(mConfigName, "StatType", aType.toString())); - mStat.put(StatType.PROCESSINGPOWERUSED, (float) GregTech_API.sModularArmor.get( mConfigName, "ProcessingUsed", aProcessingUsed)); - } - - @Override - public void calculateArmor(ArmorData aArmorData) { - addVal(StatType.PROCESSINGPOWERUSED, aArmorData); - if(!aArmorData.mBStat.containsKey(mType))aArmorData.mBStat.put(mType, true); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/components/ArmorElectricComponent.java b/src/main/java/gregtech/common/items/armor/components/ArmorElectricComponent.java deleted file mode 100644 index 3e9e22ee28..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/ArmorElectricComponent.java +++ /dev/null @@ -1,31 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.api.GregTech_API; -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; - -public class ArmorElectricComponent extends ArmorComponent{ - StatType mType1; - StatType mType2; - StatType mType3; - - public ArmorElectricComponent(String aName, ItemStack aStack, float aWeight, StatType aType1, float aValue1, StatType aType2, float aValue2, StatType aType3, float aValue3) { - super(aName, aStack, true, aWeight); - mType1 = StatType.valueOf(GregTech_API.sModularArmor.get(mConfigName, "StatType", aType1.toString())); - String tType2 = GregTech_API.sModularArmor.get(mConfigName, "StatType", aType2==null ? "null" : aType2.toString()); - mType2 = tType2.equals("null") ? null : StatType.valueOf(tType2); - String tType3 = GregTech_API.sModularArmor.get(mConfigName, "StatType", aType3==null ? "null" : aType3.toString()); - mType3 = tType3.equals("null") ? null : StatType.valueOf(tType3); - mStat.put(aType1, (float) GregTech_API.sModularArmor.get( mConfigName, "Value1", aValue1)); - if(mType2!=null)mStat.put(mType2, (float) GregTech_API.sModularArmor.get( mConfigName, "Value2", aValue2)); - if(mType3!=null)mStat.put(mType3, (float) GregTech_API.sModularArmor.get( mConfigName, "Value3", aValue3)); - } - - @Override - public void calculateArmor(ArmorData aArmorData) { - addVal(mType1, aArmorData); - if(mType2!=null)addVal(mType2, aArmorData); - if(mType3!=null)addVal(mType3, aArmorData); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java b/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java deleted file mode 100644 index 2e02ac7ba6..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java +++ /dev/null @@ -1,112 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.api.GregTech_API; -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; - -public class ArmorPlating extends ArmorComponent{ - StatType mType; - public ArmorPlating(String aName, ItemStack aStack, float aWeight, float aPhysicalDef, float aProjectileDef, float aFireDef, float aMagicDef, float aExplosionDef, float aFallDef, float aRadiationDef, float aElectricDef, float aWitherDef) { - super(aName, aStack, false, aWeight); - aPhysicalDef = (float) GregTech_API.sModularArmor.get( mConfigName, "PhysicalDef", aPhysicalDef); - aProjectileDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ProjectileDef", aProjectileDef); - aFireDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FireDef", aFireDef); - aMagicDef = (float) GregTech_API.sModularArmor.get( mConfigName, "MagicDef", aMagicDef); - aExplosionDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ExplosionDef", aExplosionDef); - aFallDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FallDef", aFallDef); - aRadiationDef = (float) GregTech_API.sModularArmor.get( mConfigName, "RadiationDef", aRadiationDef); - aElectricDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ElectricalDef", aElectricDef); - aWitherDef = (float) GregTech_API.sModularArmor.get( mConfigName, "WitherDef", aWitherDef); - addStats(aPhysicalDef, aProjectileDef, aFireDef, aMagicDef, aExplosionDef, aFallDef, aRadiationDef, aElectricDef, aWitherDef); - } - - public ArmorPlating(String aName, String aOreDict, float aWeight, float aPhysicalDef, float aProjectileDef, float aFireDef, float aMagicDef, float aExplosionDef, float aFallDef, float aRadiationDef, float aElectricDef, float aWitherDef) { - super(aName, aOreDict, false, aWeight); - aPhysicalDef = (float) GregTech_API.sModularArmor.get( mConfigName, "PhysicalDef", aPhysicalDef); - aProjectileDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ProjectileDef", aProjectileDef); - aFireDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FireDef", aFireDef); - aMagicDef = (float) GregTech_API.sModularArmor.get( mConfigName, "MagicDef", aMagicDef); - aExplosionDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ExplosionDef", aExplosionDef); - aFallDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FallDef", aFallDef); - aRadiationDef = (float) GregTech_API.sModularArmor.get( mConfigName, "RadiationDef", aRadiationDef); - aElectricDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ElectricalDef", aElectricDef); - aWitherDef = (float) GregTech_API.sModularArmor.get( mConfigName, "WitherDef", aWitherDef); - addStats(aPhysicalDef, aProjectileDef, aFireDef, aMagicDef, aExplosionDef, aFallDef, aRadiationDef, aElectricDef, aWitherDef); - } - - public ArmorPlating(String aName, String aOreDict, float aWeight, float aPhysicalDef, float aProjectileDef, float aFireDef, float aMagicDef, float aExplosionDef, float aFallDef, float aRadiationDef, float aElectricDef, float aWitherDef, StatType aType, float aSpecial) { - super(aName, aOreDict, false, aWeight); - aPhysicalDef = (float) GregTech_API.sModularArmor.get( mConfigName, "PhysicalDef", aPhysicalDef); - aProjectileDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ProjectileDef", aProjectileDef); - aFireDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FireDef", aFireDef); - aMagicDef = (float) GregTech_API.sModularArmor.get( mConfigName, "MagicDef", aMagicDef); - aExplosionDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ExplosionDef", aExplosionDef); - aFallDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FallDef", aFallDef); - aRadiationDef = (float) GregTech_API.sModularArmor.get( mConfigName, "RadiationDef", aRadiationDef); - aElectricDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ElectricalDef", aElectricDef); - aWitherDef = (float) GregTech_API.sModularArmor.get( mConfigName, "WitherDef", aWitherDef); - addStats(aPhysicalDef, aProjectileDef, aFireDef, aMagicDef, aExplosionDef, aFallDef, aRadiationDef, aElectricDef, aWitherDef); - mType = StatType.valueOf(GregTech_API.sModularArmor.get(mConfigName, "StatType", aType.toString())); - mStat.put(mType, (float) GregTech_API.sModularArmor.get( mConfigName, "SpecialType", aSpecial)); - } - - public ArmorPlating(String aName, String aOreDict,float aWeight, float aPhysicalDef, float aProjectileDef, float aFireDef, float aMagicDef, float aExplosionDef) { - super(aName, aOreDict, false, aWeight); - aPhysicalDef = (float) GregTech_API.sModularArmor.get( mConfigName, "PhysicalDef", aPhysicalDef); - aProjectileDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ProjectileDef", aProjectileDef); - aFireDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FireDef", aFireDef); - aMagicDef = (float) GregTech_API.sModularArmor.get( mConfigName, "MagicDef", aMagicDef); - aExplosionDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ExplosionDef", aExplosionDef); - float aFallDef = (float) GregTech_API.sModularArmor.get( mConfigName, "FallDef", 0.0f); - float aRadiationDef = (float) GregTech_API.sModularArmor.get( mConfigName, "RadiationDef", 0.0f); - float aElectricDef = (float) GregTech_API.sModularArmor.get( mConfigName, "ElectricalDef", 0.0f); - float aWitherDef = (float) GregTech_API.sModularArmor.get( mConfigName, "WitherDef", 0.0f); - addStats(aPhysicalDef, aProjectileDef, aFireDef, aMagicDef, aExplosionDef, aFallDef, aRadiationDef, aElectricDef, aWitherDef); - } - - public void addStats(float aPhysicalDef, float aProjectileDef, float aFireDef, float aMagicDef, float aExplosionDef, float aFallDef, float aRadiationDef, float aElectricDef, float aWitherDef){ - mStat.put(StatType.FALLDEFENCE, aFallDef); - mStat.put(StatType.PHYSICALDEFENCE, aPhysicalDef); - mStat.put(StatType.PROJECTILEDEFENCE, aProjectileDef); - mStat.put(StatType.FIREDEFENCE, aFireDef); - mStat.put(StatType.MAGICDEFENCE, aMagicDef); - mStat.put(StatType.EXPLOSIONDEFENCE, aExplosionDef); - mStat.put(StatType.RADIATIONDEFENCE, aRadiationDef); - mStat.put(StatType.ELECTRICALDEFENCE, aElectricDef); - mStat.put(StatType.WITHERDEFENCE, aWitherDef); - } - - @Override - public void calculateArmor(ArmorData aArmorData) { - calDefAdd(StatType.FALLDEFENCE, aArmorData); - calDef(StatType.PHYSICALDEFENCE, aArmorData); - calDef(StatType.PROJECTILEDEFENCE, aArmorData); - calDef(StatType.FIREDEFENCE, aArmorData); - calDef(StatType.MAGICDEFENCE, aArmorData); - calDef(StatType.EXPLOSIONDEFENCE, aArmorData); - calDef(StatType.RADIATIONDEFENCE, aArmorData); - calDef(StatType.ELECTRICALDEFENCE, aArmorData); - calDef(StatType.WITHERDEFENCE, aArmorData); - addVal(StatType.WEIGHT, aArmorData); - if(mType!=null)addVal(mType, aArmorData); - } - - public void calDef(StatType aType, ArmorData aArmorData){ - float tArmorDef = 0.0f; - if(aArmorData.mStat.containsKey(aType)){ - tArmorDef = aArmorData.mStat.get(aType); - aArmorData.mStat.remove(aType);} - float tComponentDef = mStat.get(aType); - aArmorData.mStat.put(aType, tArmorDef + ((1.0f -tArmorDef) * tComponentDef)); - } - - public void calDefAdd(StatType aType, ArmorData aArmorData){ - float tArmorDef = 0.0f; - if(aArmorData.mStat.containsKey(aType)){ - tArmorDef = aArmorData.mStat.get(aType); - aArmorData.mStat.remove(aType);} - float tComponentDef = mStat.get(aType); - aArmorData.mStat.put(aType, tArmorDef + tComponentDef); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/components/IArmorComponent.java b/src/main/java/gregtech/common/items/armor/components/IArmorComponent.java deleted file mode 100644 index 340601b354..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/IArmorComponent.java +++ /dev/null @@ -1,11 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.common.items.armor.ArmorData; -import net.minecraft.item.ItemStack; - -public interface IArmorComponent { - - boolean isArmorComponent(ItemStack aStack); - - void calculateArmor(ArmorData aArmorData); -} diff --git a/src/main/java/gregtech/common/items/armor/components/LoadArmorComponents.java b/src/main/java/gregtech/common/items/armor/components/LoadArmorComponents.java deleted file mode 100644 index bea0e2b5b4..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/LoadArmorComponents.java +++ /dev/null @@ -1,250 +0,0 @@ -package gregtech.common.items.armor.components; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - -public class LoadArmorComponents { - public static void init(){ - - new ArmorPlating("plateRubber", "plateRubber", 60, 0.06f, 0.06f, 0.02f, 0.10f, 0.10f, 2f, 0f, .25f, 0f); - new ArmorPlating("plateWood", "plateWood", 80, 0.08f, 0.09f, 0.02f, 0.08f, 0.08f); - new ArmorPlating("plateBrass", "plateBrass", 140, 0.12f, 0.12f, 0.10f, 0.10f, 0.12f); - new ArmorPlating("plateCopper", "plateCopper", 140, 0.11f, 0.11f, 0.10f, 0.10f, 0.11f); - new ArmorPlating("plateLead", "plateLead", 280, 0.05f, 0.05f, 0.05f, 0.05f, 0.05f, 0, .3f, 0, 0); - new ArmorPlating("platePlastic", "platePlastic", 60, 0.10f, 0.10f, 0.02f, 0.02f, 0.10f, 0, 0, .25f, 0); - new ArmorPlating("plateAluminium", "plateAluminium", 120, 0.14f, 0.14f, 0.12f, 0.12f, 0.14f); - new ArmorPlating("plateAstralSilver", "plateAstralSilver", 180, 0.10f, 0.10f, 0.10f, 0.18f, 0.10f); - new ArmorPlating("plateBismuthBronze", "plateBismuthBronze", 160, 0.12f, 0.12f, 0.10f, 0.10f, 0.12f); - new ArmorPlating("plateBlackBronze", "plateBlackBronze", 160, 0.13f, 0.13f, 0.10f, 0.10f, 0.13f); - new ArmorPlating("plateBlackSteel", "plateBlackSteel", 200, 0.19f, 0.19f, 0.17f, 0.17f, 0.19f); - new ArmorPlating("plateBlueSteel", "plateBlueSteel", 200, 0.21f, 0.21f, 0.19f, 0.19f, 0.21f); - new ArmorPlating("plateBronze", "plateBronze", 160, 0.13f, 0.13f, 0.12f, 0.12f, 0.13f); - new ArmorPlating("plateCobaltBrass", "plateCobaltBrass", 180, 0.15f, 0.15f, 0.14f, 0.14f, 0.15f); - new ArmorPlating("plateDamascusSteel", "plateDamascusSteel", 200, 0.22f, 0.22f, 0.20f, 0.20f, 0.22f); - new ArmorPlating("plateElectrum", "plateElectrum", 250, 0.11f, 0.11f, 0.10f, 0.10f, 0.11f); - new ArmorPlating("plateEmerald", "plateEmerald", 160, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateGold", "plateGold", 300, 0.09f, 0.09f, 0.05f, 0.25f, 0.09f); - new ArmorPlating("plateGreenSapphire", "plateGreenSapphire", 160, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateInvar", "plateInvar", 190, 0.10f, 0.10f, 0.22f, 0.22f, 0.10f); - new ArmorPlating("plateIron", "plateIron", 200, 0.12f, 0.12f, 0.10f, 0.10f, 0.12f); - new ArmorPlating("plateIronWood", "plateIronWood", 150, 0.17f, 0.17f, 0.02f, 0.02f, 0.17f); - new ArmorPlating("plateMagnalium", "plateMagnalium", 120, 0.15f, 0.15f, 0.17f, 0.17f, 0.15f); - new ArmorPlating("plateNeodymiumMagnetic","plateNeodymiumMagnetic",220, 0.14f, 0.14f, 0.14f, 0.14f, 0.14f, 0, 0, 0, 0, StatType.MAGNETSINGLE, 2.0f); - new ArmorPlating("plateManganese", "plateManganese", 180, 0.15f, 0.15f, 0.14f, 0.14f, 0.15f); - new ArmorPlating("plateMeteoricIron", "plateMeteoricIron", 200, 0.18f, 0.18f, 0.16f, 0.16f, 0.18f); - new ArmorPlating("plateMeteoricSteel", "plateMeteoricSteel", 200, 0.21f, 0.21f, 0.19f, 0.19f, 0.21f); - new ArmorPlating("plateMolybdenum", "plateMolybdenum", 140, 0.14f, 0.14f, 0.14f, 0.14f, 0.14f); - new ArmorPlating("plateNickel", "plateNickel", 180, 0.12f, 0.12f, 0.15f, 0.15f, 0.12f); - new ArmorPlating("plateOlivine", "plateOlivine", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateOpal", "plateOpal", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("platePalladium", "platePalladium", 280, 0.14f, 0.14f, 0.12f, 0.12f, 0.14f); - new ArmorPlating("platePlatinum", "platePlatinum", 290, 0.15f, 0.15f, 0.13f, 0.13f, 0.15f); - new ArmorPlating("plateGarnetRed", "plateGarnetRed", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateRedSteel", "plateRedSteel", 200, 0.20f, 0.20f, 0.18f, 0.18f, 0.20f); - new ArmorPlating("plateRoseGold", "plateRoseGold", 240, 0.10f, 0.10f, 0.08f, 0.18f, 0.10f); - new ArmorPlating("plateRuby", "plateRuby", 180, 0.10f, 0.10f, 0.20f, 0.20f, 0.10f); - new ArmorPlating("plateSapphire", "plateSapphire", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateSilver", "plateSilver", 220, 0.11f, 0.11f, 0.07f, 0.24f, 0.11f); - new ArmorPlating("plateStainlessSteel", "plateStainlessSteel", 200, 0.16f, 0.16f, 0.21f, 0.21f, 0.16f); - new ArmorPlating("plateSteel", "plateSteel", 200, 0.18f, 0.18f, 0.16f, 0.16f, 0.18f); - new ArmorPlating("plateSterlingSilver", "plateSterlingSilver", 210, 0.15f, 0.15f, 0.13f, 0.13f, 0.15f); - new ArmorPlating("plateTanzanite", "plateTanzanite", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateThorium", "plateThorium", 280, 0.13f, 0.13f, 0.16f, 0.16f, 0.13f); - new ArmorPlating("plateWroughtIron", "plateWroughtIron", 200, 0.14f, 0.14f, 0.12f, 0.12f, 0.14f); - new ArmorPlating("plateGarnetYellow", "plateGarnetYellow", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateAlloyCarbon", "plateAlloyCarbon", 60, 0.06f, 0.23f, 0.05f, 0.05f, 0.06f); - new ArmorPlating("plateInfusedAir", "plateInfusedAir", 10, 0.10f, 0.10f, 0.10f, 0.10f, 0.10f); - new ArmorPlating("plateAmethyst", "plateAmethyst", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateInfusedWater", "plateInfusedWater", 150, 0.10f, 0.10f, 0.20f, 0.20f, 0.10f); - new ArmorPlating("plateBlueTopaz", "plateBlueTopaz", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateChrome", "plateChrome", 200, 0.12f, 0.12f, 0.21f, 0.21f, 0.12f); - new ArmorPlating("plateCobalt", "plateCobalt", 220, 0.16f, 0.16f, 0.14f, 0.14f, 0.16f); - new ArmorPlating("plateDarkIron", "plateDarkIron", 200, 0.21f, 0.21f, 0.19f, 0.19f, 0.21f); - new ArmorPlating("plateDiamond", "plateDiamond", 200, 0.20f, 0.20f, 0.22f, 0.22f, 0.20f); - new ArmorPlating("plateEnderium", "plateEnderium", 250, 0.22f, 0.22f, 0.21f, 0.21f, 0.22f); - new ArmorPlating("plateElectrumFlux", "plateElectrumFlux", 180, 0.19f, 0.19f, 0.16f, 0.16f, 0.19f); - new ArmorPlating("plateForce", "plateForce", 180, 0.10f, 0.10f, 0.20f, 0.20f, 0.10f); - new ArmorPlating("plateHSLA", "plateHSLA", 200, 0.21f, 0.21f, 0.17f, 0.17f, 0.21f); - new ArmorPlating("plateInfusedFire", "plateInfusedFire", 150, 0.12f, 0.10f, 0.30f, 0.30f, 0.12f, 0, 0, 0, 0, StatType.THORNSSINGLE, 3.0f); - new ArmorPlating("plateInfusedGold", "plateInfusedGold", 300, 0.15f, 0.15f, 0.05f, 0.05f, 0.15f); - new ArmorPlating("plateMithril", "plateMithril", 200, 0.25f, 0.25f, 0.10f, 0.30f, 0.25f); - new ArmorPlating("plateInfusedOrder", "plateInfusedOrder", 150, 0.18f, 0.22f, 0.22f, 0.25f, 0.22f); - new ArmorPlating("plateSteeleaf", "plateSteeleaf", 120, 0.16f, 0.16f, 0.06f, 0.06f, 0.16f); - new ArmorPlating("plateInfusedEarth", "plateInfusedEarth", 350, 0.30f, 0.30f, 0.30f, 0.30f, 0.30f); - new ArmorPlating("plateThaumium", "plateThaumium", 200, 0.18f, 0.19f, 0.20f, 0.30f, 0.18f); - new ArmorPlating("plateTitanium", "plateTitanium", 140, 0.20f, 0.20f, 0.18f, 0.18f, 0.20f); - new ArmorPlating("plateTungsten", "plateTungsten", 270, 0.27f, 0.26f, 0.23f, 0.26f, 0.26f); - new ArmorPlating("plateUltimet", "plateTopaz", 180, 0.10f, 0.10f, 0.14f, 0.14f, 0.10f); - new ArmorPlating("plateUltimet", "plateUltimet", 180, 0.21f, 0.21f, 0.19f, 0.19f, 0.21f); - new ArmorPlating("plateUranium", "plateUranium", 290, 0.27f, 0.23f, 0.20f, 0.15f, 0.21f); - new ArmorPlating("plateVinteum", "plateVinteum", 180, 0.10f, 0.12f, 0.14f, 0.28f, 0.12f); - new ArmorPlating("plateDuranium", "plateDuranium", 140, 0.24f, 0.24f, 0.24f, 0.24f, 0.24f); - new ArmorPlating("plateAlloyIridium", "plateAlloyIridium", 220, 0.24f, 0.24f, 0.22f, 0.22f, 0.24f); - new ArmorPlating("plateOsmiridium", "plateOsmiridium", 240, 0.18f, 0.18f, 0.16f, 0.16f, 0.18f); - new ArmorPlating("plateOsmium", "plateOsmium", 250, 0.12f, 0.12f, 0.10f, 0.10f, 0.12f); - new ArmorPlating("plateNaquadah", "plateNaquadah", 250, 0.27f, 0.27f, 0.25f, 0.25f, 0.27f); - new ArmorPlating("plateNetherStar", "plateNetherStar", 140, 0.22f, 0.22f, 0.24f, 0.24f, 0.22f, 0, 0, 0, .2f); - new ArmorPlating("plateInfusedEntropy", "plateInfusedEntropy", 150, 0.10f, 0.10f, 0.10f, 0.10f, 0.10f, 0, 0, 0, 0, StatType.THORNSSINGLE, 4.0f); - new ArmorPlating("plateTritanium", "plateTritanium", 140, 0.26f, 0.26f, 0.26f, 0.26f, 0.26f); - new ArmorPlating("plateTungstenSteel", "plateTungstenSteel", 270, 0.30f, 0.28f, 0.25f, 0.28f, 0.30f); - new ArmorPlating("plateAdamantium", "plateAdamantium", 200, 0.28f, 0.28f, 0.26f, 0.30f, 0.30f); - new ArmorPlating("plateNaquadahAlloy", "plateNaquadahAlloy", 300, 0.33f, 0.33f, 0.33f, 0.33f, 0.33f); - new ArmorPlating("plateNeutronium", "plateNeutronium", 600, 0.50f, 0.50f, 0.50f, 0.50f, 0.50f); - - new ArmorComponentFunction("componentnightvision", GT_ModHandler.getIC2Item("nightvisionGoggles", 1), true, 100, StatType.NIGHTVISION, 100); - if(GT_ModHandler.getModItem("Thaumcraft", "ItemGoggles", 1)!=null)new ArmorComponentFunction("componentthaumicgoggles", GT_ModHandler.getModItem("Thaumcraft", "ItemGoggles", 1), true, 100, StatType.THAUMICGOGGLES, 100); - new ArmorComponentBattery("batteryLVLI", ItemList.Battery_RE_LV_Lithium.get(1, new Object[]{}), true, 100, 100000); - new ArmorComponentBattery("batteryMVLI", ItemList.Battery_RE_MV_Lithium.get(1, new Object[]{}), true, 100, 400000); - new ArmorComponentBattery("batteryHVLI", ItemList.Battery_RE_HV_Lithium.get(1, new Object[]{}), true, 100, 1600000); - - new ArmorComponentBattery("batteryLVCA", ItemList.Battery_RE_LV_Cadmium.get(1, new Object[]{}), true, 100, 75000); - new ArmorComponentBattery("batteryMVCA", ItemList.Battery_RE_MV_Cadmium.get(1, new Object[]{}), true, 100, 300000); - new ArmorComponentBattery("batteryHVCA", ItemList.Battery_RE_HV_Cadmium.get(1, new Object[]{}), true, 100, 1200000); - - new ArmorComponentBattery("batteryLVSO", ItemList.Battery_RE_LV_Sodium.get(1, new Object[]{}), true, 100, 50000); - new ArmorComponentBattery("batteryMVSO", ItemList.Battery_RE_MV_Sodium.get(1, new Object[]{}), true, 100, 200000); - new ArmorComponentBattery("batteryHVSO", ItemList.Battery_RE_HV_Sodium.get(1, new Object[]{}), true, 100, 800000); - - new ArmorComponentBattery("batterycystal", ItemList.IC2_EnergyCrystal.get(1, new Object[]{}), true, 100, 1000000); - new ArmorComponentBattery("batterylapotron", ItemList.IC2_LapotronCrystal.get(1, new Object[]{}), true, 100, 10000000); - new ArmorComponentBattery("batterylapoorb", ItemList.Energy_LapotronicOrb.get(1, new Object[]{}), true, 100, 100000000); - new ArmorComponentBattery("batteryorbcluster", ItemList.Energy_LapotronicOrb2.get(1, new Object[]{}), true, 100, 1000000000); - - new ArmorElectricComponent("motorlv", ItemList.Electric_Motor_LV.get(1, new Object[]{}), 20, StatType.MOTPRPOWER, 200f, StatType.MOTOREUUSAGE, 50f, StatType.PROCESSINGPOWERUSED, 10f); - new ArmorElectricComponent("motormv", ItemList.Electric_Motor_MV.get(1, new Object[]{}), 40, StatType.MOTPRPOWER, 300f, StatType.MOTOREUUSAGE, 100f, StatType.PROCESSINGPOWERUSED, 20f); - new ArmorElectricComponent("motorhv", ItemList.Electric_Motor_HV.get(1, new Object[]{}), 60, StatType.MOTPRPOWER, 400f, StatType.MOTOREUUSAGE, 200f, StatType.PROCESSINGPOWERUSED, 50f); - new ArmorElectricComponent("motorev", ItemList.Electric_Motor_EV.get(1, new Object[]{}), 80, StatType.MOTPRPOWER, 500f, StatType.MOTOREUUSAGE, 400f, StatType.PROCESSINGPOWERUSED, 100f); - new ArmorElectricComponent("motoriv", ItemList.Electric_Motor_IV.get(1, new Object[]{}),100, StatType.MOTPRPOWER, 600f, StatType.MOTOREUUSAGE, 800f, StatType.PROCESSINGPOWERUSED, 200f); - - new ArmorElectricComponent("pistonlv", ItemList.Electric_Piston_LV.get(1, new Object[]{}), 20, StatType.PISTONJUMPBOOST, 3, StatType.PISTONEUUSAGE, 200f, StatType.PROCESSINGPOWERUSED, 10f); - new ArmorElectricComponent("pistonmv", ItemList.Electric_Piston_MV.get(1, new Object[]{}), 40, StatType.PISTONJUMPBOOST, 4, StatType.PISTONEUUSAGE, 300f, StatType.PROCESSINGPOWERUSED, 20f); - new ArmorElectricComponent("pistonhv", ItemList.Electric_Piston_HV.get(1, new Object[]{}), 60, StatType.PISTONJUMPBOOST, 5, StatType.PISTONEUUSAGE, 450f, StatType.PROCESSINGPOWERUSED, 50f); - new ArmorElectricComponent("pistonev", ItemList.Electric_Piston_EV.get(1, new Object[]{}), 80, StatType.PISTONJUMPBOOST, 6, StatType.PISTONEUUSAGE, 800f, StatType.PROCESSINGPOWERUSED, 100f); - new ArmorElectricComponent("pistoniv", ItemList.Electric_Piston_IV.get(1, new Object[]{}),100, StatType.PISTONJUMPBOOST, 7, StatType.PISTONEUUSAGE,1600f, StatType.PROCESSINGPOWERUSED, 200f); - - new ArmorElectricComponent("electrolyzerlv", ItemList.Machine_LV_Electrolyzer.get(1, new Object[]{}), 20, StatType.ELECTROLYZERPROD, 10, StatType.ELECTROLYZEREUUSAGE, 1, StatType.PROCESSINGPOWERUSED, 50f); - new ArmorElectricComponent("electrolyzermv", ItemList.Machine_MV_Electrolyzer.get(1, new Object[]{}), 40, StatType.ELECTROLYZERPROD, 20, StatType.ELECTROLYZEREUUSAGE, 4, StatType.PROCESSINGPOWERUSED, 100f); - new ArmorElectricComponent("electrolyzerhv", ItemList.Machine_HV_Electrolyzer.get(1, new Object[]{}), 60, StatType.ELECTROLYZERPROD, 40, StatType.ELECTROLYZEREUUSAGE, 16, StatType.PROCESSINGPOWERUSED, 150f); - new ArmorElectricComponent("electrolyzerev", ItemList.Machine_EV_Electrolyzer.get(1, new Object[]{}), 80, StatType.ELECTROLYZERPROD, 80, StatType.ELECTROLYZEREUUSAGE, 64, StatType.PROCESSINGPOWERUSED, 200f); - new ArmorElectricComponent("electrolyzeriv", ItemList.Machine_IV_Electrolyzer.get(1, new Object[]{}),100, StatType.ELECTROLYZERPROD,160, StatType.ELECTROLYZEREUUSAGE, 128, StatType.PROCESSINGPOWERUSED, 250f); - - new ArmorElectricComponent("fieldgenlv", ItemList.Field_Generator_LV.get(1, new Object[]{}), 20, StatType.FIELDGENCAP, 1, StatType.FIELDGENEUUSAGE, 1, StatType.PROCESSINGPOWERUSED, 100f); - new ArmorElectricComponent("fieldgenmv", ItemList.Field_Generator_MV.get(1, new Object[]{}), 40, StatType.FIELDGENCAP, 2, StatType.FIELDGENEUUSAGE, 4, StatType.PROCESSINGPOWERUSED, 200f); - new ArmorElectricComponent("fieldgenhv", ItemList.Field_Generator_HV.get(1, new Object[]{}), 60, StatType.FIELDGENCAP, 3, StatType.FIELDGENEUUSAGE, 16, StatType.PROCESSINGPOWERUSED, 300f); - new ArmorElectricComponent("fieldgenev", ItemList.Field_Generator_EV.get(1, new Object[]{}), 80, StatType.FIELDGENCAP, 4, StatType.FIELDGENEUUSAGE, 64, StatType.PROCESSINGPOWERUSED, 400f); - new ArmorElectricComponent("fieldgeniv", ItemList.Field_Generator_IV.get(1, new Object[]{}),100, StatType.FIELDGENCAP, 5, StatType.FIELDGENEUUSAGE, 512, StatType.PROCESSINGPOWERUSED, 500f); - - new ArmorElectricComponent("cell", ItemList.Cell_Empty.get(1, new Object[]{}), 20, StatType.TANKCAP, 8000, null, 1, null, 0); - new ArmorElectricComponent("cellsteel", ItemList.Large_Fluid_Cell_Steel.get(1, new Object[]{}), 40, StatType.TANKCAP, 16000, null, 1, null, 0); - new ArmorElectricComponent("cellts", ItemList.Large_Fluid_Cell_TungstenSteel.get(1, new Object[]{}), 80, StatType.TANKCAP, 64000, null, 1, null, 0); - - new ArmorElectricComponent("circuitbasic", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1), 10, StatType.PROCESSINGPOWER, 100, null, 1, null, 1); - new ArmorElectricComponent("circuitgood", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1), 20, StatType.PROCESSINGPOWER, 200, null, 1, null, 1); - new ArmorElectricComponent("circuitadv", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1),30, StatType.PROCESSINGPOWER, 300, null, 1, null, 1); - new ArmorElectricComponent("circuitdata", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 1), 40, StatType.PROCESSINGPOWER, 400, null, 1, null, 1); - new ArmorElectricComponent("cicuitelite", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1), 50, StatType.PROCESSINGPOWER, 500, null, 1, null, 1); - new ArmorElectricComponent("cicuitmaster", GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1), 60, StatType.PROCESSINGPOWER, 600, null, 1, null, 1); - -// if (parts[i].getItem().getUnlocalizedName().equals("gte.meta.jetpack")) {// jeptack parts -// switch (parts[i].getItem().getDamage(parts[i])) { -// case 0: -// def[24] += 50; // JetpackFuelPower -// def[25] += 1; // FuelUsage -// def[31] += 10; -// break; -// case 1: -// def[24] += 75; // JetpackFuelPower -// def[25] += 2; // FuelUsage -// def[31] += 20; -// break; -// case 2: -// def[24] += 100; // JetpackFuelPower -// def[25] += 4; // FuelUsage -// def[31] += 30; -// break; -// case 3: -// def[24] += 125; // JetpackFuelPower -// def[25] += 8; // FuelUsage -// def[31] += 40; -// break; -// case 4: -// def[24] += 150; // JetpackFuelPower -// def[25] += 16; // FuelUsage -// def[31] += 50; -// break; -// case 5: -// def[26] += 20; // JetpackEUPower -// def[27] += 8; // JetpackEU -// def[31] += 30; -// break; -// case 6: -// def[26] += 30; // JetpackEUPower -// def[27] += 16; // JetpackEU -// def[31] += 60; -// break; -// case 7: -// def[26] += 40; // JetpackEUPower -// def[27] += 32; // JetpackEU -// def[31] += 90; -// break; -// case 8: -// def[26] += 50; // JetpackEUPower -// def[27] += 64; // JetpackEU -// def[31] += 120; -// break; -// case 9: -// def[26] += 60; // JetpackEUPower -// def[27] += 128; // JetpackEU -// def[31] += 150; -// break; -// case 10: -// def[28] += 100; // AntiGravPower -// def[29] += 32; // AntiGravEU -// def[31] += 100; -// break; -// case 11: -// def[28] += 133; // AntiGravPower -// def[29] += 64; // AntiGravEU -// def[31] += 200; -// break; -// case 12: -// def[28] += 166; // AntiGravPower -// def[29] += 128; // AntiGravEU -// def[31] += 300; -// break; -// case 13: -// def[28] += 200; // AntiGravPower -// def[29] += 256; // AntiGravEU -// def[31] += 400; -// break; -// case 14: -// def[28] += 233; // AntiGravPower -// def[29] += 512; // AntiGravEU -// def[31] += 500; -// break; -// } - - - int tCustomPlatings = GregTech_API.sModularArmor.get("custom", "CustomPlatings", 0); - int tCustomElectronicComponent = GregTech_API.sModularArmor.get("custom", "CustomElectronicComponent", 0); - int tCustomBattery = GregTech_API.sModularArmor.get("custom", "CustomBattery", 0); - int tCustomFunction = GregTech_API.sModularArmor.get("custom", "CustomFunction", 0); - for(int i = 0; i<tCustomPlatings; i++) - new ArmorPlating("customPlate"+i, "platenull_", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null, 0); - - for(int i = 0; i<tCustomElectronicComponent; i++) - new ArmorElectricComponent("customElectricComponent"+i,new ItemStack(Blocks.stone),0,null,0, null, 0, null, 0); - - for(int i = 0; i<tCustomBattery; i++) - new ArmorComponentBattery("customBattery"+i, new ItemStack(Blocks.stone),true, 0, 0); - - for(int i = 0; i<tCustomFunction; i++) - new ArmorComponentFunction("customFunction"+i, new ItemStack(Blocks.stone), true, 0, null, 0); - } -} diff --git a/src/main/java/gregtech/common/items/armor/components/StatType.java b/src/main/java/gregtech/common/items/armor/components/StatType.java deleted file mode 100644 index aacb997f9b..0000000000 --- a/src/main/java/gregtech/common/items/armor/components/StatType.java +++ /dev/null @@ -1,52 +0,0 @@ -package gregtech.common.items.armor.components; - -public enum StatType { - ELECTRIC, - ELECTRIC2, - - FULLARMOR, - FULLRADIATIONARMOR, - FULLELECTRICARMOR, - - FALLDEFENCE, - PHYSICALDEFENCE, - PROJECTILEDEFENCE, - FIREDEFENCE, - MAGICDEFENCE, - EXPLOSIONDEFENCE, - RADIATIONDEFENCE, - ELECTRICALDEFENCE, - WITHERDEFENCE, - - THORNS, - THORNSSINGLE, - MAGNET, - MAGNETSINGLE, - - THAUMICGOGGLES, - NIGHTVISION, - POTIONINJECTOR, - AUTOFEEDER, - - TANKCAP, - WEIGHT, - PROCESSINGPOWER, - PROCESSINGPOWERUSED, - PARTPROCESSING, - PARTPROCESSINGUSED, - - MOTPRPOWER, - MOTOREUUSAGE, - PISTONJUMPBOOST, - PISTONEUUSAGE, - ELECTROLYZERPROD, - ELECTROLYZEREUUSAGE, - FIELDGENCAP, - FIELDGENEUUSAGE, - JETPACKMAXWEIGHT, - ANTIGRAVMAXWEIGHT, - - PARTSCHARGE, - BATTERYCAPACITY; - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/ContainerBasicArmor.java b/src/main/java/gregtech/common/items/armor/gui/ContainerBasicArmor.java deleted file mode 100644 index a2ee329099..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/ContainerBasicArmor.java +++ /dev/null @@ -1,48 +0,0 @@ -package gregtech.common.items.armor.gui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerBasicArmor extends ContainerModularArmor { - - public ContainerBasicArmor(EntityPlayer player, InventoryArmor aInvArmor) { - super(player, aInvArmor); - } - - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new SlotArmor(mInvArmor, 0, 118, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 1, 136, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 2, 154, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 3, 118, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 4, 136, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 5, 154, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 6, 118, 42)); - addSlotToContainer(new SlotArmor(mInvArmor, 7, 136, 42)); - addSlotToContainer(new SlotArmor(mInvArmor, 8, 154, 42)); - - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (int i = 0; i < 9; i++) { - ItemStack stackInSlot = aInventoryPlayer.getStackInSlot(i); - if(isIdenticalItem(mInvArmor.parent,stackInSlot)){ - addSlotToContainer(new SlotLocked(aInventoryPlayer,i,8+i*18,142)); - }else{ - addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 142));} - } - } - - public int getSlotCount() { - return 9; - } - - public int getShiftClickSlotCount() { - return 9; - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/ContainerElectricArmor1.java b/src/main/java/gregtech/common/items/armor/gui/ContainerElectricArmor1.java deleted file mode 100644 index 02c8f016bb..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/ContainerElectricArmor1.java +++ /dev/null @@ -1,53 +0,0 @@ -package gregtech.common.items.armor.gui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerElectricArmor1 extends ContainerBasicArmor { - - public ContainerElectricArmor1(EntityPlayer player, InventoryArmor aInvArmor) { - super(player, aInvArmor); - } - - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new SlotArmor(mInvArmor, 0, 118, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 1, 136, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 2, 154, 6)); - addSlotToContainer(new SlotArmor(mInvArmor, 3, 118, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 4, 136, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 5, 154, 24)); - addSlotToContainer(new SlotArmor(mInvArmor, 6, 118, 42)); - addSlotToContainer(new SlotArmor(mInvArmor, 7, 136, 42)); - addSlotToContainer(new SlotArmor(mInvArmor, 8, 154, 42)); - addSlotToContainer(new SlotArmor(mInvArmor, 9, 118, 60)); - addSlotToContainer(new SlotArmor(mInvArmor, 10, 136, 60)); - addSlotToContainer(new SlotArmor(mInvArmor, 11, 154, 60)); - - addSlotToContainer(new SlotFluid(mInvArmor,12,94,32)); - - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (int i = 0; i < 9; i++) { - ItemStack stackInSlot = aInventoryPlayer.getStackInSlot(i); - if(isIdenticalItem(mInvArmor.parent,stackInSlot)){ - addSlotToContainer(new SlotLocked(aInventoryPlayer,i,8+i*18,142)); - }else{ - addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 142));} - } - } - - public int getSlotCount() { - return 12; - } - - public int getShiftClickSlotCount() { - return 12; - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/ContainerModularArmor.java b/src/main/java/gregtech/common/items/armor/gui/ContainerModularArmor.java deleted file mode 100644 index 1f63afac5e..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/ContainerModularArmor.java +++ /dev/null @@ -1,167 +0,0 @@ -package gregtech.common.items.armor.gui; - -import gregtech.common.items.armor.ArmorData; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public abstract class ContainerModularArmor extends Container { - - public InventoryArmor mInvArmor; - - public ContainerModularArmor(EntityPlayer player, InventoryArmor aInvArmor) { - this.mInvArmor = aInvArmor; - addSlots(player.inventory); - } - - public ArmorData getData(EntityPlayer aPlayer){ - return null; - } - - @Override - public boolean canInteractWith(EntityPlayer aPlayer) { - return true; - } - - public abstract void addSlots(InventoryPlayer aInventoryPlayer); - - public abstract int getSlotCount(); - - public abstract int getShiftClickSlotCount(); - - public void saveInventory(EntityPlayer entityplayer) { - mInvArmor.onGuiSaved(entityplayer); - } - - @Override - public void onContainerClosed(EntityPlayer player) { - super.onContainerClosed(player); - if (!player.worldObj.isRemote) { - saveInventory(player); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { - if (player == null) { - return null; - } - - ItemStack originalStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - int numSlots = inventorySlots.size(); - if (slot != null && slot.getHasStack()) { - ItemStack stackInSlot = slot.getStack(); - originalStack = stackInSlot.copy(); - if (slotIndex >= numSlots - 9 * 4 && tryShiftItem(stackInSlot, numSlots)) { - } else if (slotIndex >= numSlots - 9 * 4 && slotIndex < numSlots - 9) { - if (!shiftItemStack(stackInSlot, numSlots - 9, numSlots)) { - return null; - } - } else if (slotIndex >= numSlots - 9 && slotIndex < numSlots) { - if (!shiftItemStack(stackInSlot, numSlots - 9 * 4, numSlots - 9)) { - return null; - } - } else if (!shiftItemStack(stackInSlot, numSlots - 9 * 4, numSlots)) { - return null; - } - slot.onSlotChange(stackInSlot, originalStack); - if (stackInSlot.stackSize <= 0) { - slot.putStack(null); - } else { - slot.onSlotChanged(); - } - if (stackInSlot.stackSize == originalStack.stackSize) { - return null; - } - slot.onPickupFromSlot(player, stackInSlot); - } - return originalStack; - } - - private boolean tryShiftItem(ItemStack stackToShift, int numSlots) { - for (int machineIndex = 0; machineIndex < numSlots - 9 * 4; machineIndex++) { - Slot slot = (Slot) inventorySlots.get(machineIndex); - if (slot.getHasStack()) { - continue; - } - if(slot instanceof SlotLocked){ - continue; - } - if(slot instanceof SlotFluid){ - continue; - } - - if (!slot.isItemValid(stackToShift)) { - continue; - } - if (shiftItemStack(stackToShift, machineIndex, machineIndex + 1)) { - return true; - } - } - return false; - } - - protected boolean shiftItemStack(ItemStack stackToShift, int start, int end) { - boolean changed = false; - if (stackToShift.isStackable()) { - for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < end; slotIndex++) { - Slot slot = (Slot) inventorySlots.get(slotIndex); - ItemStack stackInSlot = slot.getStack(); - if (stackInSlot != null && isIdenticalItem(stackInSlot, stackToShift)) { - int resultingStackSize = stackInSlot.stackSize + stackToShift.stackSize; - int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); - if (resultingStackSize <= max) { - stackToShift.stackSize = 0; - stackInSlot.stackSize = resultingStackSize; - slot.onSlotChanged(); - changed = true; - } else if (stackInSlot.stackSize < max) { - stackToShift.stackSize -= max - stackInSlot.stackSize; - stackInSlot.stackSize = max; - slot.onSlotChanged(); - changed = true; - } - } - } - } - if (stackToShift.stackSize > 0) { - for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < end; slotIndex++) { - Slot slot = (Slot) inventorySlots.get(slotIndex); - ItemStack stackInSlot = slot.getStack(); - if (stackInSlot == null) { - int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); - stackInSlot = stackToShift.copy(); - stackInSlot.stackSize = Math.min(stackToShift.stackSize, max); - stackToShift.stackSize -= stackInSlot.stackSize; - slot.putStack(stackInSlot); - slot.onSlotChanged(); - changed = true; - } - } - } - return changed; - } - - public static boolean isIdenticalItem(ItemStack lhs, ItemStack rhs) { - if (lhs == null || rhs == null) { - return false; - } - - if (lhs.getItem() != rhs.getItem()) { - return false; - } - - if (lhs.getItemDamage() != OreDictionary.WILDCARD_VALUE) { - if (lhs.getItemDamage() != rhs.getItemDamage()) { - return false; - } - } - - return ItemStack.areItemStackTagsEqual(lhs, rhs); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/FluidSync.java b/src/main/java/gregtech/common/items/armor/gui/FluidSync.java deleted file mode 100644 index 0e17a82ee8..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/FluidSync.java +++ /dev/null @@ -1,58 +0,0 @@ -package gregtech.common.items.armor.gui; - -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; - -public class FluidSync /**implements IPacket**/ { - String playerName; - int amount; - String fluid; - -// @Override - public byte getPacketID() { - return 0; - } - - public FluidSync(String player, int amount, String fluid) { - this.playerName = player; - this.amount = amount; - this.fluid = fluid.toLowerCase(); - } - -// @Override - public ByteArrayDataOutput encode() { - ByteArrayDataOutput rOut = ByteStreams.newDataOutput(4); - rOut.writeUTF(playerName + ";" + amount + ";" + fluid); - return rOut; - } - -// @Override -// public IPacket decode(ByteArrayDataInput aData) { -// String tmp = aData.readUTF(); -// String[] tmp2 = tmp.split(";"); -// return new FluidSync(tmp2[0], Integer.parseInt(tmp2[1]), tmp2[2].toLowerCase()); -// } -// -// @Override -// public void process(IBlockAccess aWorld, INetworkHandler aNetworkHandler) { -// WorldServer[] worlds = DimensionManager.getWorlds(); -// EntityPlayer tmp; -// for (int i = 0; i < worlds.length; i++) { -// tmp = worlds[i].getPlayerEntityByName(playerName); -// if (tmp != null) { -// try { -// if (fluid.equals("null")) { -// tmp.openContainer.getSlot(12).putStack(null); -// } else { -// tmp.openContainer.getSlot(12).putStack(UT.Fluids.display(new FluidStack(FluidRegistry.getFluid(fluid), amount), true)); -// } -// tmp.openContainer.detectAndSendChanges(); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// } -// } -// } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/FluidSync2.java b/src/main/java/gregtech/common/items/armor/gui/FluidSync2.java deleted file mode 100644 index 6882e67268..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/FluidSync2.java +++ /dev/null @@ -1,57 +0,0 @@ -package gregtech.common.items.armor.gui; - -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; - -public class FluidSync2 /**implements IPacket**/ { - String playerName; - -// @Override - public byte getPacketID() { - return 1; - } - - public FluidSync2(String player) { - this.playerName = player; - } - -// @Override - public ByteArrayDataOutput encode() { - ByteArrayDataOutput rOut = ByteStreams.newDataOutput(4); - rOut.writeUTF(playerName); - return rOut; - } - -// @Override -// public IPacket decode(ByteArrayDataInput aData) { -// return new FluidSync2(aData.readUTF()); -// } -// -// @Override -// public void process(IBlockAccess aWorld, INetworkHandler aNetworkHandler) { -// WorldServer[] worlds = DimensionManager.getWorlds(); -// EntityPlayer tmp; -// for (int i = 0; i < worlds.length; i++) { -// tmp = worlds[i].getPlayerEntityByName(playerName); -// if (tmp != null) { -// try { -// ItemStack tmp2 = tmp.inventory.getItemStack(); -// ItemStack tmp3 = UT.Fluids.getContainerForFilledItem(tmp2, true); -// if (tmp2.stackSize <= 1) { -// tmp2 = null; -// } else { -// tmp2.stackSize--; -// } -// tmp.inventory.setItemStack(tmp2); -// if(tmp3!=null){ -// tmp3.stackSize=1; -// tmp.inventory.addItemStackToInventory(tmp3);} -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// } -// } -// } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/GuiElectricArmor1.java b/src/main/java/gregtech/common/items/armor/gui/GuiElectricArmor1.java deleted file mode 100644 index b1e08bc708..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/GuiElectricArmor1.java +++ /dev/null @@ -1,330 +0,0 @@ -package gregtech.common.items.armor.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_LanguageManager; -import gregtech.common.items.armor.components.StatType; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -@SideOnly(Side.CLIENT) -public class GuiElectricArmor1 extends GuiContainer { - ContainerModularArmor cont; - EntityPlayer player; - private int tab; - - public GuiElectricArmor1(ContainerModularArmor containerModularArmor, EntityPlayer aPlayer) { - super(containerModularArmor); - player = aPlayer; - cont = containerModularArmor; - tab = 0; - } - @Override - public void onGuiClosed() - { - cont.saveInventory(player); - super.onGuiClosed(); - }; - public String seperateNumber(long number){ - DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US); - DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); - symbols.setGroupingSeparator(' '); - return formatter.format(number); - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - int x2 = x - xStart; - int y2 = y - yStart; - drawTooltip(x2, y2 + 5); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1F, 1F, 1F, 1F); - this.mc.getTextureManager().bindTexture(new ResourceLocation("gregtech", "textures/gui/armorgui3x4.png")); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - //Draw background - drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - //Draw active arrows - drawTexturedModalRect(xStart + 10, yStart + 70, 219, 11, 14, 5); - //Draw active armor symbol - switch (cont.mInvArmor.data.type) { - case 0: - drawTexturedModalRect(xStart + 73, yStart + 68, 177, 10, 10, 9); - break; - case 1: - drawTexturedModalRect(xStart + 83, yStart + 68, 187, 10, 10, 9); - break; - case 2: - drawTexturedModalRect(xStart + 93, yStart + 68, 197, 10, 10, 9); - break; - case 3: - drawTexturedModalRect(xStart + 103, yStart + 68, 207, 10, 10, 9); - break; - default: - break; - } - //Draw active tab - switch(tab){ - case 0: - break; - case 1: - drawTexturedModalRect(xStart + 7, yStart + 14, 2, 167, 104, 54); - break; - case 2: - drawTexturedModalRect(xStart + 7, yStart + 14, 107, 167, 104, 54); - break; - default: - break; - } - float tankCap = cont.mInvArmor.data.mStat.containsKey(StatType.TANKCAP) ? cont.mInvArmor.data.mStat.get(StatType.TANKCAP) :0.0f; - if(tankCap>0){ - drawTexturedModalRect(xStart + 94, yStart + 32, 231, 69, 16, 34); - } - float weight = cont.mInvArmor.data.mStat.containsKey(StatType.WEIGHT) ? cont.mInvArmor.data.mStat.get(StatType.WEIGHT) : 0.0f; - int bar = (int) Math.floor(18 * (weight)/(float)1000); - drawTexturedModalRect(xStart + 15, yStart + 7, 217, 26, bar, 5); - drawTexturedModalRect(xStart + bar + 15, yStart + 7, 197+bar, 26, 18-bar, 5); - - if(tab==0){ - //processing power bar - bar = Math.min((int) Math.floor(52 * ((float)cont.mInvArmor.data.mStat.get(StatType.PROCESSINGPOWERUSED)/(float)cont.mInvArmor.data.mStat.get(StatType.PROCESSINGPOWER))),52); - drawTexturedModalRect(xStart + 17, yStart + 17, 177, 146, bar, 5); - drawTexturedModalRect(xStart + bar + 17, yStart + 17, 177+bar, 139, 52-bar, 5); - }else if(tab==1){ - - }else{ - //Def tab values - if(cont.mInvArmor.data.mStat.get(StatType.PHYSICALDEFENCE)>0)drawTexturedModalRect(xStart + 30, yStart + 20, 186, 33, 7, 7); - drawBars(31, 20, cont.mInvArmor.data.mStat.get(StatType.PHYSICALDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.PROJECTILEDEFENCE)>0)drawTexturedModalRect(xStart + 30, yStart + 29, 186, 42, 7, 7); - drawBars(31, 29, cont.mInvArmor.data.mStat.get(StatType.PROJECTILEDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.FIREDEFENCE)>0)drawTexturedModalRect(xStart + 30, yStart + 38, 186, 51, 7, 7); - drawBars(31, 38, cont.mInvArmor.data.mStat.get(StatType.FIREDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.MAGICDEFENCE)>0)drawTexturedModalRect(xStart + 30, yStart + 47, 186, 60, 7, 7); - drawBars(31, 47, cont.mInvArmor.data.mStat.get(StatType.MAGICDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.EXPLOSIONDEFENCE)>0)drawTexturedModalRect(xStart + 30, yStart + 56, 186, 69, 7, 7); - drawBars(31, 56, cont.mInvArmor.data.mStat.get(StatType.EXPLOSIONDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.RADIATIONDEFENCE)>0)drawTexturedModalRect(xStart + 61, yStart + 20, 186, 87, 7, 7); - drawBars(62, 20, cont.mInvArmor.data.mStat.get(StatType.RADIATIONDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.ELECTRICALDEFENCE)>0)drawTexturedModalRect(xStart + 61, yStart + 29, 186, 96, 7, 7); - drawBars(62, 29, cont.mInvArmor.data.mStat.get(StatType.ELECTRICALDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.WITHERDEFENCE)>0)drawTexturedModalRect(xStart + 61, yStart + 38, 186, 105, 7, 7); - drawBars(62, 38, cont.mInvArmor.data.mStat.get(StatType.WITHERDEFENCE)); - if(cont.mInvArmor.data.mStat.get(StatType.FALLDEFENCE)>0)drawTexturedModalRect(xStart + 61, yStart + 47, 186, 114, 7, 7); - if(cont.mInvArmor.data.mStat.get(StatType.THORNS)>0)drawTexturedModalRect(xStart + 61, yStart + 56, 186, 123, 7, 7); - if(cont.mInvArmor.data.mStat.get(StatType.MAGNET)>0)drawTexturedModalRect(xStart + 70, yStart + 56, 186, 78, 7, 7); - } - - - } - - protected void mouseClicked(int mouseX, int mouseY, int mouseBtn) { - int xStart = mouseX-((width - xSize) / 2); - int yStart = mouseY-((height - ySize) / 2); - if(yStart>68&&yStart<77){ - if(xStart>18&&xStart<26){ - tab++; - }else if(xStart>8&&xStart<17){ - tab--; - } - if(tab>2){tab=0;} - if(tab<0){tab=2;} - if(xStart>72&&xStart<112){ - if(xStart>72&&xStart<81&&cont.mInvArmor.data.helmet!=null){cont.mInvArmor.data.helmet.openGui=true;} - if(xStart>82&&xStart<91&&cont.mInvArmor.data.chestplate!=null){cont.mInvArmor.data.chestplate.openGui=true;} - if(xStart>92&&xStart<101&&cont.mInvArmor.data.leggings!=null){cont.mInvArmor.data.leggings.openGui=true;} - if(xStart>102&&xStart<112&&cont.mInvArmor.data.boots!=null){cont.mInvArmor.data.boots.openGui=true;} - -// if(xStart>72&&xStart<81&&cont.mInvArmor.data.helmet!=null){cont.mInvArmor.data.helmet.openGui=true;player.closeScreen();} -// if(xStart>82&&xStart<91&&cont.mInvArmor.data.chestplate!=null){cont.mInvArmor.data.chestplate.openGui=true;player.closeScreen();} -// if(xStart>92&&xStart<101&&cont.mInvArmor.data.leggings!=null){cont.mInvArmor.data.leggings.openGui=true;player.closeScreen();} -// if(xStart>102&&xStart<112&&cont.mInvArmor.data.boots!=null){cont.mInvArmor.data.boots.openGui=true;player.closeScreen();} - } - } -// Slot slot = getSlotAtPosition(mouseX, mouseY); -// if (slot != null && slot instanceof SlotFluid && player != null && cont.mInvArmor.data.helmet!=null) { -// ItemStack tmp = player.inventory.getItemStack(); -// //GT_Network gtn = new GT_Network(); -// if (tmp == null) { -// //GT_Values.NW.sendToServer(new FluidSync(player.getCommandSenderName(), 0, "null")); -// } -// //ArmorData armorData = new ArmorData(player,); -// if (tmp != null && tmp.getItem() instanceof IFluidContainerItem) { -// FluidStack tmp2 = ((IFluidContainerItem) tmp.getItem()).getFluid(tmp); -// if (!slot.getHasStack() && tmp2 != null) { -// slot.putStack(GT_Utility.getFluidDisplayStack(tmp2, true)); -// -// if(cont.mInvArmor.data.helmet.fluid == null) -// { -// cont.mInvArmor.data.helmet.fluid = new FluidStack(tmp2.getFluid(), tmp2.amount); -// } -// else -// { -// cont.mInvArmor.data.helmet.fluid.amount += tmp2.amount; -// } -// -// //GT_Values.NW.sendToServer(new FluidSync(player.getCommandSenderName(), tmp2.amount, GT_Utility.getFluidName(tmp2, false))); -// ItemStack tmp4 = GT_Utility.getContainerForFilledItem(tmp, true); -// tmp4.stackSize = 1; -// if (tmp.stackSize > 1) { -// player.inventory.addItemStackToInventory(tmp4); -// tmp.stackSize--; -// player.inventory.setItemStack(tmp); -// //GT_Values.NW.sendToServer(new FluidSync2(player.getCommandSenderName())); -// } else { -// player.inventory.setItemStack(null); -// player.inventory.addItemStackToInventory(tmp4); -// //GT_Values.NW.sendToServer(new FluidSync2(player.getCommandSenderName())); -// } -// -// } else if (slot.getHasStack() && tmp2 != null) { -// Item fluidSlot = slot.getStack().getItem(); -// if (fluidSlot.getDamage(slot.getStack()) == tmp2.getFluidID()) { -// NBTTagCompound nbt = slot.getStack().getTagCompound(); -// if (nbt != null) { -// tmp2.amount += nbt.getLong("mFluidDisplayAmount"); -// ItemStack tmp3 = player.inventory.getItemStack(); -// if (tmp3.stackSize <= 1) { -// tmp3 = null; -// } else { -// tmp3.stackSize--; -// } -// player.inventory.setItemStack(tmp3); -// //GT_Values.NW.sendToServer(new FluidSync2(player.getCommandSenderName())); -// slot.putStack(GT_Utility.getFluidDisplayStack(tmp2, true)); -// if(cont.mInvArmor.data.helmet.fluid == null) -// { -// cont.mInvArmor.data.helmet.fluid = new FluidStack(tmp2.getFluid(), tmp2.amount); -// } -// else -// { -// cont.mInvArmor.data.helmet.fluid.amount += tmp2.amount; -// } -// //GT_Values.NW.sendToServer(new FluidSync(player.getCommandSenderName(), tmp2.amount, GT_Utility.getFluidName(tmp2, false))); -// } -// } -// } -// } -// } - super.mouseClicked(mouseX, mouseY, mouseBtn); - } - - protected void drawTooltip(int x, int y) { - List<String> list = new ArrayList<String>(); - //General tooltips - if(x>=7&&y>=11&&x<=33&&y<=17){ - list.add(GT_LanguageManager.getTranslation("Weight") + ": " + cont.mInvArmor.data.mStat.get(StatType.WEIGHT)); - list.add("Total Weight: "+cont.mInvArmor.data.maxWeight); - if (cont.mInvArmor.data.mStat.get(StatType.WEIGHT) > 1000) - list.add("Too Heavy!"); - } - if(x>=56&&y>=11&&x<=112&&y<=17){ - list.add("Stored Energy: "+seperateNumber(cont.mInvArmor.data.charge)+" EU"); - } - if(y>74&&y<83){ - if(x>8&&x<17){ - list.add("Previous Page"); - }else if(x>18&&x<27){ - list.add("Next Page"); - }else if(x>72&&x<80){ - list.add("Helmet"); - }else if(x>81&&x<90){ - list.add("Chestplate"); - }else if(x>91&&x<100){ - list.add("Leggings"); - }else if(x>101&&x<110){ - list.add("Boots"); - } - } - if(tab==0){ - if(x>=93&&y>=36&&x<=110&&y<=71){list.add("Tank Capacity: "+cont.mInvArmor.data.mStat.get(StatType.TANKCAP)+"L"); - } - if(x>=7&&y>=22&&x<=70&&y<=28){list.add("Processing Power Provided: "+cont.mInvArmor.data.mStat.get(StatType.PROCESSINGPOWER)); - list.add("Processing Power Used: "+cont.mInvArmor.data.mStat.get(StatType.PROCESSINGPOWERUSED)); - } - }else if(tab==1){ - - }else{ - if (x >= 28 && x <= 58) { - if (y >= 25 && y <= 32) { - list.add(GT_LanguageManager.getTranslation("Physical Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.PHYSICALDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 33 && y <= 41) { - list.add(GT_LanguageManager.getTranslation("Projectile Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.PROJECTILEDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 42 && y <= 50) { - list.add(GT_LanguageManager.getTranslation("Fire Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.FIREDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 51 && y <= 59) { - list.add(GT_LanguageManager.getTranslation("Magical Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.MAGICDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 60 && y <= 68) { - list.add(GT_LanguageManager.getTranslation("Explosion Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.EXPLOSIONDEFENCE) * 1000) / 10.0) + "%"); - } - } else if (x >= 59 && x <= 90) { - if (y >= 25 && y <= 32) { - list.add(GT_LanguageManager.getTranslation("Radiation Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.RADIATIONDEFENCE) * 1000) / 10.0) + "%"); - if(cont.mInvArmor.data.mBStat.get(StatType.FULLRADIATIONARMOR)){ - list.add(GT_LanguageManager.getTranslation("Radiation Immunity"));} - } else if (y >= 33 && y <= 41) { - list.add(GT_LanguageManager.getTranslation("Electrical Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.ELECTRICALDEFENCE) * 1000) / 10.0) + "%"); - if(cont.mInvArmor.data.mBStat.get(StatType.FULLELECTRICARMOR)){ - list.add(GT_LanguageManager.getTranslation("Electric Immunity"));} - } else if (y >= 42 && y <= 50) { - list.add(GT_LanguageManager.getTranslation("Wither Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.WITHERDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 51 && y <= 59) { - if(cont.mInvArmor.data.type!=3){ - list.add(GT_LanguageManager.getTranslation("Fall Damage absorbtion")); - list.add(GT_LanguageManager.getTranslation("Only for Boots")); - }else{ - list.add(GT_LanguageManager.getTranslation("Absorbs") + " " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.FALLDEFENCE)) + GT_LanguageManager.getTranslation("m of Fall Damage"));} - } else if (y >= 60 && y <= 68) { - if(x<69){ - list.add(GT_LanguageManager.getTranslation("Thorns") + ": " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.THORNSSINGLE)) + " Dmg"); - list.add(GT_LanguageManager.getTranslation("Total Thorns") + ": " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.THORNS)) + " Dmg"); - }else{ - list.add(GT_LanguageManager.getTranslation("Magnet") + ": " + cont.mInvArmor.data.mStat.get(StatType.MAGNETSINGLE) + " m"); - list.add(GT_LanguageManager.getTranslation("Total Magnet") + ": " + cont.mInvArmor.data.mStat.get(StatType.MAGNET) + " m");} - } - } - } - if (!list.isEmpty()) - drawHoveringText(list, x, y, fontRendererObj); - } - - public void drawBars(int x, int y, float value) { - - int bar = (int) Math.floor(18 * value); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - xStart += 8; - yStart += 1; - drawTexturedModalRect(xStart + x, yStart + y, 217, 26, bar, 5); - drawTexturedModalRect(xStart+ bar + x, yStart + y, 197+bar, 26, 18-bar, 5); - } - - protected Slot getSlotAtPosition(int p_146975_1_, int p_146975_2_) { - for (int k = 0; k < cont.inventorySlots.size(); ++k) { - Slot slot = (Slot) cont.inventorySlots.get(k); - if (this.isMouseOverSlot(slot, p_146975_1_, p_146975_2_)) { - return slot; - } - } - return null; - } - - private boolean isMouseOverSlot(Slot p_146981_1_, int p_146981_2_, int p_146981_3_) { - return this.func_146978_c(p_146981_1_.xDisplayPosition, p_146981_1_.yDisplayPosition, 16, 16, p_146981_2_, p_146981_3_); - } -} diff --git a/src/main/java/gregtech/common/items/armor/gui/GuiModularArmor.java b/src/main/java/gregtech/common/items/armor/gui/GuiModularArmor.java deleted file mode 100644 index 9d552f4d2c..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/GuiModularArmor.java +++ /dev/null @@ -1,200 +0,0 @@ -package gregtech.common.items.armor.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_LanguageManager; -import gregtech.common.items.armor.components.StatType; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -import java.util.ArrayList; -import java.util.List; - -@SideOnly(Side.CLIENT) -public class GuiModularArmor extends GuiContainer { - ContainerModularArmor cont; - EntityPlayer player; - - public GuiModularArmor(ContainerModularArmor containerModularArmor,EntityPlayer aPlayer) { - super(containerModularArmor); - cont = containerModularArmor; - this.player = aPlayer; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - int x2 = x - xStart; - int y2 = y - yStart; - drawTooltip(x2, y2 + 5); - } - - protected void drawTooltip(int x, int y) { - List<String> list = new ArrayList<String>(); - if (x >= 10 && x <= 17) { - if (y >= 20 && y <= 27) { - list.add(GT_LanguageManager.getTranslation("Weight") + ": " + cont.mInvArmor.data.mStat.get(StatType.WEIGHT)); - list.add("Total Weight: "+cont.mInvArmor.data.maxWeight); - if (cont.mInvArmor.data.mStat.get(StatType.WEIGHT) > 1000) - list.add("Too Heavy!"); - } else if (y >= 29 && y <= 36) { - list.add(GT_LanguageManager.getTranslation("Physical Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.PHYSICALDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 38 && y <= 45) { - list.add(GT_LanguageManager.getTranslation("Projectile Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.PROJECTILEDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 47 && y <= 54) { - list.add(GT_LanguageManager.getTranslation("Fire Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.FIREDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 56 && y <= 63) { - list.add(GT_LanguageManager.getTranslation("Magic Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.MAGICDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 65 && y <= 72) { - list.add(GT_LanguageManager.getTranslation("Explosion Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.EXPLOSIONDEFENCE) * 1000) / 10.0) + "%"); - } - } else if (x >= 59 && x <= 66) { - if (y >= 20 && y <= 27) { - list.add(GT_LanguageManager.getTranslation("Thorns") + ": " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.THORNSSINGLE)) + " Dmg"); - list.add(GT_LanguageManager.getTranslation("Total Thorns") + ": " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.THORNS)) + " Dmg"); - } else if (y >= 29 && y <= 36) { - list.add(GT_LanguageManager.getTranslation("Magnet") + ": " + cont.mInvArmor.data.mStat.get(StatType.MAGNETSINGLE) + " m"); - list.add(GT_LanguageManager.getTranslation("Total Magnet") + ": " + cont.mInvArmor.data.mStat.get(StatType.MAGNET) + " m"); - } else if (y >= 38 && y <= 45) { - list.add(GT_LanguageManager.getTranslation("Radiation Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.RADIATIONDEFENCE) * 1000) / 10.0) + "%"); - if(cont.mInvArmor.data.mBStat.get(StatType.FULLRADIATIONARMOR)){ - list.add(GT_LanguageManager.getTranslation("Radiation Immunity"));} - } else if (y >= 47 && y <= 54) { - list.add(GT_LanguageManager.getTranslation("Electrical Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.ELECTRICALDEFENCE) * 1000) / 10.0) + "%"); - if(cont.mInvArmor.data.mBStat.get(StatType.FULLELECTRICARMOR)){ - list.add("Electric Immunity");} - } else if (y >= 56 && y <= 63) { - list.add(GT_LanguageManager.getTranslation("Wither Defence") + ": " + (Math.round(cont.mInvArmor.data.mStat.get(StatType.WITHERDEFENCE) * 1000) / 10.0) + "%"); - } else if (y >= 65 && y <= 72) { - if(cont.mInvArmor.data.type!=3){ - list.add(GT_LanguageManager.getTranslation("Fall Damage absorbtion")); - list.add(GT_LanguageManager.getTranslation("Only for Boots")); - }else{ - list.add(GT_LanguageManager.getTranslation("Absorbs") + " " + (int) Math.round(cont.mInvArmor.data.mStat.get(StatType.FALLDEFENCE)) + GT_LanguageManager.getTranslation("m of Fall Damage"));} - } - } - if (!list.isEmpty()) - drawHoveringText(list, x, y, fontRendererObj); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1F, 1F, 1F, 1F); - this.mc.getTextureManager().bindTexture(new ResourceLocation("gregtech", "textures/gui/armorgui3x3.png")); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - - switch (cont.mInvArmor.data.type) { - case 0: - drawTexturedModalRect(xStart + 124, yStart + 67, 177, 10, 10, 9); - break; - case 1: - drawTexturedModalRect(xStart + 134, yStart + 67, 187, 10, 10, 9); - break; - case 2: - drawTexturedModalRect(xStart + 144, yStart + 67, 197, 10, 10, 9); - break; - case 3: - drawTexturedModalRect(xStart + 154, yStart + 67, 207, 10, 10, 9); - break; - default: - break; - } - - // Weight: 10, 15 =191, 20 - if(getF(StatType.WEIGHT)>0){ - drawTexturedModalRect(xStart + 10, yStart + 15, 191, 20, 7, 7); - } - // Physical Def: 10, 24 =191, 29 - if(getF(StatType.PHYSICALDEFENCE)>0){ - drawTexturedModalRect(xStart + 10, yStart + 24, 191, 29, 7, 7); - } - // Projectile Def: 10, 33 =191, 38 - if(getF(StatType.PROJECTILEDEFENCE)>0){ - drawTexturedModalRect(xStart + 10, yStart + 33, 191, 38, 7, 7); - } - // Fire Def: 10, 42 =191, 47 - if(getF(StatType.FIREDEFENCE)>0){ - drawTexturedModalRect(xStart + 10, yStart + 42, 191, 47, 7, 7); - } - // Magic Def: 10, 51 =191, 56 - if(getF(StatType.MAGICDEFENCE)>0){ - drawTexturedModalRect(xStart + 10, yStart + 51, 191, 56, 7, 7); - } - // Explosive Def: 10, 60 =191, 65 - if(getF(StatType.EXPLOSIONDEFENCE)>0){ - drawTexturedModalRect(xStart + 10, yStart + 60, 191, 65, 7, 7); - } - // Thorns: 59, 15 =198, 20 - if(getF(StatType.THORNS)>0){ - drawTexturedModalRect(xStart + 59, yStart + 15, 198, 20, 7, 7); - } - // Magnet: 59, 24 =198, 29 - if(getF(StatType.MAGNETSINGLE)>0){ - drawTexturedModalRect(xStart + 59, yStart + 24, 198, 29, 7, 7); - } - // Radiation Def: 59, 33 =198, 38 - if(getF(StatType.RADIATIONDEFENCE)>0){ - drawTexturedModalRect(xStart + 59, yStart + 33, 198, 38, 7, 7); - } - // Electric Def: 59, 42 =198, 47 - if(getF(StatType.ELECTRICALDEFENCE)>0){ - drawTexturedModalRect(xStart + 59, yStart + 42, 198, 47, 7, 7); - } - // Wither Def: 59, 51 =198, 56 - if(getF(StatType.WITHERDEFENCE)>0){ - drawTexturedModalRect(xStart + 59, yStart + 51, 198, 56, 7, 7); - } - // Fall Reduction: 59, 60 =198, 65 - if(getF(StatType.FALLDEFENCE)>0){ - drawTexturedModalRect(xStart + 59, yStart + 60, 198, 65, 7, 7); - } - - drawBars(10, 24, getF(StatType.PHYSICALDEFENCE)); - drawBars(10, 33, getF(StatType.PROJECTILEDEFENCE)); - drawBars(10, 42, getF(StatType.FIREDEFENCE)); - drawBars(10, 51, getF(StatType.MAGICDEFENCE)); - drawBars(10, 60, getF(StatType.EXPLOSIONDEFENCE)); - drawBars(59, 33, getF(StatType.RADIATIONDEFENCE)); - drawBars(59, 42, getF(StatType.ELECTRICALDEFENCE)); - drawBars(59, 51, getF(StatType.WITHERDEFENCE)); - } - - public float getF(StatType aType){ - if(cont.mInvArmor.data.mStat.containsKey(aType)) - return cont.mInvArmor.data.mStat.get(aType); - return .0f; - } - - public void drawBars(int x, int y, float value) { - - int bar = (int) Math.floor(35 * value); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - xStart += 8; - yStart += 1; - //drawRect(x + xStart, y + yStart, x + bar + xStart, y + 5 + yStart, 0x8000FF00); - //drawRect(x + bar + xStart, y + yStart, x + 36 + xStart, y + 5 + yStart, 0x80FF0000); - drawTexturedModalRect(xStart + x, yStart + y, 177, 78, bar, 5); - drawTexturedModalRect(xStart+ bar + x, yStart + y, 177, 73, 35-bar, 5); - } - - protected void mouseClicked(int mouseX, int mouseY, int mouseBtn) { - int xStart = mouseX-((width - xSize) / 2); - int yStart = mouseY-((height - ySize) / 2); - if(yStart>67&&yStart<77){ - if(xStart>124&&xStart<163){ - if(xStart>124&&xStart<133&&cont.mInvArmor.data.helmet!=null){cont.mInvArmor.data.helmet.openGui=true;} - if(xStart>134&&xStart<143&&cont.mInvArmor.data.chestplate!=null){cont.mInvArmor.data.chestplate.openGui=true;} - if(xStart>144&&xStart<153&&cont.mInvArmor.data.leggings!=null){cont.mInvArmor.data.leggings.openGui=true;} - if(xStart>154&&xStart<163&&cont.mInvArmor.data.boots!=null){cont.mInvArmor.data.boots.openGui=true;} - } - } - super.mouseClicked(mouseX, mouseY, mouseBtn); - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java b/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java deleted file mode 100644 index 4615f29de5..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/InventoryArmor.java +++ /dev/null @@ -1,233 +0,0 @@ -package gregtech.common.items.armor.gui; - -import gregtech.common.items.armor.ArmorData; -import gregtech.common.items.armor.ModularArmor_Item; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.oredict.OreDictionary; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -public class InventoryArmor implements IInventory { - - public ItemStack[] parts; - public ItemStack parent; -// float[] def = new float[32]; - public int maxCharge; - public int charge; - public ArmorData data; - - public InventoryArmor(Class<ModularArmor_Item> class1, ItemStack currentEquippedItem) { - this.parts = new ItemStack[16]; - this.parent = currentEquippedItem; - setUID(false); - readFromNBT(currentEquippedItem.getTagCompound()); -// for (int i = 0; i < def.length; i++) { -// def[i] = 0.0f; -// } - if(currentEquippedItem.getItem() instanceof ModularArmor_Item){ - data = ((ModularArmor_Item)currentEquippedItem.getItem()).data; - } - - } - - @Override - public int getSizeInventory() { - return this.parts.length; - } - - @Override - public ItemStack getStackInSlot(int i) { - return parts[i]; - } - - @Override - public ItemStack decrStackSize(int i, int j) { - if (parts[i] == null) { - return null; - } - - ItemStack product; - if (parts[i].stackSize <= j) { - product = parts[i]; - parts[i] = null; -// def = ArmorCalculation.calculateArmor(parts); - data.calculateArmor(parts); - return product; - } else { - product = parts[i].splitStack(j); - if (parts[i].stackSize == 0) { - parts[i] = null; - } -// def = ArmorCalculation.calculateArmor(parts); - data.calculateArmor(parts); - return product; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - if (parts[slot] == null) { - return null; - } - ItemStack toReturn = parts[slot]; - parts[slot] = null; - return toReturn; - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - parts[i] = itemstack; -// def = ArmorCalculation.calculateArmor(parts); - data.calculateArmor(parts); - } - - @Override - public String getInventoryName() { - return "container.armor"; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public void markDirty() { - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return true; - } - - public void onGuiSaved(EntityPlayer entityplayer) { - parent = findParentInInventory(entityplayer); - if (parent != null) { - save(); - } - } - - public void save() { - NBTTagCompound nbt = parent.getTagCompound(); - if (nbt == null) { - nbt = new NBTTagCompound(); - } - writeToNBT(nbt); - ModularArmor_Item tmp = (ModularArmor_Item) parent.getItem(); - tmp.data.calculateArmor(parts); - parent.setTagCompound(nbt); - } - - public void writeToNBT(NBTTagCompound nbt) { - NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < parts.length; i++) { - if (parts[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - parts[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - nbt.setTag("Items", nbttaglist); - } - - public ItemStack findParentInInventory(EntityPlayer player) { - for (int i = 0; i < player.inventory.getSizeInventory(); i++) { - ItemStack stack = player.inventory.getStackInSlot(i); - if (isIdenticalItem(stack, parent)) { - return stack; - } - } - return parent; - } - - public static boolean isIdenticalItem(ItemStack lhs, ItemStack rhs) { - if (lhs == null || rhs == null) { - return false; - } - - if (lhs.getItem() != rhs.getItem()) { - return false; - } - - if (lhs.getItemDamage() != OreDictionary.WILDCARD_VALUE) { - if (lhs.getItemDamage() != rhs.getItemDamage()) { - return false; - } - } - - return ItemStack.areItemStackTagsEqual(lhs, rhs); - } - - public void readFromNBT(NBTTagCompound nbt) { - if (nbt == null) { - return; - } - if (nbt.hasKey("Items")) { - NBTTagList nbttaglist = nbt.getTagList("Items", 10); - parts = new ItemStack[getSizeInventory()]; - for (int i = 0; i < nbttaglist.tagCount(); i++) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte byte0 = nbttagcompound1.getByte("Slot"); - if (byte0 >= 0 && byte0 < parts.length) { - parts[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - //parts[12]= UT.Fluids.display(UT.Fluids.water(1234), true); - } - } - } - - } - - protected void setUID(boolean override) { - if (parent.getTagCompound() == null) { - parent.setTagCompound(new NBTTagCompound()); - } - NBTTagCompound nbt = parent.getTagCompound(); - if (override || !nbt.hasKey("UID")) { - nbt.setInteger("UID", XSTR_INSTANCE.nextInt()); - } - } - - public static int getOccupiedSlotCount(ItemStack itemStack) { - NBTTagCompound nbt = itemStack.getTagCompound(); - if (nbt == null) { - return 0; - } - - int count = 0; - if (nbt.hasKey("Items")) { - NBTTagList nbttaglist = nbt.getTagList("Items", 10); - for (int i = 0; i < nbttaglist.tagCount(); i++) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - ItemStack itemStack1 = ItemStack.loadItemStackFromNBT(nbttagcompound1); - if (itemStack1 != null && itemStack1.stackSize > 0) { - count++; - } - } - } - return count; - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/SlotArmor.java b/src/main/java/gregtech/common/items/armor/gui/SlotArmor.java deleted file mode 100644 index 8e6d2d41e8..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/SlotArmor.java +++ /dev/null @@ -1,18 +0,0 @@ -package gregtech.common.items.armor.gui; - -import gregtech.common.items.armor.components.ArmorComponent; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotArmor extends Slot{ - - public SlotArmor(IInventory par1iInventory, int par2, int par3, int par4) { - super(par1iInventory, par2, par3, par4); - } - - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return ArmorComponent.mStacks.containsKey(par1ItemStack.getUnlocalizedName()); - } -} diff --git a/src/main/java/gregtech/common/items/armor/gui/SlotFluid.java b/src/main/java/gregtech/common/items/armor/gui/SlotFluid.java deleted file mode 100644 index 63e8873df9..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/SlotFluid.java +++ /dev/null @@ -1,26 +0,0 @@ -package gregtech.common.items.armor.gui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotFluid extends Slot{ - - public SlotFluid(IInventory inventory, int slot_index, int x, int y) { - super(inventory, slot_index, x, y); - } - - @Override - public boolean canTakeStack(EntityPlayer p_82869_1_) - { - return false; - } - - @Override - public boolean isItemValid(ItemStack p_75214_1_) - { - return false; - } - -} diff --git a/src/main/java/gregtech/common/items/armor/gui/SlotLocked.java b/src/main/java/gregtech/common/items/armor/gui/SlotLocked.java deleted file mode 100644 index 14012d7674..0000000000 --- a/src/main/java/gregtech/common/items/armor/gui/SlotLocked.java +++ /dev/null @@ -1,33 +0,0 @@ -package gregtech.common.items.armor.gui; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - - -public class SlotLocked extends Slot{ - - public SlotLocked(IInventory par1iInventory, int par2, int par3, int par4) { - super(par1iInventory, par2, par3, par4); - } - @Override - public void onPickupFromSlot(EntityPlayer player, ItemStack itemStack) { - } - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } - @Override - public boolean getHasStack() { - return false; - } - @Override - public ItemStack decrStackSize(int i) { - return null; - } - - @Override - public boolean canTakeStack(EntityPlayer stack) { - return false;} - -} diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java index 1ebd3c0d16..1ff076dd78 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java @@ -17,8 +17,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -public class Behaviour_Arrow - extends Behaviour_None { +public class Behaviour_Arrow extends Behaviour_None { public static Behaviour_Arrow DEFAULT_WOODEN = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.0F, 6.0F); public static Behaviour_Arrow DEFAULT_PLASTIC = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.5F, 6.0F); private final int mLevel; @@ -39,6 +38,7 @@ public class Behaviour_Arrow this.mLevel = aLevel; } + @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { if ((aEntity instanceof EntityLivingBase)) { GT_Utility.GT_EnchantmentHelper.applyBullshitA((EntityLivingBase) aEntity, aPlayer, aStack); @@ -54,6 +54,7 @@ public class Behaviour_Arrow return false; } + @Override public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) { if ((this.mEnchantment != null) && (this.mLevel > 0)) { NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack); @@ -66,10 +67,12 @@ public class Behaviour_Arrow return true; } + @Override public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) { return true; } + @Override public ItemStack onDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) { World aWorld = aSource.getWorld(); IPosition tPosition = BlockDispenser.func_149939_a(aSource); @@ -88,10 +91,12 @@ public class Behaviour_Arrow return super.onDispense(aItem, aSource, aStack); } + @Override public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack) { return aProjectileType == SubTag.PROJECTILE_ARROW; } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; @@ -101,6 +106,7 @@ public class Behaviour_Arrow return rArrow; } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java index 000937b4de..d6f035119d 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java @@ -12,8 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -public class Behaviour_Arrow_Potion - extends Behaviour_Arrow { +public class Behaviour_Arrow_Potion extends Behaviour_Arrow { private final int[] mPotions; public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, int... aPotions) { @@ -26,6 +25,7 @@ public class Behaviour_Arrow_Potion this.mPotions = aPotions; } + @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { if ((aEntity instanceof EntityLivingBase)) { for (int i = 3; i < this.mPotions.length; i += 4) { @@ -37,6 +37,7 @@ public class Behaviour_Arrow_Potion return super.onLeftClickEntity(aItem, aStack, aPlayer, aEntity); } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; @@ -47,6 +48,7 @@ public class Behaviour_Arrow_Potion return rArrow; } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { if (!hasProjectile(aItem, aProjectileType, aStack)) { return null; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java index 1fe66cb723..4b6bd48a9e 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java @@ -10,8 +10,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class Behaviour_Crowbar - extends Behaviour_None { +public class Behaviour_Crowbar extends Behaviour_None { private final int mVanillaCosts; private final int mEUCosts; @@ -20,6 +19,7 @@ public class Behaviour_Crowbar this.mEUCosts = aEUCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java index 0943a9b9e2..b909593694 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java @@ -8,8 +8,7 @@ import net.minecraft.nbt.NBTTagList; import java.util.List; -public class Behaviour_DataOrb - extends Behaviour_None { +public class Behaviour_DataOrb extends Behaviour_None { public static void copyInventory(ItemStack[] aInventory, ItemStack[] aNewContent, int aIndexlength) { for (int i = 0; i < aIndexlength; i++) { if (aNewContent[i] == null) { @@ -93,6 +92,7 @@ public class Behaviour_DataOrb return tNBT; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { if (!(getDataTitle(aStack).length() == 0)) { aList.add(getDataTitle(aStack)); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java index 42de464b17..e7792aa94b 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java @@ -6,8 +6,8 @@ import net.minecraft.item.ItemStack; import java.util.List; -public class Behaviour_DataStick - extends Behaviour_None { +public class Behaviour_DataStick extends Behaviour_None { + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { String tString = GT_Utility.ItemNBT.getBookTitle(aStack); if (GT_Utility.isStringValid(tString)) { diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java index a03332057d..882f136cfa 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java @@ -5,6 +5,7 @@ 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_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -15,8 +16,7 @@ import net.minecraftforge.event.entity.player.UseHoeEvent; import java.util.List; -public class Behaviour_Hoe - extends Behaviour_None { +public class Behaviour_Hoe extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.hoe", "Can till Dirt"); @@ -24,6 +24,7 @@ public class Behaviour_Hoe this.mCosts = aCosts; } + @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) { return false; @@ -40,7 +41,13 @@ public class Behaviour_Hoe } Block aBlock = aWorld.getBlock(aX, aY, aZ); if ((aSide != 0) && (GT_Utility.isBlockAir(aWorld, aX, aY + 1, aZ)) && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) { - aWorld.playSoundEffect(aX + 0.5F, aY + 0.5F, aZ + 0.5F, Blocks.farmland.stepSound.getStepResourcePath(), (Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F, Blocks.farmland.stepSound.getPitch() * 0.8F); + new WorldSpawnedEventBuilder.SoundEventBuilder() + .setVolume((Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F) + .setPitch(Blocks.farmland.stepSound.getPitch() * 0.8F) + .setIdentifier(Blocks.farmland.stepSound.getStepResourcePath()) + .setPosition(aX + 0.5F, aY + 0.5F, aZ + 0.5F) + .setWorld(aWorld) + .run(); if (aWorld.isRemote) { return true; } @@ -53,6 +60,7 @@ public class Behaviour_Hoe return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java index e0559ae324..a4a060074b 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java @@ -17,8 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.List; -public class Behaviour_Lighter - extends Behaviour_None { +public class Behaviour_Lighter extends Behaviour_None { private final ItemStack mEmptyLighter; private final ItemStack mUsedLighter; private final ItemStack mFullLighter; @@ -34,6 +33,7 @@ public class Behaviour_Lighter this.mFuelAmount = aFuelAmount; } + @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { if ((aPlayer.worldObj.isRemote) || (aStack.stackSize != 1)) { return false; @@ -43,7 +43,7 @@ public class Behaviour_Lighter prepare(aStack); long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) { - GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String) GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ)); + GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ)); ((EntityCreeper) aEntity).func_146079_cb(); if (!aPlayer.capabilities.isCreativeMode) { tFuelAmount -= 1L; @@ -58,10 +58,12 @@ public class Behaviour_Lighter return rOutput; } + @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((aWorld.isRemote) || (aStack.stackSize != 1)) { return false; @@ -78,7 +80,7 @@ public class Behaviour_Lighter prepare(aStack); long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) { - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, Blocks.fire); if (!aPlayer.capabilities.isCreativeMode) { tFuelAmount -= 1L; @@ -109,6 +111,7 @@ public class Behaviour_Lighter } } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); NBTTagCompound tNBT = aStack.getTagCompound(); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java index a55cbff4ca..ad037ed13c 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_None.java @@ -18,39 +18,47 @@ import net.minecraft.world.World; import java.util.List; -public class Behaviour_None - implements IItemBehaviour<GT_MetaBase_Item> { +public class Behaviour_None implements IItemBehaviour<GT_MetaBase_Item> { + @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { return false; } + @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { return false; } + @Override public ItemStack onItemRightClick(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) { return aStack; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { return aList; } + @Override public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { } + @Override public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) { return true; } + @Override public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) { return false; } + @Override public ItemStack onDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) { EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); IPosition iposition = BlockDispenser.func_149939_a(aSource); @@ -59,14 +67,17 @@ public class Behaviour_None return aStack; } + @Override public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack) { return false; } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { return null; } + @Override public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { return null; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java index ef364b4cdc..63f922bcec 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java @@ -14,8 +14,7 @@ import thaumcraft.api.aspects.IEssentiaTransport; import java.util.List; -public class Behaviour_Plunger_Essentia - extends Behaviour_None { +public class Behaviour_Plunger_Essentia extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.essentia", "Clears Essentia from Containers and Tubes"); @@ -23,6 +22,7 @@ public class Behaviour_Plunger_Essentia this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -30,7 +30,7 @@ public class Behaviour_Plunger_Essentia TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (((aTileEntity instanceof IEssentiaTransport)) && ( (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { ((IEssentiaTransport) aTileEntity).takeEssentia(((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), tDirection); } @@ -39,6 +39,7 @@ public class Behaviour_Plunger_Essentia return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java index 0ff54e2168..16df231b43 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java @@ -17,8 +17,7 @@ import net.minecraftforge.fluids.IFluidHandler; import java.util.List; -public class Behaviour_Plunger_Fluid - extends Behaviour_None { +public class Behaviour_Plunger_Fluid extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks"); @@ -26,6 +25,7 @@ public class Behaviour_Plunger_Fluid this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -36,7 +36,7 @@ public class Behaviour_Plunger_Fluid if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IFluidHandler) aTileEntity).drain(tDirection, 1000, true); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); return true; } } @@ -50,13 +50,14 @@ public class Behaviour_Plunger_Fluid GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity; if(machine.mFluid!=null&&machine.mFluid.amount>0) machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); return true; } } return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java index 5fd46ab2fe..43a95fd2c7 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java @@ -17,8 +17,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.concurrent.ConcurrentHashMap; -public class Behaviour_Plunger_Item - extends Behaviour_None { +public class Behaviour_Plunger_Item extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes"); @@ -26,6 +25,7 @@ public class Behaviour_Plunger_Item this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -49,7 +49,7 @@ public class Behaviour_Plunger_Item tEntity.motionY = 0.0D; tEntity.motionZ = 0.0D; aWorld.spawnEntityInWorld(tEntity); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -61,6 +61,7 @@ public class Behaviour_Plunger_Item return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java index 287ebedd33..cdbd5e4424 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java @@ -7,8 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.List; -public class Behaviour_PrintedPages - extends Behaviour_None { +public class Behaviour_PrintedPages extends Behaviour_None { public static String getTitle(ItemStack aStack) { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT == null) { @@ -25,6 +24,7 @@ public class Behaviour_PrintedPages return tNBT.getString("author"); } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { if (GT_Utility.isStringValid(getTitle(aStack))) { aList.add(getTitle(aStack)); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java index f232fa8043..e56bd198b7 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java @@ -25,8 +25,7 @@ import net.minecraftforge.fluids.IFluidBlock; import java.util.List; import java.util.Random; -public class Behaviour_Prospecting - extends Behaviour_None { +public class Behaviour_Prospecting extends Behaviour_None { private final int mVanillaCosts; private final int mEUCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); @@ -36,6 +35,7 @@ public class Behaviour_Prospecting this.mEUCosts = aEUCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -50,7 +50,7 @@ public class Behaviour_Prospecting ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))){ GT_Utility.sendChatToPlayer(aPlayer, trans("100","This is ") + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + trans("101"," Ore.")); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(1), 1.0F, -1.0F, aX, aY, aZ); return true; } @@ -64,7 +64,7 @@ public class Behaviour_Prospecting (aBlock == GregTech_API.sBlockOresUb3) || (aBlock == GregTech_API.sBlockOres1)){ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(1), 1.0F, -1.0F, aX, aY, aZ); int tMetaID = 0; int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0; int tX = aX, tY = aY, tZ = aZ; @@ -124,6 +124,7 @@ public class Behaviour_Prospecting return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java index 02dafe640e..065bdd2189 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java @@ -15,11 +15,11 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; -public class Behaviour_Scanner - extends Behaviour_None { +public class Behaviour_Scanner extends Behaviour_None { public static final IItemBehaviour<GT_MetaBase_Item> INSTANCE = new Behaviour_Scanner(); private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.scanning", "Can scan Blocks in World"); + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { NBTTagCompound tNBT = aStack.getTagCompound(); if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) { @@ -34,11 +34,12 @@ public class Behaviour_Scanner } return true; } - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(108)), 1, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(108), 1, 1.0F, aX, aY, aZ); //doGuiAtClient() return aPlayer instanceof EntityPlayerMP; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { try { NBTTagCompound tNBT = aStack.getTagCompound(); @@ -54,10 +55,4 @@ public class Behaviour_Scanner return aList; } - //public static boolean doGuiAtClient() { - // if (!FMLCommonHandler.instance().getEffectiveSide().isClient() || GT.getThePlayer() == null || !GT.getThePlayer().worldObj.isRemote) - // return false; - // //GUI render start HERE - // return true; - //} } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java index 8d36168374..73190c5751 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java @@ -13,8 +13,7 @@ import net.minecraft.item.ItemStack; import java.util.List; -public class Behaviour_Scoop - extends Behaviour_None { +public class Behaviour_Scoop extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.scoop", "Catches Butterflies on Leftclick"); @@ -22,6 +21,7 @@ public class Behaviour_Scoop this.mCosts = aCosts; } + @Override public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { if ((aEntity instanceof IEntityButterfly)) { if (aPlayer.worldObj.isRemote) { @@ -38,6 +38,7 @@ public class Behaviour_Scoop return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java index ea548f2106..8662dd7769 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java @@ -10,8 +10,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class Behaviour_Screwdriver - extends Behaviour_None { +public class Behaviour_Screwdriver extends Behaviour_None { private final int mVanillaCosts; private final int mEUCosts; @@ -20,6 +19,7 @@ public class Behaviour_Screwdriver this.mEUCosts = aEUCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -32,14 +32,14 @@ public class Behaviour_Screwdriver if ((aBlock == Blocks.unpowered_repeater) || (aBlock == Blocks.powered_repeater)) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == Blocks.unpowered_comparator) || (aBlock == Blocks.powered_comparator)) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java index 289cc452e8..b75edf426c 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java @@ -11,8 +11,7 @@ import net.minecraft.world.World; import java.util.List; -public class Behaviour_Sense - extends Behaviour_None { +public class Behaviour_Sense extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks"); @@ -20,6 +19,7 @@ public class Behaviour_Sense this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -40,6 +40,7 @@ public class Behaviour_Sense return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java index bcbe985cdb..21d7168827 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java @@ -15,10 +15,10 @@ import net.minecraft.world.World; import java.util.List; -public class Behaviour_SensorKit - extends Behaviour_None { +public class Behaviour_SensorKit extends Behaviour_None { private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sensorkit.tooltip", "Used to display Information using the Mod Nuclear Control"); + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((aPlayer instanceof EntityPlayerMP)) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); @@ -26,7 +26,7 @@ public class Behaviour_SensorKit return false; } if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { - GT_Utility.setStack(aStack, ItemList.NC_SensorCard.get(aStack.stackSize, new Object[0])); + GT_Utility.setStack(aStack, ItemList.NC_SensorCard.get(aStack.stackSize)); NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT == null) { tNBT = new NBTTagCompound(); @@ -41,6 +41,7 @@ public class Behaviour_SensorKit return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java index 058cf98b52..43f10995ca 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java @@ -13,8 +13,7 @@ import net.minecraft.world.World; import java.util.List; -public class Behaviour_SoftHammer - extends Behaviour_None { +public class Behaviour_SoftHammer extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.softhammer", "Activates and Deactivates Machines"); @@ -22,6 +21,7 @@ public class Behaviour_SoftHammer this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -36,7 +36,7 @@ public class Behaviour_SoftHammer aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -45,7 +45,7 @@ public class Behaviour_SoftHammer aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -54,7 +54,7 @@ public class Behaviour_SoftHammer aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -63,7 +63,7 @@ public class Behaviour_SoftHammer aWorld.isRemote = true; aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0); aWorld.isRemote = false; - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -76,27 +76,28 @@ public class Behaviour_SoftHammer if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 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.trapped_chest)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta - 1) % 4 + 2, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.hopper) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6 == 1 ? (aMeta + 1) % 6 : 2, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6 != 1 ? (aMeta + 1) % 6 : 2, 3); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ); } return true; } return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java index aa4c954ba1..a0dea777f7 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java @@ -11,8 +11,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; -public class Behaviour_Sonictron - extends Behaviour_None { +public class Behaviour_Sonictron extends Behaviour_None { public static final IItemBehaviour<GT_MetaBase_Item> INSTANCE = new Behaviour_Sonictron(); public static int getCurrentIndex(ItemStack aStack) { @@ -91,21 +90,24 @@ public class Behaviour_Sonictron if (aNewContent[i] == null) { aInventory[i] = null; } else { - aInventory[i] = GT_Utility.copy(new Object[]{aNewContent[i]}); + aInventory[i] = GT_Utility.copy(aNewContent[i]); } } } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { setCurrentIndex(aStack, -1); return false; } + @Override public ItemStack onItemRightClick(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) { setCurrentIndex(aStack, 0); return aStack; } + @Override public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { int tTickTimer = getTickTimer(aStack); int tCurrentIndex = getCurrentIndex(aStack); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java index 748a660c15..5d316f009e 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java @@ -20,8 +20,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -public class Behaviour_Spray_Color - extends Behaviour_None { +public class Behaviour_Spray_Color extends Behaviour_None { private final ItemStack mEmpty; private final ItemStack mUsed; private final ItemStack mFull; @@ -41,6 +40,7 @@ public class Behaviour_Spray_Color this.mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.paintspray." + this.mColor + ".tooltip", "Can Color things in " + Dyes.get(this.mColor).mName); } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((aWorld.isRemote) || (aStack.stackSize != 1)) { return false; @@ -110,6 +110,7 @@ public class Behaviour_Spray_Color return aBlock.recolourBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aSide), (this.mColor ^ 0xFFFFFFFF) & 0xF); } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); NBTTagCompound tNBT = aStack.getTagCompound(); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java index f111e9f0fc..5bb89c9dd5 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java @@ -19,8 +19,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.Arrays; import java.util.List; -public class Behaviour_Wrench - extends Behaviour_None { +public class Behaviour_Wrench extends Behaviour_None { private final int mCosts; private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); @@ -28,6 +27,7 @@ public class Behaviour_Wrench this.mCosts = aCosts; } + @Override public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (aWorld.isRemote) { return false; @@ -44,7 +44,7 @@ public class Behaviour_Wrench if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IWrenchable) aTileEntity).setFacing((short) aTargetSide); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -61,32 +61,32 @@ public class Behaviour_Wrench } } aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } return true; } - } catch (Throwable e) { + } catch (Throwable ignored) { } if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) 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, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) 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, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -94,7 +94,7 @@ public class Behaviour_Wrench if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -103,7 +103,7 @@ public class Behaviour_Wrench if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -111,21 +111,21 @@ public class Behaviour_Wrench if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) 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 ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == Blocks.hopper) { if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return true; } @@ -136,11 +136,12 @@ public class Behaviour_Wrench if (!aPlayer.capabilities.isCreativeMode) { ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); } - GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ); } return false; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { aList.add(this.mTooltip); return aList; diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java index 3d1ee73d43..e9a771a894 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java @@ -13,8 +13,8 @@ import net.minecraft.world.World; import java.util.List; -public class Behaviour_WrittenBook - extends Behaviour_None { +public class Behaviour_WrittenBook extends Behaviour_None { + @Override @SideOnly(Side.CLIENT) public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if ((GT_Utility.isStringValid(GT_Utility.ItemNBT.getBookTitle(aStack))) && ((aPlayer instanceof EntityPlayerSP))) { @@ -23,6 +23,7 @@ public class Behaviour_WrittenBook return true; } + @Override public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { String tTitle = GT_Utility.ItemNBT.getBookTitle(aStack); if (GT_Utility.isStringValid(tTitle)) { diff --git a/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java index 7ba470e412..d666408807 100644 --- a/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java +++ b/src/main/java/gregtech/common/misc/GT_ClientPollutionMap.java @@ -2,10 +2,7 @@ package gregtech.common.misc; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.MathHelper; -import org.lwjgl.opengl.GL11; public class GT_ClientPollutionMap { private static final byte RADIUS = 24; diff --git a/src/main/java/gregtech/common/misc/GT_Command.java b/src/main/java/gregtech/common/misc/GT_Command.java index f3272ee341..a4b46b8cee 100644 --- a/src/main/java/gregtech/common/misc/GT_Command.java +++ b/src/main/java/gregtech/common/misc/GT_Command.java @@ -6,7 +6,6 @@ import gregtech.api.objects.GT_ChunkManager; import gregtech.common.GT_Pollution; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChunkCoordinates; diff --git a/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java b/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java index ee869a2bd0..c65d7f2be4 100644 --- a/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java +++ b/src/main/java/gregtech/common/net/MessageSetFlaskCapacity.java @@ -1,10 +1,9 @@ package gregtech.common.net; import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; -import gregtech.api.net.GT_Packet; +import gregtech.api.net.GT_Packet_New; import gregtech.common.items.GT_VolumetricFlask; +import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -12,7 +11,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -public final class MessageSetFlaskCapacity extends GT_Packet { +public final class MessageSetFlaskCapacity extends GT_Packet_New { private int capacity, dimID, playerID; public MessageSetFlaskCapacity() { @@ -39,16 +38,14 @@ public final class MessageSetFlaskCapacity extends GT_Packet { } @Override - public byte[] encode() { - ByteArrayDataOutput tOut = ByteStreams.newDataOutput(10); - tOut.writeInt(capacity); - tOut.writeInt(dimID); - tOut.writeInt(playerID); - return tOut.toByteArray(); + public void encode(ByteBuf aOut) { + aOut.writeInt(capacity); + aOut.writeInt(dimID); + aOut.writeInt(playerID); } @Override - public GT_Packet decode(ByteArrayDataInput aData) { + public GT_Packet_New decode(ByteArrayDataInput aData) { return new MessageSetFlaskCapacity(aData.readInt(), aData.readInt(), aData.readInt()); } @@ -64,4 +61,4 @@ public final class MessageSetFlaskCapacity extends GT_Packet { } } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java b/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java new file mode 100644 index 0000000000..619f528502 --- /dev/null +++ b/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java @@ -0,0 +1,61 @@ +package gregtech.common.net; + +import com.google.common.io.ByteArrayDataInput; +import gregtech.api.interfaces.IHasFluidDisplayItem; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.DimensionManager; + +public class MessageUpdateFluidDisplayItem extends GT_Packet_New { + private int mBlockX, mBlockY, mBlockZ, mDim; + + public MessageUpdateFluidDisplayItem() { + super(true); + } + + public MessageUpdateFluidDisplayItem(int mBlockX, int mBlockY, int mBlockZ, int mDim) { + super(false); + this.mBlockX = mBlockX; + this.mBlockY = mBlockY; + this.mBlockZ = mBlockZ; + this.mDim = mDim; + } + + @Override + public byte getPacketID() { + return 8; + } + + @Override + public void encode(ByteBuf aOut) { + aOut.writeInt(mBlockX); + aOut.writeInt(mBlockY); + aOut.writeInt(mBlockZ); + aOut.writeInt(mDim); + } + + @Override + public GT_Packet_New decode(ByteArrayDataInput aData) { + return new MessageUpdateFluidDisplayItem(aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt()); + } + + @Override + public void process(IBlockAccess aWorld) { + WorldServer world = DimensionManager.getWorld(mDim); + if (world != null) { + if (world.blockExists(mBlockX, mBlockY, mBlockZ)) { + TileEntity tileEntity = world.getTileEntity(mBlockX, mBlockY, mBlockZ); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity; + if (gtTile.getMetaTileEntity() instanceof IHasFluidDisplayItem) { + ((IHasFluidDisplayItem) gtTile.getMetaTileEntity()).updateFluidDisplayItem(); + } + } + } + } + } +} diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java index ab99c1b941..ab4f7eda69 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java @@ -3,16 +3,17 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_BasicLogic - extends GT_CircuitryBehavior { +public class GT_Circuit_BasicLogic extends GT_CircuitryBehavior { public GT_Circuit_BasicLogic(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 0) { aCircuitData[0] = 0; @@ -22,6 +23,7 @@ public class GT_Circuit_BasicLogic } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 2) { aRedstoneCircuitBlock.setRedstone((byte) (aCircuitData[0] % 2 == (getAnyRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); @@ -42,14 +44,17 @@ public class GT_Circuit_BasicLogic } } + @Override public String getName() { return "Basic Logic"; } + @Override public String getDescription() { return "Regular Logic Gates"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex == 0) { switch (aCircuitData[0]) { @@ -86,10 +91,12 @@ public class GT_Circuit_BasicLogic return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { return ""; } diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java index 0a38f929d1..2ea61ddf51 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java @@ -3,12 +3,12 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_BitAnd - extends GT_CircuitryBehavior { +public class GT_Circuit_BitAnd extends GT_CircuitryBehavior { public GT_Circuit_BitAnd(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 0; aCircuitData[1] = 0; @@ -16,6 +16,7 @@ public class GT_Circuit_BitAnd aCircuitData[3] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 0) { aCircuitData[0] = 0; @@ -43,26 +44,32 @@ public class GT_Circuit_BitAnd } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aRedstoneCircuitBlock.setRedstone((byte) ((getStrongestRedstone(aRedstoneCircuitBlock) & (aCircuitData[0] | aCircuitData[1] << 1 | aCircuitData[2] << 2 | aCircuitData[3] << 3)) != 0 ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); } + @Override public String getName() { return "Hardcode Bit-AND"; } + @Override public String getDescription() { return "( signal & this ) != 0"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { return "Bit " + aCircuitDataIndex + ":"; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { return aCircuitData[aCircuitDataIndex] == 0 ? "OFF" : "ON"; } diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java index 1846582bf3..827e4a341e 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java @@ -3,12 +3,12 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_CombinationLock - extends GT_CircuitryBehavior { +public class GT_Circuit_CombinationLock extends GT_CircuitryBehavior { public GT_Circuit_CombinationLock(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 1; aCircuitData[1] = 0; @@ -18,6 +18,7 @@ public class GT_Circuit_CombinationLock aCircuitData[5] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 1) { aCircuitData[0] = 1; @@ -54,6 +55,7 @@ public class GT_Circuit_CombinationLock } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { while ((aCircuitData[aCircuitData[4]] == 0) && (aCircuitData[4] < 4)) { aCircuitData[4] += 1; @@ -79,22 +81,27 @@ public class GT_Circuit_CombinationLock } } + @Override public String getName() { return "Combination Lock"; } + @Override public String getDescription() { return "Checks Combinations"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { return "Power " + aCircuitDataIndex; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { return null; } diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java index f328b6adde..f5bd99e09e 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java @@ -3,17 +3,18 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_Equals - extends GT_CircuitryBehavior { +public class GT_Circuit_Equals extends GT_CircuitryBehavior { public GT_Circuit_Equals(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 0; aCircuitData[1] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 0) { aCircuitData[0] = 0; @@ -29,18 +30,22 @@ public class GT_Circuit_Equals } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { - aRedstoneCircuitBlock.setRedstone(((byte) ((aCircuitData[1] != 0 ? getStrongestRedstone(aRedstoneCircuitBlock) == aCircuitData[0] : getStrongestRedstone(aRedstoneCircuitBlock) != aCircuitData[0]) ? 0 : 15)), aRedstoneCircuitBlock.getOutputFacing()); + aRedstoneCircuitBlock.setRedstone(((byte) (((aCircuitData[1] != 0) == (getStrongestRedstone(aRedstoneCircuitBlock) == aCircuitData[0])) ? 0 : 15)), aRedstoneCircuitBlock.getOutputFacing()); } + @Override public String getName() { return "Equals"; } + @Override public String getDescription() { return "signal == this"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { switch (aCircuitDataIndex) { case 0: @@ -51,10 +56,12 @@ public class GT_Circuit_Equals return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex > 0) { return ""; diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java index 815a7791cf..d1360df7cb 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java @@ -9,12 +9,14 @@ public class GT_Circuit_Pulser super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 1; aCircuitData[1] = 16; aCircuitData[4] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 1) { aCircuitData[0] = 1; @@ -30,6 +32,7 @@ public class GT_Circuit_Pulser } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { byte tRedstone = aCircuitData[1] == 0 ? getWeakestNonZeroRedstone(aRedstoneCircuitBlock) : getStrongestRedstone(aRedstoneCircuitBlock); if (aCircuitData[4] == 0) { @@ -47,14 +50,17 @@ public class GT_Circuit_Pulser aRedstoneCircuitBlock.setRedstone((byte) ((aCircuitData[4] > 0) && (aCircuitData[4] <= aCircuitData[0]) ? (byte) aCircuitData[1] : (aCircuitData[1] <= 0) || (aCircuitData[1] > 15) ? (byte) aCircuitData[5] : 0), aRedstoneCircuitBlock.getOutputFacing()); } + @Override public String getName() { return "Pulser"; } + @Override public String getDescription() { return "Limits&Enlengths"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { switch (aCircuitDataIndex) { case 0: @@ -65,10 +71,12 @@ public class GT_Circuit_Pulser return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex == 1) { if (aCircuitData[aCircuitDataIndex] == 16) { diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java index b86981e5f9..a04e2e94d1 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java @@ -3,17 +3,18 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_Randomizer - extends GT_CircuitryBehavior { +public class GT_Circuit_Randomizer extends GT_CircuitryBehavior { public GT_Circuit_Randomizer(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 1; aCircuitData[4] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 1) { aCircuitData[0] = 1; @@ -29,6 +30,7 @@ public class GT_Circuit_Randomizer } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[3] == 1) { if (getAnyRedstone(aRedstoneCircuitBlock)) { @@ -47,14 +49,17 @@ public class GT_Circuit_Randomizer } } + @Override public String getName() { return "Randomizer"; } + @Override public String getDescription() { return "Randomizes Redstone"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { switch (aCircuitDataIndex) { case 0: @@ -67,10 +72,12 @@ public class GT_Circuit_Randomizer return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex != 0) { return ""; diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java index 767b9ac8d0..973e6f3963 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java @@ -3,12 +3,12 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_RedstoneMeter - extends GT_CircuitryBehavior { +public class GT_Circuit_RedstoneMeter extends GT_CircuitryBehavior { public GT_Circuit_RedstoneMeter(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 1; aCircuitData[1] = 15; @@ -16,6 +16,7 @@ public class GT_Circuit_RedstoneMeter aCircuitData[3] = 15; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 0) { aCircuitData[0] = 0; @@ -46,19 +47,23 @@ public class GT_Circuit_RedstoneMeter } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { byte tRedstone = getStrongestRedstone(aRedstoneCircuitBlock); aRedstoneCircuitBlock.setRedstone((byte) (((tRedstone >= aCircuitData[0]) && (tRedstone <= aCircuitData[1]) ? 1 : 0) != (aCircuitData[2] != 0 ? 1 : 0) ? (byte) aCircuitData[3] : 0), aRedstoneCircuitBlock.getOutputFacing()); } + @Override public String getName() { return "Redstone Meter"; } + @Override public String getDescription() { return "Checks Boundaries"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { switch (aCircuitDataIndex) { case 0: @@ -73,10 +78,12 @@ public class GT_Circuit_RedstoneMeter return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex == 2) { return aCircuitData[2] == 0 ? "OFF" : "ON"; diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java index e501bb0258..61432610a9 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java @@ -3,18 +3,19 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_Repeater - extends GT_CircuitryBehavior { +public class GT_Circuit_Repeater extends GT_CircuitryBehavior { public GT_Circuit_Repeater(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 1; aCircuitData[4] = 0; aCircuitData[5] = -1; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 1) { aCircuitData[0] = 1; @@ -27,6 +28,7 @@ public class GT_Circuit_Repeater } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (getAnyRedstone(aRedstoneCircuitBlock)) { aCircuitData[4] += 1; @@ -50,26 +52,30 @@ public class GT_Circuit_Repeater } } + @Override public String getName() { return "Repeater"; } + @Override public String getDescription() { return "Delays RS-Signal"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { - switch (aCircuitDataIndex) { - case 0: - return "Delay"; + if (aCircuitDataIndex == 0) { + return "Delay"; } return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex > 0) { return ""; diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java index c012ea2afb..57af0c4598 100644 --- a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java @@ -3,12 +3,12 @@ package gregtech.common.redstonecircuits; import gregtech.api.interfaces.IRedstoneCircuitBlock; import gregtech.api.util.GT_CircuitryBehavior; -public class GT_Circuit_Timer - extends GT_CircuitryBehavior { +public class GT_Circuit_Timer extends GT_CircuitryBehavior { public GT_Circuit_Timer(int aIndex) { super(aIndex); } + @Override public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { aCircuitData[0] = 2; aCircuitData[1] = 1; @@ -16,6 +16,7 @@ public class GT_Circuit_Timer aCircuitData[4] = 0; } + @Override public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[0] < 2) { aCircuitData[0] = 2; @@ -37,6 +38,7 @@ public class GT_Circuit_Timer } } + @Override public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) { if (aCircuitData[3] == 1) { if (getAnyRedstone(aRedstoneCircuitBlock)) { @@ -66,14 +68,17 @@ public class GT_Circuit_Timer } } + @Override public String getName() { return "Timer"; } + @Override public String getDescription() { return "Pulses Redstone"; } + @Override public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) { switch (aCircuitDataIndex) { case 0: @@ -90,10 +95,12 @@ public class GT_Circuit_Timer return ""; } + @Override public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) { return false; } + @Override public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { if (aCircuitDataIndex == 3) { return ""; diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java index be95d7fb04..713254046e 100644 --- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java +++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java @@ -15,8 +15,7 @@ import org.lwjgl.opengl.GL11; import java.util.Collection; -public class GT_CapeRenderer - extends RenderPlayer { +public class GT_CapeRenderer extends RenderPlayer { private final ResourceLocation[] mCapes = { new ResourceLocation("gregtech:textures/BrainTechCape.png"), new ResourceLocation("gregtech:textures/GregTechCape.png"), new ResourceLocation("gregtech:textures/MrBrainCape.png"), @@ -41,7 +40,7 @@ public class GT_CapeRenderer if (aPlayer.isInvisible()) { return; } - if (GT_Utility.getPotion(aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) { + if (GT_Utility.getPotion(aPlayer, Potion.invisibility.id)) { return; } try { diff --git a/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java b/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java new file mode 100644 index 0000000000..fdd20026ab --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_CopiedBlockTexture.java @@ -0,0 +1,123 @@ +package gregtech.common.render; + +import gregtech.api.interfaces.IBlockContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.util.LightingHelper; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +class GT_CopiedBlockTexture implements ITexture, IBlockContainer { + private final Block mBlock; + private final byte mSide, mMeta; + + GT_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean allowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_CopiedBlockTexture"); + mBlock = aBlock; + mSide = (byte) aSide; + mMeta = (byte) aMeta; + } + + private IIcon getIcon(int aSide) { + if (mSide == 6) return mBlock.getIcon(aSide, mMeta); + return mBlock.getIcon(mSide, mMeta); + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(ForgeDirection.EAST.ordinal()); + aRenderer.field_152631_f = true; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 1.0f, 0.0f, 0.0f); + new LightingHelper(aRenderer) + .setupLightingXPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.EAST.ordinal(), 0xffffff); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, -1.0f, 0.0f, 0.0f); + IIcon aIcon = getIcon(ForgeDirection.WEST.ordinal()); + new LightingHelper(aRenderer) + .setupLightingXNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.WEST.ordinal(), 0xffffff); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 1.0f, 0.0f); + IIcon aIcon = getIcon(ForgeDirection.UP.ordinal()); + new LightingHelper(aRenderer) + .setupLightingYPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.UP.ordinal(), 0xffffff); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, -1.0f, 0.0f); + IIcon aIcon = getIcon(ForgeDirection.DOWN.ordinal()); + new LightingHelper(aRenderer) + .setupLightingYNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.DOWN.ordinal(), 0xffffff); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, 1.0f); + IIcon aIcon = getIcon(ForgeDirection.SOUTH.ordinal()); + new LightingHelper(aRenderer) + .setupLightingZPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.SOUTH.ordinal(), 0xffffff); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, -1.0f); + IIcon aIcon = getIcon(ForgeDirection.NORTH.ordinal()); + aRenderer.field_152631_f = true; + new LightingHelper(aRenderer) + .setupLightingZNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.NORTH.ordinal(), 0xffffff); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon); + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public boolean isValidTexture() { + return mBlock != null; + } + + @Override + public Block getBlock() { + return mBlock; + } + + @Override + public byte getMeta() { + return mMeta; + } +} diff --git a/src/main/java/gregtech/common/render/GT_FlaskRenderer.java b/src/main/java/gregtech/common/render/GT_FlaskRenderer.java index 8b1f505314..7ba4d8e037 100644 --- a/src/main/java/gregtech/common/render/GT_FlaskRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FlaskRenderer.java @@ -21,15 +21,18 @@ public final class GT_FlaskRenderer implements net.minecraftforge.client.IItemRe MinecraftForgeClient.registerItemRenderer(ItemList.VOLUMETRIC_FLASK.getItem(), this); } + @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type != ItemRenderType.FIRST_PERSON_MAP; } + @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) { return type == ItemRenderType.ENTITY; } + @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { GT_VolumetricFlask cell = (GT_VolumetricFlask) item.getItem(); IIcon icon = item.getIconIndex(); @@ -86,4 +89,4 @@ public final class GT_FlaskRenderer implements net.minecraftforge.client.IItemRe GL11.glDisable(3008); GL11.glDisable(3042); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/render/GT_MetaGenerated_Item_Renderer.java b/src/main/java/gregtech/common/render/GT_MetaGenerated_Item_Renderer.java index b8b7a121f2..6e4aadc938 100644 --- a/src/main/java/gregtech/common/render/GT_MetaGenerated_Item_Renderer.java +++ b/src/main/java/gregtech/common/render/GT_MetaGenerated_Item_Renderer.java @@ -17,8 +17,7 @@ import org.lwjgl.opengl.GL11; import java.util.Iterator; -public class GT_MetaGenerated_Item_Renderer - implements IItemRenderer { +public class GT_MetaGenerated_Item_Renderer implements IItemRenderer { public GT_MetaGenerated_Item_Renderer() { GT_MetaGenerated_Item tItem; for (Iterator i$ = GT_MetaGenerated_Item.sInstances.values().iterator(); i$.hasNext(); MinecraftForgeClient.registerItemRenderer(tItem, this)) { @@ -26,6 +25,7 @@ public class GT_MetaGenerated_Item_Renderer } } + @Override public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { if ((GT_Utility.isStackInvalid(aStack)) || (aStack.getItemDamage() < 0)) { return false; @@ -33,6 +33,7 @@ public class GT_MetaGenerated_Item_Renderer return (aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) || (aType == IItemRenderer.ItemRenderType.INVENTORY) || (aType == IItemRenderer.ItemRenderType.EQUIPPED) || (aType == IItemRenderer.ItemRenderType.ENTITY); } + @Override public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; @@ -40,6 +41,7 @@ public class GT_MetaGenerated_Item_Renderer return aType == IItemRenderer.ItemRenderType.ENTITY; } + @Override public void renderItem(IItemRenderer.ItemRenderType type, ItemStack aStack, Object... data) { if (GT_Utility.isStackInvalid(aStack)) { return; diff --git a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java index 4f869fa149..a57f97792c 100644 --- a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java +++ b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java @@ -15,8 +15,7 @@ import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; import org.lwjgl.opengl.GL11; -public class GT_MetaGenerated_Tool_Renderer - implements IItemRenderer { +public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer { public GT_MetaGenerated_Tool_Renderer() { for (GT_MetaGenerated_Tool tItem : GT_MetaGenerated_Tool.sInstances.values()) { if (tItem != null) { @@ -25,6 +24,7 @@ public class GT_MetaGenerated_Tool_Renderer } } + @Override public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { if ((GT_Utility.isStackInvalid(aStack)) || (aStack.getItemDamage() < 0)) { return false; @@ -32,6 +32,7 @@ public class GT_MetaGenerated_Tool_Renderer return (aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) || (aType == IItemRenderer.ItemRenderType.INVENTORY) || (aType == IItemRenderer.ItemRenderType.EQUIPPED) || (aType == IItemRenderer.ItemRenderType.ENTITY); } + @Override public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; @@ -39,6 +40,7 @@ public class GT_MetaGenerated_Tool_Renderer return aType == IItemRenderer.ItemRenderType.ENTITY; } + @Override public void renderItem(IItemRenderer.ItemRenderType aType, ItemStack aStack, Object... data) { if (GT_Utility.isStackInvalid(aStack)) { return; @@ -143,14 +145,14 @@ public class GT_MetaGenerated_Tool_Renderer } } Long[] tStats = aItem.getElectricStats(aStack); - if ((tStats != null) && (tStats[3].longValue() < 0L)) { + if ((tStats != null) && (tStats[3] < 0L)) { long tCharge = aItem.getRealCharge(aStack); if (tCharge <= 0L) { aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[0]; - } else if (tCharge >= tStats[0].longValue()) { + } else if (tCharge >= tStats[0]) { aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[8]; } else { - aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[(7 - (int) java.lang.Math.max(0L, java.lang.Math.min(6L, (tStats[0].longValue() - tCharge) * 7L / tStats[0].longValue())))]; + aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[(7 - (int) java.lang.Math.max(0L, java.lang.Math.min(6L, (tStats[0] - tCharge) * 7L / tStats[0])))]; } } else { aIcon = null; diff --git a/src/main/java/gregtech/common/render/GT_MultiTexture.java b/src/main/java/gregtech/common/render/GT_MultiTexture.java new file mode 100644 index 0000000000..eadcb39573 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_MultiTexture.java @@ -0,0 +1,58 @@ +package gregtech.common.render; + +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +/** + * <p>Lets Multiple ITextures Render overlay over each other.<</p> + * <p>I should have done this much earlier...</p> + */ +class GT_MultiTexture implements ITexture { + protected final ITexture[] mTextures; + + GT_MultiTexture(ITexture... aTextures) { + mTextures = aTextures; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) + if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public boolean isValidTexture() { + return true; + } +} diff --git a/src/main/java/gregtech/common/render/GT_RenderedGlowTexture.java b/src/main/java/gregtech/common/render/GT_RenderedGlowTexture.java new file mode 100644 index 0000000000..899e4d7c5d --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_RenderedGlowTexture.java @@ -0,0 +1,213 @@ +package gregtech.common.render; + +import gregtech.GT_Mod; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; + +import static gregtech.api.util.LightingHelper.MAX_BRIGHTNESS; + +/** + * This {@link ITexture} implementation renders texture with max brightness to glow in the dark. + */ + +class GT_RenderedGlowTexture implements ITexture, IColorModulationContainer { + protected final IIconContainer mIconContainer; + private final short[] mRGBa; + + GT_RenderedGlowTexture(IIconContainer aIcon, short[] aRGBa, boolean allowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); + mIconContainer = GT_Mod.gregtechproxy.mRenderGlowTextures ? aIcon : BlockIcons.VOID; + mRGBa = aRGBa; + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + final boolean enableAO = aRenderer.enableAO; + aRenderer.enableAO = false; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, -1.0f, 0.0f, 0.0f); + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorOpaque(255, 255, 255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.enableAO = enableAO; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + aRenderer.field_152631_f = true; + final boolean enableAO = aRenderer.enableAO; + aRenderer.enableAO = false; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 1.0f, 0.0f, 0.0f); + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorOpaque(255, 255, 255); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + aRenderer.enableAO = enableAO; + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + final boolean enableAO = aRenderer.enableAO; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, -1.0f, 0.0f); + final Tessellator tessellator = Tessellator.instance; + IIcon aIcon = mIconContainer.getIcon(); + + float minU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D); + float maxU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D); + float minV = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + float maxV = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + minU = 16.0F - aIcon.getMaxU(); + maxU = 16.0F - aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + minV = aIcon.getMinV(); + maxV = aIcon.getMaxV(); + } + + double minX = aX + aRenderer.renderMinX; + double maxX = aX + aRenderer.renderMaxX; + double minY = aY + aRenderer.renderMinY; + double minZ = aZ + aRenderer.renderMinZ; + double maxZ = aZ + aRenderer.renderMaxZ; + + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + tessellator.addVertexWithUV(maxX, minY, maxZ, minU, maxV); + + if (mIconContainer.getOverlayIcon() != null) { + minU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D); + maxU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D); + minV = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + maxV = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + minU = 16.0F - aIcon.getMaxU(); + maxU = 16.0F - aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + minV = aIcon.getMinV(); + maxV = aIcon.getMaxV(); + } + + minX = aX + (float) aRenderer.renderMinX; + maxX = aX + (float) aRenderer.renderMaxX; + minY = aY + (float) aRenderer.renderMinY; + minZ = aZ + (float) aRenderer.renderMinZ; + maxZ = aZ + (float) aRenderer.renderMaxZ; + + Tessellator.instance.setColorOpaque(255, 255, 255); + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + tessellator.addVertexWithUV(maxX, minY, maxZ, minU, maxV); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.enableAO = enableAO; + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + final boolean enableAO = aRenderer.enableAO; + aRenderer.enableAO = false; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 1.0f, 0.0f); + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorOpaque(255, 255, 255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.enableAO = enableAO; + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + final boolean enableAO = aRenderer.enableAO; + aRenderer.enableAO = false; + aRenderer.field_152631_f = true; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, -1.0f); + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorOpaque(255, 255, 255); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + aRenderer.enableAO = enableAO; + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + if (aRenderer.useInventoryTint) return; // TODO: Remove this once all addons have migrated to the new Texture API + if (!GT_Mod.gregtechproxy.mRenderGlowTextures) return; + final boolean enableAO = aRenderer.enableAO; + aRenderer.enableAO = false; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, 1.0f); + Tessellator.instance.setBrightness(MAX_BRIGHTNESS); + Tessellator.instance.setColorOpaque(mRGBa[0], mRGBa[1], mRGBa[2]); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.enableAO = enableAO; + } + + @Override + public boolean isValidTexture() { + return mIconContainer != null; + } +} diff --git a/src/main/java/gregtech/common/render/GT_RenderedTexture.java b/src/main/java/gregtech/common/render/GT_RenderedTexture.java new file mode 100644 index 0000000000..9e76634385 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_RenderedTexture.java @@ -0,0 +1,214 @@ +package gregtech.common.render; + +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.util.LightingHelper; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +class GT_RenderedTexture implements ITexture, IColorModulationContainer { + protected final IIconContainer mIconContainer; + private final short[] mRGBa; + + GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean allowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); + mIconContainer = aIcon; + mRGBa = aRGBa; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + aRenderer.field_152631_f = true; + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 1.0f, 0.0f, 0.0f); + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingXPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.EAST.ordinal(), mRGBa); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.EAST.ordinal(), 0xffffff); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, -1.0f, 0.0f, 0.0f); + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingXNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.WEST.ordinal(), mRGBa); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.WEST.ordinal(), 0xffffff); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 1.0f, 0.0f); + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingYPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.UP.ordinal(), mRGBa); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.UP.ordinal(), 0xffffff); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, -1.0f, 0.0f); + final Tessellator tessellator = Tessellator.instance; + IIcon aIcon = mIconContainer.getIcon(); + + float minU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D); + float maxU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D); + float minV = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + float maxV = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + minU = 16.0F - aIcon.getMaxU(); + maxU = 16.0F - aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + minV = aIcon.getMinV(); + maxV = aIcon.getMaxV(); + } + + double minX = aX + aRenderer.renderMinX; + double maxX = aX + aRenderer.renderMaxX; + double minY = aY + aRenderer.renderMinY; + double minZ = aZ + aRenderer.renderMinZ; + double maxZ = aZ + aRenderer.renderMaxZ; + + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingYNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.DOWN.ordinal(), mRGBa); + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + } else { + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + } + tessellator.addVertexWithUV(maxX, minY, maxZ, minU, maxV); + + if (mIconContainer.getOverlayIcon() != null) { + minU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D); + maxU = aIcon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D); + minV = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + maxV = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + minU = 16.0F - aIcon.getMaxU(); + maxU = 16.0F - aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + minV = aIcon.getMinV(); + maxV = aIcon.getMaxV(); + } + + minX = aX + (float)aRenderer.renderMinX; + maxX = aX + (float)aRenderer.renderMaxX; + minY = aY + (float)aRenderer.renderMinY; + minZ = aZ + (float)aRenderer.renderMinZ; + maxZ = aZ + (float)aRenderer.renderMaxZ; + + lighting.setupColor(ForgeDirection.DOWN.ordinal(), 0xffffff); + + if (aRenderer.enableAO) { + tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft); + tessellator.setBrightness(aRenderer.brightnessTopLeft); + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft); + tessellator.setBrightness(aRenderer.brightnessBottomLeft); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight); + tessellator.setBrightness(aRenderer.brightnessBottomRight); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight); + tessellator.setBrightness(aRenderer.brightnessTopRight); + } else { + tessellator.addVertexWithUV(minX, minY, maxZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY, minZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY, minZ, minU, minV); + } + tessellator.addVertexWithUV(maxX, minY, maxZ, minU, maxV); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, 1.0f); + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingZPos(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.SOUTH.ordinal(), mRGBa); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.SOUTH.ordinal(), 0xffffff); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, 0.0f, -1.0f); + aRenderer.field_152631_f = true; + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingZNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.NORTH.ordinal(), mRGBa); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.NORTH.ordinal(), 0xffffff); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + aRenderer.field_152631_f = false; + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public boolean isValidTexture() { + return mIconContainer != null; + } +} diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java index 5ee32f8dc6..a9eafd7854 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java @@ -2,6 +2,7 @@ package gregtech.common.render; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -12,14 +13,36 @@ import gregtech.common.blocks.GT_Block_Machines; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; -public class GT_Renderer_Block - implements ISimpleBlockRenderingHandler { +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_DOWN; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_EAST; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_NORTH; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_SOUTH; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_UP; +import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_WEST; +import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_FRESHFOAM; +import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_HARDENEDFOAM; +import static gregtech.api.interfaces.metatileentity.IConnectable.NO_CONNECTION; +import static net.minecraftforge.common.util.ForgeDirection.DOWN; +import static net.minecraftforge.common.util.ForgeDirection.EAST; +import static net.minecraftforge.common.util.ForgeDirection.NORTH; +import static net.minecraftforge.common.util.ForgeDirection.SOUTH; +import static net.minecraftforge.common.util.ForgeDirection.UP; +import static net.minecraftforge.common.util.ForgeDirection.VALID_DIRECTIONS; +import static net.minecraftforge.common.util.ForgeDirection.WEST; + +public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { + public static final float blockMin = 0.0F; + public static final float blockMax = 1.0F; + private static final float coverThickness = blockMax / 8.0F; + private static final float coverInnerMin = blockMin + coverThickness; + private static final float coverInnerMax = blockMax - coverThickness; public static GT_Renderer_Block INSTANCE; public final int mRenderID; @@ -29,559 +52,638 @@ public class GT_Renderer_Block RenderingRegistry.registerBlockHandler(this); } - private static void renderNormalInventoryMetaTileEntity(Block aBlock, int aMeta, RenderBlocks aRenderer) { - if ((aMeta <= 0) || (aMeta >= GregTech_API.METATILEENTITIES.length)) { - return; - } - IMetaTileEntity tMetaTileEntity = GregTech_API.METATILEENTITIES[aMeta]; - if (tMetaTileEntity == null) { - return; - } - aBlock.setBlockBoundsForItemRender(); - aRenderer.setRenderBoundsFromBlock(aBlock); - - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - if ((tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity)) { - float tThickness = ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity()).getThickNess(); - float sp = (1.0F - tThickness) / 2.0F; - - aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 0, (byte) 9, (byte) -1, false, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 1, (byte) 9, (byte) -1, false, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 2, (byte) 9, (byte) -1, false, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 3, (byte) 9, (byte) -1, false, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 4, (byte) 9, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 5, (byte) 9, (byte) -1, true, false), true); - Tessellator.instance.draw(); - } else { - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 0, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 1, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 2, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 3, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 4, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(tMetaTileEntity.getBaseMetaTileEntity(), (byte) 5, (byte) 4, (byte) -1, true, false), true); - Tessellator.instance.draw(); - } - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - aRenderer.setRenderBoundsFromBlock(aBlock); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IPipeRenderedTileEntity)) { + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{ + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) DOWN.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) UP.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) NORTH.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) SOUTH.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) WEST.ordinal()), + ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) EAST.ordinal())}); + } if ((tTileEntity instanceof ITexturedTileEntity)) { - return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 0), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 1), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 2), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 3), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 4), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 5)}); + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{ + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) DOWN.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) UP.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) NORTH.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) SOUTH.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) WEST.ordinal()), + ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) EAST.ordinal())}); } return false; } public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) { - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[DOWN.ordinal()], true); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[UP.ordinal()], true); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[NORTH.ordinal()], true); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[SOUTH.ordinal()], true); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[WEST.ordinal()], true); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[EAST.ordinal()], true); return true; } public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) { - byte aConnections = aTileEntity.getConnections(); - if ((aConnections & 0xC0) != 0) { + final byte aConnections = aTileEntity.getConnections(); + if ((aConnections & (HAS_FRESHFOAM | HAS_HARDENEDFOAM)) != 0) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); } - float tThickness = aTileEntity.getThickNess(); - if (tThickness >= 0.99F) { + final float thickness = aTileEntity.getThickNess(); + if (thickness >= 0.99F) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); } - float sp = (1.0F - tThickness) / 2.0F; - - byte tConnections = 0; - for (byte i = 0; i < 6; i = (byte) (i + 1)) { - if ((aConnections & 1 << i) != 0) { - tConnections = (byte) (tConnections | 1 << (i + 2) % 6); - } + // Range of block occupied by pipe + final float pipeMin = (blockMax - thickness) / 2.0F; + final float pipeMax = blockMax - pipeMin; + final boolean[] tIsCovered = new boolean[VALID_DIRECTIONS.length]; + for (int i = 0; i < VALID_DIRECTIONS.length; i++) { + tIsCovered[i] = (aTileEntity.getCoverIDAtSide((byte) i) != 0); } - boolean[] tIsCovered = new boolean[6]; - for (byte i = 0; i < 6; i = (byte) (i + 1)) { - tIsCovered[i] = (aTileEntity.getCoverIDAtSide(i) != 0); - } - if ((tIsCovered[0]) && (tIsCovered[1]) && (tIsCovered[2]) && (tIsCovered[3]) && (tIsCovered[4]) && (tIsCovered[5])) { - return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); - } - ITexture[][] tIcons = new ITexture[6][]; - ITexture[][] tCovers = new ITexture[6][]; - for (byte i = 0; i < 6; i = (byte) (i + 1)) { - tCovers[i] = aTileEntity.getTexture(aBlock, i); - tIcons[i] = aTileEntity.getTextureUncovered(i); + + final ITexture[][] tIcons = new ITexture[VALID_DIRECTIONS.length][]; + final ITexture[][] tCovers = new ITexture[VALID_DIRECTIONS.length][]; + for (int i = 0; i < VALID_DIRECTIONS.length; i++) { + tCovers[i] = aTileEntity.getTexture(aBlock, (byte) i); + tIcons[i] = aTileEntity.getTextureUncovered((byte) i); } - if (tConnections == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - } else if (tConnections == 3) { - aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - } - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - } - } else if (tConnections == 12) { - aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - } - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - } - } else if (tConnections == 48) { - aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - } - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - } - } else { - if ((tConnections & 0x1) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); + + switch (aConnections) { + case NO_CONNECTION: + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - } else { - aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + break; + case CONNECTED_EAST | CONNECTED_WEST: + // EAST - WEST Pipe Sides + aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, blockMax, pipeMax, pipeMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - } - } - if ((tConnections & 0x2) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + + // EAST - WEST Pipe Ends + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + break; + case CONNECTED_DOWN | CONNECTED_UP: + // UP - DOWN Pipe Sides + aBlock.setBlockBounds(pipeMin, blockMin, pipeMin, pipeMax, blockMax, pipeMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - } else { - aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + + // UP - DOWN Pipe Ends + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + break; + case CONNECTED_NORTH | CONNECTED_SOUTH: + // NORTH - SOUTH Pipe Sides + aBlock.setBlockBounds(pipeMin, pipeMin, blockMin, pipeMax, pipeMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + + // NORTH - SOUTH Pipe Ends + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + break; + default: + if ((aConnections & CONNECTED_WEST) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, pipeMin, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); } - } - if ((tConnections & 0x4) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - } else { - aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + + if ((aConnections & CONNECTED_EAST) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(pipeMax, pipeMin, pipeMin, blockMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); } - } - if ((tConnections & 0x8) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - } else { - aBlock.setBlockBounds(sp, sp + tThickness, sp, sp + tThickness, 1.0F, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + + if ((aConnections & CONNECTED_DOWN) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(pipeMin, blockMin, pipeMin, pipeMax, pipeMin, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); } - } - if ((tConnections & 0x10) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); - } else { - aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, sp); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[2], false); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + + if ((aConnections & CONNECTED_UP) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(pipeMin, pipeMax, pipeMin, pipeMax, blockMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); } - } - if ((tConnections & 0x20) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); - } else { - aBlock.setBlockBounds(sp, sp, sp + tThickness, sp + tThickness, sp + tThickness, 1.0F); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[1], false); - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[5], false); - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + + if ((aConnections & CONNECTED_NORTH) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(pipeMin, pipeMin, blockMin, pipeMax, pipeMax, pipeMin); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); } - } + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[NORTH.ordinal()], false); + + if ((aConnections & CONNECTED_SOUTH) == 0) { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMin, pipeMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + } else { + aBlock.setBlockBounds(pipeMin, pipeMin, pipeMax, pipeMax, pipeMax, blockMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[DOWN.ordinal()], false); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[UP.ordinal()], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[WEST.ordinal()], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[EAST.ordinal()], false); + } + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[SOUTH.ordinal()], false); + break; } - if (tIsCovered[0]) { - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + + // Render covers on pipes + if (tIsCovered[DOWN.ordinal()]) { + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, coverInnerMin, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - } - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - } - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - } - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false); - } - } - if (tIsCovered[1]) { - aBlock.setBlockBounds(0.0F, 0.875F, 0.0F, 1.0F, 1.0F, 1.0F); + if (!tIsCovered[NORTH.ordinal()]) { + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + } + if (!tIsCovered[SOUTH.ordinal()]) { + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + } + if (!tIsCovered[WEST.ordinal()]) { + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + } + if (!tIsCovered[EAST.ordinal()]) { + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + } + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + if ((aConnections & CONNECTED_DOWN) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMin, blockMin, blockMin, blockMax, blockMin, pipeMin); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMin, blockMin, pipeMax, blockMax, blockMin, blockMax); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMin, blockMin, pipeMin, pipeMin, blockMin, pipeMax); + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(pipeMax, blockMin, pipeMin, blockMax, blockMin, pipeMax); + } + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[DOWN.ordinal()], false); + } + + if (tIsCovered[UP.ordinal()]) { + aBlock.setBlockBounds(blockMin, coverInnerMax, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - } - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - } - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - } - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false); - } - } - if (tIsCovered[2]) { - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.125F); + if (!tIsCovered[NORTH.ordinal()]) { + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + } + if (!tIsCovered[SOUTH.ordinal()]) { + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + } + if (!tIsCovered[WEST.ordinal()]) { + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + } + if (!tIsCovered[EAST.ordinal()]) { + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + } + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + if ((aConnections & CONNECTED_UP) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMin, blockMax, blockMin, blockMax, blockMax, pipeMin); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMin, blockMax, pipeMax, blockMax, blockMax, blockMax); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMin, blockMax, pipeMin, pipeMin, blockMax, pipeMax); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(pipeMax, blockMax, pipeMin, blockMax, blockMax, pipeMax); + } + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[UP.ordinal()], false); + } + + if (tIsCovered[NORTH.ordinal()]) { + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, coverInnerMin); aRenderer.setRenderBoundsFromBlock(aBlock); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - } - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - } - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - } - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false); - } - } - if (tIsCovered[3]) { - aBlock.setBlockBounds(0.0F, 0.0F, 0.875F, 1.0F, 1.0F, 1.0F); + if (!tIsCovered[DOWN.ordinal()]) { + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + } + if (!tIsCovered[UP.ordinal()]) { + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + } + if (!tIsCovered[WEST.ordinal()]) { + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + } + if (!tIsCovered[EAST.ordinal()]) { + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + } + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + if ((aConnections & CONNECTED_NORTH) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMin, blockMin, blockMin, blockMax, pipeMin, blockMin); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMin, pipeMax, blockMin, blockMax, blockMax, blockMin); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMin, pipeMin, blockMin, pipeMin, pipeMax, blockMin); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(pipeMax, pipeMin, blockMin, blockMax, pipeMax, blockMin); + } + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[NORTH.ordinal()], false); + } + + if (tIsCovered[SOUTH.ordinal()]) { + aBlock.setBlockBounds(blockMin, blockMin, coverInnerMax, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - } - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - } - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - if (!tIsCovered[4]) { - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - } - if (!tIsCovered[5]) { - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false); - } - } - if (tIsCovered[4]) { - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 0.125F, 1.0F, 1.0F); + if (!tIsCovered[DOWN.ordinal()]) { + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + } + if (!tIsCovered[UP.ordinal()]) { + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + } + if (!tIsCovered[WEST.ordinal()]) { + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + } + if (!tIsCovered[EAST.ordinal()]) { + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + } + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + if ((aConnections & CONNECTED_SOUTH) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMin, blockMin, blockMax, blockMax, pipeMin, blockMax); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMin, pipeMax, blockMax, blockMax, blockMax, blockMax); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMin, pipeMin, blockMax, pipeMin, pipeMax, blockMax); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(pipeMax, pipeMin, blockMax, blockMax, pipeMax, blockMax); + } + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[SOUTH.ordinal()], false); + } + + if (tIsCovered[WEST.ordinal()]) { + aBlock.setBlockBounds(blockMin, blockMin, blockMin, coverInnerMin, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - } - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - } - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - } - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - } - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false); - } - if (tIsCovered[5]) { - aBlock.setBlockBounds(0.875F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + if (!tIsCovered[DOWN.ordinal()]) { + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + } + if (!tIsCovered[UP.ordinal()]) { + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + } + if (!tIsCovered[NORTH.ordinal()]) { + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + } + if (!tIsCovered[SOUTH.ordinal()]) { + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + } + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + if ((aConnections & CONNECTED_WEST) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMin, blockMin, blockMin, blockMin, pipeMin, blockMax); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMin, pipeMax, blockMin, blockMin, blockMax, blockMax); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMin, pipeMin, blockMin, blockMin, pipeMax, pipeMin); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(blockMin, pipeMin, pipeMax, blockMin, pipeMax, blockMax); + } + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[WEST.ordinal()], false); + } + + if (tIsCovered[EAST.ordinal()]) { + aBlock.setBlockBounds(coverInnerMax, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); - if (!tIsCovered[0]) { - renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); + if (!tIsCovered[DOWN.ordinal()]) { + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); + } + if (!tIsCovered[UP.ordinal()]) { + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); } - if (!tIsCovered[1]) { - renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); + if (!tIsCovered[NORTH.ordinal()]) { + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); } - if (!tIsCovered[2]) { - renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); + if (!tIsCovered[SOUTH.ordinal()]) { + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); } - if (!tIsCovered[3]) { - renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); + + if ((aConnections & CONNECTED_EAST) != 0) { + // Split outer face to leave hole for pipe + // Lower panel + aRenderer.setRenderBounds(blockMax, blockMin, blockMin, blockMax, pipeMin, blockMax); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); + // Upper panel + aRenderer.setRenderBounds(blockMax, pipeMax, blockMin, blockMax, blockMax, blockMax); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); + // Middle left panel + aRenderer.setRenderBounds(blockMax, pipeMin, blockMin, blockMax, pipeMax, pipeMin); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); + // Middle right panel + aRenderer.setRenderBounds(blockMax, pipeMin, pipeMax, blockMax, pipeMax, blockMax); } - renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); - renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[EAST.ordinal()], false); } - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); aRenderer.setRenderBoundsFromBlock(aBlock); return true; } + @Override + public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) { + aRenderer.enableAO = false; + aRenderer.useInventoryTint = true; + + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + + if (aBlock instanceof GT_Block_Ores_Abstract) { + GT_TileEntity_Ores tTileEntity = new GT_TileEntity_Ores(); + tTileEntity.mMetaData = ((short) aMeta); + + aBlock.setBlockBoundsForItemRender(); + aRenderer.setRenderBoundsFromBlock(aBlock); + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + + } else if (aMeta > 0 + && (aMeta < GregTech_API.METATILEENTITIES.length) + && aBlock instanceof GT_Block_Machines + && (GregTech_API.METATILEENTITIES[aMeta] != null) + && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) { + renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); + } + + aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + aRenderer.useInventoryTint = false; + } + + private static void renderNormalInventoryMetaTileEntity(Block aBlock, int aMeta, RenderBlocks aRenderer) { + if ((aMeta <= 0) || (aMeta >= GregTech_API.METATILEENTITIES.length)) { + return; + } + IMetaTileEntity tMetaTileEntity = GregTech_API.METATILEENTITIES[aMeta]; + if (tMetaTileEntity == null) { + return; + } + aBlock.setBlockBoundsForItemRender(); + aRenderer.setRenderBoundsFromBlock(aBlock); + + final IGregTechTileEntity iGregTechTileEntity = tMetaTileEntity.getBaseMetaTileEntity(); + + if ((iGregTechTileEntity instanceof IPipeRenderedTileEntity)) { + final float tThickness = ((IPipeRenderedTileEntity) iGregTechTileEntity).getThickNess(); + final float pipeMin = (blockMax - tThickness) / 2.0F; + final float pipeMax = blockMax - pipeMin; + + aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, blockMax, pipeMax, pipeMax); + aRenderer.setRenderBoundsFromBlock(aBlock); + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + } else { + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, -1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 1, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, -1); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(0, 0, 1); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(-1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.startDrawingQuads(); // TODO: Remove this once all addons have migrated to the new Texture API + Tessellator.instance.setNormal(1, 0, 0); // TODO: Remove this once all addons have migrated to the new Texture API + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true); + Tessellator.instance.draw(); // TODO: Remove this once all addons have migrated to the new Texture API + } + } + public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { - if (aWorld == null) return; - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) return; - Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); - - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); - } + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) return; + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); } } } public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) { - return; - } + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) return; Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); } - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); - } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); } } } public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) { - return; - } + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) return; Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); } - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); - } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); } } } public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) { - return; - } + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) return; Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); } - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); - } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); } } } public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) { - return; - } + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) return; Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); } - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); - } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); } } } public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { - if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) { - return; - } + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) return; Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); } - if (aIcon != null) { - for (ITexture iTexture : aIcon) { - if (iTexture != null) { - iTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); - } + if (aIcon == null) return; + for (ITexture iTexture : aIcon) { + if (iTexture != null) { + iTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); } } } - public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) { - if ((aBlock instanceof GT_Block_Machines)) { - if ((aMeta > 0) && (aMeta < GregTech_API.METATILEENTITIES.length) && (GregTech_API.METATILEENTITIES[aMeta] != null) && - (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) { - renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); - } - } else if ((aBlock instanceof GT_Block_Ores_Abstract)) { - GT_TileEntity_Ores tTileEntity = new GT_TileEntity_Ores(); - tTileEntity.mMetaData = ((short) aMeta); - - aBlock.setBlockBoundsForItemRender(); - aRenderer.setRenderBoundsFromBlock(aBlock); - - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); - renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); - renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); - renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); - renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); - renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); - Tessellator.instance.draw(); - - Tessellator.instance.startDrawingQuads(); - Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); - renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); - Tessellator.instance.draw(); - } - aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - aRenderer.setRenderBoundsFromBlock(aBlock); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - + @Override public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { - TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (aTileEntity == null) { - return false; - } - if (aTileEntity instanceof IGregTechTileEntity && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null) && (((IGregTechTileEntity) aTileEntity).getMetaTileEntity().renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer))) { + aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion; + aRenderer.useInventoryTint = false; + TileEntity tileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tileEntity == null) return false; + if (tileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTileEntity; + if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null && + metaTileEntity.renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)) { + aRenderer.enableAO = false; + return true; + } + } + if (tileEntity instanceof IPipeRenderedTileEntity && + renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) tileEntity, aRenderer)) { + aRenderer.enableAO = false; return true; } - if ((aTileEntity instanceof IPipeRenderedTileEntity)) { - return renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) aTileEntity, aRenderer); + if (renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer)) { + aRenderer.enableAO = false; + return true; } - return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); + return false; } + @Override public boolean shouldRender3DInInventory(int aModel) { return true; } + @Override public int getRenderId() { return this.mRenderID; } diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Entity_Arrow.java b/src/main/java/gregtech/common/render/GT_Renderer_Entity_Arrow.java index bbd791ec10..7feb8ce1b8 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Entity_Arrow.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Entity_Arrow.java @@ -5,8 +5,7 @@ import net.minecraft.client.renderer.entity.RenderArrow; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -public class GT_Renderer_Entity_Arrow - extends RenderArrow { +public class GT_Renderer_Entity_Arrow extends RenderArrow { private final ResourceLocation mTexture; public GT_Renderer_Entity_Arrow(Class aArrowClass, String aTextureName) { @@ -14,6 +13,7 @@ public class GT_Renderer_Entity_Arrow RenderingRegistry.registerEntityRenderingHandler(aArrowClass, this); } + @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.mTexture; } diff --git a/src/main/java/gregtech/common/render/GT_SidedTexture.java b/src/main/java/gregtech/common/render/GT_SidedTexture.java new file mode 100644 index 0000000000..9bdee73eb0 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_SidedTexture.java @@ -0,0 +1,75 @@ +package gregtech.common.render; + +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.render.TextureFactory; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +class GT_SidedTexture implements ITexture, IColorModulationContainer { + protected final ITexture[] mTextures; + /** + * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! + * <p/> + * Just set this variable to another different Array instead. + * Otherwise some colored things will get Problems. + */ + private final short[] mRGBa; + + GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); + mTextures = new ITexture[]{ + TextureFactory.of(aIcon0, aRGBa, aAllowAlpha), + TextureFactory.of(aIcon1, aRGBa, aAllowAlpha), + TextureFactory.of(aIcon2, aRGBa, aAllowAlpha), + TextureFactory.of(aIcon3, aRGBa, aAllowAlpha), + TextureFactory.of(aIcon4, aRGBa, aAllowAlpha), + TextureFactory.of(aIcon5, aRGBa, aAllowAlpha) + }; + mRGBa = aRGBa; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[5].renderXPos(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[4].renderXNeg(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[1].renderYPos(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[0].renderYNeg(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[3].renderZPos(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + mTextures[2].renderZNeg(aRenderer, aBlock, aX ,aY, aZ); + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public boolean isValidTexture() { + for (ITexture renderedTexture : mTextures) { + if (!renderedTexture.isValidTexture()) return false; + } + return true; + } +} diff --git a/src/main/java/gregtech/common/render/GT_StdRenderedTexture.java b/src/main/java/gregtech/common/render/GT_StdRenderedTexture.java new file mode 100644 index 0000000000..ba0f9d3a91 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_StdRenderedTexture.java @@ -0,0 +1,36 @@ +package gregtech.common.render; + +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.LightingHelper; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * This ITexture implementation extends the GT_RenderedTexture class + * to render with bottom side flipped as with dumb blocks rendering. + * It is used in Ore blocks rendering so they better blends with dumb block ores + * from vanilla or other mods, when seen from bottom. + */ +class GT_StdRenderedTexture extends GT_RenderedTexture{ + + GT_StdRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean allowAlpha) { + super(aIcon, aRGBa, allowAlpha); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + // TODO: Uncomment this once all addons have migrated to the new Texture API + //startDrawingQuads(aRenderer, 0.0f, -1.0f, 0.0f); + LightingHelper lighting = new LightingHelper(aRenderer); + lighting.setupLightingYNeg(aBlock, aX, aY, aZ) + .setupColor(ForgeDirection.DOWN.ordinal(), getRGBA()); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + lighting.setupColor(ForgeDirection.DOWN.ordinal(), 0xffffff); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + // TODO: Uncomment this once all addons have migrated to the new Texture API + //draw(aRenderer); + } +} diff --git a/src/main/java/gregtech/common/render/GT_TextureBuilder.java b/src/main/java/gregtech/common/render/GT_TextureBuilder.java new file mode 100644 index 0000000000..22446f99a5 --- /dev/null +++ b/src/main/java/gregtech/common/render/GT_TextureBuilder.java @@ -0,0 +1,107 @@ +package gregtech.common.render; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.ITextureBuilder; +import net.minecraft.block.Block; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@SuppressWarnings("unused") +public class GT_TextureBuilder implements ITextureBuilder { + private final List<IIconContainer> iconContainerList; + private final List<ITexture> textureLayers; + private Block fromBlock; + private int fromMeta; + private ForgeDirection fromSide; + private short[] rgba; + private boolean allowAlpha; + private boolean stdOrient; + private boolean glow; + + public GT_TextureBuilder() { + textureLayers = new ArrayList<>(); + iconContainerList = new ArrayList<>(); + rgba = Dyes._NULL.mRGBa; + allowAlpha = true; + stdOrient = false; + glow = false; + } + + @Override + public ITextureBuilder setFromBlock(final Block block, final int meta) { + this.fromBlock = block; + this.fromMeta = meta; + this.fromSide = ForgeDirection.UNKNOWN; + return this; + } + + @Override + public ITextureBuilder setFromSide(final ForgeDirection side) { + this.fromSide = side; + return this; + } + + @Override + public ITextureBuilder addIcon(final IIconContainer... iconContainers) { + this.iconContainerList.addAll(Arrays.asList(iconContainers)); + return this; + } + + @Override + public ITextureBuilder setRGBA(final short[] rgba) { + this.rgba = rgba; + return this; + } + + @Override + public ITextureBuilder addLayer(final ITexture... iTextures) { + this.textureLayers.addAll(Arrays.asList(iTextures)); + return this; + } + + @Override + public ITextureBuilder setAllowAlpha(final boolean allowAlpha) { + this.allowAlpha = allowAlpha; + return this; + } + + @Override + public ITextureBuilder stdOrient() { + this.stdOrient = true; + return this; + } + + @Override + public ITextureBuilder glow() { + glow = true; + return this; + } + + @Override + public ITexture build() { + if (fromBlock != null) return new GT_CopiedBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha); + if (!textureLayers.isEmpty()) return new GT_MultiTexture(textureLayers.toArray(new ITexture[0])); + switch (iconContainerList.size()) { + case 1: + if (stdOrient) return new GT_StdRenderedTexture(iconContainerList.get(0), rgba, allowAlpha); + if (glow) return new GT_RenderedGlowTexture(iconContainerList.get(0), rgba, allowAlpha); + return new GT_RenderedTexture(iconContainerList.get(0), rgba, allowAlpha); + case 6: + return new GT_SidedTexture( + iconContainerList.get(ForgeDirection.DOWN.ordinal()), + iconContainerList.get(ForgeDirection.UP.ordinal()), + iconContainerList.get(ForgeDirection.NORTH.ordinal()), + iconContainerList.get(ForgeDirection.SOUTH.ordinal()), + iconContainerList.get(ForgeDirection.WEST.ordinal()), + iconContainerList.get(ForgeDirection.EAST.ordinal()), + rgba, allowAlpha); + default: + throw new IllegalStateException("Invalid sideIconContainer count"); + } + } +} diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index 6605d4fc35..3830cd3497 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -1,11 +1,10 @@ package gregtech.common.tileentities.automation; -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_Buffer; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_ChestBuffer; import gregtech.common.gui.GT_GUIContainer_ChestBuffer; @@ -17,17 +16,21 @@ import net.minecraft.item.ItemStack; import java.util.Arrays; import java.util.Comparator; -public class GT_MetaTileEntity_ChestBuffer - extends GT_MetaTileEntity_Buffer { - private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1,1,1}; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER_GLOW; + +public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { + + private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; + private static final int[] maxStacks = { 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128}; public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 28, new String[]{ - "Buffers up to 27 Item Stacks", - "Use Screwdriver to regulate output stack size", - "Consumes 3EU per moved Item", - getTickRateDesc(aTier)}); + "Buffers up to 27 Item Stacks", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", + getTickRateDesc(aTier)}); } public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { @@ -46,18 +49,24 @@ public class GT_MetaTileEntity_ChestBuffer super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_CHESTBUFFER); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_CHESTBUFFER), + TextureFactory.builder().addIcon(AUTOMATION_CHESTBUFFER_GLOW).glow().build()); } + @Override public boolean isValidSlot(int aIndex) { return aIndex < this.mInventory.length - 1; } + @Override protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aTimer % tickRate[mTier] > 0) return; @@ -67,12 +76,9 @@ public class GT_MetaTileEntity_ChestBuffer // mSuccess will be negative if the call is caused by the %200 aTimer, always try to push. Otherwise it will be positive. // For the first 6 ticks after a successful move (49->44), push every tick. Then go to every 5 ticks. if ( (mSuccess <= 0 ) || (mSuccess > 43) || ((mSuccess % 5) == 0 )){ - super.moveItems(aBaseMetaTileEntity, aTimer); + super.moveItems(aBaseMetaTileEntity, aTimer, Math.min(MAX, maxStacks[mTier])); } - // mSuccesss is set to 50 on a successful move - //if(mSuccess == 50) { - // fillStacksIntoFirstSlots(); - //} + if(mSuccess < 0) { mSuccess = 0; } @@ -110,17 +116,12 @@ public class GT_MetaTileEntity_ChestBuffer id1 = o1.getItemDamage(); id2 = o2.getItemDamage(); - if ( id1 < id2 ) { - return -1; - } - if ( id1 > id2 ) { - return 1; - } - return 0; + return Integer.compare(id1, id2); } }); } + @Override protected void fillStacksIntoFirstSlots() { sortStacks(); // Merge small stacks together @@ -139,23 +140,31 @@ public class GT_MetaTileEntity_ChestBuffer } } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); } protected static String getTickRateDesc(int tier){ int tickRate = getTickRate(tier); - String s = ""; + String timeStr = ""; + String numStr = ""; + if (maxStacks[tier] > 1) { + numStr = maxStacks[tier] + " items"; + } else { + numStr = "1 item"; + } if (tickRate < 20) - s = "1/" + 20/tickRate + " "; + timeStr = "1/" + 20/tickRate + " "; else if (tickRate > 20) { - s = (tickRate / 20) + "th "; + timeStr = (tickRate / 20) + "th "; } - return "Moves items every " + s + "second"; + return "Moves " + numStr + " every " + timeStr + "second"; } protected static int getTickRate(int tier) { @@ -163,4 +172,9 @@ public class GT_MetaTileEntity_ChestBuffer return 1; return tickRate[tier]; } + + protected static int getMaxStacks(int tier) { + // Included higher tiers on the off chance they actually work without blowing things up lmao + return tier > 9 ? MAX : Math.min(maxStacks[tier], MAX); + } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java index a2f17ef6f3..5b23c36d9a 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -1,11 +1,10 @@ package gregtech.common.tileentities.automation; -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_Buffer; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Filter; import gregtech.common.gui.GT_GUIContainer_Filter; @@ -13,16 +12,18 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_Filter - extends GT_MetaTileEntity_Buffer { +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER_GLOW; + +public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer { public boolean bIgnoreNBT = false; public boolean bInvertFilter = false; public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 19, new String[]{ - "Filters up to 9 different Items", - "Use Screwdriver to regulate output stack size", - "Consumes 1EU per moved Item"}); + "Filters up to 9 different Items", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item"}); } public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { @@ -33,38 +34,48 @@ public class GT_MetaTileEntity_Filter super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_FILTER); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_FILTER), + TextureFactory.builder().addIcon(AUTOMATION_FILTER_GLOW).glow().build()); } + @Override public boolean isValidSlot(int aIndex) { return aIndex < 9; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_Filter(aPlayerInventory, aBaseMetaTileEntity); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_Filter(aPlayerInventory, aBaseMetaTileEntity); } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setBoolean("bInvertFilter", this.bInvertFilter); aNBT.setBoolean("bIgnoreNBT", this.bIgnoreNBT); } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); this.bIgnoreNBT = aNBT.getBoolean("bIgnoreNBT"); } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java index 5fa3bc8c82..d3b124b79f 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java @@ -5,7 +5,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_ItemDistributor; import gregtech.common.gui.GT_GUIContainer_ItemDistributor; @@ -15,6 +15,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR_GLOW; + public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer { private byte[] itemsPerSide = new byte[6]; private byte currentSide = 0, currentSideItemCount = 0; @@ -24,7 +27,7 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer "Distributes Items between different Machine Sides", "Default Items per Machine Side: 0", "Use Screwdriver to increase/decrease Items per Side", - "Consumes 1EU per moved Item"}); + "Does not consume energy to move Item"}); } public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, @@ -40,11 +43,13 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ItemDistributor(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override protected void fillStacksIntoFirstSlots() { for (int i = 0; i < this.mInventory.length - 1; i++) { for (int j = i + 1; j < this.mInventory.length - 1; j++) { @@ -57,14 +62,19 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer } } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_ItemDistributor(aPlayerInventory, aBaseMetaTileEntity); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_ITEMDISTRIBUTOR), + TextureFactory.builder().addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW).glow().build()); } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_ItemDistributor(aPlayerInventory, aBaseMetaTileEntity); } @@ -86,7 +96,7 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] returnTextures = new ITexture[2][17][]; - ITexture baseIcon = getOverlayIcon(), pipeIcon = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT); + ITexture baseIcon = getOverlayIcon(), pipeIcon = TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT); for (int i = 0; i < 17; i++) { returnTextures[0][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], baseIcon}; returnTextures[1][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], pipeIcon, baseIcon}; @@ -104,6 +114,7 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer return getBaseMetaTileEntity().getFrontFacing() != aSide && itemsPerSide[aSide] > 0; } + @Override public boolean isValidSlot(int aIndex) { return aIndex < this.mInventory.length - 1; } @@ -119,9 +130,10 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer currentSideItemCount = aNBT.getByte("mCurrentSideItemCount"); } + @Override protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { fillStacksIntoFirstSlots(); - int movedItems = 0; + int movedItems; TileEntity adjacentTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(currentSide); int inspectedSides = 0; while (itemsPerSide[currentSide] == 0) { @@ -143,7 +155,6 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer } if (movedItems > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { mSuccess = 50; - aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(movedItems), true); } fillStacksIntoFirstSlots(); } @@ -169,4 +180,4 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer super.setItemNBT(aNBT); aNBT.setByteArray("mItemsPerSide", itemsPerSide); } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java index b5a33bfb81..c20df68b32 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -1,11 +1,10 @@ package gregtech.common.tileentities.automation; -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_Buffer; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Regulator; import gregtech.common.gui.GT_GUIContainer_Regulator; @@ -14,7 +13,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Arrays; +import java.util.Collections; + +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR_GLOW; public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer { @@ -23,10 +25,10 @@ public class GT_MetaTileEntity_Regulator public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 20, new String[]{ - "Filters up to 9 different Items", - "Allows Item-specific output stack size", - "Allows Item-specific output slot", - "Consumes 1EU per moved Item"}); + "Filters up to 9 different Items", + "Allows Item-specific output stack size", + "Allows Item-specific output slot", + "Does not consume energy to move Item"}); } public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { @@ -37,26 +39,34 @@ public class GT_MetaTileEntity_Regulator super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_REGULATOR), + TextureFactory.builder().addIcon(AUTOMATION_REGULATOR_GLOW).glow().build()); } + @Override public boolean isValidSlot(int aIndex) { return aIndex < 9; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity); } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]); @@ -70,6 +80,7 @@ public class GT_MetaTileEntity_Regulator aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]); } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1"); @@ -85,23 +96,23 @@ public class GT_MetaTileEntity_Regulator @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - //Regulation per Screwdriver is overridden by GUI regulation. + //Regulation per Screwdriver is overridden by GUI regulation. } + @Override public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - int i = 0; - for (int tCosts = 0; i < 9; i++) { + for (int i = 0, tCosts; i < 9; i++) { if (this.mInventory[(i + 9)] != null) { - tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[]{this.mInventory[(i + 9)]}), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3; + tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Collections.singletonList(this.mInventory[(i + 9)]), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3; if (tCosts > 0) { this.mSuccess = 50; - getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true); break; } } } } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java index da35f17518..c7a5139c59 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -1,22 +1,23 @@ package gregtech.common.tileentities.automation; -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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.common.gui.GT_Container_SuperBuffer; import gregtech.common.gui.GT_GUIContainer_SuperBuffer; import net.minecraft.entity.player.InventoryPlayer; -public class GT_MetaTileEntity_SuperBuffer - extends GT_MetaTileEntity_ChestBuffer { +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER_GLOW; + +public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer { public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 257, new String[]{ - "Buffers up to 256 Item Stacks", - "Use Screwdriver to regulate output stack size", - "Consumes 1EU per moved Item", - getTickRateDesc(aTier)}); + "Buffers up to 256 Item Stacks", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", + getTickRateDesc(aTier)}); } public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { @@ -27,18 +28,24 @@ public class GT_MetaTileEntity_SuperBuffer super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_SUPERBUFFER); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_SUPERBUFFER), + TextureFactory.builder().addIcon(AUTOMATION_SUPERBUFFER_GLOW).glow().build()); } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 6292a769a2..61f0b5cb29 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -1,13 +1,12 @@ package gregtech.common.tileentities.automation; import gregtech.api.enums.OrePrefixes; -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_Buffer; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_TypeFilter; @@ -16,8 +15,11 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_TypeFilter - extends GT_MetaTileEntity_Buffer { +import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER; +import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER_GLOW; + +public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_Buffer { public boolean bNBTAllowed = false; public boolean bInvertFilter = false; public int mRotationIndex = 0; @@ -25,9 +27,9 @@ public class GT_MetaTileEntity_TypeFilter public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 11, new String[]{ - "Filters 1 Item Type", - "Use Screwdriver to regulate output stack size", - "Consumes 1 EU per moved Item"}); + "Filters 1 Item Type", + "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item"}); } public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { @@ -38,22 +40,29 @@ public class GT_MetaTileEntity_TypeFilter super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } + @Override public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER); + return TextureFactory.of( + TextureFactory.of(AUTOMATION_TYPEFILTER), + TextureFactory.builder().addIcon(AUTOMATION_TYPEFILTER_GLOW).glow().build()); } + @Override public boolean isValidSlot(int aIndex) { return aIndex < 9; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); } @@ -87,21 +96,21 @@ public class GT_MetaTileEntity_TypeFilter } } + @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); - if ((getBaseMetaTileEntity().isServerSide()) && ((aTick % 8L == 0L) || mRotationIndex == -1)) { - if (this.mPrefix.mPrefixedItems.isEmpty()) { - this.mInventory[9] = null; - } else { - this.mInventory[9] = GT_Utility.copyAmount(1L, this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); - if (this.mInventory[9].getItemDamage() == 32767) { - this.mInventory[9].setItemDamage(0); - } - this.mInventory[9].setStackDisplayName(this.mPrefix.toString()); - } + if ((!getBaseMetaTileEntity().isServerSide()) || ((aTick % 8L != 0L) && mRotationIndex != -1)) return; + if (this.mPrefix.mPrefixedItems.isEmpty()) { + this.mInventory[9] = null; + return; } + this.mInventory[9] = GT_Utility.copyAmount(1L, this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); + if (this.mInventory[9] == null) return; + if (this.mInventory[9].getItemDamage() == W) this.mInventory[9].setItemDamage(0); + this.mInventory[9].setStackDisplayName(this.mPrefix.toString()); } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setString("mPrefix", this.mPrefix.toString()); @@ -109,6 +118,7 @@ public class GT_MetaTileEntity_TypeFilter aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed); } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix); @@ -116,6 +126,7 @@ public class GT_MetaTileEntity_TypeFilter this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed"); } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { boolean tAllowPrefix = this.mPrefix.contains(aStack); if (this.mPrefix == OrePrefixes.ore) { diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 4facb0e300..7cef8278be 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -2,16 +2,14 @@ package gregtech.common.tileentities.boilers; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; +import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -22,13 +20,13 @@ import net.minecraftforge.fluids.IFluidHandler; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -public abstract class GT_MetaTileEntity_Boiler - extends GT_MetaTileEntity_BasicTank { +public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank { public int mTemperature = 20; public int mProcessingEnergy = 0; public int mLossTimer = 0; public FluidStack mSteam = null; public boolean mHadNoWater = false; + private int mExcessWater = 0; public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); @@ -46,58 +44,68 @@ public abstract class GT_MetaTileEntity_Boiler super(aName, aTier, 4, aDescription, aTextures); } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; - //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1]; if (aSide != aFacing && tmp.length == 2) { tmp = new ITexture[]{tmp[0]}; } return tmp; } + @Override public boolean isElectric() { return false; } + @Override public boolean isPneumatic() { return false; } + @Override public boolean isSteampowered() { return false; } + @Override public boolean isSimpleMachine() { return false; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } + @Override public boolean isValidSlot(int aIndex) { return true; } + @Override public int getProgresstime() { return this.mTemperature; } + @Override public int maxProgresstime() { return 500; } + @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; } if (aPlayer != null) { if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1))) { - fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true); + fill(Materials.Water.getFluid(1000L * (long) aPlayer.getCurrentEquippedItem().stackSize), true); aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket); } else { aBaseMetaTileEntity.openGUI(aPlayer); @@ -106,186 +114,265 @@ public abstract class GT_MetaTileEntity_Boiler return true; } + @Override public boolean doesFillContainers() { return true; } + @Override public boolean doesEmptyContainers() { return true; } + @Override public boolean canTankBeFilled() { return true; } + @Override public boolean canTankBeEmptied() { return true; } + @Override public boolean displaysItemStack() { return false; } + @Override public boolean displaysStackSize() { return false; } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return GT_ModHandler.isWater(aFluid); } + @Override public FluidStack getDrainableStack() { return this.mSteam; } + @Override public FluidStack setDrainableStack(FluidStack aFluid) { this.mSteam = aFluid; return this.mSteam; } + @Override + public boolean isDrainableStackSeparate() { + return true; + } + + @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) { return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover(); } + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("mLossTimer", this.mLossTimer); aNBT.setInteger("mTemperature", this.mTemperature); aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy); - if (this.mSteam != null) { - try { - aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound())); - } catch (Throwable e) { - } + aNBT.setInteger("mExcessWater", this.mExcessWater); + if (this.mSteam == null) { + return; } + try { + aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound())); + } catch (Throwable ignored) {} } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.mLossTimer = aNBT.getInteger("mLossTimer"); this.mTemperature = aNBT.getInteger("mTemperature"); this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy"); + this.mExcessWater = aNBT.getInteger("mExcessWater"); this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam")); } + /** + * Produce some steam. Assume water is present. + */ + protected void produceSteam(int aAmount) { + mExcessWater -= aAmount; + if (mExcessWater < 0) { + int tWaterToConsume = -mExcessWater / GT_Values.STEAM_PER_WATER; + mFluid.amount -= tWaterToConsume; + mExcessWater += GT_Values.STEAM_PER_WATER * tWaterToConsume; + } + if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += aAmount; + } else { + this.mSteam = GT_ModHandler.getSteam(aAmount); + } + } + + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > 40) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { - if (i != aBaseMetaTileEntity.getFrontFacing()) { - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); - if (tTileEntity != null) { - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); - } - } - } - } - } - if (aTick % 10L == 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) { - GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= 1; - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(150L); - } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += 150; - } else { - this.mSteam = GT_ModHandler.getSteam(150L); - } - } - } else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && - (this.mSteam.amount > 32000)) { - sendSound((byte) 1); - this.mSteam.amount = 24000; - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && - (this.mInventory[2] != null)) { - if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) { - this.mProcessingEnergy += 160; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) { - this.mProcessingEnergy += 160; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) { - this.mProcessingEnergy += 640; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); - } - } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) { - this.mProcessingEnergy += 120; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); - } + pollute(aTick); + + if (isNotAllowedToWork(aBaseMetaTileEntity, aTick)) + return; + + calculateCooldown(); + pushSteamToInventories(aBaseMetaTileEntity); + + if (canNotCreateSteam(aBaseMetaTileEntity, aTick)) { + pollute(aTick); + return; + } + + ventSteamIfTankIsFull(); + updateFuelTimed(aBaseMetaTileEntity, aTick); + calculateHeatUp(aBaseMetaTileEntity, aTick); + } + + private boolean isNotAllowedToWork(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + return (!aBaseMetaTileEntity.isServerSide()) || (aTick <= 20L); + } + + private void pollute(long aTick) { + if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); + } + } + + private void calculateHeatUp(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { + this.mProcessingEnergy -= getEnergyConsumption(); + this.mTemperature += getHeatUpAmount(); + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + + private void updateFuelTimed(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork())) + updateFuel(aBaseMetaTileEntity, aTick); + } + + private void ventSteamIfTankIsFull() { + if ((this.mSteam != null) && (this.mSteam.amount > getCapacity())) { + sendSound((byte) 1); + this.mSteam.amount = getCapacity() * 3 / 4; + } + } + + private boolean canNotCreateSteam(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aTick % 10L != 0L) { + return false; + } + + if (this.mTemperature > 100) { + if ((!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { + this.mHadNoWater = true; + } else { + if (this.mHadNoWater) { + GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); + aBaseMetaTileEntity.doExplosion(2048L); + return true; } + produceSteam(getProductionPerSecond() / 2); } - if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { - this.mProcessingEnergy -= 2; - this.mTemperature += 1; - } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } else { + this.mHadNoWater = false; } + return false; } + protected final void pushSteamToSide(IGregTechTileEntity aBaseMetaTileEntity, int aSide) { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide((byte) aSide); + if (tTileEntity == null) + return; + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained == null) + return; + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false); + if (tFilledAmount <= 0) + return; + tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), true); + } + + protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { + for (int i = 1; (this.mSteam != null) && (i < 6); i++) { + if (i == aBaseMetaTileEntity.getFrontFacing()) + continue; + pushSteamToSide(aBaseMetaTileEntity, i); + } + } + + private void calculateCooldown() { + if (this.mTemperature <= 20) { + this.mTemperature = 20; + this.mLossTimer = 0; + } else if (++this.mLossTimer > getCooldownInterval()) { + // only loss temperature if hot + this.mTemperature -= 1; + this.mLossTimer = 0; + } + } + + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation) - return true; - else - return false; + return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if(GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation) - return true; - else - return false; - + return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; } + @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ); - for (int l = 0; l < 8; l++) { - getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat(), 0.0D, 0.0D, 0.0D); - } + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 2, 1.0F, aX, aY, aZ); + + new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setIdentifier("largesmoke") + .setWorld(getBaseMetaTileEntity().getWorld()) + .setMotion(0D,0D,0D) + .<WorldSpawnedEventBuilder.ParticleEventBuilder>times(8, x -> x + .setPosition( + aX - 0.5D + XSTR_INSTANCE.nextFloat(), + aY, + aZ - 0.5D + XSTR_INSTANCE.nextFloat() + ).run() + ); } } + @Override + public int getTankPressure() { + return 100; + } + + protected boolean isOutputToFront() { + return false; + } + + protected abstract int getPollution(); + + @Override public int getCapacity() { return 16000; } - public int getTankPressure() { - return 100; + protected abstract int getProductionPerSecond(); + + protected abstract int getMaxTemperature(); + + protected abstract int getEnergyConsumption(); + + protected abstract int getCooldownInterval(); + + protected int getHeatUpAmount() { + return 1; } + + protected abstract void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index eeb8ec252f..5a89f50476 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -1,16 +1,12 @@ package gregtech.common.tileentities.boilers; -import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -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.objects.XSTR; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; @@ -19,14 +15,17 @@ import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; - -public class GT_MetaTileEntity_Boiler_Bronze - extends GT_MetaTileEntity_Boiler { +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; +public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[]{ "An early way to get Steam Power", @@ -46,159 +45,144 @@ public class GT_MetaTileEntity_Boiler_Bronze super(aName, aTier, aDescription, aTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[2][(i + 1)] = new ITexture[]{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)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; - rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)}; + final ITexture[] + texBottom = {TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM)}, + texTop = {TextureFactory.of(MACHINE_BRONZEBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, + texSide = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, + texFront = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, + texFrontActive = { + TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + for (int i = 0; i < 17; i++) { + rTextures[0][i] = texBottom; + rTextures[1][i] = texTop; + rTextures[2][i] = texSide; + rTextures[3][i] = texFront; + rTextures[4][i] = texFrontActive; } return rTextures; } + @Override public int maxProgresstime() { return 500; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "BronzeBoiler.png", 16000); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Bronze(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - singleBlockBoilerLogic(aBaseMetaTileEntity,aTick,1,45,25L,20); + super.onPostTick(aBaseMetaTileEntity, aTick); + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) && this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); + } } - protected void singleBlockBoilerLogic(IGregTechTileEntity aBaseMetaTileEntity, long aTick, int aMultiplier, int aTimer, long aTickDivider, int aPollution){ - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > aTimer) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { - if (i != aBaseMetaTileEntity.getFrontFacing()) { - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); - if (tTileEntity != null) { - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); - } - } - } - } - } - if (aTick % aTickDivider == 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) { - GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= 1; - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(150L); - } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += 150; - } else { - this.mSteam = GT_ModHandler.getSteam(150L); - } - } - } else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && - (this.mSteam.amount > (16000*aMultiplier))) { - sendSound((byte) 1); - this.mSteam.amount = (12000*aMultiplier); - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && - (this.mInventory[2] != null)) { - if ( - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Diamond) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke") - ) { - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10); - aBaseMetaTileEntity.decrStackSize(2, 1); - if (XSTR.XSTR_INSTANCE.nextInt(GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) ? 3 : GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) ? 8 : 2 ) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal)) ? Materials.DarkAsh : Materials.Ash, 1L)); - } - } - } - else if ( - //If its a block of the following materials - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal))|| - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) || - - //if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block - ( - Block.getBlockFromItem(this.mInventory[2].getItem()) != null && //check if the block exists - ( - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("tile") && //check if the block is a tile -> block - ( - //If the name of the block contains these names - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("charcoal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("diamond") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coke") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("railcraft.cube") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") - ) - ) - ) - ){ - //try to add 10% of the burnvalue as Processing energy, no boost for coal coke here - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); - aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dust, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") ) ? Materials.DarkAsh : Materials.Ash, 1L)); - } - //enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal Singularities, Nitor, while bucket of creosite should be blocked same goes for lava - }else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))){ - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); - aBaseMetaTileEntity.decrStackSize(2, 1); - //adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values - if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get( (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 ? OrePrefixes.dust : OrePrefixes.dustSmall : OrePrefixes.dustTiny), Materials.Ash, 1L)); + @Override + protected int getPollution() { + return 20; + } + + @Override + protected int getProductionPerSecond() { + return 120; + } + + @Override + protected int getMaxTemperature() { + return 500; + } + + @Override + protected int getEnergyConsumption() { + return 1; + } + + @Override + protected int getCooldownInterval() { + return 45; + } + + @Override + protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (this.mInventory[2] == null) return; + if ( + (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || + (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || + (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || + (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Diamond) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke") + ) { + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10); + aBaseMetaTileEntity.decrStackSize(2, 1); + if (XSTR.XSTR_INSTANCE.nextInt(GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) ? 3 : GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) ? 8 : 2 ) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal)) ? Materials.DarkAsh : Materials.Ash, 1L)); } } - if ((this.mTemperature < (500*aMultiplier)) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { - this.mProcessingEnergy -= aMultiplier; - this.mTemperature += 1; - } - if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), aPollution); + } + else if ( + //If its a block of the following materials + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) || + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal))|| + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) || + + //if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block + ( + Block.getBlockFromItem(this.mInventory[2].getItem()) != null && //check if the block exists + ( + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("tile") && //check if the block is a tile -> block + ( + //If the name of the block contains these names + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("charcoal") || + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("diamond") || + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coke") || + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("railcraft.cube") || + Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") + ) + ) + ) + ){ + //try to add 10% of the burnvalue as Processing energy, no boost for coal coke here + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); + aBaseMetaTileEntity.decrStackSize(2, 1); + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dust, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") ) ? Materials.DarkAsh : Materials.Ash, 1L)); } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + //enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal Singularities, Nitor, while bucket of creosite should be blocked same goes for lava + }else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))){ + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); + aBaseMetaTileEntity.decrStackSize(2, 1); + //adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values + if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get( (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 ? OrePrefixes.dust : OrePrefixes.dustSmall : OrePrefixes.dustTiny), Materials.Ash, 1L)); } + } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index d6e3d71b81..c71126b146 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -1,31 +1,41 @@ package gregtech.common.tileentities.boilers; -import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -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_Log; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.common.GT_Pollution; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; -public class GT_MetaTileEntity_Boiler_Lava - extends GT_MetaTileEntity_Boiler { +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; + +public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { + + public static final int COOLDOWN_INTERVAL = 20; + public static final int ENERGY_PER_LAVA = 1; + public static final int CONSUMPTION_PER_HEATUP = 3; + public static final int PRODUCTION_PER_SECOND = 600; + public static final int POLLUTION_PER_SECOND = 20; + public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[]{ "A Boiler running off Lava", - "Produces 600L of Steam per second", - "Causes 20 Pollution per second"}); + "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", + "Causes " + POLLUTION_PER_SECOND + " Pollution per second", + "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"}); } public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -36,109 +46,91 @@ public class GT_MetaTileEntity_Boiler_Lava super(aName, aTier, aDescription, aTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[3][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)}; - rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)}; + final ITexture[] + texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, + texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, + texFront = { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT), + TextureFactory.of(BOILER_LAVA_FRONT_GLOW)}, + texFrontActive = { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), + TextureFactory.builder().addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW).glow().build()}; + for (byte i = 0; i < 17; i++) { + rTextures[0][i] = texBottom; + rTextures[1][i] = texTop; + rTextures[2][i] = texSide; + rTextures[3][i] = texFront; + rTextures[4][i] = texFrontActive; } return rTextures; } + @Override public int maxProgresstime() { return 1000; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > 20) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { - if (i != aBaseMetaTileEntity.getFrontFacing()) { - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); - if (tTileEntity != null) { - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); - } - } - } - } - } - if (aTick % 10L == 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) { - GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= 1; - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(300L); - } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += 300; - } else { - this.mSteam = GT_ModHandler.getSteam(300L); - } - } - } else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && - (this.mSteam.amount > 32000)) { - sendSound((byte) 1); - this.mSteam.amount = 24000; - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && - (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava)))) { - this.mProcessingEnergy += 1000; - aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); - } - if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L)) { - this.mProcessingEnergy -= 3; - this.mTemperature += 1; - } + @Override + protected int getPollution() { + return POLLUTION_PER_SECOND; + } - if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), 20); - } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + @Override + protected int getProductionPerSecond() { + return PRODUCTION_PER_SECOND; + } + + @Override + protected int getMaxTemperature() { + return 1000; + } + + @Override + protected int getEnergyConsumption() { + return CONSUMPTION_PER_HEATUP; + } + + @Override + protected int getCooldownInterval() { + return COOLDOWN_INTERVAL; + } + + @Override + protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava))) { + this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA; + aBaseMetaTileEntity.decrStackSize(2, 1); + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); } } + @Override public final int fill(FluidStack aFluid, boolean doFill) { if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) { int tFilledAmount = Math.min(50, aFluid.amount); if (doFill) { - this.mProcessingEnergy += tFilledAmount; + this.mProcessingEnergy += tFilledAmount * ENERGY_PER_LAVA; } return tFilledAmount; } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index d7fd69edb2..59f84ebd91 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -1,200 +1,317 @@ package gregtech.common.tileentities.boilers; import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; +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.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; +import static gregtech.api.GregTech_API.sMachineFile; +import static gregtech.api.enums.ConfigCategories.machineconfig; + +public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { + public static final String LPS_FMT = "%s L/s"; + private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( + "gt.blockmachines.boiler.solar.desc.format", + "Steam Power by the Sun%n" + + "Produces %sL of Steam per second%n" + + "Calcifies over time, reducing Steam output to %sL/s%n" + + "Break and replace to descale"); + protected final Config mConfig; + protected int basicTemperatureMod = 5; // Base Celsius gain or loss + private int mRunTimeTicks = 0; -public class GT_MetaTileEntity_Boiler_Solar - extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[0]); + mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + mConfig = createConfig(); + } + + protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + super(aName, aTier, aDescription, aTextures); + mConfig = aConfig; + } + + protected Config createConfig() { + return new Config(machineconfig + ".boiler.solar.bronze",1080000,40,120,45); + } + + /** + * for WAILA + * + * @deprecated replaced by {@link #getMaxOutputPerSecond()} + */ + @Deprecated + public int getBasicOutput() { + return (int) (getMaxOutputPerSecond() * 1.25F); + } + + public int getMaxOutputPerSecond() { + return mConfig.getMaxOutputPerSecond(); + } + + /** + * for WAILA + * + * @deprecated replaced by {@link #getProductionPerSecond()} + */ + @SuppressWarnings("unused") + @Deprecated + public int getCalcificationOutput() { + return (int) (getProductionPerSecond() * 1.25F); } @Override public String[] getDescription() { - return new String[]{ - "Steam Power by the Sun", - "Produces 120L of Steam per second", - "Calcifies over time, reducing Steam output to 40L/s", - "Break and replace to decalcify"}; + return String.format(localizedDescFormat, + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getMinOutputPerSecond())) + .split("\\R"); } + public int getMinOutputPerSecond() { + return mConfig.getMinOutputPerSecond(); + } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[0][(i + 1)] = tmp0; - 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; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = tmp2; - 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; + for (int color = -1; color < 16; color++) { + int i = color + 1; + short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); + rTextures[0][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR)}; + rTextures[2][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; } return rTextures; } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1]; + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, getCapacity()); } - public int maxProgresstime() { - return 500; + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", getCapacity()); } - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + int i = aColorIndex + 1; + if (aSide >= 2) { + if (aSide != aFacing) return mTextures[2][i]; + return mTextures[3][i]; + } + return mTextures[aSide][i]; } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000); + @Override + public int maxProgresstime() { + return 500; } - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - private int mRunTime = 0; - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setInteger("mRunTime", this.mRunTime); + aNBT.setInteger("mRunTime", mRunTimeTicks); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - this.mRunTime = aNBT.getInteger("mRunTime"); + mRunTimeTicks = aNBT.getInteger("mRunTime"); } @Override - public String[] getInfoData() { - return new String[]{ - "Heat Capacity: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTemperature * 100 / maxProgresstime()) + " % " + EnumChatFormatting.RESET - + " Hot time: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mRunTime*25/20)+EnumChatFormatting.RESET+" s", - "Min output: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.basicMaxOuput*20/25)+EnumChatFormatting.RESET+ " L/s" - + " Max output: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.basicOutput*20/25)+EnumChatFormatting.RESET+" L/s", - "Current Output: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getCalcificationOutput()*20/25) +EnumChatFormatting.RESET+" L/s"}; + protected void produceSteam(int aAmount) { + super.produceSteam(aAmount); + // produceSteam is getting called every 10 ticks + if (mRunTimeTicks >= 0 && mRunTimeTicks < (Integer.MAX_VALUE - 10)) mRunTimeTicks += 10; + else mRunTimeTicks = Integer.MAX_VALUE; // Prevent Integer overflow wrap } @Override - public boolean isGivingInformation() { - return true; + protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { + if (mSteam == null || mSteam.amount == 0) return; + pushSteamToSide(aBaseMetaTileEntity, aBaseMetaTileEntity.getFrontFacing()); } - protected int basicOutput = 150; - protected int basicMaxOuput = 50; - protected int basicTemperatureMod = 5; - protected int basicLossTimerLimit = 45; + @Override + protected int getPollution() { + return 0; + } - // Calcification start time is 43200*25/20=54,000s or 15 hours of game time. - static final int CALCIFICATION_TIME = 43200; - - public int getCalcificationOutput() { // Returns how much output the boiler can do. - if (this.mTemperature < 100 ) { + @Override + public int getProductionPerSecond() { + if (mTemperature < 100) { return 0; } - if (this.mRunTime > CALCIFICATION_TIME) { - // Calcification takes about 2/3 CALCIFICATION_TIME to completely calcify on basic solar. For HP solar, it takes about 2x CALCIFICATION_TIME - return Math.max(this.basicMaxOuput, this.basicOutput - ((this.mRunTime - CALCIFICATION_TIME) / (CALCIFICATION_TIME/150))); // Every 288*25 ticks, or 6 minutes, lose 1 L output. + if (mRunTimeTicks > mConfig.getMaxRuntimeTicks()) { + return mConfig.getMinOutputPerSecond(); + } else if (mRunTimeTicks > mConfig.getCalcificationTicks()) { + /* When reaching calcification ticks; discount the proportion of run-time spent on calcification + * from the maximum output per second, and return this or the minimum output per second + */ + return mConfig.getMaxOutputPerSecond() + - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) / mConfig.getCalcificationTicks(); } else { - return this.basicOutput; + return mConfig.getMaxOutputPerSecond(); } } - public int getBasicOutput() { - return this.basicOutput; + @Override + protected int getMaxTemperature() { + return 500; } - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > basicLossTimerLimit) { - this.mTemperature -= basicTemperatureMod; - this.mLossTimer = 0; - } - if (this.mSteam != null) { - byte i = aBaseMetaTileEntity.getFrontFacing(); - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); - if (tTileEntity != null) { - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); - } - } - } - } - if (aTick % 25L == 0L) { // Every 25 ticks since 1L of water = 150L of steam. So for 120L, have to use 25 instead of 20. - if (this.mTemperature > 100) { - if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { - this.mHadNoWater = true; - } else { - if (this.mHadNoWater) { - GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= (basicOutput/150); - mRunTime += 1; - - int tOutput = getCalcificationOutput(); - - 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 > this.getCapacity())) { - sendSound((byte) 1); - this.mSteam.amount = 3*(this.getCapacity()/4); - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { - boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F; - mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8*basicTemperatureMod : basicTemperatureMod; - } - if ((this.mTemperature < maxProgresstime()) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { - this.mProcessingEnergy -= basicTemperatureMod; - this.mTemperature += basicTemperatureMod; + @Override + protected int getEnergyConsumption() { + return basicTemperatureMod; + } + + @Override + protected int getCooldownInterval() { + return mConfig.getCoolDownTicks() / basicTemperatureMod; + } + + @Override + protected int getHeatUpAmount() { + return basicTemperatureMod; + } + + @Override + protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + World world = aBaseMetaTileEntity.getWorld(); + // Heat-up every 12s (240 ticks), has to be multiple of 20 ticks + if ((aTick % 240L != 0L) || (world.isThundering())) { + return; + } + if (!aBaseMetaTileEntity.getSkyAtSide((byte) ForgeDirection.UP.ordinal())) { + return; + } + boolean weatherClear = !world.isRaining() || aBaseMetaTileEntity.getBiome().rainfall == 0.0F; + if (!weatherClear && world.skylightSubtracted >= 4) { + return; + } + if (weatherClear) { + if (world.isDaytime()) { + mProcessingEnergy += 8 * basicTemperatureMod; + } else { + mProcessingEnergy += basicTemperatureMod; } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } else { + mProcessingEnergy += basicTemperatureMod; + } + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + return String.format("Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + + " Hot time: " + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + + "Min output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + + " Max output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + + "Current Output: " + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, + GT_Utility.formatNumbers(getHeatCapacityPercent()), + GT_Utility.formatNumbers(getHotTimeSeconds()), + GT_Utility.formatNumbers(getMinOutputPerSecond()), + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getProductionPerSecond())) + .split("\\R"); + } + + public int getHeatCapacityPercent() { + return mTemperature * 100 / maxProgresstime(); + } + + public int getHotTimeSeconds() { + return mRunTimeTicks / 20; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Solar(mName, mTier, mDescriptionArray, mTextures, mConfig); + } + + protected static class Config { + private final int calcificationTicks; + private final int minOutputPerSecond; + private final int maxOutputPerSecond; + private final int coolDownTicks; + private final int maxRuntimeTicks; + + public Config(String aCategory, + int aDefaultCalcificationTicks, + int aDefaultMinOutputPerSecond, + int aDefaultMaxOutputPerSecond, + int aDefaultCoolDownTicks) { + calcificationTicks = get(aCategory,"CalcificationTicks", aDefaultCalcificationTicks, + "Number of run-time ticks before boiler starts calcification.", + "100% calcification and minimal output will be reached at 2 times this."); + minOutputPerSecond = get(aCategory,"MinOutputPerSecond", aDefaultMinOutputPerSecond); + maxOutputPerSecond = get(aCategory,"MaxOutputPerSecond", aDefaultMaxOutputPerSecond); + coolDownTicks = get(aCategory,"CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); + // After which min output is reached. + maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() / getMaxOutputPerSecond() + getCalcificationTicks(); + } + + protected int get(final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { + final StringBuilder tCommentBuilder = new StringBuilder(); + for (String tComment: aComments) + tCommentBuilder.append(tComment).append('\n'); + tCommentBuilder.append("Default: ").append(aDefaultValue); + return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()).getInt(); + } + + public int getCalcificationTicks() { + return calcificationTicks; + } + + public int getMinOutputPerSecond() { + return minOutputPerSecond; + } + + public int getMaxOutputPerSecond() { + return maxOutputPerSecond; + } + + public int getCoolDownTicks() { + return coolDownTicks; + } + + public int getMaxRuntimeTicks() { + return maxRuntimeTicks; } } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index 594d338204..ff77b049c4 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -1,75 +1,71 @@ package gregtech.common.tileentities.boilers; import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; +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.objects.GT_RenderedTexture; -import gregtech.common.gui.GT_Container_Boiler; +import gregtech.api.render.TextureFactory; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.ConfigCategories.machineconfig; + public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar { public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; // Cools down slower than normal boiler } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; } + public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + super(aName, aTier, aDescription, aTextures, aConfig); + } + + @Override + protected Config createConfig() { + return new Config(machineconfig + ".boiler.solar.steel", 1080000, 120, 360, 75); + } + + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)}; - rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[3][(i + 1)] = tmp3; + for (int color = -1; color < 16; color++) { + int i = color + 1; + short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); + rTextures[0][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR)}; + rTextures[2][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[]{ + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; } return rTextures; } - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); - } - + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarHPBoiler.png", 32000); + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarHPBoiler.png", getCapacity()); } @Override - public String[] getDescription() { - return new String[]{ - "Steam Power by the Sun", - "Produces 360L of Steam per second", - "Calcifies over time, reducing Steam output to 120L/s", - "Break and replace to decalcify"}; - } - public int getCapacity() { return 32000; } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); } - } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 5655bb47c5..50f68425d7 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -1,17 +1,23 @@ package gregtech.common.tileentities.boilers; -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.render.TextureFactory; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -public class GT_MetaTileEntity_Boiler_Steel - extends GT_MetaTileEntity_Boiler_Bronze {//TODO CHECK POLLUTION VALUES AND DESCRIPTIONS FOR POLLUTION SPOILERS +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; + +public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { @@ -29,40 +35,77 @@ public class GT_MetaTileEntity_Boiler_Steel super(aName, aTier, aDescription, aTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp4 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; - rTextures[3][(i + 1)] = tmp4; - ITexture[] tmp5 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)}; - rTextures[4][(i + 1)] = tmp5; + final ITexture[] + texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, + texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, + texFront = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, + texFrontActive = { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + for (int i = 0; i < 17; i++) { + rTextures[0][i] = texBottom; + rTextures[1][i] = texTop; + rTextures[2][i] = texSide; + rTextures[3][i] = texFront; + rTextures[4][i] = texFrontActive; } return rTextures; } + @Override public int maxProgresstime() { return 1000; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.singleBlockBoilerLogic(aBaseMetaTileEntity,aTick,2,40,10L,30); + @Override + protected int getPollution() { + return 30; + } + + @Override + public int getCapacity() { + return 32000; + } + + @Override + protected int getProductionPerSecond() { + return 300; + } + + @Override + protected int getMaxTemperature() { + return 1000; + } + + @Override + protected int getEnergyConsumption() { + return 2; + } + + @Override + protected int getCooldownInterval() { + return 40; } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index c745bfae20..606af204e9 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -4,20 +4,20 @@ 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.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_DieselGenerator - extends GT_MetaTileEntity_BasicGenerator { +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator { public static final int BASE_POLLUTION = 2; @@ -40,18 +40,22 @@ public class GT_MetaTileEntity_DieselGenerator onConfigLoad(); } + @Override public boolean isOutputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getFrontFacing(); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { return GT_Recipe.GT_Recipe_Map.sDieselFuels; } + @Override public int getCapacity() { return 16000; } @@ -60,73 +64,107 @@ public class GT_MetaTileEntity_DieselGenerator this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 5)); } + @Override public int getEfficiency() { return this.mEfficiency; } + @Override public int getFuelValue(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0; long 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); + rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3L); } - if(rValue> Integer.MAX_VALUE){ + if (rValue > Integer.MAX_VALUE) { throw new ArithmeticException("Integer LOOPBACK!"); } - return (int)rValue; + return (int) rValue; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){ - GT_Log.err.println("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord()); + if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) { + GT_Log.err.println("Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord()); aBaseMetaTileEntity.setToFire(); } super.onPostTick(aBaseMetaTileEntity, aTick); } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)}; + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_GLOW).glow().build())}; } + @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)}; + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_GLOW).glow().build())}; } + @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)}; + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_GLOW).glow().build())}; } + @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)}; + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_GLOW).glow().build())}; } + @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)}; + return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)}; + return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)}; + return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)}; + return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW).glow().build())}; } @Override public int getPollution() { - return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1)); + return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1)); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index ce03f6b505..02b42e2b2f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -2,17 +2,16 @@ package gregtech.common.tileentities.generators; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_GasTurbine - extends GT_MetaTileEntity_BasicGenerator { +import static gregtech.api.enums.Textures.BlockIcons.*; +public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerator { public static final int BASE_POLLUTION = 1; public int mEfficiency; @@ -34,18 +33,22 @@ public class GT_MetaTileEntity_GasTurbine onConfigLoad(); } + @Override public boolean isOutputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getFrontFacing(); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_GasTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { return GT_Recipe.GT_Recipe_Map.sTurbineFuels; } + @Override public int getCapacity() { return 16000; } @@ -55,52 +58,85 @@ public class GT_MetaTileEntity_GasTurbine } + @Override public int getEfficiency() { return this.mEfficiency; } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT), + TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK)}; + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK), + TextureFactory.builder().addIcon(GAS_TURBINE_BACK_GLOW).glow().build())}; } + @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM)}; + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM), + TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_GLOW).glow().build())}; } + @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP)}; + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP), + TextureFactory.builder().addIcon(GAS_TURBINE_TOP_GLOW).glow().build())}; } + @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE)}; + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE), + TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_GLOW).glow().build())}; } + @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE)}; + return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE)}; + return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE)}; + return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)}; + return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW).glow().build())}; } @Override public int getPollution() { - return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1)); + return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1)); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 0057e87670..88d49075e5 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.generators; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; 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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; @@ -30,7 +31,20 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],aSide==1?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; + if (aSide != ForgeDirection.UP.ordinal()) { + return new ITexture[]{ + BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; + } + if (!aActive) return new ITexture[]{ + BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) + }; + return new ITexture[]{ + BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build() + }; } @Override @@ -38,6 +52,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach return null; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LightningRod(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @@ -46,13 +61,13 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { World aWorld = aBaseMetaTileEntity.getWorld(); if (!aWorld.isRemote) { - if(aBaseMetaTileEntity.getStoredEU()>0){ + if (aBaseMetaTileEntity.getStoredEU() > 0) { aBaseMetaTileEntity.setActive(true); - aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU()/100+1, false); - }else { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(aBaseMetaTileEntity.getStoredEU() / 100 + 1, false); + } else { aBaseMetaTileEntity.setActive(false); } - + if (aTick % 256 == 0 && (aWorld.isThundering() || (aWorld.isRaining() && XSTR_INSTANCE.nextInt(10) == 0))) { int aRodValue = 0; boolean isRodValid = true; @@ -60,13 +75,13 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach int aY = aBaseMetaTileEntity.getYCoord(); int aZ = aBaseMetaTileEntity.getZCoord(); - for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight()-1; i++) { + for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight() - 1; i++) { if (isRodValid && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) { aRodValue++; } else { isRodValid = false; if (aBaseMetaTileEntity.getBlock(aX, i, aZ) != Blocks.air) { - aRodValue=0; + aRodValue = 0; break; } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index eda960bf2b..aceab00a02 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -2,21 +2,28 @@ package gregtech.common.tileentities.generators; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_MagicEnergyConverter - extends GT_MetaTileEntity_BasicGenerator { - +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; + +public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here"); onConfigLoad(); } @@ -30,18 +37,22 @@ public class GT_MetaTileEntity_MagicEnergyConverter onConfigLoad(); } + @Override public boolean isOutputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getFrontFacing(); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MagicEnergyConverter(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { return GT_Recipe.GT_Recipe_Map.sMagicFuels; } + @Override public int getCapacity() { return 16000; } @@ -51,52 +62,95 @@ public class GT_MetaTileEntity_MagicEnergyConverter } + @Override public int getEfficiency() { return this.mEfficiency; } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{ + super.getFront(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier]}; } + @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)}; + return new ITexture[]{ + super.getBack(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()}; } + @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)}; + return new ITexture[]{ + super.getBottom(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; } + @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)}; + return new ITexture[]{ + super.getTop(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; } + @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)}; + return new ITexture[]{ + super.getSides(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; } + @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{ + super.getFrontActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier]}; } + @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)}; + return new ITexture[]{ + super.getBackActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)}; + return new ITexture[]{ + super.getBottomActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)}; + return new ITexture[]{ + super.getTopActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)}; + return new ITexture[]{ + super.getSidesActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; } @Override public int getPollution() { return 0; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index b92307002e..5516b355fd 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -4,13 +4,16 @@ import com.google.common.base.Enums; import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.TC_Aspects; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.*; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.BlockDragonEgg; import net.minecraft.enchantment.Enchantment; @@ -27,16 +30,31 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; -import thaumcraft.api.aspects.*; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.aspects.AspectSourceHelper; +import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.visnet.VisNetHandler; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import static gregtech.api.enums.ConfigCategories.machineconfig; import static gregtech.api.enums.GT_Values.MOD_ID_TC; import static gregtech.api.enums.GT_Values.V; -import static net.minecraft.util.EnumChatFormatting.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static net.minecraft.util.EnumChatFormatting.GRAY; +import static net.minecraft.util.EnumChatFormatting.GREEN; +import static net.minecraft.util.EnumChatFormatting.LIGHT_PURPLE; +import static net.minecraft.util.EnumChatFormatting.RESET; +import static net.minecraft.util.EnumChatFormatting.UNDERLINE; +import static net.minecraft.util.EnumChatFormatting.YELLOW; interface MagicalEnergyBBListener { void onMagicalEnergyBBUpdate(); @@ -46,17 +64,17 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private static final boolean THAUMCRAFT_LOADED = Loader.isModLoaded(MOD_ID_TC); private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>(4); - private static List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<Aspect>(); + private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<Aspect>(); private static boolean sAllowMultipleEggs = false; private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null; private static int sEnergyPerEndercrystal = 512; private static int sEnergyFromVis = 20; private static int sEnergyPerEssentia = 320; - private static Map<Aspect, Integer> sAspectsEnergy = new HashMap<>(); + private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>(); private static int sDragonEggEnergyPerTick = 2048; private int mEfficiency; private int mMaxVisPerDrain; - private MagicalEnergyBB mMagicalEnergyBB = new MagicalEnergyBB(this, mTier, mTier + 2); + private final MagicalEnergyBB mMagicalEnergyBB = new MagicalEnergyBB(this, mTier, mTier + 2); private long mNextGenerateTickRate = 1; private int mNoGenerationTicks = 0; @@ -185,54 +203,84 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[]{ + super.getFront(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier]}; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)}; + return new ITexture[]{ + super.getBack(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()}; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)}; + return new ITexture[]{ + super.getBottom(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG)}; + return new ITexture[]{ + super.getTop(aColor)[0], + TextureFactory.of(MACHINE_CASING_DRAGONEGG)}; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)}; + return new ITexture[]{ + super.getSides(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()}; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + return new ITexture[]{ + super.getFrontActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier]}; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)}; + return new ITexture[]{ + super.getBackActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()}; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)}; + return new ITexture[]{ + super.getBottomActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG)}; + return new ITexture[]{ + super.getTopActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_DRAGONEGG), + TextureFactory.builder().addIcon(MACHINE_CASING_DRAGONEGG_GLOW).glow().build() + }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)}; + return new ITexture[]{ + super.getSidesActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()}; } @Override @@ -470,12 +518,12 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B * Handles Bounding Box ranged operations for Magic sources */ static class MagicalEnergyBB { - private GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber; - private MagicalEnergyBBListener mListener; - private int mDefaultTier; + private final GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber; + private final MagicalEnergyBBListener mListener; + private final int mDefaultTier; private int mTier; - private int mMaxTier; - private List<UUID> mLivingCrystalIDs = new ArrayList<>(); + private final int mMaxTier; + private final List<UUID> mLivingCrystalIDs = new ArrayList<>(); private List<Aspect> mAvailableAspects; /** @@ -639,4 +687,4 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index c075fda8a4..0a99a4af05 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -2,20 +2,21 @@ package gregtech.common.tileentities.generators; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGenerator { private int mEfficiency; public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, aDescription, new ITexture[0]); + super(aID, aName, aNameRegional, aTier, aDescription); if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); } @@ -30,17 +31,20 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe onConfigLoad(); } + @Override public boolean isOutputFacing(byte aSide) { return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_NaquadahReactor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_NaquadahReactor(mName, mTier, mDescriptionArray, mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { GT_Recipe.GT_Recipe_Map ret; - switch (this.mTier){ + switch (mTier) { case 4: { ret = GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels; break; @@ -57,11 +61,11 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe ret = GT_Recipe.GT_Recipe_Map.sExtremeNaquadahReactorFuels; break; } - case 8:{ + case 8: { ret = GT_Recipe.GT_Recipe_Map.sUltraHugeNaquadahReactorFuels; break; } - default:{ + default: { ret = null; break; } @@ -70,60 +74,97 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe return ret; } + @Override public int getCapacity() { - return getRecipes() != null ? getRecipes().mMinimalInputFluids>0 ? 8000*(mTier+1) : 0 : 0 ; + return getRecipes() != null ? getRecipes().mMinimalInputFluids > 0 ? 8000 * (mTier + 1) : 0 : 0; } + @Override public int getEfficiency() { return mEfficiency == 0 ? onConfigLoad() : mEfficiency; } - private int getBaseEff(){ - return mTier == 4 ? 80 : 100 + (50*(mTier-5)); + private int getBaseEff() { + return mTier == 4 ? 80 : 100 + (50 * (mTier - 5)); } public int onConfigLoad() { - return this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + this.mTier, getBaseEff()); + return mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT)}; + return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW).glow().build())}; } + @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK)}; + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW).glow().build())}; } + @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM)}; + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW).glow().build())}; } + @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP)}; + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW).glow().build())}; } + @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE)}; + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_SIDE_GLOW).glow().build())}; } + @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE)}; + return new ITexture[]{ + super.getFrontActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK_ACTIVE)}; + return new ITexture[]{ + super.getBackActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE)}; + return new ITexture[]{ + super.getBottomActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE)}; + return new ITexture[]{ + super.getTopActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE)}; + return new ITexture[]{ + super.getSidesActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW).glow().build()}; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java index 52c7e1112c..4ab048a0f7 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -2,21 +2,24 @@ package gregtech.common.tileentities.generators; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_PlasmaGenerator - extends GT_MetaTileEntity_BasicGenerator { +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; + +public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Plasma into energy"); onConfigLoad(); } @@ -30,73 +33,106 @@ public class GT_MetaTileEntity_PlasmaGenerator onConfigLoad(); } - public boolean isOutputFacing(byte aSide) { - return aSide == getBaseMetaTileEntity().getFrontFacing(); + @Override + public ITexture[] getFront(byte aColor) { + return new ITexture[]{ + super.getFront(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS), + OVERLAYS_ENERGY_OUT[mTier]}; } - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + @Override + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } - public GT_Recipe.GT_Recipe_Map getRecipes() { - return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; + @Override + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } - public int getCapacity() { - return 16000; + @Override + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10,10 + Math.min(90,this.mTier * 10))); + @Override + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } - - public int getEfficiency() { - return this.mEfficiency; + @Override + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{ + super.getFrontActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier]}; } - public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + @Override + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{ + super.getBackActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; } - public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + @Override + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{ + super.getBottomActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; } - public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + @Override + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{ + super.getTopActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; } - public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + @Override + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{ + super.getSidesActive(aColor)[0], + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()}; } - public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); } - public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + @Override + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; } - public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + @Override + public int getEfficiency() { + return this.mEfficiency; } - public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + @Override + public int getCapacity() { + return 16000; } - public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } - public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10, 10 + Math.min(90, this.mTier * 10))); } - @Override + @Override public int getPollution() { return 0; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index b248dc5aae..d7b3f03fde 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -2,16 +2,17 @@ package gregtech.common.tileentities.generators; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import net.minecraftforge.fluids.FluidStack; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; @@ -33,14 +34,17 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener onConfigLoad(); } + @Override public boolean isOutputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getFrontFacing(); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { return null; } @@ -55,6 +59,7 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener return desc; } + @Override public int getCapacity() { return 24000 * this.mTier; } @@ -63,60 +68,92 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); } + @Override public int getEfficiency() { return this.mEfficiency; } + @Override public int getFuelValue(FluidStack aLiquid) { if (aLiquid == null) return 0; - String fluidName = aLiquid.getFluid().getUnlocalizedName(aLiquid); - return GT_ModHandler.isSteam(aLiquid) || fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name") ? 3 : 0; + return GT_ModHandler.isAnySteam(aLiquid) ? 3 : 0; } + @Override public int consumedFluidPerOperation(FluidStack aLiquid) { return this.mEfficiency; } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT), + TextureFactory.builder().addIcon(STEAM_TURBINE_FRONT_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK)}; + return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK), + TextureFactory.builder().addIcon(STEAM_TURBINE_BACK_GLOW).glow().build())}; } + @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM)}; + return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM), + TextureFactory.builder().addIcon(STEAM_TURBINE_BOTTOM_GLOW).glow().build())}; } + @Override public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP)}; + return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP), + TextureFactory.builder().addIcon(STEAM_TURBINE_TOP_GLOW).glow().build())}; } + @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)}; + return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE), + TextureFactory.builder().addIcon(STEAM_TURBINE_SIDE_GLOW).glow().build())}; } + @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT_ACTIVE), + TextureFactory.builder().addIcon(STEAM_TURBINE_FRONT_ACTIVE_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier]}; } + @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE)}; + return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK_ACTIVE), + TextureFactory.builder().addIcon(STEAM_TURBINE_BACK_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE)}; + return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(STEAM_TURBINE_BOTTOM_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE)}; + return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP_ACTIVE), + TextureFactory.builder().addIcon(STEAM_TURBINE_TOP_ACTIVE_GLOW).glow().build())}; } + @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE)}; + return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE_ACTIVE), + TextureFactory.builder().addIcon(STEAM_TURBINE_SIDE_ACTIVE_GLOW).glow().build())}; } @Override @@ -126,7 +163,7 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener @Override public boolean isFluidInputAllowed(FluidStack aFluid) { - if (aFluid.getFluid().getUnlocalizedName(aFluid).equals("ic2.fluidSuperheatedSteam")) { + if (GT_ModHandler.isSuperHeatedSteam(aFluid)) { aFluid.amount = 0; aFluid = null; return false; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java index 27ffc096f0..c62145be13 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -6,10 +6,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_BasicHull_Bronze - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -22,16 +21,18 @@ public class GT_MetaTileEntity_BasicHull_Bronze super(aName, aTier, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_Bronze(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[0][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[1][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[2][(i + 1)] = new ITexture[]{TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; } return rTextures; } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java index 694a701306..90ec54b1fa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -6,10 +6,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_BasicHull_BronzeBricks - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_BronzeBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -22,18 +21,20 @@ public class GT_MetaTileEntity_BasicHull_BronzeBricks super(aName, aTier, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java index f697b75f0f..24c3f589e8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -6,11 +6,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_BasicHull_Steel - extends GT_MetaTileEntity_BasicHull_NonElectric { - public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) { +public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -22,18 +20,20 @@ public class GT_MetaTileEntity_BasicHull_Steel super(aName, aTier, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java index a86fb19928..57ef19478e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -6,10 +6,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; -public class GT_MetaTileEntity_BasicHull_SteelBricks - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_SteelBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -22,18 +21,20 @@ public class GT_MetaTileEntity_BasicHull_SteelBricks super(aName, aTier, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp0 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp1 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + ITexture[] tmp2 = {TextureFactory.of(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java new file mode 100644 index 0000000000..12d839d221 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java @@ -0,0 +1,131 @@ +package gregtech.common.tileentities.machines; + +import appeng.api.AEApi; +import appeng.api.networking.GridFlags; +import appeng.api.networking.energy.IEnergySource; +import appeng.api.networking.security.BaseActionSource; +import appeng.api.networking.security.IActionHost; +import appeng.api.networking.security.MachineSource; +import appeng.api.storage.IMEMonitor; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.util.AECableType; +import appeng.me.GridAccessException; +import appeng.me.helpers.AENetworkProxy; +import appeng.me.helpers.IGridProxyable; +import appeng.util.Platform; +import cpw.mods.fml.common.Optional; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.render.TextureFactory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH; + +public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus { + private BaseActionSource requestSource = null; + private AENetworkProxy gridProxy = null; + + public GT_MetaTileEntity_Hatch_OutputBus_ME(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 1, new String[]{ + "Item Output for Multiblocks", "Stores directly into ME"}, 0); + } + + public GT_MetaTileEntity_Hatch_OutputBus_ME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, 0, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_OutputBus_ME(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH)}; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + getProxy(); + } + + @Override + public boolean storeAll(ItemStack aStack) { + if (!GregTech_API.mAE2) + return false; + int tTotal = aStack.stackSize; + int tStored = store(aStack); + aStack.stackSize -= tStored; + return tTotal == tStored; + } + + @Optional.Method(modid = "appliedenergistics2") + public int store(final ItemStack stack) { + if (stack == null) + return 0; + try { + AENetworkProxy proxy = getProxy(); + if (proxy == null) + return stack.stackSize; + IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory(); + final IEnergySource src = proxy.getEnergy(); + IAEItemStack toStore = AEApi.instance().storage().createItemStack(stack); + IAEItemStack rest = Platform.poweredInsert( src, sg, toStore, getRequest()); + if (rest != null) + return (int)rest.getStackSize(); + return 0; + } + catch( final GridAccessException ignored ) + { + } + return stack.stackSize; + } + + @Optional.Method(modid = "appliedenergistics2") + private BaseActionSource getRequest() { + if (requestSource == null) + requestSource = new MachineSource((IActionHost)getBaseMetaTileEntity()); + return requestSource; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AECableType getCableConnectionType(ForgeDirection forgeDirection) { + return isOutputFacing((byte)forgeDirection.ordinal()) ? AECableType.SMART : AECableType.NONE; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + return false; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AENetworkProxy getProxy() { + if (gridProxy == null) { + if (getBaseMetaTileEntity() instanceof IGridProxyable) { + gridProxy = new AENetworkProxy((IGridProxyable)getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); + gridProxy.onReady(); + gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); + } + } + return this.gridProxy; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public void gridChanged() { + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 28f661c339..10bfd92f37 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -3,13 +3,12 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; @@ -25,8 +24,12 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; @@ -44,18 +47,35 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba 1, // output slot count "Default.png", // GUI name "", // NEI name - new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) }); + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); radius = aRadius; step = aStep; } + @Override public String[] getDescription() { return new String[]{ "Place, activate with explosives", @@ -79,6 +99,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba step = aStep; } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_AdvSeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName, this.radius, this.step); @@ -220,7 +241,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba ItemData association = GT_OreDictUnificator.getAssociation(is); if ((association != null) && (association.mPrefix.toString().startsWith("ore"))) return association.mMaterial.mMaterial.mDefaultLocalName; - else if (GT_Utility.isOre(is)) + else if (GT_Utility.isOre(tBlock, tMetaID)) return tBlock.getLocalizedName(); } return null; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 6895310b46..98ddf665c0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -1,26 +1,49 @@ package gregtech.common.tileentities.machines.basic; 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.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_Boxinator - extends GT_MetaTileEntity_BasicMachine { +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine { ItemStack aInputCache; ItemStack aOutputCache; int aTypeCache = 0; public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)}); + super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_BOXINATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_BOXINATOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_BOXINATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_BOXINATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_BOXINATOR_ACTIVE).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_BOXINATOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_BOXINATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_BOXINATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_BOXINATOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_BOXINATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_BOXINATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_BOXINATOR_GLOW).glow().build())); } public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -31,10 +54,12 @@ public class GT_MetaTileEntity_Boxinator super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } @@ -61,6 +86,7 @@ public class GT_MetaTileEntity_Boxinator aInputCache = mInputItem.copy(); } + @Override public int checkRecipe() { int tCheck = super.checkRecipe(); if (tCheck != DID_NOT_FIND_RECIPE) { @@ -71,9 +97,9 @@ public class GT_MetaTileEntity_Boxinator if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) { if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { boolean tIsCached = hasValidCache(tSlot0,1,true); - this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0}); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0); if (this.mOutputItems[0] != null) { - if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { + if (canOutput(this.mOutputItems[0])) { tSlot0.stackSize -= 1; calculateOverclockedNess(32,16); //In case recipe is too OP for that machine @@ -88,9 +114,9 @@ public class GT_MetaTileEntity_Boxinator } if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { boolean tIsCached = hasValidCache(tSlot0,2,true); - this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, null, tSlot0, tSlot0}); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { - if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { + if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 4; calculateOverclockedNess(32,32); //In case recipe is too OP for that machine @@ -105,9 +131,9 @@ public class GT_MetaTileEntity_Boxinator } if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { boolean tIsCached = hasValidCache(tSlot0,3,true); - this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0}); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { - if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { + if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 9; calculateOverclockedNess(32,64); //In case recipe is too OP for that machine @@ -124,27 +150,26 @@ public class GT_MetaTileEntity_Boxinator return DID_NOT_FIND_RECIPE; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - ItemStack tInput1 = getInputAt(1); - if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { - if (hasValidCache(aStack,aTypeCache,false)) - return true; - if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), tInput1}) != null) { - return true; - } - if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null) - return true; - if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, null, aStack, aStack}) != null) { - return true; - } - if (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack}) != null)) { - return true; - } - } else { - return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) { + return false; + } + ItemStack tInput1 = getInputAt(1); + if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { + if (hasValidCache(aStack,aTypeCache,false)) + return true; + if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, GT_Utility.copyAmount(64L, aStack), tInput1) != null) { + return true; + } + if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack) != null) + return true; + if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) { + return true; } + return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack) != null); + } else { + return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack); } - return false; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java index e2663a15e4..d249cae2a1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java @@ -10,17 +10,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_CuringOven - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_CuringOven(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Heats tools for hardening", 1, 1, "E_Oven.png", "", new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))}); + super(aID, aName, aNameRegional, aTier, 1, "Heats tools for hardening", 1, 1, "E_Oven.png", "", TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -31,14 +30,17 @@ public class GT_MetaTileEntity_CuringOven super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_CuringOven(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ItemList.Cell_Empty.isStackEqual(aStack); } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return false; } @@ -84,4 +86,4 @@ public class GT_MetaTileEntity_CuringOven } } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java index ce1812a9cf..b820dd44fd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -1,20 +1,87 @@ package gregtech.common.tileentities.machines.basic; +import com.google.common.collect.ArrayListMultimap; +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachine { -public class GT_MetaTileEntity_Disassembler - extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)}); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + new String[]{ + "Disassembles Machines up to " + GT_Values.TIER_COLORS[aTier] + GT_Values.VOLTAGE_NAMES[aTier], + "Can also disassemble most assembler recipes!" + }, + 1, + 9, + "Disassembler.png", + "", + + //Textures + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_DISASSEMBLER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_DISASSEMBLER), + TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_GLOW).glow().build()) + ); } public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -25,83 +92,438 @@ public class GT_MetaTileEntity_Disassembler super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + private static final ItemStack[][] alwaysReplace = { + { + //ItemStack to look for + new ItemStack(Blocks.trapped_chest, 1, OreDictionary.WILDCARD_VALUE) + }, + { + //ItemStack to replace + new ItemStack(Blocks.chest) + } + }; + + private static final Object[][] OreDictionaryOverride = { + { + //String to look for + "plankWood", + "stoneCobble", + "gemDiamond", + "logWood", + "stickWood", + "treeSapling" + }, + { + //ItemStack to replace + new ItemStack(Blocks.planks), + new ItemStack(Blocks.cobblestone), + new ItemStack(Items.diamond), + new ItemStack(Blocks.log), + new ItemStack(Items.stick), + new ItemStack(Blocks.sapling) + } + }; + + public static ArrayListMultimap<GT_ItemStack, ItemStack> getOutputHardOverrides() { + return outputHardOverrides; + } + + private static final ArrayListMultimap<GT_ItemStack, ItemStack> outputHardOverrides; + + private static final Set<GT_ItemStack> blackList; + + public static Set<GT_ItemStack> getBlackList() { + return blackList; + } + + static { + outputHardOverrides = ArrayListMultimap.create(); + outputHardOverrides.put(new GT_ItemStack(new ItemStack(Blocks.torch,6)), new ItemStack(Items.stick)); + blackList = new HashSet<>(); + blackList.add(new GT_ItemStack(ItemList.Casing_Coil_Superconductor.get(1L))); + } + + private boolean compareToUnpacker(ItemStack is){ + return null != GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.findRecipe( + null, + true, + true, + Long.MAX_VALUE, + null, + is); + } + + @Override public int checkRecipe() { - //if ((getInputAt(0) != null) && (isOutputEmpty())) { - // if(GT_Utility.areStacksEqual(getInputAt(0), new ItemStack(Items.egg))){ - // getInputAt(0).stackSize -= 1; - // this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); - // this.mMaxProgresstime = 2400; - // this.mMaxProgresstime = this.mMaxProgresstime >> (mTier); - //if (getBaseMetaTileEntity().getRandomNumber(100) < (this.mTier+1)) { - // this.mOutputItems[0] = ItemList.Circuit_Chip_Stemcell.get(1, new Object[0]); - //} - //return 2; - //} - NBTTagCompound tNBT = getInputAt(0).getTagCompound(); - if (tNBT != null) { - tNBT = tNBT.getCompoundTag("GT.CraftingComponents"); - if (tNBT != null) { - boolean isAnyOutput=false; - calculateOverclockedNessDisassembler(16); - this.mMaxProgresstime = 80; - //In case recipe is too OP for that machine - if (mEUt == Integer.MAX_VALUE - 1)//&& mMaxProgresstime==Integer.MAX_VALUE-1 - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < this.mOutputItems.length; i++) { - if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier) { - this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i); - if (this.mOutputItems[i] != null) { - this.mMaxProgresstime *= 1.7F; - isAnyOutput=true; - } - } - } - if(!isAnyOutput) - return DID_NOT_FIND_RECIPE; - for(int i=mTier-5;i>0;i--){ - this.mMaxProgresstime>>=1; - if(this.mMaxProgresstime==0) - this.mEUt = this.mEUt>>1; - } - if(this.mEUt==0) - mEUt = 1; - if(this.mMaxProgresstime==0) - this.mMaxProgresstime = 1; - getInputAt(0).stackSize -= 1; - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } + ItemStack is = getInputAt(0); + + if (GT_Utility.isStackInvalid(is)) + return DID_NOT_FIND_RECIPE; + + if ( + is.getItem() instanceof GT_MetaGenerated_Tool + || blackList.contains(new GT_ItemStack(is)) + || compareToUnpacker(is) + ) + return DID_NOT_FIND_RECIPE; + + if (checkTier(is)) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + Integer handleHardOverride = handleHardOverride(is); + if (handleHardOverride != null) + return handleHardOverride; + + return process(); + } + + private Integer handleHardOverride(ItemStack is) { + Set<GT_ItemStack> stacks = outputHardOverrides.keySet(); + for (GT_ItemStack stack : stacks) { + ItemStack in = is.copy(); + in.stackSize = 1; + if (stack.isStackEqual(in) && stack.mStackSize <= is.stackSize) { + return setOutputsAndTime(outputHardOverrides.get(stack).toArray(new ItemStack[0]), stack.mStackSize) + ? FOUND_AND_SUCCESSFULLY_USED_RECIPE + : DID_NOT_FIND_RECIPE; } + } + return null; + } + + private boolean checkTier(ItemStack is) { + ItemStack comp = new ItemStack(GregTech_API.sBlockMachines); + if (is.getItem() == comp.getItem()) { + IMetaTileEntity iMetaTileEntity = GregTech_API.METATILEENTITIES[is.getItemDamage()]; + + return iMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock && + ((GT_MetaTileEntity_TieredMachineBlock) iMetaTileEntity).mTier > this.mTier; + } + return false; + } + + private int process(){ + int statusCode = checkRecipeMap(); + if (statusCode != DID_NOT_FIND_RECIPE) + return statusCode; + + return onTheFlyGeneration(); + } + + private int onTheFlyGeneration() { + Collection<DissassembleReference> recipes = this.findRecipeFromMachine(); + if (recipes.isEmpty()) + return DID_NOT_FIND_RECIPE; + + DissassembleReference recipe = ensureDowncasting(recipes); + + removeInvalidStacks(recipe); + + return setOutputsAndTime(recipe.inputs, recipe.stackSize) + ? FOUND_AND_SUCCESSFULLY_USED_RECIPE + : FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + + private void removeInvalidStacks(DissassembleReference recipe) { + for (int i = 0; i < recipe.inputs.length; i++) + if (GT_Utility.isStackInvalid(recipe.inputs[i]) || recipe.inputs[i].stackSize < 1) + recipe.inputs[i] = null; + + recipe.inputs = GT_Utility.getArrayListWithoutNulls(recipe.inputs).toArray(new ItemStack[0]); + } + + private int checkRecipeMap() { + GT_Recipe gt_recipe = GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.findRecipe(this.getBaseMetaTileEntity(), true, this.maxEUInput(), null, this.getAllInputs()); + if (gt_recipe == null) + return DID_NOT_FIND_RECIPE; + if (gt_recipe.isRecipeInputEqual(false, null, this.getAllInputs())) + return setOutputsAndTime(gt_recipe.mOutputs, gt_recipe.mInputs[0].stackSize) + ? FOUND_AND_SUCCESSFULLY_USED_RECIPE + : FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + + private boolean setOutputsAndTime(ItemStack[] inputs, int stackSize){ + if (this.getInputAt(0).stackSize >= stackSize) + this.getInputAt(0).stackSize -= stackSize; + else + return false; + + System.arraycopy(inputs, 0, this.mOutputItems, 0, inputs.length); + this.calculateOverclockedNess(30,600); - return DID_NOT_FIND_RECIPE; + return true; } - private void calculateOverclockedNessDisassembler(int aEUt) { - if(mTier==0){ - mEUt=aEUt>>2; - }else{ - //Long EUt calculation - long xEUt=aEUt; - //Isnt too low EUt check? - long tempEUt = xEUt<GT_Values.V[1] ? GT_Values.V[1] : xEUt; + private static DissassembleReference ensureDowncasting(Collection<? extends DissassembleReference> recipes) { + ItemStack[] inputs = recipes.stream() + .findFirst() + .orElseThrow(NullPointerException::new) + .inputs; - while (tempEUt <= GT_Values.V[mTier -1] * (long)mAmperage) { - tempEUt<<=2;//this actually controls overclocking - xEUt<<=2;//this is effect of overclocking + ItemStack[] output = new ItemStack[inputs.length]; + List<GT_Recipe> recipesColl = null; + if (recipes.size() > 1) + recipesColl = recipes.stream() + .skip(1) + .map(x -> x.recipe) + .collect(Collectors.toList()); + + handleRecipeTransformation(inputs, output, recipesColl); + + return new DissassembleReference(recipes.stream().mapToInt(x -> x.stackSize).min().orElseThrow(NumberFormatException::new), output, null); + } + + private static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output, List<? extends GT_Recipe> recipesColl) { + for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) { + Set<ItemStack[]> inputsStacks = null; + if (recipesColl != null) + inputsStacks = recipesColl.stream() + .map(x -> x.mInputs) + .collect(Collectors.toSet()); + handleRecipeTransformationInternal(inputs, output, inputsStacks, i); + } + addOthersAndHandleAlwaysReplace(inputs, output); + } + + /** + * Public Interface for ReverseRecipes, do not call inside of this class. + */ + public static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks) { + for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) + handleRecipeTransformationInternal(inputs, output, inputsStacks, i); + addOthersAndHandleAlwaysReplace(inputs, output); + } + + private static void handleRecipeTransformationInternal(ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks, int i) { + ItemStack input = inputs[i]; + ItemData data = GT_OreDictUnificator.getItemData(input); + if (data == null || data.mMaterial == null || data.mMaterial.mMaterial == null || data.mPrefix == null) { + output[i] = input; + return; + } + handleReplacement(inputsStacks, data, output, input, i); + } + + private static void addOthersAndHandleAlwaysReplace(ItemStack[] inputs, ItemStack[] output){ + for (int i = 0; i < inputs.length; i++) { + //Adds rest of Items + if (output[i] == null) + output[i] = inputs[i]; + + //Math.min the recipe output if Items are the same + if (GT_Utility.areStacksEqual(output[i], inputs[i])) + output[i].stackSize = Math.min(output[i].stackSize, inputs[i].stackSize); + + //Handles replacement Overrides + ItemStack[] itemStacks = alwaysReplace[0]; + for (int j = 0; j < itemStacks.length; j++) { + ItemStack x = itemStacks[j]; + if (GT_Utility.areStacksEqual(x, output[i], true)) { + output[i] = alwaysReplace[1][j]; + break; + } } - if(xEUt>Integer.MAX_VALUE-1){ - mEUt = Integer.MAX_VALUE-1; - }else{ - mEUt = (int)xEUt; + + //Unification + output[i] = handleUnification(output[i]); + } + } + + private static ItemStack handleUnification(ItemStack stack) { + for (int oreID : OreDictionary.getOreIDs(stack)) { + for (int i = 0; i < OreDictionaryOverride[0].length; i++) + if (OreDictionary.getOreName(oreID).equals(OreDictionaryOverride[0][i])){ + ItemStack ret = ((ItemStack) OreDictionaryOverride[1][i]).copy(); + ret.stackSize = stack.stackSize; + return ret; + } + } + return GT_OreDictUnificator.get(stack); + } + + private static void handleReplacement(Set<ItemStack[]> inputsStacks, ItemData data, ItemStack[] output, ItemStack input, int i){ + AtomicReference<Materials> toRpl = new AtomicReference<>(); + Materials first = data.mMaterial.mMaterial; + if (inputsStacks != null) { + handleInputStacks(inputsStacks, toRpl, data, first, i); + } + if (toRpl.get() == null) { + //Remove Magnetic and Annealed Modifiers + handleBetterMaterialsVersions(data, toRpl); + } + if (toRpl.get() != null) { + output[i] = GT_OreDictUnificator.get(data.mPrefix, toRpl.get(), input.stackSize); + return; + } + if (data.mPrefix == OrePrefixes.circuit) { + handleCircuits(first, output, input, i); + } + } + + private static void handleInputStacks(Set<ItemStack[]> inputsStacks, AtomicReference<? super Materials> toRpl, ItemData data, Materials first, int i){ + final int finalIndex = i; + inputsStacks.forEach(stackArray -> { + ItemData dataAgainst = GT_OreDictUnificator.getItemData(stackArray[finalIndex]); + if ( + dataAgainst == null || + dataAgainst.mMaterial == null || + dataAgainst.mMaterial.mMaterial == null || + dataAgainst.mPrefix == null || + dataAgainst.mPrefix != data.mPrefix + ) { + return; } + handleDifferentMaterialsOnRecipes(first, dataAgainst.mMaterial.mMaterial, toRpl); + handleAnyMaterials(first,toRpl); + }); + } + + private static void handleAnyMaterials(Materials first, AtomicReference<? super Materials> toRpl){ + if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyIron))) + toRpl.set(Materials.Iron); + else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyCopper))) + toRpl.set(Materials.Copper); + else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyRubber))) + toRpl.set(Materials.Rubber); + else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnyBronze))) + toRpl.set(Materials.Bronze); + else if (first.mOreReRegistrations.stream().anyMatch(y -> y.equals(Materials.AnySyntheticRubber))) + toRpl.set(Materials.Rubber); + } + + private static void handleDifferentMaterialsOnRecipes(Materials first, Materials second, AtomicReference<? super Materials> toRpl){ + if (!first.equals(second)) + if (first.equals(Materials.Aluminium) && second.equals(Materials.Iron)) + toRpl.set(second); + else if (first.equals(Materials.Steel) && second.equals(Materials.Iron)) + toRpl.set(second); + else if (first.equals(Materials.WroughtIron) && second.equals(Materials.Iron)) + toRpl.set(second); + else if (first.equals(Materials.Aluminium) && second.equals(Materials.WroughtIron)) + toRpl.set(Materials.Iron); + else if (first.equals(Materials.Aluminium) && second.equals(Materials.Steel)) + toRpl.set(second); + else if (first.equals(Materials.Polytetrafluoroethylene) && second.equals(Materials.Plastic)) + toRpl.set(second); + else if (first.equals(Materials.Polybenzimidazole) && second.equals(Materials.Plastic)) + toRpl.set(second); + else if (first.equals(Materials.Polystyrene) && second.equals(Materials.Plastic)) + toRpl.set(second); + else if (first.equals(Materials.Silicone) && second.equals(Materials.Plastic)) + toRpl.set(second); + else if (first.equals(Materials.NetherQuartz) || first.equals(Materials.CertusQuartz) && second.equals(Materials.Quartzite)) + toRpl.set(second); + else if (first.equals(Materials.Plastic) && second.equals(Materials.Wood)) + toRpl.set(second); + else if (first.equals(Materials.Diamond) && second.equals(Materials.Glass)) + toRpl.set(second); + } + + private static void handleBetterMaterialsVersions(ItemData data, AtomicReference<? super Materials> toRpl){ + if (Materials.SteelMagnetic.equals(data.mMaterial.mMaterial)) { + toRpl.set(Materials.Steel); + } else if (Materials.IronMagnetic.equals(data.mMaterial.mMaterial)) { + toRpl.set(Materials.Iron); + } else if (Materials.NeodymiumMagnetic.equals(data.mMaterial.mMaterial)) { + toRpl.set(Materials.Neodymium); + } else if (Materials.SamariumMagnetic.equals(data.mMaterial.mMaterial)) { + toRpl.set(Materials.Samarium); + } else if (Materials.AnnealedCopper.equals(data.mMaterial.mMaterial)) { + toRpl.set(Materials.Copper); + } + } + + @SuppressWarnings("deprecation") + private static void handleCircuits(Materials first, ItemStack[] output, ItemStack input, int i){ + if (first.equals(Materials.Primitive)) + output[i] = ItemList.NandChip.get(input.stackSize); + else if (first.equals(Materials.Basic)) + output[i] = ItemList.Circuit_Microprocessor.get(input.stackSize); + else if (first.equals(Materials.Good)) + output[i] = ItemList.Circuit_Good.get(input.stackSize); + else if (first.equals(Materials.Advanced)) + output[i] = ItemList.Circuit_Advanced.get(input.stackSize); + else if (first.equals(Materials.Data)) + output[i] = ItemList.Circuit_Data.get(input.stackSize); + else if (first.equals(Materials.Master)) + output[i] = ItemList.Circuit_Master.get(input.stackSize); + else if (first.equals(Materials.Ultimate)) + output[i] = ItemList.Circuit_Quantummainframe.get(input.stackSize); + else if (first.equals(Materials.Superconductor)) + output[i] = ItemList.Circuit_Crystalmainframe.get(input.stackSize); + else if (first.equals(Materials.Infinite)) + output[i] = ItemList.Circuit_Wetwaremainframe.get(input.stackSize); + else if (first.equals(Materials.Bio)) + output[i] = ItemList.Circuit_Biomainframe.get(input.stackSize); + } + + static class DissassembleReference { + final int stackSize; + ItemStack[] inputs; + final GT_Recipe recipe; + + public DissassembleReference(int stackSize, ItemStack[] inputs, GT_Recipe recipe) { + this.stackSize = stackSize; + this.inputs = inputs; + this.recipe = recipe; } } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return //(aIndex == 4 && GT_Utility.areStacksEqual(aStack, new ItemStack(Items.egg))) || - (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null); + private Collection<DissassembleReference> findRecipeFromMachine() { + ItemStack is = getInputAt(0); + if (GT_Utility.isStackInvalid(is)) + return Collections.emptySet(); + + AtomicInteger stacksize = new AtomicInteger(); + //Check Recipe Maps for creation of Item + List<DissassembleReference> possibleRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() + .filter(x -> Arrays.stream(x.mOutputs) + .anyMatch(y -> + { + ItemStack out = is.copy(); + out.stackSize = y.stackSize; + boolean isDone = GT_Utility.areStacksEqual(y, out, true) && y.stackSize <= is.stackSize; + if (isDone) + stacksize.set(y.stackSize); + return isDone; + }) + ) + .map(x -> new DissassembleReference(stacksize.get(), x.mInputs, x)) + .collect(Collectors.toList()); + + //Is there only one way to create it? + if (possibleRecipes.size() == 1) + return possibleRecipes; + + //There are Multiple Ways -> Get recipe with cheapest inputs + //More Inputs should mean cheaper Materials + return possibleRecipes + .stream() + .sorted(Comparator.comparingDouble(GT_MetaTileEntity_Disassembler::getCheaperInputs)) + .collect(Collectors.toList()); + } + + private static double getCheaperInputs(GT_MetaTileEntity_Disassembler.DissassembleReference x){ + double fluidInputValueRaw = Arrays.stream(x.recipe.mFluidInputs).flatMapToInt(f -> IntStream.of(f.amount)).sum(); + fluidInputValueRaw = fluidInputValueRaw > 0 ? fluidInputValueRaw : 144D; + double inputValue = Arrays.stream(x.inputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum() + + (fluidInputValueRaw / 144D); + double fluidOutputValueRaw = Arrays.stream(x.recipe.mFluidOutputs).flatMapToInt(f -> IntStream.of(f.amount)).sum(); + fluidOutputValueRaw = fluidOutputValueRaw > 0 ? fluidOutputValueRaw : 144D; + double outputValue = Arrays.stream(x.recipe.mOutputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum() + + (fluidOutputValueRaw / 144D); + return inputValue / outputValue; + } + + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && aStack.getTagCompound() != null && aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 1ffcd3f4f3..68dd9f2fee 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -1,26 +1,52 @@ package gregtech.common.tileentities.machines.basic; -import gregtech.api.enums.*; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Recipe; import net.minecraftforge.fluids.FluidStack; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; -public class GT_MetaTileEntity_Massfabricator - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine { public static int sUUAperUUM = 1; public static int sUUASpeedBonus = 4; public static int sDurationMultiplier = 3215; public static boolean sRequiresUUA = false; public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)}); + super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_MASSFAB_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_MASSFAB), + TextureFactory.builder().addIcon(OVERLAY_SIDE_MASSFAB_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_MASSFAB_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_MASSFAB), + TextureFactory.builder().addIcon(OVERLAY_FRONT_MASSFAB_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_MASSFAB_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_MASSFAB), + TextureFactory.builder().addIcon(OVERLAY_TOP_MASSFAB_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_MASSFAB_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_MASSFAB), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_MASSFAB_GLOW).glow().build())); } public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -31,10 +57,12 @@ public class GT_MetaTileEntity_Massfabricator super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public void onConfigLoad(GT_Config aConfig) { super.onConfigLoad(aConfig); sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); @@ -54,6 +82,7 @@ public class GT_MetaTileEntity_Massfabricator return V[mTier] * 512L; } + @Override public int checkRecipe() { FluidStack tFluid = getDrainableStack(); if ((tFluid == null) || (tFluid.amount < getCapacity())) { @@ -71,54 +100,57 @@ public class GT_MetaTileEntity_Massfabricator } return 0; } - @Override + + @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes; } private void calculateOverclockedNessMassFabricator() { - if(mTier==0){ + if (mTier == 0) { //Long time calculation - long xMaxProgresstime = ((long)sDurationMultiplier)<<1; - if(xMaxProgresstime>Integer.MAX_VALUE-1){ + long xMaxProgresstime = ((long) sDurationMultiplier) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - mEUt=Integer.MAX_VALUE-1; - mMaxProgresstime=Integer.MAX_VALUE-1; - }else{ - mEUt= (int)(GT_Values.V[1]<<2);//2^2=4 so shift <<2 - mMaxProgresstime=(int)xMaxProgresstime; + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) (V[1] << 2);//2^2=4 so shift <<2 + mMaxProgresstime = (int) xMaxProgresstime; } - }else{ + } else { //Long EUt calculation - long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2); + long xEUt = V[1] * (long) Math.pow(2, mTier + 2); - long tempEUt = GT_Values.V[1]; + long tempEUt = V[1]; mMaxProgresstime = sDurationMultiplier; - while (tempEUt <= V[mTier -1]) { - tempEUt<<=2;//this actually controls overclocking - mMaxProgresstime>>=1;//this is effect of overclocking - if(mMaxProgresstime==0) - xEUt = (long)(xEUt/1.1D);//U know, if the time is less than 1 tick make the machine use less power + while (tempEUt <= V[mTier - 1]) { + tempEUt <<= 2;//this actually controls overclocking + mMaxProgresstime >>= 1;//this is effect of overclocking + if (mMaxProgresstime == 0) + xEUt = (long) (xEUt / 1.1D);//U know, if the time is less than 1 tick make the machine use less power } - if(xEUt>Integer.MAX_VALUE-1){ - mEUt = Integer.MAX_VALUE-1; - mMaxProgresstime = Integer.MAX_VALUE-1; - }else{ - mEUt = (int)xEUt; - if(mEUt==0) + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) mEUt = 1; - if(mMaxProgresstime==0) + if (mMaxProgresstime == 0) mMaxProgresstime = 1;//set time to 1 tick } } } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); } + @Override public int getCapacity() { return Math.max(sUUAperUUM, 1000); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java index f84c33d422..01f136747c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -3,14 +3,13 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_MicrowaveEnergyTransmitter; @@ -25,6 +24,11 @@ import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank { @@ -79,6 +83,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt return new GT_MetaTileEntity_MicrowaveEnergyTransmitter(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public String[] getInfoData() { return new String[]{ "Coordinates:", @@ -93,9 +98,18 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)}; + if (aSide == 0) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; + if (aActive) return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; } + @Override public void saveNBTData(NBTTagCompound aNBT) { if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); aNBT.setInteger("mTargetX", this.mTargetX); @@ -105,6 +119,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt aNBT.setBoolean("mDebug", this.mDebug); } + @Override public void loadNBTData(NBTTagCompound aNBT) { mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); this.mTargetX = aNBT.getInteger("mTargetX"); @@ -114,6 +129,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt this.mDebug = aNBT.getBoolean("mDebug"); } + @Override public void onConfigLoad(GT_Config aConfig) { sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss", 50), 11); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 69543a7196..4d7a6c4af5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -5,13 +5,12 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -36,9 +35,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { int drillY = 0; boolean isPickingPipes; boolean waitMiningPipe; - final static int[] RADIUS = new int[]{8, 8, 16, 24, 32}; //Miner radius per tier - final static int[] SPEED = new int[]{160, 160, 80, 40, 20}; //Miner cycle time per tier - final static int[] ENERGY = new int[]{8, 8, 32, 128, 512}; //Miner energy consumption per tier + static final int[] RADIUS = {8, 8, 16, 24, 32}; //Miner radius per tier + static final int[] SPEED = {160, 160, 80, 40, 20}; //Miner cycle time per tier + static final int[] ENERGY = {8, 8, 32, 128, 512}; //Miner energy consumption per tier private int radiusConfig; //Miner configured radius private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>(); @@ -52,14 +51,14 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { "Maximum work area " + (RADIUS[aTier] * 2 + 1) + "x" + (RADIUS[aTier] * 2 + 1), "Fortune bonus of " + aTier}, 2, 2, "Miner.png", "", - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), - new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM"))); + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM"))); radiusConfig = RADIUS[mTier]; } @@ -79,8 +78,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { return new GT_MetaTileEntity_Miner(mName, mTier, mDescriptionArray, mTextures, mGUIName, mNEIName); } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getItem() == MINING_PIPE.getItem()); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && aStack.getItem() == MINING_PIPE.getItem(); } public boolean hasFreeSpace() { @@ -175,10 +175,19 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { if (drillY == 0 || oreBlockPositions.isEmpty()) { moveOneDown(aBaseMetaTileEntity); } else { - ChunkPosition oreBlockPos = oreBlockPositions.remove(0); - mineBlock(aBaseMetaTileEntity, oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); - if (debugBlockMiner) { - GT_Log.out.println("MINER: Mining GT ore block at " + oreBlockPos.chunkPosX + " " + drillY + " " + oreBlockPos.chunkPosZ); + ChunkPosition oreBlockPos; + Block block; + do { + oreBlockPos = oreBlockPositions.remove(0); + block = aBaseMetaTileEntity.getBlockOffset(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); + } // someone else might have removed the block + while (block == Blocks.air && !oreBlockPositions.isEmpty()); + + if (block != Blocks.air) { + mineBlock(aBaseMetaTileEntity, block, + aBaseMetaTileEntity.getXCoord() + oreBlockPos.chunkPosX, + aBaseMetaTileEntity.getYCoord() + oreBlockPos.chunkPosY, + aBaseMetaTileEntity.getZCoord() + oreBlockPos.chunkPosZ); } } } @@ -195,7 +204,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, drillY, z); if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) oreBlockPositions.add(new ChunkPosition(x, drillY, z)); - } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + } else if (GT_Utility.isOre(block, blockMeta)) oreBlockPositions.add(new ChunkPosition(x, drillY, z)); } } @@ -236,11 +245,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { waitMiningPipe = true; return false; } - if (aBaseMetaTileEntity.getBlockOffset(0, drillY - 1, 0) != Blocks.air) { - mineBlock(aBaseMetaTileEntity, 0, drillY - 1, 0); - if (debugBlockMiner) { - GT_Log.out.println("MINER: Removed block to replace with pipe" ); - } + Block block = aBaseMetaTileEntity.getBlockOffset(0, drillY - 1, 0); + if (block != Blocks.air) { + mineBlock(aBaseMetaTileEntity, block, xCoord, yCoord + drillY - 1, zCoord); } aBaseMetaTileEntity.getWorld().setBlock(xCoord, yCoord + drillY - 1, zCoord, MINING_PIPE_TIP_BLOCK); drillY--; @@ -248,18 +255,20 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { return true; } - public void mineBlock(IGregTechTileEntity aBaseMetaTileEntity, int x, int y, int z) { - if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z, true)) { + public void mineBlock(IGregTechTileEntity aBaseMetaTileEntity, Block block, int x, int y, int z) { + if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(aBaseMetaTileEntity), x, y, z, true)) { if (debugBlockMiner) - GT_Log.out.println("MINER: FakePlayer cannot mine block at " + (aBaseMetaTileEntity.getXCoord() + x) + ", " + (aBaseMetaTileEntity.getYCoord() + y) + ", " + (aBaseMetaTileEntity.getZCoord() + z)); - return; + GT_Log.out.println("MINER: FakePlayer cannot mine block at " + x + ", " + y + ", " + z); + } else { + ArrayList<ItemStack> drops = getBlockDrops(block, x, y, z); + if (drops.size() > 0) + mOutputItems[0] = drops.get(0); + if (drops.size() > 1) + mOutputItems[1] = drops.get(1); + aBaseMetaTileEntity.getWorld().setBlockToAir(x, y, z); + if (debugBlockMiner) + GT_Log.out.println("MINER: Mining GT ore block at " + x + " " + y + " " + z); } - ArrayList<ItemStack> drops = getBlockDrops(aBaseMetaTileEntity.getBlockOffset(x, y, z), aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z); - if (drops.size() > 0) - mOutputItems[0] = drops.get(0); - if (drops.size() > 1) - mOutputItems[1] = drops.get(1); - aBaseMetaTileEntity.getWorld().setBlockToAir(aBaseMetaTileEntity.getXCoord() + x, aBaseMetaTileEntity.getYCoord() + y, aBaseMetaTileEntity.getZCoord() + z); } private ArrayList<ItemStack> getBlockDrops(final Block oreBlock, int posX, int posY, int posZ) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java index 1ee6203593..1e1beaf528 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java @@ -1,16 +1,23 @@ package gregtech.common.tileentities.machines.basic; -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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_SpawnEventHandler; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.Arrays; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_TieredMachineBlock { @@ -28,19 +35,28 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered super(aName, aTier, aInvSlotCount, aDescription, aTextures); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MonsterRepellent(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)}; + if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; + if (aActive) return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) { - int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; + int[] tCoords = {aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) { GT_SpawnEventHandler.mobReps.add(tCoords); } @@ -54,14 +70,14 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; + int[] tCoords = {aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId}; GT_SpawnEventHandler.mobReps.add(tCoords); } @Override public void onRemoval() { - int[] tCoords = new int[]{this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId}; - GT_SpawnEventHandler.mobReps.remove(tCoords); + int[] tCoords = {this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId}; + GT_SpawnEventHandler.mobReps.removeIf(coords -> Arrays.equals(coords, tCoords)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java index 59b43cbcb2..60056ec39d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -2,12 +2,11 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -16,10 +15,36 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_PotionBrewer - extends GT_MetaTileEntity_BasicMachine { +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER)}); + super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_POTIONBREWER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_POTIONBREWER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_POTIONBREWER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_POTIONBREWER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_POTIONBREWER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_POTIONBREWER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_POTIONBREWER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_POTIONBREWER), + TextureFactory.builder().addIcon(OVERLAY_TOP_POTIONBREWER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_POTIONBREWER_GLOW).glow().build()) + ); } public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -30,14 +55,17 @@ public class GT_MetaTileEntity_PotionBrewer super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return GT_Recipe.GT_Recipe_Map.sBrewingRecipes; } + @Override public int checkRecipe() { int tCheck = super.checkRecipe(); if (tCheck != DID_NOT_FIND_RECIPE) { @@ -88,7 +116,7 @@ public class GT_MetaTileEntity_PotionBrewer } if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0))) { if (!tModifier.startsWith("strong")) { - return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString())); + return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("long")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("long", "")); @@ -97,7 +125,7 @@ public class GT_MetaTileEntity_PotionBrewer } if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0))) { if (!tModifier.startsWith("long")) { - return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString())); + return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("strong")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", "")); @@ -115,7 +143,7 @@ public class GT_MetaTileEntity_PotionBrewer return 0; } - private final int setOutput(String aFluidName) { + private int setOutput(String aFluidName) { this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750); if (this.mOutputFluid == null) { this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount); @@ -131,14 +159,17 @@ public class GT_MetaTileEntity_PotionBrewer return 2; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + @Override + public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return (aFluid.getFluid().getName().startsWith("potion.")) || (super.isFluidInputAllowed(aFluid)); } + @Override public int getCapacity() { return 750; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java index 44c39612c6..87105620ea 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -12,16 +12,16 @@ import net.minecraft.item.ItemStack; import java.util.ArrayList; -public class GT_MetaTileEntity_Printer - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName, new ITexture[0]); + super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); } public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); } + @Override public int checkRecipe() { if (getOutputAt(0) != null) { this.mOutputBlocked += 1; @@ -34,7 +34,7 @@ public class GT_MetaTileEntity_Printer int i = 0; for (int j = tList.size() - 1; i < j; i++) { if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack) tList.get(i))) { - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{tList.get(i + 1)}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, tList.get(i + 1)); calculateOverclockedNess(1,32); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -49,6 +49,7 @@ public class GT_MetaTileEntity_Printer return 0; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return null; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index 0ff9f527e5..e1dfc32aba 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -8,7 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; @@ -27,9 +27,12 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; -import static gregtech.api.enums.GT_Values.D1; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.debugBlockPump; @@ -54,13 +57,16 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { public Block mSecondaryPumpedBlock = null; private int radiusConfig; //Pump configured radius + private boolean mRetractDone = false; public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 3, new String[]{"The best way to empty Oceans! Outputs on top", - getEuUsagePerTier(aTier) + " EU/operation, " + GT_Utility.safeInt(160 / (long)Math.pow(2, aTier) ) + " sec per bucket, no stuttering", + getEuUsagePerTier(aTier) + " EU/operation, " + GT_Utility.safeInt(160 / 20 / (long)Math.pow(2, aTier) ) + " sec per bucket, no stuttering", "Maximum pumping area: " + (getMaxDistanceForTier( aTier) * 2 + 1) + "x" + (getMaxDistanceForTier( aTier) * 2 + 1), - "Use Screwdriver to regulate pumping area"}); + "Use Screwdriver to regulate pumping area", + "Disable itself upon hitting rocks", + "Disable the bottom pump to retract the pipe!"}); radiusConfig = getMaxDistanceForTier(mTier); } @@ -79,6 +85,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { return new GT_MetaTileEntity_Pump(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public void saveNBTData(NBTTagCompound aNBT) { boolean wasPumping = this.wasPumping || !this.mPumpList.isEmpty(); if (debugBlockPump) { @@ -91,6 +98,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { aNBT.setInteger("radiusConfig", radiusConfig); } + @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.wasPumping = aNBT.getBoolean("wasPumping"); @@ -205,86 +213,131 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } if (this.mPumpCountBelow <= 0) { // Only the bottom most pump does anything - if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction())) - && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { - boolean tMovedOneDown = false; - if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { - if (!this.wasPumping){ - tMovedOneDown = moveOneDown(); - if (debugBlockPump) { - GT_Log.out.println("PUMP: Moved down"); + if (getBaseMetaTileEntity().isAllowedToWork()) { + mRetractDone = false; + if ((getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction())) && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { + boolean tMovedOneDown = false; + if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { + if (!this.wasPumping) { + tMovedOneDown = moveOneDown(); + if (!tMovedOneDown) { + if (canMoveDown(getBaseMetaTileEntity().getXCoord(), Math.max(getYOfPumpHead() - 1, 1), getBaseMetaTileEntity().getZCoord())) { + if (debugBlockPump) { + GT_Log.out.println("PUMP: No pipe left. Idle for a little longer."); + } + this.mPumpTimer = 160; + } else { + getBaseMetaTileEntity().disableWorking(); + if (debugBlockPump) { + GT_Log.out.println("PUMP: Can't move. Retracting in next few ticks"); + } + } + } else if (debugBlockPump) { + GT_Log.out.println("PUMP: Moved down"); + } + } else if (debugBlockPump) { + GT_Log.out.println("PUMP: Was pumping, didn't move down"); } - } else if (debugBlockPump) { - GT_Log.out.println("PUMP: Was pumping, didn't move down"); } - } - int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); - - if (!this.hasValidFluid()) { - // We don't have a valid block, let's try to find one - int y = getYOfPumpHead(); + int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); - if (debugBlockPump && this.mPrimaryPumpedBlock != null) { - GT_Log.out.println("PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y + - " Previous blocks 1: " + this.mPrimaryPumpedBlock + " 2: " + this.mSecondaryPumpedBlock); - } - // First look down - checkForFluidToPump(x, y - 1, z ); - - // Then look all around - checkForFluidToPump(x, y, z + 1); - checkForFluidToPump(x, y, z - 1); - checkForFluidToPump(x + 1, y, z ); - checkForFluidToPump(x - 1, y, z ); - this.clearQueue(false); - - if(this.hasValidFluid()) { - // Don't move down and rebuild the queue if we now have a valid fluid - this.wasPumping = true; - } + if (!this.hasValidFluid()) { + // We don't have a valid block, let's try to find one + int y = getYOfPumpHead(); - } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { - // We didn't just look for a block, and the pump head is below the pump - if ((tMovedOneDown) || this.wasPumping || - ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || - (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) - { - // Rebuild the list to pump if any of the following conditions are true: - // 1) We just moved down - // 2) We were previously pumping (and possibly just reloaded) - // 3) We have an empty queue and enough time has passed - // 4) A long while has has passed - if (debugBlockPump) { - GT_Log.out.println("PUMP: Rebuilding pump list - Size " + - this.mPumpList.size() + " WasPumping: " + this.wasPumping + " Timer " + getBaseMetaTileEntity().getTimer()); + if (debugBlockPump && this.mPrimaryPumpedBlock != null) { + GT_Log.out.println("PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y + + " Previous blocks 1: " + this.mPrimaryPumpedBlock + " 2: " + this.mSecondaryPumpedBlock); + } + // First look down + checkForFluidToPump(x, y - 1, z); + + // Then look all around + checkForFluidToPump(x, y, z + 1); + checkForFluidToPump(x, y, z - 1); + checkForFluidToPump(x + 1, y, z); + checkForFluidToPump(x - 1, y, z); + this.clearQueue(false); + + if (this.hasValidFluid()) { + // Don't move down and rebuild the queue if we now have a valid fluid + this.wasPumping = true; } - int yPump = getBaseMetaTileEntity().getYCoord() - 1, yHead = getYOfPumpHead(); - this.rebuildPumpQueue(x, yPump, z, yHead); + } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { + // We didn't just look for a block, and the pump head is below the pump + if ((tMovedOneDown) || this.wasPumping || + ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || + (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) + { + // Rebuild the list to pump if any of the following conditions are true: + // 1) We just moved down + // 2) We were previously pumping (and possibly just reloaded) + // 3) We have an empty queue and enough time has passed + // 4) A long while has has passed + if (debugBlockPump) { + GT_Log.out.println("PUMP: Rebuilding pump list - Size " + + this.mPumpList.size() + " WasPumping: " + this.wasPumping + " Timer " + getBaseMetaTileEntity().getTimer()); + } + int yPump = getBaseMetaTileEntity().getYCoord() - 1, yHead = getYOfPumpHead(); - if (debugBlockPump) { - GT_Log.out.println("PUMP: Rebuilt pump list - Size " + this.mPumpList.size()); - } + this.rebuildPumpQueue(x, yPump, z, yHead); - } - if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { - while ((!this.mPumpList.isEmpty())) { - ChunkPosition pos = this.mPumpList.pollLast(); - if (consumeFluid(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ)) { - // Keep trying until we consume something, or the list is empty - break; + if (debugBlockPump) { + GT_Log.out.println("PUMP: Rebuilt pump list - Size " + this.mPumpList.size()); } + + } + if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { + while ((!this.mPumpList.isEmpty())) { + ChunkPosition pos = this.mPumpList.pollLast(); + if (consumeFluid(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ)) { + // Keep trying until we consume something, or the list is empty + break; + } + } + this.mPumpTimer = GT_Utility.safeInt(160 / (long) Math.pow(2, this.mTier)); + this.mPumpTimer = mPumpTimer == 0 ? 1 : mPumpTimer; + } + } else { + // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps someone broke some pipes + // -- Clear the queue and we should try to move down until we can find a valid fluid + this.clearQueue(false); + } + } else if (debugBlockPump) { + GT_Log.out.println("PUMP: Not enough energy? Free space?"); + } + } else { + if (!mRetractDone && ((aTick % 5) == 0) && ((this.mInventory[0] == null) || this.mInventory[0].stackSize == 0 || (GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE) && (this.mInventory[0].stackSize < this.mInventory[0].getMaxStackSize())))) { + // try retract if all of these conditions are met + // 1. not retracted yet + // 2. once per 5 tick + // 3. can hold retracted pipe in inventory + int tHeadY = getYOfPumpHead(); + if (tHeadY < this.getBaseMetaTileEntity().getYCoord()) { + final int tXCoord = this.getBaseMetaTileEntity().getXCoord(); + final int tZCoord = this.getBaseMetaTileEntity().getZCoord(); + this.getBaseMetaTileEntity().getWorld().setBlockToAir(tXCoord, tHeadY, tZCoord); + if (tHeadY < this.getBaseMetaTileEntity().getYCoord() - 1) { + getBaseMetaTileEntity().getWorld().setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK); + } + if (this.mInventory[0] == null) { + final ItemStack copy = MINING_PIPE.copy(); + copy.stackSize = 1; + this.setInventorySlotContents(0, copy); + } else { + this.mInventory[0].stackSize++; + } + if (debugBlockPump) { + GT_Log.out.println("PUMP: Retracted one pipe"); + } + } else { + mRetractDone = true; + if (debugBlockPump) { + GT_Log.out.println("PUMP: Retract done"); } - this.mPumpTimer = GT_Utility.safeInt(160 / (long)Math.pow(2, this.mTier) ); - this.mPumpTimer = mPumpTimer==0 ? 1 : mPumpTimer; } - } else { - // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps someone broke some pipes - // -- Clear the queue and we should try to move down until we can find a valid fluid - this.clearQueue(false); } - } else if (debugBlockPump) { - GT_Log.out.println("PUMP: Disable? Not enough energy? Free space?"); } getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty()); } @@ -305,11 +358,11 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } private int getMaxPumpableDistance() { - return GT_MetaTileEntity_Pump.getMaxDistanceForTier(this.mTier); + return getMaxDistanceForTier(this.mTier); } private long getEuUsagePerAction() { - return GT_MetaTileEntity_Pump.getEuUsagePerTier(this.mTier); + return getEuUsagePerTier(this.mTier); } private boolean hasValidFluid() { @@ -490,6 +543,21 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mSecondaryPumpedBlock = null; } + /** only check if block below can be replaced with pipe tip. pipe stockpile condition is ignored */ + private boolean canMoveDown(int aX, int aY, int aZ) { + if (!GT_Utility.eraseBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), aX, aY, aZ, true)) return false; + + Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); + + return GT_Utility.isBlockValid(aBlock) && + (aBlock == Blocks.water || + aBlock == Blocks.flowing_water || + aBlock == Blocks.lava || + aBlock == Blocks.flowing_lava || + aBlock instanceof IFluidBlock || + aBlock.isAir(getBaseMetaTileEntity().getWorld(), aX, aY, aZ)); + } + private boolean consumeFluid(int aX, int aY, int aZ) { // Try to consume a fluid at a location // Returns true if something was consumed, otherwise false @@ -656,7 +724,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0 || aSide == 1) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0 || aSide == 1) ? TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT) : TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP)}; } @Override @@ -667,8 +735,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return new ITexture[]{ - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),}; + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP),}; } private FakePlayer mFakePlayer = null; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 92475d5ae6..d6879d31b5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -1,12 +1,15 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; +import gregtech.api.enums.Element; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -17,12 +20,15 @@ import net.minecraftforge.fluids.FluidStack; import java.util.HashMap; import java.util.NoSuchElementException; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine { + public static final HashMap<Materials, Long> MASS_OVERRIDES = new HashMap<>(); + public static final double EXPONENT = GregTech_API.sOPStuff.get("Replicator", "Nerf Exponent", 1.2D); private static int sHeaviestElementMass = 0; - public static final HashMap<Materials,Long> MASS_OVERRIDES =new HashMap<>(); - static{ + static { //put overrides here //ex. //MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass()); @@ -32,7 +38,31 @@ public class GT_MetaTileEntity_Replicator } public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR)); + super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_REPLICATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_REPLICATOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_REPLICATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_REPLICATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_REPLICATOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_REPLICATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_REPLICATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_REPLICATOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_REPLICATOR_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_REPLICATOR_GLOW).glow().build())); } public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -43,27 +73,27 @@ public class GT_MetaTileEntity_Replicator super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } - public static final double EXPONENT = GregTech_API.sOPStuff.get("Replicator","Nerf Exponent", 1.2D); - - public static long cubicFluidMultiplier(long amount){ + public static long cubicFluidMultiplier(long amount) { return (long) Math.pow(amount, EXPONENT); } + @Override public int checkRecipe() { FluidStack tFluid = getFillableStack(); if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) { ItemStack tDataOrb = getSpecialSlot(); if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) { Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); - long tMass = cubicFluidMultiplier(MASS_OVERRIDES.getOrDefault(tMaterial,tMaterial.getMass())); + long tMass = cubicFluidMultiplier(MASS_OVERRIDES.getOrDefault(tMaterial, tMaterial.getMass())); if ((tFluid.amount >= tMass) && (tMass > 0L)) { - this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1); - this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1 << this.mTier),1); + this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier], 1); + this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1L << this.mTier), 1); if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -101,17 +131,20 @@ public class GT_MetaTileEntity_Replicator return GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && ItemList.Cell_Empty.isStackEqual(aStack); } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)); } + @Override public int getCapacity() { if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { - sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int) cubicFluidMultiplier((int)material.getMass())).max().orElseThrow(NoSuchElementException::new); + sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int) cubicFluidMultiplier((int) material.getMass())).max().orElseThrow(NoSuchElementException::new); //Make the Number nicer =) sHeaviestElementMass = 1000 * (sHeaviestElementMass / 1000 + 1); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java index eacaf1703d..a07af88917 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -2,22 +2,46 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_RockBreaker - extends GT_MetaTileEntity_BasicMachine { +import static gregtech.api.enums.Textures.BlockIcons.*; + +public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); + super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); } public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -28,18 +52,22 @@ public class GT_MetaTileEntity_RockBreaker super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); } + @Override public int checkRecipe() { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { @@ -52,7 +80,7 @@ public class GT_MetaTileEntity_RockBreaker if (tOutput != null) { if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { tOutput = new ItemStack(Blocks.obsidian, 1); - if (canOutput(new ItemStack[]{tOutput})) { + if (canOutput(tOutput)) { getInputAt(0).stackSize -= 1; calculateOverclockedNess(32,128); //In case recipe is too OP for that machine @@ -61,7 +89,7 @@ public class GT_MetaTileEntity_RockBreaker this.mOutputItems[0] = tOutput; return 2; } - } else if (canOutput(new ItemStack[]{tOutput})) { + } else if (canOutput(tOutput)) { calculateOverclockedNess(32,16); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 1d627e3878..11430c6862 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -9,13 +9,12 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Assemblyline_Server; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; @@ -29,13 +28,37 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; -public class GT_MetaTileEntity_Scanner - extends GT_MetaTileEntity_BasicMachine { - +public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { + public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)}); + super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_GLOW).glow().build())); } public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -46,10 +69,12 @@ public class GT_MetaTileEntity_Scanner super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public int checkRecipe() { ItemStack aStack = getInputAt(0); if (getOutputAt(0) != null) { @@ -57,14 +82,14 @@ public class GT_MetaTileEntity_Scanner } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) { if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) { try { - Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); + IIndividual tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); if (tIndividual != null) { - if (((IIndividual) tIndividual).analyze()) { + if (tIndividual.analyze()) { getFillableStack().amount -= 100; - this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copy(aStack); aStack.stackSize = 0; NBTTagCompound tNBT = new NBTTagCompound(); - ((IIndividual) tIndividual).writeToNBT(tNBT); + tIndividual.writeToNBT(tNBT); this.mOutputItems[0].setTagCompound(tNBT); calculateOverclockedNess(2, 500); //In case recipe is too OP for that machine @@ -72,7 +97,7 @@ public class GT_MetaTileEntity_Scanner return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } - this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copy(aStack); aStack.stackSize = 0; this.mMaxProgresstime = 1; this.mEUt = 1; @@ -100,14 +125,14 @@ public class GT_MetaTileEntity_Scanner this.mEUt = 1; } aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); this.mOutputItems[0].setTagCompound(tNBT); return 2; } if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 512); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -119,7 +144,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]); + this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); @@ -132,7 +157,7 @@ public class GT_MetaTileEntity_Scanner if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -143,7 +168,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -155,7 +180,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -189,7 +214,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); calculateOverclockedNess(480, 36000); @@ -206,7 +231,7 @@ public class GT_MetaTileEntity_Scanner GT_Utility.ItemNBT.convertProspectionData(aStack); aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); calculateOverclockedNess(30, 1000); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -218,14 +243,14 @@ public class GT_MetaTileEntity_Scanner if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) { for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) { - boolean failScanner=true; - for(GT_Recipe scannerRecipe:sScannerFakeRecipes.mRecipeList){ - if(GT_Utility.areStacksEqual(scannerRecipe.mInputs[0],aStack,true)){ - failScanner=false; + boolean failScanner = true; + for (GT_Recipe scannerRecipe : sScannerFakeRecipes.mRecipeList) { + if (GT_Utility.areStacksEqual(scannerRecipe.mInputs[0], aStack, true)) { + failScanner = false; break; } } - if(failScanner){ + if (failScanner) { return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } @@ -235,7 +260,7 @@ public class GT_MetaTileEntity_Scanner if (s == null) s = tRecipe.mOutput.getDisplayName(); } - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); //remove possible old NBTTagCompound this.mOutputItems[0].setTagCompound(new NBTTagCompound()); GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s + " Construction Data"); @@ -285,7 +310,7 @@ public class GT_MetaTileEntity_Scanner } - tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize + " " + s); + tBuilder.append(count == 0 ? "" : "\nOr ").append(tStack.stackSize).append(" ").append(s); count++; } } @@ -334,32 +359,37 @@ public class GT_MetaTileEntity_Scanner public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); + GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } super.onPostTick(aBaseMetaTileEntity, aTick); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { return sScannerFakeRecipes; } + @Override public int getCapacity() { return 1000; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 3c5dffeb9f..42c8db6722 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -3,13 +3,12 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.GT_UndergroundOil; @@ -27,12 +26,40 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine { boolean ready = false; public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, "Default.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); + super(aID, aName, aNameRegional, aTier, 1, + "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, + "Default.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build())); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -43,6 +70,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index c9dbded8f9..7d6c0a29ed 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -1,12 +1,11 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.enums.ConfigCategories; -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_BasicTank; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; @@ -18,7 +17,14 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.effect.EntityWeatherEffect; -import net.minecraft.entity.item.*; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityArrow; @@ -37,6 +43,13 @@ import net.minecraftforge.fluids.FluidStack; import java.util.List; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES_GLOW; public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @@ -171,6 +184,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } + @Override public String[] getInfoData() { return new String[]{ "Coordinates:", @@ -185,9 +199,21 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES) : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)}; + if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER_SIDES), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_SIDES_GLOW).glow().build()}; + if (aActive) return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_TELEPORTER), + TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build()}; } + @Override public void saveNBTData(NBTTagCompound aNBT) { if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); aNBT.setInteger("mTargetX", this.mTargetX); @@ -197,6 +223,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { aNBT.setBoolean("mDebug", this.mDebug); } + @Override public void loadNBTData(NBTTagCompound aNBT) { mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); this.mTargetX = aNBT.getInteger("mTargetX"); @@ -206,6 +233,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { this.mDebug = aNBT.getBoolean("mDebug"); } + @Override public void onConfigLoad(GT_Config aConfig) { sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); sPassiveEnergyDrain = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain); @@ -287,7 +315,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ); } } - if (tTile != null && tTile instanceof IInventory) { + if (tTile instanceof IInventory) { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java new file mode 100644 index 0000000000..2fa860bb20 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java @@ -0,0 +1,253 @@ +/** + * + * Inspired/ported from GregTech 6 under the LGPL license + * + * Copyright (c) 2020 GregTech-6 Team + * + * This file is part of GregTech. + * + * GregTech is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GregTech is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GregTech. If not, see <http://www.gnu.org/licenses/>. + */ + +package gregtech.common.tileentities.machines.long_distance; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Block_LongDistancePipe; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Queue; + +public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_MetaTileEntity_BasicHull_NonElectric { + protected GT_MetaTileEntity_LongDistancePipelineBase mTarget = null, mSender = null; + protected ChunkCoordinates mTargetPos = null; + + public GT_MetaTileEntity_LongDistancePipelineBase(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, aDescription); + } + + public GT_MetaTileEntity_LongDistancePipelineBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + if (mTargetPos != null && mTarget != this) { + aNBT.setBoolean("target", true); + aNBT.setInteger("target.x", mTargetPos.posX); + aNBT.setInteger("target.y", mTargetPos.posY); + aNBT.setInteger("target.z", mTargetPos.posZ); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + if (aNBT.hasKey("target")) { + mTargetPos = new ChunkCoordinates( + aNBT.getInteger("target.x"), + aNBT.getInteger("target.y"), + aNBT.getInteger("target.z") + ); + } + } + + public boolean isSameClass(GT_MetaTileEntity_LongDistancePipelineBase other) { + return false; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null) { + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { + scanPipes(); + return true; + } + } + return false; + } + + public boolean isDead() { + return getBaseMetaTileEntity() == null || getBaseMetaTileEntity().isDead(); + } + + public boolean checkTarget() { + final IGregTechTileEntity gt_tile = getBaseMetaTileEntity(); + if (gt_tile == null || !gt_tile.isAllowedToWork() || gt_tile.isClientSide()) return false; + World world = gt_tile.getWorld(); + + if (mTargetPos == null) { + // We don't have a target position, scan the pipes + scanPipes(); + } else if (mTarget == null || mTarget.isDead()) { + // We don't have a target, or it's dead. Try checking the target position + mTarget = null; + if (world.blockExists(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ)) { + // Only check if the target position is loaded + TileEntity te = world.getTileEntity(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ); + final IMetaTileEntity tMeta; + if (te instanceof BaseMetaTileEntity && + ((tMeta = ((BaseMetaTileEntity)te).getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase) && + isSameClass((GT_MetaTileEntity_LongDistancePipelineBase)tMeta)) + { + // It's the right type! + mTarget = (GT_MetaTileEntity_LongDistancePipelineBase)tMeta; + } + else if (te != null) { + // It isn't the right type, kill the target position + mTargetPos = null; + } + } + } + if (mTarget == null || mTarget == this) return false; + if (mTarget.mSender == null || mTarget.mSender.isDead() || mTarget.mSender.mTarget == null || mTarget.mSender.mTarget.isDead()) mTarget.mSender = this; + + return mTarget.mSender == this; + } + + @Override + public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) { + if (mSender != null && !mSender.isDead() && mSender.mTarget == this) { + final ChunkCoordinates coords = mSender.getCoords(); + aList.addAll(Arrays.asList("Is the Target", "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); + } else { + aList.addAll( + Arrays.asList(checkTarget() ? "Has Target" : "Has no loaded Target", + "Target should be around: X: " + mTargetPos.posX + " Y: " + mTargetPos.posY + " Z: " + mTargetPos.posZ + )); + } + + return aList; + + } + + // What meta should the pipes for this pipeline have + public abstract int getPipeMeta(); + + protected void scanPipes() { + if (mSender != null && !mSender.isDead() && mSender.mTarget == this) return; + + // Check if we need to scan anything + final IGregTechTileEntity gtTile = getBaseMetaTileEntity(); + if (gtTile == null) return; + + final World world = gtTile.getWorld(); + if (world == null) return; + + mTargetPos = getCoords(); + mTarget = this; + mSender = null; + + // Start scanning from the output side + Block aBlock = gtTile.getBlockAtSide(gtTile.getBackFacing()); + + if(aBlock instanceof GT_Block_LongDistancePipe) { + byte aMetaData = gtTile.getMetaIDAtSide(gtTile.getBackFacing()); + if (aMetaData != getPipeMeta()) return; + + HashSet<ChunkCoordinates> + tVisited = new HashSet<>(Collections.singletonList(getCoords())), + tWires = new HashSet<>(); + Queue<ChunkCoordinates> + tQueue = new LinkedList<>(Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); + + while (!tQueue.isEmpty()) { + final ChunkCoordinates aCoords = tQueue.poll(); + + if(world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ) == aBlock && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { + // We've got another pipe/wire block + // TODO: Make sure it's the right type of pipe/wire via meta + ChunkCoordinates tCoords; + tWires.add(aCoords); + + // For each direction, if we haven't already visisted that coordinate, add it to the end of the queue + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX - 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY + 1, aCoords.posZ))) tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY - 1, aCoords.posZ))) tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ + 1))) tQueue.add(tCoords); + if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX, aCoords.posY, aCoords.posZ - 1))) tQueue.add(tCoords); + } else { + // It's not a block - let's see if it's a tile entity + TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); + if ( + tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity && + ((BaseMetaTileEntity)tTileEntity).getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase) + { + final GT_MetaTileEntity_LongDistancePipelineBase tGtTile = (GT_MetaTileEntity_LongDistancePipelineBase)((BaseMetaTileEntity) tTileEntity).getMetaTileEntity(); + if (isSameClass(tGtTile) && tWires.contains( + tGtTile.getFacingOffset((BaseMetaTileEntity)tTileEntity, ((BaseMetaTileEntity) tTileEntity).getFrontFacing()) + )) { + // If it's the same class, and we've scanned a wire in front of it (the input side), we've found our target + mTarget = tGtTile; + mTargetPos = tGtTile.getCoords(); + return; + } + + // Remove this block from the visited because we might end up back here from another wire that IS connected to the + // input side + tVisited.remove(aCoords); + } + } + } + } + + } + + public ChunkCoordinates getFacingOffset(IGregTechTileEntity gt_tile, byte aSide) { + return new ChunkCoordinates( + gt_tile.getOffsetX(aSide, 1), gt_tile.getOffsetY(aSide, 1), gt_tile.getOffsetZ(aSide, 1) + ); + + } + + public ChunkCoordinates getCoords() { + final IGregTechTileEntity gt_tile = getBaseMetaTileEntity(); + return new ChunkCoordinates(gt_tile.getXCoord(), gt_tile.getYCoord(), gt_tile.getZCoord()); + } + + @Override + public void onMachineBlockUpdate() { + //GT_Mod.GT_FML_LOGGER.info("You're dead to me"); + mTargetPos = null; mSender = null; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + public boolean shouldTriggerBlockUpdate() { return true; } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java new file mode 100644 index 0000000000..2c8ac45719 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java @@ -0,0 +1,123 @@ +/** + * + * Inspired/ported from GregTech 6 under the LGPL license + * + * Copyright (c) 2020 GregTech-6 Team + * + * This file is part of GregTech. + * + * GregTech is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GregTech is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GregTech. If not, see <http://www.gnu.org/licenses/>. + */ + +package gregtech.common.tileentities.machines.long_distance; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Utility; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_BACK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE_GLOW; + +public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEntity_LongDistancePipelineBase { + static final FluidTankInfo[] emptyTank = {new FluidTankInfo(null, Integer.MAX_VALUE)}; + + public GT_MetaTileEntity_LongDistancePipelineFluid(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Sends fluids over long distances"); + } + + public GT_MetaTileEntity_LongDistancePipelineFluid(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public boolean isSameClass(GT_MetaTileEntity_LongDistancePipelineBase other) { + return other instanceof GT_MetaTileEntity_LongDistancePipelineFluid; + } + + @Override + public int getPipeMeta() { + return 0; + } + + public IFluidHandler getTank() { + final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); + TileEntity tankTile = tTile.getTileEntityAtSide(tTile.getBackFacing()); + if (tankTile instanceof IFluidHandler) return (IFluidHandler)tankTile; + else return null; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + if (checkTarget()) { + final IFluidHandler tankTile = getTank(); + if (tankTile != null) return tankTile.getTankInfo(aSide); + + } + + return emptyTank; + } + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean aDoFill) { + if (checkTarget()) { + final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); + final IFluidHandler tankTile = getTank(); + if (tankTile != null) return tankTile.fill(ForgeDirection.getOrientation(tTile.getFrontFacing()), aFluid, aDoFill); + } + return 0; + } + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean aDoDrain) { + return null; + } + @Override + public FluidStack drain(ForgeDirection aSide, int aMaxDrain, boolean aDoDrain) { + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_LongDistancePipelineFluid(mName, mTier, getDescription()[0], mTextures); + } + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_FLUID_FRONT)}; + else if (aSide == GT_Utility.getOppositeSide(aFacing)) + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_FLUID_BACK)}; + else + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_FLUID_SIDE), + TextureFactory.builder().addIcon(OVERLAY_PIPELINE_FLUID_SIDE_GLOW).glow().build()}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java new file mode 100644 index 0000000000..f52725ef90 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java @@ -0,0 +1,196 @@ +/** + * + * Inspired/ported from GregTech 6 under the LGPL license + * + * Copyright (c) 2020 GregTech-6 Team + * + * This file is part of GregTech. + * + * GregTech is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GregTech is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with GregTech. If not, see <http://www.gnu.org/licenses/>. + */ + +package gregtech.common.tileentities.machines.long_distance; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Utility; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_BACK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE_GLOW; + +public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntity_LongDistancePipelineBase { + static final int[] emptyIntArray = new int[0]; + + public GT_MetaTileEntity_LongDistancePipelineItem(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Sends Items over long distances"); + } + + public GT_MetaTileEntity_LongDistancePipelineItem(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public boolean isSameClass(GT_MetaTileEntity_LongDistancePipelineBase other) { + return other instanceof GT_MetaTileEntity_LongDistancePipelineItem; + } + + @Override + public int getPipeMeta() { + return 1; + } + + public IInventory getInventory() { + final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); + TileEntity invTile = tTile.getTileEntityAtSide(tTile.getBackFacing()); + if (invTile instanceof IInventory) return (IInventory)invTile; + else return null; + } + + @Override + public ItemStack decrStackSize(int aSlot, int aDecrement) { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.decrStackSize(aSlot, aDecrement); + } + return null; + } + @Override + public ItemStack getStackInSlotOnClosing(int aSlot) { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.getStackInSlotOnClosing(aSlot); + } + return null; + } + @Override + public ItemStack getStackInSlot(int aSlot) { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.getStackInSlot(aSlot); + } + return null; + } + @Override + public String getInventoryName() { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.getInventoryName(); + } + return super.getInventoryName(); + } + @Override + public int getSizeInventory() { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.getSizeInventory(); + } + return 0; + } + @Override + public int getInventoryStackLimit() { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.getInventoryStackLimit(); + } + return 0; + } + @Override + public void setInventorySlotContents(int aSlot, ItemStack aStack) { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) iInventory.setInventorySlotContents(aSlot, aStack); + } + } + @Override + public boolean hasCustomInventoryName() { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.hasCustomInventoryName(); + } + return false; + } + @Override + public boolean isItemValidForSlot(int aSlot, ItemStack aStack) { + if (checkTarget()) { + IInventory iInventory = getInventory(); + if (iInventory != null) return iInventory.isItemValidForSlot(aSlot, aStack); + } + return false; + } + +// // Relay Sided Inventories +// + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + if (checkTarget()) { + final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); + IInventory iInventory = getInventory(); + if (iInventory instanceof ISidedInventory) return ((ISidedInventory)iInventory).getAccessibleSlotsFromSide(tTile.getBackFacing()); + if (iInventory != null) { + int[] tReturn = new int[iInventory.getSizeInventory()]; + for (int i = 0; i < tReturn.length; i++) tReturn[i] = i; + return tReturn; + } + } + + return emptyIntArray; + } + + @Override + public boolean canInsertItem(int aSlot, ItemStack aStack, int aSide) { + if (checkTarget()) { + final IGregTechTileEntity tTile = mTarget.getBaseMetaTileEntity(); + IInventory iInventory = getInventory(); + if (iInventory instanceof ISidedInventory) return ((ISidedInventory)iInventory).canInsertItem(aSlot, aStack, tTile.getBackFacing()); + return iInventory != null; + } + return false; + } + + @Override + public boolean canExtractItem(int aSlot, ItemStack aStack, int aSide) { + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_LongDistancePipelineItem(mName, mTier, getDescription()[0], mTextures); + } + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_ITEM_FRONT)}; + else if (aSide == GT_Utility.getOppositeSide(aFacing)) + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_ITEM_BACK)}; + else + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_PIPELINE_ITEM_SIDE), + TextureFactory.builder().addIcon(OVERLAY_PIPELINE_ITEM_SIDE_GLOW).glow().build()}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java new file mode 100644 index 0000000000..1ac4df6d73 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java @@ -0,0 +1,98 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.interfaces.IHeatingCoil; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +public abstract class GT_MetaTileEntity_AbstractMultiFurnace extends GT_MetaTileEntity_MultiBlockBase { + + private static final int CASING_INDEX = 11; + + protected GT_MetaTileEntity_AbstractMultiFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + protected GT_MetaTileEntity_AbstractMultiFurnace(String aName) { + super(aName); + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + protected HeatingCoilLevel getInitialHeatLevel(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) { + Block coil = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 1, zDir); + if (!(coil instanceof IHeatingCoil)) + return null; + IHeatingCoil heatingCoil = (IHeatingCoil) coil; + byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir); + return heatingCoil.getCoilHeat(tUsedMeta); + } + + protected boolean checkStructure(HeatingCoilLevel heatingCap, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity){ + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (!checkTopLayer(i, j, xDir, zDir, aBaseMetaTileEntity)) + return false; + + if (!checkBottomLayer(i, j, xDir, zDir, aBaseMetaTileEntity)) + return false; + + if (!checkCoils(heatingCap, i, j, xDir, zDir, aBaseMetaTileEntity)) + return false; + } + } + return true; + } + + protected abstract boolean checkTopLayer(int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity); + protected abstract boolean checkCoils(HeatingCoilLevel heatingCap, int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity); + + protected boolean checkBottomLayer(int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity){ + if ((xDir + i == 0) && (zDir + j == 0)) + return true; + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if (addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) + return true; + if (addInputToMachineList(tTileEntity, CASING_INDEX)) + return true; + if (addOutputToMachineList(tTileEntity, CASING_INDEX)) + return true; + if (addEnergyInputToMachineList(tTileEntity, CASING_INDEX)) + return true; + + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) + return false; + return aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) == CASING_INDEX; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 20; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index c90df2a7a7..6695c4d0a2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -1,13 +1,10 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -15,7 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -24,8 +21,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW; public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_MultiBlockBase { @@ -40,140 +44,157 @@ public class GT_MetaTileEntity_AssemblyLine super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_AssemblyLine(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Assembling Line") - .addInfo("Controller block for the Assembling Line") - .addInfo("Used to make complex machine parts (LuV+)") - .addInfo("Does not make Assembler items") - .addSeparator() - .beginVariableStructureBlock(5, 15, 4, 4, 3, 3, false)//? - .addStructureInfo("From Bottom to Top, Left to Right") - .addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input Bus (last is Output Bus), Solid Steel Machine Casing") - .addStructureInfo("Layer 2 - Reinforced Glass, Assembling Line Casing, Reinforced Glass") - .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") - .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") - .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes, aside from the last") - .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller") - .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller")//TT - - .addController("Either Grate on layer 3 of the first slice") - .addEnergyHatch("Any layer 4 casing") - .addMaintenanceHatch("Any layer 1 casing") - .addInputBus("As specified on layer 1") - .addInputHatch("Any layer 1 casing") - .addOutputBus("Replaces Input Bus on final slice") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Assembling Line") + .addInfo("Controller block for the Assembling Line") + .addInfo("Used to make complex machine parts (LuV+)") + .addInfo("Does not make Assembler items") + .addSeparator() + .beginVariableStructureBlock(5, 15, 4, 4, 3, 3, false)//? + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input Bus (last is Output Bus), Solid Steel Machine Casing") + .addStructureInfo("Layer 2 - Reinforced Glass, Assembling Line Casing, Reinforced Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") + .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") + .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes, aside from the last") + .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller") + .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller")//TT + + .addController("Either Grate on layer 3 of the first slice") + .addEnergyHatch("Any layer 4 casing") + .addMaintenanceHatch("Any layer 1 casing") + .addInputBus("As specified on layer 1") + .addInputHatch("Any layer 1 casing") + .addOutputBus("Replaces Input Bus on final slice") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)}; + if (aActive) + return new ITexture[]{ + BlockIcons.casingTexturePages[0][16], + TextureFactory.of(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.casingTexturePages[0][16], + TextureFactory.of(OVERLAY_FRONT_ASSEMBLY_LINE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return null; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { - if(GT_Values.D1) + if (GT_Values.D1) GT_FML_LOGGER.info("Start ALine recipe check"); ArrayList<ItemStack> tDataStickList = getDataItems(2); - if (tDataStickList.size() == 0) return false; - if(GT_Values.D1) - GT_FML_LOGGER.info("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); + if (tDataStickList.isEmpty()) return false; + if (GT_Values.D1) + GT_FML_LOGGER.info("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); - ItemStack tStack[] = new ItemStack[15]; + ItemStack[] tStack = new ItemStack[15]; FluidStack[] tFluids = new FluidStack[4]; boolean findRecipe = false; - nextDS:for (ItemStack tDataStick : tDataStickList){ + nextDS: + for (ItemStack tDataStick : tDataStickList) { NBTTagCompound tTag = tDataStick.getTagCompound(); if (tTag == null) continue; for (int i = 0; i < 15; i++) { - int count = tTag.getInteger("a"+i); + int count = tTag.getInteger("a" + i); if (!tTag.hasKey("" + i) && count <= 0) continue; if (mInputBusses.get(i) == null) { continue nextDS; } - + ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); boolean flag = true; if (count > 0) { - for (int j = 0; j < count; j++) { - tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j); - if (tStack[i] == null) continue; - if(GT_Values.D1) - GT_FML_LOGGER.info("Item "+i+" : "+tStack[i].getUnlocalizedName()); - if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { - flag = false; - break; - } - } - } + for (int j = 0; j < count; j++) { + tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j); + if (tStack[i] == null) continue; + if (GT_Values.D1) + GT_FML_LOGGER.info("Item " + i + " : " + tStack[i].getUnlocalizedName()); + if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { + flag = false; + break; + } + } + } if (flag) { - tStack[i] = GT_Utility.loadItem(tTag, "" + i); - if (tStack[i] == null) { - flag = false; - continue; - } - if(GT_Values.D1) - GT_FML_LOGGER.info("Item "+i+" : "+tStack[i].getUnlocalizedName()); - if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { - flag = false; - } - } - if(GT_Values.D1) + tStack[i] = GT_Utility.loadItem(tTag, "" + i); + if (tStack[i] == null) { + flag = false; + continue; + } + if (GT_Values.D1) + GT_FML_LOGGER.info("Item " + i + " : " + tStack[i].getUnlocalizedName()); + if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { + flag = false; + } + } + if (GT_Values.D1) GT_FML_LOGGER.info(i + (flag ? " not accepted" : " accepted")); if (flag) continue nextDS; } - if(GT_Values.D1)GT_FML_LOGGER.info("All Items done, start fluid check"); + if (GT_Values.D1) GT_FML_LOGGER.info("All Items done, start fluid check"); for (int i = 0; i < 4; i++) { if (!tTag.hasKey("f" + i)) continue; tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); if (tFluids[i] == null) continue; - if(GT_Values.D1) - GT_FML_LOGGER.info("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); + if (GT_Values.D1) + GT_FML_LOGGER.info("Fluid " + i + " " + tFluids[i].getUnlocalizedName()); if (mInputHatches.get(i) == null) { continue nextDS; } FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { - if(GT_Values.D1) - GT_FML_LOGGER.info(i+" not accepted"); + if (!GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { + if (GT_Values.D1) + GT_FML_LOGGER.info(i + " not accepted"); continue nextDS; } - if(GT_Values.D1) - GT_FML_LOGGER.info(i+" accepted"); + if (GT_Values.D1) + GT_FML_LOGGER.info(i + " accepted"); } - if(GT_Values.D1) + if (GT_Values.D1) GT_FML_LOGGER.info("Input accepted, check other values"); if (!tTag.hasKey("output")) continue; @@ -191,13 +212,13 @@ public class GT_MetaTileEntity_AssemblyLine continue; mEUt = tTag.getInteger("eu"); - if(GT_Values.D1)GT_FML_LOGGER.info("Find avaiable recipe"); - findRecipe = true; + if (GT_Values.D1) GT_FML_LOGGER.info("Find avaiable recipe"); + findRecipe = true; break; } if (!findRecipe) return false; - if(GT_Values.D1)GT_FML_LOGGER.info("All checked start consuming inputs"); + if (GT_Values.D1) GT_FML_LOGGER.info("All checked start consuming inputs"); for (int i = 0; i < 15; i++) { if (tStack[i] == null) continue; @@ -213,7 +234,7 @@ public class GT_MetaTileEntity_AssemblyLine mInputHatches.get(i).mFluid = null; } } - if(GT_Values.D1)GT_FML_LOGGER.info("Check overclock"); + if (GT_Values.D1) GT_FML_LOGGER.info("Check overclock"); byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); @@ -232,7 +253,7 @@ public class GT_MetaTileEntity_AssemblyLine } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); updateSlots(); - if(GT_Values.D1) + if (GT_Values.D1) GT_FML_LOGGER.info("Recipe sucessfull"); return true; } @@ -245,6 +266,7 @@ public class GT_MetaTileEntity_AssemblyLine return super.onRunningTick(aStack); } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { @@ -252,7 +274,9 @@ public class GT_MetaTileEntity_AssemblyLine } } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mDataAccessHatches.clear(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if (xDir != 0) { @@ -312,7 +336,7 @@ public class GT_MetaTileEntity_AssemblyLine } tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); if (!addInputToMachineList(tTileEntity, 16) && addOutputToMachineList(tTileEntity, 16)) { - return r > 0 && mEnergyHatches.size() > 0; + return r > 0 && !mEnergyHatches.isEmpty(); } } } else { @@ -372,7 +396,7 @@ public class GT_MetaTileEntity_AssemblyLine } tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); if (!addInputToMachineList(tTileEntity, 16) && addOutputToMachineList(tTileEntity, 16)) { - return r > 0 && mEnergyHatches.size() > 0; + return r > 0 && !mEnergyHatches.isEmpty(); } } } @@ -385,15 +409,14 @@ public class GT_MetaTileEntity_AssemblyLine private boolean isCorrectDataItem(ItemStack aStack, int state){ if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true; if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; - if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true; - return false; + return (state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); } /** * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb */ public ArrayList<ItemStack> getDataItems(int state) { - ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + ArrayList<ItemStack> rList = new ArrayList<>(); if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) { rList.add(mInventory[1]); } @@ -420,19 +443,23 @@ public class GT_MetaTileEntity_AssemblyLine return false; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index eb1ce1348f..446965f3b6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -1,20 +1,23 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; +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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; +import org.lwjgl.input.Keyboard; -public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace{ - private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)}; - private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)}; - private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE)}; +public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace { + private static final ITexture[] FACING_SIDE = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)}; + private static final ITexture[] FACING_FRONT = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)}; + private static final ITexture[] FACING_ACTIVE = { + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), + TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW).glow().build() + }; public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -23,33 +26,31 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri public GT_MetaTileEntity_BrickedBlastFurnace(String aName) { super(aName); } - - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BrickedBlastFurnace(this.mName); - } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Blast Furnace") - .addInfo("Controller Block for the Bricked Blast Furnace") - .addInfo("Usable for Steel and general Pyrometallurgy") - .addInfo("Has a useful interface, unlike other gregtech multis") - .addPollutionAmount(200) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front center") - .addOtherStructurePart("Firebricks", "Everything except the controller") - .addStructureInfo("The top block is also empty") - .addStructureInfo("You can share the walls of GT multis, so") - .addStructureInfo("each additional one costs less, up to 4") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } -} + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller Block for the Bricked Blast Furnace") + .addInfo("Usable for Steel and general Pyrometallurgy") + .addInfo("Has a useful interface, unlike other gregtech multis") + .addPollutionAmount(200) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front center") + .addOtherStructurePart("Firebricks", "Everything except the controller") + .addStructureInfo("The top block is also empty") + .addStructureInfo("You can share the walls of GT multis, so") + .addStructureInfo("each additional one costs less, up to 4") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } + } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; @@ -57,18 +58,24 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri return FACING_SIDE; } - @Override - protected boolean isCorrectCasingBlock(Block block) { - return block == GregTech_API.sBlockCasings4; - } + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BrickedBlastFurnace(this.mName); + } + + @Override + protected boolean isCorrectCasingBlock(Block block) { + return block == GregTech_API.sBlockCasings4; + } - @Override - protected boolean isCorrectCasingMetaID(int metaID) { - return metaID == 15; - } + @Override + protected boolean isCorrectCasingMetaID(int metaID) { + return metaID == 15; + } - @Override - public String getName() { - return "Bricked Blast Furnace"; - } + @Override + public String getName() { + return "Bricked Blast Furnace"; + } } + diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index af388a790d..93b36d376c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -1,18 +1,24 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; -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.render.TextureFactory; import net.minecraft.block.Block; -public class GT_MetaTileEntity_BronzeBlastFurnace - extends GT_MetaTileEntity_PrimitiveBlastFurnace { - private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)}; - private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)}; - private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)}; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; + +public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace { + private static final ITexture[] FACING_SIDE = {TextureFactory.of(MACHINE_BRONZEPLATEDBRICKS)}; + private static final ITexture[] FACING_FRONT = {TextureFactory.of(MACHINE_BRONZEBLASTFURNACE)}; + private static final ITexture[] FACING_ACTIVE = { + TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW).glow().build() + }; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -22,20 +28,12 @@ public class GT_MetaTileEntity_BronzeBlastFurnace super(aName); } - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName); - } - + @Override public String[] getDescription() { - return new String[]{"Disabled"}; - /*return new String[]{ - "Controller Block for the Bronze Blast Furnace", - "Useable for Steel and general Pyrometallurgy", - "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", - "Built from 32 Bronze Plated Bricks", - "Causes 200 Pollution per second"};*/ + return new String[]{"Disabled"}; } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; @@ -44,6 +42,11 @@ public class GT_MetaTileEntity_BronzeBlastFurnace } @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName); + } + + @Override protected boolean isCorrectCasingBlock(Block block) { return block == GregTech_API.sBlockCasings1; } @@ -57,6 +60,4 @@ public class GT_MetaTileEntity_BronzeBlastFurnace public String getName() { return "Bronze Blast Furnace"; } - - -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 8459f5e84b..058d5f3487 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -1,17 +1,12 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; -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_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.common.GT_Pollution; @@ -22,11 +17,19 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; import net.minecraftforge.oredict.OreDictionary; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase { private boolean running = false; - private boolean p1, p2, p3, p4, p5, p6; public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -36,77 +39,42 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Charcoal_Pit(this.mName); - } - - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Charcoal Pile Igniter") - .addInfo("Controller for the Charcoal Pit") - .addInfo("Converts Logs into Brittle Charcoal blocks") - .addInfo("Will automatically start when valid") - .addPollutionAmount(100) - .addSeparator() - .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) - .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") - .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") - .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") - .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") - .addStructureInfo("No air between logs allowed") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == 1) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][10]}; - } - - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; + @Override + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - - return true; + // No GUI, do not capture right-click so it does not interfere when placing logs + return false; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - + @Override public boolean checkRecipe(ItemStack aStack) { if (!checkRecursiveBlocks()) { - this.mEfficiency = 0; - this.mEfficiencyIncrease = 0; - this.mMaxProgresstime = 0; + mEfficiency = 0; + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; running = false; return false; } if (mEfficiency == 0) { - this.mEfficiency = 10000; - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*10); + mEfficiency = 10000; + mEfficiencyIncrease = 10000; + mMaxProgresstime = Math.max(1, mMaxProgresstime); + GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * 10); return true; } else { - this.mEfficiency = 0; - this.mEfficiencyIncrease = 0; - this.mMaxProgresstime = 0; + mEfficiency = 0; + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; } return false; } @@ -115,12 +83,10 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock ArrayList<ChunkPosition> tList1 = new ArrayList<>(); ArrayList<ChunkPosition> tList2 = new ArrayList<>(); - Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0); - if (!isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(0, -1, 0))) { - return false; - } else { + Block tBlock = getBaseMetaTileEntity().getBlockOffset(0, -1, 0); + if (isWoodLog(tBlock, getBaseMetaTileEntity().getMetaIDOffset(0, -1, 0))) { tList2.add(new ChunkPosition(0, -1, 0)); - } + } else return false; while (!tList2.isEmpty()) { ChunkPosition tPos = tList2.get(0); tList2.remove(0); @@ -130,91 +96,93 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } if (running) { for (ChunkPosition tPos : tList1) { - if (isWoodLog(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), this.getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) - this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); + if (isWoodLog(getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); } running = false; return false; } else { - this.mMaxProgresstime = (int) Math.sqrt(tList1.size() * 240000); + mMaxProgresstime = (int) Math.sqrt(tList1.size() * 240000); } running = true; return true; } - private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2) { - p1 = false; - p2 = false; - p3 = false; - p4 = false; - p5 = false; - p6 = false; - Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); - if (aX + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { + private boolean isWoodLog(Block log, int meta) { + for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { + if (OreDictionary.getOreName(id).equals("logWood")) + return true; + } + String tTool = log.getHarvestTool(meta); + return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool)) && (log.getMaterial() == Material.wood); + } + + private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, ArrayList<? super ChunkPosition> aList2) { + boolean expandToChunkXPos = false; + boolean expandToChunkXNeg = false; + boolean expandToChunkYPos = false; + boolean expandToChunkYNeg = false; + boolean expandToChunkZPos = false; + boolean expandToChunkZNeg = false; + + Block blockXPos = getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); + if (aX + 1 < 6 && (isWoodLog(blockXPos, getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) - p1 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkXPos = true; + } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); - if (aX - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { + Block blockXNeg = getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); + if (aX - 1 > -6 && (isWoodLog(blockXNeg, getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) - p2 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkXNeg = true; + } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); - if (aY + 1 < 1 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { + Block blockYPos = getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); + if (aY + 1 < 1 && (isWoodLog(blockYPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) - p3 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && tBlock == GregTech_API.sBlockMachines))) { + expandToChunkYPos = true; + } else if (!(blockYPos == Blocks.dirt || blockYPos == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); - if (aY - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { + Block blockYNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); + if (aY - 1 > -6 && (isWoodLog(blockYNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) - p4 = true; - } else if (tBlock != Blocks.brick_block) { + expandToChunkYNeg = true; + } else if (blockYNeg != Blocks.brick_block) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); - if (aZ + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { + Block blockZPos = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); + if (aZ + 1 < 6 && (isWoodLog(blockZPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) - p5 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkZPos = true; + } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); - if (aZ - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { + Block blockZNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); + if (aZ - 1 > -6 && (isWoodLog(blockZNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) - p6 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkZNeg = true; + } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } aList1.add(new ChunkPosition(aX, aY, aZ)); - if (p1) aList2.add(new ChunkPosition(aX + 1, aY, aZ)); - if (p2) aList2.add(new ChunkPosition(aX - 1, aY, aZ)); - if (p3) aList2.add(new ChunkPosition(aX, aY + 1, aZ)); - if (p4) aList2.add(new ChunkPosition(aX, aY - 1, aZ)); - if (p5) aList2.add(new ChunkPosition(aX, aY, aZ + 1)); - if (p6) aList2.add(new ChunkPosition(aX, aY, aZ - 1)); + if (expandToChunkXPos) aList2.add(new ChunkPosition(aX + 1, aY, aZ)); + if (expandToChunkXNeg) aList2.add(new ChunkPosition(aX - 1, aY, aZ)); + if (expandToChunkYPos) aList2.add(new ChunkPosition(aX, aY + 1, aZ)); + if (expandToChunkYNeg) aList2.add(new ChunkPosition(aX, aY - 1, aZ)); + if (expandToChunkZPos) aList2.add(new ChunkPosition(aX, aY, aZ + 1)); + if (expandToChunkZNeg) aList2.add(new ChunkPosition(aX, aY, aZ - 1)); return true; } - private boolean isWoodLog(Block log, int meta){ - for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { - if(OreDictionary.getOreName(id).equals("logWood")) - return true; - } - String tTool = log.getHarvestTool(meta); - return OrePrefixes.log.contains(new ItemStack(log, 1,meta)) && ((tTool != null) && (tTool.equals("axe"))) && (log.getMaterial() == Material.wood); - } - + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mWrench = true; mScrewdriver = true; @@ -225,19 +193,72 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock return true; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Charcoal_Pit(mName); + } + + @Override + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Charcoal Pile Igniter") + .addInfo("Controller for the Charcoal Pit") + .addInfo("Converts Logs into Brittle Charcoal blocks") + .addInfo("Will automatically start when valid") + .addPollutionAmount(100) + .addSeparator() + .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) + .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") + .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") + .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") + .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") + .addStructureInfo("No air between logs allowed") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == 1) { + if (aActive) return new ITexture[]{ + casingTexturePages[0][10], + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][10], + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build(), + }; + } + return new ITexture[]{casingTexturePages[0][10]}; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 606c63110f..6cf19d6867 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMachineCallback; @@ -10,7 +9,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -18,10 +17,15 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import static gregtech.api.enums.GT_Values.debugCleanroom; - -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.BLOCK_PLASCRETE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_GLOW; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { private int mHeight = -1; @@ -34,288 +38,310 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas super(aName); } - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Cleanroom(mName); - } + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Cleanroom(mName); + } - @Override + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cleanroom") - .addInfo("Controller block for the Cleanroom") - .addInfo("Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked")//? - .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") - .addInfo("2 LV batteries + 1 LV generator or 1 MV generator")//? - .addInfo("Time required to reach full efficiency is propotional to the height of empty space within") - .addInfo("Make sure your Energy Hatch matches! ?") - .addSeparator() - .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) - .addController("Top center") - .addCasingInfo("Plascrete", 20) - .addStructureInfo(GT_Values.cleanroomGlass+"% of the Plascrete can be replaced with Reinforced Glass")//check - .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") - .addEnergyHatch("LV or MV, any casing")//check - .addMaintenanceHatch("Any casing") - .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") - .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") - .addStructureInfo("You can also use Diodes for more power") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Cleanroom") + .addInfo("Controller block for the Cleanroom") + .addInfo("Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked")//? + .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") + .addInfo("2 LV batteries + 1 LV generator or 1 MV generator")//? + .addInfo("Time required to reach full efficiency is propotional to the height of empty space within") + .addInfo("Make sure your Energy Hatch matches! ?") + .addSeparator() + .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) + .addController("Top center") + .addCasingInfo("Plascrete", 20) + .addStructureInfo(GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass")//check + .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") + .addEnergyHatch("LV or MV, any casing")//check + .addMaintenanceHatch("Any casing") + .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") + .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") + .addStructureInfo("You can also use Diodes for more power") + .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } - @Override - public boolean checkRecipe(ItemStack aStack) { - mEfficiencyIncrease = 100; - // use the standard overclock mechanism to determine duration and estimate a maximum consumption - calculateOverclockedNessMulti(40, 45 * Math.min(1, mHeight - 1), 1, getMaxInputVoltage()); - // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. - mEUt /= -10; - return true; - } + @Override + public boolean checkRecipe(ItemStack aStack) { + mEfficiencyIncrease = 100; + // use the standard overclock mechanism to determine duration and estimate a maximum consumption + calculateOverclockedNessMulti(40, 45 * Math.max(1, mHeight - 1), 1, getMaxInputVoltage()); + // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. + mEUt /= -10; + return true; + } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int x = 1; - int z = 1; - int y = 1; - int mDoorCount = 0; - int mHullCount = 0; - int mPlascreteCount = 0; - int mGlassCount = 0; - boolean doorState = false; - this.mUpdate = 100; + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int x = 1; + int z = 1; + int y = 1; + int mDoorCount = 0; + int mHullCount = 0; + int mPlascreteCount = 0; + int mGlassCount = 0; + boolean doorState = false; + this.mUpdate = 100; + + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Checking machine" + ); + } + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { + x = i; + break; + } else { + if (debugCleanroom) { + GT_Log.out.println("Cleanroom: Unable to detect room X edge?"); + } + return false; + } + } + } + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { + z = i; + break; + } else { + if (debugCleanroom) { + GT_Log.out.println("Cleanroom: Unable to detect room Z edge?"); + } + return false; + } + } + } + //detect room square for filters + for (int i = -x + 1; i < x; i++) { + for (int j = -z + 1; j < z; j++) { + if (i == 0 && j == 0) continue; + Block tBlock = aBaseMetaTileEntity.getBlockOffset(j, 0, i); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(j, 0, i); + if (tBlock != GregTech_API.sBlockCasings3 && tMeta != 11) { + return false; + } + } + } - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Checking machine" - ); - } - for (int i = 1; i < 8; i++) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { - x = i; - break; - } else { - if (debugCleanroom) { - GT_Log.out.println("Cleanroom: Unable to detect room X edge?"); - } - return false; - } - } - } - for (int i = 1; i < 8; i++) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i); - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { - z = i; - break; - } else { - if (debugCleanroom) { - GT_Log.out.println("Cleanroom: Unable to detect room Z edge?"); - } - return false; - } - } - } - for (int i = -1; i > -16; i--) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - y = i + 1; - break; - } - } - if (y > -2) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Room not tall enough?" - ); - } - return false; - } - for (int dX = -x; dX <= x; dX++) { - for (int dZ = -z; dZ <= z; dZ++) { - for (int dY = 0; dY >= y; dY--) { - if (dX == -x || dX == x || dY == 0 || dY == y || dZ == -z || dZ == z) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (dY == 0) { // TOP - if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Non reinforced block on top edge? tMeta != 2" - ); - } - return false; - } - } else if (dX != 0 || dZ != 0) { // Top Inner exclude center - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Non reinforced block on top face interior? tMeta != 11" - ); - } - return false; - } - } - } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { - mPlascreteCount++; - } else if (tBlock != null && tBlock.getUnlocalizedName().equals("blockAlloyGlass")){ - ++mGlassCount; - } else { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { - if (tBlock instanceof ic2.core.block.BlockIC2Door) { - if ((tMeta & 8) == 0) { - if (Math.abs(dY) < y) //x - side - doorState = (tMeta & 0x5) == 0x4 || (tMeta & 0x5) == 0x1; - else if (Math.abs(dX) < x) //y-side, corners ignored. - doorState = (tMeta & 0x5) == 0x5 || (tMeta & 0x5) == 0x0; - } - mDoorCount++; - } else { - if (tTileEntity == null) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Missing block? Not a tTileEntity" - ); - } - return false; - } - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Missing block? Not a aMetaTileEntity" - ); - } - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { - mHullCount++; - } else { - if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Incorrect block?" - ); - } - return false; - } - } - } - } - } - } - } - } - if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { - return false; - } + for (int i = -1; i > -16; i--) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + y = i + 1; + break; + } + } + if (y > -2) { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Room not tall enough?" + ); + } + return false; + } + for (int dX = -x; dX <= x; dX++) { + for (int dZ = -z; dZ <= z; dZ++) { + for (int dY = 0; dY >= y; dY--) { + if (dX == -x || dX == x || dY == 0 || dY == y || dZ == -z || dZ == z) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); + if (dY == 0) { // TOP + if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Non reinforced block on top edge? tMeta != 2" + ); + } + return false; + } + } else if (dX != 0 || dZ != 0) { // Top Inner exclude center + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Non reinforced block on top face interior? tMeta != 11" + ); + } + return false; + } + } + } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { + mPlascreteCount++; + } else if (tBlock != null && tBlock.getUnlocalizedName().equals("blockAlloyGlass")) { + ++mGlassCount; + } else { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { + if (tBlock instanceof ic2.core.block.BlockIC2Door) { + if ((tMeta & 8) == 0) { + // let's not fiddle with bits anymore. + if (Math.abs(dZ) < z) // on side parallel to z axis + doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; + else if (Math.abs(dX) < x) // on side parallel to x axis + doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; + // corners ignored + } + mDoorCount++; + } else { + if (tTileEntity == null) { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Missing block? Not a tTileEntity" + ); + } + return false; + } + IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Missing block? Not a aMetaTileEntity" + ); + } + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { + mHullCount++; + } else { + if (debugCleanroom) { + GT_Log.out.println( + "Cleanroom: Incorrect block?" + ); + } + return false; + } + } + } + } + } + } + } + } + if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { + return false; + } - setCallbacks(x, y, z, aBaseMetaTileEntity); + setCallbacks(x, y, z, aBaseMetaTileEntity); if (doorState) { - this.mEfficiency = Math.max(0, this.mEfficiency - 200); + this.mEfficiency = Math.max(0, this.mEfficiency - 200); } - for(byte i = 0 ; i<6 ; i++){ - byte t = (byte) Math.max(1, (byte)(15/(10000f / this.mEfficiency))); - aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); + for (byte i = 0; i < 6; i++) { + byte t = (byte) Math.max(1, (byte) (15 / (10000f / this.mEfficiency))); + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); } - float ratio = (((float)mPlascreteCount)/100f)* GT_Values.cleanroomGlass; + float ratio = (((float) mPlascreteCount) / 100f) * GT_Values.cleanroomGlass; this.mHeight = -y; - return mPlascreteCount>=20 && mGlassCount < (int) Math.floor(ratio); + return mPlascreteCount >= 20 && mGlassCount < (int) Math.floor(ratio); } - private void setCallbacks(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity){ - for (int dX = -x + 1; dX <= x - 1; dX++) - for (int dZ = -z + 1; dZ <= z - 1; dZ++) - for (int dY = -1; dY >= y + 1; dY--) { - TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); + private void setCallbacks(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity) { + for (int dX = -x + 1; dX <= x - 1; dX++) + for (int dZ = -z + 1; dZ <= z - 1; dZ++) + for (int dY = -1; dY >= y + 1; dY--) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); - if (tTileEntity instanceof IGregTechTileEntity) { - IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (iMetaTileEntity instanceof IMachineCallback<?>) - checkAndSetCallback((IMachineCallback<?>) iMetaTileEntity); + if (iMetaTileEntity instanceof IMachineCallback<?>) + checkAndSetCallback((IMachineCallback<?>) iMetaTileEntity); - } else if (tTileEntity instanceof IMachineCallback<?>) - checkAndSetCallback((IMachineCallback<?>) tTileEntity); - } - } + } else if (tTileEntity instanceof IMachineCallback<?>) + checkAndSetCallback((IMachineCallback<?>) tTileEntity); + } + } @SuppressWarnings("unchecked") private void checkAndSetCallback(IMachineCallback<?> iMachineCallback) { - if (debugCleanroom) - GT_Log.out.println( - "Cleanroom: IMachineCallback detected, checking for cleanroom: " + (iMachineCallback.getType() == this.getClass()) - ); - if (iMachineCallback.getType() == this.getClass()) - ((IMachineCallback<GT_MetaTileEntity_Cleanroom>) iMachineCallback).setCallbackBase(this); - } + if (debugCleanroom) + GT_Log.out.println( + "Cleanroom: IMachineCallback detected, checking for cleanroom: " + (iMachineCallback.getType() == this.getClass()) + ); + if (iMachineCallback.getType() == this.getClass()) + ((IMachineCallback<GT_MetaTileEntity_Cleanroom>) iMachineCallback).setCallbackBase(this); + } @Override - public boolean allowGeneralRedstoneOutput(){ - return true; + public boolean allowGeneralRedstoneOutput() { + return true; } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == 0 || aSide == 1) { - return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE), - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM)}; - + if (aSide == ForgeDirection.DOWN.ordinal() || aSide == ForgeDirection.UP.ordinal()) { + return new ITexture[]{ + TextureFactory.of(BLOCK_PLASCRETE), + aActive ? + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW).glow().build()) : + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM), + TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_GLOW).glow().build())}; } - return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)}; + return new ITexture[]{TextureFactory.of(BLOCK_PLASCRETE)}; } - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png"); - } + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png"); + } - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; - } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } - @Override - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } + @Override + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java index 84bba3b3dd..a509d35ad3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java @@ -48,4 +48,4 @@ public class GT_MetaTileEntity_ConcreteBackfiller1 extends GT_MetaTileEntity_Con protected int getMinTier() { return 2; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java index ed6c028243..d1f44580c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java @@ -81,4 +81,4 @@ public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_Con protected int getMinTier() { return 4; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index a65f4d0e86..a64fea5ab0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -129,4 +129,4 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi return true; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index f16c9d2d4f..e697208a4a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -1,13 +1,7 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -16,7 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -27,6 +21,16 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Collection; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlockBase { protected int fuelConsumption = 0; @@ -42,42 +46,51 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock super(aName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Combustion Generator") - .addInfo("Controller block for the Large Combustion Engine") - .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") - .addInfo("Supply 40L/s of Oxygen to boost output (optional)") - .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") - .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") - .addInfo("You need to wait for it to reach 300% to output full power") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, false) - .addController("Front center") - .addCasingInfo("Stable Titanium Machine Casing", 16) - .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") - .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") - .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center") - .addMaintenanceHatch("One of the casings next to a Gear Box") - .addMufflerHatch("Top middle back, above the rear Gear Box") - .addInputHatch("Diesel Fuel, next to a Gear Box") - .addInputHatch("Lubricant, next to a Gear Box") - .addInputHatch("Oxygen, optional, next to a Gear Box") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Combustion Generator") + .addInfo("Controller block for the Large Combustion Engine") + .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") + .addInfo("Supply 40L/s of Oxygen to boost output (optional)") + .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") + .addInfo("You need to wait for it to reach 300% to output full power") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfo("Stable Titanium Machine Casing", 16) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center") + .addMaintenanceHatch("One of the casings next to a Gear Box") + .addMufflerHatch("Top middle back, above the rear Gear Box") + .addInputHatch("Diesel Fuel, next to a Gear Box") + .addInputHatch("Lubricant, next to a Gear Box") + .addInputHatch("Oxygen, optional, next to a Gear Box") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE)}; + if (aActive) return new ITexture[]{ + casingTexturePages[0][50], + TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][50], + TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW).glow().build()}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50]}; + return new ITexture[]{casingTexturePages[0][50]}; } @Override @@ -85,6 +98,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return getMaxEfficiency(aStack) > 0; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeDieselEngine.png"); } @@ -134,7 +148,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock ArrayList<FluidStack> tFluids = getStoredFluids(); Collection<GT_Recipe> tRecipeList = getFuelMap().mRecipeList; - if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel? + if(!tFluids.isEmpty() && tRecipeList != null) { //Does input hatch have a diesel fuel? for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes FluidStack tLiquid; @@ -283,6 +297,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return 1; } + @Override public int getMaxEfficiency(ItemStack aStack) { return boostEu ? 30000 : 10000; } @@ -315,12 +330,12 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock } } - + return new String[]{ EnumChatFormatting.BLUE+"Diesel Engine"+EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET +" EU", getIdealStatus() == getRepairStatus() ? EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET, diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 12ab91d876..e12f36f331 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -2,13 +2,14 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; 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_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -18,13 +19,16 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW; -public class GT_MetaTileEntity_DistillationTower - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_MultiBlockBase { private static final int CASING_INDEX = 49; private short controllerY; @@ -36,63 +40,79 @@ public class GT_MetaTileEntity_DistillationTower super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_DistillationTower(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Distillery") - .addInfo("Controller block for the Distillation Tower") - .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) - .addController("Front bottom") - .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("2-11x Output Hatches (One per layer except bottom layer)") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Distillery") + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("2-11x Output Hatches (One per layer except bottom layer)") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; + if (aActive) + return new ITexture[]{ + BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.of(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.getCasingTextureForId(CASING_INDEX), + TextureFactory.of(OVERLAY_FRONT_DISTILLATION_TOWER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sDistillationRecipes; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<FluidStack> tFluidList = getStoredFluids(); for (int i = 0; i < tFluidList.size() - 1; i++) { for (int j = i + 1; j < tFluidList.size(); j++) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { - if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + 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--); @@ -104,27 +124,27 @@ public class GT_MetaTileEntity_DistillationTower long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { - for(int i = 0;i<tFluids.length;i++){ - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{}); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + for (FluidStack tFluid : tFluids) { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluid}); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, tFluids)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + this.mOutputFluids = tRecipe.mFluidOutputs.clone(); + updateSlots(); + return true; } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - this.mOutputFluids = tRecipe.mFluidOutputs.clone(); - updateSlots(); - return true; - } } } } @@ -132,6 +152,7 @@ public class GT_MetaTileEntity_DistillationTower return false; } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { controllerY = aBaseMetaTileEntity.getYCoord(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; @@ -190,19 +211,23 @@ public class GT_MetaTileEntity_DistillationTower return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } @@ -237,4 +262,4 @@ public class GT_MetaTileEntity_DistillationTower } } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java index b480f4f5a6..d7b7e2aa4d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java @@ -3,7 +3,7 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IChunkLoader; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -12,7 +12,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataA import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_ChunkManager; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -28,8 +28,13 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; -public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_MultiBlockBase { +public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_MultiBlockBase implements IChunkLoader { private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0); private static final ItemStack miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0); private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe); @@ -38,7 +43,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu private Block casingBlock; private int casingMeta; private int frameMeta; - private int casingTextureIndex; + protected int casingTextureIndex; protected boolean isPickingPipes; private ForgeDirection back; @@ -72,10 +77,19 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu workState = STATE_DOWNWARD; } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(casingTextureIndex),new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL)}; - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(casingTextureIndex)}; + if (aSide == aFacing) { + if (aActive) return new ITexture[]{ + getCasingTextureForId(casingTextureIndex), + TextureFactory.of(OVERLAY_FRONT_ORE_DRILL_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + getCasingTextureForId(casingTextureIndex), + TextureFactory.of(OVERLAY_FRONT_ORE_DRILL), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW).glow().build()}; + } + return new ITexture[]{getCasingTextureForId(casingTextureIndex)}; } @Override @@ -145,7 +159,9 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu /** * Added for compability reasons * @return true if the state is 0 false otherwise. + * @deprecated compatibility reason */ + @Deprecated protected boolean tryLowerPipe() { return tryLowerPipeState(false) == 0; } @@ -168,10 +184,14 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu case 2: return 3; } - if (!GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), xPipe, yHead - 1, zPipe, miningPipeTipBlock, 0, isSimulating)) return 3; + Block b = getBaseMetaTileEntity().getBlock(xPipe, yHead - 1, zPipe); + if (b != miningPipeTipBlock && !GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), xPipe, yHead - 1, zPipe, miningPipeTipBlock, 0, isSimulating)) + return 3; if (!isSimulating) { - if (yHead != yDrill) getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); - getBaseMetaTileEntity().decrStackSize(1, 1); + if (yHead != yDrill) + getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); + if (b != miningPipeBlock && b != miningPipeTipBlock) + getBaseMetaTileEntity().decrStackSize(1, 1); } return 0; @@ -194,7 +214,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu if (pipes.stackSize == maxPipes) break; int needPipes = maxPipes - pipes.stackSize; - int transferPipes = storedItem.stackSize < needPipes ? storedItem.stackSize : needPipes; + int transferPipes = Math.min(storedItem.stackSize, needPipes); pipes.stackSize += transferPipes; storedItem.stackSize -= transferPipes; @@ -233,9 +253,10 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu } /** - * Readded for compability + * @deprecated Readded for compability * @return if no pipes are present */ + @Deprecated protected boolean waitForPipes(){ return !isHasMiningPipes(); } @@ -420,7 +441,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu return config; } - public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); + public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<>(); /** * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb @@ -428,15 +449,14 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu private boolean isCorrectDataItem(ItemStack aStack, int state){ if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true; if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; - if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true; - return false; + return (state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); } /** * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb */ public ArrayList<ItemStack> getDataItems(int state) { - ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + ArrayList<ItemStack> rList = new ArrayList<>(); if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) { rList.add(mInventory[1]); } @@ -462,4 +482,6 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu } return false; } + @Override + public ChunkCoordIntPair getActiveChunk(){return mCurrentChunk;} } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 061db80ece..5e99491c2e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -1,42 +1,46 @@ package gregtech.common.tileentities.machines.multi; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.VN; - -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IHeatingCoil; 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_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; 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.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; -public class GT_MetaTileEntity_ElectricBlastFurnace - extends GT_MetaTileEntity_MultiBlockBase { +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; + +public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_AbstractMultiFurnace { private int mHeatingCapacity = 0; private int controllerY; - private FluidStack[] pollutionFluidStacks = new FluidStack[]{Materials.CarbonDioxide.getGas(1000), + private final FluidStack[] pollutionFluidStacks = {Materials.CarbonDioxide.getGas(1000), Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; + private static final int CASING_INDEX = 11; + public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -45,173 +49,176 @@ public class GT_MetaTileEntity_ElectricBlastFurnace super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ElectricBlastFurnace(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Blast Furnace") - .addInfo("Controller block for the Electric Blast Furnace") - .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") - .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") - .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") - .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") - .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front bottom") - .addCasingInfo("Heat Proof Machine Casing", 0) - .addOtherStructurePart("Heating Coils (any tier)", "Two middle Layers") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle") - .addInputBus("Any bottom layer casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("Gasses, Any top layer casing") - .addStructureInfo("Recovery amount scales with Muffler Hatch tier") - .addOutputHatch("Platline fluids, Any bottom layer casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Blast Furnace") + .addInfo("Controller block for the Electric Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required multiplies EU/t by 0.95") + .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") + .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 0) + .addOtherStructurePart("Heating Coils", "Two middle Layers") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Top middle") + .addInputBus("Any bottom layer casing") + .addInputHatch("Any bottom layer casing") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Gasses, Any top layer casing") + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .addOutputHatch("Platline fluids, Any bottom layer casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; + if (aActive) + return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).glow().build()}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; + return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { - ArrayList<ItemStack> tInputList = getStoredInputs(); - int tInputList_sS = tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; - } - } - } - } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - - ArrayList<FluidStack> tFluidList = getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - tFluidList_sS = tFluidList.size(); - } else { - tFluidList.remove(i--); - tFluidList_sS = tFluidList.size(); - break; - } - } - } + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = getCompactedFluids(); + + if (tInputs.length <= 0) + return false; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + getBaseMetaTileEntity(), + false, + V[tTier], + tFluids, + tInputs + ); + + if (tRecipe == null) + return false; + if (this.mHeatingCapacity < tRecipe.mSpecialValue) + return false; + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) + return false; + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + byte overclockCount = calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - if (tInputList.size() > 0) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue)/900; - byte overclockCount=calculateOverclockednessEBF(tRecipe.mEUt, tRecipe.mDuration, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - if(tHeatCapacityDivTiers>0){ - this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); - this.mMaxProgresstime >>=Math.min(tHeatCapacityDivTiers/2,overclockCount);//extra free overclocking if possible - if(this.mMaxProgresstime<1) this.mMaxProgresstime=1;//no eu efficiency correction - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; - } + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction } - return false; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{ + tRecipe.getOutput(0), + tRecipe.getOutput(1) + }; + this.mOutputFluids = new FluidStack[]{ + tRecipe.getFluidOutput(0) + }; + updateSlots(); + return true; } /** * Calcualtes overclocked ness using long integers - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration */ protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { - byte mTier=(byte)Math.max(0,GT_Utility.getTier(maxInputVoltage)), timesOverclocked=0; - if(mTier==0){ + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; + if (mTier == 0) { //Long time calculation - long xMaxProgresstime = ((long)aDuration)<<1; - if(xMaxProgresstime>Integer.MAX_VALUE-1){ + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { //make impossible if too long - mEUt=Integer.MAX_VALUE-1; - mMaxProgresstime=Integer.MAX_VALUE-1; - }else{ - mEUt=aEUt>>2; - mMaxProgresstime=(int)xMaxProgresstime; + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = aEUt >> 2; + mMaxProgresstime = (int) xMaxProgresstime; } //return 0; - }else{ + } else { //Long EUt calculation - long xEUt=aEUt; + long xEUt = aEUt; //Isnt too low EUt check? - long tempEUt = xEUt<V[1] ? V[1] : xEUt; + long tempEUt = Math.max(xEUt, V[1]); mMaxProgresstime = aDuration; - while (tempEUt <= V[mTier -1]) { - tempEUt<<=2;//this actually controls overclocking + while (tempEUt <= V[mTier - 1]) { + tempEUt <<= 2;//this actually controls overclocking //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime>>=1;//this is effect of overclocking - xEUt = mMaxProgresstime==0 ? xEUt>>1 : xEUt<<2;//U know, if the time is less than 1 tick make the machine use less power + mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power timesOverclocked++; } - if(xEUt>Integer.MAX_VALUE-1){ - mEUt = Integer.MAX_VALUE-1; - mMaxProgresstime = Integer.MAX_VALUE-1; - }else{ - mEUt = (int)xEUt; - if(mEUt==0) + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) mEUt = 1; - if(mMaxProgresstime==0) + if (mMaxProgresstime == 0) mMaxProgresstime = 1;//set time to 1 tick } } @@ -224,171 +231,136 @@ public class GT_MetaTileEntity_ElectricBlastFurnace int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; this.mHeatingCapacity = 0; - if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { - return false; - } - if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) { + + replaceDeprecatedCoils(aBaseMetaTileEntity); + HeatingCoilLevel heatingCap = getInitialHeatLevel(aBaseMetaTileEntity, xDir, zDir); + if (heatingCap == null) return false; - } - if (!addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11)) { + + if (!checkStructure(heatingCap, xDir, zDir, aBaseMetaTileEntity)) return false; - } - replaceDeprecatedCoils(aBaseMetaTileEntity); - byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir); - switch (tUsedMeta) { - case 0: - this.mHeatingCapacity = 1801; - break; - case 1: - this.mHeatingCapacity = 2701; - break; - case 2: - this.mHeatingCapacity = 3601; - break; - case 3: - this.mHeatingCapacity = 4501; - break; - case 4: - this.mHeatingCapacity = 5401; - break; - case 5: - this.mHeatingCapacity = 7201; - break; - case 6: - this.mHeatingCapacity = 9001; - break; - case 7: - this.mHeatingCapacity = 9901; - break; - case 8: - this.mHeatingCapacity = 10801; - break; - default: - return false; - } - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if ((i != 0) || (j != 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings5) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) { - return false; - } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings5) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { - return false; - } - if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 11)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) { - return false; - } - } - } - } - } - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if ((xDir + i != 0) || (zDir + j != 0)) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); - if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) { - return false; - } - } - } - } - } + + this.mHeatingCapacity = (int) heatingCap.getHeat(); this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2); return true; } - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){ - boolean result= this.checkMachineFunction(aBaseMetaTileEntity,aStack); - if (!result) this.mHeatingCapacity=0; - return result; - } + @Override + protected boolean checkTopLayer(int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity) { + if ((i == 0) && (j == 0)) { + return addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), CASING_INDEX); + } + if (addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), CASING_INDEX)) + return true; - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) + return false; - public int getPollutionPerTick(ItemStack aStack) { - return 20; + return aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) == CASING_INDEX; } - public int getDamageToComponent(ItemStack aStack) { - return 0; + @Override + protected boolean checkCoils(HeatingCoilLevel heatingCap, int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity) { + if ((i == 0) && (j == 0)) { + if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) + return false; + + return aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir); + } + + Block blockLow = aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j); + if (!(blockLow instanceof IHeatingCoil)) + return false; + + Block blockHi = aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j); + if (!(blockHi instanceof IHeatingCoil)) + return false; + + byte metaLow = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j); + HeatingCoilLevel coilHeatLow = ((IHeatingCoil) blockLow).getCoilHeat(metaLow); + byte metaHi = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j); + HeatingCoilLevel coilHeatHi = ((IHeatingCoil) blockHi).getCoilHeat(metaHi); + + return heatingCap == coilHeatLow && heatingCap == coilHeatHi; } - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + return this.checkMachineFunction(aBaseMetaTileEntity, aStack); } private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int tX = aBaseMetaTileEntity.getXCoord() + xDir; - int tY = (int) aBaseMetaTileEntity.getYCoord(); + int tY = aBaseMetaTileEntity.getYCoord(); int tZ = aBaseMetaTileEntity.getZCoord() + zDir; int tUsedMeta; for (int xPos = tX - 1; xPos <= tX + 1; xPos++) { for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { - if ((xPos == tX) && (zPos == tZ)) { + if ((xPos == tX) && (zPos == tZ)) continue; - } for (int yPos = tY + 1; yPos <= tY + 2; yPos++) { tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos); - if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) == GregTech_API.sBlockCasings1) { - aBaseMetaTileEntity.getWorld().setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); - } + if (tUsedMeta < 12) + continue; + if (tUsedMeta > 14) + continue; + if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) + continue; + + aBaseMetaTileEntity.getWorld().setBlock( + xPos, + yPos, + zPos, + GregTech_API.sBlockCasings5, + tUsedMeta - 12, + 3 + ); } } } } + @Override - public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) return false; + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) + return false; int targetHeight; FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; for (FluidStack pollutionFluidStack : pollutionFluidStacks) { - if (tLiquid.isFluidEqual(pollutionFluidStack)) { - isOutputPollution = true; - break; - } + if (!tLiquid.isFluidEqual(pollutionFluidStack)) + continue; + + isOutputPollution = true; + break; } if (isOutputPollution) { targetHeight = this.controllerY + 3; int pollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); - break; - } + if (!isValidMetaTileEntity(tHatch)) + continue; + pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); + break; } tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100; } else { targetHeight = this.controllerY; } for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { - if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { - if (tHatch.getBaseMetaTileEntity().getYCoord() == targetHeight) { - 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); - } - } + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? !tHatch.outputsSteam() : !tHatch.outputsLiquids()) + continue; + + if (tHatch.getBaseMetaTileEntity().getYCoord() != targetHeight) + continue; + + 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; @@ -396,37 +368,37 @@ public class GT_MetaTileEntity_ElectricBlastFurnace @Override public String[] getInfoData() { - int mPollutionReduction=0; + int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } + if (!isValidMetaTileEntity(tHatch)) + continue; + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (!isValidMetaTileEntity(tHatch)) + continue; + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress")+": " +EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", - StatCollector.translateToLocal("GT5U.multiblock.energy")+": " +EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.multiblock.usage")+": "+EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei")+": "+EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+" EU/t(*2A) "+StatCollector.translateToLocal("GT5U.machines.tier")+": "+ - EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.EBF.heat")+": "+ - EnumChatFormatting.GREEN+mHeatingCapacity+EnumChatFormatting.RESET+" K", - StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + + EnumChatFormatting.GREEN + mHeatingCapacity + EnumChatFormatting.RESET + " K", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index 363d689c84..2457a65dec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,17 +1,14 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; -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_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; @@ -19,6 +16,13 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import org.lwjgl.input.Keyboard; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine { @@ -32,34 +36,34 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Combustion Generator") - .addInfo("Controller block for the Extreme Combustion Engine") - .addInfo("Supply High Octane Gasoline and 8000L of Lubricant per hour to run") - .addInfo("Supply 320L/s of Liquid Oxygen to boost output (optional)") - .addInfo("Default: Produces 8192EU/t at 100% fuel efficiency") - .addInfo("Boosted: Produces 32768EU/t at 400% fuel efficiency") - .addInfo("You need to wait for it to reach 400% to output full power") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, false) - .addController("Front center") - .addCasingInfo("Robust Tungstensteel Machine Casing", 16) - .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") - .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") - .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center") - .addMaintenanceHatch("One of the casings next to a Gear Box") - .addMufflerHatch("Top middle back, above the rear Gear Box") - .addInputHatch("HOG, next to a Gear Box") - .addInputHatch("Lubricant, next to a Gear Box") - .addInputHatch("Liquid Oxygen, optional, next to a Gear Box") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Combustion Generator") + .addInfo("Controller block for the Extreme Combustion Engine") + .addInfo("Supply High Octane Gasoline and 8000L of Lubricant per hour to run") + .addInfo("Supply 320L/s of Liquid Oxygen to boost output (optional)") + .addInfo("Default: Produces 8192EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 32768EU/t at 400% fuel efficiency") + .addInfo("You need to wait for it to reach 400% to output full power") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 16) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center") + .addMaintenanceHatch("One of the casings next to a Gear Box") + .addMufflerHatch("Top middle back, above the rear Gear Box") + .addInputHatch("HOG, next to a Gear Box") + .addInputHatch("Lubricant, next to a Gear Box") + .addInputHatch("Liquid Oxygen, optional, next to a Gear Box") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override @@ -70,9 +74,16 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE)}; + if (aActive) return new ITexture[]{ + casingTexturePages[0][60], + TextureFactory.of(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][60], + TextureFactory.of(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW).glow().build()}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][60]}; + return new ITexture[]{casingTexturePages[0][60]}; } @Override @@ -176,8 +187,8 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die return new String[]{ EnumChatFormatting.BLUE+"Extreme Diesel Engine"+EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET +" EU", getIdealStatus() == getRepairStatus() ? EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET, diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index e1db9d54f6..8e54010ccb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -1,13 +1,9 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - import gregtech.GT_Mod; -import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -17,7 +13,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_GUIContainer_FusionReactor; @@ -30,11 +26,25 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW; + public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase { public GT_Recipe mLastRecipe; public int mEUStore; + static { + Textures.BlockIcons.setCasingTextureForId(52, + TextureFactory.of( + TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build() + )); + } + public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) { super(aID, aName, aNameRegional); } @@ -45,6 +55,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity public abstract int tier(); + @Override public abstract long maxEUStore(); @Override @@ -57,8 +68,10 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName); } + @Override public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); + @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { return aSide != getBaseMetaTileEntity().getFrontFacing(); @@ -110,18 +123,18 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) { int mEnergyHatches_sS = this.mEnergyHatches.size(); - for (int i = 0; i < mEnergyHatches_sS; i++) { - if (this.mEnergyHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Energy mEnergyHatch : this.mEnergyHatches) { + if (mEnergyHatch.mTier < tier()) return false; } int mOutputHatches_sS = this.mOutputHatches.size(); - for (int i = 0; i < mOutputHatches_sS; i++) { - if (this.mOutputHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Output mOutputHatch : this.mOutputHatches) { + if (mOutputHatch.mTier < tier()) return false; } int mInputHatches_sS = this.mInputHatches.size(); - for (int i = 0; i < mInputHatches_sS; i++) { - if (this.mInputHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Input mInputHatch : this.mInputHatches) { + if (mInputHatch.mTier < tier()) return false; } mWrench = true; @@ -138,8 +151,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) { if (list != null) { int list_sS=list.size(); - for (int i = 0; i < list_sS; i++) { - if (list.get(i).mTier < tier) { + for (GT_MetaTileEntity_Hatch gt_metaTileEntity_hatch : list) { + if (gt_metaTileEntity_hatch.mTier < tier) { return false; } } @@ -218,23 +231,20 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity public abstract int getFusionCoilMeta(); + @Override public abstract String[] getDescription(); + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] sTexture; - if (aSide == aFacing) { - sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay())}; - } else { - if (!aActive) { - sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; - } else { - sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; - } - } - return sTexture; + if (aSide == aFacing) return new ITexture[]{TextureFactory.of(MACHINE_CASING_FUSION_GLASS), getTextureOverlay()}; + if (aActive) return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(52)}; + return new ITexture[]{TextureFactory.of(MACHINE_CASING_FUSION_GLASS)}; } - public abstract IIconContainer getIconOverlay(); + /** + * @return The list of textures overlay + */ + public abstract ITexture getTextureOverlay(); @Override public boolean isCorrectMachinePart(ItemStack aStack) { @@ -260,8 +270,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity int tFluidList_sS=tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { - if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); } else { tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); @@ -272,13 +282,13 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity } if (tFluidList.size() > 1) { FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[]{}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids); if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { turnCasingActive(false); this.mLastRecipe = null; return false; } - if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { + if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids)) { this.mLastRecipe = tRecipe; this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); @@ -362,8 +372,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { try { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); - } catch (Exception e) { + GT_Mod.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + } catch (Exception ignored) { } } this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); @@ -420,6 +430,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return true; } + @Override public boolean drainEnergyInput(long aEU) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 9da832c81a..39b78c68bd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -1,17 +1,23 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; +import org.lwjgl.input.Keyboard; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW; public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer { + private static final ITexture textureOverlay = TextureFactory.of( + TextureFactory.of(OVERLAY_FUSION1), + TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).glow().build()); + public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); } @@ -36,6 +42,11 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC } @Override + public Block getCasing() { + return GregTech_API.sBlockCasings1; + } + + @Override public int getCasingMeta() { return 6; } @@ -50,45 +61,41 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC return 15; } - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor") - .addInfo("It's over 9000!!!") - .addInfo("Controller block for the Fusion Reactor Mk I") - .addInfo("2048EU/t and 10M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfo("LuV Machine Casing", 79) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") - .addStructureInfo("ALL Hatches must be LuV or better") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - @Override - public int tierOverclock() { - return 1; + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk I") + .addInfo("2048EU/t and 10M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("LuV Machine Casing", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be LuV or better") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override - public Block getCasing() { - return GregTech_API.sBlockCasings1; + public ITexture getTextureOverlay() { + return textureOverlay; } @Override - public IIconContainer getIconOverlay() { - return Textures.BlockIcons.OVERLAY_FUSION1; + public int tierOverclock() { + return 1; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index 7a363f8f6f..2ffa8ba4e1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -1,17 +1,23 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; +import org.lwjgl.input.Keyboard; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2_GLOW; public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer { + private static final ITexture textureOverlay = TextureFactory.of( + TextureFactory.of(OVERLAY_FUSION2), + TextureFactory.builder().addIcon(OVERLAY_FUSION2_GLOW).glow().build()); + public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); } @@ -36,6 +42,11 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC } @Override + public Block getCasing() { + return GregTech_API.sBlockCasings4; + } + + @Override public int getCasingMeta() { return 6; } @@ -50,44 +61,40 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC return 7; } - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor") - .addInfo("It's over 9000!!!") - .addInfo("Controller block for the Fusion Reactor Mk II") - .addInfo("4096EU/t and 20M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfo("Fusion Machine Casing", 79) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") - .addStructureInfo("ALL Hatches must be ZPM or better") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - @Override - public int tierOverclock() { - return 2; + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk II") + .addInfo("4096EU/t and 20M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("Fusion Machine Casing", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be ZPM or better") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override - public Block getCasing() { - return GregTech_API.sBlockCasings4; + public ITexture getTextureOverlay() { + return textureOverlay; } @Override - public IIconContainer getIconOverlay() { - return Textures.BlockIcons.OVERLAY_FUSION2; + public int tierOverclock() { + return 2; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index a575427791..e8ae396954 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -1,17 +1,23 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; +import org.lwjgl.input.Keyboard; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3_GLOW; public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer { + private static final ITexture textureOverlay = TextureFactory.of( + TextureFactory.of(OVERLAY_FUSION3), + TextureFactory.builder().addIcon(OVERLAY_FUSION3_GLOW).glow().build()); + public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); } @@ -36,6 +42,11 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC } @Override + public Block getCasing() { + return GregTech_API.sBlockCasings4; + } + + @Override public int getCasingMeta() { return 8; } @@ -50,45 +61,41 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC return 7; } - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor") - .addInfo("A SUN DOWN ON EARTH") - .addInfo("Controller block for the Fusion Reactor Mk III") - .addInfo("8192EU/t and 40M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfo("Fusion Machine Casing Mk II", 79) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") - .addStructureInfo("ALL Hatches must be UV or better") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - @Override - public int tierOverclock() { - return 4; + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Fusion Reactor") + .addInfo("A SUN DOWN ON EARTH") + .addInfo("Controller block for the Fusion Reactor Mk III") + .addInfo("8192EU/t and 40M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfo("Fusion Machine Casing Mk II", 79) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings") + .addInputHatch("2-16, Specified casings") + .addOutputHatch("1-16, Specified casings") + .addStructureInfo("ALL Hatches must be UV or better") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override - public Block getCasing() { - return GregTech_API.sBlockCasings4; + public ITexture getTextureOverlay() { + return textureOverlay; } @Override - public IIconContainer getIconOverlay() { - return Textures.BlockIcons.OVERLAY_FUSION3; + public int tierOverclock() { + return 4; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index dfa58c6407..9ce1de3fec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -1,9 +1,6 @@ package gregtech.common.tileentities.machines.multi; -import org.lwjgl.input.Keyboard; - 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; @@ -12,7 +9,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; 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.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; @@ -25,6 +22,13 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase { public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) @@ -43,31 +47,32 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc super(aName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Heat Exchanger") - .addInfo("Controller Block for the Large Heat Exchanger") - .addInfo("More complicated than a Fusion Reactor. Seriously") - .addInfo("Inputs are Hot Coolant or Lava") - .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") - .addInfo("Read the wiki article to understand how it works") - .addInfo("Then go to the Discord to understand the wiki") - .addSeparator() - .beginStructureBlock(3, 4, 3, false) - .addController("Front bottom") - .addCasingInfo("Stable Titanium Machine Casing", 20) - .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") - .addMaintenanceHatch("Any casing") - .addInputHatch("Hot fluid, bottom center") - .addInputHatch("Distilled water, any casing") - .addOutputHatch("Cold fluid, top center") - .addOutputHatch("Steam/SH Steam, any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Heat Exchanger") + .addInfo("Controller Block for the Large Heat Exchanger") + .addInfo("More complicated than a Fusion Reactor. Seriously") + .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") + .addInfo("Read the wiki article to understand how it works") + .addInfo("Then go to the Discord to understand the wiki") + .addSeparator() + .beginStructureBlock(3, 4, 3, false) + .addController("Front bottom") + .addCasingInfo("Stable Titanium Machine Casing", 20) + .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") + .addMaintenanceHatch("Any casing") + .addInputHatch("Hot fluid, bottom center") + .addInputHatch("Distilled water, any casing") + .addOutputHatch("Cold fluid, top center") + .addOutputHatch("Steam/SH Steam, any casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override @@ -82,25 +87,38 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc super.saveNBTData(aNBT); } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}; + if (aActive) + return new ITexture[]{ + casingTexturePages[0][50], + TextureFactory.of(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][50], + TextureFactory.of(OVERLAY_FRONT_HEAT_EXCHANGER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).glow().build()}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][50]}; + return new ITexture[]{casingTexturePages[0][50]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeHeatExchanger.png"); } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { if (mInputHotFluidHatch.getFluid() == null) return true; @@ -146,11 +164,10 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency); if (do_lava) { mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true); - this.mEfficiencyIncrease = 80; } else { mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true); - this.mEfficiencyIncrease = 80; } + this.mEfficiencyIncrease = 80; return true; } @@ -161,6 +178,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc return usage; } + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. @@ -189,6 +207,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc return true; } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -239,10 +258,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc } public boolean ignoreController(Block tTileEntity) { - if (!controller && tTileEntity == GregTech_API.sBlockMachines) { - return true; - } - return false; + return !controller && tTileEntity == GregTech_API.sBlockMachines; } public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -290,21 +306,26 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc return 14; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_HeatExchanger(this.mName); } @@ -317,17 +338,17 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc @Override public String[] getInfoData() { return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress")+": "+ - EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", - StatCollector.translateToLocal("GT5U.multiblock.usage")+" "+StatCollector.translateToLocal("GT5U.LHE.steam")+": "+ - (superheated?EnumChatFormatting.RED:EnumChatFormatting.YELLOW) + Integer.toString(superheated?-2*mEUt:-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.LHE.superheated")+": "+ (superheated?EnumChatFormatting.RED:EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated")+" "+StatCollector.translateToLocal("GT5U.LHE.threshold")+": "+ EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + (superheated ? -2 * mEUt : -mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET }; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 9e002badbf..3d979bb862 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -2,12 +2,13 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; 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_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -15,13 +16,16 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; -public class GT_MetaTileEntity_ImplosionCompressor - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -30,64 +34,79 @@ public class GT_MetaTileEntity_ImplosionCompressor super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ImplosionCompressor(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") - .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Solid Steel Machine Casing", 16) - .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addMufflerHatch("Any casing") - .addInputBus("Any casing") - .addOutputBus("Any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Implosion Compressor") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Solid Steel Machine Casing", 16) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addMufflerHatch("Any casing") + .addInputBus("Any casing") + .addOutputBus("Any casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; + if (aActive) return new ITexture[]{ + BlockIcons.casingTexturePages[0][16], + TextureFactory.of(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.casingTexturePages[0][16], + TextureFactory.of(OVERLAY_FRONT_IMPLOSION_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][16]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); int tInputList_sS=tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { - if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { tInputList.remove(j--); tInputList_sS=tInputList.size(); } else { tInputList.remove(i--); tInputList_sS=tInputList.size(); @@ -96,8 +115,8 @@ public class GT_MetaTileEntity_ImplosionCompressor } } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); - if (tInputList.size() > 0) { + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + if (!tInputList.isEmpty()) { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); @@ -119,13 +138,15 @@ public class GT_MetaTileEntity_ImplosionCompressor return false; } + @Override 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(5)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); } } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -153,18 +174,22 @@ public class GT_MetaTileEntity_ImplosionCompressor return tAmount >= 16; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 500; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 551abdf38a..841a4fb57c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -4,27 +4,39 @@ import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.*; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; 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.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_GLOW; -public abstract class GT_MetaTileEntity_LargeBoiler - extends GT_MetaTileEntity_MultiBlockBase { +public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_MultiBlockBase { private boolean firstRun = true; private int mSuperEfficencyIncrease = 0; private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config + private int excessWater = 0; //Eliminate rounding errors for water private int excessFuel = 0; //Eliminate rounding errors for fuels that burn half items private int excessProjectedEU = 0; //Eliminate rounding errors from throttling the boiler @@ -36,35 +48,36 @@ public abstract class GT_MetaTileEntity_LargeBoiler super(aName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Boiler") - .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler") - .addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? - .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") - .addInfo(String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()))//? check semifluid again - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 5, 3, false) - .addController("Front bottom") - .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24)//? - .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") - .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") - .addMaintenanceHatch("Any firebox") - .addMufflerHatch("Any firebox") - .addInputBus("Solid fuel, Any firebox") - .addInputHatch("Liquid fuel, Any firebox") - .addStructureInfo("You can use either, or both") - .addInputHatch("Water, Any firebox") - .addOutputHatch("Steam, any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Boiler") + .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler") + .addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? + .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") + .addInfo(String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()))//? check semifluid again + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 5, 3, false) + .addController("Front bottom") + .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24)//? + .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") + .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") + .addMaintenanceHatch("Any firebox") + .addMufflerHatch("Any firebox") + .addInputBus("Solid fuel, Any firebox") + .addInputHatch("Liquid fuel, Any firebox") + .addStructureInfo("You can use either, or both") + .addInputHatch("Water, Any firebox") + .addOutputHatch("Steam, any casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } - + public abstract String getCasingMaterial(); public abstract Block getCasingBlock(); @@ -89,25 +102,37 @@ public abstract class GT_MetaTileEntity_LargeBoiler public abstract int getEfficiencyIncrease(); + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)}; + if (aActive) return new ITexture[]{ + BlockIcons.getCasingTextureForId(getCasingTextureIndex()), + TextureFactory.of(OVERLAY_FRONT_LARGE_BOILER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.getCasingTextureForId(getCasingTextureIndex()), + TextureFactory.of(OVERLAY_FRONT_LARGE_BOILER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png"); } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { //Do we have an integrated circuit with a valid configuration? if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) { @@ -176,13 +201,17 @@ public abstract class GT_MetaTileEntity_LargeBoiler abstract int runtimeBoost(int mTime); + @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if (this.mSuperEfficencyIncrease > 0) mEfficiency = Math.max(0, Math.min(mEfficiency + mSuperEfficencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { - long amount = (tGeneratedEU + 160) / 160; + long amount = (tGeneratedEU + STEAM_PER_WATER) / STEAM_PER_WATER; + excessWater += amount * STEAM_PER_WATER - tGeneratedEU; + amount -= excessWater / STEAM_PER_WATER; + excessWater %= STEAM_PER_WATER; if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) { addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } else { @@ -196,6 +225,22 @@ public abstract class GT_MetaTileEntity_LargeBoiler } @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("excessFuel", excessFuel); + aNBT.setInteger("excessWater", excessWater); + aNBT.setInteger("excessProjectedEU", excessProjectedEU); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + excessFuel = aNBT.getInteger("excessFuel"); + excessWater = aNBT.getInteger("excessWater"); + excessProjectedEU = aNBT.getInteger("excessProjectedEU"); + } + + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime > 0 && firstRun) { firstRun = false; @@ -204,6 +249,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler super.onPostTick(aBaseMetaTileEntity, aTick); } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -264,19 +310,23 @@ public abstract class GT_MetaTileEntity_LargeBoiler return tCasingAmount >= 24 && tFireboxAmount >= 3; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { int adjustedEUOutput = Math.max(25, getEUt() - 25 * integratedCircuitConfig); return Math.max(1, 12 * adjustedEUOutput / getEUt()); } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index c44f47f726..9aeff9b3d0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Bronze - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -15,10 +14,12 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName); } + @Override public String getCasingMaterial(){ return "Bronze"; } @@ -28,42 +29,52 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze return "Plated Bricks"; } + @Override public Block getCasingBlock() { return GregTech_API.sBlockCasings1; } + @Override public byte getCasingMeta() { return 10; } + @Override public byte getCasingTextureIndex() { return 10; } + @Override public Block getPipeBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getPipeMeta() { return 12; } + @Override public Block getFireboxBlock() { return GregTech_API.sBlockCasings3; } + @Override public byte getFireboxMeta() { return 13; } + @Override public byte getFireboxTextureIndex() { return 45; } + @Override public int getEUt() { return 400; } + @Override public int getEfficiencyIncrease() { return 16; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index 12a08a858d..d1188955f4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Steel - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -15,10 +14,12 @@ public class GT_MetaTileEntity_LargeBoiler_Steel super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName); } + @Override public String getCasingMaterial(){ return "Steel"; } @@ -28,42 +29,52 @@ public class GT_MetaTileEntity_LargeBoiler_Steel return "Machine Casings"; } + @Override public Block getCasingBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getCasingMeta() { return 0; } + @Override public byte getCasingTextureIndex() { return 16; } + @Override public Block getPipeBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getPipeMeta() { return 13; } + @Override public Block getFireboxBlock() { return GregTech_API.sBlockCasings3; } + @Override public byte getFireboxMeta() { return 14; } + @Override public byte getFireboxTextureIndex() { return 46; } + @Override public int getEUt() { return 600; } + @Override public int getEfficiencyIncrease() { return 12; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index c0a06168ab..e67cf64723 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Titanium - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -15,10 +14,12 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName); } + @Override public String getCasingMaterial(){ return "Titanium"; } @@ -28,42 +29,52 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium return "Machine Casings"; } + @Override public Block getCasingBlock() { return GregTech_API.sBlockCasings4; } + @Override public byte getCasingMeta() { return 2; } + @Override public byte getCasingTextureIndex() { return 50; } + @Override public Block getPipeBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getPipeMeta() { return 14; } + @Override public Block getFireboxBlock() { return GregTech_API.sBlockCasings4; } + @Override public byte getFireboxMeta() { return 3; } + @Override public byte getFireboxTextureIndex() { return 51; } + @Override public int getEUt() { return 800; } + @Override public int getEfficiencyIncrease() { return 8; } @@ -72,4 +83,4 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium int runtimeBoost(int mTime) { return mTime * 130 / 100; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 629733ad9d..78e7d25752 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_TungstenSteel - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -15,10 +14,12 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName); } + @Override public String getCasingMaterial(){ return "TungstenSteel"; } @@ -28,42 +29,52 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel return "Machine Casings"; } + @Override public Block getCasingBlock() { return GregTech_API.sBlockCasings4; } + @Override public byte getCasingMeta() { return 0; } + @Override public byte getCasingTextureIndex() { return 48; } + @Override public Block getPipeBlock() { return GregTech_API.sBlockCasings2; } + @Override public byte getPipeMeta() { return 15; } + @Override public Block getFireboxBlock() { return GregTech_API.sBlockCasings3; } + @Override public byte getFireboxMeta() { return 15; } + @Override public byte getFireboxTextureIndex() { return 47; } + @Override public int getEUt() { return 1000; } + @Override public int getEfficiencyIncrease() { return 4; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index d462b9a36d..c9de809b58 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -1,13 +1,12 @@ package gregtech.common.tileentities.machines.multi; 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_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -16,214 +15,223 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase { - private final int CASING_INDEX = 176; - - public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_MetaTileEntity_LargeChemicalReactor(String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_LargeChemicalReactor(this.mName); - } - - @Override - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Chemical Reactor") - .addInfo("Controller block for the Large Chemical Reactor") - .addInfo("Does not lose efficiency when overclocked") - .addInfo("Accepts fluids instead of fluid cells") - .addSeparator() - .beginStructureBlock(3, 3, 3, false) - .addController("Front center") - .addCasingInfo("Chemically Inert Machine Casing", 8) - .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") - .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addInputHatch("Any casing") - .addOutputBus("Any casing") - .addOutputHatch("Any casing") - .addStructureInfo("You can have multiple hatches/busses") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, - boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.casingTexturePages[1][48], - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE - : Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) }; - } - return new ITexture[] { Textures.BlockIcons.casingTexturePages[1][48] }; - } - - @Override + private final int CASING_INDEX = 176; + + public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_LargeChemicalReactor(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_LargeChemicalReactor(this.mName); + } + + @Override + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Chemical Reactor") + .addInfo("Controller block for the Large Chemical Reactor") + .addInfo("Does not lose efficiency when overclocked") + .addInfo("Accepts fluids instead of fluid cells") + .addSeparator() + .beginStructureBlock(3, 3, 3, false) + .addController("Front center") + .addCasingInfo("Chemically Inert Machine Casing", 8) + .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") + .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addInputHatch("Any casing") + .addOutputBus("Any casing") + .addOutputHatch("Any casing") + .addStructureInfo("You can have multiple hatches/busses") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, + boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) return new ITexture[]{ + casingTexturePages[1][48], + TextureFactory.of(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[1][48], + TextureFactory.of(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).glow().build()}; + } + return new ITexture[]{casingTexturePages[1][48]}; + } + + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); } - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack aStack) { - ArrayList<ItemStack> tInputList = getStoredInputs(); - int tInputList_sS = tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { - if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { - tInputList.remove(j--); - tInputList_sS = tInputList.size(); - } else { - tInputList.remove(i--); - tInputList_sS = tInputList.size(); - break; - } - } - } - } - tInputList.add(mInventory[1]); - ItemStack[] inputs = tInputList.toArray(new ItemStack[tInputList.size()]); - - ArrayList<FluidStack> tFluidList = getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - tFluidList_sS = tFluidList.size(); - } else { - tFluidList.remove(i--); - tFluidList_sS = tFluidList.size(); - break; - } - } - } - } - FluidStack[] fluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - - if (inputs.length > 0 || fluids.length > 0) { - long tVoltage = getMaxInputVoltage(); - byte tier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, - false, gregtech.api.enums.GT_Values.V[tier], fluids, inputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, fluids, inputs)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - calculatePerfectOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - - this.mOutputItems = tRecipe.mOutputs; - this.mOutputFluids = tRecipe.mFluidOutputs; - this.updateSlots(); - return true; - } - } - return false; - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - int casingAmount = 0; - boolean hasHeatingCoil = false; - // x=width, z=depth, y=height - for (int x = -1 + xDir; x <= xDir + 1; x++) { - for (int z = -1 + zDir; z <= zDir + 1; z++) { - for (int y = -1; y <= 1; y++) { - if (x == 0 && y == 0 && z == 0) { - continue; - } - IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); - Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); - int centerCoords = 0; - if (x == xDir) { - centerCoords++; - } - if (y == 0) { - centerCoords++; - } - if (z == zDir) { - centerCoords++; - } - if (centerCoords == 3) { - if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { - continue; - } else { - return false; - } - } - if (centerCoords == 2 && block == GregTech_API.sBlockCasings5 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) { - hasHeatingCoil = true; - continue; - } - if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX) - && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) - && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { - if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) { - casingAmount++; - } else { - return false; - } - } - - } - } - - } - return casingAmount >= 8 && hasHeatingCoil && !mEnergyHatches.isEmpty() && !mMaintenanceHatches.isEmpty(); - } - - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<ItemStack> tInputList = getStoredInputs(); + int tInputList_sS = tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; j++) { + if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { + if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { + tInputList.remove(j--); + tInputList_sS = tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + } + } + } + tInputList.add(mInventory[1]); + ItemStack[] inputs = tInputList.toArray(new ItemStack[0]); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + int tFluidList_sS = tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); + } else { + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); + break; + } + } + } + } + FluidStack[] fluids = tFluidList.toArray(new FluidStack[0]); + + if (inputs.length > 0 || fluids.length > 0) { + long tVoltage = getMaxInputVoltage(); + byte tier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, + false, gregtech.api.enums.GT_Values.V[tier], fluids, inputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, fluids, inputs)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculatePerfectOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mOutputItems = tRecipe.mOutputs; + this.mOutputFluids = tRecipe.mFluidOutputs; + this.updateSlots(); + return true; + } + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int casingAmount = 0; + boolean hasHeatingCoil = false; + // x=width, z=depth, y=height + for (int x = -1 + xDir; x <= xDir + 1; x++) { + for (int z = -1 + zDir; z <= zDir + 1; z++) { + for (int y = -1; y <= 1; y++) { + if (x == 0 && y == 0 && z == 0) { + continue; + } + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + int centerCoords = 0; + if (x == xDir) { + centerCoords++; + } + if (y == 0) { + centerCoords++; + } + if (z == zDir) { + centerCoords++; + } + if (centerCoords == 3) { + if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + continue; + } else { + return false; + } + } + if (centerCoords == 2 && block == GregTech_API.sBlockCasings5 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) { + hasHeatingCoil = true; + continue; + } + if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings8 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 0) { + casingAmount++; + } else { + return false; + } + } + + } + } + + } + return casingAmount >= 8 && hasHeatingCoil && !mEnergyHatches.isEmpty() && !mMaintenanceHatches.isEmpty(); + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index 8d4d81a5d2..a43de4cd9d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -19,6 +17,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase { protected int baseEff = 0; @@ -40,6 +40,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M return getMaxEfficiency(aStack) > 0; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png"); } @@ -175,15 +176,6 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 10; // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. - /* - if(this.mDynamoHatches.size()>0){ - for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) - if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { - GT_Log.exp.println("Turbine "+this.mName+" DynHatch Explosion!"); - explodeMultiblock(); - } - } - */ return true; } } @@ -195,6 +187,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M return 1; } + @Override public int getMaxEfficiency(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 6c482db6e7..b8f3d835fa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -1,16 +1,10 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; -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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; @@ -18,6 +12,15 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Collection; + +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine { @@ -31,29 +34,30 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.casingTexturePages[0][58]}; + return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_SS_ACTIVE5) : TextureFactory.of(LARGETURBINE_SS5) : casingTexturePages[0][58]}; } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Gas Turbine") - .addInfo("Controller block for the Large Gas Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo("Stainless Steel Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addMufflerHatch("Side centered") - .addInputHatch("Gas Fuel, Side centered") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Gas Turbine") + .addInfo("Controller block for the Large Gas Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Stainless Steel Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addMufflerHatch("Side centered") + .addInputHatch("Gas Fuel, Side centered") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } public int getFuelValue(FluidStack aLiquid) { @@ -99,7 +103,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); - + if (aOptFlow < fuelValue) { // turbine too weak and/or fuel too powerful // at least consume 1L @@ -107,39 +111,35 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT // wastes the extra fuel and generate aOptFlow directly depleteInput(new FluidStack(firstFuelType, 1)); this.storedFluid += 1; - return GT_Utility.safeInt((long)aOptFlow * (long)aBaseEff / 10000L); + return GT_Utility.safeInt((long) aOptFlow * (long) aBaseEff / 10000L); } - - actualOptimalFlow = GT_Utility.safeInt((long)aOptFlow / fuelValue); + + actualOptimalFlow = GT_Utility.safeInt((long) aOptFlow / fuelValue); this.realOptFlow = actualOptimalFlow; - int remainingFlow = GT_Utility.safeInt((long)(actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. int flow = 0; int totalFlow = 0; - storedFluid=0; - int aFluids_sS=aFluids.size(); - for (int i = 0; i < aFluids_sS; i++) { - if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + storedFluid = 0; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } } - if(totalFlow<=0)return 0; - tEU = GT_Utility.safeInt((long)totalFlow * fuelValue); - - if (totalFlow != actualOptimalFlow) { - float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); - //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - //if (efficiency < 0) - // efficiency = 0; // Can happen with really ludicrously poor inefficiency. - tEU *= efficiency; - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); + if (totalFlow <= 0) return 0; + tEU = GT_Utility.safeInt((long) totalFlow * fuelValue); + + if (totalFlow == actualOptimalFlow) { + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); } else { - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); + float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); + tEU *= efficiency; + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); } return tEU; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 2355b89fa8..fb510f1352 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -1,18 +1,11 @@ package gregtech.common.tileentities.machines.multi; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.GT_Mod; import gregtech.api.GregTech_API; -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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; @@ -21,11 +14,20 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine { public boolean achievement = false; - private boolean looseFit=false; + private boolean looseFit = false; public GT_MetaTileEntity_LargeTurbine_HPSteam(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -37,31 +39,32 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI5) : Textures.BlockIcons.casingTexturePages[0][59]}; + return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_TI_ACTIVE5) : TextureFactory.of(LARGETURBINE_TI5) : casingTexturePages[0][59]}; } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Steam Turbine") - .addInfo("Controller block for the Large High Pressure Steam Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Outputs Steam as well as producing power") - .addInfo("Power output depends on turbine and fitting") - .addInfo("Use screwdriver to adjust fitting of turbine") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo("Titanium Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Superheated Steam, Side centered") - .addOutputHatch("Steam, Side centered") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Steam Turbine") + .addInfo("Controller block for the Large High Pressure Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Steam as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Titanium Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Superheated Steam, Side centered") + .addOutputHatch("Steam, Side centered") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override @@ -91,54 +94,54 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { - if(looseFit) { - aOptFlow*=4; - if(aBaseEff>10000){ - aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff=7500; - }else if(aBaseEff>7500){ - aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff*=0.75f; - }else{ - aBaseEff*=0.75f; + if (looseFit) { + aOptFlow *= 4; + if (aBaseEff > 10000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); + aBaseEff = 7500; + } else if (aBaseEff > 7500) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); + aBaseEff *= 0.75f; + } else { + aBaseEff *= 0.75f; } } int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = GT_Utility.safeInt((long) (aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. this.realOptFlow = aOptFlow; - storedFluid=0; + storedFluid = 0; for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { - String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); - if (fluidName.equals("ic2.fluidSuperheatedSteam")) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + final FluidStack aFluidStack = aFluids.get(i); + if (GT_ModHandler.isSuperHeatedSteam(aFluidStack)) { + flow = Math.min(aFluidStack.amount, remainingFlow); // try to use up w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluidStack, flow)); // deplete that amount + this.storedFluid += aFluidStack.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { try { - GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); - } catch (Exception e) { + GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); + } catch (Exception ignored) { } achievement = true; } - }else if(fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")){ - depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); + } else if (GT_ModHandler.isAnySteam(aFluidStack)) { + depleteInput(new FluidStack(aFluidStack, aFluidStack.amount)); } } - if(totalFlow<=0)return 0; + if (totalFlow <= 0) return 0; tEU = totalFlow; addOutput(GT_ModHandler.getSteam(totalFlow)); - if (totalFlow != aOptFlow) { - float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); + if (totalFlow == aOptFlow) { + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); + } else { + float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float) aOptFlow); //if(totalFlow>aOptFlow){efficiency = 1.0f;} tEU *= efficiency; - tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L)); - } else { - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); + tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L)); } return tEU; @@ -147,79 +150,32 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { - looseFit^=true; + looseFit ^= true; GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); } } @Override public int getDamageToComponent(ItemStack aStack) { - return (looseFit && XSTR_INSTANCE.nextInt(4)==0)?0:1; + return (looseFit && XSTR_INSTANCE.nextInt(4) == 0) ? 0 : 1; } - - + @Override public String[] getInfoData() { - super.looseFit = looseFit; - return super.getInfoData(); + super.looseFit = looseFit; + return super.getInfoData(); } - /* - * moved to super - * - int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } - } - - String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; - int tDura = 0; - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); - } - - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", // 1 - tMaintainance, // 2 - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", // 2 - "Stored Energy:" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ // 3 - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + // 4 - EnumChatFormatting.YELLOW+"("+(looseFit?"Loose":"Tight")+")", // 5 - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", // 6 - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", // 7 - "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" // 8 - }; - } - */ - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("turbineFitting",looseFit); + aNBT.setBoolean("turbineFitting", looseFit); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - looseFit=aNBT.getBoolean("turbineFitting"); + looseFit = aNBT.getBoolean("turbineFitting"); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index bb5134097a..bf1506ec81 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -1,25 +1,33 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; 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.items.GT_MetaGenerated_Tool; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Collection; + +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine { @@ -33,29 +41,30 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU5) : Textures.BlockIcons.casingTexturePages[0][60]}; + return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_TU_ACTIVE5) : TextureFactory.of(Textures.BlockIcons.LARGETURBINE_TU5) : casingTexturePages[0][60]}; } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Plasma Turbine") - .addInfo("Controller block for the Large Plasma Generator") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Use your Fusion Reactor to produce the Plasma") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo("Tungstensteel Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Plasma Fluid, Side centered") - .addOutputHatch("Molten Fluid, optional, Side centered") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Plasma Turbine") + .addInfo("Controller block for the Large Plasma Generator") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Use your Fusion Reactor to produce the Plasma") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Tungstensteel Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Plasma Fluid, Side centered") + .addOutputHatch("Molten Fluid, optional, Side centered") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } public int getFuelValue(FluidStack aLiquid) { @@ -99,54 +108,51 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks int tEU = 0; - int actualOptimalFlow = 0; + int actualOptimalFlow = 0; FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); - actualOptimalFlow = GT_Utility.safeInt((long)Math.ceil((double)aOptFlow / (double)fuelValue)); + actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow / (double) fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info - int remainingFlow = GT_Utility.safeInt((long)(actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. int flow = 0; int totalFlow = 0; - storedFluid=0; - int aFluids_sS=aFluids.size(); - for (int i = 0; i < aFluids_sS; i++) { - if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + storedFluid = 0; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } } String fn = FluidRegistry.getFluidName(firstFuelType); - String[] nameSegments = fn.split("\\.",2); - if (nameSegments.length==2){ - String outputName=nameSegments[1]; + String[] nameSegments = fn.split("\\.", 2); + if (nameSegments.length == 2) { + String outputName = nameSegments[1]; FluidStack output = FluidRegistry.getFluidStack(outputName, totalFlow); - if (output==null){ - output = FluidRegistry.getFluidStack("molten."+outputName, totalFlow); + if (output == null) { + output = FluidRegistry.getFluidStack("molten." + outputName, totalFlow); } - if (output!=null) { + if (output != null) { addOutput(output); } } - if(totalFlow<=0)return 0; - tEU = GT_Utility.safeInt((long)((fuelValue / 20D) * (double)totalFlow)); + if (totalFlow <= 0) return 0; + tEU = GT_Utility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow)); //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); - if (totalFlow != actualOptimalFlow) { - double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); - //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - //if (efficiency < 0) - // efficiency = 0; // Can happen with really ludicrously poor inefficiency. - tEU = (int)(tEU * efficiency); - tEU = GT_Utility.safeInt((long)(aBaseEff/10000D*tEU)); + if (totalFlow == actualOptimalFlow) { + tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); } else { - tEU = GT_Utility.safeInt((long)(aBaseEff/10000D*tEU)); + double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); + + tEU = (int) (tEU * efficiency); + tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); } return tEU; @@ -157,17 +163,17 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public boolean checkRecipe(ItemStack aStack) { - if((counter&7)==0 && (aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)) { + if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() > 179)) { stopMachine(); return false; } ArrayList<FluidStack> tFluids = getStoredFluids(); - if (tFluids.size() > 0) { + if (!tFluids.isEmpty()) { if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { counter = 0; - baseEff = GT_Utility.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, + baseEff = GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50)); @@ -176,7 +182,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } } - if(optFlow<=0 || baseEff<=0){ + if (optFlow <= 0 || baseEff <= 0) { stopMachine();//in case the turbine got removed return false; } @@ -187,7 +193,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) // This is how much the turbine can actually change during this tick - int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long)Math.abs(difference)/5)); + int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long) Math.abs(difference) / 5)); if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. @@ -197,37 +203,34 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar if (this.mEUt <= 0) { //stopMachine(); - this.mEUt=0; - this.mEfficiency=0; + this.mEUt = 0; + this.mEfficiency = 0; return false; } else { this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 200; // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. - /* - if(this.mDynamoHatches.size()>0){ - for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) - if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { - GT_Log.exp.println("Turbine "+this.mName+" DynHatch Explosion!"); - explodeMultiblock(); - } - } - */ + return true; } } - /* - * moved to super - * - * @Override + @Override public String[] getInfoData() { + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + } + } + String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; + + EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.running.true")+EnumChatFormatting.RESET : + EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.running.false")+EnumChatFormatting.RESET; String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; + EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : + EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET ; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { @@ -242,19 +245,21 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - - return new String[]{ - EnumChatFormatting.BLUE+"Large Turbine"+EnumChatFormatting.RESET, - "Stored Energy:", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - tRunning, - "Current Output: "+EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s", - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", - tMaintainance, + String[] ret = new String[]{ + // 8 Lines available for information panels + tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ /* 3 */ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s" + /* 4 */ + EnumChatFormatting.YELLOW+" ("+(looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", /* 6 */ + StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" /* 8 */ }; - }*/ + if (!this.getClass().getName().contains("Steam")) + ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s"; + return ret; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 20bcbf10d0..44e7dfd695 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -1,18 +1,11 @@ package gregtech.common.tileentities.machines.multi; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.GT_Mod; import gregtech.api.GregTech_API; -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.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; @@ -21,12 +14,22 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static gregtech.api.enums.GT_Values.STEAM_PER_WATER; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine { - private float water; + private int excessWater; private boolean achievement = false; - private boolean looseFit=false; + private boolean looseFit = false; public GT_MetaTileEntity_LargeTurbine_Steam(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -39,31 +42,32 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST5) : Textures.BlockIcons.casingTexturePages[0][57]}; + return new ITexture[]{MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? TextureFactory.of(LARGETURBINE_ST_ACTIVE5) : TextureFactory.of(LARGETURBINE_ST5) : casingTexturePages[0][57]}; } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Steam Turbine") - .addInfo("Controller block for the Large Steam Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Outputs Distilled Water as well as producing power") - .addInfo("Power output depends on turbine and fitting") - .addInfo("Use screwdriver to adjust fitting of turbine") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo("Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Steam, Side centered") - .addOutputHatch("Distilled Water, Side centered") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Steam Turbine") + .addInfo("Controller block for the Large Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Distilled Water as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("Turbine Casing", 24) + .addDynamoHatch("Back center") + .addMaintenanceHatch("Side centered") + .addInputHatch("Steam, Side centered") + .addOutputHatch("Distilled Water, Side centered") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @Override @@ -91,61 +95,60 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg return 0; } - private int useWater(float input) { - water = water + input; - int usage = (int) water; - water = water - usage; - return usage; + private int condenseSteam(int steam) { + excessWater += steam; + int water = excessWater / STEAM_PER_WATER; + excessWater %= STEAM_PER_WATER; + return water; } @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { - if(looseFit) { - aOptFlow*=4; - if(aBaseEff>10000){ - aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff=7500; - }else if(aBaseEff>7500){ - aOptFlow*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f); - aBaseEff*=0.75f; - }else{ - aBaseEff*=0.75f; + if (looseFit) { + aOptFlow *= 4; + if (aBaseEff > 10000) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); + aBaseEff = 7500; + } else if (aBaseEff > 7500) { + aOptFlow *= Math.pow(1.1f, ((aBaseEff - 7500) / 10000F) * 20f); + aBaseEff *= 0.75f; + } else { + aBaseEff *= 0.75f; } } int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = GT_Utility.safeInt((long) (aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. this.realOptFlow = aOptFlow; - storedFluid=0; + storedFluid = 0; for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals. - String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); - if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + final FluidStack aFluidStack = aFluids.get(i); + if (GT_ModHandler.isAnySteam(aFluidStack)) { + flow = Math.min(aFluidStack.amount, remainingFlow); // try to use up w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluidStack, flow)); // deplete that amount + this.storedFluid += aFluidStack.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { - GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); + GT_Mod.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); achievement = true; } - }else if(fluidName.equals("ic2.fluidSuperheatedSteam")){ - depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); + } else if (GT_ModHandler.isSuperHeatedSteam(aFluidStack)) { + depleteInput(new FluidStack(aFluidStack, aFluidStack.amount)); } } - if(totalFlow<=0)return 0; + if (totalFlow <= 0) return 0; tEU = totalFlow; - int waterToOutput = useWater(totalFlow / 160.0f); + int waterToOutput = condenseSteam(totalFlow); addOutput(GT_ModHandler.getDistilledWater(waterToOutput)); - if (totalFlow != aOptFlow) { - float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); - //if(totalFlow>aOptFlow){efficiency = 1.0f;} - tEU *= efficiency; - tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L)); + if (totalFlow == aOptFlow) { + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L); } else { - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L); + float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float) aOptFlow); + tEU *= efficiency; + tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L)); } return tEU; @@ -154,77 +157,32 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { - looseFit^=true; + looseFit ^= true; GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); } } @Override public int getDamageToComponent(ItemStack aStack) { - return (looseFit && XSTR_INSTANCE.nextInt(4)==0)?0:1; + return (looseFit && XSTR_INSTANCE.nextInt(4) == 0) ? 0 : 1; } - + @Override public String[] getInfoData() { - super.looseFit = looseFit; - return super.getInfoData(); - } - /* - int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } - } - - String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; - int tDura = 0; - - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); - } - - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", // 1 - tMaintainance, // 2 - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", // 2 - "Stored Energy:" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ // 3 - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + // 4 - EnumChatFormatting.YELLOW+" ("+(looseFit?"Loose":"Tight")+")", // 5 - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", // 6 - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", // 7 - "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" // 8 - }; + super.looseFit = looseFit; + return super.getInfoData(); } - */ - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("turbineFitting",looseFit); + aNBT.setBoolean("turbineFitting", looseFit); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - looseFit=aNBT.getBoolean("turbineFitting"); + looseFit = aNBT.getBoolean("turbineFitting"); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 5eca30def1..3bf7dc4cfb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -1,36 +1,42 @@ package gregtech.common.tileentities.machines.multi; -import static gregtech.api.enums.GT_Values.VN; - -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IHeatingCoil; 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_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; -public class GT_MetaTileEntity_MultiFurnace - extends GT_MetaTileEntity_MultiBlockBase { +import java.util.ArrayList; + +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; + +public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMultiFurnace { private int mLevel = 0; private int mCostDiscount = 1; + private static final int CASING_INDEX = 11; + public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -39,123 +45,108 @@ public class GT_MetaTileEntity_MultiFurnace super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MultiFurnace(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Furnace") - .addInfo("Controller Block for the Multi Smelter") - .addInfo("Smelts up to 8-128 items at once") - .addInfo("Items smelted increases with coil tier") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front bottom") - .addCasingInfo("Heat Proof Machine Casing", 8) - .addOtherStructurePart("Heating Coils (any tier)", "Middle layer") - .addEnergyHatch("Any bottom casing") - .addMaintenanceHatch("Any bottom casing") - .addMufflerHatch("Top Middle") - .addInputBus("Any bottom casing") - .addOutputBus("Any bottom casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Furnace") + .addInfo("Controller Block for the Multi Smelter") + .addInfo("Smelts up to 8-128 items at once") + .addInfo("Items smelted increases with coil tier") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front bottom") + .addCasingInfo("Heat Proof Machine Casing", 8) + .addOtherStructurePart("Heating Coils", "Middle layer") + .addEnergyHatch("Any bottom casing") + .addMaintenanceHatch("Any bottom casing") + .addMufflerHatch("Top Middle") + .addInputBus("Any bottom casing") + .addOutputBus("Any bottom casing") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + return tt.getInformation(); + return tt.getStructureInformation(); } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][11]}; + if (aSide != aFacing) return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + if (aActive) return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_MULTI_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_MULTI_SMELTER_GLOW).glow().build()}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes; } - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); - if (!tInputList.isEmpty()) { - int mVolatage=GT_Utility.safeInt(getMaxInputVoltage()); - int tMaxParrallel = 8 * this.mLevel; - int tCurrenParrallel = 0; - ItemStack tSmeltStack = tInputList.get(0); - ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); - if (tOutputStack == null) - return false; - for (int i = 0;i<tInputList.size();i++) - { - ItemStack item = tInputList.get(i); - if (tSmeltStack.isItemEqual(item)) - { - if (item.stackSize<(tMaxParrallel-tCurrenParrallel)) - { - tCurrenParrallel += item.stackSize; - item.stackSize = 0; - } - else - { - item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; - tCurrenParrallel = tMaxParrallel; - break; - } - } - } -// this.mOutputItems = new ItemStack[8 * this.mLevel]; -// for (int i = 0; (i < 256) && (j < this.mOutputItems.length); i++) { -// if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) { -// j++; -// } -// } - tCurrenParrallel *= tOutputStack.stackSize; - this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; - for (int i = 0; i<this.mOutputItems.length;i++) - { - ItemStack tNewStack = tOutputStack.copy(); - int size = tCurrenParrallel>64 ? 64 : tCurrenParrallel; - tNewStack.stackSize = size; - tCurrenParrallel -= size; - this.mOutputItems[i] = tNewStack; + if (tInputList.isEmpty()) + return false; + + int mVolatage = GT_Utility.safeInt(getMaxInputVoltage()); + int tMaxParrallel = 8 * this.mLevel; + int tCurrenParrallel = 0; + ItemStack tSmeltStack = tInputList.get(0); + ItemStack tOutputStack = GT_ModHandler.getSmeltingOutput(tSmeltStack,false,null); + if (tOutputStack == null) + return false; + for (ItemStack item : tInputList) + if (tSmeltStack.isItemEqual(item)) if (item.stackSize < (tMaxParrallel - tCurrenParrallel)) { + tCurrenParrallel += item.stackSize; + item.stackSize = 0; + } else { + item.stackSize = (tCurrenParrallel + item.stackSize) - tMaxParrallel; + tCurrenParrallel = tMaxParrallel; + break; } + tCurrenParrallel *= tOutputStack.stackSize; + this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; + for (int i = 0; i < this.mOutputItems.length; i++) { + ItemStack tNewStack = tOutputStack.copy(); + int size = Math.min(tCurrenParrallel, 64); + tNewStack.stackSize = size; + tCurrenParrallel -= size; + this.mOutputItems[i] = tNewStack; + } - if (this.mOutputItems != null && this.mOutputItems.length > 0) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(4, 512, 1, mVolatage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - - this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1); - if (mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - } - updateSlots(); - return true; + if (this.mOutputItems.length > 0) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(4, 512, 1, mVolatage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + + this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); } - return false; + updateSlots(); + return true; } private boolean checkMachineFunction(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -164,167 +155,102 @@ public class GT_MetaTileEntity_MultiFurnace this.mLevel = 0; this.mCostDiscount = 1; - if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { - return false; - } - addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11); + replaceDeprecatedCoils(aBaseMetaTileEntity); - byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir); - switch (tUsedMeta) { - case 0: - this.mLevel = 1; - this.mCostDiscount = 1; - break; - case 1: - this.mLevel = 2; - this.mCostDiscount = 1; - break; - case 2: - this.mLevel = 4; - this.mCostDiscount = 1; - break; - case 3: - this.mLevel = 8; - this.mCostDiscount = 1; - break; - case 4: - this.mLevel = 16; - this.mCostDiscount = 2; - break; - case 5: - this.mLevel = 16; - this.mCostDiscount = 4; - break; - case 6: - this.mLevel = 16; - this.mCostDiscount = 8; - break; - case 7: - this.mLevel = 16; - this.mCostDiscount = 16; - break; - case 8: - this.mLevel = 16; - this.mCostDiscount = 24; - break; - default: - return false; - } - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if ((i != 0) || (j != 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings5) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { - return false; - } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) { - return false; - } - } - } - } - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - if ((xDir + i != 0) || (zDir + j != 0)) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); - if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) { - return false; - } - } - } - } - } + HeatingCoilLevel heatingCap = getInitialHeatLevel(aBaseMetaTileEntity, xDir, zDir); + if (heatingCap == null) + return false; + + if (!checkStructure(heatingCap, xDir, zDir, aBaseMetaTileEntity)) + return false; + + this.mLevel = heatingCap.getLevel(); + this.mCostDiscount = heatingCap.getCostDiscount(); return true; } - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){ - boolean result= this.checkMachineFunction(aBaseMetaTileEntity,aStack); - if (!result) this.mLevel=0; - return result; - } - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } + @Override + protected boolean checkCoils(HeatingCoilLevel heatingCap, int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity) { + if ((i == 0) && (j == 0)) + return aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir); + + Block coilM = aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j); + if (!(coilM instanceof IHeatingCoil)) + return false; + byte usedMetaM = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j); + + IHeatingCoil heatingCoilM = (IHeatingCoil) coilM; + HeatingCoilLevel heatingLevelM = heatingCoilM.getCoilHeat(usedMetaM); - public int getPollutionPerTick(ItemStack aStack) { - return 20; + return heatingLevelM == heatingCap; } - public int getDamageToComponent(ItemStack aStack) { - return 0; + @Override + protected boolean checkTopLayer(int i, int j, int xDir, int zDir, IGregTechTileEntity aBaseMetaTileEntity) { + if ((i == 0) && (j == 0)) { + return addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), CASING_INDEX); + } + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) + return false; + return aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) == CASING_INDEX; } - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){ + return this.checkMachineFunction(aBaseMetaTileEntity,aStack); } private void replaceDeprecatedCoils(IGregTechTileEntity aBaseMetaTileEntity) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int tX = aBaseMetaTileEntity.getXCoord() + xDir; - int tY = (int) aBaseMetaTileEntity.getYCoord(); + int tY = aBaseMetaTileEntity.getYCoord(); int tZ = aBaseMetaTileEntity.getZCoord() + zDir; int tUsedMeta; - for (int xPos = tX - 1; xPos <= tX + 1; xPos++) { + for (int xPos = tX - 1; xPos <= tX + 1; xPos++) for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { - if ((xPos == tX) && (zPos == tZ)) { - continue; - } + if ((xPos == tX) && (zPos == tZ)) continue; tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, tY + 1, zPos); - if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) { + if (tUsedMeta >= 12 && tUsedMeta <= 14 && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) aBaseMetaTileEntity.getWorld().setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); - } } - } } @Override public String[] getInfoData() { int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } - } + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) + if (isValidMetaTileEntity(tHatch)) + mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction); long storedEnergy=0; long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } - } return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress")+": "+ - EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", - StatCollector.translateToLocal("GT5U.multiblock.energy")+": "+ - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.multiblock.usage")+": "+ - EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei")+": "+ - EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+" EU/t(*2A) "+StatCollector.translateToLocal("GT5U.machines.tier")+": "+ - EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.MS.multismelting")+": "+ - EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: (EU/t) / "+EnumChatFormatting.GREEN+mCostDiscount+EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.MS.multismelting") + ": " + + EnumChatFormatting.GREEN + mLevel * 8 + EnumChatFormatting.RESET + " Discount: (EU/t) / " + EnumChatFormatting.GREEN + mCostDiscount + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %" }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index e4ad65e4a4..0a0088246b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -1,32 +1,44 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IHeatingCoil; 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_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.mutable.MutableInt; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; +import java.util.BitSet; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase { private ForgeDirection orientation; private int controllerX, controllerZ; + private static final byte CASING_INDEX = 49; + private HeatingCoilLevel heatLevel; + public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -35,40 +47,45 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa super(aName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cracker") - .addInfo("Controller block for the Oil Cracking Unit") - .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") - .addInfo("More efficient than the Chemical Reactor") - .addInfo("Place the appropriate circuit in the controller") - .addSeparator() - .beginStructureBlock(5, 3, 3, true) - .addController("Front center") - .addCasingInfo("Clean Stainless Steel Machine Casing", 18) - .addOtherStructurePart("2 Rings of 8 Cupronickel Coils", "Each side of the controller") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Steam/Hydrogen, Any middle ring casing") - .addInputHatch("Any left/right side casing") - .addOutputHatch("Any left/right side casing") - .addStructureInfo("Input/Output Hatches must be on opposite sides!") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Cracker") + .addInfo("Controller block for the Oil Cracking Unit") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Place the appropriate circuit in the controller") + .addSeparator() + .beginStructureBlock(5, 3, 3, true) + .addController("Front center") + .addCasingInfo("Clean Stainless Steel Machine Casing", 18) + .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") + .addInfo("Gets 5% energy cost reduction per coil tier") + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputHatch("Steam/Hydrogen, Any middle ring casing") + .addInputHatch("Any left/right side casing") + .addOutputHatch("Any left/right side casing") + .addStructureInfo("Input/Output Hatches must be on opposite sides!") + .toolTipFinisher("Gregtech"); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return tt.getInformation(); + return tt.getStructureInformation(); } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER)}; + if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_OIL_CRACKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{casingTexturePages[0][CASING_INDEX], + TextureFactory.of(OVERLAY_FRONT_OIL_CRACKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).glow().build()}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49]}; + return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); } @@ -76,13 +93,22 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<FluidStack> tInputList = getStoredFluids(); - FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[tInputList.size()]); + FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[0]); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe( - getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs ,new ItemStack[]{mInventory[1]}); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, new ItemStack[]{mInventory[1]})) { + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluidInputs , + mInventory[1] + ); + + if (tRecipe == null) + return false; + + if (tRecipe.isRecipeInputEqual(true, tFluidInputs, mInventory[1])) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.mEUt = tRecipe.mEUt; @@ -91,147 +117,153 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa this.mEUt *= 4; this.mMaxProgresstime /= 2; } - if (this.mEUt > 0) { + + this.mEUt *= Math.pow(0.95D, this.heatLevel.getTier()); + + if (this.mEUt > 0) this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; return true; } return false; } + private boolean coilsNotPresent(IGregTechTileEntity aBaseMetaTileEntity, int x , int y, int z) { + + Block coil = aBaseMetaTileEntity.getBlockOffset(x, y, z); + + if (!(coil instanceof IHeatingCoil)) + return true; + + IHeatingCoil heatingCoil = (IHeatingCoil) coil; + byte meta = aBaseMetaTileEntity.getMetaIDOffset(x, y, z); + HeatingCoilLevel heatLevel = heatingCoil.getCoilHeat(meta); + if (heatLevel == HeatingCoilLevel.None) + return true; + + if (this.heatLevel == HeatingCoilLevel.None) + this.heatLevel = heatLevel; + + return this.heatLevel != heatLevel; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + this.heatLevel = HeatingCoilLevel.None; this.orientation = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); this.controllerX = aBaseMetaTileEntity.getXCoord(); this.controllerZ = aBaseMetaTileEntity.getZCoord(); int xDir = this.orientation.offsetX; int zDir = this.orientation.offsetZ; - int amount = 0; + MutableInt amount = new MutableInt(0); replaceDeprecatedCoils(aBaseMetaTileEntity); - boolean negSideInput = false, negSideOutput = false, posSideInput = false, posSideOutput = false; - if (xDir != 0) { - for (int i = -1; i < 2; i++) {// xDirection - for (int j = -1; j < 2; j++) {// height - for (int h = -2; h < 3; h++) { - if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) { - if (h == 1 || h == -1) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings5) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 0) { - return false; - } - } - if (h == 2 || h == -2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir); - if (addInputToMachineList(tTileEntity, 49)) { - if (h == -2) { - negSideInput = true; - } else { - posSideInput = true; - } - } else if (addOutputToMachineList(tTileEntity, 49)) { - if (h == -2) { - negSideOutput = true; - } else { - posSideOutput = true; - } - } else if (!addEnergyInputToMachineList(tTileEntity, 49) && !addMaintenanceToMachineList(tTileEntity, 49)){ - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) { - return false; - } - amount++; - } - } - if (h == 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir); - if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) - && (!addEnergyInputToMachineList(tTileEntity, 49))) { - if (!((xDir + i) == 0 && j == 0 && (h + zDir) == 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) { - return false; - } - amount++; - } - } - } - - } - } - } - } - } else { - for (int i = -1; i < 2; i++) {// zDirection - for (int j = -1; j < 2; j++) {// height - for (int h = -2; h < 3; h++) { - if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) { - if (h == 1 || h == -1) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings5) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 0) { - return false; - } - } - if (h == 2 || h == -2) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir); - if (addInputToMachineList(tTileEntity, 49)) { - if (h == -2) { - negSideInput = true; - } else { - posSideInput = true; - } - } else if (addOutputToMachineList(tTileEntity, 49)) { - if (h == -2) { - negSideOutput = true; - } else { - posSideOutput = true; - } - } else if (!addEnergyInputToMachineList(tTileEntity, 49) && !addMaintenanceToMachineList(tTileEntity, 49)){ - if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) { - return false; - } - amount++; - } - } - if (h == 0) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir); - if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) - && (!addEnergyInputToMachineList(tTileEntity, 49))) { - if (!((xDir + h) == 0 && j == 0 && (i + zDir) == 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) { - return false; - } - amount++; - } - } - } - - } + BitSet flags = new BitSet(4); + + for (int depth = -1; depth < 2; depth++) + for (int height = -1; height < 2; height++) + for (int slice = -2; slice < 3; slice++) + if (xDir == 0) { + if (isStructureBroken(xDir, zDir, slice, height, depth, aBaseMetaTileEntity, amount, flags)) + return false; + } else { + if (isStructureBroken(xDir, zDir, depth, height, slice, aBaseMetaTileEntity, amount, flags)) + return false; } - } - } + + if(checkInputOutputBroken(flags)) + return false; + + return amount.intValue() >= 18; + } + + private boolean checkInputOutputBroken(BitSet flags){ + if (flags.get(0) && flags.get(2)) //input and output on side 1 + return true; + if (flags.get(1) && flags.get(3)) //input and output on side 2 + return true; + if (flags.get(1) && flags.get(2)) //input on both sides + return true; + return flags.get(2) && flags.get(3); //output on both sides + } + + private boolean isStructureBroken( + int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + MutableInt amount, + BitSet flags) { + if (b == 0 && c == 0 && (a == -1 || a == 0 || a == 1)) + return false; + if (a == 1 || a == -1) { + return coilsNotPresent(aBaseMetaTileEntity, xDir + a, b, c + zDir); } - if ((negSideInput && negSideOutput) || (posSideInput && posSideOutput) - || (negSideInput && posSideInput) || (negSideOutput && posSideOutput)) { - return false; + else if (a == 2 || a == -2) { + return checkEndsBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, amount, flags); } - if (amount < 18) return false; - return true; + else if (a == 0) + return checkMiddleBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, amount); + + return false; + } + + private boolean checkEndsBroken( + int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + MutableInt amount, + BitSet flags + ){ + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + c, b, a + zDir); + if (addInputToMachineList(tTileEntity, CASING_INDEX)) + if (a == -2) + flags.set(0); //input on side 1 + else + flags.set(1); //input on side 2 + else if (addOutputToMachineList(tTileEntity, CASING_INDEX)) + if (a == -2) + flags.set(2); //output on side 1 + else + flags.set(3); //output on side 2 + else if (!addEnergyInputToMachineList(tTileEntity, CASING_INDEX)) + if (!addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + c, b, a + zDir) != GregTech_API.sBlockCasings4) + return true; + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + c, b, a + zDir) != 1) + return true; + amount.increment(); + } + return false; + } + + private boolean checkMiddleBroken( int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + MutableInt amount){ + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + c, b, a + zDir); + if (addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) + return false; + if (addInputToMachineList(tTileEntity, CASING_INDEX)) + return false; + if (addEnergyInputToMachineList(tTileEntity, CASING_INDEX)) + return false; + if ((xDir + c) == 0 && b == 0 && (a + zDir) == 0) + return false; + if (aBaseMetaTileEntity.getBlockOffset(xDir + c, b, a + zDir) != GregTech_API.sBlockCasings4) + return true; + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + c, b, a + zDir) != 1) + return true; + amount.increment(); + return false; } @Override @@ -259,6 +291,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa return false; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_OilCracker(this.mName); } @@ -267,50 +300,52 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int tX = aBaseMetaTileEntity.getXCoord() + xDir; - int tY = (int) aBaseMetaTileEntity.getYCoord(); + int tY = aBaseMetaTileEntity.getYCoord(); int tZ = aBaseMetaTileEntity.getZCoord() + zDir; - for (int xPos = tX - 1; xPos <= tX + 1; xPos += (xDir != 0 ? 1 : 2)) { - for (int yPos = tY - 1; yPos <= tY + 1; yPos++) { + for (int xPos = tX - 1; xPos <= tX + 1; xPos += (xDir != 0 ? 1 : 2)) + for (int yPos = tY - 1; yPos <= tY + 1; yPos++) for (int zPos = tZ - 1; zPos <= tZ + 1; zPos += (xDir != 0 ? 2 : 1)) { - if ((yPos == tY) && (xPos == tX || zPos == tZ)) { + if ((yPos == tY) && (xPos == tX || zPos == tZ)) continue; - } - if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) == GregTech_API.sBlockCasings1 && - aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos) == 12) - { - aBaseMetaTileEntity.getWorld().setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, 0, 3); - } + byte tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos); + if (tUsedMeta < 12) + continue; + if (tUsedMeta > 14) + continue; + if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) + continue; + + aBaseMetaTileEntity.getWorld().setBlock( + xPos, + yPos, + zPos, + GregTech_API.sBlockCasings5, + tUsedMeta - 12, + 3 + ); } - } - } } @Override public ArrayList<FluidStack> getStoredFluids() { - ArrayList<FluidStack> rList = new ArrayList<FluidStack>(); + ArrayList<FluidStack> rList = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { FluidStack tStack = tHatch.getFillableStack(); if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) { - if (isHatchInMiddleRing(tHatch)) { - rList.add(tStack); - } - } else { - if (!isHatchInMiddleRing(tHatch)) { + if (isHatchInMiddleRing(tHatch)) rList.add(tStack); - } - } + } else if (!isHatchInMiddleRing(tHatch)) + rList.add(tStack); } } return rList; } private boolean isHatchInMiddleRing(GT_MetaTileEntity_Hatch_Input inputHatch){ - if (orientation == ForgeDirection.NORTH || orientation == ForgeDirection.SOUTH) { + if (orientation == ForgeDirection.NORTH || orientation == ForgeDirection.SOUTH) return inputHatch.getBaseMetaTileEntity().getXCoord() == this.controllerX; - } else { - return inputHatch.getBaseMetaTileEntity().getZCoord() == this.controllerZ; - } + return inputHatch.getBaseMetaTileEntity().getZCoord() == this.controllerZ; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java index 750978a3c3..73d8131fed 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java @@ -48,4 +48,4 @@ public class GT_MetaTileEntity_OilDrill1 extends GT_MetaTileEntity_OilDrillBase protected int getMinTier() { return 2; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java index d0b366b995..9d36b340d3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java @@ -48,4 +48,4 @@ public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase protected int getMinTier() { return 3; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java index 3ebb67f5b7..8ebc658406 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java @@ -48,4 +48,4 @@ public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase protected int getMinTier() { return 4; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java index a7a7023d34..44fb734534 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java @@ -1,7 +1,10 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ChunkManager; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; @@ -9,26 +12,29 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; - import static gregtech.api.enums.GT_Values.VN; import static gregtech.api.enums.GT_Values.debugDriller; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_DRILL_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId; import static gregtech.common.GT_UndergroundOil.undergroundOil; import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_DrillerBase { - - private boolean completedCycle = false; - - private ArrayList<Chunk> mOilFieldChunks = new ArrayList<Chunk>(); + private final ArrayList<Chunk> mOilFieldChunks = new ArrayList<>(); private int mOilId = 0; private int chunkRangeConfig = getRangeInChunks(); @@ -42,6 +48,21 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D } @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) return new ITexture[]{ + getCasingTextureForId(casingTextureIndex), + TextureFactory.of(OVERLAY_FRONT_OIL_DRILL_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + getCasingTextureForId(casingTextureIndex), + TextureFactory.of(OVERLAY_FRONT_OIL_DRILL), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW).glow().build()}; + } + return new ITexture[]{getCasingTextureForId(casingTextureIndex)}; + } + + @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("mOilId", mOilId); @@ -58,30 +79,30 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D protected String[] getDescriptionInternal(String tierSuffix) { String casings = getCasingBlockItem().get(0).getDisplayName(); - + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Pump") - .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) - .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") - .addInfo("Use a Screwdriver to configure range") - .addInfo("Use Programmed Circuits to ignore near exhausted oil field") - .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.")//doesn't work - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addStructureInfo(casings + " form the 3x1x3 Base") - .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes or Circuits, optional, any base casing") - .addOutputHatch("Any base casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + tt.addMachineType("Pump") + .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") + .addInfo("Use a Screwdriver to configure range") + .addInfo("Use Programmed Circuits to ignore near exhausted oil field") + .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.")//doesn't work + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addStructureInfo(casings + " form the 3x1x3 Base") + .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") + .addMaintenanceHatch("Any base casing") + .addInputBus("Mining Pipes or Circuits, optional, any base casing") + .addOutputHatch("Any base casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } @@ -95,6 +116,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + int oldChunkRange = chunkRangeConfig; if (aPlayer.isSneaking()) { if (chunkRangeConfig > 0) { chunkRangeConfig--; @@ -108,6 +130,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D if (chunkRangeConfig > getRangeInChunks()) chunkRangeConfig = 1; } + if (oldChunkRange != chunkRangeConfig) mOilFieldChunks.clear(); GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + chunkRangeConfig + "x" + chunkRangeConfig + StatCollector.translateToLocal("GT5U.machines.chunks"));//TODO Add translation support } @@ -137,6 +160,11 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D } if (reachingVoidOrBedrock() && tryFillChunkList()) { + if (mWorkChunkNeedsReload) { + mCurrentChunk = new ChunkCoordIntPair(xDrill >> 4, zDrill >> 4); + GT_ChunkManager.requestChunkLoad((TileEntity) getBaseMetaTileEntity(), null); + mWorkChunkNeedsReload = false; + } float speed = .5F+(GT_Utility.getTier(getMaxInputVoltage()) - getMinTier()) *.25F; FluidStack tFluid = pumpOil(speed); if (tFluid != null && tFluid.amount > getTotalConfigValue()){ @@ -144,6 +172,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D return true; } } + GT_ChunkManager.releaseTicket((TileEntity)getBaseMetaTileEntity()); workState = STATE_UPWARD; return true; } @@ -220,7 +249,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D ); } - ArrayList<Chunk> emptyChunks = new ArrayList<Chunk>(); + ArrayList<Chunk> emptyChunks = new ArrayList<>(); for (Chunk tChunk : mOilFieldChunks) { tFluid = undergroundOil(tChunk,speed); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java index f74748a364..d23ce2edd0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java @@ -55,4 +55,4 @@ public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDr protected int getBaseProgressTime() { return 960; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index e34ed7466f..224f1de557 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -4,7 +4,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.IChunkLoader; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ChunkManager; import gregtech.api.objects.ItemData; @@ -37,7 +36,7 @@ import org.lwjgl.input.Keyboard; import static gregtech.api.enums.GT_Values.VN; -public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_DrillerBase implements IChunkLoader { +public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_DrillerBase { private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>(); protected int mTier = 1; private int chunkRadiusConfig = getRadiusInChunks(); @@ -64,9 +63,6 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile } @Override - public ChunkCoordIntPair getActiveChunk(){return mCurrentChunk;} - - @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png"); } @@ -327,7 +323,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z); if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) oreBlockPositions.add(blockPos); - } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) + } else if (GT_Utility.isOre(block, blockMeta)) oreBlockPositions.add(blockPos); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java index eeeef95dc3..f1b304a1b1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -7,6 +7,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.GT_Pollution; import gregtech.common.gui.GT_Container_PrimitiveBlastFurnace; import gregtech.common.gui.GT_GUIContainer_PrimitiveBlastFurnace; @@ -18,6 +19,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; @@ -44,65 +46,81 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn super(aName, INPUT_SLOTS + OUTPUT_SLOTS); } + @Override public boolean isSteampowered() { return false; } + @Override public boolean isElectric() { return false; } + @Override public boolean isPneumatic() { return false; } + @Override public boolean isEnetInput() { return false; } + @Override public boolean isEnetOutput() { return false; } + @Override public boolean isInputFacing(byte aSide) { return false; } + @Override public boolean isOutputFacing(byte aSide) { return false; } + @Override public boolean isTeleporterCompatible() { return false; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } + @Override public int getProgresstime() { return this.mProgresstime; } + @Override public int maxProgresstime() { return this.mMaxProgresstime; } + @Override public int increaseProgress(int aProgress) { this.mProgresstime += aProgress; return this.mMaxProgresstime - this.mProgresstime; } + @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID)); } - public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); + @Override + public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); + @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setInteger("mProgresstime", this.mProgresstime); aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime); @@ -117,6 +135,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } } + @Override public void loadNBTData(NBTTagCompound aNBT) { this.mUpdate = 5; this.mProgresstime = aNBT.getInteger("mProgresstime"); @@ -127,6 +146,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } } + @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; @@ -135,11 +155,13 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn return true; } + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_Container_PrimitiveBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_PrimitiveBlastFurnace(aPlayerInventory, aBaseMetaTileEntity, getName(), GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.mNEIName); } @@ -170,16 +192,25 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn protected abstract boolean isCorrectCasingMetaID(int metaID); + @Override public void onMachineBlockUpdate() { this.mUpdate = 5; } + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { - aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + XSTR_INSTANCE.nextFloat(), - aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + XSTR_INSTANCE.nextFloat(), 0.0D, 0.3D, 0.0D); + + new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setMotion(0D,0.3D,0D) + .setIdentifier("largesmoke") + .setPosition( + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + XSTR_INSTANCE.nextFloat(), + aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + XSTR_INSTANCE.nextFloat() + ) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate-- == 0) { @@ -300,21 +331,30 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn return true; } + @Override public boolean isGivingInformation() { return false; } + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aIndex > INPUT_SLOTS; } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]); } + @Override public byte getTileEntityBaseType() { return 0; } public abstract String getName(); + + @Override + public boolean isDisplaySecondaryDescription() { + return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 2496d02a42..684cead86c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -4,6 +4,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,7 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_ProcessingArray_Manager; import gregtech.api.util.GT_Recipe; @@ -34,6 +35,10 @@ import java.util.Collections; import java.util.List; import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_GLOW; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase { @@ -51,45 +56,56 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ProcessingArray(this.mName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Processing Array") - .addInfo("Runs supplied machines as if placed in the world") - .addInfo("Place up to 64 singleblock GT machines into the controller") - .addInfo("Note that tou still need to supply power to them all") - .addInfo("Use a screwdriver to enable separate input busses") - .addInfo("Maximal overclockedness of machines inside: Tier 9") - .addInfo("Doesn't work on certain machines, deal with it") - .addInfo("Use it if you hate GT++, or want even more speed later on") - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Robust Tungstensteel Machine Casing", 14) - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addInputHatch("Any casing") - .addOutputBus("Any casing") - .addOutputHatch("Any casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Processing Array") + .addInfo("Runs supplied machines as if placed in the world") + .addInfo("Place up to 64 singleblock GT machines into the controller") + .addInfo("Note that tou still need to supply power to them all") + .addInfo("Use a screwdriver to enable separate input busses") + .addInfo("Maximal overclockedness of machines inside: Tier 9") + .addInfo("Doesn't work on certain machines, deal with it") + .addInfo("Use it if you hate GT++, or want even more speed later on") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 14) + .addEnergyHatch("Any casing") + .addMaintenanceHatch("Any casing") + .addInputBus("Any casing") + .addInputHatch("Any casing") + .addOutputBus("Any casing") + .addOutputHatch("Any casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY)}; + if (aActive) return new ITexture[]{ + BlockIcons.casingTexturePages[0][48], + TextureFactory.of(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.casingTexturePages[0][48], + TextureFactory.of(OVERLAY_FRONT_PROCESSING_ARRAY), + TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][48]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ProcessingArray.png"); } @@ -117,28 +133,27 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } */ + @Override public GT_Recipe_Map getRecipeMap() { if (isCorrectMachinePart(mInventory[1])) { - GT_Recipe_Map aTemp = GT_ProcessingArray_Manager.getRecipeMapForMeta(mInventory[1].getItemDamage()); - if (aTemp != null) { - return aTemp; - } + return GT_ProcessingArray_Manager.getRecipeMapForMeta(mInventory[1].getItemDamage()); } return null; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { - if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) { - return true; - } - return false; + return aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine."); } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } private String mMachine = ""; + + @Override public boolean checkRecipe(ItemStack aStack) { if (!isCorrectMachinePart(mInventory[1])) { return false; @@ -146,174 +161,173 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl GT_Recipe.GT_Recipe_Map map = getRecipeMap(); if (map == null) return false; - if (mInventory[1].getUnlocalizedName().endsWith("10")) { - tTier = 9; - mMult = 2;//u need 4x less machines and they will use 4x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { - tTier = 9; - mMult = 4;//u need 16x less machines and they will use 16x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("12") || - mInventory[1].getUnlocalizedName().endsWith("13") || - mInventory[1].getUnlocalizedName().endsWith("14") || - mInventory[1].getUnlocalizedName().endsWith("15")) { - tTier = 9; - mMult = 6;//u need 64x less machines and they will use 64x less power - } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { - tTier = 1; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { - tTier = 2; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { - tTier = 3; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { - tTier = 4; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { - tTier = 5; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { - tTier = 6; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { - tTier = 7; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { - tTier = 8; - mMult = 0;//*1 - } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { - tTier = 9; - mMult = 0;//*1 - } else { - tTier = 0; - mMult = 0;//*1 + if (!mMachine.equals(mInventory[1].getUnlocalizedName())) { + mLastRecipe = null; + mMachine = mInventory[1].getUnlocalizedName(); } - if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; - mMachine = mInventory[1].getUnlocalizedName(); + int machineTier = 0; + + if (mLastRecipe == null) { + try { + int length = mMachine.length(); + + machineTier = Integer.parseInt(mMachine.substring(length - 2)); + + } catch (NumberFormatException ignored) { + /* do nothing */ + } + + switch (machineTier) { + default: + tTier = 0; + mMult = 0;//*1 + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + tTier = machineTier; + mMult = 0;//*1 + break; + case 10: + tTier = 9; + mMult = 2;//u need 4x less machines and they will use 4x less power + break; + case 11: + tTier = 9; + mMult = 4;//u need 16x less machines and they will use 16x less power + break; + case 12: + case 13: + case 14: + case 15: + tTier = 9; + mMult = 6;//u need 64x less machines and they will use 64x less power + break; + } + } ArrayList<FluidStack> tFluidList = getStoredFluids(); - FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (mSeparate) { - ArrayList<ItemStack> tInputList = new ArrayList<ItemStack>(); - for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { - IGregTechTileEntity tInpuBus = tHatch.getBaseMetaTileEntity(); - for (int i = tInpuBus.getSizeInventory() - 1; i >= 0; i--) { - if (tInpuBus.getStackInSlot(i) != null) - tInputList.add(tInpuBus.getStackInSlot(i)); - } - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); - if (processRecipe(tInputs, tFluids, map)) - return true; - else - tInputList.clear(); - } + ArrayList<ItemStack> tInputList = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { + IGregTechTileEntity tInputBus = tHatch.getBaseMetaTileEntity(); + for (int i = tInputBus.getSizeInventory() - 1; i >= 0; i--) { + if (tInputBus.getStackInSlot(i) != null) + tInputList.add(tInputBus.getStackInSlot(i)); + } + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); + if (processRecipe(tInputs, tFluids, map)) + return true; + else + tInputList.clear(); + } } else { - ArrayList<ItemStack> tInputList = getStoredInputs(); - ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + ArrayList<ItemStack> tInputList = getStoredInputs(); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); return processRecipe(tInputs, tFluids, map); } return false; } public boolean processRecipe(ItemStack[] tInputs, FluidStack[] tFluids, GT_Recipe.GT_Recipe_Map map) { - if (tInputs.length > 0 || tFluids.length > 0) { - GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe != null) { - if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) - return false; + if (tInputs.length <= 0 && tFluids.length <= 0) return false; + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe == null) return false; + if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && + !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + return false; - mLastRecipe = tRecipe; - this.mEUt = 0; - this.mOutputItems = null; - this.mOutputFluids = null; - int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 - int i = 0; - for (; i < machines; i++) { - if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - if (i == 0) { - return false; - } - break; - } - } - this.mMaxProgresstime = tRecipe.mDuration; - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier]); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); - if (mEUt == Integer.MAX_VALUE - 1) + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 + int i = 0; + for (; i < machines; i++) { + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (i == 0) { return false; - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOut[h] = tRecipe.getOutput(h).copy(); - tOut[h].stackSize = 0; - } - } - FluidStack tFOut = null; - if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); - for (int f = 0; f < tOut.length; f++) { - if (tRecipe.mOutputs[f] != null && tOut[f] != null) { - for (int g = 0; g < i; g++) { - if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) - tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; - } - } } - if (tFOut != null) { - int tSize = tFOut.amount; - tFOut.amount = tSize * i; - } - tOut = clean(tOut); - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List<ItemStack> overStacks = new ArrayList<ItemStack>(); - for (int f = 0; f < tOut.length; f++) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if (tOut[f] != null) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } - } - } - if (overStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[overStacks.size()]; - tmp = overStacks.toArray(tmp); - tOut = ArrayUtils.addAll(tOut, tmp); - } - List<ItemStack> tSList = new ArrayList<ItemStack>(); - for (ItemStack tS : tOut) { - if (tS.stackSize > 0) tSList.add(tS); + break; + } + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier]); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } + } + FluidStack tFOut = null; + if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); + for (int f = 0; f < tOut.length; f++) { + if (tRecipe.mOutputs[f] != null && tOut[f] != null) { + for (int g = 0; g < i; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; } - tOut = tSList.toArray(new ItemStack[tSList.size()]); - this.mOutputItems = tOut; - this.mOutputFluids = new FluidStack[]{tFOut}; - updateSlots(); - return true; - }/* else{ - ...remoteRecipeCheck() - }*/ + } + } + if (tFOut != null) { + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + tOut = clean(tOut); + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List<ItemStack> overStacks = new ArrayList<>(); + for (ItemStack itemStack : tOut) { + while (itemStack != null && itemStack.getMaxStackSize() < itemStack.stackSize) { + ItemStack tmp = itemStack.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); + overStacks.add(tmp); + } } - return false; + if (!overStacks.isEmpty()) { + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List<ItemStack> tSList = new ArrayList<>(); + for (ItemStack tS : tOut) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[0]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + return true; } public static ItemStack[] clean(final ItemStack[] v) { - List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v)); + List<ItemStack> list = new ArrayList<>(Arrays.asList(v)); list.removeAll(Collections.singleton(null)); - return list.toArray(new ItemStack[list.size()]); + return list.toArray(new ItemStack[0]); } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -344,34 +358,38 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl @Override public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("mSeparate", mSeparate); + super.saveNBTData(aNBT); + aNBT.setBoolean("mSeparate", mSeparate); } @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - mSeparate = aNBT.getBoolean("mSeparate"); + public void loadNBTData(final NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mSeparate = aNBT.getBoolean("mSeparate"); } @Override - public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - mSeparate = !mSeparate; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") +" "+mSeparate); + public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mSeparate = !mSeparate; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate); } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } @@ -389,26 +407,26 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress")+": "+ - EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", - StatCollector.translateToLocal("GT5U.multiblock.energy")+": "+ - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.multiblock.usage")+": "+ - EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei")+": "+ - EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GT5U.machines.tier")+": "+ - EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.PA.machinetier")+": "+ - EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GT5U.PA.discount")+": "+ - EnumChatFormatting.GREEN+(1<<mMult)+EnumChatFormatting.RESET + " x", - StatCollector.translateToLocal("GT5U.PA.parallel")+": "+EnumChatFormatting.GREEN+((mInventory[1] != null) ? (mInventory[1].stackSize<<mMult) : 0)+EnumChatFormatting.RESET + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + -mEUt + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + + EnumChatFormatting.YELLOW + VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.PA.machinetier") + ": " + + EnumChatFormatting.GREEN + tTier + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.PA.discount") + ": " + + EnumChatFormatting.GREEN + (1 << mMult) + EnumChatFormatting.RESET + " x", + StatCollector.translateToLocal("GT5U.PA.parallel") + ": " + EnumChatFormatting.GREEN + ((mInventory[1] != null) ? (mInventory[1].stackSize << mMult) : 0) + EnumChatFormatting.RESET }; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index c2e13a815f..701a81b6ba 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -3,13 +3,16 @@ package gregtech.common.tileentities.machines.multi; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; +import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IHeatingCoil; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -20,17 +23,19 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; - -import java.util.ArrayList; -import java.util.Arrays; - +import org.apache.commons.lang3.mutable.MutableBoolean; import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW; + public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase { - - private int coilMetaID; - //public static GT_CopiedBlockTexture mTextureULV = new GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0, Dyes.MACHINE_METAL.mRGBa); - private final int CASING_INDEX = 1090; + + private HeatingCoilLevel coilHeat; + //public static GT_CopiedBlockTexture mTextureULV = new GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0, Dyes.MACHINE_METAL.mRGBa); + private static final int CASING_INDEX = 1090; public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -40,181 +45,149 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock super(aName); } + @Override public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Coke Oven") - .addInfo("Controller block for the Pyrolyse Oven") - .addInfo("Industrial Charcoal producer") - .addInfo("Processing speed scales linearly with Coil tier:") - .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.") - .addInfo("EU/t is not affected by Coil tier") - .addPollutionAmount(20 * getPollutionPerTick(null)) - .addSeparator() - .beginStructureBlock(5, 4, 5, true) - .addController("Front center") - .addCasingInfo("Pyrolyse Oven Casing", 60) - .addOtherStructurePart("Heating Coils (any tier)", "Center 3x1x3 of the bottom layer") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Center 3x1x3 area in top layer") - .addInputBus("Center 3x1x3 area in top layer") - .addInputHatch("Center 3x1x3 area in top layer") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("Any bottom layer casing") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Coke Oven") + .addInfo("Controller block for the Pyrolyse Oven") + .addInfo("Industrial Charcoal producer") + .addInfo("Processing speed scales linearly with Coil tier:") + .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.") + .addInfo("EU/t is not affected by Coil tier") + .addPollutionAmount(20 * getPollutionPerTick(null)) + .addSeparator() + .beginStructureBlock(5, 4, 5, true) + .addController("Front center") + .addCasingInfo("Pyrolyse Oven Casing", 60) + .addOtherStructurePart("Heating Coils", "Center 3x1x3 of the bottom layer") + .addEnergyHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .addMufflerHatch("Center 3x1x3 area in top layer") + .addInputBus("Center 3x1x3 area in top layer") + .addInputHatch("Center 3x1x3 area in top layer") + .addOutputBus("Any bottom layer casing") + .addOutputHatch("Any bottom layer casing") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN)}; + if (aActive) + return new ITexture[]{ + BlockIcons.casingTexturePages[8][66], + TextureFactory.of(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).glow().build()}; + return new ITexture[]{ + BlockIcons.casingTexturePages[8][66], + TextureFactory.of(OVERLAY_FRONT_PYROLYSE_OVEN), + TextureFactory.builder().addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).glow().build()}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "PyrolyseOven.png"); } @Override public boolean checkRecipe(ItemStack aStack) { - ArrayList<ItemStack> tInputList = getStoredInputs(); - int tInputList_sS=tInputList.size(); - for (int i = 0; i < tInputList_sS - 1; i++) { - for (int j = i + 1; j < tInputList_sS; j++) { - if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { - if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { - tInputList.remove(j--); tInputList_sS=tInputList.size(); - } else { - tInputList.remove(i--); tInputList_sS=tInputList.size(); - break; - } - } - } - } - ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); - - ArrayList<FluidStack> tFluidList = getStoredFluids(); - int tFluidList_sS=tFluidList.size(); - for (int i = 0; i < tFluidList_sS - 1; i++) { - for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { - if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { - tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); - } else { - tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); - break; - } - } - } - } - FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); - if (tInputList.size() > 0) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - - //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably - if(tRecipe==null){ - for(ItemStack is:tInputs) { - for (int id : OreDictionary.getOreIDs(is)) { - if (OreDictionary.getOreName(id).equals("logWood")) - ProcessingLog.addPyrolyeOvenRecipes(is); - } - } - tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - } + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = getCompactedFluids(); + + if (tInputs.length <= 0) + return false; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; + //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably + if (tRecipe == null) + tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) + return false; + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) + this.mEUt = (-this.mEUt); + this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilHeat.getTier()), 1); + if (tRecipe.mOutputs.length > 0) + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + if (tRecipe.mFluidOutputs.length > 0) + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + updateSlots(); + return true; + } + + private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { + if (tInputs.length > 1 || (tInputs[0] != null && tInputs[0].getItem() != GT_Utility.getIntegratedCircuit(0).getItem())) { + int oreId = OreDictionary.getOreID("logWood"); + for (ItemStack is : tInputs) { + for (int id : OreDictionary.getOreIDs(is)) { + if (oreId == id) { + ProcessingLog.addPyrolyeOvenRecipes(is); + return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + } } - this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilMetaID), 1); - if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - if (tRecipe.mFluidOutputs.length > 0) - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; } } - return false; + return null; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + Block casingBlock; + int casingMeta; - Block CasingBlock= Loader.isModLoaded("dreamcraft")? GameRegistry.findBlock("dreamcraft","gt.blockcasingsNH"): GregTech_API.sBlockCasings1; - int CasingMeta= Loader.isModLoaded("dreamcraft")?2:0; + if (Loader.isModLoaded("dreamcraft")) { + casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); + casingMeta = 2; + } else { + casingBlock = GregTech_API.sBlockCasings1; + casingMeta = 0; + } replaceDeprecatedCoils(aBaseMetaTileEntity); - boolean firstCoil = true; + MutableBoolean firstCoil = new MutableBoolean(true); for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int h = 0; h < 4; h++) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// inner 3x3 without height - if (h == 0) {// inner floor (Cupronickel or Kanthal coils) - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings5) { - return false; - } - int metaID = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - if (metaID > 8) { - return false; - } else { - if (firstCoil) { - this.coilMetaID = metaID; - firstCoil = false; - } else if (metaID != this.coilMetaID) { - return false; - } - } - } else if (h == 3) {// inner ceiling (ulv casings + input + muffler) - if ((!addInputToMachineList(tTileEntity, CASING_INDEX)) && (!addMufflerToMachineList(tTileEntity, CASING_INDEX))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { - return false; - } - } - } else {// inside air - if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) { - return false; - } - } + if (checkInnerBroken( + xDir, zDir, + i, h, j, + aBaseMetaTileEntity, tTileEntity, + casingBlock, casingMeta, + firstCoil + ) + ) + return false; } else {// outer 5x5 without height - if (h == 0) {// outer floor (controller, output, energy, maintainance, rest ulv casings) - if ((!addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) && (!addOutputToMachineList(tTileEntity, CASING_INDEX)) && (!addEnergyInputToMachineList(tTileEntity, CASING_INDEX))) { - if ((xDir + i != 0) || (zDir + j != 0)) {//no controller - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { - return false; - } - } - } - } else {// outer above floor (ulv casings) - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { - return false; - } - } + if (checkOuterBroken( + xDir, zDir, + i, h, j, + aBaseMetaTileEntity, tTileEntity, + casingBlock, casingMeta + ) + ) + return false; } } } @@ -222,6 +195,112 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return true; } + private boolean checkInnerBroken(int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + IGregTechTileEntity tTileEntity, + Block casingBlock, + int casingMeta, + MutableBoolean firstCoil + ) { + if (b == 0) {// inner floor (Coils) + return areCoilsBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, firstCoil); + } else if (b == 3) {// inner ceiling (ulv casings + input + muffler) + return checkInnerCeilingBroken(xDir, zDir, a, b, c, aBaseMetaTileEntity, tTileEntity, casingBlock, casingMeta); + } else {// inside air + return !aBaseMetaTileEntity.getAirOffset(xDir + a, b, zDir + c); + } + } + + private boolean checkOuterBroken(int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + IGregTechTileEntity tTileEntity, + Block casingBlock, + int casingMeta) { + if (b == 0) {// outer floor (controller, output, energy, maintainance, rest ulv casings) + if (checkOuterFloorLoopControl(xDir, zDir, a, c, tTileEntity)) + return false; + } + // outer above floor (ulv casings) + if (aBaseMetaTileEntity.getBlockOffset(xDir + a, b, zDir + c) != casingBlock) { + return true; + } + return aBaseMetaTileEntity.getMetaIDOffset(xDir + a, b, zDir + c) != casingMeta; + } + + private boolean checkOuterFloorLoopControl(int xDir, + int zDir, + int a, + int c, + IGregTechTileEntity tTileEntity + ) { + if (addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) { + return true; + } + if (addOutputToMachineList(tTileEntity, CASING_INDEX)) { + return true; + } + + if (addEnergyInputToMachineList(tTileEntity, CASING_INDEX)) { + return true; + } + + return (xDir + a == 0) && (zDir + c == 0); + } + + private boolean checkInnerCeilingBroken(int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + IGregTechTileEntity tTileEntity, + Block casingBlock, + int casingMeta) { + if ((addInputToMachineList(tTileEntity, CASING_INDEX)) || (addMufflerToMachineList(tTileEntity, CASING_INDEX))) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir + a, b, zDir + c) != casingBlock) { + return true; + } + return aBaseMetaTileEntity.getMetaIDOffset(xDir + a, b, zDir + c) != casingMeta; + } + + private boolean areCoilsBroken(int xDir, + int zDir, + int a, + int b, + int c, + IGregTechTileEntity aBaseMetaTileEntity, + MutableBoolean firstCoil + ) { + Block coil = aBaseMetaTileEntity.getBlockOffset(xDir + a, b, zDir + c); + + if (!(coil instanceof IHeatingCoil)) + return true; + + int metaID = aBaseMetaTileEntity.getMetaIDOffset(xDir + a, b, zDir + c); + + HeatingCoilLevel coilHeat = ((IHeatingCoil) coil).getCoilHeat(metaID); + + if (coilHeat == HeatingCoilLevel.None) { + return true; + } else { + if (firstCoil.isTrue()) { + this.coilHeat = coilHeat; + firstCoil.setFalse(); + } else return coilHeat != this.coilHeat; + } + return false; + } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; @@ -247,6 +326,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return false; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_PyrolyseOven(this.mName); } @@ -255,13 +335,12 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int tX = aBaseMetaTileEntity.getXCoord() + xDir * 2; - int tY = (int) aBaseMetaTileEntity.getYCoord(); + int tY = aBaseMetaTileEntity.getYCoord(); int tZ = aBaseMetaTileEntity.getZCoord() + zDir * 2; for (int xPos = tX - 1; xPos <= tX + 1; xPos++) { for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { if (aBaseMetaTileEntity.getBlock(xPos, tY, zPos) == GregTech_API.sBlockCasings1 && - aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) - { + aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) { aBaseMetaTileEntity.getWorld().setBlock(xPos, tY, zPos, GregTech_API.sBlockCasings5, 1, 3); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index bf4b1e9db7..c800592d0d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -1,26 +1,29 @@ package gregtech.common.tileentities.machines.multi; 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_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; -public class GT_MetaTileEntity_VacuumFreezer - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -29,10 +32,12 @@ public class GT_MetaTileEntity_VacuumFreezer super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_VacuumFreezer(this.mName); } + @Override public String[] getDescription() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Vacuum Freezer") @@ -54,38 +59,57 @@ public class GT_MetaTileEntity_VacuumFreezer } } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + ITexture[] rTexture; if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; + if (aActive) { + rTexture = new ITexture[]{ + casingTexturePages[0][17], + TextureFactory.of(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).glow().build()}; + } else { + rTexture = new ITexture[]{ + casingTexturePages[0][17], + TextureFactory.of(OVERLAY_FRONT_VACUUM_FREEZER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).glow().build()}; + } + } else { + rTexture = new ITexture[]{casingTexturePages[0][17]}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][17]}; + return rTexture; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); for (ItemStack tInput : tInputList) { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, tInput); if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) { + if (tRecipe.isRecipeInputEqual(true, null, tInput)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -106,6 +130,7 @@ public class GT_MetaTileEntity_VacuumFreezer return false; } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -134,18 +159,22 @@ public class GT_MetaTileEntity_VacuumFreezer return tAmount >= 16; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java index 4cf20fdf16..533917661b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true); @@ -25,65 +26,102 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_Bas super(aName, aDescription, aTextures, 2, 1, true); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_AlloySmelter_Bronze(this.mName, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_AlloySmelter_Bronze(mName, mDescriptionArray, mTextures); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { - this.mOutputItems[0] = tRecipe.getOutput(0); - this.mEUt = tRecipe.mEUt; - this.mMaxProgresstime = (tRecipe.mDuration * 2); + mOutputItems[0] = tRecipe.getOutput(0); + mEUt = tRecipe.mEUt; + mMaxProgresstime = (tRecipe.mDuration * 2); return 2; } return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(208), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java index 94b4cfac33..2291ae1aba 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true); @@ -25,65 +26,102 @@ public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_Basi super(aName, aDescription, aTextures, 2, 1, true); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_AlloySmelter_Steel(this.mName, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_AlloySmelter_Steel(mName, mDescriptionArray, mTextures); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { - this.mOutputItems[0] = tRecipe.getOutput(0); - this.mEUt = (tRecipe.mEUt * 2); - this.mMaxProgresstime = tRecipe.mDuration; + mOutputItems[0] = tRecipe.getOutput(0); + mEUt = (tRecipe.mEUt * 2); + mMaxProgresstime = tRecipe.mDuration; return 2; } return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(208), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java index 5013893cbe..ddfe476d15 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(203), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java index 4a3a1e73ee..153f84f74b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(203), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java index 2d36cf0e98..5c60d071bc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(200), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java index e2d762f566..da4753b78e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(200), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java index cc99d43c0d..e46a5a74a8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi super(aName, aDescription, aTextures, 1, 1, false); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ForgeHammer_Bronze(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(1), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java index fbd256c86b..4508c39fda 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -1,17 +1,18 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false); @@ -25,14 +26,17 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic super(aName, aDescription, aTextures, 1, 1, false); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ForgeHammer_Steel(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3); } + @Override public int checkRecipe() { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { @@ -44,46 +48,80 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic return 0; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(1), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java index 3018b3c9c7..4e704fac12 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -1,18 +1,19 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true); @@ -26,14 +27,17 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac super(aName, aDescription, aTextures, 1, 1, true); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting"); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Furnace_Bronze(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) { this.mEUt = 4; @@ -43,53 +47,86 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac return 0; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - return false; - } - return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null; + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(207), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW).glow().build())}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java index 326e648213..eab07f2173 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -1,18 +1,19 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import static gregtech.api.enums.Textures.BlockIcons.*; + public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true); @@ -26,14 +27,17 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach super(aName, aDescription, aTextures, 1, 1, true); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting"); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Furnace_Steel(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public int checkRecipe() { if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) { this.mEUt = 8; @@ -43,53 +47,85 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach return 0; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - return false; - } - return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null; + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(207), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java index 7b60e70ad1..918d40443c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -1,16 +1,16 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -18,6 +18,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.Random; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) { @@ -32,25 +33,37 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { - Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D); + Random tRandom = getBaseMetaTileEntity().getWorld().rand; + new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setMotion(0.0D, 0.0D, 0.0D) + .setIdentifier("smoke") + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F + ) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } + @Override public int checkRecipe() { GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) return DID_NOT_FIND_RECIPE; GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; @@ -58,9 +71,7 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - -// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) -// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); @@ -69,53 +80,85 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - return false; - } - return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack})); + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(201), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)}; + return new ITexture[]{ + super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)}; + return new ITexture[]{ + super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)}; + return new ITexture[]{ + super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java index 5085f2d66b..a857919cbc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -1,16 +1,16 @@ package gregtech.common.tileentities.machines.steam; import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -18,6 +18,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.Random; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMachine_Steel { public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) { @@ -32,25 +33,37 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa super(aName, aDescription, aTextures, 1, 1, false); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescriptionArray, this.mTextures); } + @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { - Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D); + Random tRandom = getBaseMetaTileEntity().getWorld().rand; + new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setMotion(0D, 0.0D, 0D) + .setIdentifier("smoke") + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F + ) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } + @Override public int checkRecipe() { GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) return DID_NOT_FIND_RECIPE; GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; @@ -58,9 +71,7 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - -// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) -// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); @@ -69,53 +80,80 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - return false; - } - return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack})); + @Override + public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(201), 10, 1.0F, aX, aY, aZ); } } + @Override public void startProcess() { sendLoopStart((byte) 1); } + @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)}; + return new ITexture[]{ + super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{ + super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)}; + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)}; + return new ITexture[]{super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)}; + return new ITexture[]{super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW).glow().build()}; } + @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)}; + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW).glow().build()}; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 606733658b..d78dd722fa 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -1,12 +1,12 @@ package gregtech.common.tileentities.storage; import cpw.mods.fml.common.Optional; -import gregtech.api.enums.Textures; +import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.AE2DigitalChestHandler; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_QuantumChest; import gregtech.common.gui.GT_GUIContainer_QuantumChest; @@ -17,10 +17,51 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -@Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2") -public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEInventory<appeng.api.storage.data.IAEItemStack> { +import java.util.HashMap; +import java.util.Map; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW; + +@Optional.Interface(iface = "appeng.api.storage.IMEMonitor", modid = "appliedenergistics2", striprefs = true) +public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack> { + protected boolean mVoidOverflow = false; + private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null; + public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use a screwdriver to enable voiding items on overflow"); + super(aID, aName, aNameRegional, aTier, 3, new String[]{ + "This Chest stores " + commonSizeCompute(aTier) + " Blocks", + "Use a screwdriver to enable", + "voiding items on overflow" + }); + } + + protected static int commonSizeCompute(int tier) { + switch (tier) { + case 1: + return 4000000; + case 2: + return 8000000; + case 3: + return 16000000; + case 4: + return 32000000; + case 5: + return 64000000; + case 6: + return 128000000; + case 7: + return 256000000; + case 8: + return 512000000; + case 9: + return 1024000000; + case 10: + return 2147483640; + default: + return 0; + } } public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -31,39 +72,103 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti super(aName, aTier, 3, aDescription, aTextures); } + @Optional.Method(modid = "appliedenergistics2") + public static void registerAEIntegration() { + appeng.api.AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AE2DigitalChestHandler()); + } + + @Optional.Method(modid = "appliedenergistics2") @Override - public boolean isSimpleMachine() { - return true; + public void addListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, Object o) { + if (listeners == null) + listeners = new HashMap<>(); + listeners.put(imeMonitorHandlerReceiver, o); } + @Optional.Method(modid = "appliedenergistics2") @Override - public boolean isFacingValid(byte aFacing) { - return true; + public void removeListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) { + if (listeners == null) + listeners = new HashMap<>(); + listeners.remove(imeMonitorHandlerReceiver); } + @Optional.Method(modid = "appliedenergistics2") @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; + public appeng.api.config.AccessRestriction getAccess() { + return appeng.api.config.AccessRestriction.READ_WRITE; } + @Optional.Method(modid = "appliedenergistics2") @Override - public boolean isValidSlot(int aIndex) { - return true; + public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) { + return false; } + @Optional.Method(modid = "appliedenergistics2") @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + public boolean canAccept(appeng.api.storage.data.IAEItemStack iaeItemStack) { + ItemStack s = getItemStack(); + if (s == null || iaeItemStack == null) + return true; + return iaeItemStack.isSameType(s); + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public int getPriority() { + return 0; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public int getSlot() { + return 0; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public boolean validForPass(int i) { return true; } - - protected boolean mVoidOverflow = false; + + protected abstract ItemStack getItemStack(); + + protected abstract void setItemStack(ItemStack s); @Override - public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - mVoidOverflow = !mVoidOverflow; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); + @Optional.Method(modid = "appliedenergistics2") + public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList out) { + ItemStack storedStack = getItemStack(); + if (storedStack != null) { + appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); + s.setStackSize(getItemCount()); + out.add(s); + } + return out; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getStorageList() { + appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> res = new appeng.util.item.ItemList(); + ItemStack storedStack = getItemStack(); + if (storedStack != null) { + appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); + s.setStackSize(getItemCount()); + res.add(s); + } + return res; + } + + protected abstract int getItemCount(); + + @Override + public abstract void setItemCount(int aCount); + + @Override + public int getMaxItemCount() { + return commonSizeCompute(mTier); } @Override @@ -77,6 +182,87 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public appeng.api.storage.data.IAEItemStack injectItems(final appeng.api.storage.data.IAEItemStack input, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + final ItemStack inputStack = input.getItemStack(); + if (inputStack == null) + return null; + if (mode != appeng.api.config.Actionable.SIMULATE) + getBaseMetaTileEntity().markDirty(); + ItemStack storedStack = getItemStack(); + if (storedStack != null) { + if (GT_Utility.areStacksEqual(storedStack, inputStack)) { + if (input.getStackSize() + getItemCount() > getMaxItemCount()) { + if (mVoidOverflow) { + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getMaxItemCount()); + return null; + } + return createOverflowStack(input.getStackSize() + getItemCount(), mode); + } + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getItemCount() + (int) input.getStackSize()); + return null; + } + return input; + } + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemStack(inputStack.copy()); + if (input.getStackSize() > getMaxItemCount()) + return createOverflowStack(input.getStackSize(), mode); + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount((int) input.getStackSize()); + return null; + } + + @Optional.Method(modid = "appliedenergistics2") + private appeng.api.storage.data.IAEItemStack createOverflowStack(long size, appeng.api.config.Actionable mode) { + final appeng.api.storage.data.IAEItemStack overflow = appeng.util.item.AEItemStack.create(getItemStack()); + overflow.setStackSize(size - getMaxItemCount()); + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getMaxItemCount()); + return overflow; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public appeng.api.storage.data.IAEItemStack extractItems(final appeng.api.storage.data.IAEItemStack request, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + if (request.isSameType(getItemStack())) { + if (mode != appeng.api.config.Actionable.SIMULATE) + getBaseMetaTileEntity().markDirty(); + if (request.getStackSize() >= getItemCount()) { + appeng.util.item.AEItemStack result = appeng.util.item.AEItemStack.create(getItemStack()); + result.setStackSize(getItemCount()); + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(0); + return result; + } else { + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getItemCount() - (int) request.getStackSize()); + return request.copy(); + } + } + return null; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public appeng.api.storage.StorageChannel getChannel() { + return appeng.api.storage.StorageChannel.ITEMS; + } + + @Override + public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mVoidOverflow = !mVoidOverflow; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); + } + + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) { @@ -89,9 +275,10 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } int count = getItemCount(); ItemStack stack = getItemStack(); - if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { - count += mInventory[0].stackSize; + int savedCount = count; + if ((mInventory[0] != null) && ((count < getMaxItemCount()) || mVoidOverflow) && GT_Utility.areStacksEqual(mInventory[0], stack)) { + count += mInventory[0].stackSize; if (count <= getMaxItemCount()) { mInventory[0] = null; } else { @@ -119,107 +306,53 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } else { mInventory[2] = null; } - } - } - abstract protected int getItemCount(); - abstract public void setItemCount(int aCount); - abstract protected ItemStack getItemStack(); - abstract protected void setItemStack(ItemStack s); - - @Override - public int getProgresstime() { - return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + (mInventory[1] == null ? 0 : mInventory[1].stackSize); - } - - @Override - public int maxProgresstime() { - return getMaxItemCount(); - } - - protected static int CommonSizeCompute(int tier){ - switch(tier){ - case 1: - return 4000000; - case 2: - return 8000000; - case 3: - return 16000000; - case 4: - return 32000000; - case 5: - return 64000000; - case 6: - return 128000000; - case 7: - return 256000000; - case 8: - return 512000000; - case 9: - return 1024000000; - case 10: - return 2147483640; - default: - return 0; + if (GregTech_API.mAE2) + notifyListeners(count - savedCount, stack); + if (count != savedCount) + getBaseMetaTileEntity().markDirty(); } } @Override - public int getMaxItemCount() { - return CommonSizeCompute(mTier); + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer); + return true; } @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aIndex == 1; + public boolean isFacingValid(byte aFacing) { + return true; } @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aIndex == 0 && (mInventory[0] == null || GT_Utility.areStacksEqual(mInventory[0], aStack)); - } - - abstract protected String chestName(); - - @Optional.Method(modid = "appliedenergistics2") - public static void registerAEIntegration() { - appeng.api.AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AE2DigitalChestHandler()); + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; } @Override - public boolean isGivingInformation() { + public boolean isValidSlot(int aIndex) { return true; } @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mItemCount", getItemCount()); - if (getItemStack() != null) - aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); - aNBT.setBoolean("mVoidOverflow", mVoidOverflow); + public boolean isSimpleMachine() { + return true; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - if (aNBT.hasKey("mItemCount")) - setItemCount(aNBT.getInteger("mItemCount")); - if (aNBT.hasKey("mItemStack")) - setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"))); - mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); - + public int getProgresstime() { + return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) + (mInventory[1] == null ? 0 : mInventory[1].stackSize); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)}; - } - return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};//aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]); + public int maxProgresstime() { + return getMaxItemCount(); } @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - return new ITexture[0][0][0]; + public boolean isGivingInformation() { + return true; } @Override @@ -243,85 +376,68 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti }; } + @Override + public ItemStack[] getStoredItemData() { + return mInventory; + } + + protected abstract String chestName(); + @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IAEItemStack injectItems(final appeng.api.storage.data.IAEItemStack input, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { - final ItemStack inputStack = input.getItemStack(); - if (inputStack == null) - return null; - ItemStack storedStack = getItemStack(); - if (storedStack != null) { - if (GT_Utility.areStacksEqual(storedStack, inputStack)) { - if (input.getStackSize() + getItemCount() > getMaxItemCount()) - { - if (mVoidOverflow) - { - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getMaxItemCount()); - return null; - } - else - { - return createOverflowStack(input.getStackSize() + getItemCount(), mode); - } - } - else { - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getItemCount() + (int) input.getStackSize()); - } - return null; - } else - return input; - } else { - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemStack(inputStack.copy()); - if (input.getStackSize() > getMaxItemCount()) - return createOverflowStack(input.getStackSize(), mode); - else if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount((int) input.getStackSize()); - return null; + private void notifyListeners(int count, ItemStack stack) { + if (listeners == null) { + listeners = new HashMap<>(); + return; } + if (count == 0 || stack == null) + return; + appeng.util.item.ItemList change = new appeng.util.item.ItemList(); + appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(stack); + s.setStackSize(count); + change.add(s); + listeners.forEach((l, o) -> { + if (l.isValid(o)) + l.postChange(this, change, null); + else + removeListener(l); + }); } - @Optional.Method(modid = "appliedenergistics2") - private appeng.api.storage.data.IAEItemStack createOverflowStack(long size, appeng.api.config.Actionable mode) { - final appeng.api.storage.data.IAEItemStack overflow = appeng.util.item.AEItemStack.create(getItemStack()); - overflow.setStackSize(size - getMaxItemCount()); - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getMaxItemCount()); - return overflow; + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mItemCount", getItemCount()); + if (getItemStack() != null) + aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + aNBT.setBoolean("mVoidOverflow", mVoidOverflow); } - @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IAEItemStack extractItems(final appeng.api.storage.data.IAEItemStack request, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { - if (request.equals(getItemStack())) { - if (request.getStackSize() >= getItemCount()) { - appeng.util.item.AEItemStack result = appeng.util.item.AEItemStack.create(getItemStack()); - result.setStackSize(getItemCount()); - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(0); - return result; - } else { - if (mode != appeng.api.config.Actionable.SIMULATE) - setItemCount(getItemCount() - (int) request.getStackSize()); - return request.copy(); - } - } - return null; + @Override + public void loadNBTData(NBTTagCompound aNBT) { + if (aNBT.hasKey("mItemCount")) + setItemCount(aNBT.getInteger("mItemCount")); + if (aNBT.hasKey("mItemStack")) + setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"))); + mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); + } - @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.StorageChannel getChannel() { - return appeng.api.storage.StorageChannel.ITEMS; + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex == 1; } - @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> out) { - ItemStack storedStack = getItemStack(); - if (storedStack != null) { - appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); - s.setStackSize(getItemCount()); - out.add(s); - } - return out; + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex == 0 && (mInventory[0] == null || GT_Utility.areStacksEqual(mInventory[0], aStack)); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide != aFacing) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_SCHEST), + TextureFactory.builder().addIcon(OVERLAY_SCHEST_GLOW).glow().build() + }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java index 1eb62153e7..2295042d1a 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java @@ -1,24 +1,27 @@ package gregtech.common.tileentities.storage; import gregtech.api.GregTech_API; -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.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_Locker - extends GT_MetaTileEntity_TieredMachineBlock { +import static gregtech.api.enums.Textures.BlockIcons.LOCKERS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_LOCKER; + +public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlock { public byte mType = 0; public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor"); } public GT_MetaTileEntity_Locker(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -29,6 +32,7 @@ public class GT_MetaTileEntity_Locker super(aName, aTier, 4, aDescription, aTextures); } + @Override public String[] getDescription() { String[] desc = new String[mDescriptionArray.length + 1]; System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length); @@ -36,114 +40,138 @@ public class GT_MetaTileEntity_Locker return desc; } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)]}; + ITexture[] tmp0 = {MACHINE_CASINGS[this.mTier][(i + 1)]}; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + ITexture[] tmp1 = {MACHINE_CASINGS[this.mTier][(i + 1)], OVERLAYS_ENERGY_IN[this.mTier]}; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LOCKER)}; + ITexture[] tmp2 = {MACHINE_CASINGS[this.mTier][(i + 1)], TextureFactory.of(OVERLAY_LOCKER)}; rTextures[2][(i + 1)] = tmp2; } return rTextures; } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], Textures.BlockIcons.LOCKERS[Math.abs(this.mType % Textures.BlockIcons.LOCKERS.length)]}; + return new ITexture[]{this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], LOCKERS[Math.abs(this.mType % LOCKERS.length)]}; } return this.mTextures[0][(aColorIndex + 1)]; } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Locker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } + @Override public boolean isSimpleMachine() { return false; } + @Override public boolean isElectric() { return true; } + @Override public boolean isValidSlot(int aIndex) { return true; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + @Override public boolean isEnetInput() { return true; } + @Override public boolean isInputFacing(byte aSide) { return aSide == getBaseMetaTileEntity().getBackFacing(); } + @Override public boolean isTeleporterCompatible() { return false; } + @Override public long maxEUStore() { return gregtech.api.enums.GT_Values.V[this.mTier] * maxAmperesIn(); } + @Override public long maxEUInput() { return gregtech.api.enums.GT_Values.V[this.mTier]; } + @Override public long maxAmperesIn() { - return this.mInventory.length * 2; + return this.mInventory.length * 2L; } + @Override public int rechargerSlotStartIndex() { return 0; } + @Override public int rechargerSlotCount() { return getBaseMetaTileEntity().isAllowedToWork() ? this.mInventory.length : 0; } + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } + @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setByte("mType", this.mType); } + @Override public void loadNBTData(NBTTagCompound aNBT) { this.mType = aNBT.getByte("mType"); } + @Override public void onValueUpdate(byte aValue) { this.mType = aValue; } + @Override public byte getUpdateData() { return this.mType; } + @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == 16) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(3)), 1, 1.0F); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(3), 1, 1.0F); } } + @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { this.mType = ((byte) (this.mType + 1)); } } + @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { return aSide != getBaseMetaTileEntity().getFrontFacing(); } + @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing())) { for (int i = 0; i < 4; i++) { @@ -157,10 +185,12 @@ public class GT_MetaTileEntity_Locker return true; } + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java index 10a1a14bda..396b6d6464 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -1,19 +1,38 @@ package gregtech.common.tileentities.storage; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; -public class GT_MetaTileEntity_QuantumTank - extends GT_MetaTileEntity_BasicTank { +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW; + +public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid"); + super(aID, aName, aNameRegional, aTier, 3, "Stores " + commonSizeCompute(aTier) + "L of fluid"); + } + + private static int commonSizeCompute(int tier) { + switch (tier) { + case 6: + return 128000000; + case 7: + return 256000000; + case 8: + return 512000000; + case 9: + return 1024000000; + case 10: + return 2147483640; + default: + return 0; + } } public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -30,96 +49,84 @@ public class GT_MetaTileEntity_QuantumTank } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QTANK)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + public boolean isSimpleMachine() { + return true; } @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); + public boolean doesFillContainers() { + return true; } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + public boolean doesEmptyContainers() { return true; } @Override - public boolean isSimpleMachine() { + public boolean canTankBeFilled() { return true; } @Override - public boolean isFacingValid(byte aFacing) { + public boolean canTankBeEmptied() { return true; } @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { + public boolean displaysItemStack() { return true; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); + public boolean displaysStackSize() { + return false; } @Override - public final byte getUpdateData() { - return 0x00; + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescriptionArray, mTextures); } @Override - public boolean doesFillContainers() { - return true; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_QTANK), + TextureFactory.builder().addIcon(OVERLAY_QTANK_GLOW).glow().build() + }; } @Override - public boolean doesEmptyContainers() { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer); return true; } @Override - public boolean canTankBeFilled() { - return true; + public final byte getUpdateData() { + return 0x00; } @Override - public boolean canTankBeEmptied() { + public boolean isFacingValid(byte aFacing) { return true; } @Override - public boolean displaysItemStack() { + public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } @Override - public boolean displaysStackSize() { - return false; + public int getTankPressure() { + return 100; } @Override - public String[] getInfoData() { - - if (mFluid == null) { - return new String[]{ - EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+ - EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET - }; - } - return new String[]{ - EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+ - EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET - }; + public int getCapacity() { + return commonSizeCompute(mTier); } @Override @@ -128,35 +135,24 @@ public class GT_MetaTileEntity_QuantumTank } @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescriptionArray, mTextures); - } + public String[] getInfoData() { - private static int CommonSizeCompute(int tier){ - switch(tier){ - case 6: - return 128000000; - case 7: - return 256000000; - case 8: - return 512000000; - case 9: - return 1024000000; - case 10: - return 2147483640; - default: - return 0; + if (mFluid == null) { + return new String[]{ + EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(0) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET + }; } - } - - @Override - public int getCapacity() { - return CommonSizeCompute(mTier); - } - - @Override - public int getTankPressure() { - return 100; + return new String[]{ + EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET + }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java index 3f53058f8d..e566ba9ed5 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java @@ -20,20 +20,34 @@ public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_DigitalChest public GT_MetaTileEntity_SuperChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } + @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SuperChest(mName, mTier, mDescriptionArray, mTextures); + protected ItemStack getItemStack() { + return mItemStack; } + @Override - protected String chestName(){ return "Super Chest"; } + protected void setItemStack(ItemStack s) { + mItemStack = s; + } + @Override - protected int getItemCount() { return mItemCount; } + protected int getItemCount() { + return mItemCount; + } + @Override public void setItemCount(int aCount) { mItemCount = aCount; } + @Override - protected ItemStack getItemStack(){ return mItemStack; } + protected String chestName() { + return "Super Chest"; + } + @Override - protected void setItemStack(ItemStack s){ mItemStack = s; } + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SuperChest(mName, mTier, mDescriptionArray, mTextures); + } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java index a6e4d11599..41171720f5 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java @@ -1,19 +1,38 @@ package gregtech.common.tileentities.storage; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; -public class GT_MetaTileEntity_SuperTank - extends GT_MetaTileEntity_BasicTank { +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_QTANK_GLOW; + +public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_SuperTank(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid"); + super(aID, aName, aNameRegional, aTier, 3, "Stores " + commonSizeCompute(aTier) + "L of fluid"); + } + + private static int commonSizeCompute(int tier) { + switch (tier) { + case 1: + return 4000000; + case 2: + return 8000000; + case 3: + return 16000000; + case 4: + return 32000000; + case 5: + return 64000000; + default: + return 0; + } } public GT_MetaTileEntity_SuperTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -30,96 +49,84 @@ public class GT_MetaTileEntity_SuperTank } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_STANK)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + public boolean isSimpleMachine() { + return true; } @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); + public boolean doesFillContainers() { + return true; } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + public boolean doesEmptyContainers() { return true; } @Override - public boolean isSimpleMachine() { + public boolean canTankBeFilled() { return true; } @Override - public boolean isFacingValid(byte aFacing) { + public boolean canTankBeEmptied() { return true; } @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { + public boolean displaysItemStack() { return true; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); + public boolean displaysStackSize() { + return false; } @Override - public final byte getUpdateData() { - return 0x00; + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SuperTank(mName, mTier, mDescription, mTextures); } @Override - public boolean doesFillContainers() { - return true; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1]}; + return new ITexture[]{ + MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(OVERLAY_QTANK), + TextureFactory.builder().addIcon(OVERLAY_QTANK_GLOW).glow().build() + }; } @Override - public boolean doesEmptyContainers() { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (!aBaseMetaTileEntity.isClientSide()) aBaseMetaTileEntity.openGUI(aPlayer); return true; } @Override - public boolean canTankBeFilled() { - return true; + public final byte getUpdateData() { + return 0x00; } @Override - public boolean canTankBeEmptied() { + public boolean isFacingValid(byte aFacing) { return true; } @Override - public boolean displaysItemStack() { + public boolean isAccessAllowed(EntityPlayer aPlayer) { return true; } @Override - public boolean displaysStackSize() { - return false; + public int getTankPressure() { + return 100; } @Override - public String[] getInfoData() { - - if (mFluid == null) { - return new String[]{ - EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+ - EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET - }; - } - return new String[]{ - EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET, - "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+ - EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET - }; + public int getCapacity() { + return commonSizeCompute(mTier); } @Override @@ -128,35 +135,24 @@ public class GT_MetaTileEntity_SuperTank } @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SuperTank(mName, mTier, mDescription, mTextures); - } + public String[] getInfoData() { - private static int CommonSizeCompute(int tier){ - switch(tier){ - case 1: - return 4000000; - case 2: - return 8000000; - case 3: - return 16000000; - case 4: - return 32000000; - case 5: - return 64000000; - default: - return 0; + if (mFluid == null) { + return new String[]{ + EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0 L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET + }; } - } - - @Override - public int getCapacity() { - return CommonSizeCompute(mTier); - } - - @Override - public int getTankPressure() { - return 100; + return new String[]{ + EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L" + EnumChatFormatting.RESET + " " + + EnumChatFormatting.YELLOW + getCapacity() + " L" + EnumChatFormatting.RESET + }; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool.java b/src/main/java/gregtech/common/tools/GT_Tool.java index d8ca77a388..198ee4fb5a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool.java +++ b/src/main/java/gregtech/common/tools/GT_Tool.java @@ -19,93 +19,113 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public abstract class GT_Tool - implements IToolStats { +public abstract class GT_Tool implements IToolStats { 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(int aOriginalHurtResistance, 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 (String) 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 isGrafter() { return false; } + @Override public boolean isChainsaw(){ 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 DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity) { return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null); } @@ -114,35 +134,43 @@ public abstract class GT_Tool return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { return 0; } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public Enchantment[] getEnchantments(ItemStack aStack) { return ZERO_ENCHANTMENTS; } + @Override public int[] getEnchantmentLevels(ItemStack aStack) { return ZERO_ENCHANTMENT_LEVELS; } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { aPlayer.triggerAchievement(AchievementList.openInventory); aPlayer.triggerAchievement(AchievementList.mineWood); aPlayer.triggerAchievement(AchievementList.buildWorkBench); } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } + @Override public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java index 67594753c7..edbdb3b61b 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java @@ -17,73 +17,89 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public class GT_Tool_Axe - extends GT_Tool { +public class GT_Tool_Axe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getSpeedMultiplier() { return 2.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("axe"))) || (aBlock.getMaterial() == Material.wood); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rAmount = 0; if ((GregTech_API.sTimber) && (!aPlayer.isSneaking()) && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { @@ -98,6 +114,7 @@ public class GT_Tool_Axe return rAmount; } + @Override public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){ @@ -113,21 +130,26 @@ public class GT_Tool_Axe return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been chopped by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java index 7497cb8b2f..1ba110252a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java @@ -19,24 +19,28 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public class GT_Tool_BranchCutter - extends GT_Tool { +public class GT_Tool_BranchCutter extends GT_Tool { + @Override public float getBaseDamage() { return 2.5F; } + @Override public float getSpeedMultiplier() { return 0.25F; } + @Override public float getMaxDurabilityMultiplier() { return 0.25F; } + @Override public boolean isGrafter() { return true; } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { if (aBlock.getMaterial() == Material.leaves) { aEvent.dropChance = Math.min(1.0F, Math.max(aEvent.dropChance, (aStack.getItem().getHarvestLevel(aStack, "") + 1) * 0.2F)); @@ -58,19 +62,23 @@ public class GT_Tool_BranchCutter return 0; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("grafter"))) || (aBlock.getMaterial() == Material.leaves); } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.GRAFTER : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been trimmed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java index 52994e22b2..f57ba7f5d3 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java @@ -12,68 +12,83 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_ButcheryKnife - extends GT_Tool { +public class GT_Tool_ButcheryKnife extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) { return aOriginalHurtResistance * 2; } + @Override public float getSpeedMultiplier() { return 0.1F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMiningTool() { return false; } + @Override public Enchantment[] getEnchantments(ItemStack aStack) { return LOOTING_ENCHANTMENT; } + @Override public int[] getEnchantmentLevels(ItemStack aStack) { return new int[]{(2 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2}; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.BUTCHERYKNIFE : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has butchered " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return false; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java index 1a0a6c13e7..f0a3169c7a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java @@ -11,52 +11,63 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_BuzzSaw - extends GT_Tool_Saw { +public class GT_Tool_BuzzSaw extends GT_Tool_Saw { + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 300; } + @Override public float getBaseDamage() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(104)); + return (String) GregTech_API.sSoundList.get(104); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(105)); + return (String) GregTech_API.sSoundList.get(105); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(104)); + return (String) GregTech_API.sSoundList.get(104); } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return false; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadBuzzSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_BUZZSAW; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got buzzed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java index 2ca6b688ff..117b7b6bc0 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java @@ -4,40 +4,48 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import net.minecraft.item.ItemStack; -public class GT_Tool_Chainsaw_HV - extends GT_Tool_Chainsaw_LV { +public class GT_Tool_Chainsaw_HV extends GT_Tool_Chainsaw_LV { + @Override public int getToolDamagePerBlockBreak() { return 800; } + @Override public int getToolDamagePerDropConversion() { return 1600; } + @Override public int getToolDamagePerContainerCraft() { return 12800; } + @Override public int getToolDamagePerEntityAttack() { return 3200; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 4.0F; } + @Override public float getSpeedMultiplier() { return 4.0F; } + @Override public float getMaxDurabilityMultiplier() { return 4.0F; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java index 127f477542..f746f7e43f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java @@ -22,74 +22,89 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.ArrayList; import java.util.List; -public class GT_Tool_Chainsaw_LV - extends GT_Tool_Saw { +public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 800; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getSpeedMultiplier() { return 2.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(104)); + return (String) GregTech_API.sSoundList.get(104); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(105)); + return (String) GregTech_API.sSoundList.get(105); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(104)); + return (String) GregTech_API.sSoundList.get(104); } + @Override public boolean canBlock() { return false; } + @Override public boolean isChainsaw(){ return true; } + @Override public boolean isWeapon() { return true; } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "brrrr"); GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildChainsaw"); - } catch (Exception e) { + } catch (Exception ignored) { } } @Override @@ -100,20 +115,7 @@ public class GT_Tool_Chainsaw_LV if (((IShearable) aBlock).isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)) { ArrayList<ItemStack> tDrops = ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); aDrops.clear(); -// aDrops.addAll(tDrops); -// aEvent.dropChance = 1.0F; -// for (ItemStack stack : tDrops) -// { -// Random itemRand = new Random(); -// float f = 0.7F; -// double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D; -// double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D; -// double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D; -// EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack); -// entityitem.delayBeforeCanPickup = 10; -// aPlayer.worldObj.spawnEntityInWorld(entityitem); -// } -// aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1); + } aPlayer.worldObj.setBlock(aX, aY, aZ, Blocks.air, 0, 0); } else @@ -135,6 +137,7 @@ public class GT_Tool_Chainsaw_LV return rAmount; } + @Override public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))){ @@ -150,14 +153,17 @@ public class GT_Tool_Chainsaw_LV return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was massacred by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java index 0fcd74ebf7..e571a26cfc 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java @@ -4,40 +4,48 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import net.minecraft.item.ItemStack; -public class GT_Tool_Chainsaw_MV - extends GT_Tool_Chainsaw_LV { +public class GT_Tool_Chainsaw_MV extends GT_Tool_Chainsaw_LV { + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 400; } + @Override public int getToolDamagePerContainerCraft() { return 3200; } + @Override public int getToolDamagePerEntityAttack() { return 800; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 3.5F; } + @Override public float getSpeedMultiplier() { return 3.0F; } + @Override public float getMaxDurabilityMultiplier() { return 2.0F; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java index 613037ea91..43890b0c93 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java @@ -17,68 +17,83 @@ import net.minecraft.util.IChatComponent; import java.util.Iterator; -public class GT_Tool_Crowbar - extends GT_Tool { +public class GT_Tool_Crowbar extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 2.0F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return true; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { if (aBlock.getMaterial() == Material.circuits) { return true; @@ -95,22 +110,27 @@ public class GT_Tool_Crowbar return tTool.equals("crowbar"); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.CROWBAR : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Crowbar(1, 1000)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was removed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java index 42968cf9e8..36c414d40f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java @@ -6,49 +6,58 @@ import gregtech.api.interfaces.IIconContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -public class GT_Tool_Drill_HV - extends GT_Tool_Drill_LV { +public class GT_Tool_Drill_HV extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 400 : 800; } + @Override public int getToolDamagePerDropConversion() { return 1600; } + @Override public int getToolDamagePerContainerCraft() { return 12800; } + @Override public int getToolDamagePerEntityAttack() { return 3200; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getSpeedMultiplier() { return 9.0F; } + @Override public float getMaxDurabilityMultiplier() { return 4.0F; } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "highpowerdrill"); GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildDDrill"); - } catch (Exception e) { + } catch (Exception ignored) { } } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java index 8f5e6bdfe2..898b549753 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java @@ -15,84 +15,103 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Drill_LV - extends GT_Tool { +public class GT_Tool_Drill_LV extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 25 : 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 2.0F; } + @Override public float getSpeedMultiplier() { return 3.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(106)); + return (String) GregTech_API.sSoundList.get(106); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(106)); + return (String) GregTech_API.sSoundList.get(106); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(106)); + return (String) GregTech_API.sSoundList.get(106); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(106)); + return (String) GregTech_API.sSoundList.get(106); } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || ((tTool.equals("pickaxe")) || (tTool.equals("shovel")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.iron) || (aBlock.getMaterial() == Material.anvil) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.glass); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); aPlayer.triggerAchievement(AchievementList.buildPickaxe); @@ -100,10 +119,11 @@ public class GT_Tool_Drill_LV try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "driltime"); GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildDrill"); - } catch (Exception e) { + } catch (Exception ignored) { } } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got the Drill! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java index de9c067f3c..7bfddc6f98 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java @@ -7,38 +7,47 @@ import net.minecraft.item.ItemStack; public class GT_Tool_Drill_MV extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 100 : 200; } + @Override public int getToolDamagePerDropConversion() { return 400; } + @Override public int getToolDamagePerContainerCraft() { return 3200; } + @Override public int getToolDamagePerEntityAttack() { return 800; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 2.5F; } + @Override public float getSpeedMultiplier() { return 6.0F; } + @Override public float getMaxDurabilityMultiplier() { return 2.0F; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index b17f350aca..dc6bc759b1 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -13,86 +13,107 @@ import net.minecraft.util.IChatComponent; public class GT_Tool_File extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMiningTool() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || tTool.equals("file")); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadFile.mTextureIndex] : Textures.ItemIcons.HANDLE_FILE; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been filed D for 'Dead' by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java index 1627b22fa5..8cb09da5f9 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java @@ -22,91 +22,109 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.Arrays; import java.util.List; -public class GT_Tool_HardHammer - extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"}); +public class GT_Tool_HardHammer extends GT_Tool { + public static final List<String> mEffectiveList = Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; } + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 200; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) { return aOriginalHurtResistance * 2; } + @Override public float getSpeedMultiplier() { return 0.75F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(1)); + return (String) GregTech_API.sSoundList.get(1); } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(2)); + return (String) GregTech_API.sSoundList.get(2); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || ((tTool.equals("hammer")) || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce) || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})}); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[]{tDrop})); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -125,31 +143,37 @@ public class GT_Tool_HardHammer return rConversions; } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHammer.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Prospecting(1, 1000)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was squashed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "tools"); - } catch (Exception e) { + } catch (Exception ignored) { } } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java index b6d57ba0fb..65849d7dad 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java @@ -14,90 +14,110 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Hoe - extends GT_Tool { +public class GT_Tool_Hoe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.75F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("hoe"))) || (aBlock.getMaterial() == Material.gourd); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Hoe(100)); } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); aPlayer.triggerAchievement(AchievementList.buildHoe); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been called a stupid Hoe by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java index 863775d6fb..f76170963a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java @@ -17,51 +17,60 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public class GT_Tool_JackHammer - extends GT_Tool_Drill_LV { +public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 200 : 400; } + @Override public int getToolDamagePerDropConversion() { return 400; } + @Override public int getToolDamagePerContainerCraft() { return 3200; } + @Override public int getToolDamagePerEntityAttack() { return 800; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getSpeedMultiplier() { return 12.0F; } + @Override public float getMaxDurabilityMultiplier() { return 2.0F; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("pickaxe"))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})}); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[]{tDrop})); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -80,19 +89,22 @@ public class GT_Tool_JackHammer return rConversions; } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "hammertime"); - } catch (Exception e) { + } catch (Exception ignored) { } } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.JACKHAMMER : null; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been jackhammered into pieces by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java index db49fb35df..2a4ba6fff9 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java @@ -9,44 +9,53 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Knife - extends GT_Tool_Sword { +public class GT_Tool_Knife extends GT_Tool_Sword { + @Override public int getToolDamagePerBlockBreak() { return 100; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 600; } + @Override public float getBaseDamage() { return 0F; } + @Override public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) { return aOriginalHurtResistance * 3; } + @Override public float getSpeedMultiplier() { return 0.5F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.KNIFE : null; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText("<" + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " what are you doing?, " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + "?!? STAHP!!!"); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java index 28e122b1d9..772da53b7f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java @@ -12,87 +12,107 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Mortar - extends GT_Tool { +public class GT_Tool_Mortar extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 2.0F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMiningTool() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return false; } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.MORTAR : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Dyes._NULL.mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was grounded by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java index 19f1380a94..db9d3a6a5f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java @@ -14,94 +14,114 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Pickaxe - extends GT_Tool { +public class GT_Tool_Pickaxe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 25 : 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("pickaxe"))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.iron) || (aBlock.getMaterial() == Material.anvil) || (aBlock.getMaterial() == Material.glass); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); aPlayer.triggerAchievement(AchievementList.buildPickaxe); aPlayer.triggerAchievement(AchievementList.buildBetterPickaxe); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "flintpick"); - } catch (Exception e) { + } catch (Exception ignored) { } } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got mined by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java index 08463ed1ca..0239598222 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java @@ -17,23 +17,26 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public class GT_Tool_Plow - extends GT_Tool { +public class GT_Tool_Plow extends GT_Tool { private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return (aEntity instanceof EntitySnowman) ? aOriginalDamage * 4.0F : aOriginalDamage; } + @Override public float getBaseDamage() { return 1.0F; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("plow"))) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.craftedSnow); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { @@ -41,7 +44,10 @@ public class GT_Tool_Plow for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int k = -1; k < 2; k++) { - if (((i != 0) || (j != 0) || (k != 0)) && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { + if (((i != 0) || (j != 0) || (k != 0)) + && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) + && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) + { rConversions++; } } @@ -52,14 +58,17 @@ public class GT_Tool_Plow return rConversions; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " plew through the yard of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index 72c0080deb..c0046a8a6c 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -15,57 +15,67 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Plunger - extends GT_Tool { +public class GT_Tool_Plunger extends GT_Tool { + @Override public float getBaseDamage() { return 1.25F; } + @Override public float getMaxDurabilityMultiplier() { return 0.25F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || tTool.equals("plunger")); } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.PLUNGER : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Plunger_Item(getToolDamagePerDropConversion())); aItem.addItemBehavior(aID, new Behaviour_Plunger_Fluid(getToolDamagePerDropConversion())); try { - Object tObject = GT_Utility.callConstructor("gregtech.common.items.behaviors.Behaviour_Plunger_Essentia", 0, null, false, new Object[]{Integer.valueOf(getToolDamagePerDropConversion())}); + Object tObject = GT_Utility.callConstructor("gregtech.common.items.behaviors.Behaviour_Plunger_Essentia", 0, null, false, getToolDamagePerDropConversion()); if ((tObject instanceof IItemBehaviour)) { aItem.addItemBehavior(aID, (IItemBehaviour) tObject); } - } catch (Throwable e) { + } catch (Throwable ignored) { } } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got stuck trying to escape through a Pipe while fighting " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java index ca0d85e3d6..b4b1422d92 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java @@ -11,43 +11,52 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_RollingPin - extends GT_Tool { +public class GT_Tool_RollingPin extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public float getBaseDamage() { return 2.0F; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return false; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Dyes._NULL.mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.ROLLING_PIN : null; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got flattened by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java index aafd989bac..fb37a55eef 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java @@ -19,56 +19,68 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.ArrayList; import java.util.List; -public class GT_Tool_Saw - extends GT_Tool { +public class GT_Tool_Saw extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 200; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.75F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { if ((aBlock.getMaterial() == Material.leaves) && ((aBlock instanceof IShearable))) { aPlayer.worldObj.setBlock(aX, aY, aZ, aBlock, aMetaData, 0); @@ -88,26 +100,32 @@ public class GT_Tool_Saw return 0; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || ((tTool.equals("axe")) || (tTool.equals("saw")))) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_SAW; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was getting cut down by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java index 65af5d5c92..674a52133d 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java @@ -16,83 +16,101 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Scoop - extends GT_Tool { +public class GT_Tool_Scoop extends GT_Tool { public static Material sBeeHiveMaterial; + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 200; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.0F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("scoop"))) || (aBlock.getMaterial() == sBeeHiveMaterial); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.SCOOP : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { if(Loader.isModLoaded(GT_Values.MOD_ID_FR)){ aItem.addItemBehavior(aID, new Behaviour_Scoop(200)); @@ -102,6 +120,7 @@ public class GT_Tool_Scoop } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java index 4d19ee0671..f6b99bdb5a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java @@ -20,97 +20,118 @@ import net.minecraft.util.IChatComponent; import java.util.Arrays; import java.util.List; -public class GT_Tool_Screwdriver - extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"}); +public class GT_Tool_Screwdriver extends GT_Tool { + public static final List<String> mEffectiveList = Arrays.asList(EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"); + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; } + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(100)); + return (String) GregTech_API.sSoundList.get(100); } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMiningTool() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("screwdriver"))) || (aBlock.getMaterial() == Material.circuits); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_SCREWDRIVER; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Screwdriver(1, 200)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " is screwed! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java index 93255f7f2f..d8d97cdc4b 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java @@ -5,20 +5,23 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.item.ItemStack; -public class GT_Tool_Screwdriver_LV - extends GT_Tool_Screwdriver { +public class GT_Tool_Screwdriver_LV extends GT_Tool_Screwdriver { + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public int getToolDamagePerContainerCraft() { return 200; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_ELECTRIC_SCREWDRIVER; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java index c9af2fc5a6..99830fe315 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java @@ -16,24 +16,27 @@ import net.minecraftforge.event.world.BlockEvent; import java.util.List; -public class GT_Tool_Sense - extends GT_Tool { +public class GT_Tool_Sense extends GT_Tool { private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getMaxDurabilityMultiplier() { return 4.0F; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || ((tTool.equals("sense")) || (tTool.equals("scythe")))) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.leaves); } + @Override public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { @@ -41,7 +44,9 @@ public class GT_Tool_Sense for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int k = -2; k < 3; k++) { - if (((i != 0) || (j != 0) || (k != 0)) && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { + if (((i != 0) || (j != 0) || (k != 0)) + && (aStack.getItem().getDigSpeed(aStack, aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) + && (((EntityPlayerMP) aPlayer).theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { rConversions++; } } @@ -52,18 +57,22 @@ public class GT_Tool_Sense return rConversions; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Sense(getToolDamagePerBlockBreak())); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has taken the Soul of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java index 1549eaebab..ee42c6345c 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java @@ -11,84 +11,103 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_Shovel - extends GT_Tool { +public class GT_Tool_Shovel extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("shovel"))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got dug up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 5bee44aa03..ef460bdcc4 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -12,97 +12,119 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_SoftHammer - extends GT_Tool { +public class GT_Tool_SoftHammer extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 800; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) { return aOriginalHurtResistance * 2; } + @Override public float getSpeedMultiplier() { return 0.1F; } + @Override public float getMaxDurabilityMultiplier() { return 8.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public String getEntityHitSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(101)); + return (String) GregTech_API.sSoundList.get(101); } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMiningTool() { return false; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || tTool.equals("softhammer")); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadMallet.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.handleMallet.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_SoftHammer(100)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was hammered to death by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java index 1b13e9207a..c8eefb40ea 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java @@ -21,95 +21,117 @@ import java.util.Arrays; import java.util.List; public class GT_Tool_Soldering_Iron extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"}); + public static final List<String> mEffectiveList = Arrays.asList(EntityCaveSpider.class.getName(), EntitySpider.class.getName(), "EntityTFHedgeSpider", "EntityTFKingSpider", "EntityTFSwarmSpider", "EntityTFTowerBroodling"); + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; } + @Override public int getToolDamagePerBlockBreak() { return 1000; } + @Override public int getToolDamagePerDropConversion() { return 500; } + @Override public int getToolDamagePerContainerCraft() { return 1000; } + @Override public int getToolDamagePerEntityAttack() { return 500; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(100)); + return (String) GregTech_API.sSoundList.get(100); } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMiningTool() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("soldering_iron"))) || (aBlock.getMaterial() == Material.circuits); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[49] : Textures.ItemIcons.HANDLE_SOLDERING; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Screwdriver(1, 200)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got soldert! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java index 305b8313eb..a357fe3ba0 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java @@ -10,85 +10,104 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; -public class GT_Tool_Sword - extends GT_Tool { +public class GT_Tool_Sword extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 100; } + @Override public int getToolDamagePerEntityAttack() { return 100; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 4.0F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("sword"))) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] : Textures.ItemIcons.HANDLE_SWORD; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); aPlayer.triggerAchievement(AchievementList.buildSword); diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java index 8ac83ef486..249ca04acb 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java @@ -10,6 +10,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; public abstract class GT_Tool_Turbine extends GT_Tool { + @Override public abstract float getBaseDamage(); @Override @@ -27,6 +28,7 @@ public abstract class GT_Tool_Turbine extends GT_Tool { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null; } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + "s" + EnumChatFormatting.WHITE + " head into a turbine"); @@ -34,10 +36,13 @@ public abstract class GT_Tool_Turbine extends GT_Tool { public abstract IIconContainer getTurbineIcon(); + @Override public abstract float getSpeedMultiplier(); + @Override public abstract float getMaxDurabilityMultiplier(); + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java index cd0f406f18..690c3c1b5a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java @@ -15,98 +15,119 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_UniversalSpade - extends GT_Tool { +public class GT_Tool_UniversalSpade extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 100; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public float getSpeedMultiplier() { return 0.75F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return true; } + @Override public boolean isCrowbar() { return true; } + @Override public boolean isWeapon() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || ((tTool.equals("shovel")) || (tTool.equals("axe")) || (tTool.equals("saw")) || (tTool.equals("sword")) || (tTool.equals("crowbar")))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Crowbar(2, 2000)); } + @Override public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { super.onToolCrafted(aStack, aPlayer); aPlayer.triggerAchievement(AchievementList.buildSword); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "unitool"); - } catch (Exception e) { + } catch (Exception ignored) { } } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been digged by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java index a68275f88f..b77efa1e4e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java @@ -11,84 +11,103 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -public class GT_Tool_WireCutter - extends GT_Tool { +public class GT_Tool_WireCutter extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 100; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 400; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.25F; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { return null; } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { return null; } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && ( tTool == null || tTool.isEmpty() || (tTool.equals("cutter"))); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.WIRE_CUTTER : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has cut the Cable for the Life Support Machine of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java index 26a77ed229..98fc1005c0 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -20,112 +20,125 @@ import net.minecraft.util.IChatComponent; import java.util.Arrays; import java.util.List; -public class GT_Tool_Wrench - extends GT_Tool { - public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"}); +public class GT_Tool_Wrench extends GT_Tool { + public static final List<String> mEffectiveList = Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; } + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 800; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 3.0F; } + @Override public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) { return aOriginalHurtResistance * 2; } + @Override public float getSpeedMultiplier() { return 1.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public String getCraftingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(100)); + return (String) GregTech_API.sSoundList.get(100); } + @Override public String getEntityHitSound() { return null; } + @Override public String getBreakingSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + return (String) GregTech_API.sSoundList.get(0); } + @Override public String getMiningSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(100)); + return (String) GregTech_API.sSoundList.get(100); } + @Override public boolean canBlock() { return false; } + @Override public boolean isCrowbar() { return false; } + @Override public boolean isWrench() { return true; } + @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("wrench"))) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper); } + @Override public ItemStack getBrokenItem(ItemStack aStack) { return null; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? Textures.ItemIcons.WRENCH : null; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null; } + @Override public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { aItem.addItemBehavior(aID, new Behaviour_Wrench(100)); } + @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " threw a Monkey Wrench into the Plans of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); } } - - -/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar - - * Qualified Name: gregtech.common.tools.GT_Tool_Wrench - - * JD-Core Version: 0.7.0.1 - - */ diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java index deb7a8dbc3..4ec433d9a7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java @@ -5,48 +5,58 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.item.ItemStack; -public class GT_Tool_Wrench_HV - extends GT_Tool_Wrench_LV { +public class GT_Tool_Wrench_HV extends GT_Tool_Wrench_LV { + @Override public int getToolDamagePerBlockBreak() { return 800; } + @Override public int getToolDamagePerDropConversion() { return 1600; } + @Override public int getToolDamagePerContainerCraft() { return 12800; } + @Override public int getToolDamagePerEntityAttack() { return 3200; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 2.0F; } + @Override public float getSpeedMultiplier() { return 4.0F; } + @Override public float getMaxDurabilityMultiplier() { return 4.0F; } + @Override public boolean canBlock() { return false; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java index 034752f265..12b83dcb83 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java @@ -7,52 +7,63 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -public class GT_Tool_Wrench_LV - extends GT_Tool_Wrench { +public class GT_Tool_Wrench_LV extends GT_Tool_Wrench { + @Override public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { return aOriginalDamage; } + @Override public int getToolDamagePerBlockBreak() { return 50; } + @Override public int getToolDamagePerDropConversion() { return 100; } + @Override public int getToolDamagePerContainerCraft() { return 800; } + @Override public int getToolDamagePerEntityAttack() { return 200; } + @Override public int getBaseQuality() { return 0; } + @Override public float getBaseDamage() { return 1.0F; } + @Override public float getSpeedMultiplier() { return 2.0F; } + @Override public float getMaxDurabilityMultiplier() { return 1.0F; } + @Override public boolean canBlock() { return false; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java index 8a3fb4f968..5ffc3b1481 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java @@ -5,48 +5,58 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.item.ItemStack; -public class GT_Tool_Wrench_MV - extends GT_Tool_Wrench_LV { +public class GT_Tool_Wrench_MV extends GT_Tool_Wrench_LV { + @Override public int getToolDamagePerBlockBreak() { return 200; } + @Override public int getToolDamagePerDropConversion() { return 400; } + @Override public int getToolDamagePerContainerCraft() { return 3200; } + @Override public int getToolDamagePerEntityAttack() { return 800; } + @Override public int getBaseQuality() { return 1; } + @Override public float getBaseDamage() { return 1.5F; } + @Override public float getSpeedMultiplier() { return 3.0F; } + @Override public float getMaxDurabilityMultiplier() { return 2.0F; } + @Override public boolean canBlock() { return false; } + @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } |