mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-22 18:46:45 +01:00
Don't try to make potions unbreakable.
The catch-all approach to unbreakability works in modern Minecraft because it's just a flag. Historians speculate that back in ancient times when Minecraft 1.8 was relevant and worth anyone's time, no such flag existed, and as a result, primitive plugin developers of the ages resorted to hacks where the durability was just set to something very high (or low, rather), making stuff _effectively_ unbreakable. However, because we didn't know better back then, we also used the durability to configure potion metadata. As a result, making potions "unbreakable" just means changing their type, and `Short.MIN_VALUE` is not a valid potion type, so it just defaults to water bottle. For the love of maintainability, please just let 1.8 die... Fixes #633
This commit is contained in:
parent
59e1977d90
commit
81894b425b
@ -1267,6 +1267,9 @@ public class ArenaImpl implements Arena
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
if (stack.getType() == Material.POTION) {
|
||||
return;
|
||||
}
|
||||
stack.setDurability(Short.MIN_VALUE);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user