mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-21 12:07:38 +01:00
Mapping fixes
This commit is contained in:
parent
b516103a6e
commit
2d1f675834
@ -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
|
||||
|
@ -27,7 +27,6 @@ public class BungeePlugin extends Plugin implements ViaBackwardsPlatform {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// MappingDataLoader.enableMappingsCache();
|
||||
Via.getManager().addEnableListener(() -> this.init(getDataFolder()));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -47,7 +47,6 @@ public class SpongePlugin implements ViaBackwardsPlatform {
|
||||
|
||||
@Listener
|
||||
public void constructPlugin(ConstructPluginEvent event) {
|
||||
// MappingDataLoader.enableMappingsCache();
|
||||
Via.getManager().addEnableListener(() -> this.init(getDataFolder()));
|
||||
}
|
||||
|
||||
|
@ -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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user