Skip to content

Commit

Permalink
- added eltyra check
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzybol committed Mar 17, 2024
1 parent 046c5ac commit b0af517
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>betterbox.mine.game</groupId>
<artifactId>BetterElo</artifactId>
<version>3.2.48-SNAPSHOT</version>
<version>3.2.50-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BetterElo</name>
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/betterbox/mine/game/betterelo/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,20 @@ public void onPlayerInteract(PlayerInteractEvent event) {
}
pluginLogger.log(PluginLogger.LogLevel.DEBUG_LVL3,"Event.onPlayerInteract checking if its infinite firework");
ItemStack item = event.getItem();
Location location = player.getLocation();
Location blockBelowLocation = location.clone().subtract(0, 1, 0);
boolean isNotOnGround = blockBelowLocation.getBlock().isPassable();



if (item != null && item.getType() == Material.FIREWORK_ROCKET) {
Location location = player.getLocation();
Location blockBelowLocation = location.clone().subtract(0, 1, 0);
boolean isNotOnGround = blockBelowLocation.getBlock().isPassable();

ItemStack chestplate = player.getInventory().getChestplate();
if (chestplate == null || !chestplate.getType().toString().contains("ELYTRA")) {
pluginLogger.log(PluginLogger.LogLevel.DEBUG_LVL3,"Event.onPlayerInteract player is not wearing Elytra!");
return;

}
pluginLogger.log(PluginLogger.LogLevel.DEBUG_LVL3,"Event.onPlayerInteract firework item check passed");
ItemMeta meta = item.getItemMeta();
if (meta != null && meta.hasLore()) {
Expand Down

0 comments on commit b0af517

Please sign in to comment.