update to 24w33a

This commit is contained in:
gnembon committed 2024-08-18 19:10:40 +02:00
1 parent 9940feb7d3
commit d11586fdaf
58 files changed
+379 -875

No files matched your search

+2 -2
View File
@@ -9,8 +9,8 @@ import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.ai.goal.RandomStrollGoal;
import net.minecraft.world.entity.ai.util.DefaultRandomPos;
@@ -75,7 +75,7 @@ public class BlockInfo
private static Component wander_chances(BlockPos pos, ServerLevel worldIn)
{
PathfinderMob creature = new ZombifiedPiglin(EntityType.ZOMBIFIED_PIGLIN, worldIn);
creature.finalizeSpawn(worldIn, worldIn.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null);
creature.finalizeSpawn(worldIn, worldIn.getCurrentDifficultyAt(pos), EntitySpawnReason.NATURAL, null);
creature.moveTo(pos, 0.0F, 0.0F);
RandomStrollGoal wander = new RandomStrollGoal(creature, 0.8D);
int success = 0;
@@ -6,10 +6,10 @@ import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.SpawnPlacements;
import net.minecraft.world.entity.ambient.AmbientCreature;
import net.minecraft.world.entity.animal.WaterAnimal;
@@ -179,8 +179,8 @@ public class PerimeterDiagnostics
if (SpawnPlacements.isSpawnPositionOk(sle.type, worldServer, pos))
{
el.moveTo(pos.getX() + 0.5F, pos.getY(), pos.getZ()+0.5F, 0.0F, 0.0F);
return el.checkSpawnObstruction(worldServer) && el.checkSpawnRules(worldServer, MobSpawnType.NATURAL) &&
SpawnPlacements.checkSpawnRules(el.getType(),(ServerLevel)el.getCommandSenderWorld(), MobSpawnType.NATURAL, el.blockPosition(), el.getCommandSenderWorld().random) &&
return el.checkSpawnObstruction(worldServer) && el.checkSpawnRules(worldServer, EntitySpawnReason.NATURAL) &&
SpawnPlacements.checkSpawnRules(el.getType(),(ServerLevel)el.getCommandSenderWorld(), EntitySpawnReason.NATURAL, el.blockPosition(), el.getCommandSenderWorld().random) &&
worldServer.noCollision(el); // check collision rules once they stop fiddling with them after 1.14.1
}
return false;
@@ -13,11 +13,11 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntitySpawnReason;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.SpawnPlacements;
import net.minecraft.world.entity.animal.Ocelot;
import net.minecraft.world.item.DyeColor;
@@ -421,7 +421,7 @@ public class SpawnReporter
Mob mob;
try
{
mob = (Mob) spawnEntry.type.create(worldIn);
mob = (Mob) spawnEntry.type.create(worldIn, EntitySpawnReason.NATURAL);
}
catch (Exception e)
{
@@ -443,9 +443,9 @@ public class SpawnReporter
for (int i = 0; i < 20; ++i)
{
if (
SpawnPlacements.checkSpawnRules(etype,worldIn, MobSpawnType.NATURAL, pos, worldIn.random) &&
SpawnPlacements.checkSpawnRules(etype,worldIn, EntitySpawnReason.NATURAL, pos, worldIn.random) &&
SpawnPlacements.isSpawnPositionOk(etype, worldIn, pos) &&
mob.checkSpawnRules(worldIn, MobSpawnType.NATURAL)
mob.checkSpawnRules(worldIn, EntitySpawnReason.NATURAL)
// && mob.canSpawn(worldIn) // entity collisions // mostly - except ocelots
)
{
@@ -459,7 +459,7 @@ public class SpawnReporter
willSpawn += 1;
}
}
mob.finalizeSpawn(worldIn, worldIn.getCurrentDifficultyAt(mob.blockPosition()), MobSpawnType.NATURAL, null);
mob.finalizeSpawn(worldIn, worldIn.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.NATURAL, null);
// the code invokes onInitialSpawn after getCanSpawHere
fits = fits && worldIn.noCollision(mob);
@@ -467,7 +467,7 @@ public class SpawnReporter
try
{
mob = (Mob) spawnEntry.type.create(worldIn);
mob = (Mob) spawnEntry.type.create(worldIn, EntitySpawnReason.NATURAL);
}
catch (Exception e)
{