1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge pull request #810 from Sniddunc/master

Fixed Sawmill Bug + Furnace Bug
This commit is contained in:
TheBusyBiscuit 2018-12-29 21:00:15 +01:00 committed by GitHub
commit ea0aae94fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import me.mrCookieSlime.Slimefun.Lists.Categories;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.BlockTicker;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.Furnace;
import org.bukkit.inventory.ItemStack;
@ -24,12 +25,18 @@ public class EnhancedFurnace extends SlimefunItem {
addItemHandler(new BlockTicker() {
@Override
public void tick(Block b, SlimefunItem item, Config data) {
if (b.getState() instanceof Furnace)
if (b.getState() instanceof Furnace) {
if (((Furnace) b.getState()).getCookTime() > 0) {
Furnace furnace = (Furnace) b.getState();
furnace.setCookTime((short) (furnace.getCookTime() + getSpeed() * 10));
int newCookTime = furnace.getCookTime() + getSpeed() * 10;
if (newCookTime > 200) furnace.setCookTime((short) 188);
else furnace.setCookTime((short) newCookTime);
furnace.update(true, false);
}
}
}
@Override

View File

@ -1904,7 +1904,7 @@ public class SlimefunSetup {
if (MaterialHelper.isLog(b.getRelative(BlockFace.UP).getType())) {
Block log = b.getRelative(BlockFace.UP);
if (!BlockStorage.hasBlockInfo(log)) {
ItemStack item = new CustomItem(MaterialHelper.getWoodFromLog(log.getType()), 8);
ItemStack item = new CustomItem(MaterialHelper.getWoodFromLog(log.getType()), 0, 8);
log.getWorld().dropItemNaturally(log.getLocation(), item);
log.getWorld().playEffect(log.getLocation(), Effect.STEP_SOUND, log.getType());
log.setType(Material.AIR);