1.15.1 build 17

This commit is contained in:
gnembon committed 2019-12-27 23:29:58 -04:00
1 parent be273d419a
commit 025855af42
4 files changed
+11 -10

No files matched your search

@@ -19,9 +19,9 @@ public abstract class Entity_portalSuffocationMixin
@Inject(method = "changeDimension", at = @At( @Inject(method = "changeDimension", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/entity/Entity;getLastPortalDirection()Lnet/minecraft/util/math/Direction;" target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirection()Lnet/minecraft/util/math/Direction;"
)) ))
private void registerEntityDimensionChange(DimensionType dimensionType_1, CallbackInfoReturnable<Entity> cir) private void registerEntityDimensionChange(DimensionType newDimension, CallbackInfoReturnable<Entity> cir)
{ {
if (CarpetSettings.portalSuffocationFix) if (CarpetSettings.portalSuffocationFix)
{ {
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(PlayerEntity.class) @Mixin(PlayerEntity.class)
public abstract class PlayerEntityMixin public abstract class PlayerEntityMixin
{ {
@ModifyConstant(method = "getMaxPortalTime", @ModifyConstant(method = "getMaxNetherPortalTime",
constant = @Constant(intValue = 1)) constant = @Constant(intValue = 1))
private int addFillUpdatesInt(int original) { private int addFillUpdatesInt(int original) {
if (CarpetSettings.portalCreativeDelay) if (CarpetSettings.portalCreativeDelay)
@@ -20,13 +20,13 @@ public class PortalForcer_portalSuffocationMixin
{ {
@Inject(method = "usePortal", at = @At( @Inject(method = "usePortal", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/entity/Entity;getLastPortalDirectionVector()Lnet/minecraft/util/math/Vec3d;" target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirectionVector()Lnet/minecraft/util/math/Vec3d;"
)) ))
private void registerEntityDimensionChange(Entity entity_1, float float_1, CallbackInfoReturnable<Boolean> cir) private void registerEntityDimensionChange(Entity entity, float f, CallbackInfoReturnable<Boolean> cir)
{ {
if (CarpetSettings.portalSuffocationFix) if (CarpetSettings.portalSuffocationFix)
{ {
CarpetSettings.currentTelepotingEntityBox = entity_1.getBoundingBox(); CarpetSettings.currentTelepotingEntityBox = entity.getBoundingBox();
CarpetSettings.fixedPosition = null; CarpetSettings.fixedPosition = null;
} }
} }
@@ -151,7 +151,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
pv.x, pv.y+1.5, pv.z, pv.x, pv.y+1.5, pv.z,
50, 0.1, 0.3, 0.1, 0.0); 50, 0.1, 0.3, 0.1, 0.0);
} }
else if (method_20642((VillagerEntity)(Object)this, poi.getPos())) else if (canReachHome((VillagerEntity)(Object)this, poi.getPos()))
((ServerWorld) getEntityWorld()).spawnParticles(ParticleTypes.END_ROD, ((ServerWorld) getEntityWorld()).spawnParticles(ParticleTypes.END_ROD,
pv.x, pv.y+1, pv.z, pv.x, pv.y+1, pv.z,
50, 0.1, 0.3, 0.1, 0.0); 50, 0.1, 0.3, 0.1, 0.0);
@@ -166,9 +166,10 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
} }
} }
private boolean method_20642(VillagerEntity villagerEntity_1, BlockPos blockPos_1) { // stolen from VillagerBreedTask
Path path_1 = villagerEntity_1.getNavigation().findPathTo(blockPos_1, PointOfInterestType.HOME.method_21648()); private boolean canReachHome(VillagerEntity villager, BlockPos pos) {
return path_1 != null && path_1.reachesTarget(); Path path = villager.getNavigation().findPathTo(pos, PointOfInterestType.HOME.getSearchDistance());
return path != null && path.reachesTarget();
} }