Skip to content

Commit f316ffa

Browse files
committed
24w04a
1 parent ea3f51e commit f316ffa

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check https://fabricmc.net/develop/
6-
minecraft_version=24w03a
6+
minecraft_version=24w04a
77
loader_version=0.15.6
88
jsr305_version=3.0.2
99
fabric_version=0.91.1+1.20.3
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
package carpet.mixins;
22

33
import carpet.CarpetSettings;
4-
import net.minecraft.core.BlockPos;
5-
import net.minecraft.util.RandomSource;
64
import net.minecraft.world.entity.EntityType;
7-
import net.minecraft.world.entity.Mob;
8-
import net.minecraft.world.entity.MobSpawnType;
5+
import net.minecraft.world.entity.SpawnPlacementType;
6+
import net.minecraft.world.entity.SpawnPlacementTypes;
97
import net.minecraft.world.entity.SpawnPlacements;
10-
import net.minecraft.world.entity.monster.Monster;
11-
import net.minecraft.world.entity.monster.piglin.Piglin;
12-
import net.minecraft.world.entity.monster.piglin.PiglinBrute;
13-
import net.minecraft.world.level.LevelAccessor;
14-
import net.minecraft.world.level.ServerLevelAccessor;
15-
import net.minecraft.world.level.block.Blocks;
16-
import net.minecraft.world.level.levelgen.Heightmap;
178
import org.spongepowered.asm.mixin.Mixin;
18-
import org.spongepowered.asm.mixin.Shadow;
19-
import org.spongepowered.asm.mixin.Unique;
209
import org.spongepowered.asm.mixin.injection.At;
2110
import org.spongepowered.asm.mixin.injection.Inject;
22-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2311
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2412

2513
@Mixin(SpawnPlacements.class)
2614
public class PiglinBrute_getPlacementTypeMixin {
2715
@Inject(method = "getPlacementType", at = @At("HEAD"), cancellable = true)
28-
private static void getPlacementType(EntityType<?> entityType, CallbackInfoReturnable<SpawnPlacements.Type> cir) {
16+
private static void getPlacementType(final EntityType<?> entityType, final CallbackInfoReturnable<SpawnPlacementType> cir) {
2917
if (CarpetSettings.piglinsSpawningInBastions && entityType == EntityType.PIGLIN_BRUTE) {
30-
cir.setReturnValue(SpawnPlacements.Type.ON_GROUND);
18+
cir.setReturnValue(SpawnPlacementTypes.ON_GROUND);
3119
}
3220
}
3321
}

src/main/java/carpet/utils/PerimeterDiagnostics.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ private boolean check_entity_spawn(BlockPos pos)
176176
}
177177
}
178178

179-
SpawnPlacements.Type spt = SpawnPlacements.getPlacementType(sle.type);
180-
181-
if (NaturalSpawner.isSpawnPositionOk(spt, worldServer, pos, sle.type))
179+
if (SpawnPlacements.isSpawnPositionOk(sle.type, worldServer, pos))
182180
{
183181
el.moveTo(pos.getX() + 0.5F, pos.getY(), pos.getZ()+0.5F, 0.0F, 0.0F);
184182
return el.checkSpawnObstruction(worldServer) && el.checkSpawnRules(worldServer, MobSpawnType.NATURAL) &&

src/main/java/carpet/utils/SpawnReporter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public static List<Component> report(BlockPos pos, ServerLevel worldIn)
414414
{
415415
if (SpawnPlacements.getPlacementType(spawnEntry.type) == null)
416416
continue; // vanilla bug
417-
boolean canSpawn = NaturalSpawner.isSpawnPositionOk(SpawnPlacements.getPlacementType(spawnEntry.type), worldIn, pos, spawnEntry.type);
417+
boolean canSpawn = SpawnPlacements.isSpawnPositionOk(spawnEntry.type, worldIn, pos);
418418
int willSpawn = -1;
419419
boolean fits = false;
420420

@@ -444,7 +444,7 @@ public static List<Component> report(BlockPos pos, ServerLevel worldIn)
444444
{
445445
if (
446446
SpawnPlacements.checkSpawnRules(etype,worldIn, MobSpawnType.NATURAL, pos, worldIn.random) &&
447-
NaturalSpawner.isSpawnPositionOk(SpawnPlacements.getPlacementType(etype), worldIn, pos, etype) &&
447+
SpawnPlacements.isSpawnPositionOk(etype, worldIn, pos) &&
448448
mob.checkSpawnRules(worldIn, MobSpawnType.NATURAL)
449449
// && mob.canSpawn(worldIn) // entity collisions // mostly - except ocelots
450450
)

0 commit comments

Comments
 (0)