mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Use DFUs for some additional data fixing.
Legacy mapper now uses the data fixers to upgrade blocks and item types (e.g. signs, dyes that changed names in 1.14). The sponge schematic reader can now attempt to use the data fixers to upgrade blocks, block entities, biomes and entities. This has been tested with the 1.13 -> 1.14 changes. It is yet to be seen if it will continue to work because... The mc edit schematic reader has code for using data fixers, but it is currently disabled as there seem to be some issues with fixing up older block entities.
This commit is contained in:
@ -58,6 +58,10 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.world.WorldInitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -102,11 +106,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
// Setup platform
|
||||
server = new BukkitServerInterface(this, getServer());
|
||||
worldEdit.getPlatformManager().register(server);
|
||||
loadAdapter(); // Need an adapter to work with special blocks with NBT data
|
||||
setupRegistries();
|
||||
worldEdit.loadMappings();
|
||||
|
||||
loadConfig(); // Load configuration
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,8 +113,6 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
*/
|
||||
@Override
|
||||
public void onEnable() {
|
||||
setupTags(); // these have to be done post-world since they rely on MC registries. the other ones just use Bukkit enums
|
||||
|
||||
PermissionsResolverManager.initialize(this); // Setup permission resolver
|
||||
|
||||
// Register CUI
|
||||
@ -125,10 +122,8 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
// Now we can register events
|
||||
getServer().getPluginManager().registerEvents(new WorldEditListener(this), this);
|
||||
|
||||
// If we are on MCPC+/Cauldron, then Forge will have already loaded
|
||||
// Forge WorldEdit and there's (probably) not going to be any other
|
||||
// platforms to be worried about... at the current time of writing
|
||||
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
|
||||
// register this so we can load world-dependent data right as the first world is loading
|
||||
getServer().getPluginManager().registerEvents(new WorldInitListener(), this);
|
||||
|
||||
// Enable metrics
|
||||
new Metrics(this);
|
||||
@ -433,4 +428,20 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
return bukkitAdapter;
|
||||
}
|
||||
|
||||
private class WorldInitListener implements Listener {
|
||||
private boolean loaded = false;
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onWorldInit(@SuppressWarnings("unused") WorldInitEvent event) {
|
||||
if (loaded) return;
|
||||
loaded = true;
|
||||
|
||||
loadAdapter(); // Need an adapter to work with special blocks with NBT data
|
||||
setupRegistries();
|
||||
WorldEdit.getInstance().loadMappings();
|
||||
loadConfig(); // Load configuration
|
||||
setupTags();
|
||||
|
||||
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
name: WorldEdit
|
||||
main: com.sk89q.worldedit.bukkit.WorldEditPlugin
|
||||
version: "${internalVersion}"
|
||||
load: STARTUP
|
||||
api-version: 1.13
|
||||
|
||||
# Permissions aren't here. Read http://wiki.sk89q.com/wiki/WEPIF/DinnerPerms
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user