Dieser Commit ist enthalten in:
Ursprung
71f7264789
Commit
3ca4a7d99f
@ -26,6 +26,9 @@ import net.minecraft.network.chat.contents.LiteralContents;
|
||||
import net.minecraft.network.protocol.game.ClientboundServerDataPacket;
|
||||
|
||||
public class ChatWrapper19 implements ChatWrapper {
|
||||
|
||||
private static final Reflection.FieldAccessor<Boolean> accessor = Reflection.getField(ClientboundServerDataPacket.class, "c",Boolean.class);
|
||||
|
||||
@Override
|
||||
public Object stringToChatComponent(String text) {
|
||||
return IChatMutableComponent.a(new LiteralContents(text));
|
||||
@ -40,11 +43,7 @@ public class ChatWrapper19 implements ChatWrapper {
|
||||
@Override
|
||||
public Object modifyServerDataPacket(Object o) {
|
||||
ClientboundServerDataPacket clientboundServerDataPacket = (ClientboundServerDataPacket) o;
|
||||
try{
|
||||
o.getClass().getDeclaredField("c").setBoolean(clientboundServerDataPacket,true);
|
||||
}catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
//ignore
|
||||
}
|
||||
accessor.set(clientboundServerDataPacket,true);
|
||||
return clientboundServerDataPacket;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren