From 53f833b0949062eac35612a57278460a8f9e87a9 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Fri, 7 Mar 2014 21:41:00 -0800 Subject: [PATCH] Fixed #396 - Dust block place on wall material bug --- .../energy/network/TileMechanical.java | 8 +++ .../resonantinduction/core/CommonProxy.java | 1 - .../core/fluid/FluidDistributionetwork.java | 3 - .../core/fluid/TileFluidDistribution.java | 19 ------ .../core/fluid/TilePressurizedNode.java | 2 - .../resonantinduction/core/grid/Grid.java | 3 - .../resonantinduction/core/grid/Node.java | 1 - .../resonantinduction/core/grid/NodeGrid.java | 8 --- .../core/grid/TickingGrid.java | 2 - .../core/grid/UpdateTicker.java | 14 ++-- .../core/grid/fluid/PressureNode.java | 4 +- .../prefab/part/PartColorableMaterial.java | 2 - .../core/resource/BlockDust.java | 65 +++++++++++-------- .../core/resource/ItemOreResource.java | 2 - 14 files changed, 55 insertions(+), 79 deletions(-) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java index 8cfab6e8d..38bd95d78 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/network/TileMechanical.java @@ -45,6 +45,14 @@ public abstract class TileMechanical extends TileAdvanced implements IMechanical public void initiate() { mechanicalNode.reconstruct(); + super.initiate(); + } + + @Override + public void invalidate() + { + mechanicalNode.deconstruct(); + super.invalidate(); } @Override diff --git a/src/main/java/resonantinduction/core/CommonProxy.java b/src/main/java/resonantinduction/core/CommonProxy.java index 17b130d65..ab4b13284 100644 --- a/src/main/java/resonantinduction/core/CommonProxy.java +++ b/src/main/java/resonantinduction/core/CommonProxy.java @@ -3,7 +3,6 @@ */ package resonantinduction.core; -import resonantinduction.core.grid.UpdateTicker; import net.minecraft.world.World; import universalelectricity.api.vector.Vector3; import calclavia.lib.prefab.ProxyBase; diff --git a/src/main/java/resonantinduction/core/fluid/FluidDistributionetwork.java b/src/main/java/resonantinduction/core/fluid/FluidDistributionetwork.java index c719b7ab5..90d0c1723 100644 --- a/src/main/java/resonantinduction/core/fluid/FluidDistributionetwork.java +++ b/src/main/java/resonantinduction/core/fluid/FluidDistributionetwork.java @@ -1,7 +1,5 @@ package resonantinduction.core.fluid; -import java.util.Set; - import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; @@ -10,7 +8,6 @@ import net.minecraftforge.fluids.IFluidHandler; import universalelectricity.api.net.IUpdate; import universalelectricity.core.net.NetworkTickHandler; import universalelectricity.core.net.NodeNetwork; -import calclavia.lib.utility.FluidUtility; /** * The fluid network for instantaneous equal distribution between all nodes. Used for tanks. diff --git a/src/main/java/resonantinduction/core/fluid/TileFluidDistribution.java b/src/main/java/resonantinduction/core/fluid/TileFluidDistribution.java index 1382600a1..5d3a92238 100644 --- a/src/main/java/resonantinduction/core/fluid/TileFluidDistribution.java +++ b/src/main/java/resonantinduction/core/fluid/TileFluidDistribution.java @@ -1,33 +1,14 @@ package resonantinduction.core.fluid; -import java.util.List; - import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTankInfo; -import resonantinduction.api.IInformation; -import resonantinduction.core.ResonantInduction; import universalelectricity.api.vector.Vector3; -import calclavia.lib.network.IPacketReceiverWithID; -import calclavia.lib.network.PacketHandler; -import calclavia.lib.prefab.tile.TileAdvanced; -import calclavia.lib.utility.FluidUtility; import calclavia.lib.utility.WorldUtility; -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - /** * A prefab class for tiles that use the fluid network. * diff --git a/src/main/java/resonantinduction/core/fluid/TilePressurizedNode.java b/src/main/java/resonantinduction/core/fluid/TilePressurizedNode.java index ee8784b39..885a5c154 100644 --- a/src/main/java/resonantinduction/core/fluid/TilePressurizedNode.java +++ b/src/main/java/resonantinduction/core/fluid/TilePressurizedNode.java @@ -1,7 +1,6 @@ package resonantinduction.core.fluid; import net.minecraft.block.material.Material; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; @@ -9,7 +8,6 @@ import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTankInfo; import resonantinduction.core.grid.fluid.IPressureNodeProvider; import resonantinduction.core.grid.fluid.PressureNode; -import universalelectricity.api.vector.Vector3; import calclavia.lib.network.IPacketReceiverWithID; /** diff --git a/src/main/java/resonantinduction/core/grid/Grid.java b/src/main/java/resonantinduction/core/grid/Grid.java index 146e29751..f58184cab 100644 --- a/src/main/java/resonantinduction/core/grid/Grid.java +++ b/src/main/java/resonantinduction/core/grid/Grid.java @@ -6,9 +6,6 @@ import java.util.Iterator; import java.util.Set; import java.util.WeakHashMap; -import universalelectricity.api.net.IUpdate; -import universalelectricity.core.net.ConnectionPathfinder; - /** * A grid specifying a connection with a series of nodes. * diff --git a/src/main/java/resonantinduction/core/grid/Node.java b/src/main/java/resonantinduction/core/grid/Node.java index e4a65cc8f..5bf101734 100644 --- a/src/main/java/resonantinduction/core/grid/Node.java +++ b/src/main/java/resonantinduction/core/grid/Node.java @@ -3,7 +3,6 @@ package resonantinduction.core.grid; import java.util.AbstractMap; import java.util.WeakHashMap; -import resonantinduction.mechanical.energy.network.IMechanicalNodeProvider; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.ForgeDirection; diff --git a/src/main/java/resonantinduction/core/grid/NodeGrid.java b/src/main/java/resonantinduction/core/grid/NodeGrid.java index 4a3757893..4f4bdac32 100644 --- a/src/main/java/resonantinduction/core/grid/NodeGrid.java +++ b/src/main/java/resonantinduction/core/grid/NodeGrid.java @@ -1,18 +1,10 @@ package resonantinduction.core.grid; import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; import net.minecraftforge.common.ForgeDirection; -import resonantinduction.mechanical.energy.network.MechanicalNode; -import universalelectricity.api.net.IConnectable; -import universalelectricity.api.net.IUpdate; public abstract class NodeGrid extends Grid { diff --git a/src/main/java/resonantinduction/core/grid/TickingGrid.java b/src/main/java/resonantinduction/core/grid/TickingGrid.java index 85920a46e..b85c0d531 100644 --- a/src/main/java/resonantinduction/core/grid/TickingGrid.java +++ b/src/main/java/resonantinduction/core/grid/TickingGrid.java @@ -1,8 +1,6 @@ package resonantinduction.core.grid; -import resonantinduction.mechanical.energy.network.MechanicalNode; import universalelectricity.api.net.IUpdate; -import universalelectricity.core.net.NetworkTickHandler; public class TickingGrid extends NodeGrid implements IUpdate { diff --git a/src/main/java/resonantinduction/core/grid/UpdateTicker.java b/src/main/java/resonantinduction/core/grid/UpdateTicker.java index ff8692da7..5474f579b 100644 --- a/src/main/java/resonantinduction/core/grid/UpdateTicker.java +++ b/src/main/java/resonantinduction/core/grid/UpdateTicker.java @@ -1,15 +1,17 @@ package resonantinduction.core.grid; -import cpw.mods.fml.common.ITickHandler; -import cpw.mods.fml.common.TickType; -import net.minecraft.server.MinecraftServer; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Queue; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; + import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.Event; import universalelectricity.api.net.IUpdate; -import java.util.*; -import java.util.concurrent.ConcurrentLinkedQueue; - /** * A ticker to update all grids. This is multithreaded. * diff --git a/src/main/java/resonantinduction/core/grid/fluid/PressureNode.java b/src/main/java/resonantinduction/core/grid/fluid/PressureNode.java index 9a2cf6a0e..a8fa2260d 100644 --- a/src/main/java/resonantinduction/core/grid/fluid/PressureNode.java +++ b/src/main/java/resonantinduction/core/grid/fluid/PressureNode.java @@ -11,10 +11,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.IFluidHandler; import resonantinduction.api.mechanical.fluid.IPressure; -import resonantinduction.core.grid.Grid; import resonantinduction.core.grid.Node; import resonantinduction.core.grid.TickingGrid; -import resonantinduction.mechanical.energy.network.IMechanicalNodeProvider; import universalelectricity.api.vector.Vector3; import codechicken.multipart.TMultiPart; @@ -192,7 +190,7 @@ public class PressureNode extends Node= 0) + if (materialName != null) { - byte b0 = 32; + int metadata = world.getBlockMetadata(x, y, z); - world.setBlockToAir(x, y, z); - - while (canFallBelow(world, x, y - 1, z) && y > 0) + if (canFallBelow(world, x, y - 1, z) && y >= 0) { - --y; - } + byte b0 = 32; - if (y > 0) - { - world.setBlock(x, y, z, this.blockID, metadata, 3); + world.setBlockToAir(x, y, z); - TileEntity newTile = world.getBlockTileEntity(x, y, z); - - if (newTile instanceof TileMaterial) + while (canFallBelow(world, x, y - 1, z) && y > 0) { - ((TileMaterial) newTile).name = materialName; + --y; + } + + if (y > 0) + { + world.setBlock(x, y, z, this.blockID, metadata, 3); + + TileEntity newTile = world.getBlockTileEntity(x, y, z); + + if (newTile instanceof TileMaterial) + { + ((TileMaterial) newTile).name = materialName; + } } } } diff --git a/src/main/java/resonantinduction/core/resource/ItemOreResource.java b/src/main/java/resonantinduction/core/resource/ItemOreResource.java index 30a26032b..47bf6f49e 100644 --- a/src/main/java/resonantinduction/core/resource/ItemOreResource.java +++ b/src/main/java/resonantinduction/core/resource/ItemOreResource.java @@ -15,13 +15,11 @@ import net.minecraftforge.oredict.OreDictionary; import resonantinduction.api.recipe.MachineRecipes; import resonantinduction.api.recipe.MachineRecipes.RecipeType; import resonantinduction.api.recipe.RecipeResource; -import resonantinduction.archaic.Archaic; import resonantinduction.archaic.fluid.gutter.TileGutter; import resonantinduction.core.Reference; import resonantinduction.core.ResonantInduction; import resonantinduction.core.TabRI; import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.FluidUtility; import calclavia.lib.utility.LanguageUtility; import calclavia.lib.utility.inventory.InventoryUtility; import cpw.mods.fml.relauncher.Side;