World#getTerraGenerator -> World#getGenerator

This commit is contained in:
dfsek 2021-07-22 14:28:37 -07:00
parent ec14666c6d
commit ad9cc1afcb
6 changed files with 7 additions and 7 deletions

View File

@ -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().getTerraGenerator().getConfigPack(), entity));
main.getEventManager().callEvent(new EntitySpawnEvent(entity.world().getGenerator().getConfigPack(), entity));
}
}

View File

@ -33,7 +33,7 @@ public class BufferedLootApplication implements BufferedItem {
}
Container container = (Container) data;
LootPopulateEvent event = new LootPopulateEvent(container, table, world.getTerraGenerator().getConfigPack(), structure);
LootPopulateEvent event = new LootPopulateEvent(container, table, world.getGenerator().getConfigPack(), structure);
main.getEventManager().callEvent(event);
if(event.isCancelled()) return;

View File

@ -53,7 +53,7 @@ public interface World extends Handle {
int getMinHeight();
TerraChunkGenerator getTerraGenerator();
TerraChunkGenerator getGenerator();
BiomeProvider getBiomeProvider();

View File

@ -23,6 +23,6 @@ public class GetBlockCommand implements CommandTemplate {
@Override
public void execute(CommandSender sender) {
Player player = (Player) sender;
sender.sendMessage("Block: " + player.world().getTerraGenerator().getBlock(player.world(), player.position()).getAsString());
sender.sendMessage("Block: " + player.world().getGenerator().getBlock(player.world(), player.position()).getAsString());
}
}

View File

@ -20,7 +20,7 @@ public class SamplerCacheImpl implements com.dfsek.terra.api.world.generator.Sam
public Sampler load(@NotNull Long key) {
int cx = (int) (key >> 32);
int cz = (int) key.longValue();
return world.getTerraGenerator().createSampler(cx, cz, world.getBiomeProvider(), world, world.getConfig().elevationBlend());
return world.getGenerator().createSampler(cx, cz, world.getBiomeProvider(), world, world.getConfig().elevationBlend());
}
});
}

View File

@ -169,7 +169,7 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
@Override
public int getHeight(int x, int z, Heightmap.Type heightmap, HeightLimitView heightmapType) {
int height = ((World) world).getMaxHeight();
while(height >= ((World) world).getMinHeight() && !heightmap.getBlockPredicate().test(((FabricBlockState) ((World) world).getTerraGenerator().getBlock((World) world, x, height - 1, z)).getHandle())) {
while(height >= ((World) world).getMinHeight() && !heightmap.getBlockPredicate().test(((FabricBlockState) ((World) world).getGenerator().getBlock((World) world, x, height - 1, z)).getHandle())) {
height--;
}
return height;
@ -179,7 +179,7 @@ public class FabricChunkGeneratorWrapper extends ChunkGenerator implements Gener
public VerticalBlockSample getColumnSample(int x, int z, HeightLimitView view) {
BlockState[] array = new BlockState[view.getHeight()];
for(int y = view.getBottomY() + view.getHeight() - 1; y >= view.getBottomY(); y--) {
array[y] = ((FabricBlockState) ((World) world).getTerraGenerator().getBlock((World) world, x, y, z)).getHandle();
array[y] = ((FabricBlockState) ((World) world).getGenerator().getBlock((World) world, x, y, z)).getHandle();
}
return new VerticalBlockSample(view.getBottomY(), array);
}