Skip to content

Commit

Permalink
Try delaying tracking transmitters until first tick on servers to see…
Browse files Browse the repository at this point in the history
… if that fixes issues where the data isn't synced to the client. Hopefully this doesn't break anything
  • Loading branch information
pupnewfster committed Mar 9, 2024
1 parent 39882fc commit bf26e1d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public abstract class TileEntityTransmitter extends CapabilityTileEntity impleme
private final Transmitter<?, ?, ?> transmitter;
private boolean forceUpdate = true;
private boolean loaded = false;
private boolean markJoined = false;

public TileEntityTransmitter(IBlockProvider blockProvider, BlockPos pos, BlockState state) {
super(((IHasTileEntity<? extends TileEntityTransmitter>) blockProvider.getBlock()).getTileType(), pos, state);
Expand Down Expand Up @@ -90,6 +91,10 @@ public void setForceUpdate() {
public abstract TransmitterType getTransmitterType();

protected void onUpdateServer() {
if (markJoined) {
onWorldJoin(false);
markJoined = false;
}
if (forceUpdate) {
getTransmitter().refreshConnections();
forceUpdate = false;
Expand Down Expand Up @@ -138,7 +143,11 @@ public void onNeighborBlockChange(Direction side) {
@Override
public void clearRemoved() {
super.clearRemoved();
onWorldJoin(false);
if (isRemote()) {
onWorldJoin(false);
} else {
markJoined = true;
}
}

@Override
Expand Down

0 comments on commit bf26e1d

Please sign in to comment.