mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
fix StructureScript
This commit is contained in:
@@ -30,7 +30,6 @@ import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
|
||||
|
||||
public class TerraScriptAddon implements AddonInitializer {
|
||||
public static TypeKey<FunctionBuilder<?>> FUNCTION_BUILDER_TYPE = new TypeKey<>() {};
|
||||
@Inject
|
||||
private Platform platform;
|
||||
|
||||
@@ -49,10 +48,14 @@ public class TerraScriptAddon implements AddonInitializer {
|
||||
for(Map.Entry<String, InputStream> entry : entries) {
|
||||
try {
|
||||
String id = StringUtil.fileName(entry.getKey());
|
||||
StructureScript structureScript = new StructureScript(entry.getValue(), id, platform, structureRegistry,
|
||||
StructureScript structureScript = new StructureScript(entry.getValue(),
|
||||
id,
|
||||
platform,
|
||||
structureRegistry,
|
||||
lootRegistry,
|
||||
event.getPack().getOrCreateRegistry(
|
||||
FUNCTION_BUILDER_TYPE));
|
||||
event
|
||||
.getPack()
|
||||
.getOrCreateRegistry(FunctionBuilder.class));
|
||||
structureRegistry.register(structureScript.getID(), structureScript);
|
||||
} catch(ParseException e) {
|
||||
throw new LoadException("Failed to load script \"" + entry.getKey() + "\"", e);
|
||||
|
||||
@@ -63,9 +63,10 @@ public class StructureScript implements Structure {
|
||||
private final Cache<Vector3, StructureBuffer> cache;
|
||||
private final Platform platform;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public StructureScript(InputStream inputStream, String id, Platform platform, Registry<Structure> registry,
|
||||
Registry<LootTable> lootRegistry,
|
||||
Registry<FunctionBuilder<?>> functionRegistry) {
|
||||
Registry<FunctionBuilder> functionRegistry) {
|
||||
Parser parser;
|
||||
try {
|
||||
parser = new Parser(IOUtils.toString(inputStream, Charset.defaultCharset()));
|
||||
|
||||
Reference in New Issue
Block a user