This commit is contained in:
gnembon committed 2020-07-01 15:41:25 -03:00
1 parent 150c1d41a7
commit 03061ba114
14 files changed
+60 -35

No files matched your search

+3 -2
View File
@@ -11,6 +11,7 @@ import net.minecraft.entity.ai.goal.WanderAroundGoal;
import net.minecraft.entity.ai.pathing.NavigationType;
import net.minecraft.entity.mob.PathAwareEntity;
import net.minecraft.entity.mob.ZombifiedPiglinEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.text.BaseText;
import net.minecraft.util.math.BlockPos;
@@ -169,7 +170,7 @@ public class BlockInfo
put(Material.CAKE , "cake" );
}};
public static List<BaseText> blockInfo(BlockPos pos, World world)
public static List<BaseText> blockInfo(BlockPos pos, ServerWorld world)
{
BlockState state = world.getBlockState(pos);
Material material = state.getMaterial();
@@ -220,7 +221,7 @@ public class BlockInfo
return lst;
}
private static BaseText wander_chances(BlockPos pos, World worldIn)
private static BaseText wander_chances(BlockPos pos, ServerWorld worldIn)
{
PathAwareEntity creature = new ZombifiedPiglinEntity(EntityType.ZOMBIFIED_PIGLIN, worldIn);
creature.initialize(worldIn, worldIn.getLocalDifficulty(pos), SpawnReason.NATURAL, null, null);
@@ -181,7 +181,7 @@ public class PerimeterDiagnostics
{
el.refreshPositionAndAngles((float)pos.getX() + 0.5F, (float)pos.getY(), (float)pos.getZ()+0.5F, 0.0F, 0.0F);
return el.canSpawn(worldServer) && el.canSpawn(worldServer, SpawnReason.NATURAL) &&
SpawnRestriction.canSpawn(el.getType(),el.getEntityWorld(), SpawnReason.NATURAL, el.getBlockPos(), el.getEntityWorld().random) &&
SpawnRestriction.canSpawn(el.getType(),(ServerWorld)el.getEntityWorld(), SpawnReason.NATURAL, el.getBlockPos(), el.getEntityWorld().random) &&
worldServer.doesNotCollide(el); // check collision rules once they stop fiddling with them after 1.14.1
}
return false;