Advertisement
tahg

Untitled

Jun 20th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. public void g_() {
  2. boolean flag = this.burnTime > 0;
  3. boolean flag1 = false;
  4.  
  5. // CraftBukkit start
  6. int currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
  7. int elapsedTicks = currentTick - this.lastTick;
  8. this.lastTick = currentTick;
  9. // CraftBukkit end
  10.  
  11. if (this.f() && this.h()) {
  12. // CraftBukkit start -- handle multiple elapsed ticks
  13. this.cookTime += elapsedTicks;
  14. if (this.cookTime >= 200) {
  15. this.cookTime %= 200;
  16. // CraftBukkit end
  17. this.g();
  18. flag1 = true;
  19. }
  20. } else {
  21. this.cookTime = 0;
  22. }
  23.  
  24. if (this.burnTime > 0) {
  25. this.burnTime -= elapsedTicks; // CraftBukkit
  26. }
  27.  
  28. if (!this.world.isStatic) {
  29. // CraftBukkit start -- handle multiple elapsed ticks
  30. if (this.burnTime <= 0 && this.h() && this.items[1] != null) { // CraftBukkit == to <=
  31. CraftServer cserver = this.world.getServer();
  32. CraftWorld cworld = this.world.getWorld();
  33. CraftItemStack fuel = new CraftItemStack(this.items[1]);
  34.  
  35. FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(cworld.getBlockAt(this.e, this.f, this.g), fuel, this.a(this.items[1]));
  36. cserver.getPluginManager().callEvent(furnaceBurnEvent);
  37.  
  38. if (furnaceBurnEvent.isCancelled()) {
  39. return;
  40. }
  41.  
  42. this.b = this.a(this.items[1]);
  43. this.burnTime += this.b;
  44. // CraftBukkit end
  45. if (this.burnTime > 0) {
  46. flag1 = true;
  47. if (this.items[1] != null) {
  48. --this.items[1].count;
  49. if (this.items[1].count == 0) {
  50. this.items[1] = null;
  51. }
  52. }
  53. }
  54. }
  55.  
  56. if (flag != this.burnTime > 0) {
  57. flag1 = true;
  58. BlockFurnace.a(this.burnTime > 0, this.world, this.e, this.f, this.g);
  59. }
  60. }
  61.  
  62. if (flag1) {
  63. this.update();
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement