mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Updated WorldEdit API
This commit is contained in:
parent
3619c4bc9e
commit
99ad2d4ddf
@ -23,12 +23,10 @@ public class WESlimefunManager {
|
||||
@Subscribe
|
||||
public void wrapForLogging(final EditSessionEvent event) {
|
||||
event.setExtent(new AbstractDelegateExtent(event.getExtent()) {
|
||||
@SuppressWarnings({ "rawtypes", "deprecation" })
|
||||
@Override
|
||||
public boolean setBlock(BlockVector3 pos, BlockStateHolder block) throws WorldEditException {
|
||||
if (block.getBlockType().getLegacyId() == 0) {
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 pos, T block) throws WorldEditException {
|
||||
if (block.getBlockType().getMaterial().isAir()) {
|
||||
World world = Bukkit.getWorld(event.getWorld().getName());
|
||||
|
||||
if (world != null) {
|
||||
Location l = new Location(world, pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
if (BlockStorage.hasBlockInfo(l)) BlockStorage.clearBlockInfo(l);
|
||||
@ -36,7 +34,6 @@ public class WESlimefunManager {
|
||||
}
|
||||
return getExtent().setBlock(pos, block);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user