Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-26 16:12:43 +01:00
VV now has these methods
Dieser Commit ist enthalten in:
Ursprung
f75420a642
Commit
8deeda641a
@ -17,7 +17,6 @@ import java.util.Map;
|
||||
public class TranslatableRewriter extends ComponentRewriter {
|
||||
|
||||
private static final Map<String, Map<String, String>> TRANSLATABLES = new HashMap<>();
|
||||
protected final BackwardsProtocol protocol;
|
||||
protected final Map<String, String> newTranslatables;
|
||||
|
||||
public static void loadTranslatables() {
|
||||
@ -36,13 +35,14 @@ public class TranslatableRewriter extends ComponentRewriter {
|
||||
}
|
||||
|
||||
public TranslatableRewriter(BackwardsProtocol protocol, String sectionIdentifier) {
|
||||
this.protocol = protocol;
|
||||
super(protocol);
|
||||
final Map<String, String> newTranslatables = TRANSLATABLES.get(sectionIdentifier);
|
||||
if (newTranslatables == null) {
|
||||
ViaBackwards.getPlatform().getLogger().warning("Error loading " + sectionIdentifier + " translatables!");
|
||||
this.newTranslatables = new HashMap<>();
|
||||
} else
|
||||
} else {
|
||||
this.newTranslatables = newTranslatables;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerPing() {
|
||||
@ -72,22 +72,6 @@ public class TranslatableRewriter extends ComponentRewriter {
|
||||
});
|
||||
}
|
||||
|
||||
public void registerBossBar(ClientboundPacketType packetType) {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.UUID);
|
||||
map(Type.VAR_INT);
|
||||
handler(wrapper -> {
|
||||
int action = wrapper.get(Type.VAR_INT, 0);
|
||||
if (action == 0 || action == 3) {
|
||||
processText(wrapper.passthrough(Type.COMPONENT));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void registerLegacyOpenWindow(ClientboundPacketType packetType) {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
@ -110,35 +94,6 @@ public class TranslatableRewriter extends ComponentRewriter {
|
||||
});
|
||||
}
|
||||
|
||||
public void registerCombatEvent(ClientboundPacketType packetType) {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
if (wrapper.passthrough(Type.VAR_INT) == 2) {
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
wrapper.passthrough(Type.INT);
|
||||
processText(wrapper.passthrough(Type.COMPONENT));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void registerTitle(ClientboundPacketType packetType) {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(wrapper -> {
|
||||
int action = wrapper.passthrough(Type.VAR_INT);
|
||||
if (action >= 0 && action <= 2) {
|
||||
processText(wrapper.passthrough(Type.COMPONENT));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void registerTabList(ClientboundPacketType packetType) {
|
||||
protocol.registerOutgoing(packetType, new PacketRemapper() {
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren