mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
fix conflicts
This commit is contained in:
@ -458,10 +458,10 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
final Plugin preciousstonesPlugin = Bukkit.getServer().getPluginManager().getPlugin("PreciousStones");
|
||||
if (preciousstonesPlugin != null && preciousstonesPlugin.isEnabled()) {
|
||||
final Plugin preciousStonesPlugin = Bukkit.getServer().getPluginManager().getPlugin("PreciousStones");
|
||||
if (preciousStonesPlugin != null && preciousStonesPlugin.isEnabled()) {
|
||||
try {
|
||||
managers.add(new PreciousStonesFeature(preciousstonesPlugin, this));
|
||||
managers.add(new PreciousStonesFeature(preciousStonesPlugin, this));
|
||||
Fawe.debug("Plugin 'PreciousStones' found. Using it now.");
|
||||
} catch (final Throwable e) {
|
||||
e.printStackTrace();
|
||||
|
@ -284,7 +284,7 @@ public class BukkitQueue extends SimpleCharQueueExtent {
|
||||
}
|
||||
final int[] blockToPalette = FaweCache.BLOCK_TO_PALETTE.get();
|
||||
final int[] paletteToBlock = FaweCache.PALETTE_TO_BLOCK.get();
|
||||
final long[] blockstates = FaweCache.BLOCK_STATES.get();
|
||||
final long[] blockStates = FaweCache.BLOCK_STATES.get();
|
||||
final int[] blocksCopy = FaweCache.SECTION_BLOCKS.get();
|
||||
try {
|
||||
int num_palette = 0;
|
||||
@ -317,9 +317,9 @@ public class BukkitQueue extends SimpleCharQueueExtent {
|
||||
|
||||
final int blockBitArrayEnd = (bitsPerEntry * 4096) >> 6;
|
||||
if (num_palette == 1) {
|
||||
for (int i = 0; i < blockBitArrayEnd; i++) blockstates[i] = 0;
|
||||
for (int i = 0; i < blockBitArrayEnd; i++) blockStates[i] = 0;
|
||||
} else {
|
||||
final BitArray4096 bitArray = new BitArray4096(blockstates, bitsPerEntry);
|
||||
final BitArray4096 bitArray = new BitArray4096(blockStates, bitsPerEntry);
|
||||
bitArray.fromRaw(blocksCopy);
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ public class BukkitQueue extends SimpleCharQueueExtent {
|
||||
final DataPaletteBlock<IBlockData> dataPaletteBlocks = section.getBlocks();
|
||||
// private DataPalette<T> h;
|
||||
// protected DataBits a;
|
||||
final long[] bits = Arrays.copyOfRange(blockstates, 0, blockBitArrayEnd);
|
||||
final long[] bits = Arrays.copyOfRange(blockStates, 0, blockBitArrayEnd);
|
||||
final DataBits nmsBits = new DataBits(bitsPerEntry, 4096, bits);
|
||||
final DataPalette<IBlockData> palette;
|
||||
// palette = new DataPaletteHash<>(Block.REGISTRY_ID, bitsPerEntry, dataPaletteBlocks, GameProfileSerializer::d, GameProfileSerializer::a);
|
||||
|
@ -25,24 +25,24 @@ import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
|
||||
public class BukkitTextAdapter {
|
||||
|
||||
public static String reduceToText(Component component) {
|
||||
StringBuilder text = new StringBuilder();
|
||||
appendTextTo(text, component);
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
private static void appendTextTo(StringBuilder builder, Component component) {
|
||||
if (component instanceof TextComponent) {
|
||||
builder.append(((TextComponent) component).content());
|
||||
} else if (component instanceof TranslatableComponent) {
|
||||
builder.append(((TranslatableComponent) component).key());
|
||||
public static String reduceToText(Component component) {
|
||||
StringBuilder text = new StringBuilder();
|
||||
appendTextTo(text, component);
|
||||
return text.toString();
|
||||
}
|
||||
for (Component child : component.children()) {
|
||||
appendTextTo(builder, child);
|
||||
}
|
||||
}
|
||||
|
||||
private BukkitTextAdapter() {
|
||||
}
|
||||
private static void appendTextTo(StringBuilder builder, Component component) {
|
||||
if (component instanceof TextComponent) {
|
||||
builder.append(((TextComponent) component).content());
|
||||
} else if (component instanceof TranslatableComponent) {
|
||||
builder.append(((TranslatableComponent) component).key());
|
||||
}
|
||||
for (Component child : component.children()) {
|
||||
appendTextTo(builder, child);
|
||||
}
|
||||
}
|
||||
|
||||
private BukkitTextAdapter() {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -199,9 +199,9 @@ public class BukkitWorld extends AbstractWorld {
|
||||
|
||||
// We have to restore the block if it was outside
|
||||
if (!region.contains(pt)) {
|
||||
editSession.setBlock(pt, history[index]);
|
||||
editSession.smartSetBlock(pt, history[index]);
|
||||
} else { // Otherwise fool with history
|
||||
editSession.setBlock().add(new BlockChange(pt, history[index], editSession.getFullBlock(pt)));
|
||||
editSession.getChangeSet().add(new BlockChange(pt, history[index], editSession.getFullBlock(pt)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -420,8 +420,21 @@ public class BukkitWorld extends AbstractWorld {
|
||||
getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally();
|
||||
}
|
||||
|
||||
private static volatile boolean hasWarnedImplError = false;
|
||||
|
||||
@Override
|
||||
public com.sk89q.worldedit.world.block.BlockState getBlock(BlockVector3 position) {
|
||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||
if (adapter != null) {
|
||||
try {
|
||||
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)).toImmutableState();
|
||||
} catch (Exception e) {
|
||||
if (!hasWarnedImplError) {
|
||||
hasWarnedImplError = true;
|
||||
logger.warn("Unable to retrieve block via impl adapter", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import com.bekvon.bukkit.residence.commands.command;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -45,7 +44,6 @@ import org.enginehub.piston.inject.MapBackedValueStore;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to a Player
|
||||
@ -75,8 +73,9 @@ public class WorldEditListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onPlayerCommandSend(PlayerCommandSendEvent event) {
|
||||
InjectedValueStore store = null;
|
||||
// Command processing used to show up in timings
|
||||
CommandManager commandManager = plugin.getWorldEdit().getPlatformManager().getPlatformCommandManager().getCommandManager();
|
||||
InjectedValueStore store = null;
|
||||
Iterator<String> iter = event.getCommands().iterator();
|
||||
while (iter.hasNext()) {
|
||||
String name = iter.next();
|
||||
|
@ -217,7 +217,8 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
public void setupRegistries() {
|
||||
// Biome
|
||||
for (Biome biome : Biome.values()) {
|
||||
BiomeType.REGISTRY.register("minecraft:" + biome.name().toLowerCase(Locale.ROOT), new BiomeType("minecraft:" + biome.name().toLowerCase(Locale.ROOT)));
|
||||
String lowerCaseBiomeName = biome.name().toLowerCase(Locale.ROOT);
|
||||
BiomeType.REGISTRY.register("minecraft:" + lowerCaseBiomeName, new BiomeType("minecraft:" + lowerCaseBiomeName));
|
||||
}
|
||||
// Block & Item
|
||||
for (Material material : Material.values()) {
|
||||
@ -254,7 +255,8 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
for (org.bukkit.entity.EntityType entityType : org.bukkit.entity.EntityType.values()) {
|
||||
String mcid = entityType.getName();
|
||||
if (mcid != null) {
|
||||
EntityType.REGISTRY.register("minecraft:" + mcid.toLowerCase(Locale.ROOT), new EntityType("minecraft:" + mcid.toLowerCase(Locale.ROOT)));
|
||||
String lowerCaseMcId = mcid.toLowerCase(Locale.ROOT);
|
||||
EntityType.REGISTRY.register("minecraft:" + lowerCaseMcId, new EntityType("minecraft:" + lowerCaseMcId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -426,7 +428,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
// code of WorldEdit expects it
|
||||
String[] split = new String[args.length + 1];
|
||||
System.arraycopy(args, 0, split, 1, args.length);
|
||||
split[0] = cmd.getName();
|
||||
split[0] = "/" + cmd.getName();
|
||||
|
||||
CommandEvent event = new CommandEvent(wrapCommandSender(sender), Joiner.on(" ").join(split));
|
||||
getWorldEdit().getEventBus().post(event);
|
||||
@ -441,11 +443,12 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
// code of WorldEdit expects it
|
||||
String[] split = new String[args.length + 1];
|
||||
System.arraycopy(args, 0, split, 1, args.length);
|
||||
split[0] = cmd.getName();
|
||||
split[0] = "/" + cmd.getName();
|
||||
|
||||
CommandSuggestionEvent event = new CommandSuggestionEvent(wrapCommandSender(sender), Joiner.on(" ").join(split));
|
||||
String arguments = Joiner.on(" ").join(split);
|
||||
CommandSuggestionEvent event = new CommandSuggestionEvent(wrapCommandSender(sender), arguments);
|
||||
getWorldEdit().getEventBus().post(event);
|
||||
return event.getSuggestions();
|
||||
return CommandUtil.fixSuggestions(arguments, event.getSuggestions());
|
||||
}
|
||||
*/
|
||||
|
||||
@ -581,13 +584,9 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
|
||||
CommandSuggestionEvent suggestEvent = new CommandSuggestionEvent(wrapCommandSender(event.getSender()), event.getBuffer());
|
||||
getWorldEdit().getEventBus().post(suggestEvent);
|
||||
List<String> suggestions = suggestEvent.getSuggestions();
|
||||
if (suggestions != null && !suggestions.isEmpty()) {
|
||||
event.setCompletions(suggestions);
|
||||
event.setHandled(true);
|
||||
}
|
||||
//event.setCompletions(CommandUtil.fixSuggestions(event.getBuffer(), suggestEvent.getSuggestions()));
|
||||
//event.setHandled(true);
|
||||
|
||||
event.setCompletions(CommandUtil.fixSuggestions(event.getBuffer(), suggestEvent.getSuggestions()));
|
||||
event.setHandled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class BukkitImplLoader {
|
||||
"** will be blank, and so on. There will be no support for entity\n" +
|
||||
"** and block property-related functions.\n" +
|
||||
"**\n" +
|
||||
"** Please see http://wiki.sk89q.com/wiki/WorldEdit/Bukkit_adapters\n" +
|
||||
"** Please see https://worldedit.rtfd.io/en/latest/faq/#bukkit-adapters\n" +
|
||||
"**********************************************\n";
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user