mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-04 23:06:05 +00:00
cleanup
This commit is contained in:
@@ -21,6 +21,6 @@ public class BufferedEntity implements BufferedItem {
|
||||
@Override
|
||||
public void paste(Vector3 origin, World world) {
|
||||
Entity entity = world.spawnEntity(origin.clone().add(0.5, 0, 0.5), type);
|
||||
main.getEventManager().callEvent(new EntitySpawnEvent(entity.world().getGenerator().getConfigPack(), entity));
|
||||
main.getEventManager().callEvent(new EntitySpawnEvent(entity.world().getConfig().getPack(), entity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class BufferedLootApplication implements BufferedItem {
|
||||
}
|
||||
Container container = (Container) data;
|
||||
|
||||
LootPopulateEvent event = new LootPopulateEvent(container, table, world.getGenerator().getConfigPack(), structure);
|
||||
LootPopulateEvent event = new LootPopulateEvent(container, table, world.getConfig().getPack(), structure);
|
||||
main.getEventManager().callEvent(event);
|
||||
if(event.isCancelled()) return;
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ public interface WorldConfig {
|
||||
|
||||
BiomeProvider getProvider();
|
||||
|
||||
ConfigPack getPack();
|
||||
|
||||
int elevationBlend();
|
||||
|
||||
boolean disableTrees();
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.dfsek.terra.api.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.Chunk;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.generator.TerraChunkGenerator;
|
||||
|
||||
public class DummyWorld implements World {
|
||||
@Override
|
||||
@@ -56,6 +57,11 @@ public class DummyWorld implements World {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerraChunkGenerator getGenerator() {
|
||||
throw new UnsupportedOperationException("Cannot get generator of DummyWorld");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeProvider getBiomeProvider() {
|
||||
throw new UnsupportedOperationException("Cannot get biome provider of DummyWorld");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dfsek.terra.config.pack;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.WorldConfig;
|
||||
import com.dfsek.terra.api.registry.Registry;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
@@ -54,6 +55,11 @@ public class WorldConfigImpl implements WorldConfig {
|
||||
return provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigPack getPack() {
|
||||
return pack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int elevationBlend() {
|
||||
return pack.getTemplate().getElevationBlend();
|
||||
|
||||
Reference in New Issue
Block a user