Feature/propagate diff and object cleanup (#1190)

* Feature/main/propagate diff annotations (#1187)

* 25% done

* More work

* More work

* 50%

* More work

* 75%

* 100% & cleanup

* Update adapters

* Squish squash, applesauce

commit 275ba9bd84
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Jul 17 01:10:20 2021 +0200

    Update dependency com.comphenix.protocol:ProtocolLib to v4.7.0 (#1173)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 9fd8984804
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Jul 17 01:09:29 2021 +0200

    Update dependency org.checkerframework:checker-qual to v3.16.0 (#1184)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 861fb45e5c
Author: dordsor21 <dordsor21@gmail.com>
Date:   Fri Jul 16 19:07:02 2021 +0100

    Fix #1075

commit 420c45a29a
Author: dordsor21 <dordsor21@gmail.com>
Date:   Fri Jul 16 18:48:21 2021 +0100

    Entity removal should be on the main thread as we're just passing through rather than doing chunk operations
     - Fixes #1164
     - Not working: butcher/remove history

commit 4d4db7dcd0
Author: SirYwell <hannesgreule@outlook.de>
Date:   Fri Jul 16 17:52:44 2021 +0200

    Make sure leaves category is loaded for heightmaps (fixes #1176)

commit c98f6e4f37
Author: dordsor21 <dordsor21@gmail.com>
Date:   Fri Jul 16 10:44:52 2021 +0100

    Do not allow generation commands to generate outside selection

commit 2485f5eccc
Author: dordsor21 <dordsor21@gmail.com>
Date:   Fri Jul 16 10:43:15 2021 +0100

    EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents
    Fixes #1152

commit d9418ec8ae
Author: dordsor21 <dordsor21@gmail.com>
Date:   Fri Jul 16 09:52:44 2021 +0100

    Undo part of 41073bb1a0
    Fixes #1178

* Update Upstream

fb1fb84 Fixed typo and grammar

* We don't support custom heights yet

* Casing inconsistency

* Address a few comments

* Address comments

* Don't refactor to AP classpath

* Document annotation style

* Refactoring & shade cleanup

* Address a few comments

* More work

* Resolve comments not being resolved yet

* Feature/main/propagate diff annotations (#1187) (#1194)

* Remove beta package, fix history packages, move classes out of object package

* Resolve comments not being resolved yet

* Remove beta package, fix history packages, move classes out of object package

Co-authored-by: NotMyFault <mc.cache@web.de>

* brushes should be under brush

* More refactoring
 - Filters/processors should be in the same place and are related to extents
 - Transforms are in `extent.transform` in upstream

* Move history classes under history

* Update adapters

Co-authored-by: dordsor21 <dordsor21@gmail.com>
This commit is contained in:
NotMyFault
2021-07-23 17:48:51 +02:00
committed by GitHub
parent ad102ab7a9
commit 50ab8ad5c7
799 changed files with 4916 additions and 10589 deletions

View File

@ -62,7 +62,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Adapts between Bukkit and WorldEdit equivalent objects.
*/
// FAWE start - enum-ized
//FAWE start - enum-ized
public enum BukkitAdapter {
INSTANCE;
@ -77,7 +77,7 @@ public enum BukkitAdapter {
return INSTANCE.adapter;
}
// FAWE end
//FAWE end
private static final ParserContext TO_BLOCK_CONTEXT = new ParserContext();
@ -93,9 +93,9 @@ public enum BukkitAdapter {
* @return If they are equal
*/
public static boolean equals(BlockType blockType, Material type) {
// FAWE start - swapped reference to getAdapter
//FAWE start - swapped reference to getAdapter
return getAdapter().equals(blockType, type);
// FAWE end
//FAWE end
}
/**
@ -108,9 +108,9 @@ public enum BukkitAdapter {
* @return a wrapped Bukkit world
*/
public static BukkitWorld asBukkitWorld(World world) {
// FAWE start - logic moved to IBukkitAdapter
//FAWE start - logic moved to IBukkitAdapter
return getAdapter().asBukkitWorld(world);
// FAWE end
//FAWE end
}
/**
@ -120,9 +120,9 @@ public enum BukkitAdapter {
* @return a WorldEdit world
*/
public static World adapt(org.bukkit.World world) {
// FAWE start - logic moved to IBukkitAdapter
//FAWE start - logic moved to IBukkitAdapter
return getAdapter().adapt(world);
// FAWE end
//FAWE end
}
/**

View File

@ -146,7 +146,7 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
}
}
// FAWE start
//FAWE start
@Override
public Collection<String> values() {
ArrayList<String> blocks = new ArrayList<>();

View File

@ -21,7 +21,7 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.object.RunnableVal;
import com.fastasyncworldedit.core.util.task.RunnableVal;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.util.StringUtil;
import com.sk89q.wepif.VaultResolver;

View File

@ -25,7 +25,7 @@ import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.extent.inventory.BlockBagException;
import com.sk89q.worldedit.extent.inventory.OutOfBlocksException;
import com.sk89q.worldedit.extent.inventory.OutOfSpaceException;
import com.sk89q.worldedit.extent.inventory.SlottableBlockBag;
import com.fastasyncworldedit.core.extent.inventory.SlottableBlockBag;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BlockState;
import org.bukkit.entity.Player;

View File

@ -19,7 +19,7 @@
package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
import com.google.common.collect.Sets;
import com.sk89q.bukkit.util.CommandInfo;
import com.sk89q.bukkit.util.CommandRegistration;
@ -218,12 +218,12 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
return plugin.getDescription().getVersion();
}
// FAWE start
//FAWE start
@Override
public String getId() {
return "intellectualsites:bukkit";
}
// FAWE end
//FAWE end
@Override
public Map<Capability, Preference> getCapabilities() {

View File

@ -21,8 +21,8 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.bukkit.util.WorldUnloadedException;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.beta.IChunkGet;
import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.sk89q.jnbt.CompoundTag;
@ -311,11 +311,11 @@ public class BukkitWorld extends AbstractWorld {
for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) {
if (treeTypeMapping.get(type) == null) {
LOGGER.error("No TreeType mapping for TreeGenerator.TreeType." + type);
// FAWE start
//FAWE start
LOGGER.warn("Your FAWE version is newer than " + Bukkit.getVersion() +
" and contains features of future minecraft versions which do not exist in "
+ Bukkit.getVersion() + ", hence the tree type " + type + " is not available.");
// FAWE end
//FAWE end
}
}
}

View File

@ -112,7 +112,7 @@ public class WorldEditPlugin extends JavaPlugin {
@Override
public void onLoad() {
// FAWE start
//FAWE start
// This is already covered by Spigot, however, a more pesky warning with a proper explanation over "Ambiguous plugin name..." can't hurt.
Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins();
for (Plugin p : plugins) {
@ -122,7 +122,7 @@ public class WorldEditPlugin extends JavaPlugin {
"Stop your server and delete the 'worldedit-bukkit' jar from your plugins folder.");
}
}
// FAWE end
//FAWE end
INSTANCE = this;

View File

@ -23,9 +23,9 @@ import com.fastasyncworldedit.bukkit.FaweBukkit;
import com.fastasyncworldedit.bukkit.adapter.IBukkitAdapter;
import com.fastasyncworldedit.bukkit.adapter.NMSRelighterFactory;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.beta.IChunkGet;
import com.fastasyncworldedit.core.beta.implementation.lighting.RelighterFactory;
import com.fastasyncworldedit.core.beta.implementation.packet.ChunkPacket;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
import com.fastasyncworldedit.core.queue.implementation.packet.ChunkPacket;
import com.sk89q.jnbt.AdventureNBTConverter;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.blocks.BaseItem;
@ -67,9 +67,9 @@ import javax.annotation.Nullable;
/**
* An interface for adapters of various Bukkit implementations.
*/
// FAWE start - Generic & extends IBukkitAdapter
//FAWE start - Generic & extends IBukkitAdapter
public interface BukkitImplAdapter<T> extends IBukkitAdapter {
// FAWE end
//FAWE end
/**
* Get a data fixer, or null if not supported.
@ -225,10 +225,10 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
Set<SideEffect> getSupportedSideEffects();
default OptionalInt getInternalBlockStateId(BlockData data) {
// FAWE start
//FAWE start
// return OptionalInt.empty();
return getInternalBlockStateId(BukkitAdapter.adapt(data));
// FAWE end
//FAWE end
}
/**
@ -253,7 +253,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
throw new UnsupportedOperationException("This adapter does not support regeneration.");
}
// FAWE start
//FAWE start
default BlockMaterial getMaterial(BlockType blockType) {
return getMaterial(blockType.getDefaultState());
}
@ -306,5 +306,5 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
default RelighterFactory getRelighterFactory() {
return new NMSRelighterFactory(); // TODO implement in adapters instead
}
// FAWE end
//FAWE end
}