diff options
author | â€huajijam <strhuaji@gmail.com> | 2019-04-19 18:29:22 +0800 |
---|---|---|
committer | â€huajijam <strhuaji@gmail.com> | 2019-04-19 18:29:22 +0800 |
commit | 399674bb9946664a880ee5e26690eb98f9aa7170 (patch) | |
tree | 7da9495cfd23b3582896428e2481afdddceb0e1b /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities | |
parent | 98649eab067e2ffd4c6983fe44f75b65ffb0954b (diff) | |
parent | 7f7eecf6a84264ca229f6b8d6759004a9a21ae5d (diff) | |
download | GT5-Unofficial-399674bb9946664a880ee5e26690eb98f9aa7170.tar.gz GT5-Unofficial-399674bb9946664a880ee5e26690eb98f9aa7170.tar.bz2 GT5-Unofficial-399674bb9946664a880ee5e26690eb98f9aa7170.zip |
Automatic synchronization
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities')
5 files changed, 89 insertions, 50 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 45a73f9e35..ef3e06086e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -18,9 +18,11 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.GTPP_MTE_BasicLosslessGenerator; -public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator{ +public class GT_MetaTileEntity_SemiFluidGenerator extends GTPP_MTE_BasicLosslessGenerator{ public static final int BASE_POLLUTION = 2; public int mEfficiency; @@ -48,7 +50,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public int getCapacity() { - return 8000; + return 4000 * this.mTier; } public void onConfigLoad() { @@ -63,6 +65,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public GT_Recipe.GT_Recipe_Map getRecipes() { + //Logger.INFO("Fuel Count: "+Gregtech_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList.size()); return Gregtech_Recipe_Map.sSemiFluidLiquidFuels; } @@ -91,12 +94,15 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public int getFuelValue(ItemStack aStack) { - if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) + if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) { + Logger.INFO("Bad Fuel?"); return 0; + } int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack)); if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); } + Logger.INFO("Good Fuel: "+rValue); return rValue; } @@ -110,7 +116,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override @@ -122,13 +128,13 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override @@ -141,7 +147,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } @Override @@ -153,13 +159,13 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index 81f594bc7e..c07fa2e927 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -1,7 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -10,8 +8,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT; - -import gtPlusPlus.core.lib.CORE; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicMachine { @@ -67,7 +64,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM @Override public int getCapacity() { - return 8000; + return 8000 * Math.max(1, this.mTier); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index e3c05a8388..3f3a276f0c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -1,13 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; -import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; 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_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -27,7 +24,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_MultiBlockBase { - private boolean mIsAnimated = true; + private boolean mIsAnimated; private static ITexture frontFace; private static ITexture frontFaceActive; private static CustomIcon GT9_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); @@ -38,10 +35,12 @@ extends GregtechMeta_MultiBlockBase { super(aID, aName, aNameRegional); frontFaceActive = new GT_RenderedTexture(GT9_5_Active); frontFace = new GT_RenderedTexture(GT9_5); + mIsAnimated = true; } public GregtechMetaTileEntity_IndustrialCentrifuge(final String aName) { super(aName); + mIsAnimated = true; } @Override @@ -59,6 +58,7 @@ extends GregtechMeta_MultiBlockBase { return new String[]{ "Controller Block for the Industrial Centrifuge", "125% faster than using single block machines of the same voltage", + "Disable animations with a screwdriver", "Only uses 90% of the eu/t normally required", "Processes six items per voltage tier", "Size: 3x3x3 (Hollow)", @@ -179,13 +179,14 @@ extends GregtechMeta_MultiBlockBase { @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - this.mIsAnimated = Utils.invertBoolean(mIsAnimated); + this.mIsAnimated = !mIsAnimated; + Logger.INFO("Is Centrifuge animated "+this.mIsAnimated); if (this.mIsAnimated) { - PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); + PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture. "); } else { - PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); - } + PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture. "); + } } @Override @@ -196,12 +197,18 @@ extends GregtechMeta_MultiBlockBase { @Override public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - mIsAnimated = aNBT.getBoolean("mIsAnimated"); + super.loadNBTData(aNBT); + if (aNBT.hasKey("mIsAnimated")) { + mIsAnimated = aNBT.getBoolean("mIsAnimated"); + } + else { + mIsAnimated = true; + } } public boolean usingAnimations() { - return mIsAnimated; + //Logger.INFO("Is animated? "+this.mIsAnimated); + return this.mIsAnimated; } private ITexture getFrontFacingTurbineTexture(boolean isActive) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index 61cfbcc5c7..7c57f799d7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -170,7 +170,7 @@ extends GregtechMeta_MultiBlockBase { } else { - if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(21), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) { + if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(21), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) { log("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); log("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; @@ -181,16 +181,9 @@ extends GregtechMeta_MultiBlockBase { else { //Dealt with inner 5x5, now deal with the exterior. //Deal with all 4 sides (Sifter walls) - boolean checkController = false; - if (((xDir + i) != 0) || (((zDir + j) != 0) && (h == 0))) {//no controller - checkController = true; - } - else { - checkController = false; - } - if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) { + boolean checkController = false; if (!checkController){ - if (!isValidBlockForStructure(null, TAE.GTPP_INDEX(21), false, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) { + if (!isValidBlockForStructure(tTileEntity, TAE.GTPP_INDEX(21), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j), ModBlocks.blockCasings2Misc, 5)) { if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){ if (h != 0){ log("Found a secondary controller at the wrong Y level."); @@ -205,10 +198,7 @@ extends GregtechMeta_MultiBlockBase { } } tAmount++; - } - else { - tAmount++; - } + } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index b77529220f..86d02eae9a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -26,10 +26,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { - /* - * public GregtechMetaEnergyBuffer() { super.this - * setCreativeTab(GregTech_API.TAB_GREGTECH); } - */ + private byte aCurrentOutputAmperage = 4; public GregtechMetaEnergyBuffer(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); @@ -41,7 +38,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription, "Accepts/Outputs 4Amp",}; + return new String[] {this.mDescription, "Defaults 4A In/Out", "Change output Amperage with a screwdriver", "Now Portable!"}; } @Override @@ -200,12 +197,12 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public long maxAmperesIn() { - return 4; + return aCurrentOutputAmperage; } @Override public long maxAmperesOut() { - return 4; + return aCurrentOutputAmperage; } @Override public int rechargerSlotStartIndex() {return 0;} @Override public int dechargerSlotStartIndex() {return 0;} @@ -216,13 +213,25 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;} @Override - public void saveNBTData(final NBTTagCompound aNBT) { - // + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); + if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) { + long aEU = this.getBaseMetaTileEntity().getStoredEU(); + if (aEU > 0){ + aNBT.setLong("aStoredEU", aEU); + if (aNBT.hasKey("aStoredEU")) { + Logger.WARNING("Set aStoredEU to NBT."); + } + } + } } @Override - public void loadNBTData(final NBTTagCompound aNBT) { - // + public void loadNBTData(final NBTTagCompound aNBT) { + aCurrentOutputAmperage = aNBT.getByte("aCurrentOutputAmperage"); + if (aNBT.hasKey("aStoredEU")) { + this.setEUVar(aNBT.getLong("aStoredEU")); + } } @Override @@ -244,6 +253,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { final double c = ((double) tempStorage / this.maxEUStore()) * 100; final double roundOff = Math.round(c * 100.00) / 100.00; PlayerUtils.messagePlayer(playerIn, "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at "+V[this.mTier]+"v ("+roundOff+"%)"); + PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesIn())+"A"); } //Utils.LOG_WARNING("Begin Show Energy"); @@ -373,6 +383,35 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) { return false; + } + + @Override + public void setItemNBT(NBTTagCompound aNBT) { + if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) { + aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); + long aEU = this.getBaseMetaTileEntity().getStoredEU(); + if (aEU > 0){ + aNBT.setLong("aStoredEU", aEU); + if (aNBT.hasKey("aStoredEU")) { + Logger.WARNING("Set aStoredEU to NBT."); + } + } + } } + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + byte aTest = (byte) (aCurrentOutputAmperage + 1); + if (aTest > 16 || aTest <= 0 ) { + aTest = 1; + } + aCurrentOutputAmperage = aTest; + PlayerUtils.messagePlayer(aPlayer, "Now handling "+aCurrentOutputAmperage+" Amps."); + } + + + + + + }
\ No newline at end of file |