Skip to content

Commit

Permalink
InstantFurnace :: Fix diff 1
Browse files Browse the repository at this point in the history
  • Loading branch information
PresentKim committed Jan 20, 2018
1 parent 45e837c commit f918c75
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions InstantFurnace.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function onFurnaceBurnEvent(FurnaceBurnEvent $event){
if (!$event->isCancelled()) {
if (($burnTime = $event->getBurnTime()) > 200) {
$furnace = $event->getFurnace();
$event->setBurnTime($burnTime - 200);
$furnace->namedtag->setShort(Furnace::TAG_COOK_TIME, 400);
$event->setBurnTime($burnTime - 199);
$furnace->namedtag->setShort(Furnace::TAG_COOK_TIME, 399);
}
}
}
Expand All @@ -56,11 +56,11 @@ public function onFurnaceBurnEvent(FurnaceBurnEvent $event){
public function onFurnaceSmeltEvent(FurnaceSmeltEvent $event){
if (!$event->isCancelled()) {
$furnace = $event->getFurnace();
if (($burnTime = $furnace->namedtag->getShort(Furnace::TAG_BURN_TIME)) > 200) {
$furnace->namedtag->setShort(Furnace::TAG_BURN_TIME, $burnTime - 200);
$furnace->namedtag->setShort(Furnace::TAG_COOK_TIME, 400);
if (($burnTime = $furnace->namedtag->getShort(Furnace::TAG_BURN_TIME)) > 199) {
$furnace->namedtag->setShort(Furnace::TAG_BURN_TIME, $burnTime - 199);
$furnace->namedtag->setShort(Furnace::TAG_COOK_TIME, 399);
} elseif ($furnace->getInventory()->getFuel()->getFuelTime() > 200) {
$furnace->namedtag->setShort(Furnace::TAG_BURN_TIME, 0);
$furnace->namedtag->setShort(Furnace::TAG_BURN_TIME, 1);
$furnace->namedtag->setShort(Furnace::TAG_COOK_TIME, $furnace->namedtag->getShort(Furnace::TAG_COOK_TIME) + $burnTime);
}
}
Expand Down

0 comments on commit f918c75

Please sign in to comment.