mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
unimplement Keyed in Structure
This commit is contained in:
@@ -74,11 +74,6 @@ public class TerraFlora implements Structure {
|
||||
return faces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(Vector3Int location, WritableWorld world, Random random, Rotation rotation) {
|
||||
boolean doRotation = testRotation.size() > 0;
|
||||
|
||||
@@ -95,11 +95,6 @@ public class VanillaOre implements Structure {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockState getMaterial(BlockType replace) {
|
||||
return materials.getOrDefault(replace, material);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dfsek.terra.addons.palette.shortcut.block;
|
||||
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.registry.key.RegistryKey;
|
||||
import com.dfsek.terra.api.structure.Structure;
|
||||
import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.util.vector.Vector3Int;
|
||||
@@ -21,9 +22,4 @@ public class SingletonStructure implements Structure {
|
||||
world.setBlockState(location, blockState);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return blockState.getAsString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ package com.dfsek.terra.addons.sponge;
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.registry.key.Keyed;
|
||||
import com.dfsek.terra.api.registry.key.RegistryKey;
|
||||
import com.dfsek.terra.api.structure.Structure;
|
||||
import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.util.vector.Vector2Int;
|
||||
@@ -17,13 +19,13 @@ import com.dfsek.terra.api.util.vector.Vector3Int;
|
||||
import com.dfsek.terra.api.world.WritableWorld;
|
||||
|
||||
|
||||
public class SpongeStructure implements Structure {
|
||||
public class SpongeStructure implements Structure, Keyed<SpongeStructure> {
|
||||
|
||||
private final BlockState[][][] blocks;
|
||||
|
||||
private final String id;
|
||||
private final RegistryKey id;
|
||||
|
||||
public SpongeStructure(BlockState[][][] blocks, String id) {
|
||||
public SpongeStructure(BlockState[][][] blocks, RegistryKey id) {
|
||||
this.blocks = blocks;
|
||||
this.id = id;
|
||||
}
|
||||
@@ -49,7 +51,7 @@ public class SpongeStructure implements Structure {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
public RegistryKey getRegistryKey() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.dfsek.terra.addons.terrascript.script;
|
||||
|
||||
import com.dfsek.terra.api.registry.key.Keyed;
|
||||
import com.dfsek.terra.api.registry.key.RegistryKey;
|
||||
import com.dfsek.terra.api.util.vector.Vector3Int;
|
||||
|
||||
import net.jafama.FastMath;
|
||||
@@ -49,14 +51,14 @@ import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.world.WritableWorld;
|
||||
|
||||
|
||||
public class StructureScript implements Structure {
|
||||
public class StructureScript implements Structure, Keyed<StructureScript> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(StructureScript.class);
|
||||
private final Block block;
|
||||
private final String id;
|
||||
private final RegistryKey id;
|
||||
private final Platform platform;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public StructureScript(InputStream inputStream, String id, Platform platform, Registry<Structure> registry,
|
||||
public StructureScript(InputStream inputStream, RegistryKey id, Platform platform, Registry<Structure> registry,
|
||||
Registry<LootTable> lootRegistry,
|
||||
Registry<FunctionBuilder> functionRegistry) {
|
||||
Parser parser;
|
||||
@@ -148,7 +150,7 @@ public class StructureScript implements Structure {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return id;
|
||||
public RegistryKey getRegistryKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@ package com.dfsek.terra.api.structure;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.api.registry.key.Keyed;
|
||||
import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.registry.key.StringIdentifiable;
|
||||
import com.dfsek.terra.api.util.vector.Vector3Int;
|
||||
import com.dfsek.terra.api.world.WritableWorld;
|
||||
|
||||
|
||||
public interface Structure extends StringIdentifiable {
|
||||
public interface Structure {
|
||||
boolean generate(Vector3Int location, WritableWorld world, Random random, Rotation rotation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user