Skip to content

Commit

Permalink
Fix Impersonate requiring clientside installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Dec 22, 2024
1 parent c3fbb60 commit 56280f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------
Version 3.2.1
------------------------------------------------------
- Fixed inadvertent clientside requirement from the 1.20.6 port

------------------------------------------------------
Version 3.2.0
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jb_annotations_version = 23.0.0
apiguardian_version = 1.1.2

# Mod Properties
mod_version = 3.2.0
mod_version = 3.2.1
maven_group = org.ladysnake
archives_base_name = impersonate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,34 @@
package org.ladysnake.impersonate.impl;

import com.mojang.authlib.GameProfile;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.registry.RegistryWrapper;
import org.ladysnake.cca.api.v3.component.CopyableComponent;
import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.component.type.ProfileComponent;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtHelper;
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtOps;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodecs;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerRemoveS2CPacket;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.server.PlayerManager;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.ladysnake.cca.api.v3.component.CopyableComponent;
import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent;
import org.ladysnake.impersonate.Impersonate;
import org.ladysnake.impersonate.Impersonator;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;

public class PlayerImpersonator implements Impersonator, AutoSyncedComponent, CopyableComponent<PlayerImpersonator> {

Expand Down Expand Up @@ -192,8 +189,10 @@ public void copyFrom(PlayerImpersonator other, RegistryWrapper.WrapperLookup reg
this.resetImpersonation();
}

private static final int ID_PRESENT = 0b01;
private static final int NAME_PRESENT = 0b10;
@Override
public boolean isRequiredOnClient() {
return false;
}

@Override
public boolean shouldSyncWith(ServerPlayerEntity player) {
Expand Down

0 comments on commit 56280f6

Please sign in to comment.