More moves and compilation fixes
This commit is contained in:
@@ -8,7 +8,7 @@ import com.mojang.datafixers.Dynamic;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.GenerationSettings;
|
||||
import net.minecraft.world.gen.Heightmap;
|
||||
@@ -41,7 +41,7 @@ public class ChargedQuartzOreFeature extends Feature<ChargedQuartzOreConfig> {
|
||||
|
||||
BlockPos.Mutable bpos = new BlockPos.Mutable();
|
||||
int height = worldIn.getHeight(Heightmap.Type.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
IChunk chunk = worldIn.getChunk(pos);
|
||||
Chunk chunk = worldIn.getChunk(pos);
|
||||
for (int y = 0; y < height; y++) {
|
||||
bpos.setY(y);
|
||||
for (int x = chunkPos.getXStart(); x <= chunkPos.getXEnd(); x++) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
import net.minecraft.world.PersistentState;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
|
||||
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
||||
@@ -144,11 +144,11 @@ public final class MeteoriteSpawnData {
|
||||
serverWorld = server.getWorld(world.getDimension().getType());
|
||||
}
|
||||
|
||||
SavedData savedData = serverWorld.getSavedData().getOrCreate(SavedData::new, NAME);
|
||||
SavedData savedData = serverWorld.getPersistentStateManager().getOrCreate(SavedData::new, NAME);
|
||||
return new MeteoriteSpawnData(savedData);
|
||||
}
|
||||
|
||||
private static class SavedData extends WorldSavedData {
|
||||
private static class SavedData extends PersistentState {
|
||||
|
||||
private LongOpenHashSet generated;
|
||||
private CompoundTag spawns;
|
||||
@@ -160,13 +160,13 @@ public final class MeteoriteSpawnData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void read(CompoundTag nbt) {
|
||||
public synchronized void fromTag(CompoundTag nbt) {
|
||||
this.generated = new LongOpenHashSet(nbt.getLongArray("generated"));
|
||||
this.spawns = nbt.getCompound("spawns");
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized CompoundTag write(CompoundTag compound) {
|
||||
public synchronized CompoundTag toTag(CompoundTag compound) {
|
||||
compound.putLongArray("generated", generated.toLongArray());
|
||||
compound.put("spawns", spawns);
|
||||
return compound;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class MeteoriteStructurePiece extends StructurePiece {
|
||||
MeteoritePlacer placer = new MeteoritePlacer(world, settings, bounds);
|
||||
placer.place();
|
||||
|
||||
WorldData.instance().compassData().service().updateArea(world, chunkPos); // FIXME: We know the y-range here...
|
||||
WorldData.instance().compassData().service().tryUpdateArea(world, chunkPos); // FIXME: We know the y-range here...
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user