More moves and compilation fixes

This commit is contained in:
Sebastian Hartte
2020-06-29 02:15:31 +02:00
parent 3df93fc66d
commit 0d63f560d3
240 changed files with 2221 additions and 1926 deletions
@@ -24,6 +24,7 @@ import java.util.Random;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.util.InputMappings;
import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.server.network.ServerPlayerEntity;
@@ -148,7 +149,7 @@ public class ServerHelper extends CommonHelper {
}
@Override
public boolean isActionKey(ActionKey key, InputMappings.Input input) {
public boolean isActionKey(ActionKey key, InputUtil.Key input) {
return false;
}
}
@@ -40,9 +40,8 @@ import net.minecraft.text.Text;
import net.minecraft.text.LiteralText;
import net.minecraft.util.text.event.ClickEvent;
import net.minecraft.util.text.event.HoverEvent;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.Heightmap;
import net.minecraft.world.gen.feature.structure.StructureStart;
@@ -84,15 +83,15 @@ public class TestMeteoritesCommand implements ISubCommand {
BlockPos centerBlock;
if (player != null) {
world = player.getServerWorld();
centerBlock = new BlockPos(player.getX(), 0, player.getPosZ());
centerBlock = new BlockPos(player.getX(), 0, player.getZ());
} else {
world = srv.getWorld(DimensionType.OVERWORLD);
world = srv.getOverworld();
centerBlock = world.getSpawnPoint();
}
ChunkPos center = new ChunkPos(centerBlock);
ChunkGenerator<?> generator = world.getChunkProvider().getChunkGenerator();
ChunkGenerator<?> generator = world.getChunkManager().getChunkGenerator();
// Find all meteorites in the given rectangle
List<PlacedMeteoriteSettings> found = new ArrayList<>();
@@ -104,7 +103,7 @@ public class TestMeteoritesCommand implements ISubCommand {
BlockPos p = new BlockPos(cp.getXStart(), 0, cp.getZStart());
BlockPos nearest = MeteoriteStructure.INSTANCE.findNearest(world, generator, p, 0, false);
if (nearest != null) {
IChunk chunk = world.getChunk(cx, cz, ChunkStatus.STRUCTURE_STARTS);
Chunk chunk = world.getChunk(cx, cz, ChunkStatus.STRUCTURE_STARTS);
// The actual relevant information is in the structure piece
MeteoriteStructurePiece piece = getMeteoritePieceFromChunk(chunk);
if (piece != null) {
@@ -147,7 +146,7 @@ public class TestMeteoritesCommand implements ISubCommand {
String state = "not final";
if (force && settings.getFallout() == null) {
IChunk chunk = world.getChunk(pos);
Chunk chunk = world.getChunk(pos);
MeteoriteStructurePiece piece = getMeteoritePieceFromChunk(chunk);
if (piece == null) {
state = "removed";
@@ -195,7 +194,7 @@ public class TestMeteoritesCommand implements ISubCommand {
.formatted(style -> style.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, tpCommand)));
}
private static MeteoriteStructurePiece getMeteoritePieceFromChunk(IChunk chunk) {
private static MeteoriteStructurePiece getMeteoritePieceFromChunk(Chunk chunk) {
StructureStart start = chunk.getStructureStart(MeteoriteStructure.INSTANCE.getStructureName());
if (start != null && start.getComponents().size() > 0
@@ -36,8 +36,7 @@ import net.minecraft.text.LiteralText;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.server.world.ServerWorld;
import appeng.core.Api;
@@ -66,9 +65,9 @@ public class TestOreGenCommand implements ISubCommand {
try {
ServerPlayerEntity player = sender.asPlayer();
world = player.getServerWorld();
center = new BlockPos(player.getX(), 0, player.getPosZ());
center = new BlockPos(player.getX(), 0, player.getZ());
} catch (CommandSyntaxException e) {
world = srv.getWorld(DimensionType.OVERWORLD);
world = srv.getOverworld();
center = world.getSpawnPoint();
}
@@ -98,7 +97,7 @@ public class TestOreGenCommand implements ISubCommand {
}
private void checkChunk(ServerCommandSource sender, ServerWorld world, ChunkPos cp, Stats stats) {
IChunk chunk = world.getChunk(cp.x, cp.z, ChunkStatus.FULL, false);
Chunk chunk = world.getChunk(cp.x, cp.z, ChunkStatus.FULL, false);
if (chunk == null) {
sendLine(sender, "Skipping chunk %s", cp);
return;