|
37 | 37 | import com.sk89q.worldedit.bukkit.BukkitAdapter; |
38 | 38 | import org.apache.commons.lang.StringUtils; |
39 | 39 | import org.bukkit.Bukkit; |
40 | | -import org.bukkit.Material; |
41 | 40 | import org.bukkit.block.Block; |
42 | 41 | import org.bukkit.event.EventHandler; |
43 | 42 | import org.bukkit.event.EventPriority; |
@@ -232,7 +231,11 @@ public void onBlockRedstoneChange(final SourcedBlockRedstoneEvent event) { |
232 | 231 | } |
233 | 232 | } |
234 | 233 | if (cnt > 0) { |
235 | | - ((IC) icData[2]).trigger(chipState); |
| 234 | + IC ic = (IC) icData[2]; |
| 235 | + ic.trigger(chipState); |
| 236 | + try { |
| 237 | + ic.getSign().update(false); |
| 238 | + } catch (Throwable ignored) {} |
236 | 239 | } |
237 | 240 | } catch (IllegalArgumentException ex) { |
238 | 241 | // Exclude these exceptions so that we don't spam consoles because of Bukkit |
@@ -302,10 +305,13 @@ public void onThink(SelfTriggerThinkEvent event) { |
302 | 305 |
|
303 | 306 | final Object[] icData = setupIC(event.getBlock(), true); |
304 | 307 |
|
305 | | - if(icData != null && icData[2] instanceof SelfTriggeredIC) { |
| 308 | + if(icData != null && icData[2] instanceof SelfTriggeredIC ic) { |
306 | 309 | event.setHandled(true); |
307 | 310 | ChipState chipState = ((ICFamily) icData[1]).detectSelfTriggered(BukkitAdapter.adapt(event.getBlock().getLocation()), ((IC) icData[2]).getSign()); |
308 | | - ((SelfTriggeredIC) icData[2]).think(chipState); |
| 311 | + ic.think(chipState); |
| 312 | + try { |
| 313 | + ic.getSign().update(false); |
| 314 | + } catch (Throwable ignored) {} |
309 | 315 | } |
310 | 316 | } |
311 | 317 |
|
|
0 commit comments