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