From c2e8f2754f8b5868e7b2110c6442410ce686ff0a Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Sat, 24 Aug 2024 15:12:00 +0200 Subject: 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 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> --- src/main/java/gregtech/api/util/GT_StructureUtility.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/api/util') 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; } -- cgit