Some fixes

This commit is contained in:
boy0001
2015-08-04 04:20:04 +10:00
parent 0a0c72bc7d
commit 76ca8a7376
15 changed files with 117 additions and 96 deletions

View File

@@ -184,7 +184,12 @@ public class SpongeBlockManager extends BlockManager {
if (state == null) {
return;
}
SpongeUtil.getWorld(worldname).setBlock(x, y, z, state);
World world = SpongeUtil.getWorld(worldname);
BlockState block = world.getBlock(x, y, z);
if (block != state) {
world.setBlock(x, y, z, state);
}
}
@Override

View File

@@ -65,8 +65,14 @@ public class SpongeUtil {
}
return null;
}
private static World lastWorld;
private static String last;
public static World getWorld(String world) {
if (world == last) {
return lastWorld;
}
Optional<World> optional = SpongeMain.THIS.getServer().getWorld(world);
if (!optional.isPresent()) {
return null;