mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-25 21:40:08 +00:00
rename main parameters/fields to platform
This commit is contained in:
1 parent
8f51707505
commit
4945a3bbfa
117 files changed
+535
-516
No files matched your search
@@ -16,17 +16,17 @@ import com.dfsek.terra.api.world.generator.GenerationStageProvider;
|
||||
@Version("1.0.0")
|
||||
public class OreAddon extends TerraAddon {
|
||||
@Inject
|
||||
private Platform main;
|
||||
private Platform platform;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
main.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> {
|
||||
platform.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> {
|
||||
event.getPack().registerConfigType(new OreConfigType(), "ORE", 1);
|
||||
event.getPack().getOrCreateRegistry(GenerationStageProvider.class).register("ORE", pack -> new OrePopulator(main));
|
||||
event.getPack().getOrCreateRegistry(GenerationStageProvider.class).register("ORE", pack -> new OrePopulator(platform));
|
||||
})
|
||||
.failThrough();
|
||||
.failThrough();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ public class OreConfigType implements ConfigType<OreTemplate, Ore> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OreTemplate getTemplate(ConfigPack pack, Platform main) {
|
||||
public OreTemplate getTemplate(ConfigPack pack, Platform platform) {
|
||||
return new OreTemplate();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.dfsek.terra.api.config.ConfigFactory;
|
||||
|
||||
public class OreFactory implements ConfigFactory<OreTemplate, Ore> {
|
||||
@Override
|
||||
public Ore build(OreTemplate config, Platform main) {
|
||||
public Ore build(OreTemplate config, Platform platform) {
|
||||
BlockState m = config.getMaterial();
|
||||
return new VanillaOre(m, config.getReplaceable(), config.doPhysics(), config.getSize(), main, config.getMaterialOverrides());
|
||||
return new VanillaOre(m, config.getReplaceable(), config.doPhysics(), config.getSize(), platform, config.getMaterialOverrides());
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,16 @@ import com.dfsek.terra.api.world.generator.GenerationStage;
|
||||
|
||||
|
||||
public class OrePopulator implements GenerationStage {
|
||||
private final Platform main;
|
||||
private final Platform platform;
|
||||
|
||||
public OrePopulator(Platform main) {
|
||||
this.main = main;
|
||||
public OrePopulator(Platform platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Chunk chunk) {
|
||||
try(ProfileFrame ignore = main.getProfiler().profile("ore")) {
|
||||
try(ProfileFrame ignore = platform.getProfiler().profile("ore")) {
|
||||
if(world.getConfig().disableOres()) return;
|
||||
|
||||
for(int cx = -1; cx <= 1; cx++) {
|
||||
|
||||
@@ -17,13 +17,13 @@ public abstract class Ore {
|
||||
private final MaterialSet replaceable;
|
||||
private final boolean applyGravity;
|
||||
private final Map<BlockType, BlockState> materials;
|
||||
protected Platform main;
|
||||
protected Platform platform;
|
||||
|
||||
public Ore(BlockState material, MaterialSet replaceable, boolean applyGravity, Platform main, 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;
|
||||
this.main = main;
|
||||
this.platform = platform;
|
||||
this.materials = materials;
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
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;
|
||||
@@ -17,9 +18,9 @@ import com.dfsek.terra.api.world.Chunk;
|
||||
public class VanillaOre extends Ore {
|
||||
private final Range sizeRange;
|
||||
|
||||
public VanillaOre(BlockState material, MaterialSet replaceable, boolean applyGravity, Range size, Platform main,
|
||||
public VanillaOre(BlockState material, MaterialSet replaceable, boolean applyGravity, Range size, Platform platform,
|
||||
Map<BlockType, BlockState> materials) {
|
||||
super(material, replaceable, applyGravity, main, materials);
|
||||
super(material, replaceable, applyGravity, platform, materials);
|
||||
this.sizeRange = size;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user