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

@ -17,6 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.spongepowered.api.CatalogType;
import org.spongepowered.api.Game;
import org.spongepowered.api.Platform;
import org.spongepowered.api.Server;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
@ -637,4 +638,9 @@ public class SpongeMain implements IPlotMain, PluginContainer {
}
return null;
}
@Override
public String getNMSPackage() {
return "1_8_R3";
}
}

View File

@ -5,6 +5,7 @@ import org.spongepowered.api.world.WorldCreationSettings;
import org.spongepowered.api.world.gen.WorldGenerator;
import org.spongepowered.api.world.gen.WorldGeneratorModifier;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.util.ClusterManager;

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;