mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
createBlockData -> createBlockState
This commit is contained in:
+1
-1
@@ -91,7 +91,7 @@ public class SpongeSchematicAddon implements AddonInitializer {
|
||||
for(int y = 0; y < hei; y++) {
|
||||
String block = data.get((int) arr[x + z * wid + y * wid * len]);
|
||||
if(block.startsWith("minecraft:structure_void")) continue;
|
||||
states[x][z][y] = platform.getWorldHandle().createBlockData(block);
|
||||
states[x][z][y] = platform.getWorldHandle().createBlockState(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -79,7 +79,7 @@ public class BlockFunction implements Function<Void> {
|
||||
}
|
||||
|
||||
protected BlockState getBlockState(ImplementationArguments arguments, Map<String, Variable<?>> variableMap) {
|
||||
return data.computeIfAbsent(blockData.apply(arguments, variableMap), platform.getWorldHandle()::createBlockData);
|
||||
return data.computeIfAbsent(blockData.apply(arguments, variableMap), platform.getWorldHandle()::createBlockState);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BlockFunction implements Function<Void> {
|
||||
public Constant(Returnable<Number> x, Returnable<Number> y, Returnable<Number> z, StringConstant blockData,
|
||||
Returnable<Boolean> overwrite, Platform platform, Position position) {
|
||||
super(x, y, z, blockData, overwrite, platform, position);
|
||||
this.state = platform.getWorldHandle().createBlockData(blockData.getConstant());
|
||||
this.state = platform.getWorldHandle().createBlockState(blockData.getConstant());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class PullFunction implements Function<Void> {
|
||||
this.position = position;
|
||||
if(!(data instanceof ConstantExpression)) throw new ParseException("Block data must be constant", data.getPosition());
|
||||
|
||||
this.data = platform.getWorldHandle().createBlockData(((ConstantExpression<String>) data).getConstant());
|
||||
this.data = platform.getWorldHandle().createBlockState(((ConstantExpression<String>) data).getConstant());
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.dfsek.terra.api.entity.EntityType;
|
||||
public interface WorldHandle {
|
||||
@NotNull
|
||||
@Contract("_ -> new")
|
||||
BlockState createBlockData(@NotNull String data);
|
||||
BlockState createBlockState(@NotNull String data);
|
||||
|
||||
@NotNull
|
||||
@Contract(pure = true)
|
||||
|
||||
@@ -58,8 +58,8 @@ public class GenericLoaders implements LoaderRegistrar {
|
||||
if(platform != null) {
|
||||
registry.registerLoader(BaseAddon.class, platform.getAddons())
|
||||
.registerLoader(BlockType.class,
|
||||
(t, object, cf) -> platform.getWorldHandle().createBlockData((String) object).getBlockType())
|
||||
.registerLoader(BlockState.class, (t, object, cf) -> platform.getWorldHandle().createBlockData((String) object));
|
||||
(t, object, cf) -> platform.getWorldHandle().createBlockState((String) object).getBlockType())
|
||||
.registerLoader(BlockState.class, (t, object, cf) -> platform.getWorldHandle().createBlockState((String) object));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user