diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-09-18 00:02:24 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-09-18 00:02:24 +1000 |
commit | a177ece7d75a21ac682a9bb850a4205e7dbcbd34 (patch) | |
tree | ec4cbb314e2ea6d9ddf882e68edb06c9f4d98137 /src/Java | |
parent | 42951c3b2217ba0cf349d42fab05c8227ad3e0ef (diff) | |
download | GT5-Unofficial-a177ece7d75a21ac682a9bb850a4205e7dbcbd34.tar.gz GT5-Unofficial-a177ece7d75a21ac682a9bb850a4205e7dbcbd34.tar.bz2 GT5-Unofficial-a177ece7d75a21ac682a9bb850a4205e7dbcbd34.zip |
+ Added Solar Reflector.
% Made Solar Tower more complex structure wise.
% Bumped Ticon ASM Handler.
Diffstat (limited to 'src/Java')
6 files changed, 632 insertions, 79 deletions
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java index 81e7c8f9a2..c14a4809ba 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TiConFluids.java @@ -32,7 +32,7 @@ public class ClassTransformer_TiConFluids { public ClassTransformer_TiConFluids(String aMethodName, boolean obfuscated, byte[] basicClass) { isObfuscated = obfuscated; - methodName = obfuscated ? DevHelper.getInstance().getSRG(aMethodName) : aMethodName; + methodName = obfuscated ? DevHelper.getSRG(aMethodName) : aMethodName; ClassReader aTempReader = null; ClassWriter aTempWriter = null; try { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index c74be0fe87..2f19d2933b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -380,8 +380,9 @@ public enum GregtechItemList implements GregtechItemContainer { //Basically is an automatic Cauldron SimpleDustWasher, - - + + //Solar Tower Reflector + Solar_Tower_Reflector, //Super Tier Chests Super_Chest_LV, Super_Chest_MV, Super_Chest_HV, Super_Chest_EV, Super_Chest_IV, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 1b47012038..c530c6c360 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -73,7 +73,7 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); //Material Press Casings case 4: - return TexturesGtBlock.Casing_Material_Grisium.getIcon(); + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); //Sifter Structural case 5: return TexturesGtBlock.Casing_Material_Stellite.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java index 1032afa011..0c4685c33f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java @@ -4,7 +4,6 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -13,13 +12,10 @@ 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 gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -74,10 +70,10 @@ extends GregtechMeta_MultiBlockBase { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == 0 || aSide == 1) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 1)], + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(3, 6)], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 1)]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(3, 6)]}; } @Override @@ -102,10 +98,10 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(final ItemStack aStack) { - //this.mEfficiencyIncrease = 100; - //this.mMaxProgresstime = 100; - //this.mEUt = -4; - return true; + //this.mEfficiencyIncrease = 100; + //this.mMaxProgresstime = 100; + //this.mEUt = -4; + return true; } @Override @@ -113,17 +109,15 @@ extends GregtechMeta_MultiBlockBase { this.sendLoopStart((byte) 1); } - @SuppressWarnings("deprecation") @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - - for (int i = 0; i < 18; i++) { + + for (int i = 0; i < 19; i++) { if (!checkLayer(i)) { Logger.INFO("Invalid Structure on Y level "+i); return false; } } - if (mMaintenanceHatches.size() != 1) { Logger.INFO("Bad Hatches"); return false; @@ -193,8 +187,8 @@ extends GregtechMeta_MultiBlockBase { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); if (this.mHeight > 3) {} - - + + } @Override @@ -208,102 +202,283 @@ extends GregtechMeta_MultiBlockBase { super.loadNBTData(aNBT); mHeight = aNBT.getInteger("mHeight"); } - + public boolean checkLayer(int aY) { - if (aY >= 0 && aY <= 4) { + if (aY >= 0 && aY <= 6) { return checkTopLayers(-aY); } - if (aY >= 5 && aY <= 14) { + if (aY >= 7 && aY <= 16) { return checkTowerLayer(-aY); } - else if (aY >= 15 && aY <= 17) { + else if (aY >= 17 && aY <= 19) { return checkBaseLayer(-aY); - } + } Logger.INFO("Bad Y level to check"); return false; } - + public boolean checkTopLayers(int aY) { Block aBlock; int aMeta; + if (aY == 0) { - for (int x = -2; x < 2; x++) { - for (int z = -2; z < 2; z++) { + return true; + } else if (aY == -1) { + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - if (x != 0 && z != 0) { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { + if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { + continue; + } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + } + } + } else if (aY == -2 || aY == -6) { + for (int x = -2; x <= 2; x++) { + for (int z = -2; z <= 2; z++) { + aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); + aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); + //Edge Casing + if (x == -2 || x == 2 || z == -2 || z == 2) { + //Edge Corners + if ((x == 2 || x == -2) && (z == 2 | z == -2)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + else { + continue; + } + } + else { + //Edge Sides + if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { + continue; + } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + } + } + + //Internal + else { + if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { continue; } else { - Logger.INFO("Found Bad Block on Top Layer: "+(aBlock != null ? aBlock.getLocalizedName() : "Air")); + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); return false; } - } - else { - continue; - } + } } } - } else if (aY > 0 && aY < 4) { - for (int x = -2; x < 2; x++) { - for (int z = -2; z < 2; z++) { + } + //Top Layers 7x7 + else if (aY == -3 || aY == -5) { + for (int x = -3; x <= 3; x++) { + for (int z = -3; z <= 3; z++) { aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - if (x != -2 || x == 2 || z == -2 || z == 2) { + aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); + //Edge Casing + if (x == -3 || x == 3 || z == -3 || z == 3) { + + //3, 3 + //2, 3 + //3, 2 + + //Air Spacing + if (x == 3 && (z == -3 || z == -2 || z == 2 || z == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + else { + continue; + } + } + else if (x == -3 && (z == -3 || z == -2 || z == 2 || z == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + else { + continue; + } + } + else if (z == 3 && (x == -3 || x == -2 || x == 2 || x == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + else { + continue; + } + } + else if (z == -3 && (x == -3 || x == -2 || x == 2 || x == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + else { + continue; + } + } + else { + //Edge Sides + if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { + continue; + } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + } + } + else if ((x == -2 || x == 2) & (z == -2 || z == 2)) { if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { continue; } else { - Logger.INFO("Found Bad Block on Exterior of Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); return false; } - } else { + } + //Internal + else { if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { continue; } else { - Logger.INFO("Found Bad Block on Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); return false; } + } + } + } + } + //Midle Top Layer 9x9 + else if (aY == -4) { + //Check Inner 5x5 + for (int x = -2; x <= 2; x++) { + for (int z = -2; z <= 2; z++) { + if (getBaseMetaTileEntity().getBlockOffset(x, aY, z) != getCasingBlock() && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z) != getCasingMeta2()) { + Logger.INFO("Error at offset: X:" + x + ", Y:" + aY + ", Z:" + z); + return false; } + else { + continue; + } + } + } + //Check Pos Sides + for (int z = -1; z <= -1; z++) { + if (getBaseMetaTileEntity().getBlockOffset(3, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(3, aY, z) == getCasingMeta2()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(-3, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(-3, aY, z) == getCasingMeta2()) { + continue; + } else { + Logger.INFO("1 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); + return false; } + } - } else if (aY == 4) { - for (int x = -2; x < 2; x++) { - for (int z = -2; z < 2; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - - if (x == 0 && z == 0) { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { - continue; - } - else { - return false; - } + for (int x = -1; x <= -1; x++) { + if (getBaseMetaTileEntity().getBlockOffset(x, aY, 3) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 3) == getCasingMeta2()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -3) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -3) == getCasingMeta2()) { + continue; + } else { + Logger.INFO("1 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); + return false; + } + } + + //Corner Casings + for (int z = -2; z <= -2; z++) { + if (z == -2 || z == 2) { + if (getBaseMetaTileEntity().getBlockOffset(3, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(3, aY, z) == getCasingMeta3()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(-3, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(-3, aY, z) == getCasingMeta3()) { + continue; + } else { + Logger.INFO("2 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); + return false; } - - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { + } + } + for (int x = -2; x <= -2; x++) { + if (x == -2 || x == 2) { + if (getBaseMetaTileEntity().getBlockOffset(x, aY, 3) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 3) == getCasingMeta3()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -3) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -3) == getCasingMeta3()) { continue; } else { - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + Logger.INFO("2 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); return false; } } } + //Check Sides Casings + for (int z = -1; z <= -1; z++) { + if (getBaseMetaTileEntity().getBlockOffset(4, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(4, aY, z) == getCasingMeta3()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(-4, aY, z) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(-4, aY, z) == getCasingMeta3()) { + continue; + } else { + Logger.INFO("1 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); + return false; + } + + } + for (int x = -1; x <= -1; x++) { + if (getBaseMetaTileEntity().getBlockOffset(x, aY, 4) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 4) == getCasingMeta3()) { + continue; + } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -4) == getCasingBlock() + && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -4) == getCasingMeta3()) { + continue; + } else { + Logger.INFO("1 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); + return false; + } + } } return true; } - + public boolean checkTowerLayer(int aY) { Block aBlock; int aMeta; - for (int x = -1; x < 1; x++) { - for (int z = -1; z < 1; z++) { + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); if (x == -1 || x == 1 || z == -1 || z == 1) { if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { continue; } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); Logger.INFO("Found Bad Block Externally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); return false; } @@ -311,6 +486,7 @@ extends GregtechMeta_MultiBlockBase { if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { continue; } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); return false; } @@ -319,28 +495,80 @@ extends GregtechMeta_MultiBlockBase { } return true; } - + public boolean checkBaseLayer(int aY) { Block aBlock; - int aMeta; - for (int x = -2; x < 2; x++) { - for (int z = -1; z < 1; z++) { + int aMeta; + + int requiredMeta = getCasingMeta2(); + if (aY == 19) { + requiredMeta = getCasingMeta(); + } + + for (int x = -3; x <= 3; x++) { + for (int z = -3; z <= 3; z++) { aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { - continue; - } else { - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (addToMachineList(tTileEntity, mCasingTextureID)) { - continue; - } - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; + aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); + + if ((x == 3 && z == 3) || (x == 2 && z == 2) || (x == 3 && z == 2) || (x == 2 && z == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + return false; + } + } + else if ((x == -3 && z == -3) || (x == -2 && z == -2) || (x == -3 && z == -2) || (x == -2 && z == -3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + return false; + } + } + else if ((x == -3 && z == 3) || (x == -2 && z == 2) || (x == -3 && z == 2) || (x == -2 && z == 3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + return false; + } + } + else if ((x == 3 && z == -3) || (x == 2 && z == -2) || (x == 3 && z == -2) || (x == 2 && z == -3)) { + if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + return false; + } + } + else { + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); + if (addToMachineList(tTileEntity, mCasingTextureID)) { + continue; + } + if (x == 0 && z == 0) { + if (aBlock == getCasingBlock() && aMeta == requiredMeta) { + continue; + } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + } + else { + if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { + continue; + } else { + Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); + Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); + return false; + } + } } } } return true; } - - + + + + + + + + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java new file mode 100644 index 0000000000..78d04bfa43 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java @@ -0,0 +1,315 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.misc; + +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.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock { + + private GregtechMetaTileEntity_SolarTower mSolarTower; + private Integer mTX, mTY, mTZ; + private Byte mRequiredFacing; + private boolean mHasTower = false; + + public TileEntitySolarHeater(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { + super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); + } + + public TileEntitySolarHeater(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { + super(aName, aTier, aSlotCount, aDescription, aTextures); + } + + @Override + public String[] getDescription() { + return new String[] { + this.mDescription, + "Point me at a Solar Tower", + CORE.GT_Tooltip }; + } + + @Override + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + final ITexture[][][] rTextures = new ITexture[10][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][i + 1] = this.getFront(i); + rTextures[1][i + 1] = this.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFrontActive(i); + rTextures[6][i + 1] = this.getBackActive(i); + rTextures[7][i + 1] = this.getBottomActive(i); + rTextures[8][i + 1] = this.getTopActive(i); + rTextures[9][i + 1] = this.getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + } + + public ITexture[] getFrontActive(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + } + + public ITexture[] getBackActive(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + } + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + } + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; + } + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return null; + } + + @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; + } + + @Override + public String[] getInfoData() { + return new String[] { + this.getLocalName(), + "Testificate" + }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) { + return false; + } + + public boolean allowCoverOnSide(final byte aSide, final int aCoverID) { + return false; + } + + @Override + public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { + return new int[] {}; + } + + @Override + public int getSizeInventory() { + return 0; + } + + @Override + public ItemStack getStackInSlot(final int p_70301_1_) { + return null; + } + + @Override + public long maxEUStore() { + return 0; + } + + @Override + public int getCapacity() { + return 0; + } + + @Override + public long maxEUInput() { + return 0; + } + + @Override + public long maxEUOutput() { + return 0; + } + + @Override + public long maxAmperesIn() { + return 0; + } + + @Override + public long maxAmperesOut() { + return 0; + } + + @Override + public boolean isElectric() { + return false; + } + + @Override + public boolean isValidSlot(final int aIndex) { + return false; + } + + @Override + public boolean isFacingValid(final byte aFacing) { + return aFacing >= 2; + } + + @Override + public boolean isEnetInput() { + return false; + } + + @Override + public boolean isEnetOutput() { + return false; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("mHasTower", mHasTower); + if (mHasTower && mTX != null && mTY != null && mTZ != null) { + aNBT.setInteger("mTX", mTX); + aNBT.setInteger("mTY", mTY); + aNBT.setInteger("mTZ", mTZ); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + this.mHasTower = aNBT.getBoolean("mHasTower"); + if (this.mHasTower) { + if (aNBT.hasKey("mTX")) + this.mTX = aNBT.getInteger("mTX"); + if (aNBT.hasKey("mTY")) + this.mTY = aNBT.getInteger("mTY"); + if (aNBT.hasKey("mTZ")) + this.mTZ = aNBT.getInteger("mTZ"); + } + } + + @Override + public long getInputTier() { + return 0; + } + + @Override + public long getOutputTier() { + return 0; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return false; + } + + @Override + public void onExplosion() { + + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (this.mSolarTower != null) { + if (!mHasTower) { + this.mTX = mSolarTower.getBaseMetaTileEntity().getXCoord(); + this.mTY = (int) mSolarTower.getBaseMetaTileEntity().getYCoord(); + this.mTZ = mSolarTower.getBaseMetaTileEntity().getZCoord(); + //this.mRequiredFacing = null; + this.mHasTower = true; + } + } + else { + if (mTX != null || mTY != null || mTZ != null || mRequiredFacing != null) { + this.mTX = null; + this.mTY = null; + this.mTZ = null; + this.mRequiredFacing = null; + this.mHasTower = false; + } + } + } + + @Override + public void onRemoval() { + super.onRemoval(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide > 1; + } + + @Override + public boolean isInputFacing(byte aSide) { + return false; + } + + @Override + public long getMinimumStoredEU() { + return 0; + } + + @Override + public void onFacingChange() { + super.onFacingChange(); + } + + @Override + public void doExplosion(long aExplosionPower) { + + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java index e9c5f3cfad..1ea1339755 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; +import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; public class GregtechSolarTower { @@ -17,6 +18,14 @@ public class GregtechSolarTower { private static void run1() { // Solar Tower GregtechItemList.Industrial_Solar_Tower.set(new GregtechMetaTileEntity_SolarTower(863, "solartower.controller.tier.single", "Solar Tower").getStackForm(1L)); - + GregtechItemList.Solar_Tower_Reflector.set( + new TileEntitySolarHeater( + 864, + "solarreflector.simple.single", + "Solar Reflector", + 8, + "Part of the Clean Green energy movement", + 0).getStackForm(1L)); + } }
\ No newline at end of file |