Skip to content

Commit

Permalink
only increment the pulls if the player isn't opped.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Sep 9, 2024
1 parent 82edd61 commit a24894c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ public static void givePrize(@NotNull final Player player, @Nullable Prize prize

prize = prize.hasPermission(player) ? prize.getAlternativePrize() : prize;

final int pulls = getCurrentPulls(prize, crate);
if (!player.isOp()) {
final int pulls = getCurrentPulls(prize, crate);

if (pulls != -1 && pulls < prize.getMaxPulls()) {
YamlConfiguration configuration = Files.data.getConfiguration();
if (pulls != -1 && pulls < prize.getMaxPulls()) {
YamlConfiguration configuration = Files.data.getConfiguration();

configuration.set("Prizes." + crate.getFileName() + "." + prize.getSectionName() + ".Pulls", pulls + 1);
configuration.set("Prizes." + crate.getFileName() + "." + prize.getSectionName() + ".Pulls", pulls + 1);

// save to file!
Files.data.save();
// save to file!
Files.data.save();
}
}

for (ItemStack item : prize.getEditorItems()) {
Expand Down

0 comments on commit a24894c

Please sign in to comment.