aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2023-09-04 03:05:22 +0100
committerGitHub <noreply@github.com>2023-09-04 03:05:22 +0100
commit76719d65a90d98e228a914774d3b11ed9f01ac8e (patch)
treece0d35f954e441e9cc4aa95aa347073728e6f4ee /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
parent0393b582eb3edcb5c575330804b6747577a55e27 (diff)
downloadGT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.gz
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.bz2
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.zip
Clean-up v2 (#729)
* Remove test items from NEI with no texture * Add number formatting to hand pumps * Remove heavy plates (no recipes & completely unused). * Remove helium generator (no texture, no recipe) * Remove fire pit and fire starter (no use, no recipe, no textures) * Remove giant chicken and associated unused stuff, has no texture and is unobtainable. Used to be relevant but isn't anymore. * Remove villagers with silly trades like 1 motor + 1 hull = 1 hull. Why? * Remove trade bench, no recipe, missing textures. Unused. * Remove farm processors, no texture, no recipe. Unused. * Remove MAX tier components, these exist in GT now, have no recipe here and are unused. * Hide untextured light block from NEI * Update buildscript * Remove unused backpacks, no recipe and contains dupe bugs. Bad. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. part 2 * Remove dragon catcher (what?), no texture, no recipe, unused. * Remove empty item, does nothing, has no recipe, no idea why it is here. * Empty item v2 removal * Revert "Empty item v2 removal" This reverts commit 75bcd3ccfaf55bbfe2c12b2e4167d5c37636030d. * Revert "Remove empty item, does nothing, has no recipe, no idea why it is here." This reverts commit e41a9f484392776331c58530ab1faa5ef978ef36. * Remove debug square. No recipe, unused. * Number formatting overflow covers * Remove JVM garbage collection block. Unused, no recipe. * Remove nanotubes, no recipe for them. Unused. * Remove "git" item, doesn't seem to work. Has no recipe. * Remove uncraftable food with awful textures. * Remove "bat king" mob, unused content. Does not spawn. * Remove uncraftable doors with bad textures. Unused content. * Remove uncraftable, unlocalised redstone stuff that crashes game when placed. * Remove weird spawner item. No recipe, does not exist in world. * Remove sunnarium bit, no recipe, no usage. * Remove unused modularity table and some misc uncraftable, unused items. * Remove Interconnecting Storage Crate, no recipe, unused. * Delete worse debug power gen, this already exists as part of GT. Unneeded duplication. * Delete unused placeholder circuit * Delete uncraftable generator hatches. * Spotless * Remove XP tank thing, unused and uncraftable. * Remove null item, this fluid registry only seemed to register one null fluid. All others exist? * Remove EU -> RF battery. Unused in GTNH. * Remove some shelf nonsense, why is this in this mod? * Remove some weird random tools. These have no realistic usage in GTNH. * Remove firemaker. Useless in GTNH. * Removed helium blob. Deprecated item, not used anymore, uncraftable. * spotlessApply (#730) Co-authored-by: GitHub GTNH Actions <> * Stop modulators generating unused blocks with no textures * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove some weird methods and uncraftable mining parts, probably part of deprecated multiblock. * spotlessApply (#732) Co-authored-by: GitHub GTNH Actions <> * Remove gem shards, unused. * Remove unused atoms * Remove unused gum * Remove unused elements/materials * Bye bye * Remove some unused reflection stuff * Remove control cores, obsolete now. * Remove mob killing thing with no texture and no recipe. * Remove uncraftable covers * Remove pizza gloves * Net and rope removal, unused * Remove force crop * Removal of some old event stuff * Remove unused nuclear chem items * Remove player safe, mostly because of the horrible event code that was intercepting every block break. I can't see any real usage of this via discord. * Remove Force material and associated other nonsense. Also remove some nuclear chem stuff. * Remove force for realsies * Skookum Chooker purge. * Remove some enderio compat, these plates/dusts are added via GT5 anyway now. This is obsolete. * spotlessApply (#733) Co-authored-by: GitHub GTNH Actions <> * Unused textures * Bump dep * Revert "Remove force for realsies" This reverts commit 0d288912a99f9dabce56d2a2623d4d3510f4804e. * Revert "Remove Force material and associated other nonsense. Also remove some nuclear chem stuff." This reverts commit 3455e6e916defe1f2aef923be6f9696a6cf3095b. * Remove nuclear items that are unused * spotlessApply (#734) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Connor Colenso <colen@CONNORSPC> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java166
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java289
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java98
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java328
4 files changed, 5 insertions, 876 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
deleted file mode 100644
index e85cc1f6c2..0000000000
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import org.apache.commons.lang3.ArrayUtils;
-
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.item.general.ItemControlCore;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-
-public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch {
-
- public GT_Recipe_Map mRecipeMap = null;
-
- public BlockPos mControllerLocation;
-
- public GT_MetaTileEntity_Hatch_ControlCore(int aID, String aName, String aNameRegional, int aTier) {
- super(
- aID,
- aName,
- aNameRegional,
- aTier,
- getSlots(aTier),
- "Core determines maximum tier machine will operate at");
- }
-
- public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
- super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription[0], aTextures);
- }
-
- @Override
- public String[] getDescription() {
- return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get());
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) };
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) };
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(ForgeDirection facing) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_ControlCore(mName, mTier, mDescriptionArray, mTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- }
- }
-
- public void updateSlots() {
- for (int i = 0; i < mInventory.length; i++)
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
- fillStacksIntoFirstSlots();
- }
-
- protected void fillStacksIntoFirstSlots() {
- for (int i = 0; i < mInventory.length; i++)
- for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null
- && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) {
- GT_Utility.moveStackFromSlotAToSlotB(
- getBaseMetaTileEntity(),
- getBaseMetaTileEntity(),
- j,
- i,
- (byte) 64,
- (byte) 1,
- (byte) 64,
- (byte) 1);
- }
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
- ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
- ItemStack aStack) {
- return side == getBaseMetaTileEntity().getFrontFacing()
- && (aStack != null && aStack.getItem() instanceof ItemControlCore);
- }
-
- public boolean setOwner(TileEntity aTileEntity) {
- if (mControllerLocation != null) {
- return false;
- } else {
- mControllerLocation = new BlockPos(aTileEntity);
- return true;
- }
- }
-
- public boolean setOwner(IGregTechTileEntity aTileEntity) {
- if (mControllerLocation != null) {
- return false;
- } else {
- mControllerLocation = new BlockPos(aTileEntity);
- return true;
- }
- }
-
- @Override
- public boolean useModularUI() {
- return true;
- }
-
- @Override
- public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- getBaseMetaTileEntity().add1by1Slot(builder);
- }
-}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java
deleted file mode 100644
index 3fd3c7a82b..0000000000
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java
+++ /dev/null
@@ -1,289 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-
-import static gregtech.api.enums.GT_Values.V;
-
-import java.util.HashMap;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.InventoryUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-
-public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_Energy {
-
- public GT_MetaTileEntity_Hatch_Energy_RTG(int aID, String aName, String aNameRegional, int aTier,
- int aInvSlotCount) {
- super(
- aID,
- aName,
- aNameRegional,
- aTier,
- aInvSlotCount,
- new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" });
- }
-
- public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, int aInvSlotCount, String[] aDescription,
- ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public String[] getDescription() {
- String[] S = super.getDescription();
- final String[] desc = new String[S.length + 1];
- System.arraycopy(S, 0, desc, 0, S.length);
- desc[S.length] = CORE.GT_Tooltip.get();
- return desc;
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, TexturesGtBlock
- .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] { 220, 220, 220, 0 }) };
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture, TexturesGtBlock
- .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] { 220, 220, 220, 0 }) };
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(ForgeDirection facing) {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public boolean isInputFacing(ForgeDirection side) {
- return side == getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 0;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public long maxEUStore() {
- return Long.MAX_VALUE / (Short.MAX_VALUE * Byte.MAX_VALUE);
- }
-
- @Override
- public long maxAmperesIn() {
- return 0;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_Energy_RTG(mName, mTier, 9, mDescriptionArray, mTextures);
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
- ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
- ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
- return true;
- }
-
- private static class Dat {
-
- protected final String mUniqueDataTag;
- private final ItemStack mStack;
- private final NBTTagCompound mNBT;
-
- public Dat(ItemStack aStack) {
- mStack = aStack;
- mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound());
- mUniqueDataTag = "" + Item
- .getIdFromItem(aStack.getItem()) + "" + aStack.getItemDamage() + "" + 1 + "" + mNBT.getId();
- }
-
- public int getKey() {
- return Item.getIdFromItem(mStack.getItem()) + mStack.getItemDamage();
- }
- }
-
- private static final HashMap<String, ItemStack> mFuelInstanceMap = new HashMap<String, ItemStack>();
- private static final HashMap<String, Long> mFuelValueMap = new HashMap<String, Long>();
- private static final HashMap<String, Integer> mFuelTypeMap = new HashMap<String, Integer>();
- private static final HashMap<Integer, String> mFuelTypeMapReverse = new HashMap<Integer, String>();
-
- public static boolean registerPelletForHatch(ItemStack aStack, long aFuelValue) {
- if (!ItemUtils.checkForInvalidItems(aStack)) {
- return false;
- }
- ItemStack aTemp = aStack.copy();
- aTemp.stackSize = 1;
- Dat aDat = new Dat(aTemp);
- String aKey = aDat.mUniqueDataTag;
- mFuelInstanceMap.put(aKey, aTemp);
- mFuelValueMap.put(aKey, aFuelValue);
- mFuelTypeMap.put(aKey, aDat.getKey());
- mFuelTypeMapReverse.put(aDat.getKey(), aKey);
- Logger.INFO(
- "RTG Hatch: Registered Fuel Pellet: " + ItemUtils.getItemName(
- aTemp) + ", Fuel Value: " + aFuelValue + ", Key: " + aKey + ", Key2: " + aDat.getKey());
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
- InventoryUtils.sortInventoryItems(this);
- }
- if (aTimer % 100 == 0 && aBaseMetaTileEntity.isServerSide()) {
- if (hasPellet(this)) {
- Logger.INFO("Has Pellet");
- tryConsumePellet(this);
- }
- }
- }
-
- private static void tryConsumePellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- ItemStack aPellet = getPelletToConsume(aTile);
- if (aPellet != null) {
- Logger.INFO("Found Pellet");
- long aFuel = getFuelValueOfPellet(aPellet);
- if (aFuel > 0) {
- Logger.INFO("Has Fuel Value: " + aFuel);
- if (hasSpaceForEnergy(aTile, aFuel)) {
- Logger.INFO("Can buffer");
- aPellet.stackSize = 0;
- Logger.INFO("Stack set to 0");
- aPellet = null;
- Logger.INFO("null stack");
- addEnergyToInternalStorage(aTile, aFuel);
- Logger.INFO("Consumed");
- }
- }
- }
- aTile.updateSlots();
- Logger.INFO("updating slots");
- }
-
- private static void addEnergyToInternalStorage(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aFuel) {
- aTile.getBaseMetaTileEntity().increaseStoredEnergyUnits(aFuel, true);
- }
-
- public static boolean hasSpaceForEnergy(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aAmount) {
- long aMax = aTile.maxEUStore();
- long aCurrent = aTile.getEUVar();
- if ((aMax - aCurrent) >= aAmount) {
- return true;
- }
- return false;
- }
-
- public void updateSlots() {
- for (int i = 0; i < mInventory.length; i++) {
- if (mInventory[i] != null && mInventory[i].stackSize <= 0) {
- mInventory[i] = null;
- }
- }
- InventoryUtils.sortInventoryItems(this);
- }
-
- public static boolean hasPellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- for (ItemStack o : aTile.mInventory) {
- if (o != null) {
- for (ItemStack i : mFuelInstanceMap.values()) {
- if (GT_Utility.areStacksEqual(o, i)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static String getPelletType(ItemStack o) {
- if (o == null) {
- return "error";
- }
- Dat aDat = new Dat(o);
- return mFuelTypeMapReverse.get(aDat.getKey());
- }
-
- public static long getFuelValueOfPellet(ItemStack aPellet) {
- String aType = getPelletType(aPellet);
- if (mFuelValueMap.containsKey(aType)) {
- return mFuelValueMap.get(aType);
- }
- return 0;
- }
-
- public static ItemStack getPelletToConsume(GT_MetaTileEntity_Hatch_Energy_RTG aTile) {
- for (ItemStack o : aTile.mInventory) {
- if (o != null) {
- for (ItemStack i : mFuelInstanceMap.values()) {
- if (GT_Utility.areStacksEqual(o, i)) {
- return o;
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public boolean useModularUI() {
- return true;
- }
-
- @Override
- public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- getBaseMetaTileEntity().add3by3Slots(builder);
- }
-}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 3c567db889..194729a4a2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -83,7 +83,6 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.preloader.CORE_Preloader;
import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput;
@@ -102,7 +101,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
public GT_Recipe mLastRecipe;
protected long mTotalRunTime = 0;
- public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus = new ArrayList<>();
/**
* Don't use this for recipe input check, otherwise you'll get duplicated fluids
*/
@@ -168,7 +166,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
long seconds = (this.mTotalRunTime / 20);
int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
- long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7 * weeks);
+ long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days)
+ - TimeUnit.DAYS.toHours(7L * weeks);
long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60);
@@ -179,11 +178,11 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
mInfo.add(
StatCollector.translateToLocal("GTPP.multiblock.progress") + ": "
+ EnumChatFormatting.GREEN
- + Integer.toString(mProgresstime / 20)
+ + mProgresstime / 20
+ EnumChatFormatting.RESET
+ " s / "
+ EnumChatFormatting.YELLOW
- + Integer.toString(mMaxProgresstime / 20)
+ + mMaxProgresstime / 20
+ EnumChatFormatting.RESET
+ " s");
@@ -272,15 +271,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
+ " %");
}
- if (this.mControlCoreBus.size() > 0) {
- int tTier = this.getControlCoreTier();
- mInfo.add(
- StatCollector.translateToLocal("GTPP.CC.machinetier") + ": "
- + EnumChatFormatting.GREEN
- + tTier
- + EnumChatFormatting.RESET);
- }
-
mInfo.add(
StatCollector.translateToLocal("GTPP.CC.parallel") + ": "
+ EnumChatFormatting.GREEN
@@ -448,7 +438,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
if (this.mUpdate == 1 || this.mStartUpCheck == 1) {
this.mChargeHatches.clear();
this.mDischargeHatches.clear();
- this.mControlCoreBus.clear();
this.mAirIntakes.clear();
this.mTecTechEnergyHatches.clear();
this.mTecTechDynamoHatches.clear();
@@ -563,15 +552,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
super.updateSlots();
}
- public boolean isToolCreative(ItemStack mStack) {
- Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack);
- Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack);
- if (t1 == Materials._NULL && t2 == Materials._NULL) {
- return true;
- }
- return false;
- }
-
/**
* Causes a Random Maint. Issue.
*
@@ -705,59 +685,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
return false;
}
- public int getControlCoreTier() {
-
- // Always return best tier if config is off.
- /*
- * boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores; if (!aCoresConfig) {
- * return 10; }
- */
-
- if (mControlCoreBus.isEmpty()) {
- log("No Control Core Modules Found.");
- return 0;
- }
- GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus();
- if (i != null) {
- ItemStack x = i.mInventory[0];
- if (x != null) {
- return x.getItemDamage();
- }
- }
- log("Control Core Module was null.");
- return 0;
- }
-
- public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
- if (this.mControlCoreBus == null || this.mControlCoreBus.isEmpty()) {
- return null;
- }
- GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
- if (x != null) {
- log("getControlCore(ok)");
- return x;
- }
- log("getControlCore(bad)");
- return null;
- }
-
- // mControlCoreBus
- public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (!mControlCoreBus.isEmpty()) {
- log("Tried to add a secondary control core module.");
- return false;
- }
- GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity(
- aTileEntity);
- if (Module != null) {
- if (Module.setOwner(aTileEntity)) {
- log("Adding control core module.");
- return addToMachineListInternal(mControlCoreBus, Module, aBaseCasingIndex);
- }
- }
- return false;
- }
-
private IMetaTileEntity getMetaTileEntity(final IGregTechTileEntity aTileEntity) {
if (aTileEntity == null) {
return null;
@@ -780,14 +707,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
boolean aDidAdd = false;
// Handle Custom Hatches
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) {
- log("Found GT_MetaTileEntity_Hatch_ControlCore");
- if (!mControlCoreBus.isEmpty()) {
- log("Tried to add a secondary control core module.");
- return false;
- }
- aDidAdd = addToMachineListInternal(this.mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) {
log("Found GT_MetaTileEntity_Hatch_InputBattery");
aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) {
@@ -1782,14 +1702,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
return t.mAirIntakes.size();
}
},
- ControlCore(GregtechMeta_MultiBlockBase::addControlCoreToMachineList,
- GT_MetaTileEntity_Hatch_ControlCore.class) {
-
- @Override
- public long count(GregtechMeta_MultiBlockBase<?> t) {
- return t.mControlCoreBus.size();
- }
- },
TTDynamo(GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList,
"com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti") {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
deleted file mode 100644
index a53915b3d6..0000000000
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
+++ /dev/null
@@ -1,328 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines;
-
-import static gregtech.api.enums.GT_Values.V;
-
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
-import gregtech.api.objects.GT_RenderedTexture;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.core.util.player.PlayerCache;
-
-public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock {
-
- public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
- public int mSuccess = 0, mTargetStackSize = 0;
- public UUID ownerUUID;
-
- public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaSafeBlockBase(final String aName, final int aTier, final int aInvSlotCount,
- final String[] aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[6][17][];
- final ITexture tIcon = this.getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST),
- tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT);
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon }; // Back
- rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Right,
- // Strangely
- // The
- // top
- // side
- // as
- // well
- // when
- // facing
- // East?
- rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top
- // And
- // Bottom,
- // When
- // Facing
- // South
- // (What
- // the
- // hell?)
- rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Left,
- // Top
- // if
- // facing
- // West
- // and
- // Bottom
- // if
- // facing
- // east?
- rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top
- // and
- // Bottom
- // when
- // Facing
- // North..
- rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut }; // Front
- }
- return rTextures;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side,
- final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (side == facing) {
- return this.mTextures[5][aColorIndex + 1];
- }
- if (side.getOpposite() == facing) {
- return this.mTextures[0][aColorIndex + 1];
- }
- switch (facing) {
- case DOWN:
- return this.mTextures[4][aColorIndex + 1];
- case UP:
- return this.mTextures[2][aColorIndex + 1];
- case NORTH:
- switch (side) {
- case DOWN:
- return this.mTextures[2][aColorIndex + 1];
- case UP:
- return this.mTextures[2][aColorIndex + 1];
- case WEST:
- return this.mTextures[1][aColorIndex + 1];
- case EAST:
- return this.mTextures[3][aColorIndex + 1];
- }
- case SOUTH:
- switch (side) {
- case DOWN:
- return this.mTextures[4][aColorIndex + 1];
- case UP:
- return this.mTextures[4][aColorIndex + 1];
- case WEST:
- return this.mTextures[3][aColorIndex + 1];
- case EAST:
- return this.mTextures[1][aColorIndex + 1];
- }
- case WEST:
- switch (side) {
- case DOWN:
- return this.mTextures[3][aColorIndex + 1];
- case UP:
- return this.mTextures[1][aColorIndex + 1];
- case NORTH:
- return this.mTextures[3][aColorIndex + 1];
- case SOUTH:
- return this.mTextures[1][aColorIndex + 1];
- }
- case EAST:
- switch (side) {
- case DOWN:
- return this.mTextures[1][aColorIndex + 1];
- case UP:
- return this.mTextures[3][aColorIndex + 1];
- case NORTH:
- return this.mTextures[1][aColorIndex + 1];
- case SOUTH:
- return this.mTextures[3][aColorIndex + 1];
- }
- }
- return this.mTextures[5][aColorIndex + 1];
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < (this.mInventory.length - 1);
- }
-
- @Override
- public boolean isFacingValid(final ForgeDirection facing) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(final ForgeDirection side) {
- return !this.isOutputFacing(side);
- }
-
- @Override
- public boolean isOutputFacing(final ForgeDirection side) {
- return this.getBaseMetaTileEntity().getBackFacing() == side;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- @Override
- public long maxEUStore() {
- return 512 + (V[this.mTier] * 50);
- }
-
- @Override
- public long maxEUInput() {
- return V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return this.bOutput ? V[this.mTier] : 0;
- }
-
- @Override
- public long maxAmperesIn() {
- return 1;
- }
-
- @Override
- public long maxAmperesOut() {
- return 1;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- public abstract ITexture getOverlayIcon();
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
-
- if (aBaseMetaTileEntity.isClientSide()) {
- // Utils.LOG_WARNING("Clicky Clicky.");
- return true;
- }
- if (aPlayer != null) {
- final UUID tempUUID = aPlayer.getUniqueID();
- /*
- * if (!aPlayer.worldObj.isRemote){ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(),
- * aPlayer.getUniqueID().toString()); }
- */
- // Utils.LOG_INFO("test");
- if (this.ownerUUID == null) {
- Logger.INFO("No owner yet for this block.");
- } else {
- // Utils.LOG_INFO("test");
- Logger.INFO(
- "Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)
- + " - UUID: "
- + this.ownerUUID);
- }
- Logger.WARNING("Is ownerUUID Null");
- if (this.ownerUUID == null) {
- Logger.WARNING("OwnerUUID is Null, let's set it.");
- Logger.WARNING("Accessing Players UUID is: " + tempUUID);
- this.ownerUUID = tempUUID;
- // Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
- Logger.WARNING("Block Owner is now set to: " + this.ownerUUID);
- }
- Logger.WARNING("No, it is not.");
- Logger.WARNING("Checking ownerUUID.");
- if (this.ownerUUID != null) {
- Logger.WARNING("ownerUUID != Null, if accessor == owner.");
- Logger.WARNING("Accessing is: " + PlayerCache.lookupPlayerByUUID(tempUUID));
- if (this.ownerUUID.equals(tempUUID)) {
- Logger.WARNING("Owner's UUID: " + this.ownerUUID);
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
- // Utils.LOG_WARNING("GUI should now be open for you sir.");
- } else {
- PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
- PlayerUtils.messagePlayer(
- aPlayer,
- "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
- Logger.WARNING("Expecting Player : " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
- Logger.ERROR("Access Denied.");
- return true;
- }
- }
-
- /*
- * else { Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke."); }
- */
- /*
- * Utils.LOG_WARNING("Clicky Clicky."); Utils.messagePlayer(aPlayer, "Owner of this safe, now set.");
- * aBaseMetaTileEntity.openGUI(aPlayer);
- */
-
- }
- return true;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
- aNBT.setBoolean("bOutput", this.bOutput);
- aNBT.setBoolean("bRedstoneIfFull", this.bRedstoneIfFull);
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- if (this.ownerUUID != null) {
- aNBT.setString("ownerUUID", this.ownerUUID.toString());
- }
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
- this.bOutput = aNBT.getBoolean("bOutput");
- this.bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
- this.mTargetStackSize = aNBT.getInteger("mTargetStackSize");
- if (aNBT.hasKey("ownerUUID")) {
- this.ownerUUID = UUID.fromString(aNBT.getString("ownerUUID"));
- }
- }
-
- @Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- super.setItemNBT(aNBT);
- if (this.mTargetStackSize > 0) {
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- }
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex,
- final ForgeDirection side, final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex,
- final ForgeDirection side, final ItemStack aStack) {
- return side != aBaseMetaTileEntity.getBackFacing();
- }
-}