Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Clean up some code in Base and MetaIndex
Dieser Commit ist enthalten in:
Ursprung
bae3599388
Commit
eccbb567e8
@ -41,8 +41,6 @@ public class BaseProtocol extends Protocol {
|
|||||||
JSONObject json = (JSONObject) new JSONParser().parse(originalStatus);
|
JSONObject json = (JSONObject) new JSONParser().parse(originalStatus);
|
||||||
JSONObject version = (JSONObject) json.get("version");
|
JSONObject version = (JSONObject) json.get("version");
|
||||||
|
|
||||||
System.out.println("Calculating " + info.getProtocolVersion());
|
|
||||||
// TODO: Make it so the detection doesn't base off just ping :)
|
|
||||||
if (ProtocolRegistry.SERVER_PROTOCOL == -1) {
|
if (ProtocolRegistry.SERVER_PROTOCOL == -1) {
|
||||||
Long original = (Long) version.get("protocol");
|
Long original = (Long) version.get("protocol");
|
||||||
ProtocolRegistry.SERVER_PROTOCOL = original.intValue();
|
ProtocolRegistry.SERVER_PROTOCOL = original.intValue();
|
||||||
@ -151,6 +149,7 @@ public class BaseProtocol extends Protocol {
|
|||||||
@Override
|
@Override
|
||||||
protected void registerListeners() {
|
protected void registerListeners() {
|
||||||
final ViaVersionPlugin plugin = (ViaVersionPlugin) Bukkit.getPluginManager().getPlugin("ViaVersion");
|
final ViaVersionPlugin plugin = (ViaVersionPlugin) Bukkit.getPluginManager().getPlugin("ViaVersion");
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(new Listener() {
|
Bukkit.getPluginManager().registerEvents(new Listener() {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent e) {
|
public void onPlayerQuit(PlayerQuitEvent e) {
|
||||||
|
@ -59,7 +59,7 @@ public enum MetaIndex {
|
|||||||
// sheep
|
// sheep
|
||||||
SHEEP_COLOR(Sheep.class, 16, Type.Byte, 12, NewType.Byte),
|
SHEEP_COLOR(Sheep.class, 16, Type.Byte, 12, NewType.Byte),
|
||||||
// villager
|
// villager
|
||||||
VILLAGER_PROFESSION(Villager.class, 16, Type.Int, 12, NewType.VarInt), // TODO write this to wiki.vg
|
VILLAGER_PROFESSION(Villager.class, 16, Type.Int, 12, NewType.VarInt),
|
||||||
// enderman
|
// enderman
|
||||||
ENDERMAN_BLOCK(Enderman.class, 16, Type.Short, 11, NewType.BlockID), // special case
|
ENDERMAN_BLOCK(Enderman.class, 16, Type.Short, 11, NewType.BlockID), // special case
|
||||||
ENDERMAN_BLOCKDATA(Enderman.class, 17, Type.Byte, 11, NewType.BlockID), // special case
|
ENDERMAN_BLOCKDATA(Enderman.class, 17, Type.Byte, 11, NewType.BlockID), // special case
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren