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