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;
|
import net.minecraft.network.protocol.game.ClientboundServerDataPacket;
|
||||||
|
|
||||||
public class ChatWrapper19 implements ChatWrapper {
|
public class ChatWrapper19 implements ChatWrapper {
|
||||||
|
|
||||||
|
private static final Reflection.FieldAccessor<Boolean> accessor = Reflection.getField(ClientboundServerDataPacket.class, "c",Boolean.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object stringToChatComponent(String text) {
|
public Object stringToChatComponent(String text) {
|
||||||
return IChatMutableComponent.a(new LiteralContents(text));
|
return IChatMutableComponent.a(new LiteralContents(text));
|
||||||
@ -40,11 +43,7 @@ public class ChatWrapper19 implements ChatWrapper {
|
|||||||
@Override
|
@Override
|
||||||
public Object modifyServerDataPacket(Object o) {
|
public Object modifyServerDataPacket(Object o) {
|
||||||
ClientboundServerDataPacket clientboundServerDataPacket = (ClientboundServerDataPacket) o;
|
ClientboundServerDataPacket clientboundServerDataPacket = (ClientboundServerDataPacket) o;
|
||||||
try{
|
accessor.set(clientboundServerDataPacket,true);
|
||||||
o.getClass().getDeclaredField("c").setBoolean(clientboundServerDataPacket,true);
|
|
||||||
}catch (NoSuchFieldException | IllegalAccessException e) {
|
|
||||||
//ignore
|
|
||||||
}
|
|
||||||
return clientboundServerDataPacket;
|
return clientboundServerDataPacket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren