Skip to content

Commit

Permalink
prevent fallbackItemCollector race condition on client thread (#8189)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Aug 19, 2024
1 parent e82cc2d commit 9574883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/mekanism/common/CommonWorldTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onEntitySpawn(EntityJoinLevelEvent event) {
entity.discard();
event.setCanceled(true);
}
} else if (fallbackItemCollector != null && event.getEntity() instanceof ItemEntity entity && fallbackItemCollector.test(entity.getItem())) {
} else if (!event.getLevel().isClientSide && fallbackItemCollector != null && event.getEntity() instanceof ItemEntity entity && fallbackItemCollector.test(entity.getItem())) {
//If we have a fallback item collector active and the entity that is being added is an item,
// try to let our fallback collector handle the item and keep track of it instead of actually adding it to the world
entity.discard();
Expand Down

0 comments on commit 9574883

Please sign in to comment.