mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-23 00:29:51 +00:00
drastically simplify generator API
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.implementations.world;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ProtoWorld;
|
||||
|
||||
import net.minecraft.block.FluidBlock;
|
||||
@@ -59,7 +60,7 @@ import com.dfsek.terra.fabric.util.FabricUtil;
|
||||
@Mixin(ChunkRegion.class)
|
||||
@Implements(@Interface(iface = ProtoWorld.class, prefix = "terraWorld$", remap = Interface.Remap.NONE))
|
||||
public abstract class ChunkRegionMixin {
|
||||
private WorldConfig config;
|
||||
private ConfigPack config;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
@@ -80,7 +81,7 @@ public abstract class ChunkRegionMixin {
|
||||
method = "<init>(Lnet/minecraft/server/world/ServerWorld;Ljava/util/List;Lnet/minecraft/world/chunk/ChunkStatus;I)V")
|
||||
public void injectConstructor(net.minecraft.server.world.ServerWorld world, List<net.minecraft.world.chunk.Chunk> list, ChunkStatus chunkStatus, int i,
|
||||
CallbackInfo ci) {
|
||||
this.config = ((ServerWorld) world).getConfig();
|
||||
this.config = ((ServerWorld) world).getPack();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@@ -149,7 +150,7 @@ public abstract class ChunkRegionMixin {
|
||||
return (ServerWorld) world;
|
||||
}
|
||||
|
||||
public WorldConfig terraWorld$getConfig() {
|
||||
public ConfigPack terraWorld$getPack() {
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.implementations.world;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.WorldGenerationProgressListener;
|
||||
import net.minecraft.server.world.ServerChunkManager;
|
||||
@@ -60,7 +62,7 @@ import com.dfsek.terra.fabric.util.FabricUtil;
|
||||
@Mixin(net.minecraft.server.world.ServerWorld.class)
|
||||
@Implements(@Interface(iface = ServerWorld.class, prefix = "terra$", remap = Interface.Remap.NONE))
|
||||
public abstract class ServerWorldMixin {
|
||||
private WorldConfig config;
|
||||
private ConfigPack config;
|
||||
@Shadow
|
||||
@Final
|
||||
private ServerChunkManager chunkManager;
|
||||
@@ -80,7 +82,7 @@ public abstract class ServerWorldMixin {
|
||||
net.minecraft.world.gen.chunk.ChunkGenerator chunkGenerator, boolean debugWorld, long seed,
|
||||
List<Spawner> spawners, boolean shouldTickTime, CallbackInfo ci) {
|
||||
if(chunkGenerator instanceof FabricChunkGeneratorWrapper) {
|
||||
config = ((FabricChunkGeneratorWrapper) chunkGenerator).getPack().toWorldConfig((ServerWorld) this);
|
||||
config = ((FabricChunkGeneratorWrapper) chunkGenerator).getPack();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +131,7 @@ public abstract class ServerWorldMixin {
|
||||
return ((TerraBiomeSource) ((net.minecraft.server.world.ServerWorld) (Object) this).getChunkManager().getChunkGenerator().getBiomeSource()).getProvider();
|
||||
}
|
||||
|
||||
public WorldConfig terra$getConfig() {
|
||||
public ConfigPack terra$getPack() {
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user