This commit is contained in:
dfsek
2021-11-17 16:28:40 -07:00
parent 4ba759c374
commit 76f8af1b64
3 changed files with 6 additions and 11 deletions

View File

@@ -3,17 +3,12 @@ package com.dfsek.terra.addons.ore;
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
import com.dfsek.terra.api.Platform;
import com.dfsek.terra.api.addon.BaseAddon;
import com.dfsek.terra.api.addon.TerraAddon;
import com.dfsek.terra.api.addon.annotations.Addon;
import com.dfsek.terra.api.addon.annotations.Author;
import com.dfsek.terra.api.addon.annotations.Version;
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
import com.dfsek.terra.api.inject.annotations.Inject;
import com.dfsek.terra.api.world.generator.GenerationStageProvider;
public class OreAddon implements AddonInitializer {
@Inject
private Platform platform;
@@ -27,9 +22,9 @@ public class OreAddon implements AddonInitializer {
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
event.getPack().registerConfigType(new OreConfigType(), "ORE", 1);
event.getPack().getOrCreateRegistry(GenerationStageProvider.class).register("ORE", pack -> new OrePopulator(platform));
})
event.getPack().registerConfigType(new OreConfigType(), "ORE", 1);
event.getPack().getOrCreateRegistry(GenerationStageProvider.class).register("ORE", pack -> new OrePopulator(platform));
})
.failThrough();
}
}

View File

@@ -19,7 +19,8 @@ public abstract class Ore {
private final Map<BlockType, BlockState> materials;
protected Platform platform;
public Ore(BlockState material, MaterialSet replaceable, boolean applyGravity, Platform platform, Map<BlockType, BlockState> materials) {
public Ore(BlockState material, MaterialSet replaceable, boolean applyGravity, Platform platform,
Map<BlockType, BlockState> materials) {
this.material = material;
this.replaceable = replaceable;
this.applyGravity = applyGravity;

View File

@@ -1,12 +1,11 @@
package com.dfsek.terra.addons.ore.ores;
import com.dfsek.terra.api.Platform;
import net.jafama.FastMath;
import java.util.Map;
import java.util.Random;
import com.dfsek.terra.api.Platform;
import com.dfsek.terra.api.block.BlockType;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.util.Range;