diff options
author | Mary <33456283+FourIsTheNumber@users.noreply.github.com> | 2024-09-03 11:58:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 15:58:14 +0000 |
commit | 5b23b1a11a0b1249f3b853c346597243f93fbe6a (patch) | |
tree | 84ac3d473906d3d9c0fe12e329ce8fcdfcbf07d5 /src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java | |
parent | f9f95c4466ed7ee41bcdc68d981dfeaeb589796f (diff) | |
download | GT5-Unofficial-5b23b1a11a0b1249f3b853c346597243f93fbe6a.tar.gz GT5-Unofficial-5b23b1a11a0b1249f3b853c346597243f93fbe6a.tar.bz2 GT5-Unofficial-5b23b1a11a0b1249f3b853c346597243f93fbe6a.zip |
Laser Engraver fixes (#3024)
* Better renderer adder, fixes plate not appearing in NEI preview
* Lower minimum casing
* New casing texture
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index e79244f881..1516695a88 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -16,7 +16,6 @@ import java.util.Map; import javax.annotation.Nonnull; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -55,7 +54,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; -import gregtech.api.util.LaserRenderingUtil; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.blocks.BlockCasings10; import gregtech.common.tileentities.render.TileEntityLaser; @@ -88,10 +86,7 @@ public class MTEIndustrialLaserEngraver extends MTEExtendedPowerMultiBlockBase<M 'g', BorosilicateGlass .ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glassTier = t, te -> te.glassTier)) - .addElement( - 'r', - LaserRenderingUtil - .ofBlockAdder(MTEIndustrialLaserEngraver::laserRendererAdder, GregTechAPI.sLaserRender, 0)) + .addElement('r', ofBlock(GregTechAPI.sLaserRender, 0)) .addElement( 's', buildHatchAdder(MTEIndustrialLaserEngraver.class).adder(MTEIndustrialLaserEngraver::addLaserSource) @@ -136,19 +131,6 @@ public class MTEIndustrialLaserEngraver extends MTEExtendedPowerMultiBlockBase<M return false; } - private boolean laserRendererAdder(Block block, int meta, World world, int x, int y, int z) { - if (block != GregTechAPI.sLaserRender || world == null) { - return false; - } - TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TileEntityLaser) { - renderer = (TileEntityLaser) te; - renderer.setRotationFields(getDirection(), getRotation(), getFlip()); - return true; - } - return false; - } - public MTEIndustrialLaserEngraver(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -273,7 +255,7 @@ public class MTEIndustrialLaserEngraver extends MTEExtendedPowerMultiBlockBase<M .addSeparator() .beginStructureBlock(5, 5, 5, false) .addController("Front Center") - .addCasingInfoMin("Laser Containment Casing", 45, false) + .addCasingInfoMin("Laser Containment Casing", 35, false) .addCasingInfoExactly("Tungstensteel Frame Box", 9, false) .addOtherStructurePart("Laser Resistant Plate", "x1") .addOtherStructurePart("Borosilicate Glass", "x3") @@ -305,15 +287,28 @@ public class MTEIndustrialLaserEngraver extends MTEExtendedPowerMultiBlockBase<M mCasingAmount++; } + private boolean findLaserRenderer(World w, int x, int y, int z) { + ForgeDirection opposite = getDirection().getOpposite(); + x = x + opposite.offsetX; + y = y + opposite.offsetY; + z = z + opposite.offsetZ; + if (w.getTileEntity(x, y, z) instanceof TileEntityLaser laser) { + renderer = laser; + renderer.setRotationFields(getDirection(), getRotation(), getFlip()); + return true; + } + return false; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasingAmount = 0; - mEnergyHatches.clear(); + IGregTechTileEntity base = getBaseMetaTileEntity(); if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 4, 0)) return false; - if (mCasingAmount < 45) return false; + if (mCasingAmount < 35) return false; if (laserSource == null) return false; - if (renderer == null) return false; + if (!findLaserRenderer(base.getWorld(), base.getXCoord(), base.getYCoord(), base.getZCoord())) return false; if (glassTier < VoltageIndex.UMV && laserSource.mTier > glassTier) return false; return true; |