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