From 815ddbfe127301f8586599f1c5483a09f9a6374a Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Tue, 18 Feb 2020 12:32:37 +0100 Subject: one more TFFT cell, fixed press/alloying recipes, improved fuel cells --- .../java/itemBlocks/IB_TFFTStorageFieldBlockT5.java | 2 +- src/main/java/kekztech/KekzCore.java | 21 ++++++++++++++++++--- .../java/tileentities/GTMTE_FluidMultiStorage.java | 2 +- src/main/java/tileentities/GTMTE_SOFuelCellMK1.java | 19 +++++++++---------- src/main/java/tileentities/GTMTE_SOFuelCellMK2.java | 19 +++++++++---------- src/main/resources/assets/kekztech/lang/en_US.lang | 1 + 6 files changed, 39 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/main/java/itemBlocks/IB_TFFTStorageFieldBlockT5.java b/src/main/java/itemBlocks/IB_TFFTStorageFieldBlockT5.java index caef257f93..304f2a221c 100644 --- a/src/main/java/itemBlocks/IB_TFFTStorageFieldBlockT5.java +++ b/src/main/java/itemBlocks/IB_TFFTStorageFieldBlockT5.java @@ -19,7 +19,7 @@ public class IB_TFFTStorageFieldBlockT5 extends ItemBlock { public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { lines.add("This is not a fluid tank"); lines.add("Capacity: " + Block_TFFTStorageFieldBlockT5.getCapacity() + "L"); - lines.add("Power Draw: 0.5EU/t"); + lines.add("Power Draw: 8EU/t"); } } \ No newline at end of file diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index 247131c7f7..114446ad38 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -16,6 +16,7 @@ import blocks.Block_TFFTStorageFieldBlockT1; import blocks.Block_TFFTStorageFieldBlockT2; import blocks.Block_TFFTStorageFieldBlockT3; import blocks.Block_TFFTStorageFieldBlockT4; +import blocks.Block_TFFTStorageFieldBlockT5; import blocks.Block_YSZUnit; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.Loader; @@ -95,6 +96,7 @@ public class KekzCore { Block_TFFTStorageFieldBlockT2.getInstance().registerBlock(); Block_TFFTStorageFieldBlockT3.getInstance().registerBlock(); Block_TFFTStorageFieldBlockT4.getInstance().registerBlock(); + Block_TFFTStorageFieldBlockT5.getInstance().registerBlock(); Block_TFFTMultiHatch.getInstance().registerBlock(); Block_ReactorChamber_OFF.getInstance().registerBlock(); Block_ReactorChamber_ON.getInstance().registerBlock(); @@ -284,7 +286,7 @@ public class KekzCore { 200, 480); final ItemStack[] tfftstoragefield3 = { GT_Utility.getIntegratedCircuit(6), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.VibrantAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 1), ItemList.Field_Generator_MV.get(1L), @@ -308,6 +310,19 @@ public class KekzCore { FluidRegistry.getFluidStack("molten.epoxid", 1152), new ItemStack(Block_TFFTStorageFieldBlockT4.getInstance(), 1), 400, 4098); + final ItemStack[] tfftstoragefield5 = { + GT_Utility.getIntegratedCircuit(6), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 4), + GT_OreDictUnificator.get(OrePrefixes.plateTriple, Materials.HSSS, 1), + GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.Enderium, 1), + ItemList.Field_Generator_EV.get(1L), + ItemList.Electric_Pump_IV.get(1L) + }; + GT_Values.RA.addAssemblerRecipe( + tfftstoragefield5, + FluidRegistry.getFluidStack("molten.epoxid", 1152), + new ItemStack(Block_TFFTStorageFieldBlockT5.getInstance(), 1), + 400, 4098); final Object[] multi_hatch = { "PRP", "UFU", "PRP", 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.NiobiumTitanium, 1), @@ -345,12 +360,12 @@ public class KekzCore { // Ceramic plates GT_Values.RA.addAlloySmelterRecipe( craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicDust.getMetaID(), Loader.isModLoaded("bartworks") ? 3 : 10), - ItemList.Shape_Mold_Plate.get(1), + ItemList.Shape_Mold_Plate.get(0), craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicPlate.getMetaID(), 1), 400, 480); GT_Values.RA.addFormingPressRecipe( craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicDust.getMetaID(), 10), - ItemList.Shape_Mold_Plate.get(1), + ItemList.Shape_Mold_Plate.get(0), craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicPlate.getMetaID(), 1), 800, 480); diff --git a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java index 945309ad80..221fd03a49 100644 --- a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java +++ b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java @@ -343,7 +343,7 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { runningCostAcc += 4.0f; fluidCapacityAcc += (float) STORAGE_FIELD4.getCapacity(); } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(STORAGE_FIELD4.getUnlocalizedName())) { + .equals(STORAGE_FIELD5.getUnlocalizedName())) { runningCostAcc += 8.0f; fluidCapacityAcc += (float) STORAGE_FIELD5.getCapacity(); } else { diff --git a/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java b/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java index 9aa0a5c01d..197799149c 100644 --- a/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java +++ b/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java @@ -35,9 +35,9 @@ public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase { private final int CASING_META = 1; private final int CASING_TEXTURE_ID = 49; - private final int OXYGEN_PER_TICK = 20; + private final int OXYGEN_PER_SEC = 400; private final int EU_PER_TICK = 1024; - private final int STEAM_PER_TICK = 900; + private final int STEAM_PER_SEC = 18000; public GTMTE_SOFuelCellMK1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -60,8 +60,8 @@ public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase { b.addInfo("Oxidizes gas fuels to generate electricity without polluting the environment") .addInfo("Consumes 29,480EU worth of fuel with up to 97% efficiency each second") .addInfo("Steam production requires the SOFC to heat up completely first") - .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Steam") - .addInfo("Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas") + .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam") + .addInfo("Additionally requires " + OXYGEN_PER_SEC + "L/s Oxygen gas") .addSeparator() .beginStructureBlock(3, 3, 5) .addController("Front Center") @@ -119,22 +119,21 @@ public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase { if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null && hatchFluid.isFluidEqual(liquid)) { - liquid.amount = EU_PER_TICK / aFuel.mSpecialValue; + liquid.amount = Math.round((EU_PER_TICK * 20) / aFuel.mSpecialValue); if(super.depleteInput(liquid)) { - if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) { + if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_SEC))) { super.mEUt = 0; super.mEfficiency = 0; return false; } super.mEUt = EU_PER_TICK; - super.mProgresstime = 1; - super.mMaxProgresstime = 1; - super.mEfficiencyIncrease = 5; + super.mMaxProgresstime = 20; + super.mEfficiencyIncrease = 40; if(super.mEfficiency == getMaxEfficiency(null)) { - super.addOutput(GT_ModHandler.getSteam(STEAM_PER_TICK)); + super.addOutput(GT_ModHandler.getSteam(STEAM_PER_SEC)); } return true; } diff --git a/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java b/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java index 3ecba204ce..de8b37cb85 100644 --- a/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java +++ b/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java @@ -35,9 +35,9 @@ public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase { final int CASING_META = 0; final int CASING_TEXTURE_ID = 48; - private final int OXYGEN_PER_TICK = 100; + private final int OXYGEN_PER_SEC = 2000; private final int EU_PER_TICK = 24576; // 100% Efficiency, 3A IV - private final int STEAM_PER_TICK = 4800; // SH Steam (10,800EU/t @ 150% Efficiency) + private final int STEAM_PER_SEC = 96000; // SH Steam (10,800EU/t @ 150% Efficiency) public GTMTE_SOFuelCellMK2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -60,8 +60,8 @@ public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase { b.addInfo("Oxidizes gas fuels to generate electricity without polluting the environment") .addInfo("Consumes 442,200EU worth of fuel with up to 97% efficiency each second") .addInfo("Steam production requires the SOFC to heat up completely first") - .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Steam") - .addInfo("Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas") + .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam") + .addInfo("Additionally requires " + OXYGEN_PER_SEC + "L/s Oxygen gas") .addSeparator() .beginStructureBlock(3, 3, 5) .addController("Front Center") @@ -119,22 +119,21 @@ public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase { if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null && hatchFluid.isFluidEqual(liquid)) { - liquid.amount = EU_PER_TICK / aFuel.mSpecialValue; + liquid.amount = Math.round((EU_PER_TICK * 20) / aFuel.mSpecialValue); if(super.depleteInput(liquid)) { - if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) { + if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_SEC))) { super.mEUt = 0; super.mEfficiency = 0; return false; } super.mEUt = EU_PER_TICK; - super.mProgresstime = 1; - super.mMaxProgresstime = 1; - super.mEfficiencyIncrease = 20; + super.mMaxProgresstime = 20; + super.mEfficiencyIncrease = 80; if(super.mEfficiency == getMaxEfficiency(null)) { - super.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", STEAM_PER_TICK)); + super.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", STEAM_PER_SEC)); } return true; } diff --git a/src/main/resources/assets/kekztech/lang/en_US.lang b/src/main/resources/assets/kekztech/lang/en_US.lang index d21ed0462e..1fffdf2b4e 100644 --- a/src/main/resources/assets/kekztech/lang/en_US.lang +++ b/src/main/resources/assets/kekztech/lang/en_US.lang @@ -82,6 +82,7 @@ tile.kekztech_tfftstoragefieldblock1_block.name=T.F.F.T Storage Field Block (Tie tile.kekztech_tfftstoragefieldblock2_block.name=T.F.F.T Storage Field Block (Tier II) tile.kekztech_tfftstoragefieldblock3_block.name=T.F.F.T Storage Field Block (Tier III) tile.kekztech_tfftstoragefieldblock4_block.name=T.F.F.T Storage Field Block (Tier IV) +tile.kekztech_tfftstoragefieldblock5_block.name=T.F.F.T Storage Field Block (Tier V) tile.kekztech_tfftmultihatch_block.name=T.F.F.T Multi-Fluid I/O Hatch tile.kekztech_controlrod_block.name=Nuclear Reactor Control Rod -- cgit From ba8d49bd6c77d69630135c887272e9d0c8c7311d Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Tue, 18 Feb 2020 16:01:52 +0100 Subject: Fixed Item Server structure check. Wrote better doc for the MIH --- src/main/java/kekztech/KekzCore.java | 1 - src/main/java/kekztech/MultiItemHandler.java | 112 +++++++++++++++------ src/main/java/tileentities/GTMTE_ItemServer.java | 121 ++++++++++++----------- 3 files changed, 142 insertions(+), 92 deletions(-) (limited to 'src') diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index 114446ad38..64e1298d3c 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -18,7 +18,6 @@ import blocks.Block_TFFTStorageFieldBlockT3; import blocks.Block_TFFTStorageFieldBlockT4; import blocks.Block_TFFTStorageFieldBlockT5; import blocks.Block_YSZUnit; -import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; diff --git a/src/main/java/kekztech/MultiItemHandler.java b/src/main/java/kekztech/MultiItemHandler.java index 766abbbb93..9416dbebcf 100644 --- a/src/main/java/kekztech/MultiItemHandler.java +++ b/src/main/java/kekztech/MultiItemHandler.java @@ -1,7 +1,5 @@ package kekztech; -import java.util.ArrayList; - import net.minecraft.item.ItemStack; public class MultiItemHandler { @@ -10,31 +8,44 @@ public class MultiItemHandler { private boolean locked = true; - private final ArrayList items = new ArrayList<>(); + private ItemStack[] items; public MultiItemHandler() { } - /** - * Tries to adapt the internal storage to match structure changes. - * Structure should turn off and give a warning if this returns false. - * Otherwise items might unavailable. + /** + * Adapts the internal storage to structure changes. + * In the event of structure down-sizing, all excess items + * will be dropped on the ground. * * @param itemTypeCapacity - * New item array length to adapt to. - * @return Success status of the operation. */ - public boolean setItemTypeCapacity(int itemTypeCapacity) { - if(items.size() > itemTypeCapacity) { - System.out.println("WARNING: ITEM SERVER STRUCTURE WAS DOWNSIZED TOO FAR! LOCKING FOR SAFETY."); - setLock(true); - return false; + public void setItemTypeCapacity(int itemTypeCapacity) { + if(items.length > itemTypeCapacity) { + // Generate new smaller backing array + final ItemStack[] newItems = new ItemStack[itemTypeCapacity]; + for(int i = 0; i < newItems.length; i++) { + newItems[i] = items[i]; + } + // Sort out item overflow + final ItemStack[] toDrop = new ItemStack[items.length - itemTypeCapacity]; + for(int i = 0; i < toDrop.length; i++) { + toDrop[i] = items[i + newItems.length - 1]; + } + // TODO drop overflow items to the ground + + // Swap array + items = newItems; } else { - items.ensureCapacity(itemTypeCapacity); - // If the lock was engaged, it should only be disengaged by turning - // the structure back on after fixing the above warning. - return true; + // Generate new larger backing array + final ItemStack[] newItems = new ItemStack[itemTypeCapacity]; + for(int i = 0; i < items.length; i++) { + newItems[i] = items[i]; + } + + // Swap array + items = newItems; } } @@ -44,7 +55,6 @@ public class MultiItemHandler { /** * Lock internal storage in case Item Server is not running. - * May also be engaged in case of item safety issues. * * @param state * Lock state. @@ -54,60 +64,98 @@ public class MultiItemHandler { } public int getItemTypeCapacity() { - return items.size(); + return items.length; } public int getPerTypeCapacity() { return perTypeCapacity; } + /** + * Returns the ItemStack from the specified slot. + * + * @param slot + * Storage slot number. Zero indexed. + * @return + * ItemStack from storage or null if + * storage is locked or invalid slot parameter. + */ public ItemStack getStackInSlot(int slot) { System.out.println("Stack in slot " + slot + " requested"); - if(locked || slot >= items.size()) { + if(locked || slot >= items.length) { return null; } else { - return items.get(slot); + return items[slot]; } } + /** + * Inserts a new ItemStack into storage, + * but only if the slot is still unassigned. + * + * @param slot + * Storage slot number. Zero indexed. + * @param itemStack + * ItemStack to insert. + */ public void insertStackInSlot(int slot, ItemStack itemStack) { System.out.println("Inserting " + itemStack.getDisplayName() + " into " + slot); if(itemStack == null - || items.get(slot) != null + || items[slot] != null || locked - || slot >= items.size()) { + || slot >= items.length) { return; } else { - items.set(slot, itemStack); + items[slot] = itemStack; } } + /** + * Tries to increase the item amount in a specified slot. + * + * @param slot + * Storage slot number. Zero indexed. + * @param amount + * Amount to increase by. + * @return + * Actual amount the item amount was increased by. + */ public int increaseStackInSlot(int slot, int amount) { System.out.println("Increasing item in slot " + slot + " by " + amount); - if(slot >= items.size() + if(slot >= items.length || locked || amount <= 0) { return 0; } else { - final int space = perTypeCapacity - items.get(slot).stackSize; + final int space = perTypeCapacity - items[slot].stackSize; final int fit = Math.min(space, amount); - items.get(slot).stackSize += fit; + items[slot].stackSize += fit; return fit; } } + /** + * Tries to reduce the item amount in a specified slot. + * + * @param slot + * Storage slot number. Zero indexed. + * @param amount + * Amount to decrease by. + * @return + * Actual amount the item amount was decreased by. + */ public int reduceStackInSlot(int slot, int amount) { System.out.println("Reducing item in slot " + slot + " by " + amount); - if(slot >= items.size() + if(slot >= items.length || locked || amount <= 0) { return 0; } else { - final int available = items.get(slot).stackSize; + final int available = items[slot].stackSize; final int take = Math.min(available, amount); - items.get(slot).stackSize -= take; + items[slot].stackSize -= take; if(take == available) { - items.set(slot, null); + items[slot] = null; } return take; } diff --git a/src/main/java/tileentities/GTMTE_ItemServer.java b/src/main/java/tileentities/GTMTE_ItemServer.java index 9b4d50c5d4..3753b8e17a 100644 --- a/src/main/java/tileentities/GTMTE_ItemServer.java +++ b/src/main/java/tileentities/GTMTE_ItemServer.java @@ -34,7 +34,8 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { private final Block_ItemServerDrive DRIVE = Block_ItemServerDrive.getInstance(); private final Block_ItemServerRackCasing CASING = Block_ItemServerRackCasing.getInstance(); private final Block_ItemServerIOPort IO_PORT = Block_ItemServerIOPort.getInstance(); - private final String ALU_FRAME_BOX_NAME = "gt.blockmachines.gt_frame_aluminium"; + private final String ALU_FRAME_BOX_NAME = "gt.blockmachines"; + private final int ALU_FRAME_BOX_META = 6;//4115; private final int CASING_TEXTURE_ID = 176; private MultiItemHandler mih; @@ -111,8 +112,8 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; - this.mEUt = (int) (BASE_SLICE_ENERGY_COST * sliceCount * Math.pow(2, config)); - super.mMaxProgresstime = 10; + this.mEUt = (int) -(BASE_SLICE_ENERGY_COST * sliceCount * Math.pow(2, config)); + super.mMaxProgresstime = 20; mih.setPerTypeCapacity((int) (BASE_PER_ITEM_CAPACITY * Math.pow(4, config))); @@ -184,9 +185,8 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { // If it's not a hatch, is it the right casing for this machine? - // TODO: Also check IO port if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) { - // yay + // is casing } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) { final TE_ItemServerIOPort port = (TE_ItemServerIOPort) thisController.getWorld().getTileEntity( @@ -201,23 +201,31 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { } } + if(formationChecklist) { + System.out.println("Item Server front slice approved"); + } + // Check slices int slicesFound = 0; - int zOffset = 1; - for(int s = 0; s < slicesFound; s++) { - final Vector3ic probe = rotateOffsetVector(forgeDirection, 1, 0, zOffset); - // Probe if another slice might exist - if(thisController.getBlockOffset(probe.x(), probe.y(), probe.z()) == DRIVE) { - formationChecklist = checkSlice(thisController, zOffset); - if(!formationChecklist) { - break; - } else { - slicesFound++; - zOffset += 2; - } + int zOffset = -1; + + while(slicesFound < 5) { + if(checkSlice(thisController, forgeDirection, zOffset)) { + slicesFound++; + zOffset -= 3; + + System.out.println("Item Server slice approved: " + slicesFound); + } else { + System.out.println("Item Server slice rejected: " + slicesFound + 1); + break; } } + if(slicesFound < 1) { + System.out.println("At least one slice required for storage"); + formationChecklist = false; + } + if(this.mEnergyHatches.size() < 1) { System.out.println("At least one energy hatch is required!"); formationChecklist = false; @@ -229,12 +237,13 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { } if(formationChecklist) { - slicesFound = sliceCount; + sliceCount = slicesFound; if(mih == null) { mih = new MultiItemHandler(); mih.setItemTypeCapacity(slicesFound * BASE_ITEM_TYPES_PER_SLICE); } + System.out.println("Configuring " + ioPorts.size() + " ports"); for(TE_ItemServerIOPort port : ioPorts) { port.setMultiItemHandler(mih); } @@ -243,19 +252,16 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { return formationChecklist; } - public boolean checkSlice(IGregTechTileEntity thisController, int zOffset) { - // Figure out the vector for the direction the back face of the controller is facing - final Vector3ic forgeDirection = new Vector3i( - ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX, - ForgeDirection.getOrientation(thisController.getBackFacing()).offsetY, - ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ - ); + public boolean checkSlice(IGregTechTileEntity thisController, Vector3ic forgeDirection, int zOffset) { boolean formationChecklist = true; - for(int Z = 0; Z <= 2; Z++) { - if(Z != 2) { + for(int Z = 0; Z >= -2; Z--) { + // Is not back slice + if(Z != -2) { + // Left to right for(int X = -1; X <= 1; X++) { - for(int Y = 0; Y < 5; Y++) { + // Bottom to top + for(int Y = 0; Y <= 4; Y++) { final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, zOffset + Z); // Server rack roof is casings @@ -270,9 +276,8 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { // If it's not a hatch, is it the right casing for this machine? - // TODO: Also check IO port if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) { - // yay + // is casing } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) { final TE_ItemServerIOPort port = (TE_ItemServerIOPort) thisController.getWorld().getTileEntity( @@ -287,14 +292,19 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { } // Middle wall is aluminium frame boxes - else if(Y < 4 && X == 0) { - if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(ALU_FRAME_BOX_NAME))) { + else if(Y <= 3 && X == 0) { + if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(ALU_FRAME_BOX_NAME)) + || !(thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == ALU_FRAME_BOX_META)) { + System.out.println("Rejected Frame box: " + + thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() + + ":" + + thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z())); formationChecklist = false; } } // Side walls are item server drives - else if(Y < 4 && X != 0) { + else if(Y <= 3 && X != 0) { if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == DRIVE)) { formationChecklist = false; } @@ -304,38 +314,30 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { } else { // Back slice for(int X = -1; X <= 1; X++) { - for(int Y = 0; Y < 5; Y++) { + for(int Y = 0; Y <= 4; Y++) { // Get next TE final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, zOffset + Z); IGregTechTileEntity currentTE = thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); - // Disallow nonsensical hatches in the middle of the structure - if(Y < 4 && Y > 0 && X == 0) { - if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)) { + if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) + && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) + && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { + + // If it's not a hatch, is it the right casing for this machine? + if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) { + // is casing + } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) { + final TE_ItemServerIOPort port = + (TE_ItemServerIOPort) thisController.getWorld().getTileEntity( + thisController.getXCoord() + offset.x(), + thisController.getYCoord() + offset.y(), + thisController.getZCoord() + offset.z()); + ioPorts.add(port); + } else { formationChecklist = false; } - } else { - if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { - - // If it's not a hatch, is it the right casing for this machine? - // TODO: Also check IO port - if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) { - // yay - } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) { - final TE_ItemServerIOPort port = - (TE_ItemServerIOPort) thisController.getWorld().getTileEntity( - thisController.getXCoord() + offset.x(), - thisController.getYCoord() + offset.y(), - thisController.getZCoord() + offset.z()); - ioPorts.add(port); - } else { - formationChecklist = false; - } - } } } } @@ -351,8 +353,9 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { final ArrayList ll = new ArrayList<>();//mfh.getInfoData(); ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET); - ll.add("Per-Fluid Capacity: " + BASE_PER_ITEM_CAPACITY); - ll.add("Running Cost: " + (-super.mEUt) + "EU/t"); + ll.add("Per-Item Capacity: " + mih.getPerTypeCapacity()); + ll.add("Item-Type Capacity: " + BASE_ITEM_TYPES_PER_SLICE * sliceCount); + ll.add("Running Cost: " + -(super.mEUt) + "EU/t"); ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus()) ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET)); -- cgit From e3568bc7c726a8893b45ab15fb984a88ebab1a5c Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Tue, 18 Feb 2020 16:50:20 +0100 Subject: Improved TE IS IO port code but it's still not working --- src/main/java/kekztech/MultiItemHandler.java | 9 ++-- src/main/java/tileentities/GTMTE_ItemServer.java | 4 -- .../java/tileentities/TE_ItemServerIOPort.java | 62 +++++++++++++++------- 3 files changed, 49 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/main/java/kekztech/MultiItemHandler.java b/src/main/java/kekztech/MultiItemHandler.java index 9416dbebcf..58dd0660e9 100644 --- a/src/main/java/kekztech/MultiItemHandler.java +++ b/src/main/java/kekztech/MultiItemHandler.java @@ -64,7 +64,7 @@ public class MultiItemHandler { } public int getItemTypeCapacity() { - return items.length; + return items != null ? items.length : 0; } public int getPerTypeCapacity() { @@ -97,16 +97,19 @@ public class MultiItemHandler { * Storage slot number. Zero indexed. * @param itemStack * ItemStack to insert. + * @return + * Operation success state. */ - public void insertStackInSlot(int slot, ItemStack itemStack) { + public boolean insertStackInSlot(int slot, ItemStack itemStack) { System.out.println("Inserting " + itemStack.getDisplayName() + " into " + slot); if(itemStack == null || items[slot] != null || locked || slot >= items.length) { - return; + return false; } else { items[slot] = itemStack; + return true; } } diff --git a/src/main/java/tileentities/GTMTE_ItemServer.java b/src/main/java/tileentities/GTMTE_ItemServer.java index 3753b8e17a..1449e8333a 100644 --- a/src/main/java/tileentities/GTMTE_ItemServer.java +++ b/src/main/java/tileentities/GTMTE_ItemServer.java @@ -75,7 +75,6 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { .addOtherStructurePart("2nd and 3rd slice, top", "3x1x1 Item Server Rack Casing") .addOtherStructurePart("2nd and 3rd slice, sides", "2x 1x4x1 Item Server Drive") .addOtherStructurePart("Back slice", "3x5x1 Item Server Rack Casing") - .addInputBus("Instead of any casing") .signAndFinalize("Kekzdealer"); if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return b.getInformation(); @@ -181,7 +180,6 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { // If it's not a hatch, is it the right casing for this machine? @@ -272,7 +270,6 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { // If it's not a hatch, is it the right casing for this machine? @@ -322,7 +319,6 @@ public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase { thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) { // If it's not a hatch, is it the right casing for this machine? diff --git a/src/main/java/tileentities/TE_ItemServerIOPort.java b/src/main/java/tileentities/TE_ItemServerIOPort.java index a8c0f25b83..a7dc7e14f5 100644 --- a/src/main/java/tileentities/TE_ItemServerIOPort.java +++ b/src/main/java/tileentities/TE_ItemServerIOPort.java @@ -2,22 +2,22 @@ package tileentities; import kekztech.MultiItemHandler; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -public class TE_ItemServerIOPort extends TileEntity implements IInventory { +public class TE_ItemServerIOPort extends TileEntity implements ISidedInventory { private MultiItemHandler mih; public void setMultiItemHandler(MultiItemHandler mih) { - System.out.println("MIH set"); this.mih = mih; + System.out.println("MIH set"); } @Override public int getSizeInventory() { - return (mih != null) ? mih.getItemTypeCapacity() : 9; + return (mih != null) ? mih.getItemTypeCapacity() : 0; } @Override @@ -36,8 +36,9 @@ public class TE_ItemServerIOPort extends TileEntity implements IInventory { } else { return null; } + } else { + return null; } - return null; } @Override @@ -47,26 +48,26 @@ public class TE_ItemServerIOPort extends TileEntity implements IInventory { @Override public void setInventorySlotContents(int slot, ItemStack itemStack) { - System.out.println("Set slot, MIH: " + mih); + System.out.println("Set slot: " + slot); if(mih != null) { - if(itemStack == null || !itemStack.isItemEqual(mih.getStackInSlot(slot))) { + if(itemStack == null) { return; } else { - if(mih.getStackInSlot(slot) == null) { - System.out.println("Set slot: Allocate new"); - mih.insertStackInSlot(slot, itemStack); - } else { - final int change = itemStack.stackSize - mih.getStackInSlot(slot).stackSize; - if(change < 0) { - System.out.println("Set slot: reduce"); - mih.reduceStackInSlot(slot, change); + if(!mih.insertStackInSlot(slot, itemStack)) { + final int delta = itemStack.stackSize - mih.getStackInSlot(slot).stackSize; + if(delta < 0) { + System.out.println("Set slot reduce: " + itemStack.getDisplayName()); + mih.reduceStackInSlot(slot, delta); } else { - System.out.println("Set slot: increase"); - mih.increaseStackInSlot(slot, change); - } + System.out.println("Set slot increase: " + itemStack.getDisplayName()); + mih.increaseStackInSlot(slot, delta); + } + + } else { + System.out.println("Allocated new slot for: " + itemStack.getDisplayName()); } super.markDirty(); - } + } } } @@ -105,4 +106,27 @@ public class TE_ItemServerIOPort extends TileEntity implements IInventory { return (mih != null) ? (mih.getStackInSlot(slot).isItemEqual(itemStack) || mih.getStackInSlot(slot) == null) : false; } + @Override + public int[] getAccessibleSlotsFromSide(int side) { + if(mih != null) { + final int[] as = new int[mih.getItemTypeCapacity()]; + for(int i = 0; i < mih.getItemTypeCapacity(); i++) { + as[i] = i; + } + return as; + } else { + return new int[1]; + } + } + + @Override + public boolean canInsertItem(int slot, ItemStack itemStack, int side) { + return isItemValidForSlot(slot, itemStack); + } + + @Override + public boolean canExtractItem(int slot, ItemStack itemStack, int side) { + return (mih != null) ? true : false; + } + } -- cgit From 872412284b1a4b31bbf47e3e1deb861675aa6b2b Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Mon, 2 Mar 2020 01:52:50 +0100 Subject: added maintenance hatch to tfft tooltip --- src/main/java/tileentities/GTMTE_FluidMultiStorage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java index 221fd03a49..05af3faad5 100644 --- a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java +++ b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java @@ -85,6 +85,7 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { .addEnergyHatch("Any top or bottom casing") .addOtherStructurePart("Inner 3x7x3 tube", "Storage Field Blocks") .addOtherStructurePart("Outer 5x7x5 glass shell", "AE2 Quartz Glass of Vanilla Stained Glass") + .addMaintenanceHatch("Instead of any casing or glass, have to touch storage field.") .addIOHatches("Instead of any casing or glass, have to touch storage field. True for the Multi-Hatch as well.") .signAndFinalize("Kekzdealer"); if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { @@ -118,7 +119,7 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { @Override public boolean checkRecipe(ItemStack guiSlotItem) { - this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; + super.mEfficiency = 10000 - (super.getIdealStatus() - super.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; this.mEUt = runningCost; super.mMaxProgresstime = 10; -- cgit From ff7b23c1f50fcf8a92e9061f52f516f0b38d3daa Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Mon, 2 Mar 2020 02:42:50 +0100 Subject: tfft scanner data should now correctly show power usage during maintenance issues --- src/main/java/tileentities/GTMTE_FluidMultiStorage.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java index 05af3faad5..9ac2dd887a 100644 --- a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java +++ b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java @@ -120,8 +120,8 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { public boolean checkRecipe(ItemStack guiSlotItem) { super.mEfficiency = 10000 - (super.getIdealStatus() - super.getRepairStatus()) * 1000; - this.mEfficiencyIncrease = 10000; - this.mEUt = runningCost; + super.mEfficiencyIncrease = 10000; + super.mEUt = runningCost; super.mMaxProgresstime = 10; // If there are no basic I/O hatches, let multi hatches handle it and skip a lot of code! @@ -492,7 +492,9 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET); ll.add("Auto-voiding: " + doVoidExcess); ll.add("Per-Fluid Capacity: " + mfh.getCapacity() + "L"); - ll.add("Running Cost: " + (-super.mEUt) + "EU/t"); + ll.add("Running Cost: " + // mEUt does not naturally reflect efficiency status. Do that here. + + ((-super.mEUt) * 10000 / Math.max(1000, super.mEfficiency)) + "EU/t"); ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus()) ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET)); -- cgit From 03a0e592bd88a5609c45b0f605ab38ac07047c7f Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Wed, 4 Mar 2020 15:18:44 +0100 Subject: removed WIP things for v0.2.3 bug fix release --- src/main/java/kekztech/KekzCore.java | 36 +++++++++++----------- .../java/tileentities/GTMTE_FluidMultiStorage.java | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index 64e1298d3c..baf84cd18f 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -85,7 +85,7 @@ public class KekzCore { ErrorItem.getInstance().registerItem(); MetaItem_ReactorComponent.getInstance().registerItem(); MetaItem_CraftingComponent.getInstance().registerItem(); - Item_Configurator.getInstance().registerItem(); + // disabled for release; Item_Configurator.getInstance().registerItem(); Items.registerOreDictNames(); // Blocks Block_YSZUnit.getInstance().registerBlock(); @@ -100,18 +100,18 @@ public class KekzCore { Block_ReactorChamber_OFF.getInstance().registerBlock(); Block_ReactorChamber_ON.getInstance().registerBlock(); Block_ControlRod.getInstance().registerBlock(); - Block_ItemServerDrive.getInstance().registerBlock(); - Block_ItemServerRackCasing.getInstance().registerBlock(); - Block_ItemServerIOPort.getInstance().registerBlock(); - Block_ItemProxyCable.getInstance().registerBlock(); - Block_ItemProxySource.getInstance().registerBlock(); - Block_ItemProxyEndpoint.getInstance().registerBlock(); + // disabled for release; Block_ItemServerDrive.getInstance().registerBlock(); + // disabled for release; Block_ItemServerRackCasing.getInstance().registerBlock(); + // disabled for release; Block_ItemServerIOPort.getInstance().registerBlock(); + // disabled for release; Block_ItemProxyCable.getInstance().registerBlock(); + // disabled for release; Block_ItemProxySource.getInstance().registerBlock(); + // disabled for release; Block_ItemProxyEndpoint.getInstance().registerBlock(); // Register TileEntities GameRegistry.registerTileEntity(TE_TFFTMultiHatch.class, "kekztech_tfftmultihatch_tile"); - GameRegistry.registerTileEntity(TE_ItemServerIOPort.class, "kekztech_itemserverioport_tile"); - GameRegistry.registerTileEntity(TE_ItemProxyCable.class, "kekztech_itemproxycable_tile"); - GameRegistry.registerTileEntity(TE_ItemProxySource.class, "kekztech_itemproxysource_tile"); - GameRegistry.registerTileEntity(TE_ItemProxyEndpoint.class, "kekztech_itemproxyendpoint_tile"); + // disabled for release; GameRegistry.registerTileEntity(TE_ItemServerIOPort.class, "kekztech_itemserverioport_tile"); + // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxyCable.class, "kekztech_itemproxycable_tile"); + // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxySource.class, "kekztech_itemproxysource_tile"); + // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxyEndpoint.class, "kekztech_itemproxyendpoint_tile"); // Register guis NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); @@ -124,9 +124,9 @@ public class KekzCore { sofc2 = new GTMTE_SOFuelCellMK2(13102, "multimachine.fuelcellmk2", "Solid-Oxide Fuel Cell Mk II"); mdr = new GTMTE_ModularNuclearReactor(13103, "multimachine.nuclearreactor", "Nuclear Reactor"); fms = new GTMTE_FluidMultiStorage(13104, "multimachine.tf_fluidtank", "T.F.F.T"); - is = new GTMTE_ItemServer(13105, "multimachine.itemserver", "Item Server"); + // disabled for release; is = new GTMTE_ItemServer(13105, "multimachine.itemserver", "Item Server"); // Register renderer - ConduitRenderer.getInstance().registerRenderer(); + // disabled for release; ConduitRenderer.getInstance().registerRenderer(); } @Mod.EventHandler @@ -165,7 +165,7 @@ public class KekzCore { 'C', OrePrefixes.circuit.get(Materials.Data) }; GT_ModHandler.addCraftingRecipe(fms.getStackForm(1), tfft_recipe); - final Object[] is_recipe = { + /*final Object[] is_recipe = { "FRF", "CGC", "PZP", 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1), 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.TungstenSteel, 1), @@ -174,7 +174,7 @@ public class KekzCore { 'P', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.VanadiumGallium, 1), 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1) }; - GT_ModHandler.addCraftingRecipe(is.getStackForm(1), is_recipe); + GT_ModHandler.addCraftingRecipe(is.getStackForm(1), is_recipe);*/ // Ceramic Electrolyte Units @@ -204,7 +204,7 @@ public class KekzCore { 2400, 1920); // Item Server Structure blocks - final Object[] is_rack_recipe = { + /*final Object[] is_rack_recipe = { "BRB", "CFC", "BRB", 'B', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlueSteel, 1), 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Aluminium, 1), @@ -245,7 +245,7 @@ public class KekzCore { is_drive, FluidRegistry.getFluidStack("molten.polyethylene", 1152), new ItemStack(Block_ItemServerDrive.getInstance(), 1), - 200, 7680); + 200, 7680);*/ // T.F.F.T Structure blocks final ItemStack[] tfftcasing = { @@ -321,7 +321,7 @@ public class KekzCore { tfftstoragefield5, FluidRegistry.getFluidStack("molten.epoxid", 1152), new ItemStack(Block_TFFTStorageFieldBlockT5.getInstance(), 1), - 400, 4098); + 400, 6147); final Object[] multi_hatch = { "PRP", "UFU", "PRP", 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.NiobiumTitanium, 1), diff --git a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java index 9ac2dd887a..07e0a56151 100644 --- a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java +++ b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java @@ -85,7 +85,7 @@ public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { .addEnergyHatch("Any top or bottom casing") .addOtherStructurePart("Inner 3x7x3 tube", "Storage Field Blocks") .addOtherStructurePart("Outer 5x7x5 glass shell", "AE2 Quartz Glass of Vanilla Stained Glass") - .addMaintenanceHatch("Instead of any casing or glass, have to touch storage field.") + .addMaintenanceHatch("Instead of any casing or glass, has to touch storage field.") .addIOHatches("Instead of any casing or glass, have to touch storage field. True for the Multi-Hatch as well.") .signAndFinalize("Kekzdealer"); if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { -- cgit From 193e453b3fc84f2b2c8ad90db6372ca9f48abca4 Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Wed, 4 Mar 2020 16:22:09 +0100 Subject: updated version number --- src/main/java/kekztech/KekzCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index baf84cd18f..c7fe8df8ee 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -67,7 +67,7 @@ public class KekzCore { public static final String NAME = "KekzTech"; public static final String MODID = "kekztech"; - public static final String VERSION = "0.2.2"; + public static final String VERSION = "0.2.3"; @Mod.Instance("kekztech") public static KekzCore instance; -- cgit From 60554a28fc5b2d0753a8c63935b00b9ba84ea058 Mon Sep 17 00:00:00 2001 From: kekzdealer Date: Wed, 11 Mar 2020 20:36:28 +0100 Subject: re-enabled WIP content for further dev work --- src/main/java/kekztech/KekzCore.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index c7fe8df8ee..368ea6f185 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -85,7 +85,7 @@ public class KekzCore { ErrorItem.getInstance().registerItem(); MetaItem_ReactorComponent.getInstance().registerItem(); MetaItem_CraftingComponent.getInstance().registerItem(); - // disabled for release; Item_Configurator.getInstance().registerItem(); + Item_Configurator.getInstance().registerItem(); Items.registerOreDictNames(); // Blocks Block_YSZUnit.getInstance().registerBlock(); @@ -100,18 +100,18 @@ public class KekzCore { Block_ReactorChamber_OFF.getInstance().registerBlock(); Block_ReactorChamber_ON.getInstance().registerBlock(); Block_ControlRod.getInstance().registerBlock(); - // disabled for release; Block_ItemServerDrive.getInstance().registerBlock(); - // disabled for release; Block_ItemServerRackCasing.getInstance().registerBlock(); - // disabled for release; Block_ItemServerIOPort.getInstance().registerBlock(); - // disabled for release; Block_ItemProxyCable.getInstance().registerBlock(); - // disabled for release; Block_ItemProxySource.getInstance().registerBlock(); - // disabled for release; Block_ItemProxyEndpoint.getInstance().registerBlock(); + Block_ItemServerDrive.getInstance().registerBlock(); + Block_ItemServerRackCasing.getInstance().registerBlock(); + Block_ItemServerIOPort.getInstance().registerBlock(); + Block_ItemProxyCable.getInstance().registerBlock(); + Block_ItemProxySource.getInstance().registerBlock(); + Block_ItemProxyEndpoint.getInstance().registerBlock(); // Register TileEntities GameRegistry.registerTileEntity(TE_TFFTMultiHatch.class, "kekztech_tfftmultihatch_tile"); - // disabled for release; GameRegistry.registerTileEntity(TE_ItemServerIOPort.class, "kekztech_itemserverioport_tile"); - // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxyCable.class, "kekztech_itemproxycable_tile"); - // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxySource.class, "kekztech_itemproxysource_tile"); - // disabled for release; GameRegistry.registerTileEntity(TE_ItemProxyEndpoint.class, "kekztech_itemproxyendpoint_tile"); + GameRegistry.registerTileEntity(TE_ItemServerIOPort.class, "kekztech_itemserverioport_tile"); + GameRegistry.registerTileEntity(TE_ItemProxyCable.class, "kekztech_itemproxycable_tile"); + GameRegistry.registerTileEntity(TE_ItemProxySource.class, "kekztech_itemproxysource_tile"); + GameRegistry.registerTileEntity(TE_ItemProxyEndpoint.class, "kekztech_itemproxyendpoint_tile"); // Register guis NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); @@ -124,9 +124,9 @@ public class KekzCore { sofc2 = new GTMTE_SOFuelCellMK2(13102, "multimachine.fuelcellmk2", "Solid-Oxide Fuel Cell Mk II"); mdr = new GTMTE_ModularNuclearReactor(13103, "multimachine.nuclearreactor", "Nuclear Reactor"); fms = new GTMTE_FluidMultiStorage(13104, "multimachine.tf_fluidtank", "T.F.F.T"); - // disabled for release; is = new GTMTE_ItemServer(13105, "multimachine.itemserver", "Item Server"); + is = new GTMTE_ItemServer(13105, "multimachine.itemserver", "Item Server"); // Register renderer - // disabled for release; ConduitRenderer.getInstance().registerRenderer(); + ConduitRenderer.getInstance().registerRenderer(); } @Mod.EventHandler -- cgit From 1164ce897327ccd9103a05d99103314d44b06138 Mon Sep 17 00:00:00 2001 From: Christina Berchtold Date: Sun, 29 Mar 2020 21:34:34 +0200 Subject: added first code to make multi hatch auto-output --- src/main/java/tileentities/TE_TFFTMultiHatch.java | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'src') diff --git a/src/main/java/tileentities/TE_TFFTMultiHatch.java b/src/main/java/tileentities/TE_TFFTMultiHatch.java index 94d7d9283a..1f92f924c4 100644 --- a/src/main/java/tileentities/TE_TFFTMultiHatch.java +++ b/src/main/java/tileentities/TE_TFFTMultiHatch.java @@ -2,7 +2,13 @@ package tileentities; import java.util.List; +import blocks.Block_TFFTStorageFieldBlockT1; +import blocks.Block_TFFTStorageFieldBlockT2; +import blocks.Block_TFFTStorageFieldBlockT3; +import blocks.Block_TFFTStorageFieldBlockT4; +import blocks.Block_TFFTStorageFieldBlockT5; import kekztech.MultiFluidHandler; +import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; @@ -13,12 +19,86 @@ import net.minecraftforge.fluids.IFluidHandler; public class TE_TFFTMultiHatch extends TileEntity implements IFluidHandler { + private static final int OUTPUT_SPEED = 100; // L/s + private MultiFluidHandler mfh; + private int tickCounter = 0; public void setMultiFluidHandler(MultiFluidHandler mfh) { + System.out.println("Set MFH"); this.mfh = mfh; } + @Override + public void updateEntity() { + tickCounter++; + if(tickCounter == 100 && mfh != null) { + + final ForgeDirection d = getOutwardsFacingDirection(); + if(d == ForgeDirection.UNKNOWN) { + return; + } + final TileEntity t = this.getWorldObj().getTileEntity( + this.xCoord + d.offsetX, + this.yCoord + d.offsetY, + this.zCoord + d.offsetZ); + + if(t != null && t instanceof IFluidHandler) { + + final IFluidHandler fh = (IFluidHandler) t; + + System.out.println("Found connecting tank"); + + // Cycle through fluids + for(FluidStack volume : mfh.getFluids()) { + + // Use API methods + if(fh.canFill(d.getOpposite(), volume.getFluid())) { + System.out.println("Can fill " + volume.getLocalizedName()); + + // Test how much can be output + final FluidStack copy = volume.copy(); + copy.amount = Math.min(volume.amount, OUTPUT_SPEED); + + final int drawn = mfh.pullFluid(copy, false); + copy.amount = drawn; + + System.out.println("Can output " + copy.amount + "L of" + copy.getLocalizedName()); + + // Test how much can be filled (and fill if possible) + final int filled = fh.fill(d.getOpposite(), copy, true); + copy.amount = Math.min(drawn, filled); + + // Actually deplete storage + mfh.pullFluid(copy, true); + } + } + } + + tickCounter = 0; + } + } + + private ForgeDirection getOutwardsFacingDirection() { + // TODO Revisit this once the hatch has a facing side + // Look up which side has the storage field block and choose the other side. + // This is important so the tank doesn't output into itself in case + // there is another hatch next to this one. + for(ForgeDirection direction : ForgeDirection.values()) { + + final Block b = this.getWorldObj().getBlock(this.xCoord + direction.offsetX, this.yCoord + direction.offsetY, this.zCoord + direction.offsetZ); + if(b != null && ( + b.equals(Block_TFFTStorageFieldBlockT1.getInstance()) + || b.equals(Block_TFFTStorageFieldBlockT2.getInstance()) + || b.equals(Block_TFFTStorageFieldBlockT3.getInstance()) + || b.equals(Block_TFFTStorageFieldBlockT4.getInstance()) + || b.equals(Block_TFFTStorageFieldBlockT5.getInstance()))) { + return direction.getOpposite(); + } + } + return ForgeDirection.UNKNOWN; + } + @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { return (mfh != null) ? mfh.pushFluid(resource, doFill) : 0; -- cgit From 7f927621de00e55ad6cedca256a6f54cfa12c2be Mon Sep 17 00:00:00 2001 From: Christina Berchtold Date: Sun, 19 Apr 2020 21:06:33 +0200 Subject: New TC jar textures --- src/main/java/blocks/Block_IchorJar.java | 46 +++++++++++ .../java/blocks/Block_ThaumiumReinforcedJar.java | 90 +++++++++++++++++++++ src/main/java/items/Item_IchorJarFilled.java | 24 ++++++ .../items/Item_ThaumiumReinforcedJarFilled.java | 62 ++++++++++++++ src/main/java/kekztech/KekzCore.java | 15 ++++ src/main/java/tileentities/TE_IchorJar.java | 10 +++ .../tileentities/TE_ThaumiumReinforcedJar.java | 10 +++ src/main/resources/assets/kekztech/lang/en_US.lang | 6 ++ .../kekztech/textures/blocks/ichor_jar_bottom.png | Bin 0 -> 384 bytes .../kekztech/textures/blocks/ichor_jar_side.png | Bin 0 -> 465 bytes .../kekztech/textures/blocks/ichor_jar_top.png | Bin 0 -> 547 bytes .../assets/kekztech/textures/blocks/jar_bottom.png | Bin 0 -> 566 bytes .../assets/kekztech/textures/blocks/jar_side.png | Bin 0 -> 718 bytes .../kekztech/textures/blocks/jar_side_void.png | Bin 0 -> 607 bytes .../assets/kekztech/textures/blocks/jar_top.png | Bin 0 -> 670 bytes .../kekztech/textures/blocks/jar_top_void.png | Bin 0 -> 562 bytes 16 files changed, 263 insertions(+) create mode 100644 src/main/java/blocks/Block_IchorJar.java create mode 100644 src/main/java/blocks/Block_ThaumiumReinforcedJar.java create mode 100644 src/main/java/items/Item_IchorJarFilled.java create mode 100644 src/main/java/items/Item_ThaumiumReinforcedJarFilled.java create mode 100644 src/main/java/tileentities/TE_IchorJar.java create mode 100644 src/main/java/tileentities/TE_ThaumiumReinforcedJar.java create mode 100644 src/main/resources/assets/kekztech/textures/blocks/ichor_jar_bottom.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/ichor_jar_side.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/ichor_jar_top.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/jar_bottom.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/jar_side.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/jar_side_void.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/jar_top.png create mode 100644 src/main/resources/assets/kekztech/textures/blocks/jar_top_void.png (limited to 'src') diff --git a/src/main/java/blocks/Block_IchorJar.java b/src/main/java/blocks/Block_IchorJar.java new file mode 100644 index 0000000000..bc046ae3b4 --- /dev/null +++ b/src/main/java/blocks/Block_IchorJar.java @@ -0,0 +1,46 @@ +package blocks; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import thaumcraft.common.blocks.BlockJar; +import tileentities.TE_IchorJar; + +public class Block_IchorJar extends BlockJar { + + private static Block_IchorJar instance = new Block_IchorJar(); + + private Block_IchorJar() { + super(); + } + + public static Block_IchorJar getInstance() { + return instance; + } + + public void registerBlock() { + final String blockName = "kekztech_ichorjar_block"; + super.setBlockName(blockName); + GameRegistry.registerBlock(getInstance(), blockName); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ir) { + super.iconLiquid = ir.registerIcon("thaumcraft:animatedglow"); + super.iconJarSide = ir.registerIcon("kekztech:ichor_jar_side"); + super.iconJarTop = ir.registerIcon("kekztech:ichor_jar_top"); + super.iconJarTopVoid = ir.registerIcon("kekztech:ichor_jar_top_void"); + super.iconJarSideVoid = ir.registerIcon("kekztech:jar_side_void"); + super.iconJarBottom = ir.registerIcon("kekztech:ichor_jar_bottom"); + } + + @Override + public TileEntity createTileEntity(World world, int meta) { + return new TE_IchorJar(); + } + +} diff --git a/src/main/java/blocks/Block_ThaumiumReinforcedJar.java b/src/main/java/blocks/Block_ThaumiumReinforcedJar.java new file mode 100644 index 0000000000..29736a14f9 --- /dev/null +++ b/src/main/java/blocks/Block_ThaumiumReinforcedJar.java @@ -0,0 +1,90 @@ +package blocks; + +import java.util.ArrayList; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import items.Item_ThaumiumReinforcedJarFilled; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.common.blocks.BlockJar; +import thaumcraft.common.blocks.ItemJarFilled; +import thaumcraft.common.tiles.TileJarFillable; +import thaumcraft.common.tiles.TileJarFillableVoid; +import tileentities.TE_ThaumiumReinforcedJar; + +public class Block_ThaumiumReinforcedJar extends BlockJar { + + private static Block_ThaumiumReinforcedJar instance = new Block_ThaumiumReinforcedJar(); + + private Block_ThaumiumReinforcedJar() { + super(); + } + + public static Block_ThaumiumReinforcedJar getInstance() { + return instance; + } + + public void registerBlock() { + final String blockName = "kekztech_thaumiumreinforcedjar_block"; + super.setBlockName(blockName); + GameRegistry.registerBlock(getInstance(), blockName); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ir) { + super.iconLiquid = ir.registerIcon("thaumcraft:animatedglow"); + super.iconJarSide = ir.registerIcon("kekztech:jar_side"); + super.iconJarTop = ir.registerIcon("kekztech:jar_top"); + super.iconJarTopVoid = ir.registerIcon("kekztech:jar_top_void"); + super.iconJarSideVoid = ir.registerIcon("kekztech:jar_side_void"); + super.iconJarBottom = ir.registerIcon("kekztech:jar_bottom"); + } + + @Override + public TileEntity createTileEntity(World world, int meta) { + return new TE_ThaumiumReinforcedJar(); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) { + final ArrayList drops = new ArrayList<>(); + + TileEntity te; + ItemStack drop; + + te = world.getTileEntity(x, y, z); + if(te != null && te instanceof TileJarFillable) { + drop = new ItemStack(Item_ThaumiumReinforcedJarFilled.getInstance()); + // Empty and no label + if(((TileJarFillable) te).amount <= 0 && ((TileJarFillable) te).aspectFilter == null) { + drop = new ItemStack(this); + } + // If is void jar, set meta + if(te instanceof TileJarFillableVoid) { + drop.setItemDamage(3); + } + // Non empty, generate filled jar item with contents + if(((TileJarFillable) te).amount > 0) { + ((ItemJarFilled) drop.getItem()).setAspects(drop, + (new AspectList()).add(((TileJarFillable) te).aspect, ((TileJarFillable) te).amount)); + } + // has label + if(((TileJarFillable) te).aspectFilter != null) { + if(!drop.hasTagCompound()) { + drop.setTagCompound(new NBTTagCompound()); + } + drop.stackTagCompound.setString("AspectFilter", ((TileJarFillable) te).aspectFilter.getTag()); + } + drops.add(drop); + } + return drops; + } + +} diff --git a/src/main/java/items/Item_IchorJarFilled.java b/src/main/java/items/Item_IchorJarFilled.java new file mode 100644 index 0000000000..19c2ace122 --- /dev/null +++ b/src/main/java/items/Item_IchorJarFilled.java @@ -0,0 +1,24 @@ +package items; + +import cpw.mods.fml.common.registry.GameRegistry; +import thaumcraft.common.blocks.ItemJarFilled; + +public class Item_IchorJarFilled extends ItemJarFilled { + + private static final Item_IchorJarFilled instance = new Item_IchorJarFilled(); + + private Item_IchorJarFilled() { + super(); + } + + public static Item_IchorJarFilled getInstance() { + return instance; + } + + public void registerItem() { + super.setHasSubtypes(false); + final String unlocalizedName = "kekztech_ichorjarfilled_item"; + super.setUnlocalizedName(unlocalizedName); + GameRegistry.registerItem(getInstance(), unlocalizedName); + } +} diff --git a/src/main/java/items/Item_ThaumiumReinforcedJarFilled.java b/src/main/java/items/Item_ThaumiumReinforcedJarFilled.java new file mode 100644 index 0000000000..cc4be0e247 --- /dev/null +++ b/src/main/java/items/Item_ThaumiumReinforcedJarFilled.java @@ -0,0 +1,62 @@ +package items; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import thaumcraft.common.blocks.ItemJarFilled; + +public class Item_ThaumiumReinforcedJarFilled extends ItemJarFilled { + + private static final Item_ThaumiumReinforcedJarFilled instance = new Item_ThaumiumReinforcedJarFilled(); + + private Item_ThaumiumReinforcedJarFilled() { + super(); + } + + public static Item_ThaumiumReinforcedJarFilled getInstance() { + return instance; + } + + public void registerItem() { + super.setHasSubtypes(false); + final String unlocalizedName = "kekztech_thaumiumreinforcedjarfilled_item"; + super.setUnlocalizedName(unlocalizedName); + GameRegistry.registerItem(getInstance(), unlocalizedName); + } + /* + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, Worl