From c526997aba8b883462c6263877194b4b89fc7383 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 13 Oct 2018 08:49:54 -0400 Subject: [PATCH] Fixed coal in core / Fixed build events not triggering --- core/src/io/anuke/mindustry/core/Control.java | 4 ++-- core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java | 2 +- core/src/io/anuke/mindustry/input/DesktopInput.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 935a140fa9..aac708c169 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -160,8 +160,8 @@ public class Control extends Module{ Events.on(WorldLoadEvent.class, event -> threads.runGraphics(() -> Events.fire(new WorldLoadGraphicsEvent()))); - Events.on(BlockBuildEvent.class, event -> { - if(event.team == players[0].getTeam() && Recipe.getByResult(event.tile.block()) != null){ + Events.on(TileChangeEvent.class, event -> { + if(event.tile.getTeam() == players[0].getTeam() && Recipe.getByResult(event.tile.block()) != null){ unlocks.handleContentUsed(Recipe.getByResult(event.tile.block())); } }); diff --git a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java index c49dca1a6a..2b1ff13c11 100644 --- a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java @@ -247,7 +247,7 @@ public interface BuilderTrait extends Entity{ if(Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){ - if(unit.distanceTo(core) < mineTransferRange && core.items.get(item) < core.tile.block().getMaximumAccepted(core.tile, item)){ + if(unit.distanceTo(core) < mineTransferRange && core.tile.block().acceptStack(item, 1, core.tile, unit) == 1){ Call.transferItemTo(item, 1, tile.worldx() + Mathf.range(tilesize / 2f), tile.worldy() + Mathf.range(tilesize / 2f), core.tile); diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 13b7de4638..416c7fe62f 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -146,9 +146,9 @@ public class DesktopInput extends InputHandler{ pollInput(); - if(recipe != null && !Settings.getBool("desktop-place-help", false)){ + if(recipe != null && !Settings.getBool("desktop-place-help-2", false)){ ui.showInfo("$text.construction.desktop"); - Settings.putBool("desktop-place-help", true); + Settings.putBool("desktop-place-help-2", true); Settings.save(); }