mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-08 19:38:57 +01:00
Slight cleanups
This commit is contained in:
parent
b7975b6544
commit
beaa5bb990
src/main
java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft
resources
@ -24,13 +24,9 @@ import de.florianmichael.viafabricplus.injection.ViaFabricPlusMixinPlugin;
|
||||
import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -67,10 +67,6 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
@Shadow
|
||||
private int ticksSinceLastPositionPacketSent;
|
||||
|
||||
public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
|
||||
super(world, profile);
|
||||
}
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
public ClientPlayNetworkHandler networkHandler;
|
||||
@ -84,6 +80,10 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
@Shadow
|
||||
protected abstract void sendSneakingPacket();
|
||||
|
||||
public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
|
||||
super(world, profile);
|
||||
}
|
||||
|
||||
@WrapWithCondition(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSneakingPacket()V"))
|
||||
private boolean sendSneakingAfterSprinting(ClientPlayerEntity instance) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_21_2);
|
||||
|
@ -42,7 +42,7 @@ public abstract class MixinRegistryEntryList_Named {
|
||||
abstract void setEntries(List<RegistryEntry> entries);
|
||||
|
||||
@Inject(method = "getEntries", at = @At("HEAD"))
|
||||
public void preventNullableEntries(CallbackInfoReturnable<List<RegistryEntry<?>>> cir) {
|
||||
private void preventNullableEntries(CallbackInfoReturnable<List<RegistryEntry<?>>> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
|
||||
// Previoulsy didn't had unbounded entries
|
||||
if (this.entries == null) {
|
||||
@ -52,7 +52,7 @@ public abstract class MixinRegistryEntryList_Named {
|
||||
}
|
||||
|
||||
@Inject(method = "isBound", at = @At("HEAD"), cancellable = true)
|
||||
public void alwaysBound(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void alwaysBound(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
|
||||
// Previously didn't exist
|
||||
cir.setReturnValue(true);
|
||||
|
@ -155,6 +155,7 @@
|
||||
"fixes.minecraft.network.MixinNetworkStateTransitionHandler",
|
||||
"fixes.minecraft.network.MixinNetworkStateTransitions",
|
||||
"fixes.minecraft.network.MixinPlayerListEntry",
|
||||
"fixes.minecraft.network.MixinRegistryEntryList_Named",
|
||||
"fixes.minecraft.network.MixinRegistryEntryListCodec",
|
||||
"fixes.minecraft.network.MixinUpdatePlayerAbilitiesC2SPacket",
|
||||
"fixes.minecraft.screen.MixinAbstractCommandBlockScreen",
|
||||
@ -215,8 +216,7 @@
|
||||
"fixes.viaversion.MixinWorldPacketRewriter1_19",
|
||||
"viabedrock.MixinJoinPackets",
|
||||
"vialegacy.MixinExtensionProtocolMetadataStorage",
|
||||
"vialegacy.MixinViaLegacyConfig",
|
||||
"fixes.minecraft.network.MixinRegistryEntryList_Named"
|
||||
"vialegacy.MixinViaLegacyConfig"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
Loading…
Reference in New Issue
Block a user