diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b7d531d4..6ac7a246b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,4 +8,5 @@ - Updated the /crates additem command - CrazyCrates now supports MiniMessage, regardless of the item format used. - This is only happening, as legacy colors have been removed and I did some research. -- Updated Vital API \ No newline at end of file +- Updated Vital API +- Removed the code, that if no `Items` or `Editor-Items` or `Commands` were found, that it would use the `DisplayItem`, `DisplayName` etc as a prize. \ No newline at end of file diff --git a/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java b/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java index e460b7878..3b97e169c 100644 --- a/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java +++ b/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java @@ -79,15 +79,6 @@ public static void givePrize(@NotNull final Player player, @Nullable Prize prize player.getWorld().dropItemNaturally(player.getLocation(), item.setPlayer(player).getStack()); } } - } else { - // Only give them the display item as a reward if prize commands are empty. - if (prize.getCommands().isEmpty() && prize.getEditorItems().isEmpty()) { - if (!MiscUtils.isInventoryFull(player)) { - MiscUtils.addItem(player, prize.getPrizeItem().setPlayer(player).getStack()); - } else { - player.getWorld().dropItemNaturally(player.getLocation(), prize.getPrizeItem().setPlayer(player).getStack()); - } - } } for (final String command : crate.getPrizeCommands()) { diff --git a/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java b/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java index 9ab80ca6e..5f17d388e 100644 --- a/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java +++ b/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java @@ -35,7 +35,6 @@ public class Prize { private List permissions = new ArrayList<>(); private ItemBuilder displayItem = new ItemBuilder(); - private ItemBuilder prizeItem = new ItemBuilder(); private boolean firework = false; private String crateName = ""; private int maxRange = 100; @@ -82,8 +81,7 @@ public Prize(@NotNull final ConfigurationSection section, List editor this.broadcastMessages = section.getStringList("Settings.Broadcast.Messages"); this.broadcastPermission = section.getString("Settings.Broadcast.Permission", ""); - this.prizeItem = display(); - this.displayItem = new ItemBuilder(this.prizeItem, true); + this.displayItem = display(); this.editorItems = editorItems; } @@ -164,13 +162,6 @@ public Prize(@NotNull final String prizeName, @NotNull final String sectionName, return this.displayItem.setPlayer(player).setPersistentString(Keys.crate_prize.getNamespacedKey(), this.sectionName).getStack(); } - - /** - * @return the ItemBuilder of the display item. - */ - public @NotNull final ItemBuilder getPrizeItem() { - return this.prizeItem; - } /** * @return the list of tiers the prize is in.