mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Make 1.18 to be effectively in a usable state (#1452)
* Update swathes of easy-to-update-sort-of-code. - Untested - Should compile but NMF broken something - Several todos: - biome history//better support (move to biome sections in core) - regen (haha lol no thanks, someone else can do that) - probably actually do the palette stuff that probably won't work in PaperweightPlatformAdapter * ci: Provide basic Jenkinsfile for ghprb pipeline * build: Update paperweight * upstream: Update Upstream de6fa17 Add getBrush helper for use with instanceof pattern matching (1926) * FAWE will now load on startup * it....works? * Begin to allow biome edits (and fix biomes reverting to plains upon editing blocks) * Add new blocks/block properties * Only create biome palette if supplies is null * Fix biome operations * Finally get removing BlockID done (major version change allows it) * refactor!: Drop PlotSquared v4 Fawe 2.0.0 and newer requires Java 17, PlotSquared v4 supports 1.13 and 1.14, Fawe wont work on these versions nevertheless and refuses to load due Java version incompatiblities with older versions. Newer versions can use PlotSquared v6. * docs: Update readme * Added and removed some comments * Added and removed some comments * refactor: Rename worldedit configuration * build: Re-add 1.17 module This the a very nasty commit * chore: Implement missing methods * build: Update paperweight * upstream: Update upstream 6df194e Remove finalize, use a Cleaner instead (1943) 9843a4f Fix snapshots in 1.18 (1959) * ci: Escape workflows * build: Update paperweight to 1.18.1 * build: Update Paster * Fix compilation * Bump to 1.18.1 * Do both 1.18 and 1.18.1 Co-authored-by: Alex <mc.cache@web.de> * Fix single-block lookups * Reserve ordinals 0 through 3 for air/"reserved" * Create block palette data with values * Fix classpath for testing for starlight * Correctly use block rather than sky light layer [not used in paper] Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
This commit is contained in:
@ -520,7 +520,7 @@ public class BukkitWorld extends AbstractWorld {
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||
if (adapter != null) {
|
||||
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position));
|
||||
return adapter.getFullBlock(BukkitAdapter.adapt(getWorld(), position));
|
||||
} else {
|
||||
return getBlock(position).toBaseBlock();
|
||||
}
|
||||
|
@ -138,12 +138,12 @@ public class WorldEditPlugin extends JavaPlugin {
|
||||
platform = new BukkitServerInterface(this, getServer());
|
||||
worldEdit.getPlatformManager().register(platform);
|
||||
|
||||
//FAWE start - Rename config to config-legacy.yml TODO: Chose a better name in the future
|
||||
createDefaultConfiguration("config-legacy.yml"); // Create the default configuration file for WorldEdit, for us it's 'config-legacy.yml'
|
||||
//FAWE start - Migrate from config-legacy to worldedit-config
|
||||
migrateLegacyConfig();
|
||||
//FAWE end
|
||||
|
||||
//FAWE start - Modify WorldEdit config name
|
||||
config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config-legacy.yml"), true), this);
|
||||
config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "worldedit-config.yml"), true), this);
|
||||
//FAWE end
|
||||
|
||||
//FAWE start - Setup permission attachments
|
||||
@ -422,6 +422,19 @@ public class WorldEditPlugin extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
private void migrateLegacyConfig() {
|
||||
File legacy = new File(getDataFolder(), "config-legacy.yml");
|
||||
if (legacy.exists()) {
|
||||
try {
|
||||
legacy.renameTo(new File(getDataFolder(), "worldedit-config.yml"));
|
||||
LOGGER.info("Migrated config-legacy.yml to worldedit-config.yml");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Unable to rename legacy config file", e);
|
||||
}
|
||||
}
|
||||
createDefaultConfiguration("worldedit-config.yml");
|
||||
}
|
||||
|
||||
private void copyDefaultConfig(InputStream input, File actual, String name) {
|
||||
try (FileOutputStream output = new FileOutputStream(actual)) {
|
||||
byte[] buf = new byte[8192];
|
||||
|
@ -106,7 +106,15 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
|
||||
* @param location the location
|
||||
* @return the block
|
||||
*/
|
||||
BaseBlock getBlock(Location location);
|
||||
BlockState getBlock(Location location);
|
||||
|
||||
/**
|
||||
* Get the block at the given location.
|
||||
*
|
||||
* @param location the location
|
||||
* @return the block
|
||||
*/
|
||||
BaseBlock getFullBlock(Location location);
|
||||
|
||||
/**
|
||||
* Create a {@link WorldNativeAccess} for the given world reference.
|
||||
|
Reference in New Issue
Block a user