mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 20:12:30 +00:00
Fixed the no-update issues
This commit is contained in:
1 parent
a0b8ab0331
commit
ed919fa19a
5 files changed
+46
-18
No files matched your search
@@ -40,6 +40,7 @@ import codechicken.lib.render.CCModel;
|
||||
import codechicken.lib.vec.Cuboid6;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import codechicken.microblock.ISidedHollowConnect;
|
||||
import codechicken.multipart.INeighborTileChange;
|
||||
import codechicken.multipart.IconHitEffects;
|
||||
import codechicken.multipart.JIconHitEffects;
|
||||
import codechicken.multipart.JNormalOcclusion;
|
||||
@@ -52,7 +53,7 @@ import cpw.mods.fml.common.ModAPIManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
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[] largeSides = new IndexedCuboid6[7];
|
||||
@@ -513,11 +514,10 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
super.onChunkLoad();
|
||||
refreshConnections();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
public void onNeighborTileChanged(int side, boolean weak)
|
||||
{
|
||||
super.onNeighborChanged();
|
||||
refreshConnections();
|
||||
}
|
||||
|
||||
@@ -665,4 +665,10 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
|
||||
return values()[ordinal()+1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean weakTileChanges()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -197,9 +197,9 @@ public abstract class PartTransmitter<N extends DynamicNetwork<?, N>> extends Pa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
public void onNeighborTileChanged(int side, boolean weak)
|
||||
{
|
||||
super.onNeighborChanged();
|
||||
super.onNeighborTileChanged(side, weak);
|
||||
|
||||
if(!world().isRemote)
|
||||
{
|
||||
|
||||
@@ -173,9 +173,9 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock implements I
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,9 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
|
||||
|
||||
temperature = Math.min(getMaxTemperature(), getTemperature());
|
||||
}
|
||||
else {
|
||||
clearStructure();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -379,15 +382,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
|
||||
structured = scanTopLayer(startPoint);
|
||||
height = structured ? height : 0;
|
||||
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
|
||||
for(TileEntitySalinationTank tank : tankParts)
|
||||
{
|
||||
if(tank != this && tank instanceof TileEntitySalinationValve)
|
||||
{
|
||||
worldObj.notifyBlocksOfNeighborChange(tank.xCoord, tank.yCoord, tank.zCoord, tank.getBlockType());
|
||||
}
|
||||
}
|
||||
markDirty();
|
||||
|
||||
return structured;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.util.PipeUtils;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@@ -9,6 +11,31 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntitySalinationValve extends TileEntitySalinationTank 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 TileEntitySalinationTank))
|
||||
{
|
||||
obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prevMaster = (master != null);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
@@ -54,7 +81,7 @@ public class TileEntitySalinationValve extends TileEntitySalinationTank implemen
|
||||
{
|
||||
if(master == null)
|
||||
{
|
||||
return new FluidTankInfo[0];
|
||||
return PipeUtils.EMPTY;
|
||||
}
|
||||
|
||||
return new FluidTankInfo[] {new FluidTankInfo(master.waterTank), new FluidTankInfo(master.brineTank)};
|
||||
|
||||
Reference in new issue
Block a user