fix #3072 properly + a bonus quarry bug
This commit is contained in:
parent
58cdbbf909
commit
213fe63f91
4
buildcraft_resources/changelog/7.1.10
Normal file
4
buildcraft_resources/changelog/7.1.10
Normal file
|
@ -0,0 +1,4 @@
|
|||
Bugs fixed:
|
||||
|
||||
* [#3072] PipeTransportFluids crash (proper fix) (asie)
|
||||
* Rotated quarry not detecting its own frame (asie)
|
|
@ -194,6 +194,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
public static boolean hidePowerNumbers = false;
|
||||
public static boolean hideFluidNumbers = false;
|
||||
public static boolean canEnginesExplode = false;
|
||||
public static boolean useServerDataOnClient = true;
|
||||
public static int itemLifespan = 1200;
|
||||
public static int updateFactor = 10;
|
||||
public static int builderMaxPerItemFactor = 1024;
|
||||
|
@ -301,6 +302,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
mainConfigManager.getCat("debug").setShowInGui(false);
|
||||
mainConfigManager.getCat("vars").setShowInGui(false);
|
||||
|
||||
mainConfigManager.register("general.useServerDataOnClient", BuildCraftCore.useServerDataOnClient, "Allows BuildCraft to use the integrated server's data on the client on singleplayer worlds. Disable if you're getting the odd crash caused by it.", ConfigManager.RestartRequirement.NONE);
|
||||
mainConfigManager.register("general.builderMaxIterationsPerItemFactor", BuildCraftCore.builderMaxPerItemFactor, "Lower this number if BuildCraft builders/fillers are causing TPS lag. Raise it if you think they are being too slow.", ConfigManager.RestartRequirement.NONE);
|
||||
|
||||
mainConfigManager.register("general.miningBreaksPlayerProtectedBlocks", false, "Should BuildCraft miners be allowed to break blocks using player-specific protection?", ConfigManager.RestartRequirement.NONE);
|
||||
|
@ -632,6 +634,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
} else if (restartType == ConfigManager.RestartRequirement.WORLD) {
|
||||
reloadConfig(ConfigManager.RestartRequirement.NONE);
|
||||
} else {
|
||||
useServerDataOnClient = mainConfigManager.get("general.useServerDataOnClient").getBoolean(true);
|
||||
builderMaxPerItemFactor = mainConfigManager.get("general.builderMaxIterationsPerItemFactor").getInt();
|
||||
hideFluidNumbers = mainConfigManager.get("display.hideFluidValues").getBoolean();
|
||||
hidePowerNumbers = mainConfigManager.get("display.hidePowerValues").getBoolean();
|
||||
|
|
|
@ -100,7 +100,6 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
|
|||
private NBTTagCompound initNBT = null;
|
||||
|
||||
private BlockMiner miner;
|
||||
|
||||
private int ledState;
|
||||
|
||||
public TileQuarry() {
|
||||
|
@ -283,12 +282,16 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
|
|||
}
|
||||
|
||||
protected boolean findFrame() {
|
||||
int dir = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
ForgeDirection o = ForgeDirection.getOrientation(dir > 6 ? 6 : dir).getOpposite();
|
||||
if (o == ForgeDirection.UNKNOWN) {
|
||||
return true;
|
||||
for (int i = 2; i < 6; i++) {
|
||||
ForgeDirection o = ForgeDirection.getOrientation(i);
|
||||
if (box.contains(xCoord + o.offsetX, yCoord + o.offsetY, zCoord + o.offsetZ)) {
|
||||
return worldObj.getBlock(xCoord + o.offsetX, yCoord + o.offsetY, zCoord + o.offsetZ) == BuildCraftBuilders.frameBlock;
|
||||
}
|
||||
}
|
||||
return worldObj.getBlock(xCoord + o.offsetX, yCoord + o.offsetY, zCoord + o.offsetZ) == BuildCraftBuilders.frameBlock;
|
||||
|
||||
// Could not find any location in box - this is strange, so obviously
|
||||
// we're going to ignore it!
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void idling() {
|
||||
|
|
|
@ -152,7 +152,7 @@ public class CoreProxyClient extends CoreProxy {
|
|||
|
||||
@Override
|
||||
public TileEntity getServerTile(TileEntity source) {
|
||||
if (Minecraft.getMinecraft().isSingleplayer() && source.getWorldObj().isRemote) {
|
||||
if (BuildCraftCore.useServerDataOnClient && Minecraft.getMinecraft().isSingleplayer() && source.getWorldObj().isRemote) {
|
||||
WorldServer w = DimensionManager.getWorld(source.getWorldObj().provider.dimensionId);
|
||||
if (w != null) {
|
||||
Chunk c = w.getChunkFromBlockCoords(source.xCoord, source.zCoord);
|
||||
|
|
|
@ -425,18 +425,6 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler,
|
|||
return outputCount;
|
||||
}
|
||||
|
||||
public FluidRenderData createServerFluidRenderData() {
|
||||
FluidRenderData rCache = new FluidRenderData();
|
||||
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;
|
||||
}
|
||||
}
|
||||
return rCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the PacketFluidUpdate packet for transmission to a client
|
||||
*
|
||||
|
|
|
@ -48,8 +48,9 @@ public class PipeTransportFluidsRenderer extends PipeTransportRenderer<PipeTrans
|
|||
displayFluidLists.clearMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useServerTileIfPresent() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private DisplayFluidList getDisplayFluidLists(int liquidId, int skylight, int blocklight, int flags, World world) {
|
||||
|
@ -170,12 +171,7 @@ public class PipeTransportFluidsRenderer extends PipeTransportRenderer<PipeTrans
|
|||
PipeTransportFluids trans = pipe.transport;
|
||||
|
||||
boolean needsRender = false;
|
||||
FluidRenderData renderData;
|
||||
if (!pipe.container.getWorldObj().isRemote) {
|
||||
renderData = trans.createServerFluidRenderData();
|
||||
} else {
|
||||
renderData = trans.renderCache;
|
||||
}
|
||||
FluidRenderData renderData = trans.renderCache;
|
||||
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
if (renderData.amount[i] > 0) {
|
||||
|
|
Loading…
Reference in a new issue