forked from LogBlock/LogBlock
cleanup: getBlockSet/Replaced in class BlockChange
This commit is contained in:
@ -70,8 +70,8 @@ public class BlockChange implements LookupCacheElement {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
BlockData type = MaterialConverter.getBlockData(typeMaterial, typeData);
|
||||
BlockData replaced = MaterialConverter.getBlockData(replacedMaterial, replacedData);
|
||||
BlockData type = getBlockSet();
|
||||
BlockData replaced = getBlockReplaced();
|
||||
String typeDetails = null;
|
||||
if (BlockStateCodecs.hasCodec(type.getMaterial())) {
|
||||
try {
|
||||
@ -158,6 +158,14 @@ public class BlockChange implements LookupCacheElement {
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
public BlockData getBlockReplaced() {
|
||||
return MaterialConverter.getBlockData(replacedMaterial, replacedData);
|
||||
}
|
||||
|
||||
public BlockData getBlockSet() {
|
||||
return MaterialConverter.getBlockData(typeMaterial, typeData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
return loc;
|
||||
|
@ -165,8 +165,8 @@ public class WorldEditor implements Runnable {
|
||||
}
|
||||
|
||||
PerformResult perform() throws WorldEditorException {
|
||||
BlockData replacedBlock = MaterialConverter.getBlockData(this.replacedMaterial, replacedData);
|
||||
BlockData setBlock = MaterialConverter.getBlockData(this.typeMaterial, typeData);
|
||||
BlockData replacedBlock = getBlockReplaced();
|
||||
BlockData setBlock = getBlockSet();
|
||||
if (replacedBlock == null || setBlock == null) {
|
||||
throw new WorldEditorException("Could not parse the material", loc.clone());
|
||||
}
|
||||
|
Reference in New Issue
Block a user