From 7ee1952eac0b68c03bf4c1994ed919bee6ff06b9 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 10 Sep 2023 16:14:27 +0900 Subject: Remove mention to GregTech_API#mAE2 --- src/main/java/common/CommonProxy.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/common') diff --git a/src/main/java/common/CommonProxy.java b/src/main/java/common/CommonProxy.java index 3af1fd1671..75a775e1bc 100644 --- a/src/main/java/common/CommonProxy.java +++ b/src/main/java/common/CommonProxy.java @@ -9,7 +9,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.GregTech_API; import kekztech.GuiHandler; import kekztech.Items; import kekztech.KekzCore; @@ -43,6 +42,6 @@ public class CommonProxy { // Research Researches.postInit(); - if (GregTech_API.mAE2) GTMTE_TFFTHatch.registerAEIntegration(); + GTMTE_TFFTHatch.registerAEIntegration(); } } -- cgit From e4f9ba57233b2bcbf4dc54d08bee52e98ebbd285 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 10 Sep 2023 16:16:43 +0900 Subject: Remove beam things --- .../java/common/blocks/Block_BeamTransmitter.java | 53 ---------------------- .../common/tileentities/TE_BeamTransmitter.java | 49 -------------------- 2 files changed, 102 deletions(-) delete mode 100644 src/main/java/common/blocks/Block_BeamTransmitter.java delete mode 100644 src/main/java/common/tileentities/TE_BeamTransmitter.java (limited to 'src/main/java/common') diff --git a/src/main/java/common/blocks/Block_BeamTransmitter.java b/src/main/java/common/blocks/Block_BeamTransmitter.java deleted file mode 100644 index 48bedd3b7f..0000000000 --- a/src/main/java/common/blocks/Block_BeamTransmitter.java +++ /dev/null @@ -1,53 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.tileentities.TE_BeamTransmitter; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.KekzCore; - -public class Block_BeamTransmitter extends Block { - - private static final Block_BeamTransmitter INSTANCE = new Block_BeamTransmitter(); - - private Block_BeamTransmitter() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_beamtransmitter_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(5.0f); - INSTANCE.setResistance(5.0f); - INSTANCE.setBlockTextureName(KekzCore.MODID + ":" + "Tether_top"); - GameRegistry.registerBlock(INSTANCE, blockName); - - return INSTANCE; - } - - @Override - public TileEntity createTileEntity(World world, int meta) { - return new TE_BeamTransmitter(); - } - - @Override - public boolean hasTileEntity(int meta) { - return true; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/tileentities/TE_BeamTransmitter.java b/src/main/java/common/tileentities/TE_BeamTransmitter.java deleted file mode 100644 index e8999e393f..0000000000 --- a/src/main/java/common/tileentities/TE_BeamTransmitter.java +++ /dev/null @@ -1,49 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -import org.joml.Vector3i; -import org.joml.Vector3ic; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TE_BeamTransmitter extends TileEntity { - - private final Vector3ic position; - - private final Vector3ic target = new Vector3i(10, 20, 10); - private double distanceCache; - private boolean distanceCacheValid = false; - - public TE_BeamTransmitter() { - position = new Vector3i(super.xCoord, super.yCoord, super.zCoord); - } - - public Vector3ic getTargetPosition() { - return target; - } - - public double getDistanceFromTarget() { - if (!distanceCacheValid) { - distanceCache = position.distance(target); - distanceCacheValid = true; - } - return distanceCache; - } - - @SideOnly(Side.CLIENT) - @Override - public double getMaxRenderDistanceSquared() { - // 4k is standard, 65k is what the vanilla beacon uses - return 65536.0D; - } - - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() { - // Make it so the beam is still rendered even when the source block is out of sight - return INFINITE_EXTENT_AABB; - } -} -- cgit From 3dfd657c27f0efe2e20841a3e93a92c7881e8f6f Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 10 Sep 2023 16:26:06 +0900 Subject: Remove Space Elevator things --- src/main/java/common/Blocks.java | 3 - src/main/java/common/TileEntities.java | 2 - .../java/common/blocks/Block_SpaceElevator.java | 62 ----- .../blocks/Block_SpaceElevatorCapacitor.java | 82 ------- .../common/blocks/Block_SpaceElevatorTether.java | 67 ------ .../java/common/itemBlocks/IB_SpaceElevator.java | 37 --- .../itemBlocks/IB_SpaceElevatorCapacitor.java | 22 -- .../common/tileentities/GTMTE_SpaceElevator.java | 260 --------------------- .../tileentities/TE_SpaceElevatorCapacitor.java | 53 ----- .../tileentities/TE_SpaceElevatorTether.java | 24 -- 10 files changed, 612 deletions(-) delete mode 100644 src/main/java/common/blocks/Block_SpaceElevator.java delete mode 100644 src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java delete mode 100644 src/main/java/common/blocks/Block_SpaceElevatorTether.java delete mode 100644 src/main/java/common/itemBlocks/IB_SpaceElevator.java delete mode 100644 src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java delete mode 100644 src/main/java/common/tileentities/GTMTE_SpaceElevator.java delete mode 100644 src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java delete mode 100644 src/main/java/common/tileentities/TE_SpaceElevatorTether.java (limited to 'src/main/java/common') diff --git a/src/main/java/common/Blocks.java b/src/main/java/common/Blocks.java index f43482b909..d2fb863968 100644 --- a/src/main/java/common/Blocks.java +++ b/src/main/java/common/Blocks.java @@ -23,9 +23,6 @@ public class Blocks { public static Block jarThaumiumReinforced; public static Block jarIchor; public static Block lscLapotronicEnergyUnit; - public static Block spaceElevatorStructure; - public static Block spaceElevatorCapacitor; - public static Block spaceElevatorTether; public static Block largeHexPlate; diff --git a/src/main/java/common/TileEntities.java b/src/main/java/common/TileEntities.java index 9ad4fdb99f..0825b872f0 100644 --- a/src/main/java/common/TileEntities.java +++ b/src/main/java/common/TileEntities.java @@ -3,7 +3,6 @@ package common; import common.tileentities.GTMTE_LapotronicSuperCapacitor; import common.tileentities.GTMTE_SOFuelCellMK1; import common.tileentities.GTMTE_SOFuelCellMK2; -import common.tileentities.GTMTE_SpaceElevator; import common.tileentities.GTMTE_TFFT; import common.tileentities.GTMTE_TFFTHatch; import common.tileentities.TE_IchorJar; @@ -21,7 +20,6 @@ public class TileEntities { // public static GTMTE_ModularNuclearReactor mdr; public static GTMTE_TFFT tfft; public static GTMTE_LapotronicSuperCapacitor lsc; - public static GTMTE_SpaceElevator se; // Singleblocks public static GTMTE_TFFTHatch tfftHatch; diff --git a/src/main/java/common/blocks/Block_SpaceElevator.java b/src/main/java/common/blocks/Block_SpaceElevator.java deleted file mode 100644 index 2f491db0a4..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevator.java +++ /dev/null @@ -1,62 +0,0 @@ -package common.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import common.itemBlocks.IB_SpaceElevator; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class Block_SpaceElevator extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevator INSTANCE = new Block_SpaceElevator(); - - private IIcon baseTop; - private IIcon baseSide; - private IIcon coilHolder; - - private Block_SpaceElevator() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevator_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(7.0f); - INSTANCE.setResistance(10.0f); - GameRegistry.registerBlock(INSTANCE, IB_SpaceElevator.class, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - baseTop = ir.registerIcon("kekztech:SpaceElevatorBase_top"); - baseSide = ir.registerIcon("kekztech:SpaceElevatorBase_side"); - coilHolder = ir.registerIcon("kekztech:CoilHolder"); - } - - @Override - @SuppressWarnings({ "unchecked" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - par3List.add(new ItemStack(par1, 1, 1)); - } - - @Override - public IIcon getIcon(int side, int meta) { - if (meta == 0) { - return (side < 2) ? baseTop : baseSide; - } else { - return coilHolder; - } - } -} diff --git a/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java b/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java deleted file mode 100644 index b6816ba7e8..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,82 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import common.itemBlocks.IB_SpaceElevatorCapacitor; -import common.tileentities.TE_SpaceElevatorCapacitor; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class Block_SpaceElevatorCapacitor extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevatorCapacitor INSTANCE = new Block_SpaceElevatorCapacitor(); - - private IIcon top; - private IIcon side; - - private Block_SpaceElevatorCapacitor() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevatorcapacitor_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(5.0f); - INSTANCE.setResistance(3.0f); - GameRegistry.registerBlock(INSTANCE, IB_SpaceElevatorCapacitor.class, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - top = ir.registerIcon("kekztech:SpaceElevatorCapacitor_top_fullbase"); - side = ir.registerIcon("kekztech:SpaceElevatorCapacitor_side_fullbase"); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side < 2) ? this.top : this.side; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_SpaceElevatorCapacitor(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - return false; - } - - @Override - public int getLightValue() { - return 2; - } -} diff --git a/src/main/java/common/blocks/Block_SpaceElevatorTether.java b/src/main/java/common/blocks/Block_SpaceElevatorTether.java deleted file mode 100644 index c6ed0f54b0..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevatorTether.java +++ /dev/null @@ -1,67 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import common.tileentities.TE_SpaceElevatorTether; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class Block_SpaceElevatorTether extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevatorTether INSTANCE = new Block_SpaceElevatorTether(); - - private IIcon top; - private IIcon side; - - private Block_SpaceElevatorTether() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevatortether_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(15.0f); - INSTANCE.setResistance(15.0f); - GameRegistry.registerBlock(INSTANCE, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - top = ir.registerIcon("kekztech:Tether_top"); - side = ir.registerIcon("kekztech:Tether_side"); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side < 2) ? this.top : this.side; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_SpaceElevatorTether(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/itemBlocks/IB_SpaceElevator.java b/src/main/java/common/itemBlocks/IB_SpaceElevator.java deleted file mode 100644 index 8b7668207b..0000000000 --- a/src/main/java/common/itemBlocks/IB_SpaceElevator.java +++ /dev/null @@ -1,37 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_SpaceElevator extends ItemBlock { - - public IB_SpaceElevator(Block block) { - super(block); - } - - @Override - public int getMetadata(int meta) { - return meta; - } - - @Override - public boolean getHasSubtypes() { - return true; - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return super.getUnlocalizedName() + "." + stack.getItemDamage(); - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_spaceelevator_block.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java b/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java deleted file mode 100644 index fc367ae6a5..0000000000 --- a/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,22 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_SpaceElevatorCapacitor extends ItemBlock { - - public IB_SpaceElevatorCapacitor(Block block) { - super(block); - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_spaceelevatorcapacitor_block.desc")); - } -} diff --git a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java b/src/main/java/common/tileentities/GTMTE_SpaceElevator.java deleted file mode 100644 index 421a2e2760..0000000000 --- a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java +++ /dev/null @@ -1,260 +0,0 @@ -package common.tileentities; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; - -import common.Blocks; - -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import util.Vector3i; -import util.Vector3ic; - -public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase { - - private static final Block BASE_BLOCK = Blocks.spaceElevatorStructure; - private static final Block CAP_BLOCK = Blocks.spaceElevatorCapacitor; - private static final Block TETHER_BLOCK = Blocks.spaceElevatorTether; - private static final int BASE_META = 0; - private static final int COIL_HOLDER_META = 1; - private static final String glassNameBorosilicate = "BW_GlasBlocks"; - private static final int HATCH_OVERLAY_ID = 16; - - // Scan positions for capacitor banks - // Start with top left bank, clockwise - // Start with top middle pillar within bank, clockwise, middle last - private static final int[] bankOffsetsX = { -7, 5, 5, -7 }; - private static final int[] bankOffsetsY = { -7, -7, 5, 5 }; - private static final int[] scanOffsetsX = { 1, 2, 1, 0, 1 }; - private static final int[] scanOffsetsY = { 0, 1, 2, 1, 1 }; - - private final HashSet capacitors = new HashSet<>(); - private long lastLaunchEUCost = 0; - - public GTMTE_SpaceElevator(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GTMTE_SpaceElevator(String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_SpaceElevator((super.mName)); - } - - @Override - public String[] getDescription() { - return new String[] { "Disabled" }; - /* - * final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder(); - * b.addInfo("Access for your Space Station!") - * .addInfo("Check out the wiki on my github if you are having trouble with the structure") - * .addInfo("Regenerative Breaking will recover up to X% of the energy spent on launch") - * .addInfo("Energy recovered depends on coil tier: +10% per coil tier, up to 90%") .addSeparator() - * .beginStructureBlock(15, 11, 15) .addController("Bottom Center") - * .addEnergyHatch("Instead of any casing in the bottom floor") - * .addMaintenanceHatch("Instead of any casing in the bottom floor") - * .addCasingInfo("Solid Steel Machine Casing", 320) .addOtherStructurePart("Any EBF coil", - * "40x, have to be all the same") .addOtherStructurePart("Space Elevator Tether", "4x") - * .addOtherStructurePart("Space Elevator Cabin Block", "42x") - * .addOtherStructurePart("Space Elevator Cabin Guide", "8x") .signAndFinalize("Kekzdealer"); - * if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return b.getInformation(); } else { return - * b.getStructureInformation(); } - */ - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { - ITexture[] sTexture = new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; - if (side == facing && aActive) { - sTexture = new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; - } - return sTexture; - } - - @Override - public boolean isCorrectMachinePart(ItemStack stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEUt = 0; - this.mEfficiencyIncrease = 10000; - return true; - } - - public Vector3ic rotateOffsetVector(Vector3ic forgeDirection, int x, int y, int z) { - final Vector3i offset = new Vector3i(0, 0, 0); - // either direction on y-axis - if (forgeDirection.y() == -1) { - offset.x = x; - offset.y = z; - offset.z = y; - } - - return offset; - } - - @Override - public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) { - // Make sure the controller is either facing up or down - if (thisController.getFrontFacing().offsetY != 0) { - return false; - } - - // Figure out the vector for the direction the back face of the controller is facing - final Vector3ic forgeDirection = new Vector3i( - thisController.getBackFacing().offsetX, - thisController.getBackFacing().offsetY, - thisController.getBackFacing().offsetZ); - boolean formationChecklist = true; - int minCasingAmount = 320; - int firstCoilMeta = -1; - capacitors.clear(); - - // Base floor - for (int X = -7; X <= 7; X++) { - for (int Y = -7; Y <= 7; Y++) { - if (X == 0 && Y == 0) { - continue; // Skip controller - } - - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, 0); - final IGregTechTileEntity currentTE = thisController - .getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); - - // Tries to add TE as either of those kinds of hatches. - // The number is the texture index number for the texture that needs to be painted over the hatch - // texture - if (!super.addMaintenanceToMachineList(currentTE, HATCH_OVERLAY_ID) - && !this.addEnergyInputToMachineList(currentTE, HATCH_OVERLAY_ID)) { - - // If it's not a hatch, is it the right casing for this machine? Check block and block meta. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == BASE_BLOCK) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == BASE_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - System.out.println(""); - // Capacitor banks - for (int bank = 0; bank < 4; bank++) { - for (int Z = 1; Z <= 5; Z++) { - for (int scan = 0; scan < 5; scan++) { - final Vector3ic offset = rotateOffsetVector( - forgeDirection, - bankOffsetsX[bank] + scanOffsetsX[scan], - bankOffsetsY[bank] + scanOffsetsY[scan], - Z); - if (Z == 1 || Z == 5) { - // Check for casings - if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == BASE_BLOCK - && thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == BASE_META) { - minCasingAmount--; - } else { - formationChecklist = false; - } - } else { - if (scan == 4) { - // Check for capacitors - final TileEntity te = thisController - .getTileEntityOffset(offset.x(), offset.y(), offset.z()); - if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CAP_BLOCK - && te instanceof TE_SpaceElevatorCapacitor) { - capacitors.add((TE_SpaceElevatorCapacitor) te); - } else { - formationChecklist = false; - } - } else { - // Check for Glass - if (!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(glassNameBorosilicate)) { - formationChecklist = false; - } - } - } - } - } - } - // Anchor - - // Coil holders - - // Coils - - if (minCasingAmount > 0) { - formationChecklist = false; - } - - for (TE_SpaceElevatorCapacitor cap : capacitors) { - cap.setIsDamaged(false); - } - - return formationChecklist; - } - - @Override - public String[] getInfoData() { - final ArrayList ll = new ArrayList<>(); - ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET); - - ll.add( - "Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus()) - ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET)); - ll.add("---------------------------------------------"); - - final String[] a = new String[ll.size()]; - return ll.toArray(a); - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } -} diff --git a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java b/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java deleted file mode 100644 index ea5211bfba..0000000000 --- a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,53 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; - -public class TE_SpaceElevatorCapacitor extends TileEntity { - - private float chargeLevel = 0.0F; - private boolean isDamaged = true; - - /** - * Called by {@link GTMTE_SpaceElevator} while charging - * - * @param charge Current elevator charge - * @param maxCharge Charge level it is trying to reach - */ - public void updateChargeLevel(int charge, int maxCharge) { - chargeLevel = ((float) charge) / ((float) maxCharge); - } - - /** - * Called by {@link client.renderer.TESR_SECapacitor} to calculate the block's colour saturation - * - * @return Charge level from 0.0F to 1.0F - */ - public float getChargeLevel() { - return chargeLevel; - } - - /** - * Called by {@link GTMTE_SpaceElevator} in case of power loss - */ - public void resetChargeLevel() { - chargeLevel = 0.0F; - } - - /** - * Called by {@link GTMTE_SpaceElevator} in case of maintenance issues - * - * @param isDamaged has maintenance issue - */ - public void setIsDamaged(boolean isDamaged) { - this.isDamaged = isDamaged; - } - - /** - * Called by {@link client.renderer.TESR_SECapacitor} to check whether the block should be rendered red - * - * @return should be rendered red - */ - public boolean isDamaged() { - return isDamaged; - } -} diff --git a/src/main/java/common/tileentities/TE_SpaceElevatorTether.java b/src/main/java/common/tileentities/TE_SpaceElevatorTether.java deleted file mode 100644 index 7e76a9c14d..0000000000 --- a/src/main/java/common/tileentities/TE_SpaceElevatorTether.java +++ /dev/null @@ -1,24 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TE_SpaceElevatorTether extends TileEntity { - - @SideOnly(Side.CLIENT) - @Override - public double getMaxRenderDistanceSquared() { - // 4k is standard, 65k is what the vanilla beacon uses - return 65536.0D; - } - - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() { - // Make it so the beam is still rendered even when the source block is out of sight - return INFINITE_EXTENT_AABB; - } -} -- cgit From 84b4d11e693439e87687c5d636497ed61de9402c Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 10 Sep 2023 16:34:53 +0900 Subject: Remove Item Proxy things --- src/main/java/common/CommonProxy.java | 5 - .../java/common/blocks/Block_ItemProxyCable.java | 68 -------- .../common/blocks/Block_ItemProxyEndpoint.java | 63 -------- .../java/common/blocks/Block_ItemProxySource.java | 63 -------- .../container/Container_ItemProxyEndpoint.java | 66 -------- .../container/Container_ItemProxySource.java | 79 ---------- .../java/common/itemBlocks/IB_ItemProxyCable.java | 22 --- .../common/itemBlocks/IB_ItemProxyEndpoint.java | 23 --- .../java/common/itemBlocks/IB_ItemProxySource.java | 24 --- .../common/tileentities/TE_ItemProxyCable.java | 155 ------------------ .../common/tileentities/TE_ItemProxyEndpoint.java | 175 --------------------- .../common/tileentities/TE_ItemProxySource.java | 105 ------------- 12 files changed, 848 deletions(-) delete mode 100644 src/main/java/common/blocks/Block_ItemProxyCable.java delete mode 100644 src/main/java/common/blocks/Block_ItemProxyEndpoint.java delete mode 100644 src/main/java/common/blocks/Block_ItemProxySource.java delete mode 100644 src/main/java/common/container/Container_ItemProxyEndpoint.java delete mode 100644 src/main/java/common/container/Container_ItemProxySource.java delete mode 100644 src/main/java/common/itemBlocks/IB_ItemProxyCable.java delete mode 100644 src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java delete mode 100644 src/main/java/common/itemBlocks/IB_ItemProxySource.java delete mode 100644 src/main/java/common/tileentities/TE_ItemProxyCable.java delete mode 100644 src/main/java/common/tileentities/TE_ItemProxyEndpoint.java delete mode 100644 src/main/java/common/tileentities/TE_ItemProxySource.java (limited to 'src/main/java/common') diff --git a/src/main/java/common/CommonProxy.java b/src/main/java/common/CommonProxy.java index 75a775e1bc..0f6600be83 100644 --- a/src/main/java/common/CommonProxy.java +++ b/src/main/java/common/CommonProxy.java @@ -8,10 +8,7 @@ import common.tileentities.GTMTE_TFFTHatch; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import kekztech.GuiHandler; import kekztech.Items; -import kekztech.KekzCore; public class CommonProxy { @@ -27,8 +24,6 @@ public class CommonProxy { TileEntities.preInit(); // TC Research Researches.preInit(); - // GUI Handler - NetworkRegistry.INSTANCE.registerGuiHandler(KekzCore.instance, new GuiHandler()); } public void init(final FMLInitializationEvent e) { diff --git a/src/main/java/common/blocks/Block_ItemProxyCable.java b/src/main/java/common/blocks/Block_ItemProxyCable.java deleted file mode 100644 index cf9307dde0..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxyCable.java +++ /dev/null @@ -1,68 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxyCable; -import common.tileentities.TE_ItemProxyCable; - -import client.renderer.ConduitRenderer; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import kekztech.KekzCore; - -public class Block_ItemProxyCable extends Block { - - private static final Block_ItemProxyCable instance = new Block_ItemProxyCable(); - - private Block_ItemProxyCable() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxycable_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "TFFTCasing"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - GameRegistry.registerBlock(instance, IB_ItemProxyCable.class, blockName); - - return instance; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxyCable(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - public int getRenderType() { - return ConduitRenderer.RID; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/blocks/Block_ItemProxyEndpoint.java b/src/main/java/common/blocks/Block_ItemProxyEndpoint.java deleted file mode 100644 index 5f60eba040..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxyEndpoint.java +++ /dev/null @@ -1,63 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxyEndpoint; -import common.tileentities.TE_ItemProxyEndpoint; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.GuiHandler; -import kekztech.KekzCore; - -public class Block_ItemProxyEndpoint extends Block { - - private static final Block_ItemProxyEndpoint instance = new Block_ItemProxyEndpoint(); - - private Block_ItemProxyEndpoint() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxyendpoint_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemProxyEndpoint"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - instance.setHarvestLevel("wrench", 2); - GameRegistry.registerBlock(instance, IB_ItemProxyEndpoint.class, blockName); - - return instance; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, - float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TE_ItemProxyEndpoint) { - player.openGui(KekzCore.instance, GuiHandler.ITEM_PROXY_ENDPOINT, world, x, y, z); - return true; - } else { - return false; - } - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxyEndpoint(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } -} diff --git a/src/main/java/common/blocks/Block_ItemProxySource.java b/src/main/java/common/blocks/Block_ItemProxySource.java deleted file mode 100644 index 7ab34ade52..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxySource.java +++ /dev/null @@ -1,63 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxySource; -import common.tileentities.TE_ItemProxySource; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.GuiHandler; -import kekztech.KekzCore; - -public class Block_ItemProxySource extends Block { - - private static final Block_ItemProxySource instance = new Block_ItemProxySource(); - - private Block_ItemProxySource() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxysource_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemProxySource"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - instance.setHarvestLevel("wrench", 2); - GameRegistry.registerBlock(instance, IB_ItemProxySource.class, blockName); - - return instance; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, - float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TE_ItemProxySource) { - player.openGui(KekzCore.instance, GuiHandler.ITEM_PROXY_SOURCE, world, x, y, z); - return true; - } else { - return false; - } - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxySource(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } -} diff --git a/src/main/java/common/container/Container_ItemProxyEndpoint.java b/src/main/java/common/container/Container_ItemProxyEndpoint.java deleted file mode 100644 index 8f509e789c..0000000000 --- a/src/main/java/common/container/Container_ItemProxyEndpoint.java +++ /dev/null @@ -1,66 +0,0 @@ -package common.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class Container_ItemProxyEndpoint extends Container { - - private final IInventory teInventory; - - private int slotID = 0; - - public Container_ItemProxyEndpoint(TileEntity te, EntityPlayer player) { - this.teInventory = (IInventory) te; - - // Source Slot - addSlotToContainer(new Slot(teInventory, slotID++, 80, 35)); - // Config slot - addSlotToContainer(new Slot(teInventory, slotID++, 100, 35)); - - // Inventory - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - // Hotbar - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) { - ItemStack stack = null; - final Slot slot = (Slot) inventorySlots.get(slotRaw); - - if (slot != null && slot.getHasStack()) { - final ItemStack stackInSlot = slot.getStack(); - stack = stackInSlot.copy(); - - if (slotRaw < 3 * 9) { - if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - } - return stack; - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return teInventory.isUseableByPlayer(player); - } -} diff --git a/src/main/java/common/container/Container_ItemProxySource.java b/src/main/java/common/container/Container_ItemProxySource.java deleted file mode 100644 index 23af97e5bb..0000000000 --- a/src/main/java/common/container/Container_ItemProxySource.java +++ /dev/null @@ -1,79 +0,0 @@ -package common.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class Container_ItemProxySource extends Container { - - private final IInventory teInventory; - - private int slotID = 0; - - public Container_ItemProxySource(TileEntity te, EntityPlayer player) { - this.teInventory = (IInventory) te; - - // Source Slots - addSlotToContainer(new Slot(teInventory, slotID++, 53, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 62)); - - // Inventory - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - // Hotbar - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) { - ItemStack stack = null; - final Slot slot = (Slot) inventorySlots.get(slotRaw); - - if (slot != null && slot.getHasStack()) { - final ItemStack stackInSlot = slot.getStack(); - stack = stackInSlot.copy(); - - if (slotRaw < 3 * 9) { - if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - } - return stack; - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return teInventory.isUseableByPlayer(player); - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxyCable.java b/src/main/java/common/itemBlocks/IB_ItemProxyCable.java deleted file mode 100644 index 6022194225..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxyCable.java +++ /dev/null @@ -1,22 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxyCable extends ItemBlock { - - public IB_ItemProxyCable(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxycable_block.0.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java b/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java deleted file mode 100644 index 2cde2c14d3..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java +++ /dev/null @@ -1,23 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxyEndpoint extends ItemBlock { - - public IB_ItemProxyEndpoint(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxyendpoint_block.0.desc")); - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxyendpoint_block.1.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxySource.java b/src/main/java/common/itemBlocks/IB_ItemProxySource.java deleted file mode 100644 index 42371ab6e6..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxySource.java +++ /dev/null @@ -1,24 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxySource extends ItemBlock { - - public IB_ItemProxySource(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.0.desc")); - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.1.desc")); - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.2.desc")); - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxyCable.java b/src/main/java/common/tileentities/TE_ItemProxyCable.java deleted file mode 100644 index 1dc539c89e..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxyCable.java +++ /dev/null @@ -1,155 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class TE_ItemProxyCable extends TileEntity { - - private static final float THICKNESS = 0.5F; - private byte connections = 0; - private byte connectionAllowed = 63; - private String idCache = null; - - public TE_ItemProxyCable() {} - - @Override - public void updateEntity() { - // Check all 6 sides and connect the conduit if it is allowed to - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - final TileEntity te = super.getWorldObj().getTileEntity( - super.xCoord + side.offsetX, - super.yCoord + side.offsetY, - super.zCoord + side.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - setConnection(side, cable.isConnectionAllowed(side.getOpposite())); - } else { - setConnection(side, false); - } - } - } - - public static float getThickness() { - return THICKNESS; - } - - /** - * Builds a simple unique identifier for this TileEntity by appending the x, y, and z coordinates in a string. - * - * @return unique identifier for this TileEntity - */ - public String getIdentifier() { - if (idCache == null) { - idCache = "" + super.xCoord + super.yCoord + super.zCoord; - return idCache; - } else { - return idCache; - } - } - - /** - * 0 0 0 0 0 0 0 0 = 0 -> no connection
- * 0 0 0 0 0 0 0 1 = 1 -> down
- * 0 0 0 0 0 0 1 0 = 2 -> up
- * 0 0 0 0 0 1 0 0 = 4 -> north
- * 0 0 0 0 1 0 0 0 = 8 -> south
- * 0 0 0 1 0 0 0 0 = 16 -> west
- * 0 0 1 0 0 0 0 0 = 32 -> east
- * - * @param side The side for which to set the connection status. - * @param connected Whether this side should be connected or not - * @return True if the connection was allowed - */ - public boolean setConnection(ForgeDirection side, boolean connected) { - if (isConnectionAllowed(side)) { - switch (side) { - case DOWN: - connections = (byte) ((connected) ? connections | 1 : connections ^ 1); - break; - case UP: - connections = (byte) ((connected) ? connections | 2 : connections ^ 2); - break; - case NORTH: - connections = (byte) ((connected) ? connections | 4 : connections ^ 4); - break; - case SOUTH: - connections = (byte) ((connected) ? connections | 8 : connections ^ 8); - break; - case WEST: - connections = (byte) ((connected) ? connections | 16 : connections ^ 16); - break; - case EAST: - connections = (byte) ((connected) ? connections | 32 : connections ^ 32); - break; - default: - return false; - } - return true; - } else { - return false; - } - } - - public boolean isConnected(ForgeDirection side) { - switch (side) { - case DOWN: - return (connections & 1) == 1; - case UP: - return (connections & 2) == 2; - case NORTH: - return (connections & 4) == 4; - case SOUTH: - return (connections & 8) == 8; - case WEST: - return (connections & 16) == 16; - case EAST: - return (connections & 32) == 32; - default: - return false; - } - } - - public void setConnectionAllowed(ForgeDirection side, boolean allowed) { - switch (side) { - case DOWN: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 1 : connectionAllowed ^ 1); - break; - case UP: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 2 : connectionAllowed ^ 2); - break; - case NORTH: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 4 : connectionAllowed ^ 4); - break; - case SOUTH: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 8 : connectionAllowed ^ 8); - break; - case WEST: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 16 : connectionAllowed ^ 16); - break; - case EAST: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 32 : connectionAllowed ^ 32); - break; - default: - break; - } - } - - public boolean isConnectionAllowed(ForgeDirection side) { - switch (side) { - case DOWN: - return (connectionAllowed & 1) == 1; - case UP: - return (connectionAllowed & 2) == 2; - case NORTH: - return (connectionAllowed & 4) == 4; - case SOUTH: - return (connectionAllowed & 8) == 8; - case WEST: - return (connectionAllowed & 16) == 16; - case EAST: - return (connectionAllowed & 32) == 32; - default: - return false; - } - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java b/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java deleted file mode 100644 index 7d58a21c61..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java +++ /dev/null @@ -1,175 +0,0 @@ -package common.tileentities; - -import java.util.HashSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class TE_ItemProxyEndpoint extends TileEntity implements ISidedInventory { - - private byte channel = -1; - private IInventory proxyInventory = null; - private int tickCounter = 0; - - public TE_ItemProxyEndpoint() { - channel = 0; - } - - public void setChannel(byte channel) { - this.channel = channel; - } - - public int getChannel() { - return channel; - } - - @Override - public void updateEntity() { - if (tickCounter == 20) { - if (channel != -1) { - proxyInventory = searchSource(); - } - tickCounter = 0; - } - tickCounter++; - } - - private TE_ItemProxySource searchSource() { - - final HashSet sources = new HashSet<>(); - final HashSet visited = new HashSet<>(); - - for (ForgeDirection next : ForgeDirection.VALID_DIRECTIONS) { - final TileEntity te = super.getWorldObj().getTileEntity( - super.xCoord + next.offsetX, - super.yCoord + next.offsetY, - super.zCoord + next.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - if (cable.isConnected(next.getOpposite())) { - searchSourceRecursive(sources, visited, next.getOpposite(), cable); - } - } - } - - if (sources.isEmpty()) { - return null; - } else { - return sources.iterator().next(); - } - } - - private void searchSourceRecursive(HashSet sources, HashSet visited, - ForgeDirection from, TE_ItemProxyCable nextTarget) { - - if (!visited.contains(nextTarget.getIdentifier())) { - visited.add(nextTarget.getIdentifier()); - - for (ForgeDirection next : ForgeDirection.VALID_DIRECTIONS) { - if (next != from) { - final TileEntity te = super.getWorldObj().getTileEntity( - nextTarget.xCoord + next.offsetX, - nextTarget.yCoord + next.offsetY, - nextTarget.zCoord + next.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - if (cable.isConnected(next.getOpposite())) { - searchSourceRecursive(sources, visited, next.getOpposite(), cable); - } - } else if (te instanceof TE_ItemProxySource) { - sources.add((TE_ItemProxySource) te); - } - } - } - } - } - - @Override - public int getSizeInventory() { - return 1; - } - - @Override - public ItemStack getStackInSlot(int slot) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.getStackInSlot(channel); - } else { - return null; - } - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.decrStackSize(channel, amount); - } else { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return (proxyInventory != null) ? proxyInventory.getStackInSlotOnClosing(channel) : null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - if (proxyInventory != null && slot == 0) { - proxyInventory.setInventorySlotContents(channel, itemStack); - } - } - - @Override - public String getInventoryName() { - return (proxyInventory != null) ? "Connected: " + proxyInventory.getInventoryName() : "Untethered Proxy"; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return (proxyInventory != null) ? proxyInventory.getInventoryStackLimit() : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.isItemValidForSlot(channel, itemStack); - } else { - return false; - } - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[] { 0 }; - } - - @Override - public boolean canInsertItem(int slot, ItemStack itemStack, int side) { - return isItemValidForSlot(slot, itemStack); - } - - @Override - public boolean canExtractItem(int slot, ItemStack itemStack, int side) { - return slot == 0; - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxySource.java b/src/main/java/common/tileentities/TE_ItemProxySource.java deleted file mode 100644 index 31403f5352..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxySource.java +++ /dev/null @@ -1,105 +0,0 @@ -package common.tileentities; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class TE_ItemProxySource extends TileEntity implements IInventory { - - private final ItemStack[] slots = new ItemStack[16]; - private String idCache = null; - - /** - * Builds a simple unique identifier for this TileEntity by appending the x, y, and z coordinates in a string. - * - * @return unique identifier for this TileEntity - */ - public String getIdentifier() { - if (idCache == null) { - idCache = "" + super.xCoord + super.yCoord + super.zCoord; - return idCache; - } else { - return idCache; - } - } - - @Override - public int getSizeInventory() { - return slots.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return slots[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - if (slots[slot] != null) { - - ItemStack copy; - - if (slots[slot].stackSize == amount) { - copy = slots[slot]; - slots[slot] = null; - super.markDirty(); - return copy; - } else { - copy = slots[slot].splitStack(amount); - if (slots[slot].stackSize == 0) { - slots[slot] = null; - } - return copy; - } - - } else { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - slots[slot] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - super.markDirty(); - } - - @Override - public String getInventoryName() { - return "Item Proxy Source"; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - return true; - } -} -- cgit From 95d414ee4f549a4967e9c529cf005c8a0375e483 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 10 Sep 2023 17:04:00 +0900 Subject: Remove Nuclear Reactor things --- src/main/java/common/Blocks.java | 3 - src/main/java/common/CommonProxy.java | 2 - src/main/java/common/TileEntities.java | 1 - src/main/java/common/blocks/Block_ControlRod.java | 29 --- .../common/blocks/Block_ReactorChamber_OFF.java | 29 --- .../common/blocks/Block_ReactorChamber_ON.java | 34 ---- .../container/Container_ModularNuclearReactor.java | 77 ------- .../common/items/MetaItem_CraftingComponent.java | 11 - .../common/items/MetaItem_ReactorComponent.java | 119 ----------- .../common/reactorItem/AbstractReactorItem.java | 29 --- src/main/java/common/reactorItem/ReactorItem.java | 4