better handling of unknown exceptions
This commit is contained in:
1 parent
6e2ee7605f
commit
99835f3474
3 files changed
+44
No files matched your search
@@ -0,0 +1,35 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.settings.CarpetSettings;
|
||||||
|
import net.minecraft.client.network.packet.EntityPositionS2CPacket;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.mob.MobEntity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Entity.class)
|
||||||
|
public abstract class Entity_horseFixMixin
|
||||||
|
{
|
||||||
|
@Shadow private Entity vehicle;
|
||||||
|
|
||||||
|
@Shadow public abstract World getEntityWorld();
|
||||||
|
|
||||||
|
@Inject(method = "stopRiding", at = @At("HEAD"))
|
||||||
|
private void resetNavigation(CallbackInfo ci)
|
||||||
|
{
|
||||||
|
if (vehicle != null && vehicle instanceof MobEntity && CarpetSettings.horseWanderingFix)
|
||||||
|
{
|
||||||
|
((MobEntity) vehicle).getNavigation().stop();
|
||||||
|
if (!getEntityWorld().isClient)
|
||||||
|
{
|
||||||
|
((ServerWorld) getEntityWorld()).method_14178().sendToNearbyPlayers((Entity)(Object)this, new EntityPositionS2CPacket(vehicle));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -401,4 +401,11 @@ public class CarpetSettings
|
|||||||
|
|
||||||
@Rule(desc = "Spawning requires much less CPU and Memory", category = OPTIMIZATION)
|
@Rule(desc = "Spawning requires much less CPU and Memory", category = OPTIMIZATION)
|
||||||
public static boolean lagFreeSpawning = false;
|
public static boolean lagFreeSpawning = false;
|
||||||
|
|
||||||
|
@Rule(
|
||||||
|
desc = "Prevents horses and other mobs to wander into the distance after dismounting",
|
||||||
|
extra = "Fixes issues with various Joergens wandering off and disappearing client-side",
|
||||||
|
category = BUGFIX
|
||||||
|
)
|
||||||
|
public static boolean horseWanderingFix = false;
|
||||||
}
|
}
|
||||||
@@ -81,6 +81,8 @@
|
|||||||
"Entity_portalSuffocationMixin",
|
"Entity_portalSuffocationMixin",
|
||||||
"PortalForcer_portalSuffocationMixin",
|
"PortalForcer_portalSuffocationMixin",
|
||||||
|
|
||||||
|
"Entity_horseFixMixin",
|
||||||
|
|
||||||
"HopperBlockEntityMixin",
|
"HopperBlockEntityMixin",
|
||||||
"ContainerMixin",
|
"ContainerMixin",
|
||||||
"ClientConnectionMixin",
|
"ClientConnectionMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user