From 7cb0bec18480b30e45ef4fed6be095531eea8416 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 4 Apr 2022 11:19:23 +0200 Subject: [PATCH] proxy tiles work with re-eval, network debugger item --- .../java/api/hbm/energy/IEnergyConductor.java | 42 +++++++-- .../java/api/hbm/energy/IEnergyConnector.java | 19 ++++ src/main/java/api/hbm/energy/PowerNet.java | 30 ++++++- src/main/java/com/hbm/blocks/ModBlocks.java | 4 + .../hbm/blocks/fluid/GenericFluidBlock.java | 5 +- src/main/java/com/hbm/items/ModItems.java | 7 ++ .../com/hbm/items/tool/ItemPowerNetTool.java | 81 ++++++++++++++++++ src/main/java/com/hbm/main/ClientProxy.java | 9 ++ .../java/com/hbm/particle/ParticleText.java | 64 ++++++++++++++ .../satellites/SatelliteLunarMiner.java | 6 +- .../tileentity/TileEntityProxyConductor.java | 16 ++++ .../network/TileEntityConnector.java | 2 - .../network/TileEntitySubstation.java | 16 ++++ src/main/java/com/hbm/util/ChatBuilder.java | 5 ++ .../textures/items/bucket_sulfuric_acid.png | Bin 0 -> 425 bytes .../hbm/textures/items/power_net_tool.png | Bin 0 -> 321 bytes 16 files changed, 286 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/hbm/items/tool/ItemPowerNetTool.java create mode 100644 src/main/java/com/hbm/particle/ParticleText.java create mode 100644 src/main/resources/assets/hbm/textures/items/bucket_sulfuric_acid.png create mode 100644 src/main/resources/assets/hbm/textures/items/power_net_tool.png diff --git a/src/main/java/api/hbm/energy/IEnergyConductor.java b/src/main/java/api/hbm/energy/IEnergyConductor.java index 1744c5f79..a8c244b7a 100644 --- a/src/main/java/api/hbm/energy/IEnergyConductor.java +++ b/src/main/java/api/hbm/energy/IEnergyConductor.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; /** @@ -52,7 +53,7 @@ public interface IEnergyConductor extends IEnergyConnector { * Each link has to decide what other links will join the same net. * @param copy */ - public default void reevaluate(HashMap copy) { + public default void reevaluate(HashMap copy, HashMap proxies) { for(int[] pos : getConnectionPoints()) { int newX = pos[0]; @@ -62,12 +63,37 @@ public interface IEnergyConductor extends IEnergyConnector { IEnergyConductor neighbor = copy.get(id); - if(neighbor != null && neighbor.getPowerNet() != null && this.canReevaluate() && neighbor.canReevaluate()) { + if(neighbor == null) { + Integer newId = proxies.get(id); - if(this.getPowerNet() == null) { - neighbor.getPowerNet().joinLink(this); + if(newId != null) { + neighbor = copy.get(newId); + } + } + + if(neighbor != null && this.canReevaluate() && neighbor.canReevaluate()) { + + if(neighbor.getPowerNet() != null) { + + //neighbor net and no self net + if(this.getPowerNet() == null) { + neighbor.getPowerNet().joinLink(this); + //neighbor net and self net + } else { + this.getPowerNet().joinNetworks(neighbor.getPowerNet()); + } + + //bidirectional re-eval, experimental and technically optional, only useful as a fallback } else { - this.getPowerNet().joinNetworks(neighbor.getPowerNet()); + + //no neighbor net and no self net + if(this.getPowerNet() == null) { + this.setPowerNet(new PowerNet().joinLink(this)); + neighbor.setPowerNet(this.getPowerNet().joinLink(neighbor)); + //no neighbor net and self net + } else { + neighbor.setPowerNet(this.getPowerNet().joinLink(neighbor)); + } } } } @@ -114,4 +140,10 @@ public interface IEnergyConductor extends IEnergyConnector { return this.getPowerNet().transferPower(power); } + + public default Vec3 getDebugParticlePos() { + TileEntity te = (TileEntity) this; + Vec3 vec = Vec3.createVectorHelper(te.xCoord + 0.5, te.yCoord + 1.5, te.zCoord + 0.5); + return vec; + } } diff --git a/src/main/java/api/hbm/energy/IEnergyConnector.java b/src/main/java/api/hbm/energy/IEnergyConnector.java index 40ad4e647..0799c228a 100644 --- a/src/main/java/api/hbm/energy/IEnergyConnector.java +++ b/src/main/java/api/hbm/energy/IEnergyConnector.java @@ -1,5 +1,8 @@ package api.hbm.energy; +import java.util.ArrayList; +import java.util.List; + import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; @@ -94,4 +97,20 @@ public interface IEnergyConnector extends ILoadedTile { } public static final boolean particleDebug = false; + + /** + * Returns whether the conductor has mutliblock proxies which need to be taken into consideration for re-eval. + * @return + */ + public default boolean hasProxies() { + return false; + } + + /** + * Returns the identities (position-based) of proxies which resolve into the conductor's own identity. + * @return + */ + public default List getProxies() { + return new ArrayList(); + } } diff --git a/src/main/java/api/hbm/energy/PowerNet.java b/src/main/java/api/hbm/energy/PowerNet.java index 2969e9e4d..d563c2bf5 100644 --- a/src/main/java/api/hbm/energy/PowerNet.java +++ b/src/main/java/api/hbm/energy/PowerNet.java @@ -15,6 +15,7 @@ public class PowerNet implements IPowerNet { private boolean valid = true; private HashMap links = new HashMap(); + private HashMap proxies = new HashMap(); private List subscribers = new ArrayList(); @Override @@ -42,14 +43,29 @@ public class PowerNet implements IPowerNet { conductor.getPowerNet().leaveLink(conductor); conductor.setPowerNet(this); - this.links.put(conductor.getIdentity(), conductor); + int identity = conductor.getIdentity(); + this.links.put(identity, conductor); + + if(conductor.hasProxies()) { + for(Integer i : conductor.getProxies()) { + this.proxies.put(i, identity); + } + } + return this; } @Override public void leaveLink(IEnergyConductor conductor) { conductor.setPowerNet(null); - this.links.remove(conductor.getIdentity()); + int identity = conductor.getIdentity(); + this.links.remove(identity); + + if(conductor.hasProxies()) { + for(Integer i : conductor.getProxies()) { + this.proxies.remove(i); + } + } } @Override @@ -74,6 +90,11 @@ public class PowerNet implements IPowerNet { return linkList; } + public HashMap getProxies() { + HashMap proxyCopy = new HashMap(proxies); + return proxyCopy; + } + @Override public List getSubscribers() { return this.subscribers; @@ -143,8 +164,9 @@ public class PowerNet implements IPowerNet { @Override public void reevaluate() { - + HashMap copy = new HashMap(links); + HashMap proxyCopy = new HashMap(proxies); for(IEnergyConductor link : copy.values()) { this.leaveLink(link); @@ -153,7 +175,7 @@ public class PowerNet implements IPowerNet { for(IEnergyConductor link : copy.values()) { link.setPowerNet(null); - link.reevaluate(copy); + link.reevaluate(copy, proxyCopy); if(link.getPowerNet() == null) { link.setPowerNet(new PowerNet().joinLink(link)); diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index ec06e13b4..50315005c 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -471,6 +471,8 @@ public class ModBlocks { public static Block fallout; public static Block foam_layer; public static Block sand_boron_layer; + public static Block leaves_layer; + public static Block sellafield_slaked; public static Block sellafield_0; @@ -1677,6 +1679,7 @@ public class ModBlocks { fallout = new BlockFallout(Material.snow).setBlockName("fallout").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":ash"); foam_layer = new BlockLayering(Material.snow).setBlockName("foam_layer").setStepSound(Block.soundTypeSnow).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":foam"); sand_boron_layer = new BlockLayering(Material.sand).setBlockName("sand_boron_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":sand_boron"); + leaves_layer = new BlockLayering(Material.leaves).setBlockName("leaves_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":waste_leaves"); burning_earth = new WasteEarth(Material.ground, true).setBlockName("burning_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":burning_earth"); tektite = new BlockGeneric(Material.sand).setBlockName("tektite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":tektite"); @@ -2707,6 +2710,7 @@ public class ModBlocks { GameRegistry.registerBlock(fallout, fallout.getUnlocalizedName()); GameRegistry.registerBlock(foam_layer, foam_layer.getUnlocalizedName()); GameRegistry.registerBlock(sand_boron_layer, sand_boron_layer.getUnlocalizedName()); + GameRegistry.registerBlock(leaves_layer, leaves_layer.getUnlocalizedName()); GameRegistry.registerBlock(burning_earth, burning_earth.getUnlocalizedName()); GameRegistry.registerBlock(tektite, tektite.getUnlocalizedName()); GameRegistry.registerBlock(ore_tektite_osmiridium, ore_tektite_osmiridium.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java b/src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java index ebd04d324..d4d61c72b 100644 --- a/src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java +++ b/src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java @@ -2,9 +2,7 @@ package com.hbm.blocks.fluid; import java.util.Random; -import com.hbm.lib.ModDamageSource; import com.hbm.lib.RefStrings; -import com.hbm.util.ArmorUtil; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -12,8 +10,6 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.passive.EntitySquid; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.util.IIcon; import net.minecraft.world.World; @@ -61,6 +57,7 @@ public class GenericFluidBlock extends BlockFluidClassic { flowingIcon = register.registerIcon(RefStrings.MODID + ":" + flowingName); } + /** Only temporary, will be moved into a subclass */ @Override public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 469c370a2..411f4f8c3 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1209,6 +1209,7 @@ public class ModItems { public static Item mirror_tool; public static Item rbmk_tool; public static Item coltan_tool; + public static Item power_net_tool; public static Item template_folder; public static Item journal_pip; @@ -2388,6 +2389,7 @@ public class ModItems { public static Item bucket_acid; public static Item bucket_toxic; public static Item bucket_schrabidic_acid; + public static Item bucket_sulfuric_acid; public static Item door_metal; public static Item door_office; @@ -4732,6 +4734,7 @@ public class ModItems { mirror_tool = new ItemMirrorTool().setUnlocalizedName("mirror_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":mirror_tool"); rbmk_tool = new ItemRBMKTool().setUnlocalizedName("rbmk_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":rbmk_tool"); coltan_tool = new ItemColtanCompass().setUnlocalizedName("coltan_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coltass"); + power_net_tool = new ItemPowerNetTool().setUnlocalizedName("power_net_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":power_net_tool"); key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key"); key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red"); @@ -5472,6 +5475,7 @@ public class ModItems { bucket_acid = new ItemModBucket(ModBlocks.acid_block).setUnlocalizedName("bucket_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_acid"); bucket_toxic = new ItemModBucket(ModBlocks.toxic_block).setUnlocalizedName("bucket_toxic").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_toxic"); bucket_schrabidic_acid = new ItemModBucket(ModBlocks.schrabidic_block).setUnlocalizedName("bucket_schrabidic_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_schrabidic_acid"); + bucket_sulfuric_acid = new ItemModBucket(ModBlocks.sulfuric_acid_block).setUnlocalizedName("bucket_sulfuric_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_sulfuric_acid"); door_metal = new ItemModDoor().setUnlocalizedName("door_metal").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_metal"); door_office = new ItemModDoor().setUnlocalizedName("door_office").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_office"); @@ -5621,6 +5625,7 @@ public class ModItems { BucketHandler.INSTANCE.buckets.put(ModBlocks.acid_block, ModItems.bucket_acid); BucketHandler.INSTANCE.buckets.put(ModBlocks.toxic_block, ModItems.bucket_toxic); BucketHandler.INSTANCE.buckets.put(ModBlocks.schrabidic_block, ModItems.bucket_schrabidic_acid); + BucketHandler.INSTANCE.buckets.put(ModBlocks.sulfuric_acid_block, ModItems.bucket_sulfuric_acid); MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); } @@ -6838,6 +6843,7 @@ public class ModItems { GameRegistry.registerItem(mirror_tool, mirror_tool.getUnlocalizedName()); GameRegistry.registerItem(rbmk_tool, rbmk_tool.getUnlocalizedName()); GameRegistry.registerItem(coltan_tool, coltan_tool.getUnlocalizedName()); + GameRegistry.registerItem(power_net_tool, power_net_tool.getUnlocalizedName()); GameRegistry.registerItem(dosimeter, dosimeter.getUnlocalizedName()); GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName()); GameRegistry.registerItem(digamma_diagnostic, digamma_diagnostic.getUnlocalizedName()); @@ -8003,6 +8009,7 @@ public class ModItems { GameRegistry.registerItem(bucket_acid, bucket_acid.getUnlocalizedName()); GameRegistry.registerItem(bucket_toxic, bucket_toxic.getUnlocalizedName()); GameRegistry.registerItem(bucket_schrabidic_acid, bucket_schrabidic_acid.getUnlocalizedName()); + GameRegistry.registerItem(bucket_sulfuric_acid, bucket_sulfuric_acid.getUnlocalizedName()); //Door Items GameRegistry.registerItem(door_metal, door_metal.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/tool/ItemPowerNetTool.java b/src/main/java/com/hbm/items/tool/ItemPowerNetTool.java new file mode 100644 index 000000000..b67ded1b3 --- /dev/null +++ b/src/main/java/com/hbm/items/tool/ItemPowerNetTool.java @@ -0,0 +1,81 @@ +package com.hbm.items.tool; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.util.ChatBuilder; + +import api.hbm.energy.IEnergyConductor; +import api.hbm.energy.IPowerNet; +import api.hbm.energy.PowerNet; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class ItemPowerNetTool extends Item { + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) { + + Block b = world.getBlock(x, y, z); + + if(b instanceof BlockDummyable) { + int[] pos = ((BlockDummyable) b).findCore(world, x, y, z); + + if(pos != null) { + x = pos[0]; + y = pos[1]; + z = pos[2]; + } + } + + TileEntity te = world.getTileEntity(x, y, z); + + if(!(te instanceof IEnergyConductor)) + return false; + + if(world.isRemote) + return true; + + IEnergyConductor con = (IEnergyConductor) te; + IPowerNet net = con.getPowerNet(); + + if(net == null) { + player.addChatComponentMessage(ChatBuilder.start("Error: No network found! This should be impossible!").color(EnumChatFormatting.RED).flush()); + return true; + } + + if(!(net instanceof PowerNet)) { + player.addChatComponentMessage(ChatBuilder.start("Error: Cannot print diagnostic for non-standard power net implementation!").color(EnumChatFormatting.RED).flush()); + } + + PowerNet network = (PowerNet) net; + String id = Integer.toHexString(net.hashCode()); + + player.addChatComponentMessage(ChatBuilder.start("Start of diagnostic for network" + id).color(EnumChatFormatting.GOLD).flush()); + player.addChatComponentMessage(ChatBuilder.start("Links: " + network.getLinks().size()).color(EnumChatFormatting.YELLOW).flush()); + player.addChatComponentMessage(ChatBuilder.start("Proxies: " + network.getProxies().size()).color(EnumChatFormatting.YELLOW).flush()); + player.addChatComponentMessage(ChatBuilder.start("Subscribers: " + network.getSubscribers().size()).color(EnumChatFormatting.YELLOW).flush()); + player.addChatComponentMessage(ChatBuilder.start("End of diagnostic for network" + id).color(EnumChatFormatting.GOLD).flush()); + + for(IEnergyConductor link : network.getLinks()) { + Vec3 pos = link.getDebugParticlePos(); + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "text"); + data.setInteger("color", 0xffff00); + data.setFloat("scale", 0.5F); + data.setString("text", id); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, 20)); + } + + return true; + } +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index ce28cc008..ac1474ef8 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -1571,6 +1571,15 @@ public class ClientProxy extends ServerProxy { if("amat".equals(type)) { Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleAmatFlash(world, x, y, z, data.getFloat("scale"))); } + + if("debug".equals(type)) { + String t = data.getString("text"); + int color = data.getInteger("color"); + float scale = data.getFloat("scale"); + ParticleText text = new ParticleText(world, x, y, z, color, t); + text.multipleParticleScaleBy(scale); + Minecraft.getMinecraft().effectRenderer.addEffect(text); + } } private HashMap vanished = new HashMap(); diff --git a/src/main/java/com/hbm/particle/ParticleText.java b/src/main/java/com/hbm/particle/ParticleText.java new file mode 100644 index 000000000..f1c6711c9 --- /dev/null +++ b/src/main/java/com/hbm/particle/ParticleText.java @@ -0,0 +1,64 @@ +package com.hbm.particle; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class ParticleText extends EntityFX { + + int color; + String text; + + public ParticleText(World world, double x, double y, double z, int color, String text) { + super(world, x, y, z); + this.particleMaxAge = 30; + this.color = color; + this.text = text; + + this.motionY = 0.1D; + } + + public int getFXLayer() { + return 3; + } + + public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) { + + GL11.glPushMatrix(); + + GL11.glDisable(GL11.GL_LIGHTING); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 0.0F); + RenderHelper.disableStandardItemLighting(); + + Minecraft mc = Minecraft.getMinecraft(); + FontRenderer font = mc.fontRenderer; + + this.rotationYaw = -mc.thePlayer.rotationYaw; + this.rotationPitch = mc.thePlayer.rotationPitch; + + float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX); + float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY); + float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ); + + GL11.glTranslatef(pX, pY, pZ); + GL11.glRotatef(this.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.rotationPitch, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + + GL11.glScaled(particleScale, particleScale, particleScale); + + font.drawStringWithShadow(text, -(int) (font.getStringWidth(text) * 0.5F), -(int) (font.FONT_HEIGHT * 0.5F), color); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glEnable(GL11.GL_LIGHTING); + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/saveddata/satellites/SatelliteLunarMiner.java b/src/main/java/com/hbm/saveddata/satellites/SatelliteLunarMiner.java index f297b315e..99195b6d5 100644 --- a/src/main/java/com/hbm/saveddata/satellites/SatelliteLunarMiner.java +++ b/src/main/java/com/hbm/saveddata/satellites/SatelliteLunarMiner.java @@ -1,7 +1,3 @@ package com.hbm.saveddata.satellites; -import net.minecraft.nbt.NBTTagCompound; - -public class SatelliteLunarMiner extends SatelliteMiner { - -} \ No newline at end of file +public class SatelliteLunarMiner extends SatelliteMiner { } \ No newline at end of file diff --git a/src/main/java/com/hbm/tileentity/TileEntityProxyConductor.java b/src/main/java/com/hbm/tileentity/TileEntityProxyConductor.java index 1c458df9d..1bcbaa6cb 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityProxyConductor.java +++ b/src/main/java/com/hbm/tileentity/TileEntityProxyConductor.java @@ -1,5 +1,8 @@ package com.hbm.tileentity; +import java.util.ArrayList; +import java.util.List; + import api.hbm.energy.IEnergyConductor; import api.hbm.energy.IPowerNet; import net.minecraft.tileentity.TileEntity; @@ -68,4 +71,17 @@ public class TileEntityProxyConductor extends TileEntityProxyBase implements IEn ((IEnergyConductor)te).setPowerNet(network); } } + + @Override + public List getConnectionPoints() { + + /*TileEntity te = this.getTE(); + + if(te instanceof IEnergyConductor) { + return ((IEnergyConductor)te).getConnectionPoints(); + }*/ + + /* Proxy TE doesn't need to implement proxying here because the conductor main TE already has a network-specific proxying system */ + return new ArrayList(); + } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityConnector.java b/src/main/java/com/hbm/tileentity/network/TileEntityConnector.java index 122e71ae5..18908ba92 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityConnector.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityConnector.java @@ -3,8 +3,6 @@ package com.hbm.tileentity.network; import java.util.ArrayList; import java.util.List; -import api.hbm.energy.IEnergyConductor; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/com/hbm/tileentity/network/TileEntitySubstation.java b/src/main/java/com/hbm/tileentity/network/TileEntitySubstation.java index bcb29c5e0..6f4235e38 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntitySubstation.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntitySubstation.java @@ -5,6 +5,7 @@ import java.util.List; import com.hbm.blocks.BlockDummyable; +import api.hbm.energy.IEnergyConductor; import net.minecraft.util.Vec3; public class TileEntitySubstation extends TileEntityPylonBase { @@ -58,4 +59,19 @@ public class TileEntitySubstation extends TileEntityPylonBase { pos.add(new int[] {xCoord + 1, yCoord, zCoord - 2}); return pos; } + + @Override + public boolean hasProxies() { + return true; + } + + @Override + public List getProxies() { + List proxies = new ArrayList(); + proxies.add(IEnergyConductor.getIdentityFromPos(xCoord + 1, yCoord, zCoord + 1)); + proxies.add(IEnergyConductor.getIdentityFromPos(xCoord + 1, yCoord, zCoord - 1)); + proxies.add(IEnergyConductor.getIdentityFromPos(xCoord - 1, yCoord, zCoord + 1)); + proxies.add(IEnergyConductor.getIdentityFromPos(xCoord - 1, yCoord, zCoord - 1)); + return proxies; + } } diff --git a/src/main/java/com/hbm/util/ChatBuilder.java b/src/main/java/com/hbm/util/ChatBuilder.java index 6ed56f8ee..0140af364 100644 --- a/src/main/java/com/hbm/util/ChatBuilder.java +++ b/src/main/java/com/hbm/util/ChatBuilder.java @@ -21,6 +21,11 @@ public class ChatBuilder { return builder; } + public static ChatBuilder startTranslation(String text) { + ChatBuilder builder = new ChatBuilder("").nextTranslation(text); + return builder; + } + public ChatBuilder next(String text) { ChatComponentText append = new ChatComponentText(text); this.last.appendSibling(append); diff --git a/src/main/resources/assets/hbm/textures/items/bucket_sulfuric_acid.png b/src/main/resources/assets/hbm/textures/items/bucket_sulfuric_acid.png new file mode 100644 index 0000000000000000000000000000000000000000..d1863b06da265e932acd962679ae9f7b546a2d83 GIT binary patch literal 425 zcmV;a0apHrP)ZXQlS-C%=@1U9#d%|fdPjfVISDA6PY z5^Zfw2loevAPM5);-Cpm-EH3~o*_ZlqQ|9YEm{4Uli$Ak_;MC334&TLLZmVv9~rjX>lT)#hM=FAz7$0$k^RgD2)nijS# zNT)B5MVNj_# z+?3t`ux){9T9~FqrRGq74pA%?cV{r2PB9DvfJ`O>ga8MChr1K{{XU&eXScvwMAI}1 z*Poo7Ke_$)VTnaB4~+Z;R>>}_)hYn#%NKgRo;&zq3r6D+tyaqoa4Ul~gTVkz(?}+h z00<#g+qdx*@Z;#~ale4B>r%N~c3pT`1oK<=cRFY^8g4Cw_|@6ozu;wa`=9U)?n#IM Tidx#w00000NkvXXu0mjfb>k6hI$Q278Kpg;@6Btv6tbI7Cm;gXBCY6Q}S{&M8f@rU4*?fH6i$DHmgmNF}=poO9H5or$(+twjg{t+gn&;JsfZDf2w<_I83; zw)cLWN36A?>$)YCoj3VR(?r|0>pT(@x9kKdQ4}vRm04>Ay!cF|Ubn3r9{3ACHivBE T>v0CA00000NkvXXu0mjfuK|Nh literal 0 HcmV?d00001