Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Merge branch 'master' into dev
# Conflicts: # bukkit-legacy/src/main/java/com/viaversion/viaversion/bukkit/util/ProtocolSupportUtil.java # bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaInjector.java # bungee/src/main/java/com/viaversion/viaversion/bungee/handlers/BungeeServerHandler.java # bungee/src/main/java/com/viaversion/viaversion/bungee/providers/BungeeVersionProvider.java # common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java # common/src/main/java/com/viaversion/viaversion/update/UpdateUtil.java # velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaInjector.java # velocity/src/main/java/com/viaversion/viaversion/velocity/service/ProtocolDetectorService.java
Dieser Commit ist enthalten in:
Commit
feefe6f278
2
.github/workflows/gradle.yml
vendored
2
.github/workflows/gradle.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
uses: gradle/wrapper-validation-action@v2
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
|
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
uses: gradle/wrapper-validation-action@v2
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
|
@ -25,6 +25,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.ArmorType;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.ClientboundPackets1_9;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -71,7 +72,7 @@ public class ArmorListener extends ViaBukkitListener {
|
||||
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send armor update", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class DeathListener extends ViaBukkitListener {
|
||||
|
||||
@ -66,7 +67,7 @@ public class DeathListener extends ViaBukkitListener {
|
||||
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send death message", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,8 @@ package com.viaversion.viaversion.bukkit.util;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.api.protocol.version.VersionType;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -52,7 +54,7 @@ public final class ProtocolSupportUtil {
|
||||
|
||||
return ProtocolVersion.getProtocol(preNetty ? VersionType.RELEASE_INITIAL : VersionType.RELEASE, id);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to get ProtocolSupport version", e);
|
||||
}
|
||||
return ProtocolVersion.unknown;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -148,7 +149,7 @@ public class PlayerSneakListener extends ViaBukkitListener {
|
||||
try {
|
||||
setSize.invoke(getHandle.invoke(player), DEFAULT_WIDTH, height);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to set player height", e);
|
||||
}
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@
|
||||
package com.viaversion.viaversion.bukkit.listeners.protocol1_15to1_14_4;
|
||||
|
||||
import com.viaversion.viaversion.ViaVersionPlugin;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
@ -26,6 +27,7 @@ import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener;
|
||||
import com.viaversion.viaversion.protocols.protocol1_15to1_14_4.ClientboundPackets1_15;
|
||||
import com.viaversion.viaversion.protocols.protocol1_15to1_14_4.Protocol1_15To1_14_4;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -84,7 +86,7 @@ public class EntityToggleGlideListener extends ViaBukkitListener {
|
||||
packet.write(Types1_14.METADATA_LIST, Arrays.asList(new Metadata(0, Types1_14.META_TYPES.byteType, bitmask)));
|
||||
packet.scheduleSend(Protocol1_15To1_14_4.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send entity glide fix metadata", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
package com.viaversion.viaversion.bukkit.platform;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.bukkit.handlers.BukkitChannelInitializer;
|
||||
import com.viaversion.viaversion.bukkit.util.NMSUtil;
|
||||
@ -31,6 +32,7 @@ import io.netty.channel.ChannelInitializer;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
@ -218,7 +220,7 @@ public class BukkitViaInjector extends LegacyViaInjector {
|
||||
}
|
||||
}
|
||||
} catch (ReflectiveOperationException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to check if ViaVersion is binded", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class BukkitInventoryQuickMoveProvider extends InventoryQuickMoveProvider
|
||||
// send
|
||||
packetMethod.invoke(playerConnection, packet);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to send packet to server", e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -25,6 +25,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.MovementTrac
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.viaversion.viaversion.util.PipelineUtil;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@ -109,7 +110,7 @@ public class BukkitViaMovementTransmitter extends MovementTransmitterProvider {
|
||||
info.get(MovementTracker.class).incrementIdlePacket();
|
||||
}
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to handle idle packet", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -17,12 +17,14 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.bukkit.tasks.protocol1_19to1_18_2;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.Protocol1_19To1_18_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.SequenceStorage;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class AckSequenceTask implements Runnable {
|
||||
|
||||
@ -42,7 +44,7 @@ public final class AckSequenceTask implements Runnable {
|
||||
ackPacket.write(Type.VAR_INT, sequence);
|
||||
ackPacket.scheduleSend(Protocol1_19To1_18_2.class);
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send block changed ack packet", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,14 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.bungee.handlers;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.connection.UserConnectionImpl;
|
||||
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class BungeeChannelInitializer extends ChannelInitializer<Channel> {
|
||||
private final ChannelInitializer<Channel> original;
|
||||
@ -34,7 +36,7 @@ public class BungeeChannelInitializer extends ChannelInitializer<Channel> {
|
||||
this.method = ChannelInitializer.class.getDeclaredMethod("initChannel", Channel.class);
|
||||
this.method.setAccessible(true);
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to get initChannel method", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
@ -109,7 +110,7 @@ public class BungeeServerHandler implements Listener {
|
||||
Object handshake = getHandshake.invoke(event.getPlayer().getPendingConnection());
|
||||
setProtocol.invoke(handshake, protocols == null ? clientProtocolVersion.getVersion() : serverProtocolVersion.getVersion());
|
||||
} catch (InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error setting handshake version", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +119,7 @@ public class BungeeServerHandler implements Listener {
|
||||
try {
|
||||
checkServerChange(event, Via.getManager().getConnectionManager().getConnectedClient(event.getPlayer().getUniqueId()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to handle server switch", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.ClientboundPackets1_
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9;
|
||||
import java.util.Collections;
|
||||
import java.util.logging.Level;
|
||||
import net.md_5.bungee.api.event.ServerConnectedEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
@ -56,7 +57,7 @@ public class ElytraPatch implements Listener {
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send elytra patch metadata packet!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,13 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.bungee.providers;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.ProtocolInfo;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MainHandProvider;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
@ -52,7 +54,7 @@ public class BungeeMainHandProvider extends MainHandProvider {
|
||||
setMainHand.invoke(settings, hand);
|
||||
}
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to set main hand for " + player.getName(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,10 +72,9 @@ public class BungeeVersionProvider extends BaseVersionProvider {
|
||||
try {
|
||||
list = ReflectionUtil.getStatic(ProtocolConstants.class, "SUPPORTED_VERSION_IDS", List.class);
|
||||
return ProtocolVersion.getProtocol(list.get(0));
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchFieldException | IllegalAccessException ignored) {
|
||||
// Fallback
|
||||
return ProtocolVersion.getProtocol(ProxyServer.getInstance().getProtocolVersion());
|
||||
}
|
||||
// Fallback
|
||||
return ProtocolVersion.getProtocol(ProxyServer.getInstance().getProtocolVersion());
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,13 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.bungee.storage;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
public class BungeeStorage implements StorableObject {
|
||||
@ -52,7 +54,7 @@ public class BungeeStorage implements StorableObject {
|
||||
try {
|
||||
bossbar = (Set<UUID>) bossField.get(player);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to get bossbar list", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class CommonBoss implements BossBar {
|
||||
private final UUID uuid;
|
||||
@ -233,7 +234,7 @@ public class CommonBoss implements BossBar {
|
||||
try {
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send bossbar packet", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,7 +270,7 @@ public class CommonBoss implements BossBar {
|
||||
|
||||
return wrapper;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to create bossbar packet", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class BaseProtocol1_7 extends AbstractProtocol<BaseClientboundPacket, Bas
|
||||
|
||||
wrapper.set(Type.STRING, 0, GsonUtil.getGson().toJson(json)); // Update value
|
||||
} catch (JsonParseException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error handling StatusResponse", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class MetadataRewriter1_11To1_10 extends EntityRewriter<ClientboundPacket
|
||||
|
||||
wrapper.send(Protocol1_11To1_10.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to update hologram position", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ClientboundPac
|
||||
import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPackets1_9_3;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class Protocol1_12To1_11_1 extends AbstractProtocol<ClientboundPackets1_9_3, ClientboundPackets1_12, ServerboundPackets1_9_3, ServerboundPackets1_12> {
|
||||
|
||||
@ -105,7 +106,7 @@ public class Protocol1_12To1_11_1 extends AbstractProtocol<ClientboundPackets1_9
|
||||
|
||||
wrapper.set(Type.COMPONENT, 0, obj);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Error converting 1.11.2 -> 1.12 chat item", e);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -70,6 +70,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class Protocol1_13To1_12_2 extends AbstractProtocol<ClientboundPackets1_12_1, ClientboundPackets1_13, ServerboundPackets1_12_1, ServerboundPackets1_13> {
|
||||
|
||||
@ -183,7 +184,7 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol<ClientboundPackets1_1
|
||||
}
|
||||
wrapper.set(Type.STRING, 0, GsonUtil.getGson().toJson(json));
|
||||
} catch (JsonParseException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Error transforming status response", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package com.viaversion.viaversion.protocols.protocol1_13to1_12_2.data;
|
||||
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.util.GsonUtil;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
@ -27,6 +28,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class BlockIdData {
|
||||
public static final String[] PREVIOUS = new String[0];
|
||||
@ -52,7 +54,7 @@ public class BlockIdData {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to load block id mappings (1.12.2 -> 1.13)", e);
|
||||
}
|
||||
|
||||
InputStream blockS = MappingData.class.getClassLoader()
|
||||
@ -65,7 +67,7 @@ public class BlockIdData {
|
||||
);
|
||||
numberIdToString = new Int2ObjectOpenHashMap<>(map);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to load block number to string mappings (1.12.2)", e);
|
||||
}
|
||||
// Ignored
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_12_1to1_12.ServerboundPackets1_12_1;
|
||||
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class TabCompleteTracker implements StorableObject {
|
||||
private int transactionId;
|
||||
@ -43,7 +44,7 @@ public class TabCompleteTracker implements StorableObject {
|
||||
try {
|
||||
wrapper.scheduleSendToServer(Protocol1_13To1_12_2.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send tab complete packet", e);
|
||||
}
|
||||
lastTabComplete = null;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.Compressio
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MainHandProvider;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.ClientChunks;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class PlayerPackets {
|
||||
public static void register(Protocol1_9To1_8 protocol) {
|
||||
@ -43,14 +44,14 @@ public class PlayerPackets {
|
||||
@Override
|
||||
public void register() {
|
||||
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Chat Message (json)
|
||||
map(Type.BYTE); // 1 - Chat Positon
|
||||
map(Type.BYTE); // 1 - Chat Position
|
||||
|
||||
handler(wrapper -> {
|
||||
try {
|
||||
JsonObject obj = (JsonObject) wrapper.get(Type.COMPONENT, 0);
|
||||
ChatRewriter.toClient(obj, wrapper.user());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to transform chat component", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.metadata.MetadataRew
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class SpawnPackets {
|
||||
public static final ValueTransformer<Integer, Double> toNewDouble = new ValueTransformer<Integer, Double>(Type.DOUBLE) {
|
||||
@ -275,7 +276,7 @@ public class SpawnPackets {
|
||||
try {
|
||||
packet.send(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to send entity equipment packet", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -51,6 +51,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
public static final String WITHER_TRANSLATABLE = "{\"translate\":\"entity.WitherBoss.name\"}";
|
||||
@ -101,7 +102,7 @@ public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
try {
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send second hand item", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,7 +330,7 @@ public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to send team packet", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,7 +356,7 @@ public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
try {
|
||||
wrapper.scheduleSend(Protocol1_9To1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to send metadata", e);
|
||||
}
|
||||
}
|
||||
metadataBuffer.remove(entityId);
|
||||
|
@ -63,7 +63,7 @@ public final class ComponentUtil {
|
||||
}
|
||||
|
||||
public static @Nullable Tag jsonToTag(@Nullable final JsonElement element) {
|
||||
if (element == null) {
|
||||
if (element == null || element.isJsonNull()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binäre Datei nicht angezeigt.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
@ -1,7 +1,5 @@
|
||||
import io.papermc.hangarpublishplugin.model.Platforms
|
||||
|
||||
plugins {
|
||||
id("io.papermc.hangar-publish-plugin") version "0.1.0"
|
||||
id("io.papermc.hangar-publish-plugin") version "0.1.2"
|
||||
id("com.modrinth.minotaur") version "2.+"
|
||||
}
|
||||
|
||||
@ -80,15 +78,15 @@ if (!isRelease || isMainBranch) { // Only publish releases from the main branch
|
||||
changelog.set(changelogContent)
|
||||
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
||||
platforms {
|
||||
register(Platforms.PAPER) {
|
||||
paper {
|
||||
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
platformVersions.set(listOf(property("mcVersionRange") as String))
|
||||
}
|
||||
register(Platforms.VELOCITY) {
|
||||
velocity {
|
||||
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
platformVersions.set(listOf(property("velocityVersion") as String))
|
||||
}
|
||||
register(Platforms.WATERFALL) {
|
||||
waterfall {
|
||||
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
||||
platformVersions.set(listOf(property("waterfallVersion") as String))
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.SortedSet;
|
||||
import java.util.logging.Level;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class VelocityViaInjector implements ViaInjector {
|
||||
@ -38,7 +39,7 @@ public class VelocityViaInjector implements ViaInjector {
|
||||
try {
|
||||
return Class.forName("com.velocitypowered.proxy.config.VelocityConfiguration").getMethod("getPlayerInfoForwardingMode");
|
||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to get getPlayerInfoForwardingMode method from Velocity, please report this issue on our GitHub.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import com.viaversion.viaversion.velocity.platform.VelocityViaInjector;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.IntStream;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -37,7 +38,7 @@ public class VelocityVersionProvider extends BaseVersionProvider {
|
||||
try {
|
||||
return Class.forName("com.velocitypowered.proxy.connection.MinecraftConnection").getMethod("getAssociation");
|
||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to get association method from Velocity, please report this issue on our GitHub.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class ProtocolDetectorService extends AbstractProtocolDetectorService {
|
||||
|
||||
@ -90,7 +91,7 @@ public final class ProtocolDetectorService extends AbstractProtocolDetectorServi
|
||||
try {
|
||||
return Via.getManager().getInjector().getServerProtocolVersion();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, "Failed to get lowest supported protocol version", e);
|
||||
return ProtocolVersion.v1_8;
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
package com.viaversion.viaversion.velocity.storage;
|
||||
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.util.ReflectionUtil;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@ -25,6 +26,7 @@ import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class VelocityStorage implements StorableObject {
|
||||
private final Player player;
|
||||
@ -42,7 +44,7 @@ public class VelocityStorage implements StorableObject {
|
||||
getMinecraftConnection = Class.forName("com.velocitypowered.proxy.connection.client.ConnectedPlayer")
|
||||
.getDeclaredMethod("getMinecraftConnection");
|
||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to initialize Velocity bossbar support, bossbars will not work.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +66,7 @@ public class VelocityStorage implements StorableObject {
|
||||
cachedBossbar = (List<UUID>) getServerBossBars.invoke(sessionHandler);
|
||||
}
|
||||
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, "Failed to get bossbar list", e);
|
||||
}
|
||||
}
|
||||
return cachedBossbar;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren