Skip to content

Commit

Permalink
Fix null throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte committed Nov 12, 2024
1 parent 861d303 commit 26b5a43
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ public MachineFuel(int seconds, SlimefunItemStack fuel) {
}

public MachineFuel(int seconds, SlimefunItemStack fuel, SlimefunItemStack output) {
this(seconds, fuel.item(), output.item());
Validate.notNull(fuel, "Fuel must never be null!");
Validate.isTrue(seconds > 0, "Fuel must last at least one second!");

this.ticks = seconds * 2;
this.fuel = fuel.item();
this.wrapper = ItemStackWrapper.wrap(this.fuel);
if (output != null)
this.output = output.item();
}

public ItemStack getInput() {
Expand Down

0 comments on commit 26b5a43

Please sign in to comment.