WIP - Updating to full 1.13. Will not build.

This commit is contained in:
Florian CUNY 2018-07-31 21:17:10 +02:00
parent 5fa0f590f1
commit 46f22e5467
7 changed files with 114 additions and 51 deletions

View File

@ -607,8 +607,4 @@ public class Settings implements DataObject {
public void setNameMaxLength(int nameMaxLength) {
this.nameMaxLength = nameMaxLength;
}
// Getters and setters
}

View File

@ -165,8 +165,8 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
if (!getSubCommand("help").isPresent() && !label.equals("help")) {
new DefaultHelpCommand(this);
}
}
/*
* This method deals with the command execution. It traverses the tree of
* subcommands until it finds the right object and then runs execute on it.

View File

@ -269,7 +269,6 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
// Run through all the fields in the class that is being stored. EVERY field must have a get and set method
for (Field field : dataObject.getDeclaredFields()) {
// Get the property descriptor for this field
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(field.getName(), dataObject);
// Get the read method, i.e., getXXXX();

View File

@ -32,7 +32,23 @@ public class BlockInteractionListener extends AbstractFlagListener {
case BEACON:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.BEACON);
break;
case BED_BLOCK:
case BLACK_BED:
case BLUE_BED:
case BROWN_BED:
case CYAN_BED:
case GRAY_BED:
case GREEN_BED:
case LIGHT_BLUE_BED:
case LIGHT_GRAY_BED:
case LIME_BED:
case MAGENTA_BED:
case ORANGE_BED:
case PINK_BED:
case PURPLE_BED:
case RED_BED:
case WHITE_BED:
case YELLOW_BED:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.BED);
break;
case BREWING_STAND:
@ -40,7 +56,7 @@ public class BlockInteractionListener extends AbstractFlagListener {
checkIsland(e, e.getClickedBlock().getLocation(), Flags.BREWING);
break;
case CHEST:
case STORAGE_MINECART:
case CHEST_MINECART:
case TRAPPED_CHEST:
case BLACK_SHULKER_BOX:
case BLUE_SHULKER_BOX:
@ -55,7 +71,7 @@ public class BlockInteractionListener extends AbstractFlagListener {
case ORANGE_SHULKER_BOX:
case PURPLE_SHULKER_BOX:
case RED_SHULKER_BOX:
case SILVER_SHULKER_BOX:
case LIGHT_GRAY_SHULKER_BOX:
case WHITE_SHULKER_BOX:
case YELLOW_SHULKER_BOX:
case DISPENSER:
@ -70,31 +86,33 @@ public class BlockInteractionListener extends AbstractFlagListener {
case BIRCH_DOOR:
case DARK_OAK_DOOR:
case IRON_DOOR:
case IRON_DOOR_BLOCK:
case JUNGLE_DOOR:
case SPRUCE_DOOR:
case WOODEN_DOOR:
case WOOD_DOOR:
case OAK_DOOR:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.DOOR);
break;
case TRAP_DOOR:
case ACACIA_TRAPDOOR:
case BIRCH_TRAPDOOR:
case DARK_OAK_TRAPDOOR:
case OAK_TRAPDOOR:
case JUNGLE_TRAPDOOR:
case SPRUCE_TRAPDOOR:
case IRON_TRAPDOOR:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.TRAPDOOR);
break;
case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case FENCE_GATE:
case OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case SPRUCE_FENCE_GATE:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.GATE);
break;
case BURNING_FURNACE:
case FURNACE:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.FURNACE);
break;
case ENCHANTMENT_TABLE:
case ENCHANTING_TABLE:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.ENCHANTING);
break;
case ENDER_CHEST:
@ -106,30 +124,31 @@ public class BlockInteractionListener extends AbstractFlagListener {
case NOTE_BLOCK:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.NOTE_BLOCK);
break;
case WORKBENCH:
case CRAFTING_TABLE:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.CRAFTING);
break;
case STONE_BUTTON:
case WOOD_BUTTON:
case ACACIA_BUTTON:
case BIRCH_BUTTON:
case DARK_OAK_BUTTON:
case JUNGLE_BUTTON:
case OAK_BUTTON:
case SPRUCE_BUTTON:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.BUTTON);
break;
case LEVER:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.LEVER);
break;
case DIODE:
case DIODE_BLOCK_OFF:
case DIODE_BLOCK_ON:
case REDSTONE_COMPARATOR_ON:
case REDSTONE_COMPARATOR_OFF:
case REPEATER:
case COMPARATOR:
case DAYLIGHT_DETECTOR:
case DAYLIGHT_DETECTOR_INVERTED:
case REDSTONE_COMPARATOR:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.REDSTONE);
break;
case DRAGON_EGG:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);
break;
case ENDER_PORTAL_FRAME:
case END_PORTAL_FRAME:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.PLACE_BLOCKS);
break;
case FLOWER_POT:
@ -150,7 +169,57 @@ public class BlockInteractionListener extends AbstractFlagListener {
case ENDER_PEARL:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.ENDER_PEARL);
break;
case MONSTER_EGG:
case BAT_SPAWN_EGG:
case BLAZE_SPAWN_EGG:
case CAVE_SPIDER_SPAWN_EGG:
case CHICKEN_SPAWN_EGG:
case COD_SPAWN_EGG:
case COW_SPAWN_EGG:
case CREEPER_SPAWN_EGG:
case DOLPHIN_SPAWN_EGG:
case DONKEY_SPAWN_EGG:
case DROWNED_SPAWN_EGG:
case ELDER_GUARDIAN_SPAWN_EGG:
case ENDERMAN_SPAWN_EGG:
case ENDERMITE_SPAWN_EGG:
case EVOKER_SPAWN_EGG:
case GHAST_SPAWN_EGG:
case GUARDIAN_SPAWN_EGG:
case HORSE_SPAWN_EGG:
case HUSK_SPAWN_EGG:
case LLAMA_SPAWN_EGG:
case MAGMA_CUBE_SPAWN_EGG:
case MOOSHROOM_SPAWN_EGG:
case MULE_SPAWN_EGG:
case OCELOT_SPAWN_EGG:
case PARROT_SPAWN_EGG:
case PHANTOM_SPAWN_EGG:
case PIG_SPAWN_EGG:
case POLAR_BEAR_SPAWN_EGG:
case PUFFERFISH_SPAWN_EGG:
case RABBIT_SPAWN_EGG:
case SALMON_SPAWN_EGG:
case SHEEP_SPAWN_EGG:
case SHULKER_SPAWN_EGG:
case SILVERFISH_SPAWN_EGG:
case SKELETON_HORSE_SPAWN_EGG:
case SKELETON_SPAWN_EGG:
case SLIME_SPAWN_EGG:
case SPIDER_SPAWN_EGG:
case SQUID_SPAWN_EGG:
case STRAY_SPAWN_EGG:
case TROPICAL_FISH_SPAWN_EGG:
case TURTLE_SPAWN_EGG:
case VEX_SPAWN_EGG:
case VILLAGER_SPAWN_EGG:
case VINDICATOR_SPAWN_EGG:
case WITCH_SPAWN_EGG:
case WITHER_SKELETON_SPAWN_EGG:
case WOLF_SPAWN_EGG:
case ZOMBIE_HORSE_SPAWN_EGG:
case ZOMBIE_PIGMAN_SPAWN_EGG:
case ZOMBIE_SPAWN_EGG:
case ZOMBIE_VILLAGER_SPAWN_EGG:
checkIsland(e, e.getClickedBlock().getLocation(), Flags.SPAWN_EGGS);
break;
default:

View File

@ -63,29 +63,29 @@ public class Flags {
// Block interactions - all use BlockInteractionListener()
public static final Flag ANVIL = new FlagBuilder().id("ANVIL").icon(Material.ANVIL).listener(new BlockInteractionListener()).build();
public static final Flag BEACON = new FlagBuilder().id("BEACON").icon(Material.BEACON).build();
public static final Flag BED = new FlagBuilder().id("BED").icon(Material.BED).build();
public static final Flag BREWING = new FlagBuilder().id("BREWING").icon(Material.BREWING_STAND_ITEM).build();
public static final Flag BED = new FlagBuilder().id("BED").icon(Material.RED_BED).build();
public static final Flag BREWING = new FlagBuilder().id("BREWING").icon(Material.BREWING_STAND).build();
public static final Flag CHEST = new FlagBuilder().id("CHEST").icon(Material.CHEST).build();
public static final Flag DOOR = new FlagBuilder().id("DOOR").allowedByDefault(true).icon(Material.WOOD_DOOR).build();
public static final Flag TRAPDOOR = new FlagBuilder().id("TRAPDOOR").allowedByDefault(true).icon(Material.TRAP_DOOR).build();
public static final Flag CRAFTING = new FlagBuilder().id("CRAFTING").allowedByDefault(true).icon(Material.WORKBENCH).build();
public static final Flag ENCHANTING = new FlagBuilder().id("ENCHANTING").allowedByDefault(true).icon(Material.ENCHANTMENT_TABLE).build();
public static final Flag DOOR = new FlagBuilder().id("DOOR").allowedByDefault(true).icon(Material.OAK_DOOR).build();
public static final Flag TRAPDOOR = new FlagBuilder().id("TRAPDOOR").allowedByDefault(true).icon(Material.OAK_TRAPDOOR).build();
public static final Flag CRAFTING = new FlagBuilder().id("CRAFTING").allowedByDefault(true).icon(Material.CRAFTING_TABLE).build();
public static final Flag ENCHANTING = new FlagBuilder().id("ENCHANTING").allowedByDefault(true).icon(Material.ENCHANTING_TABLE).build();
public static final Flag FURNACE = new FlagBuilder().id("FURNACE").icon(Material.FURNACE).build();
public static final Flag GATE = new FlagBuilder().id("GATE").allowedByDefault(true).icon(Material.FENCE_GATE).build();
public static final Flag GATE = new FlagBuilder().id("GATE").allowedByDefault(true).icon(Material.OAK_FENCE_GATE).build();
public static final Flag NOTE_BLOCK = new FlagBuilder().id("NOTE_BLOCK").icon(Material.NOTE_BLOCK).build();
public static final Flag JUKEBOX = new FlagBuilder().id("JUKEBOX").icon(Material.JUKEBOX).build();
public static final Flag LEVER = new FlagBuilder().id("LEVER").icon(Material.LEVER).build();
public static final Flag BUTTON = new FlagBuilder().id("BUTTON").icon(Material.WOOD_BUTTON).build();
public static final Flag BUTTON = new FlagBuilder().id("BUTTON").icon(Material.OAK_BUTTON).build();
public static final Flag REDSTONE = new FlagBuilder().id("REDSTONE").icon(Material.REDSTONE).build();
public static final Flag SPAWN_EGGS = new FlagBuilder().id("SPAWN_EGGS").icon(Material.MONSTER_EGG).build();
public static final Flag SPAWN_EGGS = new FlagBuilder().id("SPAWN_EGGS").icon(Material.COW_SPAWN_EGG).build();
// Entity interactions
public static final Flag ARMOR_STAND = new FlagBuilder().id("ARMOR_STAND").icon(Material.ARMOR_STAND).listener(new EntityInteractListener()).build();
public static final Flag RIDING = new FlagBuilder().id("RIDING").icon(Material.GOLD_BARDING).build();
public static final Flag RIDING = new FlagBuilder().id("RIDING").icon(Material.GOLDEN_HORSE_ARMOR).build();
public static final Flag TRADING = new FlagBuilder().id("TRADING").allowedByDefault(true).icon(Material.EMERALD).build();
// Breeding
public static final Flag BREEDING = new FlagBuilder().id("BREEDING").icon(Material.CARROT_ITEM).listener(new BreedingListener()).build();
public static final Flag BREEDING = new FlagBuilder().id("BREEDING").icon(Material.CARROT).listener(new BreedingListener()).build();
// Buckets. All bucket use is covered by one listener
public static final Flag BUCKET = new FlagBuilder().id("BUCKET").icon(Material.BUCKET).listener(new BucketListener()).build();
@ -99,7 +99,7 @@ public class Flags {
// Physical interactions
public static final Flag CROP_TRAMPLE = new FlagBuilder().id("CROP_TRAMPLE").icon(Material.WHEAT).listener(new PhysicalInteractionListener()).build();
public static final Flag PRESSURE_PLATE = new FlagBuilder().id("PRESSURE_PLATE").icon(Material.GOLD_PLATE).build();
public static final Flag PRESSURE_PLATE = new FlagBuilder().id("PRESSURE_PLATE").icon(Material.STONE_PRESSURE_PLATE).build();
// Egg throwing
public static final Flag EGGS = new FlagBuilder().id("EGGS").icon(Material.EGG).listener(new EggListener()).build();
@ -118,15 +118,15 @@ public class Flags {
public static final Flag FIRE_EXTINGUISH = new FlagBuilder().id("FIRE_EXTINGUISH").icon(Material.POTION).build();
// Inventories
public static final Flag MOUNT_INVENTORY = new FlagBuilder().id("MOUNT_INVENTORY").icon(Material.IRON_BARDING).listener(new InventoryListener()).build();
public static final Flag MOUNT_INVENTORY = new FlagBuilder().id("MOUNT_INVENTORY").icon(Material.IRON_HORSE_ARMOR).listener(new InventoryListener()).build();
// Hurting things
public static final Flag HURT_ANIMALS = new FlagBuilder().id("HURT_ANIMALS").icon(Material.STONE_SWORD).listener(new HurtingListener()).build();
public static final Flag HURT_MONSTERS = new FlagBuilder().id("HURT_MONSTERS").icon(Material.WOOD_SWORD).build();
public static final Flag HURT_VILLAGERS = new FlagBuilder().id("HURT_VILLAGERS").icon(Material.GOLD_SWORD).build();
public static final Flag HURT_MONSTERS = new FlagBuilder().id("HURT_MONSTERS").icon(Material.WOODEN_SWORD).build();
public static final Flag HURT_VILLAGERS = new FlagBuilder().id("HURT_VILLAGERS").icon(Material.GOLDEN_SWORD).build();
// Leashes
public static final Flag LEASH = new FlagBuilder().id("LEASH").icon(Material.LEASH).listener(new LeashListener()).build();
public static final Flag LEASH = new FlagBuilder().id("LEASH").icon(Material.LEAD).listener(new LeashListener()).build();
// Portal use protection
public static final Flag PORTAL = new FlagBuilder().id("PORTAL").icon(Material.OBSIDIAN).listener(new PortalListener()).build();
@ -161,8 +161,8 @@ public class Flags {
// Others
public static final Flag ANIMAL_SPAWN = new FlagBuilder().id("ANIMAL_SPAWN").icon(Material.APPLE).allowedByDefault(true).type(Type.SETTING)
.listener(new MobSpawnListener()).build();
public static final Flag MONSTER_SPAWN = new FlagBuilder().id("MONSTER_SPAWN").icon(Material.MOB_SPAWNER).allowedByDefault(true).type(Type.SETTING).build();
public static final Flag FIRE_SPREAD = new FlagBuilder().id("FIRE_SPREAD").icon(Material.FIREWORK_CHARGE).allowedByDefault(true).type(Type.SETTING).build();
public static final Flag MONSTER_SPAWN = new FlagBuilder().id("MONSTER_SPAWN").icon(Material.SPAWNER).allowedByDefault(true).type(Type.SETTING).build();
public static final Flag FIRE_SPREAD = new FlagBuilder().id("FIRE_SPREAD").icon(Material.FIREWORK_STAR).allowedByDefault(true).type(Type.SETTING).build();
/*
* World Settings - they apply to every island in the game worlds.
@ -174,7 +174,7 @@ public class Flags {
.listener(new EnderChestListener())
.build();
public static final Flag ENDERMAN_GRIEFING = new FlagBuilder().id("ENDERMAN_GRIEFING").icon(Material.END_BRICKS)
public static final Flag ENDERMAN_GRIEFING = new FlagBuilder().id("ENDERMAN_GRIEFING").icon(Material.END_STONE_BRICKS)
.allowedByDefault(true).type(Type.WORLD_SETTING)
.listener(new EndermanListener())
.build();
@ -187,7 +187,7 @@ public class Flags {
.listener(new EnterExitListener())
.build();
public static final Flag PISTON_PUSH = new FlagBuilder().id("PISTON_PUSH").icon(Material.PISTON_BASE).allowedByDefault(true).type(Type.WORLD_SETTING)
public static final Flag PISTON_PUSH = new FlagBuilder().id("PISTON_PUSH").icon(Material.PISTON).allowedByDefault(true).type(Type.WORLD_SETTING)
.listener(new PistonPushListener())
.build();
@ -207,7 +207,7 @@ public class Flags {
public static final Flag ISLAND_RESPAWN = new FlagBuilder().id("ISLAND_RESPAWN").icon(Material.TORCH).type(Type.WORLD_SETTING)
.listener(new IslandRespawnListener()).allowedByDefault(true).build();
public static final Flag OFFLINE_REDSTONE = new FlagBuilder().id("OFFLINE_REDSTONE").icon(Material.REDSTONE_COMPARATOR).type(Type.WORLD_SETTING)
public static final Flag OFFLINE_REDSTONE = new FlagBuilder().id("OFFLINE_REDSTONE").icon(Material.COMPARATOR).type(Type.WORLD_SETTING)
.listener(new OfflineRedstoneListener()).allowedByDefault(true).build();
public static final Flag CLEAN_SUPER_FLAT = new FlagBuilder().id("CLEAN_SUPER_FLAT").icon(Material.BEDROCK).type(Type.WORLD_SETTING)
@ -220,7 +220,7 @@ public class Flags {
/**
* Prevents creeper griefing. This is where a visitor will trigger a creeper to blow up an island.
*/
public static final Flag CREEPER_GRIEFING = new FlagBuilder().id("CREEPER_GRIEFING").icon(Material.FIREWORK).type(Type.WORLD_SETTING)
public static final Flag CREEPER_GRIEFING = new FlagBuilder().id("CREEPER_GRIEFING").icon(Material.CREEPER_HEAD).type(Type.WORLD_SETTING)
.allowedByDefault(false).build();
/**

View File

@ -40,7 +40,6 @@ import world.bentobox.bentobox.util.teleport.SafeTeleportBuilder;
* It also handles island ownership, including team, trustees, coops, etc.
* The data object that it uses is Island
* @author tastybento
*
*/
public class IslandsManager {

View File

@ -36,7 +36,7 @@ public class HeadGetter {
Iterator<Entry<String, PanelItem>> it = names.entrySet().iterator();
if (it.hasNext()) {
Entry<String, PanelItem> en = it.next();
ItemStack playerSkull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
ItemStack playerSkull = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta meta = (SkullMeta) playerSkull.getItemMeta();
meta.setOwner(en.getKey());
playerSkull.setItemMeta(meta);