From f480dbdd4b4750e966900f942a9dbad65202ec8b Mon Sep 17 00:00:00 2001 From: Alkalus Date: Wed, 15 Nov 2017 06:35:52 +1000 Subject: ^ Version bump. --- src/Java/gtPlusPlus/core/lib/CORE.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 95c4c7e84a..e9cddfecb8 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -35,7 +35,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.6.70-release"; + public static final String VERSION = "1.6.90-release"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); -- cgit From 2cbc0ee9f27bc1d2a21d44d1b4a0c248a315c316 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Wed, 15 Nov 2017 10:26:36 +1000 Subject: + Added Wireless Chargers. > These are a basic design-only implementation for reference, so they may never be completed and are more of a proof of concept. --- build.gradle | 2 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + src/Java/gtPlusPlus/core/lib/CORE.java | 2 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 7 +- .../basic/GregtechMetaWirelessCharger.java | 455 +++++++++++++++++++++ .../gregtech/GregtechWirelessChargers.java | 41 ++ src/resources/mcmod.info | 2 +- 7 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/build.gradle b/build.gradle index 244c177ce0..efbc8c0232 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 archivesBaseName = "GT-PlusPlus" -version = "1.6.90-release" +version = "1.6.91-release" minecraft.version = "1.7.10-10.13.4.1448-1.7.10" diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 788d011733..23b2ad8e1a 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -97,6 +97,7 @@ public class COMPAT_HANDLER { GregtechIndustrialWashPlant.run(); GregtechSemiFluidgenerators.run(); GregtechAdvancedMixer.run(); + GregtechWirelessChargers.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index e9cddfecb8..71119ee00e 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -35,7 +35,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.6.90-release"; + public static final String VERSION = "1.6.91-release"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index e4da291b17..6a797d9ce0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -255,7 +255,12 @@ public enum GregtechItemList implements GregtechItemContainer { //Custom hatches Hatch_Input_Battery_MV, Hatch_Input_Battery_EV, - Hatch_Output_Battery_MV, Hatch_Output_Battery_EV, + Hatch_Output_Battery_MV, Hatch_Output_Battery_EV, + + //Wireless Chargers + Charger_LV, Charger_MV, Charger_HV, + Charger_EV, Charger_IV, Charger_LuV, + Charger_ZPM, Charger_UV, Charger_MAX, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java new file mode 100644 index 0000000000..7239dc41ac --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -0,0 +1,455 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import gregtech.api.enums.GT_Values; +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_Utility; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.array.BlockPos; +import gtPlusPlus.core.util.entity.EntityUtils; +import gtPlusPlus.core.util.player.PlayerUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { + + public GregtechMetaWirelessCharger(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 GregtechMetaWirelessCharger(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, + "3 Modes, Long-Range, Local and Mixed.", + "Long-Range: Can supply 2A of power to a single player upto "+(this.mTier*4)+"m away.", + "Local: Can supply 1A to each player within 50m.", + "Mixed: Provides both 2A of long range and 1A per player locally.", + "Mixed mode is more conservative of power and as a result only", + "gets half the distances each singular mode gets.", + 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[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)}; + } + + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getFrontActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2)}; + } + + + public ITexture[] getBackActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier+3][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (this.mMode >= 2){ + this.mMode = 0; + } + else { + this.mMode++; + } + if (this.mMode == 0){ + PlayerUtils.messagePlayer(aPlayer, "Now in Long-Range Mode."); + } + else if (this.mMode == 1){ + PlayerUtils.messagePlayer(aPlayer, "Now in Local Charge Mode."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Now in Mixed Mode."); + } + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaWirelessCharger(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isValidSlot(final int aIndex) {return true;} + @Override public boolean isFacingValid(final byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isEnetOutput() {return false;} + @Override public boolean isInputFacing(final byte aSide) {return aSide!=this.getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isOutputFacing(final byte aSide) {return aSide==this.getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return 0;} + @Override public long maxEUStore() {return GT_Values.V[this.mTier]*32;} + + @Override + public int getCapacity() { + return (int) (GT_Values.V[this.mTier]*32); + } + + @Override + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxEUOutput() { + return 0; + } + + @Override + public long maxAmperesIn() { + if (this.mMode == 0){ + return 2; + } + else if (this.mMode == 1){ + return this.mLocalChargingMap.size(); + } + else { + return (this.mLocalChargingMap.size()+this.mWirelessChargingMap.size()); + } + } + + @Override + public long maxAmperesOut() { + return 0; + } + @Override public int rechargerSlotStartIndex() {return 0;} + @Override public int dechargerSlotStartIndex() {return 0;} + @Override public int rechargerSlotCount() {return 0;} + @Override public int dechargerSlotCount() {return 0;} + @Override public int getProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyStored();} + @Override public int maxProgresstime() {return (int)this.getBaseMetaTileEntity().getUniversalEnergyCapacity();} + @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;} + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) + { + return true; + } + return true; + } + + public int mMode = 0; + + @Override + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + return false; + } + + @Override + public String[] getInfoData() { + return new String[] { + this.getLocalName()}; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { + return null; + } + + @Override + public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) { + return false; + } + + @Override + public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { + return false; + } + + @Override + public int getSizeInventory() { + return 0; + } + + @Override + public ItemStack getStackInSlot(final int p_70301_1_) { + return null; + } + + @Override + public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) { + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int p_70304_1_) { + return null; + } + + @Override + public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) { + } + + @Override + public String getInventoryName() { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 0; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) { + return false; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) { + return false; + } + + @Override + public boolean isOverclockerUpgradable() { + return false; + } + + @Override + public boolean isTransformerUpgradable() { + return false; + } + + @Override + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setInteger("mMode", this.mMode); + } + + @Override + public void loadNBTData(final NBTTagCompound aNBT) { + this.mMode = aNBT.getInteger("mMode"); + } + + @Override + public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { + if (this.getBaseMetaTileEntity().isServerSide()) { + + } + } + + + private Map mWirelessChargingMap = new HashMap(); + private Map mLocalChargingMap = new HashMap(); + + @Override + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (this.getBaseMetaTileEntity().isServerSide()) { + + + if (aTick % 20 == 0){ + if (!aBaseMetaTileEntity.getWorld().playerEntities.isEmpty()){ + for (Object mTempPlayer : aBaseMetaTileEntity.getWorld().playerEntities){ + if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){ + EntityPlayer mTemp = (EntityPlayer) mTempPlayer; + + if (this.mMode == 1 || this.mMode == 2){ + int tempRange = (this.mMode == 1 ? 50 : 25); + if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ + if (!mLocalChargingMap.containsKey(mTemp.getPersistentID())){ + if (mLocalChargingMap.put(mTemp.getPersistentID(), mTemp) != null){ + PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m]."); + } + } + + } + else { + if (mLocalChargingMap.containsKey(mTemp.getPersistentID())){ + if (mLocalChargingMap.remove(mTemp.getPersistentID()) != null){ + PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m]."); + } + } + } + } + if (this.mMode == 0 || this.mMode == 2){ + int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); + if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ + if (!mWirelessChargingMap.containsKey(mTemp)){ + if (mWirelessChargingMap.put(mTemp, mTemp.getPersistentID()) != null){ + PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m]."); + } + } + + } + else { + if (mWirelessChargingMap.containsKey(mTemp)){ + if (mWirelessChargingMap.remove(mTemp) != null){ + PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m]."); + } + } + } + } + + } + } + } + } + + + } + } + + private BlockPos getTileEntityPosition(){ + return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); + } + + private BlockPos getPositionOfEntity(Entity mEntity){ + if (mEntity == null){ + return null; + } + return EntityUtils.findBlockPosUnderEntity(mEntity); + } + + private double getDistanceBetweenTwoPositions(BlockPos objectA, BlockPos objectB){ + int[] objectArray1 = new int[]{objectA.xPos, objectA.yPos, objectA.zPos}; + int[] objectArray2 = new int[]{objectB.xPos, objectB.yPos, objectB.zPos}; + if (objectA == null || objectB == null){ + return 0f; + } + final double distance = Math.sqrt( + (objectArray2[0]-objectArray1[0])*(objectArray2[0]-objectArray1[0]) + +(objectArray2[1]-objectArray1[1])*(objectArray2[1]-objectArray1[1]) + +(objectArray2[2]-objectArray1[2])*(objectArray2[2]-objectArray1[2])); + return distance; + } + + @Override + public void onRemoval() { + mWirelessChargingMap.clear(); + super.onRemoval(); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, + EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + + int tempRange; + + if (this.mMode == 0 || this.mMode == 2){ + tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); + } + else { + tempRange = 50; + } + + if (this.mMode == 2){ + PlayerUtils.messagePlayer(aPlayer, "Mixed Mode | Local: 25m | Long: "+tempRange); + } + else if (this.mMode == 1){ + PlayerUtils.messagePlayer(aPlayer, "Local Mode: 50m"); + + } + else { + PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: "+tempRange+"m"); + + } + + return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); + } + + @Override + public void onServerStart() { + mWirelessChargingMap.clear(); + super.onServerStart(); + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java new file mode 100644 index 0000000000..f23dc3ab3d --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java @@ -0,0 +1,41 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaWirelessCharger; +import net.minecraft.item.ItemStack; + +public class GregtechWirelessChargers { + + + public static void run(){ + + long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; + int mID = 890; + + GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.01.tier.single", + "Wireless Charger MK I", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.02.tier.single", + "Wireless Charger MK II", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.03.tier.single", + "Wireless Charger MK III", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.04.tier.single", + "Wireless Charger MK IV", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.05.tier.single", + "Wireless Charger MK V", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.06.tier.single", + "Wireless Charger MK VI", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger(mID++, "wificharger.07.tier.single", + "Wireless Charger MK VII", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.08.tier.single", + "Wireless Charger MK VIII", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger(mID++, "wificharger.09.tier.single", + "Wireless Charger MK IX", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + + } + +} diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info index 898bf3b265..68f69d5530 100644 --- a/src/resources/mcmod.info +++ b/src/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Adds a few various Multiblocks, Machines, etc to Gregtech and a plethora of other mods (Nearly 30!)", "credits": "", "logoFile": "", - "version": "1.6.90-release", + "version": "1.6.91-release", "mcversion": "1.7.10", "url": "https://github.com/draknyte1/GTplusplus/wiki", "updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest", -- cgit From 94389c154e4d517e4fcdebdacc3da9be414e8c75 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 17 Nov 2017 10:58:02 +1000 Subject: + Added the Cutting Factory Multiblock. + Added a config for the Cutting Factory. % Hid Generator Array Logging. --- src/Java/gregtech/api/util/ThermalFuel.java | 43 ++++ .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 3 +- src/Java/gtPlusPlus/core/lib/CORE.java | 2 + .../xmod/gregtech/api/enums/GregtechItemList.java | 7 +- .../common/blocks/GregtechMetaCasingBlocks2.java | 4 +- .../blocks/textures/CasingTextureHandler2.java | 2 +- .../GregtechMetaTileEntityGeneratorArray.java | 20 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 254 +++++++++++++++++++++ .../gregtech/GregtechIndustrialCuttingFactory.java | 25 ++ 9 files changed, 344 insertions(+), 16 deletions(-) create mode 100644 src/Java/gregtech/api/util/ThermalFuel.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/src/Java/gregtech/api/util/ThermalFuel.java b/src/Java/gregtech/api/util/ThermalFuel.java new file mode 100644 index 0000000000..4f6637e13f --- /dev/null +++ b/src/Java/gregtech/api/util/ThermalFuel.java @@ -0,0 +1,43 @@ +package gregtech.api.util; + +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraftforge.fluids.FluidStack; + +public class ThermalFuel { + + public static void addThermalFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int euValue, int aSpecialValue) { + GT_Recipe x = new GT_Recipe( + true, + null, + null, + null, + null, + new FluidStack[]{aInput1, aInput2}, + new FluidStack[]{aOutput1}, + 20, //1 Tick + euValue, //No Eu produced + aSpecialValue //Magic Number + ); + Recipe_GT.Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(x); + } + + public static void addSteamTurbineFuel(FluidStack aInput1) { + GT_Recipe x = new GT_Recipe( + true, + null, + null, + null, + null, + new FluidStack[]{aInput1}, + null, + 20, //1 Tick + MathUtils.findPercentageOfInt((aInput1.amount/2), 95), //No Eu produced + 0 //Magic Number + ); + Recipe_GT.Gregtech_Recipe_Map.sSteamTurbineFuels.addRecipe(x); + } + + + + +} diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index c59798ce21..e504e16761 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -98,7 +98,8 @@ public class COMPAT_HANDLER { GregtechAdvancedMixer.run(); GregtechWirelessChargers.run(); GregtechIndustrialGeneratorArray.run(); - + GregtechIndustrialCuttingFactory.run(); + //New Horizons Content NewHorizonsAccelerator.run(); } diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 71119ee00e..6cb37837aa 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -164,6 +164,7 @@ public class CORE { public static boolean enableMultiblock_IndustrialWashPlant = true; public static boolean enableMultiblock_LargeAutoCrafter = true; public static boolean enableMultiblock_ThermalBoiler = true; + public static boolean enableMultiblock_IndustrialCuttingMachine = true; //Visuals public static boolean enableTreeFarmerParticles = true; @@ -171,6 +172,7 @@ public class CORE { + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 7d413a9796..fbffa4adf1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -173,7 +173,7 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Autocrafter, - Casing_PlaceHolder13, + Casing_CuttingFactoryFrame, Casing_PlaceHolder14, Casing_PlaceHolder15, @@ -263,7 +263,10 @@ public enum GregtechItemList implements GregtechItemContainer { Charger_ZPM, Charger_UV, Charger_MAX, //Generator Array - Generator_Array_Controller, + Generator_Array_Controller, + + //Cutting Factory Controller + Industrial_CuttingFactoryController, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index afce39b5d9..51a2c208e6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -32,7 +32,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Autocrafter Frame"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Placeholder Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Placeholder Casing "); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Casing "); GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0)); @@ -48,7 +48,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10)); GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); - GregtechItemList.Casing_PlaceHolder13.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); GregtechItemList.Casing_PlaceHolder14.set(new ItemStack(this, 1, 14)); GregtechItemList.Casing_PlaceHolder15.set(new ItemStack(this, 1, 15)); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java index 82b2da069c..af9edb3e0c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -50,7 +50,7 @@ public class CasingTextureHandler2 { return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); //Reactor Casing II case 13: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.Casing_Machine_Ultra.getIcon(); case 14: return TexturesGtBlock._PlaceHolder.getIcon(); case 15: diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java index e6c82e203b..3923f65f29 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java @@ -138,32 +138,32 @@ public class GregtechMetaTileEntityGeneratorArray extends GT_MetaTileEntity_Mult if(!mMachine.equals(mInventory[1].getUnlocalizedName()))mLastRecipe=null; mMachine = mInventory[1].getUnlocalizedName(); - Utils.LOG_INFO("mMachine: "+mMachine); + Utils.LOG_WARNING("mMachine: "+mMachine); ArrayList tFluids = getStoredFluids(); Collection tRecipeList = this.getRecipeMap().mRecipeList; - Utils.LOG_INFO("tRecipeList: "+tRecipeList); + Utils.LOG_WARNING("tRecipeList: "+tRecipeList); if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel? - Utils.LOG_INFO("1"); + Utils.LOG_WARNING("1"); for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches - Utils.LOG_INFO("2"); + Utils.LOG_WARNING("2"); for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes - Utils.LOG_INFO("3"); + Utils.LOG_WARNING("3"); /*if (aFuel != null){ for (FluidStack x : aFuel.mFluidInputs){ if (x != null){ - Utils.LOG_INFO("Recipe: "+x.getLocalizedName()); + Utils.LOG_WARNING("Recipe: "+x.getLocalizedName()); } } }*/ FluidStack tLiquid; tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], aFuel.mFluidInputs[0].amount); - Utils.LOG_INFO("5"); + Utils.LOG_WARNING("5"); fuelConsumption = aFuel.mFluidInputs[0].amount; if(depleteInput(tLiquid)) { //Deplete that amount - Utils.LOG_INFO("6"); + Utils.LOG_WARNING("6"); boostEu = true; - Utils.LOG_INFO("7"); + Utils.LOG_WARNING("7"); fuelValue = aFuel.mEUt*aFuel.mDuration; fuelRemaining = hatchFluid1.amount; //Record available fuel @@ -171,7 +171,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GT_MetaTileEntity_Mult //this.mProgresstime = 1; this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 9500; - Utils.LOG_INFO("9"); + Utils.LOG_WARNING("9"); return true; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java new file mode 100644 index 0000000000..ad1b9cc635 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -0,0 +1,254 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +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; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialCuttingMachine +extends GregtechMeta_MultiBlockBase { + public GregtechMetaTileEntity_IndustrialCuttingMachine(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialCuttingMachine(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialCuttingMachine(this.mName); + } + + @Override + public String[] getDescription() { + return new String[]{ + "Controller Block for the Industrial Cutting Factory", + "60% faster than using single block machines of the same voltage", + "Size: 3x3x5 [WxHxL] (Hollow)", "Controller (front centered)", + "2x Input Bus (side centered)", + "2x Output Bus (side centered)", + "1x Energy Hatch (top or bottom centered)", + "1x Input Hatch (top or bottom centered)", + "1x Maintenance Hatch (back centered)", + "Cutting Factory Frames for the rest (32 at least!)", + CORE.GT_Tooltip + }; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(29)], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(29)]}; + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "WireFactory.png"); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sCutterRecipes; + } + + @Override + public boolean isFacingValid(final byte aFacing) { + return aFacing > 1; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + final ArrayList tInputList = this.getStoredInputs(); + final ArrayList tFluidList = this.getStoredFluids(); + for (final ItemStack tInput : tInputList) { + for (final FluidStack tFluid : tFluidList) { + final long tVoltage = this.getMaxInputVoltage(); + final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCutterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluid}, new ItemStack[]{tInput}); + //tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 60F); + if (tRecipe != null) { + + //More than or one input + if (tInputList.size() > 0) { + + if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{tFluid}, new ItemStack[]{tInput})) { + this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << (tTier - 1))); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + ItemStack[] mOutputStacks = new ItemStack[9]; + for (int i=0;i<9;i++){ + if (tRecipe.getOutput(i) != null){ + mOutputStacks[i] = tRecipe.getOutput(i); + } + } + this.mOutputItems = mOutputStacks.clone(); + //this.updateSlots(); + return true; + } + } + } + } + } + return false; + } + + @Override + public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + final byte tSide = this.getBaseMetaTileEntity().getBackFacing(); + if ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) { + int tAirCount = 0; + for (byte i = -1; i < 2; i = (byte) (i + 1)) { + for (byte j = -1; j < 2; j = (byte) (j + 1)) { + for (byte k = -1; k < 2; k = (byte) (k + 1)) { + if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { + tAirCount++; + } + } + } + } + if (tAirCount != 10) { + Utils.LOG_INFO("False 1"); + return false; + } + for (byte i = 2; i < 6; i = (byte) (i + 1)) { + IGregTechTileEntity tTileEntity; + if ((null != (tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && + (tTileEntity.getFrontFacing() == this.getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && + ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCuttingMachine))) { + //Utils.LOG_INFO("False 1"); + return false; + } + } + final int tX = this.getBaseMetaTileEntity().getXCoord(); + final int tY = this.getBaseMetaTileEntity().getYCoord(); + final int tZ = this.getBaseMetaTileEntity().getZCoord(); + for (byte i = -1; i < 2; i = (byte) (i + 1)) { + for (byte j = -1; j < 2; j = (byte) (j + 1)) { + if ((i != 0) || (j != 0)) { + for (byte k = 0; k < 5; k = (byte) (k + 1)) { + if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { + if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { + } + else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { + Utils.LOG_INFO("False 2"); + return false; + } + } + else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { + } + else { + Utils.LOG_INFO("False 3"); + return false; + } + } + } + } + } + if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() < 0)) { + Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output."); + return false; + } + if ((this.mInputBusses.size() != 2) || (this.mOutputBusses.size() != 2)) { + Utils.LOG_INFO("Incorrect amount of Input & Output busses."); + return false; + } + this.mMaintenanceHatches.clear(); + final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 4); + if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { + if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) { + this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); + ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); + } else { + Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back."); + return false; + } + } + if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { + Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches."); + return false; + } + } else { + Utils.LOG_INFO("False 5"); + return false; + } + Utils.LOG_INFO("True"); + return true; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return 80; + } + + @Override + public int getAmountOfOutputs() { + return 2; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + public Block getCasingBlock() { + return ModBlocks.blockCasings2Misc; + } + + + public byte getCasingMeta() { + return 13; + } + + + public byte getCasingTextureIndex() { + return (byte) TAE.GTPP_INDEX(29); + } + + private boolean addToMachineList(final IGregTechTileEntity tTileEntity) { + return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))); + } + + private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) { + return ((this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex()))); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java new file mode 100644 index 0000000000..11d8b400d0 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java @@ -0,0 +1,25 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialCuttingMachine; + +public class GregtechIndustrialCuttingFactory { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Cutting Factory Multiblock."); + if (CORE.configSwitches.enableMultiblock_IndustrialCuttingMachine) { + run1(); + } + } + } + + private static void run1() { + // Industrial Wire Factory Multiblock + GregtechItemList.Industrial_CuttingFactoryController.set(new GregtechMetaTileEntity_IndustrialCuttingMachine(992, + "industrialcuttingmachine.controller.tier.01", "Cutting Factory Controller").getStackForm(1L)); + + } +} \ No newline at end of file -- cgit From 4487354c88d814123e1374198d96275ac8c85406 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 17 Nov 2017 15:54:35 +1000 Subject: ^ Version Bump. % Tweaked SFR side texture when active. --- build.gradle | 2 +- src/Java/gtPlusPlus/core/lib/CORE.java | 2 +- .../machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java | 2 +- src/resources/mcmod.info | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/build.gradle b/build.gradle index efbc8c0232..1321368c96 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 archivesBaseName = "GT-PlusPlus" -version = "1.6.91-release" +version = "1.6.93-release" minecraft.version = "1.7.10-10.13.4.1448-1.7.10" diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 6cb37837aa..cdccd4164f 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -35,7 +35,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.6.91-release"; + public static final String VERSION = "1.6.93-release"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java index b604eb94a2..2572f36372 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java @@ -399,7 +399,7 @@ GT_MetaTileEntity_DeluxeMachine { public ITexture[] getSides(final byte aColor) { return new ITexture[]{this.getCasingTexture(), new GT_RenderedTexture( - TexturesGtBlock.Overlay_Machine_Dimensional_Blue)}; + TexturesGtBlock.Overlay_Machine_Dimensional_Orange)}; } public ITexture[] getFrontActive(final byte aColor) { diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info index 68f69d5530..032322a414 100644 --- a/src/resources/mcmod.info +++ b/src/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Adds a few various Multiblocks, Machines, etc to Gregtech and a plethora of other mods (Nearly 30!)", "credits": "", "logoFile": "", - "version": "1.6.91-release", + "version": "1.6.93-release", "mcversion": "1.7.10", "url": "https://github.com/draknyte1/GTplusplus/wiki", "updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest", -- cgit From e8fa34d3ba219a21bcce0cdb07ede8dcdfe9dcb9 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 17 Nov 2017 18:38:00 +1000 Subject: $ Fixed capes. My bad. + Added new textures for capes. ^ Version bump. --- build.gradle | 2 +- src/Java/gtPlusPlus/core/lib/CORE.java | 2 +- .../xmod/gregtech/common/render/GTPP_CapeRenderer.java | 12 ++++++------ src/resources/assets/miscutils/textures/DevCapeHD.png | Bin 0 -> 12011 bytes src/resources/assets/miscutils/textures/FancyCapeHD.png | Bin 0 -> 9643 bytes src/resources/assets/miscutils/textures/OrangeHD.png | Bin 0 -> 7652 bytes .../assets/miscutils/textures/TesterCapeHD.png | Bin 0 -> 8215 bytes src/resources/mcmod.info | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 src/resources/assets/miscutils/textures/DevCapeHD.png create mode 100644 src/resources/assets/miscutils/textures/FancyCapeHD.png create mode 100644 src/resources/assets/miscutils/textures/OrangeHD.png create mode 100644 src/resources/assets/miscutils/textures/TesterCapeHD.png (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/build.gradle b/build.gradle index 1321368c96..c6bafd9207 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 archivesBaseName = "GT-PlusPlus" -version = "1.6.93-release" +version = "1.6.94-release" minecraft.version = "1.7.10-10.13.4.1448-1.7.10" diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index cdccd4164f..1099679f5e 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -35,7 +35,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.6.93-release"; + public static final String VERSION = "1.6.94-release"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index 89b144fc5f..4cbd3c7205 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -17,7 +17,7 @@ import java.util.Collection; public class GTPP_CapeRenderer extends RenderPlayer { - private final ResourceLocation[] mCapes = {new ResourceLocation("miscutils:textures/Orange.png"), new ResourceLocation("miscutils:textures/TesterCape.png"), new ResourceLocation("miscutils:textures/FancyCape.png"), new ResourceLocation("miscutils:textures/DevCape.png")}; + private final ResourceLocation[] mCapes = {new ResourceLocation("miscutils:textures/OrangeHD.png"), new ResourceLocation("miscutils:textures/TesterCapeHD.png"), new ResourceLocation("miscutils:textures/FancyCapeHD.png"), new ResourceLocation("miscutils:textures/TesterCapeHD.png")}; private final Collection mCapeList; public GTPP_CapeRenderer(Collection aCapeList) { @@ -26,9 +26,9 @@ public class GTPP_CapeRenderer } private final String[] mOrangeCapes = {"ImmortalPharaoh7", "Walmart_Employee", "ArchonCerulean", "asturrial"}; //Orange.png - private final String[] mBlueCapes = {"fobius", "cantankerousrex", "stephen_2015", "Dyonovan", "Bear989Sr", "CrazyJ1984"}; //Fancycape.png - private final String[] mTestCapes = {"123_456_789", "doomsquirter", "ukdunc"}; //TesterCape.png - private final String[] mDevCapes = {"draknyte1", "redmage17"}; //Capes for Developers + private final String[] mTestCapes = {"123_456_789", "doomsquirter", "ukdunc"}; //TesterCape.png + private final String[] mBlueCapes = {"fobius", "cantankerousrex", "stephen_2015", "Dyonovan", "Bear989Sr", "CrazyJ1984"}; //Fancycape.png + private final String[] mDevCapes = {"draknyte1", "redmage17"}; //Capes for Developers public void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) { @@ -52,12 +52,12 @@ public class GTPP_CapeRenderer tResource = this.mCapes[0]; } } - for (String mName : mBlueCapes){ + for (String mName : mTestCapes){ if (mName.toLowerCase().contains(aPlayer.getDisplayName().toLowerCase())) { tResource = this.mCapes[1]; } } - for (String mName : mTestCapes){ + for (String mName : mBlueCapes){ if (mName.toLowerCase().contains(aPlayer.getDisplayName().toLowerCase())) { tResource = this.mCapes[2]; } diff --git a/src/resources/assets/miscutils/textures/DevCapeHD.png b/src/resources/assets/miscutils/textures/DevCapeHD.png new file mode 100644 index 0000000000..e979848c69 Binary files /dev/null and b/src/resources/assets/miscutils/textures/DevCapeHD.png differ diff --git a/src/resources/assets/miscutils/textures/FancyCapeHD.png b/src/resources/assets/miscutils/textures/FancyCapeHD.png new file mode 100644 index 0000000000..d8da3ba76d Binary files /dev/null and b/src/resources/assets/miscutils/textures/FancyCapeHD.png differ diff --git a/src/resources/assets/miscutils/textures/OrangeHD.png b/src/resources/assets/miscutils/textures/OrangeHD.png new file mode 100644 index 0000000000..b7dfa6d79a Binary files /dev/null and b/src/resources/assets/miscutils/textures/OrangeHD.png differ diff --git a/src/resources/assets/miscutils/textures/TesterCapeHD.png b/src/resources/assets/miscutils/textures/TesterCapeHD.png new file mode 100644 index 0000000000..274ba1bd44 Binary files /dev/null and b/src/resources/assets/miscutils/textures/TesterCapeHD.png differ diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info index 032322a414..7140a5b320 100644 --- a/src/resources/mcmod.info +++ b/src/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Adds a few various Multiblocks, Machines, etc to Gregtech and a plethora of other mods (Nearly 30!)", "credits": "", "logoFile": "", - "version": "1.6.93-release", + "version": "1.6.94-release", "mcversion": "1.7.10", "url": "https://github.com/draknyte1/GTplusplus/wiki", "updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest", -- cgit From 5fb4cdd13a452737f2bb62d84779de5067791a9b Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 27 Nov 2017 00:53:16 +1000 Subject: - Removed Mekanism changes if RedTech is loaded. --- .../core/handler/COMPAT_IntermodStaging.java | 8 +- src/Java/gtPlusPlus/core/lib/LoadedMods.java | 8 +- .../gtPlusPlus/preloader/Preloader_GT_OreDict.java | 54 +++--- .../gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java | 190 ++++++++++----------- 4 files changed, 132 insertions(+), 128 deletions(-) (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index 1bf729cdc6..b534cd11cd 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -6,7 +6,6 @@ import gtPlusPlus.xmod.forestry.HANDLER_FR; import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.growthcraft.HANDLER_GC; import gtPlusPlus.xmod.ic2.HANDLER_IC2; -import gtPlusPlus.xmod.mekanism.HANDLER_Mekanism; import gtPlusPlus.xmod.thaumcraft.common.HANDLER_Thaumcraft; import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF; @@ -20,9 +19,8 @@ public class COMPAT_IntermodStaging { HANDLER_IC2.preInit(); HANDLER_Computronics.preInit(); HANDLER_BiomesOPlenty.preInit(); - HANDLER_Mekanism.preInit(); + //HANDLER_Mekanism.preInit(); HANDLER_Thaumcraft.preInit(); - } public static void init(){ @@ -33,7 +31,7 @@ public class COMPAT_IntermodStaging { HANDLER_IC2.init(); HANDLER_Computronics.init(); HANDLER_BiomesOPlenty.init(); - HANDLER_Mekanism.init(); + //HANDLER_Mekanism.init(); HANDLER_Thaumcraft.init(); } @@ -45,7 +43,7 @@ public class COMPAT_IntermodStaging { HANDLER_IC2.postInit(); HANDLER_Computronics.postInit(); HANDLER_BiomesOPlenty.postInit(); - HANDLER_Mekanism.postInit(); + //HANDLER_Mekanism.postInit(); HANDLER_Thaumcraft.postInit(); } diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java index d97b41641d..dda50a0d84 100644 --- a/src/Java/gtPlusPlus/core/lib/LoadedMods.java +++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java @@ -45,6 +45,7 @@ public class LoadedMods { public static boolean PamsHarvestcraft = false; public static boolean GalacticraftCore = false; public static boolean Mekanism = false; + public static boolean RedTech = false; @@ -242,8 +243,13 @@ public class LoadedMods { Utils.LOG_INFO("Components disabled for: Computronics - This feature will enable itself if you remove Computronics."); totalMods++; } + if (Loader.isModLoaded("GTRedtech") == true){ + RedTech = true; + Utils.LOG_INFO("Components enabled for: GTRedtech"); + totalMods++; + } else { - Utils.LOG_INFO("Components enabled for: Computronics - This feature will disable itself if you add Computronics."); + Utils.LOG_INFO("Components enabled for: Computronics - This feature will disable itself if you add Computronics."); } Utils.LOG_INFO("Content found for "+totalMods+" mods"); diff --git a/src/Java/gtPlusPlus/preloader/Preloader_GT_OreDict.java b/src/Java/gtPlusPlus/preloader/Preloader_GT_OreDict.java index 26cefe7254..018e0bee82 100644 --- a/src/Java/gtPlusPlus/preloader/Preloader_GT_OreDict.java +++ b/src/Java/gtPlusPlus/preloader/Preloader_GT_OreDict.java @@ -10,48 +10,48 @@ import net.minecraft.item.ItemStack; public class Preloader_GT_OreDict { - public static boolean shouldPreventRegistration(String string, ItemStack bannedItem) { + public static boolean shouldPreventRegistration(final String string, final ItemStack bannedItem) { try { if (CORE_Preloader.enableOldGTcircuits){ - if (bannedItem != null && ItemUtils.getModId(bannedItem).toLowerCase().equals("gregtech")){ - int damageValue = bannedItem.getItemDamage() - 32000; + if ((bannedItem != null) && ItemUtils.getModId(bannedItem).toLowerCase().equals("gregtech")){ + final int damageValue = bannedItem.getItemDamage() - 32000; if (bannedItem.getItem() instanceof GT_MetaGenerated_Item_01) { // 700-720 - if (damageValue >= 700 && damageValue <= 720) { + if ((damageValue >= 700) && (damageValue <= 720)) { return true; } } else { try { if (Class.forName("gregtech.common.items.GT_MetaGenerated_Item_03") != null) { // 6/11/12/14/16/20/30-57/69-73/79-96 - Class MetaItem03 = Class.forName("gregtech.common.items.GT_MetaGenerated_Item_03"); + final Class MetaItem03 = Class.forName("gregtech.common.items.GT_MetaGenerated_Item_03"); if (isInstanceOf(MetaItem03, bannedItem.getItem())) { - if (damageValue == 6 || damageValue == 7 || damageValue == 11 || damageValue == 12 || damageValue == 14 - || damageValue == 16 || damageValue == 20 || damageValue == 21 || damageValue == 22) { + if ((damageValue == 6) || (damageValue == 7) || (damageValue == 11) || (damageValue == 12) || (damageValue == 14) + || (damageValue == 16) || (damageValue == 20) || (damageValue == 21) || (damageValue == 22)) { return true; } - else if (damageValue >= 30 && damageValue <= 57) { + else if ((damageValue >= 30) && (damageValue <= 57)) { return true; } - else if (damageValue >= 69 && damageValue <= 73) { + else if ((damageValue >= 69) && (damageValue <= 73)) { return true; } - else if (damageValue >= 78 && damageValue <= 96) { + else if ((damageValue >= 78) && (damageValue <= 96)) { return true; } } } } - catch (ClassNotFoundException e) { + catch (final ClassNotFoundException e) { } } } } - + //Mekanism Support - Let's not make Mek Osmium useful in GT anymore. - if (bannedItem != null && (ItemUtils.getModId(bannedItem).toLowerCase().equals("mekanism") || LoadedMods.Mekanism)){ + if ((((bannedItem != null) && (ItemUtils.getModId(bannedItem).toLowerCase().equals("mekanism"))) || (LoadedMods.Mekanism)) && !LoadedMods.RedTech){ //Circuits if (Class.forName("mekanism.common.item.ItemControlCircuit") != null) { - Class MekCircuit = Class.forName("mekanism.common.item.ItemControlCircuit"); + final Class MekCircuit = Class.forName("mekanism.common.item.ItemControlCircuit"); if (isInstanceOf(MekCircuit, bannedItem.getItem())) { for (int r=0;r<4;r++){ if (bannedItem.getItemDamage() == r){ @@ -63,7 +63,7 @@ public class Preloader_GT_OreDict { } //Ingots if (Class.forName("mekanism.common.item.ItemIngot") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemIngot"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemIngot"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 1){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); @@ -73,7 +73,7 @@ public class Preloader_GT_OreDict { } //Dirty Dust if (Class.forName("mekanism.common.item.ItemDirtyDust") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemDirtyDust"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemDirtyDust"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 2){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); @@ -83,27 +83,27 @@ public class Preloader_GT_OreDict { } //Dust if (Class.forName("mekanism.common.item.ItemDust") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemDust"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemDust"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 2){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); return true; } } - } + } //Crystal if (Class.forName("mekanism.common.item.ItemCrystal") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemCrystal"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemCrystal"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 2){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); return true; } } - } + } //Shard if (Class.forName("mekanism.common.item.ItemShard") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemShard"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemShard"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 2){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); @@ -113,18 +113,18 @@ public class Preloader_GT_OreDict { } //Clump if (Class.forName("mekanism.common.item.ItemClump") != null) { - Class MekIngot = Class.forName("mekanism.common.item.ItemClump"); + final Class MekIngot = Class.forName("mekanism.common.item.ItemClump"); if (isInstanceOf(MekIngot, bannedItem.getItem())) { if (bannedItem.getItemDamage() == 2){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); return true; } } - } + } //Ores if (Class.forName("mekanism.common.item.ItemBlockOre") != null) { - Class MekOre = Class.forName("mekanism.common.item.ItemBlockOre"); - if (isInstanceOf(MekOre, bannedItem.getItem()) || bannedItem == ItemUtils.simpleMetaStack("Mekanism:OreBlock", 0, 1)) { + final Class MekOre = Class.forName("mekanism.common.item.ItemBlockOre"); + if (isInstanceOf(MekOre, bannedItem.getItem()) || (bannedItem == ItemUtils.simpleMetaStack("Mekanism:OreBlock", 0, 1))) { if (bannedItem.getItemDamage() == 0){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Removing "+bannedItem.getDisplayName()+" from the OreDictionary to balance Mekanism."); return true; @@ -133,7 +133,7 @@ public class Preloader_GT_OreDict { } } - } catch (Throwable e) { + } catch (final Throwable e) { FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "A mod tried to register an invalid item with the OreDictonary."); if (bannedItem != null){ FMLRelaunchLog.log("[GT++ ASM] OreDictTransformer", Level.INFO, "Please report this issue to the authors of "+ItemUtils.getModId(bannedItem)); @@ -144,7 +144,7 @@ public class Preloader_GT_OreDict { } // Simplification of Life. - private static boolean isInstanceOf(Class clazz, Object obj) { + private static boolean isInstanceOf(final Class clazz, final Object obj) { return clazz.isInstance(obj); } diff --git a/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java b/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java index 401bd19e83..ce4ec38a09 100644 --- a/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java +++ b/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java @@ -27,180 +27,180 @@ public class HANDLER_Mekanism { } public static void postInit(){ - if (LoadedMods.Mekanism){ - + if (LoadedMods.Mekanism && !LoadedMods.RedTech){ + Utils.LOG_INFO("Performing GT recipe balance for Mek. now that it's Osmium is useless."); - + //Steel Casing - ItemStack tSteelCasing = ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1); + final ItemStack tSteelCasing = ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1); addNewRecipe( - "plateSteel", "blockGlass", "plateSteel", - "blockGlass", "plateStainlessSteel", "blockGlass", + "plateSteel", "blockGlass", "plateSteel", + "blockGlass", "plateStainlessSteel", "blockGlass", "plateSteel", "blockGlass", "plateSteel", tSteelCasing); //Energy Storage - ItemStack tAdvancedEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy(); + final ItemStack tAdvancedEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy(); NBTUtils.setString(tAdvancedEnergyCube, "tier", "Advanced"); - ItemStack tBasicEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy(); + final ItemStack tBasicEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1).copy(); NBTUtils.setString(tBasicEnergyCube, "tier", "Basic"); //Gas tanks - ItemStack tBasicGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); + final ItemStack tBasicGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); NBTUtils.setInteger(tBasicGasTank, "tier", 0); - ItemStack tAdvancedGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); + final ItemStack tAdvancedGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); NBTUtils.setInteger(tAdvancedGasTank, "tier", 1); - ItemStack tEliteGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); + final ItemStack tEliteGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); NBTUtils.setInteger(tEliteGasTank, "tier", 2); - ItemStack tMasterGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); + final ItemStack tMasterGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1).copy(); NBTUtils.setInteger(tMasterGasTank, "tier", 3); //Machines that use Osmium - ItemStack tMachineBlock_Basic = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:5", 5, 1); - ItemStack tMachineBlock = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:6", 6, 1); + final ItemStack tMachineBlock_Basic = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:5", 5, 1); + final ItemStack tMachineBlock = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:6", 6, 1); //Smelting - ItemStack tMachineBlock_0_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_0_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_0_Basic, "recipeType", 0); - ItemStack tMachineBlock_0 = tMachineBlock.copy(); + final ItemStack tMachineBlock_0 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_0, "recipeType", 0); //Enriching - ItemStack tMachineBlock_1_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_1_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_1_Basic, "recipeType", 1); - ItemStack tMachineBlock_1 = tMachineBlock.copy(); + final ItemStack tMachineBlock_1 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_1, "recipeType", 1); //Crushing - ItemStack tMachineBlock_2_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_2_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_2_Basic, "recipeType", 2); - ItemStack tMachineBlock_2 = tMachineBlock.copy(); + final ItemStack tMachineBlock_2 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_2, "recipeType", 2); //Compressing - ItemStack tMachineBlock_3_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_3_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_3_Basic, "recipeType", 3); - ItemStack tMachineBlock_3 = tMachineBlock.copy(); + final ItemStack tMachineBlock_3 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_3, "recipeType", 3); //Combining - ItemStack tMachineBlock_4_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_4_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_4_Basic, "recipeType", 4); - ItemStack tMachineBlock_4 = tMachineBlock.copy(); + final ItemStack tMachineBlock_4 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_4, "recipeType", 4); //Purifying - ItemStack tMachineBlock_5_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_5_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_5_Basic, "recipeType", 5); - ItemStack tMachineBlock_5 = tMachineBlock.copy(); + final ItemStack tMachineBlock_5 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_5, "recipeType", 5); //Injecting - ItemStack tMachineBlock_6_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_6_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_6_Basic, "recipeType", 6); - ItemStack tMachineBlock_6 = tMachineBlock.copy(); + final ItemStack tMachineBlock_6 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_6, "recipeType", 6); //Infusing - ItemStack tMachineBlock_7_Basic = tMachineBlock_Basic.copy(); + final ItemStack tMachineBlock_7_Basic = tMachineBlock_Basic.copy(); NBTUtils.setInteger(tMachineBlock_7_Basic, "recipeType", 7); - ItemStack tMachineBlock_7 = tMachineBlock.copy(); + final ItemStack tMachineBlock_7 = tMachineBlock.copy(); NBTUtils.setInteger(tMachineBlock_7, "recipeType", 7); //Infuser - ItemStack tMachineBlock_8 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:8", 8, 1); + final ItemStack tMachineBlock_8 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:8", 8, 1); //Purification - ItemStack tMachineBlock_9 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:9", 9, 1); + final ItemStack tMachineBlock_9 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:9", 9, 1); //Pump - ItemStack tMachineBlock_12 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:12", 12, 1); + final ItemStack tMachineBlock_12 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:12", 12, 1); // - ItemStack tItem_1 = ItemUtils.simpleMetaStack("Mekanism:ElectrolyticCore", 0, 1); + final ItemStack tItem_1 = ItemUtils.simpleMetaStack("Mekanism:ElectrolyticCore", 0, 1); // - ItemStack tItem_2 = ItemUtils.simpleMetaStack("Mekanism:FactoryInstaller:1", 1, 1); + final ItemStack tItem_2 = ItemUtils.simpleMetaStack("Mekanism:FactoryInstaller:1", 1, 1); // - ItemStack tItem_3 = ItemUtils.simpleMetaStack("Mekanism:SpeedUpgrade", 0, 1); + final ItemStack tItem_3 = ItemUtils.simpleMetaStack("Mekanism:SpeedUpgrade", 0, 1); //MiscItems - String tAdvancedAlloy = "alloyAdvanced"; - String tCircuitAdvanced = "circuitAdvanced"; - ItemStack tMekBatterySimple = ItemUtils.simpleMetaStack("Mekanism:EnergyTablet", 0, 1); + final String tAdvancedAlloy = "alloyAdvanced"; + final String tCircuitAdvanced = "circuitAdvanced"; + final ItemStack tMekBatterySimple = ItemUtils.simpleMetaStack("Mekanism:EnergyTablet", 0, 1); //Items addNewRecipe( - tAdvancedAlloy, "plateTitanium", tAdvancedAlloy, - "dustIron", tAdvancedAlloy, "dustGold", - tAdvancedAlloy, "plateTitanium", tAdvancedAlloy, + tAdvancedAlloy, "plateTitanium", tAdvancedAlloy, + "dustIron", tAdvancedAlloy, "dustGold", + tAdvancedAlloy, "plateTitanium", tAdvancedAlloy, tItem_1); addNewRecipe( - tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, - "plateStainlessSteel", "plankWood", "plateStainlessSteel", - tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, + tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, + "plateStainlessSteel", "plankWood", "plateStainlessSteel", + tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, tItem_2); addNewRecipe( - null, "blockGlass", null, - tAdvancedAlloy, "plateTungsten", tAdvancedAlloy, - null, "blockGlass", null, + null, "blockGlass", null, + tAdvancedAlloy, "plateTungsten", tAdvancedAlloy, + null, "blockGlass", null, tItem_3); //Power Storage addNewRecipe( - tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy, - "plateAluminium", tBasicEnergyCube, "plateAluminium", - tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy, + tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy, + "plateAluminium", tBasicEnergyCube, "plateAluminium", + tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy, tAdvancedEnergyCube); //Blocks addNewRecipe( - "plateSteel", "craftingFurnace", "plateSteel", - "plateRedstone", "platePlatinum", "plateRedstone", - "plateSteel", "craftingFurnace", "plateSteel", + "plateSteel", "craftingFurnace", "plateSteel", + "plateRedstone", "platePlatinum", "plateRedstone", + "plateSteel", "craftingFurnace", "plateSteel", tMachineBlock_8); addNewRecipe( - tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, - "plateTitanium", ItemUtils.simpleMetaStack("Mekanism:MachineBlock", 0, 1), "plateTitanium", - tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, + tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, + "plateTitanium", ItemUtils.simpleMetaStack("Mekanism:MachineBlock", 0, 1), "plateTitanium", + tAdvancedAlloy, "circuitAdvanced", tAdvancedAlloy, tMachineBlock_9); addNewRecipe( - null, ItemUtils.getSimpleStack(Items.bucket), null, - tAdvancedAlloy, tSteelCasing, tAdvancedAlloy, - "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel", + null, ItemUtils.getSimpleStack(Items.bucket), null, + tAdvancedAlloy, tSteelCasing, tAdvancedAlloy, + "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel", tMachineBlock_12); //Machines addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_0_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_0_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_0); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_1_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_1_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_1); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_2_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_2_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_2); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_3_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_3_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_3); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_4_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_4_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_4); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_5_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_5_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_5); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_6_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_6_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, tMachineBlock_6); addNewRecipe( - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - "plateStainlessSteel", tMachineBlock_7_Basic, "plateStainlessSteel", - tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, - tMachineBlock_7); + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + "plateStainlessSteel", tMachineBlock_7_Basic, "plateStainlessSteel", + tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy, + tMachineBlock_7); //Gas Tanks addNewRecipe( @@ -222,7 +222,7 @@ public class HANDLER_Mekanism { "alloyUltimate", "plateTungsten", "alloyUltimate", "plateTungsten", tEliteGasTank, "plateTungsten", "alloyUltimate", "plateTungsten", "alloyUltimate", - tMasterGasTank); + tMasterGasTank); } } @@ -234,34 +234,34 @@ public class HANDLER_Mekanism { /*if (removeRecipe(OutputItem)){ return RecipeUtils.recipeBuilder( - InputItem1, InputItem2, InputItem3, - InputItem4, InputItem5, InputItem6, - InputItem7, InputItem8, InputItem9, + InputItem1, InputItem2, InputItem3, + InputItem4, InputItem5, InputItem6, + InputItem7, InputItem8, InputItem9, OutputItem); }*/ removeRecipe(OutputItem); return RecipeUtils.recipeBuilder( - InputItem1, InputItem2, InputItem3, - InputItem4, InputItem5, InputItem6, - InputItem7, InputItem8, InputItem9, + InputItem1, InputItem2, InputItem3, + InputItem4, InputItem5, InputItem6, + InputItem7, InputItem8, InputItem9, OutputItem); } - private static boolean removeRecipe(ItemStack item){ + private static boolean removeRecipe(final ItemStack item){ Class mekUtils; boolean removed = false; try { mekUtils = Class.forName("mekanism.common.util.RecipeUtils"); if (mekUtils != null){ - Method mRemoveRecipe = mekUtils.getDeclaredMethod("removeRecipes", ItemStack.class); + final Method mRemoveRecipe = mekUtils.getDeclaredMethod("removeRecipes", ItemStack.class); if (mRemoveRecipe != null){ removed = (boolean) mRemoveRecipe.invoke(null, item); if (!removed) { removed = (boolean) mRemoveRecipe.invoke(mekUtils, item); } } - } + } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Utils.LOG_INFO("[Mek] Failed to use the built-in recipe remover from Mekanism."); } -- cgit From 0d18c5ebd32acf0fc58643d40229947eee547e49 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 27 Nov 2017 00:59:09 +1000 Subject: ^ Version Bump. --- build.gradle | 2 +- src/Java/gtPlusPlus/core/lib/CORE.java | 11 ++++++++--- src/resources/mcmod.info | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/Java/gtPlusPlus/core/lib') diff --git a/build.gradle b/build.gradle index c6bafd9207..c009405e03 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 archivesBaseName = "GT-PlusPlus" -version = "1.6.94-release" +version = "1.6.97-release" minecraft.version = "1.7.10-10.13.4.1448-1.7.10" diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 1099679f5e..76a65ca4fe 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -1,6 +1,11 @@ package gtPlusPlus.core.lib; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import com.mojang.authlib.GameProfile; @@ -35,7 +40,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.6.94-release"; + public static final String VERSION = "1.6.97-release"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); @@ -77,7 +82,7 @@ public class CORE { //Book List public static final Map sBookList = new ConcurrentHashMap(); - + /** * File Paths and Resource Paths */ diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info index 7140a5b320..9f12b3fae0 100644 --- a/src/resources/mcmod.info +++ b/src/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Adds a few various Multiblocks, Machines, etc to Gregtech and a plethora of other mods (Nearly 30!)", "credits": "", "logoFile": "", - "version": "1.6.94-release", + "version": "1.6.97-release", "mcversion": "1.7.10", "url": "https://github.com/draknyte1/GTplusplus/wiki", "updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest", -- cgit