diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-08-24 15:12:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-24 15:12:00 +0200 |
commit | c2e8f2754f8b5868e7b2110c6442410ce686ff0a (patch) | |
tree | 3c5b2b33065fdb0578abaebc6384662bb496d8fe /src/main/java/gregtech/common/render | |
parent | f89d122ce4492281981140fd9e1612cea08313cf (diff) | |
download | GT5-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/common/render')
-rw-r--r-- | src/main/java/gregtech/common/render/GT_Renderer_Block.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java index da0d68d555..aa61cc125e 100644 --- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java +++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java @@ -52,6 +52,7 @@ import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; +import gregtech.common.blocks.GT_Block_FrameBox; import gregtech.common.blocks.GT_Block_Machines; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; @@ -108,6 +109,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { textureArray[5] = texturedTileEntity.getTexture(aBlock, EAST); return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, textureArray); } + return false; } @@ -569,6 +571,18 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { && (GregTech_API.METATILEENTITIES[aMeta] != null) && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) { renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); + } else if (aBlock instanceof GT_Block_FrameBox) { + ITexture[] texture = ((GT_Block_FrameBox) aBlock).getTexture(aMeta); + aBlock.setBlockBoundsForItemRender(); + aRenderer.setRenderBoundsFromBlock(aBlock); + // spotless:off + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, texture, true); + // spotless:on } aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); @@ -714,7 +728,25 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler { aRenderer.useInventoryTint = false; final TileEntity tileEntity = aWorld.getTileEntity(aX, aY, aZ); + + // If this block does not have a TE, render it as a normal block. + // Otherwise, render the TE instead. + if (tileEntity == null && aBlock instanceof GT_Block_FrameBox frameBlock) { + int meta = aWorld.getBlockMetadata(aX, aY, aZ); + ITexture[] texture = frameBlock.getTexture(meta); + if (texture == null) return false; + textureArray[0] = texture; + textureArray[1] = texture; + textureArray[2] = texture; + textureArray[3] = texture; + textureArray[4] = texture; + textureArray[5] = texture; + renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, textureArray); + return true; + } + if (tileEntity == null) return false; + if (tileEntity instanceof IGregTechTileEntity) { final IMetaTileEntity metaTileEntity; if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null |