From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: The Great Renaming (#3014) * move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names --- .../common/tileentities/render/TileDrone.java | 24 ----- .../tileentities/render/TileEntityDrone.java | 24 +++++ .../tileentities/render/TileEntityLaser.java | 116 +++++++++++++++++++++ .../tileentities/render/TileEntityWormhole.java | 87 ++++++++++++++++ .../common/tileentities/render/TileLaser.java | 116 --------------------- .../common/tileentities/render/TileWormhole.java | 87 ---------------- 6 files changed, 227 insertions(+), 227 deletions(-) delete mode 100644 src/main/java/gregtech/common/tileentities/render/TileDrone.java create mode 100644 src/main/java/gregtech/common/tileentities/render/TileEntityDrone.java create mode 100644 src/main/java/gregtech/common/tileentities/render/TileEntityLaser.java create mode 100644 src/main/java/gregtech/common/tileentities/render/TileEntityWormhole.java delete mode 100644 src/main/java/gregtech/common/tileentities/render/TileLaser.java delete mode 100644 src/main/java/gregtech/common/tileentities/render/TileWormhole.java (limited to 'src/main/java/gregtech/common/tileentities/render') diff --git a/src/main/java/gregtech/common/tileentities/render/TileDrone.java b/src/main/java/gregtech/common/tileentities/render/TileDrone.java deleted file mode 100644 index 625157ff37..0000000000 --- a/src/main/java/gregtech/common/tileentities/render/TileDrone.java +++ /dev/null @@ -1,24 +0,0 @@ -package gregtech.common.tileentities.render; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -public class TileDrone extends TileEntity { - - public double rotation = 0; - - @Override - public AxisAlignedBB getRenderBoundingBox() { - return INFINITE_EXTENT_AABB; - } - - @Override - public double getMaxRenderDistanceSquared() { - return 65536; - } - - @Override - public void updateEntity() { - rotation = (rotation + 50) % 360d; - } -} diff --git a/src/main/java/gregtech/common/tileentities/render/TileEntityDrone.java b/src/main/java/gregtech/common/tileentities/render/TileEntityDrone.java new file mode 100644 index 0000000000..e6f292d895 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/render/TileEntityDrone.java @@ -0,0 +1,24 @@ +package gregtech.common.tileentities.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityDrone extends TileEntity { + + public double rotation = 0; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return INFINITE_EXTENT_AABB; + } + + @Override + public double getMaxRenderDistanceSquared() { + return 65536; + } + + @Override + public void updateEntity() { + rotation = (rotation + 50) % 360d; + } +} diff --git a/src/main/java/gregtech/common/tileentities/render/TileEntityLaser.java b/src/main/java/gregtech/common/tileentities/render/TileEntityLaser.java new file mode 100644 index 0000000000..b719039fe0 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/render/TileEntityLaser.java @@ -0,0 +1,116 @@ +package gregtech.common.tileentities.render; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +import com.gtnewhorizon.structurelib.alignment.enumerable.Flip; +import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation; + +public class TileEntityLaser extends TileEntity { + + public boolean shouldRender = false; + public float red = 0, green = 0, blue = 0; + public float counter = 0F; + public boolean realism = false; + public double rotAxisX = 0, rotAxisY = 0, rotAxisZ = 0, rotationAngle = 0; + + @Override + public void writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); + compound.setFloat("rgb_red", red); + compound.setFloat("rgb_green", green); + compound.setFloat("rgb_blue", blue); + compound.setBoolean("shouldRender", shouldRender); + compound.setDouble("rotAxisX", rotAxisX); + compound.setDouble("rotAxisY", rotAxisY); + compound.setDouble("rotAxisZ", rotAxisZ); + compound.setDouble("rotationAngle", rotationAngle); + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + red = compound.getFloat("rgb_red"); + blue = compound.getFloat("rgb_blue"); + green = compound.getFloat("rgb_green"); + shouldRender = compound.getBoolean("shouldRender"); + rotAxisX = compound.getDouble("rotAxisX"); + rotAxisY = compound.getDouble("rotAxisY"); + rotAxisZ = compound.getDouble("rotAxisZ"); + rotationAngle = compound.getDouble("rotationAngle"); + } + + public void setColors(float red, float green, float blue) { + this.red = red; + this.green = green; + this.blue = blue; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public void setRotationFields(ForgeDirection direction, Rotation rotation, Flip flip) { + setRotationAngle(rotation, flip); + setRotationAxis(direction); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + private void setRotationAngle(Rotation rotation, Flip flip) { + int invert = (flip == Flip.HORIZONTAL || flip == Flip.VERTICAL) ? 1 : -1; + switch (rotation) { + case NORMAL -> rotationAngle = 0; + case CLOCKWISE -> rotationAngle = 90 * invert; + case COUNTER_CLOCKWISE -> rotationAngle = -90 * invert; + case UPSIDE_DOWN -> rotationAngle = 180; + } + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public void setRotationAxis(ForgeDirection direction) { + rotAxisX = direction.offsetX; + rotAxisY = direction.offsetY; + rotAxisZ = direction.offsetZ; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public void setShouldRender(boolean shouldRender) { + this.shouldRender = shouldRender; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public Boolean getShouldRender() { + return shouldRender; + } + + public float getRed() { + return red; + } + + public float getGreen() { + return green; + } + + public float getBlue() { + return blue; + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + + @Override + public double getMaxRenderDistanceSquared() { + return 4096; + } +} diff --git a/src/main/java/gregtech/common/tileentities/render/TileEntityWormhole.java b/src/main/java/gregtech/common/tileentities/render/TileEntityWormhole.java new file mode 100644 index 0000000000..f3385b5ed6 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/render/TileEntityWormhole.java @@ -0,0 +1,87 @@ +package gregtech.common.tileentities.render; + +import java.util.Optional; + +import net.minecraft.block.Block; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; + +import gtneioreplugin.plugin.block.ModBlocks; +import gtneioreplugin.util.DimensionHelper; + +public class TileEntityWormhole extends TileEntity { + + public int dimID = 0; + + public double targetRadius = 0; + + @Override + public void writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); + compound.setInteger("dimID", dimID); + compound.setDouble("targetRadius", targetRadius); + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + dimID = compound.getInteger("dimID"); + targetRadius = compound.getDouble("targetRadius"); + } + + public int getDimFromWorld(World target) { + if (target == null) return 0; + String dimName = Optional.ofNullable(target.provider) + .map(WorldProvider::getDimensionName) + .orElse(null); + if (dimName == null) return 0; + for (int i = 0; i < DimensionHelper.DimName.length; i++) { + if (dimName.equals(DimensionHelper.DimName[i])) return i; + } + return 0; + } + + public void setDimFromWorld(World target) { + int newName = getDimFromWorld(target); + if (target != null & dimID != newName) { + dimID = newName; + this.markDirty(); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + + public void setRadius(double target) { + targetRadius = target; + this.markDirty(); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public Block getBlock() { + return ModBlocks.getBlock(DimensionHelper.DimNameDisplayed[dimID]); + } + + @Override + public double getMaxRenderDistanceSquared() { + return 65536; + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + + readFromNBT(pkt.func_148857_g()); + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/render/TileLaser.java b/src/main/java/gregtech/common/tileentities/render/TileLaser.java deleted file mode 100644 index 848eecdcf2..0000000000 --- a/src/main/java/gregtech/common/tileentities/render/TileLaser.java +++ /dev/null @@ -1,116 +0,0 @@ -package gregtech.common.tileentities.render; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizon.structurelib.alignment.enumerable.Flip; -import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation; - -public class TileLaser extends TileEntity { - - public boolean shouldRender = false; - public float red = 0, green = 0, blue = 0; - public float counter = 0F; - public boolean realism = false; - public double rotAxisX = 0, rotAxisY = 0, rotAxisZ = 0, rotationAngle = 0; - - @Override - public void writeToNBT(NBTTagCompound compound) { - super.writeToNBT(compound); - compound.setFloat("rgb_red", red); - compound.setFloat("rgb_green", green); - compound.setFloat("rgb_blue", blue); - compound.setBoolean("shouldRender", shouldRender); - compound.setDouble("rotAxisX", rotAxisX); - compound.setDouble("rotAxisY", rotAxisY); - compound.setDouble("rotAxisZ", rotAxisZ); - compound.setDouble("rotationAngle", rotationAngle); - } - - @Override - public void readFromNBT(NBTTagCompound compound) { - super.readFromNBT(compound); - red = compound.getFloat("rgb_red"); - blue = compound.getFloat("rgb_blue"); - green = compound.getFloat("rgb_green"); - shouldRender = compound.getBoolean("shouldRender"); - rotAxisX = compound.getDouble("rotAxisX"); - rotAxisY = compound.getDouble("rotAxisY"); - rotAxisZ = compound.getDouble("rotAxisZ"); - rotationAngle = compound.getDouble("rotationAngle"); - } - - public void setColors(float red, float green, float blue) { - this.red = red; - this.green = green; - this.blue = blue; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public void setRotationFields(ForgeDirection direction, Rotation rotation, Flip flip) { - setRotationAngle(rotation, flip); - setRotationAxis(direction); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - private void setRotationAngle(Rotation rotation, Flip flip) { - int invert = (flip == Flip.HORIZONTAL || flip == Flip.VERTICAL) ? 1 : -1; - switch (rotation) { - case NORMAL -> rotationAngle = 0; - case CLOCKWISE -> rotationAngle = 90 * invert; - case COUNTER_CLOCKWISE -> rotationAngle = -90 * invert; - case UPSIDE_DOWN -> rotationAngle = 180; - } - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public void setRotationAxis(ForgeDirection direction) { - rotAxisX = direction.offsetX; - rotAxisY = direction.offsetY; - rotAxisZ = direction.offsetZ; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public void setShouldRender(boolean shouldRender) { - this.shouldRender = shouldRender; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public Boolean getShouldRender() { - return shouldRender; - } - - public float getRed() { - return red; - } - - public float getGreen() { - return green; - } - - public float getBlue() { - return blue; - } - - @Override - public Packet getDescriptionPacket() { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - readFromNBT(pkt.func_148857_g()); - worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); - } - - @Override - public double getMaxRenderDistanceSquared() { - return 4096; - } -} diff --git a/src/main/java/gregtech/common/tileentities/render/TileWormhole.java b/src/main/java/gregtech/common/tileentities/render/TileWormhole.java deleted file mode 100644 index d482fd7ce1..0000000000 --- a/src/main/java/gregtech/common/tileentities/render/TileWormhole.java +++ /dev/null @@ -1,87 +0,0 @@ -package gregtech.common.tileentities.render; - -import java.util.Optional; - -import net.minecraft.block.Block; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraft.world.WorldProvider; - -import pers.gwyog.gtneioreplugin.plugin.block.ModBlocks; -import pers.gwyog.gtneioreplugin.util.DimensionHelper; - -public class TileWormhole extends TileEntity { - - public int dimID = 0; - - public double targetRadius = 0; - - @Override - public void writeToNBT(NBTTagCompound compound) { - super.writeToNBT(compound); - compound.setInteger("dimID", dimID); - compound.setDouble("targetRadius", targetRadius); - } - - @Override - public void readFromNBT(NBTTagCompound compound) { - super.readFromNBT(compound); - dimID = compound.getInteger("dimID"); - targetRadius = compound.getDouble("targetRadius"); - } - - public int getDimFromWorld(World target) { - if (target == null) return 0; - String dimName = Optional.ofNullable(target.provider) - .map(WorldProvider::getDimensionName) - .orElse(null); - if (dimName == null) return 0; - for (int i = 0; i < DimensionHelper.DimName.length; i++) { - if (dimName.equals(DimensionHelper.DimName[i])) return i; - } - return 0; - } - - public void setDimFromWorld(World target) { - int newName = getDimFromWorld(target); - if (target != null & dimID != newName) { - dimID = newName; - this.markDirty(); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - - public void setRadius(double target) { - targetRadius = target; - this.markDirty(); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public Block getBlock() { - return ModBlocks.getBlock(DimensionHelper.DimNameDisplayed[dimID]); - } - - @Override - public double getMaxRenderDistanceSquared() { - return 65536; - } - - @Override - public Packet getDescriptionPacket() { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - - readFromNBT(pkt.func_148857_g()); - worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); - } - -} -- cgit