1.15.1 build 17
This commit is contained in:
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(
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
@Mixin(PlayerEntity.class)
|
||||
public abstract class PlayerEntityMixin
|
||||
{
|
||||
@ModifyConstant(method = "getMaxPortalTime",
|
||||
@ModifyConstant(method = "getMaxNetherPortalTime",
|
||||
constant = @Constant(intValue = 1))
|
||||
private int addFillUpdatesInt(int original) {
|
||||
if (CarpetSettings.portalCreativeDelay)
|
||||
|
||||
@@ -20,13 +20,13 @@ public class PortalForcer_portalSuffocationMixin
|
||||
{
|
||||
@Inject(method = "usePortal", at = @At(
|
||||
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)
|
||||
{
|
||||
CarpetSettings.currentTelepotingEntityBox = entity_1.getBoundingBox();
|
||||
CarpetSettings.currentTelepotingEntityBox = entity.getBoundingBox();
|
||||
CarpetSettings.fixedPosition = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
|
||||
pv.x, pv.y+1.5, pv.z,
|
||||
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,
|
||||
pv.x, pv.y+1, pv.z,
|
||||
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) {
|
||||
Path path_1 = villagerEntity_1.getNavigation().findPathTo(blockPos_1, PointOfInterestType.HOME.method_21648());
|
||||
return path_1 != null && path_1.reachesTarget();
|
||||
// stolen from VillagerBreedTask
|
||||
private boolean canReachHome(VillagerEntity villager, BlockPos pos) {
|
||||
Path path = villager.getNavigation().findPathTo(pos, PointOfInterestType.HOME.getSearchDistance());
|
||||
return path != null && path.reachesTarget();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user