Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed May 26, 2024
1 parent 660064c commit d5ea1f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public void register() {
}));
register(new ActionFactory(GenesisMC.apoliIdentifier("apply_effect"), (action, entity) -> {
if (entity instanceof LivingEntity le) {
Util.parseAndReturnPotionEffects(action).forEach(potionEffect -> le.addPotionEffect(potionEffect, true));
Util.parseAndReturnPotionEffects(action).forEach(potionEffect -> le.addPotionEffect(potionEffect));
}
}));
register(new ActionFactory(GenesisMC.apoliIdentifier("area_of_effect"), (action, entity) -> {
Expand Down
28 changes: 8 additions & 20 deletions origins/src/main/java/me/dueris/genesismc/util/KeybindUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,14 @@ public void onTransfer(InventoryClickEvent e) {

return;
}
if (e.getView().getTopInventory().getType() != InventoryType.CRAFTING) {
if (e.getView().getTopInventory().getHolder() != null && e.getView().getTopInventory().getHolder().equals(e.getWhoClicked()))
return;
if (e.getCurrentItem() == null) return;
if (e.getCurrentItem().isSimilar(getPrimaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
if (e.getCurrentItem().isSimilar(getSecondaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
} else {
if (e.getView().getTopInventory().getHolder() != null && e.getView().getTopInventory().getHolder().equals(e.getWhoClicked()))
return;
if (e.getCurrentItem() == null) return;
if (e.getCurrentItem().isSimilar(getPrimaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
if (e.getCurrentItem().isSimilar(getSecondaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
if (e.getView().getTopInventory().getHolder() != null && e.getView().getTopInventory().getHolder().equals(e.getWhoClicked()))
return;
if (e.getCurrentItem() == null) return;
if (e.getCurrentItem().isSimilar(getPrimaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
if (e.getCurrentItem().isSimilar(getSecondaryTrigger((Player) e.getWhoClicked()))) {
e.setCancelled(true);
}
}

Expand Down

0 comments on commit d5ea1f2

Please sign in to comment.