Skip to content

Commit

Permalink
fix thodor derp and #714
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Dec 9, 2024
1 parent 6abb52d commit 52be8f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/main/java/com/ldtteam/structurize/management/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ private Manager()
*/
public static void onWorldTick(final ServerLevel world)
{
int count = 0;
if (!scanToolOperationPool.isEmpty())
{
final ITickedWorldOperation operation = scanToolOperationPool.peek();
if (operation != null && operation.apply(world))
while (count++ <= Structurize.getConfig().getServer().maxOperationsPerTick.get())
{
scanToolOperationPool.pop();
if (!(operation instanceof UndoOperation || operation instanceof RedoOperation))
final ITickedWorldOperation operation = scanToolOperationPool.peek();
if (operation != null && operation.apply(world))
{
addToUndoRedoCache(operation.getChangeStorage());
scanToolOperationPool.pop();
if (!(operation instanceof UndoOperation || operation instanceof RedoOperation))
{
addToUndoRedoCache(operation.getChangeStorage());
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ protected ReplaceBlockMessage(final RegistryFriendlyByteBuf buf, final PlayMessa
super(buf, type);
this.from = buf.readBlockPos();
this.to = buf.readBlockPos();
this.blockTo = ItemStack.STREAM_CODEC.decode(buf);
this.blockFrom = ItemStack.STREAM_CODEC.decode(buf);
this.blockTo = ItemStack.OPTIONAL_STREAM_CODEC.decode(buf);
this.blockFrom = ItemStack.OPTIONAL_STREAM_CODEC.decode(buf);
this.pct = buf.readInt();
}

Expand Down

0 comments on commit 52be8f6

Please sign in to comment.