Skip to content

Commit

Permalink
Slight cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Nov 16, 2024
1 parent b7975b6 commit beaa5bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -84,6 +80,10 @@ public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -52,7 +52,7 @@ public void preventNullableEntries(CallbackInfoReturnable<List<RegistryEntry<?>>
}

@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);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/viafabricplus.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -215,8 +216,7 @@
"fixes.viaversion.MixinWorldPacketRewriter1_19",
"viabedrock.MixinJoinPackets",
"vialegacy.MixinExtensionProtocolMetadataStorage",
"vialegacy.MixinViaLegacyConfig",
"fixes.minecraft.network.MixinRegistryEntryList_Named"
"vialegacy.MixinViaLegacyConfig"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit beaa5bb

Please sign in to comment.