Skip to content

Commit

Permalink
fix plugin not properly checking if horse is carrying chest
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Feb 9, 2024
1 parent 42a7590 commit 31ab419
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ private void onPortalEnter(EntityPortalEnterEvent event) { // Only portal event
if (!AnarchyExploitFixes.isServerFolia()) return; // Avoid fallback logic on non-folia

if (event.getEntity() instanceof ChestedHorse chestedHorse && chestedHorse.isCarryingChest()) {
chestedHorse.getScheduler().run(plugin, removeChest -> {
chestedHorse.setCarryingChest(false);
}, null);
chestedHorse.getScheduler().run(plugin, removeChest -> chestedHorse.setCarryingChest(false), null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean shouldEnable() {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
private void onEntityPortalEvent(EntityPortalEvent event) {
if (event.getEntity() instanceof ChestedHorse) {
if (event.getEntity() instanceof ChestedHorse && ((ChestedHorse) event.getEntity()).isCarryingChest()) {
event.setCancelled(true);
}
}
Expand Down

0 comments on commit 31ab419

Please sign in to comment.