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