20w20b
This commit is contained in:
1 parent
e9c72ac4fe
commit
77d819487e
12 files changed
+35
-35
No files matched your search
@@ -2,12 +2,12 @@ package carpet.helpers;
|
||||
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
public class BlockSaplingHelper
|
||||
{
|
||||
// Added code for checking water for dead shrub rule
|
||||
public static boolean hasWater(IWorld worldIn, BlockPos pos)
|
||||
public static boolean hasWater(WorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
for (BlockPos blockpos$mutableblockpos : BlockPos.iterate(pos.add(-4, -4, -4), pos.add(4, 1, 4)))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package carpet.mixins;
|
||||
import carpet.fakes.CoralFeatureInterface;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.CoralFeature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -15,7 +15,7 @@ import java.util.Random;
|
||||
public abstract class CoralFeatureMixin implements CoralFeatureInterface
|
||||
{
|
||||
|
||||
@Shadow protected abstract boolean spawnCoral(IWorld var1, Random var2, BlockPos var3, BlockState var4);
|
||||
@Shadow protected abstract boolean spawnCoral(WorldAccess var1, Random var2, BlockPos var3, BlockState var4);
|
||||
|
||||
@Override
|
||||
public boolean growSpecific(World worldIn, Random random, BlockPos pos, BlockState blockUnder)
|
||||
|
||||
@@ -4,7 +4,7 @@ import carpet.CarpetSettings;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.BiomeSource;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
|
||||
@@ -4,7 +4,7 @@ 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.WorldAccess;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -13,10 +13,10 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(HuskEntity.class)
|
||||
public class HuskEntityMixin
|
||||
{
|
||||
@Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/world/IWorld;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z"))
|
||||
private static boolean isSkylightOrTempleVisible(IWorld iWorld, BlockPos blockPos_1)
|
||||
@Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/world/WorldAccess;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z"))
|
||||
private static boolean isSkylightOrTempleVisible(WorldAccess WorldAccess, BlockPos blockPos_1)
|
||||
{
|
||||
return iWorld.isSkyVisible(blockPos_1) ||
|
||||
(CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(((ServerWorld)iWorld).getStructureAccessor(), blockPos_1));
|
||||
return WorldAccess.isSkyVisible(blockPos_1) ||
|
||||
(CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(((ServerWorld)WorldAccess).getStructureAccessor(), blockPos_1));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package carpet.mixins;
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.BiomeSource;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ServerPlayerInteractionManager_scarpetEventsMixin
|
||||
|
||||
@Inject(method = "tryBreakBlock", locals = LocalCapture.CAPTURE_FAILEXCEPTION, at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V",
|
||||
target = "Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V",
|
||||
shift = At.Shift.BEFORE
|
||||
))
|
||||
private void onBlockBroken(BlockPos blockPos_1, CallbackInfoReturnable<Boolean> cir, BlockState blockState_1, BlockEntity be, Block b, boolean boolean_1)
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.LocalDifficulty;
|
||||
import net.minecraft.world.SpawnHelper;
|
||||
import net.minecraft.world.World;
|
||||
@@ -174,12 +174,12 @@ public class SpawnHelperMixin
|
||||
|
||||
@Redirect(method = "spawnEntitiesInChunk(Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/SpawnHelper$Checker;Lnet/minecraft/world/SpawnHelper$Runner;)V", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;"
|
||||
target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;"
|
||||
))
|
||||
private static EntityData spawnEntity(MobEntity mobEntity, IWorld iWorld_1, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1)
|
||||
private static EntityData spawnEntity(MobEntity mobEntity, WorldAccess WorldAccess_1, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1)
|
||||
{
|
||||
if (!SpawnReporter.mock_spawns)
|
||||
return mobEntity.initialize(iWorld_1, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1);
|
||||
return mobEntity.initialize(WorldAccess_1, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.block.entity.StructureBlockBlockEntity;
|
||||
import net.minecraft.structure.Structure;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -15,15 +15,15 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin
|
||||
{
|
||||
@Redirect(method = "place", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V"
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V"
|
||||
))
|
||||
private void onStructurePlacen(Structure structure, IWorld iWorld_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1)
|
||||
private void onStructurePlacen(Structure structure, WorldAccess WorldAccess_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1)
|
||||
{
|
||||
if(!CarpetSettings.fillUpdates)
|
||||
CarpetSettings.impendingFillSkipUpdates = true;
|
||||
try
|
||||
{
|
||||
structure.place(iWorld_1, blockPos_1, structurePlacementData_1);
|
||||
structure.place(WorldAccess_1, blockPos_1, structurePlacementData_1);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.structure.StructureStart;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.structure.Structure;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -13,17 +13,17 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(Structure.class)
|
||||
public class Structure_fillUpdatesMixin
|
||||
{
|
||||
@Redirect( method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
|
||||
@Redirect( method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IWorld;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
|
||||
target = "Lnet/minecraft/world/WorldAccess;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
|
||||
))
|
||||
private void skipUpdateNeighbours(IWorld iWorld, BlockPos var1, Block var2)
|
||||
private void skipUpdateNeighbours(WorldAccess WorldAccess, BlockPos var1, Block var2)
|
||||
{
|
||||
if (!CarpetSettings.impendingFillSkipUpdates)
|
||||
iWorld.updateNeighbors(var1, var2);
|
||||
WorldAccess.updateNeighbors(var1, var2);
|
||||
}
|
||||
|
||||
@Redirect(method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
|
||||
@Redirect(method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z"
|
||||
))
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.server.world.ChunkHolder;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.EmptyChunk;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
@@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(World.class)
|
||||
public abstract class World_movableTEMixin implements WorldInterface, IWorld
|
||||
public abstract class World_movableTEMixin implements WorldInterface, WorldAccess
|
||||
{
|
||||
@Shadow
|
||||
@Final
|
||||
@@ -125,9 +125,9 @@ public abstract class World_movableTEMixin implements WorldInterface, IWorld
|
||||
if ((int_1 & 16) == 0)
|
||||
{
|
||||
int int_2 = int_1 & -2;
|
||||
blockState_2.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2);
|
||||
blockState_1.updateNeighbors((net.minecraft.world.IWorld) this, blockPos_1, int_2);
|
||||
blockState_1.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2);
|
||||
blockState_2.prepare((net.minecraft.world.WorldAccess) this, blockPos_1, int_2);
|
||||
blockState_1.updateNeighbors((net.minecraft.world.WorldAccess) this, blockPos_1, int_2);
|
||||
blockState_1.prepare((net.minecraft.world.WorldAccess) this, blockPos_1, int_2);
|
||||
}
|
||||
this.onBlockChanged(blockPos_1, blockState_2, blockState_3);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user