Browse Source

Hacky workaround for Spigot API bug not showing burntime to the client when burntime was too high

nossr50 3 years ago
parent
commit
4db6e03517

+ 1 - 0
Changelog.txt

@@ -1,4 +1,5 @@
 Version 2.1.215
 Version 2.1.215
+    Added hacky workaround for Spigot API bug that resulted in burnTimes not showing burning animation to the client
     Level up broadcasts from level milestones will now be visible to the player who achieved them
     Level up broadcasts from level milestones will now be visible to the player who achieved them
     Fixed a bug where hovering over skill descriptions did not display anything (thanks Greymagic27)
     Fixed a bug where hovering over skill descriptions did not display anything (thanks Greymagic27)
     Added Dripstone to experience.yml (thanks Greymagic27)
     Added Dripstone to experience.yml (thanks Greymagic27)

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java

@@ -34,7 +34,7 @@ public class SmeltingManager extends SkillManager {
      * @param burnTime The initial burn time from the {@link FurnaceBurnEvent}
      * @param burnTime The initial burn time from the {@link FurnaceBurnEvent}
      */
      */
     public int fuelEfficiency(int burnTime) {
     public int fuelEfficiency(int burnTime) {
-        return Math.max(1, burnTime * getFuelEfficiencyMultiplier());
+        return Math.min(Short.MAX_VALUE, Math.max(1, burnTime * getFuelEfficiencyMultiplier()));
     }
     }
 
 
     public int getFuelEfficiencyMultiplier()
     public int getFuelEfficiencyMultiplier()