Optimise getType calls
Remove the map lookup for converting from Block->Bukkit Material
This commit is contained in:
@@ -220,7 +220,7 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public Material getType() {
|
||||
return CraftBlockType.minecraftToBukkit(this.world.getBlockState(this.position).getBlock());
|
||||
return this.world.getBlockState(this.position).getBukkitMaterial(); // Paper - optimise getType calls
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,7 +175,7 @@ public class CraftBlockState implements BlockState {
|
||||
|
||||
@Override
|
||||
public Material getType() {
|
||||
return CraftBlockType.minecraftToBukkit(this.data.getBlock());
|
||||
return this.data.getBukkitMaterial(); // Paper - optimise getType calls
|
||||
}
|
||||
|
||||
public void setFlag(int flag) {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CraftBlockData implements BlockData {
|
||||
|
||||
@Override
|
||||
public Material getMaterial() {
|
||||
return CraftBlockType.minecraftToBukkit(this.state.getBlock());
|
||||
return this.state.getBukkitMaterial(); // Paper - optimise getType calls
|
||||
}
|
||||
|
||||
public net.minecraft.world.level.block.state.BlockState getState() {
|
||||
|
||||
Reference in New Issue
Block a user