mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-16 05:43:54 +00:00
Fixed a null pointer. Merged in a bunch of CLI stuff.
This commit is contained in:
@ -32,6 +32,7 @@ import java.io.File;
|
||||
public class BukkitConfiguration extends YAMLConfiguration {
|
||||
|
||||
public boolean noOpPermissions = false;
|
||||
public boolean commandBlockSupport = false;
|
||||
@Unreported private final WorldEditPlugin plugin;
|
||||
|
||||
public BukkitConfiguration(YAMLProcessor config, WorldEditPlugin plugin) {
|
||||
@ -43,6 +44,7 @@ public class BukkitConfiguration extends YAMLConfiguration {
|
||||
public void load() {
|
||||
super.load();
|
||||
noOpPermissions = config.getBoolean("no-op-permissions", false);
|
||||
commandBlockSupport = config.getBoolean("command-block-support", false);
|
||||
migrateLegacyFolders();
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,6 @@ class BukkitRegistries extends BundledRegistries {
|
||||
|
||||
private static final BukkitRegistries INSTANCE = new BukkitRegistries();
|
||||
private final BlockRegistry blockRegistry = new BukkitBlockRegistry();
|
||||
private final ItemRegistry itemRegistry = new BukkitItemRegistry();
|
||||
private final BiomeRegistry biomeRegistry = new BukkitBiomeRegistry();
|
||||
private final EntityRegistry entityRegistry = new BukkitEntityRegistry();
|
||||
private final BlockCategoryRegistry blockCategoryRegistry = new BukkitBlockCategoryRegistry();
|
||||
@ -56,11 +55,6 @@ class BukkitRegistries extends BundledRegistries {
|
||||
return biomeRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemRegistry getItemRegistry() {
|
||||
return itemRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockCategoryRegistry getBlockCategoryRegistry() {
|
||||
return blockCategoryRegistry;
|
||||
|
@ -23,9 +23,11 @@ import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.bukkit.FaweBukkit;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.world.DataFixer;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -33,6 +35,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
|
||||
import java.util.OptionalInt;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@ -154,7 +157,30 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
|
||||
*/
|
||||
void sendFakeOP(Player player);
|
||||
|
||||
/**
|
||||
* Simulates a player using an item.
|
||||
*
|
||||
* @param world the world
|
||||
* @param position the location
|
||||
* @param item the item to be used
|
||||
* @param face the direction in which to "face" when using the item
|
||||
* @return whether the usage was successful
|
||||
*/
|
||||
default boolean simulateItemUse(World world, BlockVector3 position, BaseItem item, Direction face) {
|
||||
return false;
|
||||
}
|
||||
|
||||
default @org.jetbrains.annotations.Nullable World createWorld(WorldCreator creator) {
|
||||
return ((FaweBukkit) Fawe.imp()).createWorldUnloaded(creator::createWorld);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the internal ID for a given state, if possible.
|
||||
*
|
||||
* @param state The block state
|
||||
* @return the internal ID of the state
|
||||
*/
|
||||
default OptionalInt getInternalBlockStateId(BlockState state) {
|
||||
return OptionalInt.empty();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user