API compiles
This commit is contained in:
@@ -7,7 +7,7 @@ import com.mojang.datafixers.Dynamic;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.chunk.IChunk;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.GenerationSettings;
|
||||
@@ -35,7 +35,7 @@ public class ChargedQuartzOreFeature extends Feature<ChargedQuartzOreConfig> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> generator, Random rand,
|
||||
public boolean place(WorldAccess worldIn, ChunkGenerator<? extends GenerationSettings> generator, Random rand,
|
||||
BlockPos pos, ChargedQuartzOreConfig config) {
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ package appeng.worldgen.meteorite;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
public class MeteoriteBlockPutter {
|
||||
public boolean put(final IWorld w, BlockPos pos, final BlockState blk) {
|
||||
public boolean put(final WorldAccess w, BlockPos pos, final BlockState blk) {
|
||||
final BlockState original = w.getBlockState(pos);
|
||||
|
||||
if (original.getBlock() == Blocks.BEDROCK || original == blk) {
|
||||
|
||||
@@ -24,16 +24,16 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MutableBoundingBox;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
@@ -57,7 +57,7 @@ public final class MeteoritePlacer {
|
||||
private final BlockState skyStone;
|
||||
private final Item skyStoneItem;
|
||||
private final MeteoriteBlockPutter putter = new MeteoriteBlockPutter();
|
||||
private final IWorld world;
|
||||
private final WorldAccess world;
|
||||
private final Fallout type;
|
||||
private final BlockPos pos;
|
||||
private final int x;
|
||||
@@ -73,7 +73,7 @@ public final class MeteoritePlacer {
|
||||
private final boolean craterLake;
|
||||
private final MutableBoundingBox boundingBox;
|
||||
|
||||
public MeteoritePlacer(IWorld world, PlacedMeteoriteSettings settings, MutableBoundingBox boundingBox) {
|
||||
public MeteoritePlacer(WorldAccess world, PlacedMeteoriteSettings settings, MutableBoundingBox boundingBox) {
|
||||
this.boundingBox = boundingBox;
|
||||
this.world = world;
|
||||
this.pos = settings.getPos();
|
||||
@@ -187,7 +187,7 @@ public final class MeteoritePlacer {
|
||||
}
|
||||
|
||||
for (final Object o : world.getEntitiesWithinAABB(ItemEntity.class,
|
||||
new AxisAlignedBB(minX(x - 30), y - 5, minZ(z - 30), maxX(x + 30), y + 30, maxZ(z + 30)))) {
|
||||
new Box(minX(x - 30), y - 5, minZ(z - 30), maxX(x + 30), y + 30, maxZ(z + 30)))) {
|
||||
final Entity e = (Entity) o;
|
||||
e.remove();
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public final class MeteoritePlacer {
|
||||
if (AEConfig.instance().isFeatureEnabled(AEFeature.SPAWN_PRESSES_IN_METEORITES)) {
|
||||
this.putter.put(world, pos, this.skyChestDefinition.block().getDefaultState());
|
||||
|
||||
final TileEntity te = world.getTileEntity(pos); // FIXME: this is also probably a band-aid for another issue
|
||||
final BlockEntity te = world.getTileEntity(pos); // FIXME: this is also probably a band-aid for another issue
|
||||
final InventoryAdaptor ap = InventoryAdaptor.getAdaptor(te, Direction.UP);
|
||||
if (ap != null && !ap.containsItems()) // FIXME: band-aid for meteorites being generated multiple times
|
||||
{
|
||||
@@ -413,7 +413,7 @@ public final class MeteoritePlacer {
|
||||
}
|
||||
}
|
||||
|
||||
private Fallout getFallout(IWorld w, BlockPos pos, FalloutMode mode) {
|
||||
private Fallout getFallout(WorldAccess w, BlockPos pos, FalloutMode mode) {
|
||||
switch (mode) {
|
||||
case SAND:
|
||||
return new FalloutSand(w, pos, this.putter, this.skyStone);
|
||||
|
||||
@@ -10,8 +10,8 @@ import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
|
||||
@@ -135,7 +135,7 @@ public final class MeteoriteSpawnData {
|
||||
return ll;
|
||||
}
|
||||
|
||||
public synchronized static MeteoriteSpawnData get(IWorld world) {
|
||||
public synchronized static MeteoriteSpawnData get(WorldAccess world) {
|
||||
ServerWorld serverWorld;
|
||||
if (world instanceof ServerWorld) {
|
||||
serverWorld = (ServerWorld) world;
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.MutableBoundingBox;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.structure.IStructurePieceType;
|
||||
import net.minecraft.world.gen.feature.structure.StructurePiece;
|
||||
@@ -85,7 +85,7 @@ public class MeteoriteStructurePiece extends StructurePiece {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean create(IWorld world, ChunkGenerator<?> chunkGeneratorIn, Random rand, MutableBoundingBox bounds,
|
||||
public boolean create(WorldAccess world, ChunkGenerator<?> chunkGeneratorIn, Random rand, MutableBoundingBox bounds,
|
||||
ChunkPos chunkPos) {
|
||||
MeteoritePlacer placer = new MeteoritePlacer(world, settings, bounds);
|
||||
placer.place();
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MutableBoundingBox;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@@ -26,9 +26,9 @@ import appeng.worldgen.meteorite.fallout.FalloutMode;
|
||||
|
||||
public class MeteoriteStructureStart extends StructureStart {
|
||||
|
||||
private final Tag<Block> sandTag = BlockTags.getCollection().getOrCreate(new ResourceLocation("minecraft:sand"));
|
||||
private final Tag<Block> sandTag = BlockTags.getCollection().getOrCreate(new Identifier("minecraft:sand"));
|
||||
private final Tag<Block> terracottaTag = BlockTags.getCollection()
|
||||
.getOrCreate(new ResourceLocation("forge:terracotta"));
|
||||
.getOrCreate(new Identifier("forge:terracotta"));
|
||||
|
||||
public MeteoriteStructureStart(Structure<?> p_i225815_1_, int p_i225815_2_, int p_i225815_3_,
|
||||
MutableBoundingBox p_i225815_4_, int p_i225815_5_, long p_i225815_6_) {
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.worldgen.meteorite.fallout;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.worldgen.meteorite.MeteoriteBlockPutter;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Fallout {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void getRandomFall(final IWorld w, BlockPos pos) {
|
||||
public void getRandomFall(final WorldAccess w, BlockPos pos) {
|
||||
final double a = Math.random();
|
||||
if (a > 0.9) {
|
||||
this.putter.put(w, pos, Blocks.STONE.getDefaultState());
|
||||
@@ -51,7 +51,7 @@ public class Fallout {
|
||||
}
|
||||
}
|
||||
|
||||
public void getRandomInset(final IWorld w, BlockPos pos) {
|
||||
public void getRandomInset(final WorldAccess w, BlockPos pos) {
|
||||
final double a = Math.random();
|
||||
if (a > 0.9) {
|
||||
this.putter.put(w, pos, Blocks.COBBLESTONE.getDefaultState());
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.worldgen.meteorite.fallout;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.worldgen.meteorite.MeteoriteBlockPutter;
|
||||
|
||||
@@ -33,14 +33,14 @@ public class FalloutCopy extends Fallout {
|
||||
private final BlockState block;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
public FalloutCopy(final IWorld w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
public FalloutCopy(final WorldAccess w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
super(putter, skyStone);
|
||||
this.putter = putter;
|
||||
this.block = w.getBiome(pos).getSurfaceBuilderConfig().getTop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRandomFall(final IWorld w, BlockPos pos) {
|
||||
public void getRandomFall(final WorldAccess w, BlockPos pos) {
|
||||
final double a = Math.random();
|
||||
if (a > SPECIFIED_BLOCK_THRESHOLD) {
|
||||
this.putter.put(w, pos, this.block);
|
||||
@@ -49,12 +49,12 @@ public class FalloutCopy extends Fallout {
|
||||
}
|
||||
}
|
||||
|
||||
public void getOther(final IWorld w, BlockPos pos, final double a) {
|
||||
public void getOther(final WorldAccess w, BlockPos pos, final double a) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRandomInset(final IWorld w, BlockPos pos) {
|
||||
public void getRandomInset(final WorldAccess w, BlockPos pos) {
|
||||
final double a = Math.random();
|
||||
if (a > SPECIFIED_BLOCK_THRESHOLD) {
|
||||
this.putter.put(w, pos, this.block);
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.worldgen.meteorite.fallout;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.worldgen.meteorite.MeteoriteBlockPutter;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class FalloutSand extends FalloutCopy {
|
||||
private static final double GLASS_THRESHOLD = 0.66;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
public FalloutSand(final IWorld w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
public FalloutSand(final WorldAccess w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
super(w, pos, putter, skyStone);
|
||||
this.putter = putter;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class FalloutSand extends FalloutCopy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getOther(final IWorld w, BlockPos pos, final double a) {
|
||||
public void getOther(final WorldAccess w, BlockPos pos, final double a) {
|
||||
if (a > GLASS_THRESHOLD) {
|
||||
this.putter.put(w, pos, Blocks.GLASS.getDefaultState());
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.worldgen.meteorite.fallout;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import appeng.worldgen.meteorite.MeteoriteBlockPutter;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class FalloutSnow extends FalloutCopy {
|
||||
private static final double ICE_THRESHOLD = 0.5;
|
||||
private final MeteoriteBlockPutter putter;
|
||||
|
||||
public FalloutSnow(final IWorld w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
public FalloutSnow(final WorldAccess w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
|
||||
super(w, pos, putter, skyStone);
|
||||
this.putter = putter;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class FalloutSnow extends FalloutCopy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getOther(final IWorld w, BlockPos pos, final double a) {
|
||||
public void getOther(final WorldAccess w, BlockPos pos, final double a) {
|
||||
if (a > SNOW_THRESHOLD) {
|
||||
this.putter.put(w, pos, Blocks.SNOW.getDefaultState());
|
||||
} else if (a > ICE_THRESHOLD) {
|
||||
|
||||
Reference in New Issue
Block a user