Fix the no-update issues
This commit is contained in:
parent
40659dcdac
commit
d4039d7f4b
5 changed files with 47 additions and 18 deletions
|
@ -40,6 +40,7 @@ import codechicken.lib.render.CCModel;
|
||||||
import codechicken.lib.vec.Cuboid6;
|
import codechicken.lib.vec.Cuboid6;
|
||||||
import codechicken.lib.vec.Vector3;
|
import codechicken.lib.vec.Vector3;
|
||||||
import codechicken.microblock.ISidedHollowConnect;
|
import codechicken.microblock.ISidedHollowConnect;
|
||||||
|
import codechicken.multipart.INeighborTileChange;
|
||||||
import codechicken.multipart.IconHitEffects;
|
import codechicken.multipart.IconHitEffects;
|
||||||
import codechicken.multipart.JIconHitEffects;
|
import codechicken.multipart.JIconHitEffects;
|
||||||
import codechicken.multipart.JNormalOcclusion;
|
import codechicken.multipart.JNormalOcclusion;
|
||||||
|
@ -51,7 +52,7 @@ import cpw.mods.fml.common.ModAPIManager;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, JNormalOcclusion, ISidedHollowConnect, JIconHitEffects, ITileNetwork, IBlockableConnection, IConfigurable, ITransmitter
|
public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, JNormalOcclusion, ISidedHollowConnect, JIconHitEffects, ITileNetwork, IBlockableConnection, IConfigurable, ITransmitter, INeighborTileChange
|
||||||
{
|
{
|
||||||
public static IndexedCuboid6[] smallSides = new IndexedCuboid6[7];
|
public static IndexedCuboid6[] smallSides = new IndexedCuboid6[7];
|
||||||
public static IndexedCuboid6[] largeSides = new IndexedCuboid6[7];
|
public static IndexedCuboid6[] largeSides = new IndexedCuboid6[7];
|
||||||
|
@ -514,9 +515,8 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborChanged()
|
public void onNeighborTileChanged(int side, boolean weak)
|
||||||
{
|
{
|
||||||
super.onNeighborChanged();
|
|
||||||
refreshConnections();
|
refreshConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,4 +673,10 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||||
return values()[ordinal()+1];
|
return values()[ordinal()+1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean weakTileChanges()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,9 +195,9 @@ public abstract class PartTransmitter<N extends DynamicNetwork<?, N>> extends Pa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborChanged()
|
public void onNeighborTileChanged(int side, boolean weak)
|
||||||
{
|
{
|
||||||
super.onNeighborChanged();
|
super.onNeighborTileChanged(side, weak);
|
||||||
|
|
||||||
if(!world().isRemote)
|
if(!world().isRemote)
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,9 +161,9 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock implements I
|
||||||
{
|
{
|
||||||
Coord4D obj = Coord4D.get(this).getFromSide(side);
|
Coord4D obj = Coord4D.get(this).getFromSide(side);
|
||||||
|
|
||||||
if(!(obj.getTileEntity(worldObj) instanceof TileEntityDynamicTank))
|
if(!obj.isAirBlock(worldObj) && !(obj.getTileEntity(worldObj) instanceof TileEntityDynamicTank))
|
||||||
{
|
{
|
||||||
worldObj.notifyBlockOfNeighborChange(obj.xCoord, obj.yCoord, obj.zCoord, getBlockType());
|
obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,9 @@ public class TileEntitySalinationController extends TileEntitySalinationBlock
|
||||||
|
|
||||||
temperature = Math.min(getMaxTemperature(), getTemperature());
|
temperature = Math.min(getMaxTemperature(), getTemperature());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
clearStructure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,15 +384,7 @@ public class TileEntitySalinationController extends TileEntitySalinationBlock
|
||||||
structured = scanTopLayer(startPoint);
|
structured = scanTopLayer(startPoint);
|
||||||
height = structured ? height : 0;
|
height = structured ? height : 0;
|
||||||
|
|
||||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
markDirty();
|
||||||
|
|
||||||
for(TileEntitySalinationBlock tank : tankParts)
|
|
||||||
{
|
|
||||||
if(tank != this && tank instanceof TileEntitySalinationValve)
|
|
||||||
{
|
|
||||||
worldObj.notifyBlocksOfNeighborChange(tank.xCoord, tank.yCoord, tank.zCoord, tank.getBlockType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return structured;
|
return structured;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package mekanism.common.tile;
|
package mekanism.common.tile;
|
||||||
|
|
||||||
|
import mekanism.api.Coord4D;
|
||||||
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.util.PipeUtils;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
@ -9,6 +12,31 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
|
||||||
public class TileEntitySalinationValve extends TileEntitySalinationBlock implements IFluidHandler
|
public class TileEntitySalinationValve extends TileEntitySalinationBlock implements IFluidHandler
|
||||||
{
|
{
|
||||||
|
public boolean prevMaster = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate()
|
||||||
|
{
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
if(!worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if((master != null) != prevMaster)
|
||||||
|
{
|
||||||
|
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||||
|
{
|
||||||
|
Coord4D obj = Coord4D.get(this).getFromSide(side);
|
||||||
|
|
||||||
|
if(!obj.isAirBlock(worldObj) && !(obj.getTileEntity(worldObj) instanceof TileEntitySalinationBlock))
|
||||||
|
{
|
||||||
|
obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prevMaster = (master != null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +82,7 @@ public class TileEntitySalinationValve extends TileEntitySalinationBlock impleme
|
||||||
{
|
{
|
||||||
if(master == null)
|
if(master == null)
|
||||||
{
|
{
|
||||||
return new FluidTankInfo[0];
|
return PipeUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FluidTankInfo[] {new FluidTankInfo(master.waterTank), new FluidTankInfo(master.brineTank)};
|
return new FluidTankInfo[] {new FluidTankInfo(master.waterTank), new FluidTankInfo(master.brineTank)};
|
||||||
|
|
Loading…
Reference in a new issue