diff options
author | Bass <basdxz@github.com> | 2017-08-21 11:06:12 +0100 |
---|---|---|
committer | Bass <basdxz@github.com> | 2017-08-21 11:06:12 +0100 |
commit | c2bd55b7ef6097f3c08c21e2d6ea102d63925c59 (patch) | |
tree | 165d6be12a93b643b22035c6403d80aa6648e6e5 /src/main/java | |
parent | ee40553d2bf5938c4403a78107dcfe417aec46b8 (diff) | |
download | GT5-Unofficial-c2bd55b7ef6097f3c08c21e2d6ea102d63925c59.tar.gz GT5-Unofficial-c2bd55b7ef6097f3c08c21e2d6ea102d63925c59.tar.bz2 GT5-Unofficial-c2bd55b7ef6097f3c08c21e2d6ea102d63925c59.zip |
>WhenyouStageTheWrongFileHelpImInTecsBasement
Diffstat (limited to 'src/main/java')
3 files changed, 27 insertions, 139 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java index 6b37db2cee..aa591faa50 100644 --- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java @@ -183,6 +183,7 @@ public class MachineLoader implements Runnable { Machine_Multi_Switch.set(new GT_MetaTileEntity_EM_switch(15310, "multimachine.em.switch", "Network Switch With QoS").getStackForm(1L)); Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(15311, "multimachine.em.computer", "Quantum Computer").getStackForm(1L)); Machine_Multi_Microwave.set(new GT_MetaTileEntity_TM_microwave(15312, "multimachine.tm.microwave", "Microwave Grinder").getStackForm(1L)); + Machine_Multi_teslaCoil.set(new GT_MetaTileEntity_TM_teslaCoil(15313, "multimachine.tm.teslaCoil", "Tesla Coil").getStackForm(1L)); Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(15320, "multimachine.em.junction", "Matter Junction").getStackForm(1L)); Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EM_quantizer(15321, "multimachine.em.mattertoem", "Matter Quantizer").getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 94a948593e..557fc7da68 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -31,7 +31,7 @@ public enum CustomItemList implements IItemContainer { Parametrizer_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch, eM_Containment, eM_Containment_Field, eM_Containment_Advanced, eM_Coil, eM_Teleportation, eM_Dimensional, eM_Ultimate_Containment, eM_Ultimate_Containment_Advanced, eM_Ultimate_Containment_Field, eM_Spacetime, eM_Computer_Casing, eM_Computer_Bus, eM_Computer_Vent, eM_Hollow, eM_Power, debugBlock, - Machine_Multi_Microwave, + Machine_Multi_Microwave, Machine_Multi_teslaCoil, Machine_Multi_Transformer, Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, Machine_Multi_Scanner, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index c7816192c2..07cd858503 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,93 +1,68 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; 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.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.ArrayList; -import java.util.HashSet; import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.loader.MainLoader.microwaving; -import static gregtech.api.GregTech_API.sBlockCasings4; +import static gregtech.api.GregTech_API.sBlockCasings2; +import static gregtech.api.GregTech_API.sBlockCasings5; +import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { +public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private int powerSetting = 1000; private int timerSetting = 0; private int timerValue = 0; private boolean hasBeenPausedThiscycle=false; - private boolean flipped=false; //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"00000", "00000", "00.00", "0 0",}, - {"0---0", "0---0", "0---0", " 000 ",}, - {"0---0", "0---0", "0---0", " 000 ",}, - {"0---0", "0---0", "0---0", " 000 ",}, - {"00000", "00000", "00000", "0 0",}, - }; - private static final String[][] shapeFlipped = new String[][]{ - {shape[0][3],shape[0][2],shape[0][1],shape[0][0],}, - {shape[1][3],shape[1][2],shape[1][1],shape[1][0],}, - {shape[2][3],shape[2][2],shape[2][1],shape[2][0],}, - {shape[3][3],shape[3][2],shape[3][1],shape[3][0],}, - {shape[4][3],shape[4][2],shape[4][1],shape[4][0],}, + {E,"00000",}, + {"A000","00000","A000","\u0003","A . ",}, + {"A000","00100","A010","B1","B1","B1","B1","A 1 ",}, + {"A000","00000","A000","\u0003","A ",}, + {E,"00000",} }; - private static final Block[] blockType = new Block[]{sBlockCasings4}; - private static final byte[] blockMeta = new byte[]{1}; + private static final Block[] blockType = new Block[]{sBlockCasings5,sBlockCasings2}; + private static final byte[] blockMeta = new byte[]{0,0}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; - private static final short[] casingTextures = new short[]{49}; - private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; - private static final byte[] blockMetaFallback = new byte[]{1}; - private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "Also acts like a hopper so give it an Output Bus", - }; + private static final short[] casingTextures = new short[]{16}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasings5}; + private static final byte[] blockMetaFallback = new byte[]{0}; //endregion - public GT_MetaTileEntity_TM_microwave(int aID, String aName, String aNameRegional) { + public GT_MetaTileEntity_TM_teslaCoil(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_MetaTileEntity_TM_microwave(String aName) { + public GT_MetaTileEntity_TM_teslaCoil(String aName) { super(aName); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TM_microwave(this.mName); + return new GT_MetaTileEntity_TM_teslaCoil(this.mName); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; - }else if(aSide == GT_Utility.getOppositeSide(aFacing)) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], aActive ? Textures.BlockIcons.CASING_BLOCKS[52] : Textures.BlockIcons.CASING_BLOCKS[53]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; } @Override @@ -97,37 +72,17 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if(flipped){//some optimization - if(EM_StructureCheckAdvanced(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ - flipped=true; - return true; - } - if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ - flipped=false; - return true; - } - }else{ - if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ - flipped=false; - return true; - } - if(EM_StructureCheckAdvanced(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ - flipped=true; - return true; - } - } - return false; + return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 7, 1); } @Override public void construct(int stackSize, boolean hintsOnly) { - if((stackSize &0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); - else StructureBuilder(shapeFlipped, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilder(shape, blockType, blockMeta,2, 7, 1, getBaseMetaTileEntity(),hintsOnly); } @Override public String[] getStructureDescription(int stackSize) { - return description; + return new String[0]; } @Override @@ -136,7 +91,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock CommonValues.bassMark, "High Frequency Oven", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "From live to done in seconds!", - EnumChatFormatting.BLUE + "I said nuke the... I meant microwave supper!", + EnumChatFormatting.BLUE + "I said nuke the chinese, I meant teslaCoil supper!", }; } @@ -156,68 +111,10 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void EM_outputFunction() { - if(hasBeenPausedThiscycle) return;//skip timer and actions if paused - timerValue--; - IGregTechTileEntity mte=getBaseMetaTileEntity(); - int xDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetX*2; - int zDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetZ*2; - float xPos=mte.getXCoord()+0.5f; - float yPos=mte.getYCoord()+0.5f; - float zPos=mte.getZCoord()+0.5f; - ArrayList<ItemStack> itemsToOutput=new ArrayList<>(); - HashSet<Entity> tickedStuff=new HashSet<>(); - - AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox( - xPos-1.5+xDirShift, - yPos-(flipped?2.5:.5), - zPos-1.5+zDirShift, - xPos+1.5+xDirShift, - yPos+(flipped?.5:2.5), - zPos+1.5+zDirShift); - - int damagingFactor = powerSetting >> 9; - boolean inside=true; - - do { - for (Object entity : mte.getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb)) { - if (entity instanceof Entity) { - if(tickedStuff.add((Entity)entity)) { - if (inside && entity instanceof EntityItem) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMicrowaveRecipes.findRecipe( - mte, null, true, 128, null, null, new ItemStack[]{((EntityItem) entity).getEntityItem()}); - if (tRecipe == null || tRecipe.mInputs[0].stackSize != 1) { - itemsToOutput.add(((EntityItem) entity).getEntityItem()); - } else { - ItemStack newStuff = tRecipe.getOutput(0).copy(); - newStuff.stackSize = ((EntityItem) entity).getEntityItem().stackSize; - itemsToOutput.add(newStuff); - } - ((EntityItem) entity).delayBeforeCanPickup=2; - ((EntityItem) entity).setDead(); - } else if (entity instanceof EntityLivingBase) { - if(!GT_Utility.isWearingFullElectroHazmat((EntityLivingBase) entity)) - ((EntityLiving) entity).attackEntityFrom(microwaving, damagingFactor); - } - } - } - } - aabb.offset(0,flipped?-3:3,0); - aabb.minX-=.5f; - aabb.maxX+=.5f; - aabb.minZ-=.5f; - aabb.maxZ+=.5f; - inside=false; - damagingFactor>>=1; - } while(damagingFactor>0); - - mOutputItems=itemsToOutput.toArray(new ItemStack[0]); - if(timerValue<=0) { - mte.getWorld().playSoundEffect(xPos,yPos,zPos, Reference.MODID+":microwave_ding", 1, 1); - stopMachine(); - } } + @Override public void EM_checkParams() { if (eParamsIn[0] <= 300) @@ -275,14 +172,4 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public void doExplosion(long aExplosionPower) { explodeMultiblock(); }//Redirecting to explodemultiblock - - @Override - public byte getTileEntityBaseType() { - return 1; - } - - @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - ePowerPass=false; - } } |