aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-08-24 15:12:00 +0200
committerGitHub <noreply@github.com>2024-08-24 15:12:00 +0200
commitc2e8f2754f8b5868e7b2110c6442410ce686ff0a (patch)
tree3c5b2b33065fdb0578abaebc6384662bb496d8fe /src/main/java/gregtech/api
parentf89d122ce4492281981140fd9e1612cea08313cf (diff)
downloadGT5-Unofficial-c2e8f2754f8b5868e7b2110c6442410ce686ff0a.tar.gz
GT5-Unofficial-c2e8f2754f8b5868e7b2110c6442410ce686ff0a.tar.bz2
GT5-Unofficial-c2e8f2754f8b5868e7b2110c6442410ce686ff0a.zip
Make frame boxes no longer TileEntities (#2799)
* fiddling around with frame boxes * more fiddling * am trying * frames exist * fix frame rendering in inventory * Fix in world frame rendering * Apply cover to dumb frame * continue work on frames * apply covers to correct side and fix crash on load * Test permissions * fix oredict for new frames and create recipes * fix waila names and drops (kind of) * fix drops * mostly all working * remove old comment * fix structurecheck using new frames * create the TE transformer * it didnt work * dont modify tes we dont want to modify (needs future postea update) * it works! * item transformer works too * spotless * add more method overrides from generic gt block? * update postea * fix postea transforming items in reserved frame range that were not frame boxes * fix tesla tower structurecheck + capacitor hatch crash * Update src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * Update src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * Update src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * Update src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * Spotless apply for branch dumb-frames for #2799 (#2953) spotlessApply Co-authored-by: GitHub GTNH Actions <> * remove extra null check * Update src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * remove more messy instanceof checks * Spotless apply for branch dumb-frames for #2799 (#2954) spotlessApply Co-authored-by: GitHub GTNH Actions <> * remove unnecessary null check * try fixing facade color * Update src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> * small cleanup in framebox gen code * swap material for frame box block * fix description * make getMaterial static and add fix AE cover color * nicer casts + localize tooltip in frame block instead of stealing old localization * draw grid on cover hover * add a null check in getTexture() that hopefully fixes crash in full pack when interacting with frame boxes * also draw grid when hovering with wrench * add chemical element back to tooltip * fix breaking frame not causing structure update --------- Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: Alexander Anishin <14104815+OneEyeMaker@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/GregTech_API.java1
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java35
-rw-r--r--src/main/java/gregtech/api/util/GT_StructureUtility.java13
3 files changed, 9 insertions, 40 deletions
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index 62727f4b62..c382e90fef 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -249,6 +249,7 @@ public class GregTech_API {
sBlockCasings8, sBlockCasings9, sBlockCasings10, sBlockCasings11, sSolenoidCoilCasings;
public static Block sBlockLongDistancePipes;
public static Block sDroneRender;
+ public static Block sBlockFrames;
public static Block sBlockGlass1;
public static Block sBlockTintedGlass;
public static Block sLaserRender;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
index 399c536b9f..7cb2b3a9bd 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
@@ -1,30 +1,18 @@
package gregtech.api.metatileentity.implementations;
-import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
-import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
-import static gregtech.api.util.GT_RecipeBuilder.TICKS;
-import static gregtech.api.util.GT_Utility.calculateRecipeEU;
-
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import gregtech.api.enums.Dyes;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.SubTag;
-import gregtech.api.enums.TierEU;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_ModHandler.RecipeBits;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@@ -35,27 +23,8 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
public GT_MetaPipeEntity_Frame(int aID, String aName, String aNameRegional, Materials aMaterial) {
super(aID, aName, aNameRegional, 0);
mMaterial = aMaterial;
-
- GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1));
- if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) {
- GT_ModHandler.addCraftingRecipe(
- getStackForm(2),
- RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) });
- }
-
- if (!aMaterial.contains(SubTag.NO_RECIPES)
- && GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1) != null) {
- // Auto generate frame box recipe in an assembler.
- GT_Values.RA.stdBuilder()
- .itemInputs(
- GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4),
- GT_Utility.getIntegratedCircuit(4))
- .itemOutputs(getStackForm(1))
- .duration(3 * SECONDS + 4 * TICKS)
- .eut(calculateRecipeEU(aMaterial, 7))
- .addTo(assemblerRecipes);
- }
+ // Hide TileEntity frame in NEI, since we have the block version now that should always be used
+ codechicken.nei.api.API.hideItem(this.getStackForm(1));
}
public GT_MetaPipeEntity_Frame(String aName, Materials aMaterial) {
diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GT_StructureUtility.java
index d3c4c10a0d..ad3e4e9876 100644
--- a/src/main/java/gregtech/api/util/GT_StructureUtility.java
+++ b/src/main/java/gregtech/api/util/GT_StructureUtility.java
@@ -44,10 +44,9 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IHeatingCoil;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.common.blocks.GT_Block_Casings5;
+import gregtech.common.blocks.GT_Block_FrameBox;
import gregtech.common.blocks.GT_Item_Machines;
public class GT_StructureUtility {
@@ -74,11 +73,11 @@ public class GT_StructureUtility {
@Override
public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tBase = world.getTileEntity(x, y, z);
- if (tBase instanceof BaseMetaPipeEntity tPipeBase) {
- if (tPipeBase.isInvalidTileEntity()) return false;
- if (tPipeBase.getMetaTileEntity() instanceof GT_MetaPipeEntity_Frame)
- return aFrameMaterial == ((GT_MetaPipeEntity_Frame) tPipeBase.getMetaTileEntity()).mMaterial;
+ Block block = world.getBlock(x, y, z);
+ if (block instanceof GT_Block_FrameBox frameBox) {
+ int meta = world.getBlockMetadata(x, y, z);
+ Materials material = frameBox.getMaterial(meta);
+ return aFrameMaterial == material;
}
return false;
}