mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-19 01:41:22 +01:00
Negative Alc saving fix
This commit is contained in:
parent
02f2e0c966
commit
556ce7ed34
@ -1005,18 +1005,20 @@ public class Brew implements Cloneable {
|
||||
quality = 10;
|
||||
}
|
||||
alc = Math.min(alc, Short.MAX_VALUE);
|
||||
alc = Math.max(alc, Short.MIN_VALUE);
|
||||
|
||||
out.writeByte((byte) quality);
|
||||
int bools = 0;
|
||||
bools |= ((distillRuns != 0) ? 1 : 0);
|
||||
bools |= (ageTime > 0 ? 2 : 0);
|
||||
bools |= (wood != -1 ? 4 : 0);
|
||||
bools |= ((distillRuns != 0) ? 1 : 0);
|
||||
bools |= (ageTime > 0 ? 2 : 0);
|
||||
bools |= (wood != -1 ? 4 : 0);
|
||||
bools |= (currentRecipe != null ? 8 : 0);
|
||||
bools |= (unlabeled ? 16 : 0);
|
||||
bools |= (immutable ? 32 : 0);
|
||||
bools |= (alc > 0 ? 64 : 0);
|
||||
bools |= (stripped ? 128 : 0);
|
||||
bools |= (unlabeled ? 16 : 0);
|
||||
bools |= (immutable ? 32 : 0);
|
||||
bools |= (alc != 0 ? 64 : 0);
|
||||
bools |= (stripped ? 128 : 0);
|
||||
out.writeByte(bools);
|
||||
if (alc > 0) {
|
||||
if (alc != 0) {
|
||||
out.writeShort(alc);
|
||||
}
|
||||
if (distillRuns != 0) {
|
||||
@ -1143,7 +1145,7 @@ public class Brew implements Cloneable {
|
||||
if (brew.quality != 0) {
|
||||
idConfig.set("quality", brew.quality);
|
||||
}
|
||||
if (brew.alc > 0) {
|
||||
if (brew.alc != 0) {
|
||||
idConfig.set("alc", brew.alc);
|
||||
}
|
||||
if (brew.distillRuns != 0) {
|
||||
|
@ -8,6 +8,7 @@ import com.dre.brewery.utility.LegacyUtil;
|
||||
import com.dre.brewery.utility.PermissionUtil;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -40,6 +41,9 @@ public class PlayerListener implements Listener {
|
||||
if (Brew.isBrew(item)) {
|
||||
event.setCancelled(true);
|
||||
BUtil.setItemInHand(event, Material.GLASS_BOTTLE, false);
|
||||
if (P.use1_11) {
|
||||
clickedBlock.getWorld().playSound(clickedBlock.getLocation(), Sound.ITEM_BOTTLE_EMPTY, 1f, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user