Fix worldDataTrackerHandlerByKey world index

This commit is contained in:
Nassim Jahnke 2022-08-04 15:51:51 +02:00
parent 0c3a1803e1
commit c4fa3b0ff8
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
3 changed files with 6 additions and 6 deletions

View File

@ -286,7 +286,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
@Override
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)
.addClassName("org.yatopiamc.yatopia.server.YatopiaConfig")
.addClassName("net.yatopia.api.event.PlayerAttackEntityEvent")

View File

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

View File

@ -446,10 +446,10 @@ public abstract class EntityRewriter<T extends Protocol> extends RewriterBase<T>
public PacketHandler worldDataTrackerHandlerByKey() {
return wrapper -> {
EntityTracker tracker = tracker(wrapper.user());
String key = wrapper.get(Type.STRING, 0);
DimensionData dimensionData = tracker.dimensionData(key);
String dimensionKey = wrapper.get(Type.STRING, 0);
DimensionData dimensionData = tracker.dimensionData(dimensionKey);
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");
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.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)) {
tracker.clearEntities();
tracker.trackClientEntity();