Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void g_() {
- boolean flag = this.burnTime > 0;
- boolean flag1 = false;
- // CraftBukkit start
- int currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
- int elapsedTicks = currentTick - this.lastTick;
- this.lastTick = currentTick;
- // CraftBukkit end
- if (this.f() && this.h()) {
- // CraftBukkit start -- handle multiple elapsed ticks
- this.cookTime += elapsedTicks;
- if (this.cookTime >= 200) {
- this.cookTime %= 200;
- // CraftBukkit end
- this.g();
- flag1 = true;
- }
- } else {
- this.cookTime = 0;
- }
- if (this.burnTime > 0) {
- this.burnTime -= elapsedTicks; // CraftBukkit
- }
- if (!this.world.isStatic) {
- // CraftBukkit start -- handle multiple elapsed ticks
- if (this.burnTime <= 0 && this.h() && this.items[1] != null) { // CraftBukkit == to <=
- CraftServer cserver = this.world.getServer();
- CraftWorld cworld = this.world.getWorld();
- CraftItemStack fuel = new CraftItemStack(this.items[1]);
- FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(cworld.getBlockAt(this.e, this.f, this.g), fuel, this.a(this.items[1]));
- cserver.getPluginManager().callEvent(furnaceBurnEvent);
- if (furnaceBurnEvent.isCancelled()) {
- return;
- }
- this.b = this.a(this.items[1]);
- this.burnTime += this.b;
- // CraftBukkit end
- if (this.burnTime > 0) {
- flag1 = true;
- if (this.items[1] != null) {
- --this.items[1].count;
- if (this.items[1].count == 0) {
- this.items[1] = null;
- }
- }
- }
- }
- if (flag != this.burnTime > 0) {
- flag1 = true;
- BlockFurnace.a(this.burnTime > 0, this.world, this.e, this.f, this.g);
- }
- }
- if (flag1) {
- this.update();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement