fixes to render refreshing
This commit is contained in:
parent
d73f176950
commit
a6048f22a2
1 changed files with 5 additions and 5 deletions
|
@ -530,6 +530,8 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler,
|
||||||
((FacadePluggable) pluggable).setActiveState(activeState);
|
((FacadePluggable) pluggable).setActiveState(activeState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Rewrite the requiresRenderUpdate API to run on the
|
||||||
|
server side instead of the client side to save network bandwidth */
|
||||||
pluggableState.setPluggables(sideProperties.pluggables);
|
pluggableState.setPluggables(sideProperties.pluggables);
|
||||||
|
|
||||||
if (renderState.isDirty()) {
|
if (renderState.isDirty()) {
|
||||||
|
@ -1008,23 +1010,21 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler,
|
||||||
// mark for render update if necessary
|
// mark for render update if necessary
|
||||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||||
PipePluggable old = sideProperties.pluggables[i];
|
PipePluggable old = sideProperties.pluggables[i];
|
||||||
PipePluggable newer = sideProperties.pluggables[i];
|
PipePluggable newer = newPluggables[i];
|
||||||
if (old == null && newer == null) {
|
if (old == null && newer == null) {
|
||||||
continue;
|
continue;
|
||||||
} else if (old != null && newer != null) {
|
} else if (old != null && newer != null && old.getClass() == newer.getClass()) {
|
||||||
if (newer.requiresRenderUpdate(old)) {
|
if (newer.requiresRenderUpdate(old)) {
|
||||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||||
System.out.println("Update requested - " + i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// one of them is null but not the other, so update
|
// one of them is null but not the other, so update
|
||||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||||
System.out.println("Update requested [null] - " + i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sideProperties.pluggables = newPluggables;
|
sideProperties.pluggables = newPluggables.clone();
|
||||||
|
|
||||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||||
final PipePluggable pluggable = getPipePluggable(ForgeDirection.getOrientation(i));
|
final PipePluggable pluggable = getPipePluggable(ForgeDirection.getOrientation(i));
|
||||||
|
|
Loading…
Reference in a new issue