Mapping fixes

This commit is contained in:
Nassim Jahnke 2023-03-05 15:21:06 +01:00
parent b516103a6e
commit 2d1f675834
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
16 changed files with 13 additions and 9 deletions

View File

@ -33,8 +33,6 @@ import org.bukkit.plugin.java.JavaPlugin;
public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
public BukkitPlugin() {
// This is the only place we can enable this before ViaVersion is loaded and registers protocols
// MappingDataLoader.enableMappingsCache();
}
@Override

View File

@ -27,7 +27,6 @@ public class BungeePlugin extends Plugin implements ViaBackwardsPlatform {
@Override
public void onLoad() {
// MappingDataLoader.enableMappingsCache();
Via.getManager().addEnableListener(() -> this.init(getDataFolder()));
}

View File

@ -61,6 +61,14 @@ public class BackwardsMappings extends MappingDataBase {
@Override
protected void loadExtras(final CompoundTag data) {
if (vvProtocolClass != null) {
// Reuse item mappings
//TODO rest
final MappingData mappingData = Via.getManager().getProtocolManager().getProtocol(vvProtocolClass).getMappingData();
final BiMappings vvItemMappings = mappingData.getItemMappings();
this.itemMappings = vvItemMappings != null ? vvItemMappings.inverse() : null;
}
final CompoundTag itemNames = data.get("itemnames");
if (itemNames != null) {
backwardsItemMappings = new Int2ObjectOpenHashMap<>(itemNames.size());
@ -120,10 +128,11 @@ public class BackwardsMappings extends MappingDataBase {
return mappings != null ? mappings.createInverse() : null;
}
/*@Override
@Override
protected boolean shouldLoad(final String key) {
return !TO_REUSE.contains(key);
}/*/
return !key.equals("items");
//return !TO_REUSE.contains(key); //TODO
}
/**
* @see #getMappedItem(int) for custom backwards mappings

View File

@ -157,6 +157,6 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
@Override
protected boolean shouldLoad(final String key) {
return super.shouldLoad(key) && !key.equals("blocks");
return !key.equals("blocks");
}
}

View File

@ -47,7 +47,6 @@ public class SpongePlugin implements ViaBackwardsPlatform {
@Listener
public void constructPlugin(ConstructPluginEvent event) {
// MappingDataLoader.enableMappingsCache();
Via.getManager().addEnableListener(() -> this.init(getDataFolder()));
}

View File

@ -52,7 +52,6 @@ public class VelocityPlugin implements ViaBackwardsPlatform {
@Subscribe(order = PostOrder.LATE)
public void onProxyStart(ProxyInitializeEvent event) {
this.logger = new LoggerWrapper(loggerSlf4j);
// MappingDataLoader.enableMappingsCache();
Via.getManager().addEnableListener(() -> this.init(getDataFolder()));
}