mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
Change Java whitespace handling in .editorconfig (#425)
* Change whitespace handling in .editorconfig * Reformat code * fix format error * Reformat code --------- Co-authored-by: Zoë Gidiere <duplexsys@protonmail.com>
This commit is contained in:
+7
-7
@@ -18,13 +18,13 @@ import com.dfsek.terra.api.world.WritableWorld;
|
||||
|
||||
public class ConfiguredFeature implements Feature {
|
||||
private final ProbabilityCollection<Structure> structures;
|
||||
|
||||
|
||||
private final NoiseSampler structureSelector;
|
||||
private final Distributor distributor;
|
||||
private final Locator locator;
|
||||
|
||||
|
||||
private final String id;
|
||||
|
||||
|
||||
public ConfiguredFeature(ProbabilityCollection<Structure> structures, NoiseSampler structureSelector, Distributor distributor,
|
||||
Locator locator, String id) {
|
||||
this.structures = structures;
|
||||
@@ -33,22 +33,22 @@ public class ConfiguredFeature implements Feature {
|
||||
this.locator = locator;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Structure getStructure(WritableWorld world, int x, int y, int z) {
|
||||
return structures.get(structureSelector, x, y, z, world.getSeed());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Distributor getDistributor() {
|
||||
return distributor;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Locator getLocator() {
|
||||
return locator;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return id;
|
||||
|
||||
+6
-6
@@ -18,16 +18,16 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
public class FeatureAddon implements AddonInitializer {
|
||||
@Inject
|
||||
private Platform platform;
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseAddon addon;
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
platform.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(addon, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().registerConfigType(new FeatureConfigType(), addon.key("FEATURE"), 500))
|
||||
.failThrough();
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(addon, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().registerConfigType(new FeatureConfigType(), addon.key("FEATURE"), 500))
|
||||
.failThrough();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -18,19 +18,19 @@ import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
public class FeatureConfigType implements ConfigType<FeatureTemplate, Feature> {
|
||||
public static final TypeKey<Feature> FEATURE_TYPE_KEY = new TypeKey<>() {
|
||||
};
|
||||
|
||||
|
||||
private final FeatureFactory factory = new FeatureFactory();
|
||||
|
||||
|
||||
@Override
|
||||
public FeatureTemplate getTemplate(ConfigPack pack, Platform platform) {
|
||||
return new FeatureTemplate();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ConfigFactory<FeatureTemplate, Feature> getFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TypeKey<Feature> getTypeKey() {
|
||||
return FEATURE_TYPE_KEY;
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ public class FeatureFactory implements ConfigFactory<FeatureTemplate, Feature> {
|
||||
@Override
|
||||
public Feature build(FeatureTemplate config, Platform platform) throws LoadException {
|
||||
return new ConfiguredFeature(config.getStructures(), config.getStructureNoise(), config.getDistributor(), config.getLocator(),
|
||||
config.getID());
|
||||
config.getID());
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -23,36 +23,36 @@ public class FeatureTemplate implements AbstractableTemplate {
|
||||
@Value("id")
|
||||
@Final
|
||||
private String id;
|
||||
|
||||
|
||||
@Value("distributor")
|
||||
private @Meta Distributor distributor;
|
||||
|
||||
|
||||
@Value("locator")
|
||||
private @Meta Locator locator;
|
||||
|
||||
|
||||
@Value("structures.distribution")
|
||||
private @Meta NoiseSampler structureNoise;
|
||||
|
||||
|
||||
@Value("structures.structures")
|
||||
private @Meta ProbabilityCollection<Structure> structures;
|
||||
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public Distributor getDistributor() {
|
||||
return distributor;
|
||||
}
|
||||
|
||||
|
||||
public Locator getLocator() {
|
||||
return locator;
|
||||
}
|
||||
|
||||
|
||||
public NoiseSampler getStructureNoise() {
|
||||
return structureNoise;
|
||||
}
|
||||
|
||||
|
||||
public ProbabilityCollection<Structure> getStructures() {
|
||||
return structures;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user