Fix WildStacker barrel counts being off by 1 in island level

This commit is contained in:
Esophose 2019-07-20 01:35:39 -06:00
parent 5b06e6577d
commit cd5cdba69b

View File

@ -64,7 +64,7 @@ public class WildStacker implements Listener {
materialAmount = level.getMaterialAmount(materials.name()); materialAmount = level.getMaterialAmount(materials.name());
} }
level.setMaterialAmount(materials.name(), materialAmount + event.getBarrel().getStackAmount()); level.setMaterialAmount(materials.name(), materialAmount + event.getBarrel().getStackAmount() - 1); // -1 because the Interact handler will always add +1
} }
} }
} }
@ -100,7 +100,7 @@ public class WildStacker implements Listener {
materialAmount = level.getMaterialAmount(materials.name()); materialAmount = level.getMaterialAmount(materials.name());
} }
level.setMaterialAmount(materials.name(), materialAmount + event.getTarget().getStackAmount()); level.setMaterialAmount(materials.name(), materialAmount + event.getTarget().getStackAmount() - 1); // -1 because the Interact handler will always add +1
} }
} }
} }