diff --git a/src/main/java/com/minelittlepony/unicopia/UEntities.java b/src/main/java/com/minelittlepony/unicopia/UEntities.java index 05f01fee..434ddf0a 100644 --- a/src/main/java/com/minelittlepony/unicopia/UEntities.java +++ b/src/main/java/com/minelittlepony/unicopia/UEntities.java @@ -13,7 +13,8 @@ import net.minecraft.util.registry.Registry; public interface UEntities { EntityType THROWN_ITEM = register("thrown_item", FabricEntityTypeBuilder.create(SpawnGroup.MISC, MagicProjectileEntity::new) - .trackable(100, 2) + .trackRangeBlocks(100) + .trackedUpdateRate(2) .dimensions(EntityDimensions.fixed(0.25F, 0.25F))); static EntityType register(String name, FabricEntityTypeBuilder builder) { diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java index bbdf5fc7..c9d791b6 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java @@ -20,8 +20,8 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.mob.HostileEntity; -import net.minecraft.entity.passive.AbstractTraderEntity; import net.minecraft.entity.passive.CowEntity; +import net.minecraft.entity.passive.MerchantEntity; import net.minecraft.entity.passive.PigEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.entity.player.PlayerEntity; @@ -66,7 +66,7 @@ public class ChangelingFeedAbility implements Ability { private boolean canDrain(Entity e) { return (e instanceof LivingEntity) && (e instanceof CowEntity - || e instanceof AbstractTraderEntity + || e instanceof MerchantEntity || e instanceof PlayerEntity || e instanceof SheepEntity || e instanceof PigEntity diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java index 7db679f3..bee3aba4 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java @@ -168,7 +168,7 @@ public class EarthPonyStompAbility implements Ability { } private static BlockPos getSolidBlockBelow(BlockPos pos, World w) { - while (!World.isHeightInvalid(pos)) { + while (!World.isOutOfBuildLimitVertically(pos)) { pos = pos.down(); if (Block.isFaceFullSquare(w.getBlockState(pos).getCollisionShape(w, pos, ShapeContext.absent()), Direction.UP)) { diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/Disguise.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/Disguise.java index e5a79c61..89e0908e 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/Disguise.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/Disguise.java @@ -323,7 +323,7 @@ public class Disguise implements NbtSerialisable { return; } - if (entity.method_30948()) { + if (entity.isCollidable()) { output.accept(VoxelShapes.cuboid(entity.getBoundingBox())); } else if (entity instanceof FallingBlockEntity) { BlockPos pos = entity.getBlockPos(); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java index 40feebf6..789e9194 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java @@ -3,12 +3,12 @@ package com.minelittlepony.unicopia.entity.behaviour; import com.minelittlepony.unicopia.ability.magic.spell.DisguiseSpell; import com.minelittlepony.unicopia.entity.player.Pony; -import net.minecraft.entity.passive.AbstractTraderEntity; +import net.minecraft.entity.passive.MerchantEntity; import net.minecraft.sound.SoundEvents; -public class TraderBehaviour extends EntityBehaviour { +public class TraderBehaviour extends EntityBehaviour { @Override - public void update(Pony pony, AbstractTraderEntity entity, DisguiseSpell spell) { + public void update(Pony pony, MerchantEntity entity, DisguiseSpell spell) { if (pony.sneakingChanged() && pony.getMaster().isSneaking()) { entity.setHeadRollingTimeLeft(40); diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index 1485dbd7..93a8cb4a 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -60,15 +60,15 @@ public interface UItems { URecipes.bootstrap(); FabricItemGroupBuilder.create(new Identifier("unicopia", "items")).appendItems(list -> { - list.addAll(VanillaOverrides.REGISTRY.stream().map(Item::getStackForRender).collect(Collectors.toList())); - list.addAll(ITEMS.stream().map(Item::getStackForRender).collect(Collectors.toList())); - }).icon(ZAP_APPLE::getStackForRender).build(); + list.addAll(VanillaOverrides.REGISTRY.stream().map(Item::getDefaultStack).collect(Collectors.toList())); + list.addAll(ITEMS.stream().map(Item::getDefaultStack).collect(Collectors.toList())); + }).icon(ZAP_APPLE::getDefaultStack).build(); FabricItemGroupBuilder.create(new Identifier("unicopia", "horsefeed")).appendItems(list -> { list.addAll(Registry.ITEM.stream() .filter(item -> item instanceof ToxicHolder && ((ToxicHolder)item).getToxic().isPresent()) - .map(Item::getStackForRender) + .map(Item::getDefaultStack) .collect(Collectors.toList())); - }).icon(ZAP_APPLE::getStackForRender).build(); + }).icon(ZAP_APPLE::getDefaultStack).build(); } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java index a90f2618..8a5ad90f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ZapAppleRecipe.java @@ -30,7 +30,7 @@ public class ZapAppleRecipe extends ShapelessRecipe { throw new JsonParseException("Too many ingredients for shapeless recipe"); } - ItemStack stack = UItems.ZAP_APPLE.getStackForRender(); + ItemStack stack = UItems.ZAP_APPLE.getDefaultStack(); stack.getOrCreateTag().putString("appearance", JsonHelper.getString(json, "appearance")); return new ZapAppleRecipe(identifier, group, stack, ingredients); diff --git a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java index f23222f8..830fe208 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java @@ -24,7 +24,7 @@ public interface PosHelper { } static BlockPos findSolidGroundAt(World world, BlockPos pos) { - while ((pos.getY() > 0 || !World.isHeightInvalid(pos)) + while ((pos.getY() > 0 || !World.isInBuildLimit(pos)) && (world.isAir(pos) || !world.getBlockState(pos).canPlaceAt(world, pos))) { pos = pos.down(); } diff --git a/src/main/java/com/minelittlepony/unicopia/util/RayTraceHelper.java b/src/main/java/com/minelittlepony/unicopia/util/RayTraceHelper.java index 587567fc..f91dd05a 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/RayTraceHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/RayTraceHelper.java @@ -49,7 +49,7 @@ public class RayTraceHelper { * @return A Trace describing what was found. */ public static Trace doTrace(Entity e, double distance, float tickDelta, Predicate predicate) { - HitResult tracedBlock = e.rayTrace(distance, tickDelta, false); + HitResult tracedBlock = e.raycast(distance, tickDelta, false); final Vec3d start = e.getCameraPosVec(tickDelta); @@ -69,7 +69,7 @@ public class RayTraceHelper { )) { Box entityAABB = entity.getBoundingBox().expand(entity.getTargetingMargin()); - Optional intercept = entityAABB.rayTrace(start, end); + Optional intercept = entityAABB.raycast(start, end); if (entityAABB.contains(start)) { if (traceDistance <= 0) {