This commit is contained in:
gnembon committed 2020-04-02 23:38:19 -03:00
1 parent a4626df004
commit 76080f1a59
19 files changed
+49 -48

No files matched your search

@@ -2,6 +2,7 @@ package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.block.Blocks;
import net.minecraft.class_5138;
import net.minecraft.entity.EntityCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
@@ -24,11 +25,11 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGe
}
@Override
public List<Biome.SpawnEntry> getEntitySpawnList(EntityCategory category, BlockPos pos)
public List<Biome.SpawnEntry> getEntitySpawnList(class_5138 arg, EntityCategory category, BlockPos pos)
{
if (CarpetSettings.flatWorldStructureSpawning)
{
if (Feature.SWAMP_HUT.method_14029(this.world, pos))
if (Feature.SWAMP_HUT.method_14029(this.world, arg, pos))
{
if (category == EntityCategory.MONSTER)
{
@@ -42,37 +43,37 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGe
}
else if (category == EntityCategory.MONSTER)
{
if (Feature.PILLAGER_OUTPOST.isApproximatelyInsideStructure(this.world, pos))
if (Feature.PILLAGER_OUTPOST.isApproximatelyInsideStructure(this.world, arg, pos))
{
return Feature.PILLAGER_OUTPOST.getMonsterSpawns();
}
if (CarpetSettings.huskSpawningInTemples)
{
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, pos))
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, arg, pos))
{
return Feature.DESERT_PYRAMID.getMonsterSpawns();
}
}
if (Feature.OCEAN_MONUMENT.isApproximatelyInsideStructure(this.world, pos))
if (Feature.OCEAN_MONUMENT.isApproximatelyInsideStructure(this.world, arg, pos))
{
return Feature.OCEAN_MONUMENT.getMonsterSpawns();
}
if (Feature.NETHER_BRIDGE.isInsideStructure(this.world, pos))
if (Feature.NETHER_BRIDGE.isInsideStructure(this.world, arg, pos))
{
return Feature.NETHER_BRIDGE.getMonsterSpawns();
}
if (Feature.NETHER_BRIDGE.isApproximatelyInsideStructure(this.world, pos) && this.world.getBlockState(pos.down(1)).getBlock() == Blocks.NETHER_BRICKS)
if (Feature.NETHER_BRIDGE.isApproximatelyInsideStructure(this.world, arg, pos) && this.world.getBlockState(pos.down(1)).getBlock() == Blocks.NETHER_BRICKS)
{
return Feature.NETHER_BRIDGE.getMonsterSpawns();
}
if (CarpetSettings.shulkerSpawningInEndCities)
{
if (Feature.END_CITY.isInsideStructure(this.world, pos))
if (Feature.END_CITY.isInsideStructure(this.world, arg, pos))
{
return Feature.END_CITY.getMonsterSpawns();
}
@@ -80,6 +81,6 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGe
}
}
return super.getEntitySpawnList(category, pos);
return super.getEntitySpawnList(arg, category, pos);
}
}
@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.class_5138;
import net.minecraft.entity.EntityCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
@@ -23,15 +24,15 @@ public abstract class FloatingIslandsChunkGeneratorMixin extends SurfaceChunkGen
}
@Override
public List<Biome.SpawnEntry> getEntitySpawnList(EntityCategory entityCategory_1, BlockPos blockPos_1)
public List<Biome.SpawnEntry> getEntitySpawnList(class_5138 arg, EntityCategory category, BlockPos pos)
{
if (CarpetSettings.shulkerSpawningInEndCities && EntityCategory.MONSTER == entityCategory_1)
if (CarpetSettings.shulkerSpawningInEndCities && EntityCategory.MONSTER == category)
{
if (Feature.END_CITY.isInsideStructure(this.world, blockPos_1))
if (Feature.END_CITY.isInsideStructure(this.world, arg, pos))
{
return Feature.END_CITY.getMonsterSpawns();
}
}
return this.world.getBiome(blockPos_1).getEntitySpawnList(entityCategory_1);
return this.world.getBiome(pos).getEntitySpawnList(category);
}
}
@@ -2,6 +2,7 @@ package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.entity.mob.HuskEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.feature.Feature;
@@ -16,6 +17,6 @@ public class HuskEntityMixin
private static boolean isSkylightOrTempleVisible(IWorld iWorld, BlockPos blockPos_1)
{
return iWorld.isSkyVisible(blockPos_1) ||
(CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(iWorld, blockPos_1));
(CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(iWorld, ((ServerWorld)iWorld).method_27056(), blockPos_1));
}
}
@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class IntegratedServerMixin
{
@Inject(method = "loadWorld", at = @At("HEAD"))
private void onSetupServerIntegrated(String name, String serverName, long seed, LevelGeneratorOptions arg, CallbackInfo ci) {
private void onSetupServerIntegrated(String string, long l, LevelGeneratorOptions levelGeneratorOptions, CallbackInfo ci) {
CarpetServer.onServerLoaded((IntegratedServer) (Object) this);
}
}
@@ -14,7 +14,7 @@ public class MinecraftDedicatedServerMixin
// this.tickWorlds(booleanSupplier_1);
@Inject(method = "setupServer", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld(Ljava/lang/String;Ljava/lang/String;JLnet/minecraft/world/level/LevelGeneratorOptions;)V",
target = "Lnet/minecraft/server/dedicated/MinecraftDedicatedServer;loadWorld(Ljava/lang/String;JLnet/minecraft/world/level/LevelGeneratorOptions;)V",
shift = At.Shift.BEFORE
))
private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
@@ -30,7 +30,7 @@ public abstract class MinecraftServer_coreMixin
// Dedicated server only
@Inject(method = "loadWorld", at = @At("HEAD"))
private void serverLoaded(String name, String serverName, long seed, LevelGeneratorOptions arg, CallbackInfo ci)
private void serverLoaded(String string, long l, LevelGeneratorOptions levelGeneratorOptions, CallbackInfo ci)
{
CarpetServer.onServerLoaded((MinecraftServer) (Object) this);
}
@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.class_5138;
import net.minecraft.entity.EntityCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
@@ -26,14 +27,13 @@ public abstract class OverworldChunkGeneratorMixin extends SurfaceChunkGenerator
}
@Inject(method = "getEntitySpawnList", at = @At(value = "INVOKE", ordinal = 1, shift = At.Shift.BEFORE,
target = "Lnet/minecraft/world/gen/feature/StructureFeature;isApproximatelyInsideStructure(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;)Z"),
target = "Lnet/minecraft/world/gen/feature/StructureFeature;isApproximatelyInsideStructure(Lnet/minecraft/world/IWorld;Lnet/minecraft/class_5138;Lnet/minecraft/util/math/BlockPos;)Z"),
cancellable = true)
private void onGetEntitySpawnList(EntityCategory entityCategory_1, BlockPos blockPos_1,
CallbackInfoReturnable<List<Biome.SpawnEntry>> cir)
private void onGetEntitySpawnList(class_5138 arg, EntityCategory entityCategory, BlockPos blockPos, CallbackInfoReturnable<List<Biome.SpawnEntry>> cir)
{
if (CarpetSettings.huskSpawningInTemples)
{
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, blockPos_1))
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, arg, blockPos))
{
cir.setReturnValue(Feature.DESERT_PYRAMID.getMonsterSpawns());
}
@@ -109,7 +109,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
if (this.source)
blockState_2 = Blocks.AIR.getDefaultState();
else
blockState_2 = Block.getRenderingState(this.pushedBlock, this.world, this.pos);
blockState_2 = Block.postProcessState(this.pushedBlock, this.world, this.pos);
((WorldInterface) (this.world)).setBlockStateWithBlockEntity(this.pos, blockState_2, this.carriedBlockEntity, 3);
this.world.breakBlock(this.pos, false, null);
}
@@ -19,7 +19,7 @@ import java.util.Random;
public abstract class SaplingBlockMixin
{
@Inject(method = "generate", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
target = "Lnet/minecraft/block/sapling/SaplingGenerator;generate(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Ljava/util/Random;)Z"),
target = "Lnet/minecraft/block/sapling/SaplingGenerator;generate(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Ljava/util/Random;)Z"),
cancellable = true)
private void onGenerate(ServerWorld serverWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci)
{
@@ -68,7 +68,7 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
BlockBox box = structurestart.getBoundingBox();
if (!wireOnly)
{
structurestart.generateStructure(world, generator, rand,
structurestart.generateStructure(world, world.method_27056(), generator, rand,
new BlockBox(
pos.getX() - this.getRadius() * 16,
pos.getZ() - this.getRadius() * 16,