Open doublehelix457 opened 5 years ago
Update: Doesn't work using DataManipulators
Update: It would appear this is actually a mojang bug related to: https://bugs.mojang.com/browse/MC-120682
I was able to work around my problem using NMS World. Set Lever blockstate, notifyNeighbors, update attached block, notifyNeighbors.
A Sponge fix would be awesome though.
I am currently running
Issue Description I have attempted to change the state of a lever by trying either the methods above like so:
if(!block.supports(Keys.POWERED)) return; Sponge.getCauseStackManager().pushCause(Object); block.offer(Keys.POWERED, power); Sponge.getCauseStackManger().popCause();
and
Optional<BlockState> lever = block.getBlock().withTrait(BooleanTraits.LEVER_POWERED,power); if(lever.isPresent()) { Sponge.getCauseStackManager().pushCause(Object); block.setBlock(lever.get()); Sponge.getCauseStackManager().popCause(); }
Ive even added a scheduled update on the block the lever is on, to no avail.
The reason i say the block the lever is on is not updating is because redstone torches and lamps on the block don't update around the block the lever is on. Redstone or other blocks DIRECTLY connected to the lever work as normal. Oddly enough, i dont hear the lever flick sound effect, not sure if related.