mirror of https://github.com/Ste3et/furniture.git
fix distance meassure if the world hase been reloadet !
This commit is contained in:
parent
b8d43954ad
commit
4a88d33310
|
@ -16,11 +16,11 @@ public class redstoneEvent implements Listener {
|
|||
|
||||
@EventHandler
|
||||
private void onBlockPowered(BlockRedstoneEvent e){
|
||||
World w = e.getBlock().getWorld();
|
||||
World world = e.getBlock().getWorld();
|
||||
Block block = e.getBlock();
|
||||
Location location = block.getLocation();
|
||||
Entry<Location, streetlamp> object = streetlamp.locationSet.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().getObjID().getWorldName().equalsIgnoreCase(w.getName()))
|
||||
.filter(entry -> entry.getValue().getObjID().getWorld().equals(world))
|
||||
.filter(entry -> entry.getKey().distance(location) <= 1).findFirst().orElse(null);
|
||||
if(Objects.nonNull(object)) {
|
||||
if(e.getNewCurrent()==0){
|
||||
|
|
Loading…
Reference in New Issue