fix #3056, int. server fluid crash bug
This commit is contained in:
parent
73c5ae6657
commit
521774c829
3 changed files with 15 additions and 7 deletions
4
buildcraft_resources/changelog/7.1.9
Normal file
4
buildcraft_resources/changelog/7.1.9
Normal file
|
@ -0,0 +1,4 @@
|
|||
Bugs fixed:
|
||||
|
||||
* [#3056] PipeTransportFluids crash (asie)
|
||||
* Random crashes with integrated server tile entity lookup (asie)
|
|
@ -23,6 +23,7 @@ import net.minecraft.network.NetHandlerPlayServer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
|
@ -151,12 +152,15 @@ public class CoreProxyClient extends CoreProxy {
|
|||
|
||||
@Override
|
||||
public TileEntity getServerTile(TileEntity source) {
|
||||
if (source.getWorldObj().isRemote) {
|
||||
if (Minecraft.getMinecraft().isSingleplayer() && source.getWorldObj().isRemote) {
|
||||
WorldServer w = DimensionManager.getWorld(source.getWorldObj().provider.dimensionId);
|
||||
if (w != null) {
|
||||
TileEntity t = w.getTileEntity(source.xCoord, source.yCoord, source.zCoord);
|
||||
if (t != null && t.getClass().equals(source.getClass())) {
|
||||
return t;
|
||||
Chunk c = w.getChunkFromBlockCoords(source.xCoord, source.zCoord);
|
||||
if (c != null) {
|
||||
TileEntity t = c.getTileEntityUnsafe(source.xCoord & 15, source.yCoord, source.zCoord & 15);
|
||||
if (t != null && t.getClass().equals(source.getClass())) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -427,9 +427,9 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler,
|
|||
|
||||
public FluidRenderData createServerFluidRenderData() {
|
||||
FluidRenderData rCache = new FluidRenderData();
|
||||
rCache.fluidID = fluidType != null ? fluidType.getFluid().getID() : 0;
|
||||
rCache.color = fluidType != null ? fluidType.getFluid().getColor(fluidType) : 0;
|
||||
if (fluidType != null) {
|
||||
if (fluidType != null && fluidType.getFluid() != null) {
|
||||
rCache.fluidID = fluidType.getFluid().getID();
|
||||
rCache.color = fluidType.getFluid().getColor(fluidType);
|
||||
for (int i = 0; i < 7; i++) {
|
||||
rCache.amount[i] = sections[i].amount;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue