3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Fix worldDataTrackerHandlerByKey world index

Dieser Commit ist enthalten in:
Nassim Jahnke 2022-08-04 15:51:51 +02:00
Ursprung 0c3a1803e1
Commit c4fa3b0ff8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -286,7 +286,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
@Override @Override
public final Collection<UnsupportedSoftware> getUnsupportedSoftwareClasses() { public final Collection<UnsupportedSoftware> getUnsupportedSoftwareClasses() {
List<UnsupportedSoftware> list = new ArrayList<>(ViaPlatform.super.getUnsupportedSoftwareClasses()); final List<UnsupportedSoftware> list = new ArrayList<>(ViaPlatform.super.getUnsupportedSoftwareClasses());
list.add(new UnsupportedServerSoftware.Builder().name("Yatopia").reason(UnsupportedServerSoftware.Reason.DANGEROUS_SERVER_SOFTWARE) list.add(new UnsupportedServerSoftware.Builder().name("Yatopia").reason(UnsupportedServerSoftware.Reason.DANGEROUS_SERVER_SOFTWARE)
.addClassName("org.yatopiamc.yatopia.server.YatopiaConfig") .addClassName("org.yatopiamc.yatopia.server.YatopiaConfig")
.addClassName("net.yatopia.api.event.PlayerAttackEntityEvent") .addClassName("net.yatopia.api.event.PlayerAttackEntityEvent")

Datei anzeigen

@ -237,7 +237,7 @@ public class ViaManagerImpl implements ViaManager {
private void unsupportedSoftwareWarning() { private void unsupportedSoftwareWarning() {
boolean found = false; boolean found = false;
for (UnsupportedSoftware software : platform.getUnsupportedSoftwareClasses()) { for (final UnsupportedSoftware software : platform.getUnsupportedSoftwareClasses()) {
if (!software.findMatch()) { if (!software.findMatch()) {
continue; continue;
} }

Datei anzeigen

@ -446,10 +446,10 @@ public abstract class EntityRewriter<T extends Protocol> extends RewriterBase<T>
public PacketHandler worldDataTrackerHandlerByKey() { public PacketHandler worldDataTrackerHandlerByKey() {
return wrapper -> { return wrapper -> {
EntityTracker tracker = tracker(wrapper.user()); EntityTracker tracker = tracker(wrapper.user());
String key = wrapper.get(Type.STRING, 0); String dimensionKey = wrapper.get(Type.STRING, 0);
DimensionData dimensionData = tracker.dimensionData(key); DimensionData dimensionData = tracker.dimensionData(dimensionKey);
if (dimensionData == null) { if (dimensionData == null) {
Via.getPlatform().getLogger().severe("Dimension data missing for dimension: " + key + ", falling back to overworld"); Via.getPlatform().getLogger().severe("Dimension data missing for dimension: " + dimensionKey + ", falling back to overworld");
dimensionData = tracker.dimensionData("minecraft:overworld"); dimensionData = tracker.dimensionData("minecraft:overworld");
Preconditions.checkNotNull(dimensionData, "Overworld data missing"); Preconditions.checkNotNull(dimensionData, "Overworld data missing");
} }
@ -457,7 +457,7 @@ public abstract class EntityRewriter<T extends Protocol> extends RewriterBase<T>
tracker.setCurrentWorldSectionHeight(dimensionData.height() >> 4); tracker.setCurrentWorldSectionHeight(dimensionData.height() >> 4);
tracker.setCurrentMinY(dimensionData.minY()); tracker.setCurrentMinY(dimensionData.minY());
String world = wrapper.get(Type.STRING, 0); String world = wrapper.get(Type.STRING, 1);
if (tracker.currentWorld() != null && !tracker.currentWorld().equals(world)) { if (tracker.currentWorld() != null && !tracker.currentWorld().equals(world)) {
tracker.clearEntities(); tracker.clearEntities();
tracker.trackClientEntity(); tracker.trackClientEntity();