浏览代码

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

nossr50 3 年之前
父节点
当前提交
4db6e03517
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      Changelog.txt
  2. 1 1
      src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java

+ 1 - 0
Changelog.txt

@@ -1,4 +1,5 @@
 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
     Fixed a bug where hovering over skill descriptions did not display anything (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}
      */
     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()