geforkt von Mirrors/FastAsyncWorldEdit
Correctness improvement for legacy data in expression generation.
Dieser Commit ist enthalten in:
Ursprung
e53962dadd
Commit
c3ee926a2e
@ -1897,12 +1897,25 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
final Vector3 scaled = current.subtract(zero).divide(unit);
|
final Vector3 scaled = current.subtract(zero).divide(unit);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), defaultMaterial.getBlockType().getLegacyId(), 0) <= 0) {
|
int[] legacy = LegacyMapper.getInstance().getLegacyFromBlock(defaultMaterial.toImmutableState());
|
||||||
// TODO data
|
int typeVar = 0;
|
||||||
|
int dataVar = 0;
|
||||||
|
if (legacy != null) {
|
||||||
|
typeVar = legacy[0];
|
||||||
|
if (legacy.length > 1) {
|
||||||
|
dataVar = legacy[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ(), typeVar, dataVar) <= 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
int newType = (int) typeVariable.getValue();
|
||||||
return LegacyMapper.getInstance().getBlockFromLegacy((int) typeVariable.getValue(), (int) dataVariable.getValue()).toBaseBlock();
|
int newData = (int) dataVariable.getValue();
|
||||||
|
if (newType != typeVar || newData != dataVar) {
|
||||||
|
return LegacyMapper.getInstance().getBlockFromLegacy((int) typeVariable.getValue(), (int) dataVariable.getValue()).toBaseBlock();
|
||||||
|
} else {
|
||||||
|
return defaultMaterial;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.log(Level.WARNING, "Failed to create shape", e);
|
log.log(Level.WARNING, "Failed to create shape", e);
|
||||||
return null;
|
return null;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren