Remove all raw usages of BSH, improve API generics

This commit is contained in:
Kenzie Togami
2018-12-26 16:39:10 -08:00
parent a88f6b8430
commit 3fefcbf971
83 changed files with 242 additions and 259 deletions

View File

@ -51,7 +51,7 @@ public class BlockQuirkExtent extends AbstractDelegateExtent {
}
@Override
public boolean setBlock(BlockVector3 position, BlockStateHolder block) throws WorldEditException {
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, B block) throws WorldEditException {
BlockType existing = getExtent().getBlock(position).getBlockType();
if (existing.getMaterial().hasContainer()) {

View File

@ -61,7 +61,7 @@ public class ChunkLoadingExtent extends AbstractDelegateExtent {
}
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
world.checkLoadedChunk(location);
return super.setBlock(location, block);
}

View File

@ -96,7 +96,7 @@ public class FastModeExtent extends AbstractDelegateExtent {
}
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
if (enabled || postEditSimulation) {
dirtyChunks.add(BlockVector2.at(location.getBlockX() >> 4, location.getBlockZ() >> 4));

View File

@ -79,7 +79,7 @@ public class SurvivalModeExtent extends AbstractDelegateExtent {
}
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
if (toolUse && block.getBlockType().getMaterial().isAir()) {
world.simulateBlockMine(location);
return true;