mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-19 07:11:14 +00:00
dont use pack instance where unneeded
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ public class FloraAddon extends TerraAddon implements EventListener {
|
||||
}
|
||||
|
||||
public void onPackLoad(ConfigPackPreLoadEvent event) throws DuplicateEntryException {
|
||||
event.getPack().registerConfigType(new FloraConfigType(event.getPack()), "FLORA", 2);
|
||||
event.getPack().registerConfigType(new FloraConfigType(), "FLORA", 2);
|
||||
event.getPack().applyLoader(BlockLayer.class, BlockLayerTemplate::new);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -12,14 +12,9 @@ import java.util.function.Supplier;
|
||||
|
||||
public class FloraConfigType implements ConfigType<FloraTemplate, Flora> {
|
||||
private final FloraFactory factory = new FloraFactory();
|
||||
private final ConfigPack pack;
|
||||
|
||||
public static final TypeKey<Flora> FLORA_TYPE_TOKEN = new TypeKey<>(){};
|
||||
|
||||
public FloraConfigType(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FloraTemplate getTemplate(ConfigPack pack, TerraPlugin main) {
|
||||
return new FloraTemplate();
|
||||
@@ -37,6 +32,6 @@ public class FloraConfigType implements ConfigType<FloraTemplate, Flora> {
|
||||
|
||||
@Override
|
||||
public Supplier<OpenRegistry<Flora>> registrySupplier(ConfigPack pack) {
|
||||
return this.pack.getRegistryFactory()::create;
|
||||
return pack.getRegistryFactory()::create;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user