Added 1.10 Support (1.10_R1)

This commit is contained in:
Eric 2016-06-09 19:34:48 +02:00
parent 8a08dcb059
commit 8def855a43
8 changed files with 665 additions and 440 deletions

View File

@ -1,421 +1,426 @@
(Source: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html) (Source: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html)
ACACIA_DOOR ACACIA_DOOR
ACACIA_DOOR_ITEM ACACIA_DOOR_ITEM
ACACIA_FENCE ACACIA_FENCE
ACACIA_FENCE_GATE ACACIA_FENCE_GATE
ACACIA_STAIRS ACACIA_STAIRS
ACTIVATOR_RAIL ACTIVATOR_RAIL
AIR AIR
ANVIL ANVIL
APPLE APPLE
ARMOR_STAND ARMOR_STAND
ARROW ARROW
BAKED_POTATO BAKED_POTATO
BANNER BANNER
BARRIER BARRIER
BEACON BEACON
BED BED
BED_BLOCK BED_BLOCK
BEDROCK BEDROCK
BEETROOT BEETROOT
BEETROOT_BLOCK BEETROOT_BLOCK
BEETROOT_SEEDS BEETROOT_SEEDS
BEETROOT_SOUP BEETROOT_SOUP
BIRCH_DOOR BIRCH_DOOR
BIRCH_DOOR_ITEM BIRCH_DOOR_ITEM
BIRCH_FENCE BIRCH_FENCE
BIRCH_FENCE_GATE BIRCH_FENCE_GATE
BIRCH_WOOD_STAIRS BIRCH_WOOD_STAIRS
BLAZE_POWDER BLAZE_POWDER
BLAZE_ROD BLAZE_ROD
BOAT BOAT
BOAT_ACACIA BOAT_ACACIA
BOAT_BIRCH BOAT_BIRCH
BOAT_DARK_OAK BOAT_DARK_OAK
BOAT_JUNGLE BOAT_JUNGLE
BOAT_SPRUCE BOAT_SPRUCE
BONE BONE
BOOK BONE_BLOCK
BOOK_AND_QUILL BOOK
BOOKSHELF BOOK_AND_QUILL
BOW BOOKSHELF
BOWL BOW
BREAD BOWL
BREWING_STAND BREAD
BREWING_STAND_ITEM BREWING_STAND
BRICK BREWING_STAND_ITEM
BRICK_STAIRS BRICK
BROWN_MUSHROOM BRICK_STAIRS
BUCKET BROWN_MUSHROOM
BURNING_FURNACE BUCKET
CACTUS BURNING_FURNACE
CAKE CACTUS
CAKE_BLOCK CAKE
CARPET CAKE_BLOCK
CARROT CARPET
CARROT_ITEM CARROT
CARROT_STICK CARROT_ITEM
CAULDRON CARROT_STICK
CAULDRON_ITEM CAULDRON
CHAINMAIL_BOOTS CAULDRON_ITEM
CHAINMAIL_CHESTPLATE CHAINMAIL_BOOTS
CHAINMAIL_HELMET CHAINMAIL_CHESTPLATE
CHAINMAIL_LEGGINGS CHAINMAIL_HELMET
CHEST CHAINMAIL_LEGGINGS
CHORUS_FLOWER CHEST
CHORUS_FRUIT CHORUS_FLOWER
CHORUS_FRUIT_POPPED CHORUS_FRUIT
CHORUS_PLANT CHORUS_FRUIT_POPPED
CLAY CHORUS_PLANT
CLAY_BALL CLAY
CLAY_BRICK CLAY_BALL
COAL CLAY_BRICK
COAL_BLOCK COAL
COAL_ORE COAL_BLOCK
COBBLE_WALL COAL_ORE
COBBLESTONE COBBLE_WALL
COBBLESTONE_STAIRS COBBLESTONE
COCOA COBBLESTONE_STAIRS
COMMAND COCOA
COMMAND_CHAIN COMMAND
COMMAND_MINECART COMMAND_CHAIN
COMMAND_REPEATING COMMAND_MINECART
COMPASS COMMAND_REPEATING
COOKED_BEEF COMPASS
COOKED_CHICKEN COOKED_BEEF
COOKED_FISH COOKED_CHICKEN
COOKED_MUTTON COOKED_FISH
COOKED_RABBIT COOKED_MUTTON
COOKIE COOKED_RABBIT
CROPS COOKIE
DARK_OAK_DOOR CROPS
DARK_OAK_DOOR_ITEM DARK_OAK_DOOR
DARK_OAK_FENCE DARK_OAK_DOOR_ITEM
DARK_OAK_FENCE_GATE DARK_OAK_FENCE
DARK_OAK_STAIRS DARK_OAK_FENCE_GATE
DAYLIGHT_DETECTOR DARK_OAK_STAIRS
DAYLIGHT_DETECTOR_INVERTED DAYLIGHT_DETECTOR
DEAD_BUSH DAYLIGHT_DETECTOR_INVERTED
DETECTOR_RAIL DEAD_BUSH
DIAMOND DETECTOR_RAIL
DIAMOND_AXE DIAMOND
DIAMOND_BARDING DIAMOND_AXE
DIAMOND_BLOCK DIAMOND_BARDING
DIAMOND_BOOTS DIAMOND_BLOCK
DIAMOND_CHESTPLATE DIAMOND_BOOTS
DIAMOND_HELMET DIAMOND_CHESTPLATE
DIAMOND_HOE DIAMOND_HELMET
DIAMOND_LEGGINGS DIAMOND_HOE
DIAMOND_ORE DIAMOND_LEGGINGS
DIAMOND_PICKAXE DIAMOND_ORE
DIAMOND_SPADE DIAMOND_PICKAXE
DIAMOND_SWORD DIAMOND_SPADE
DIODE DIAMOND_SWORD
DIODE_BLOCK_OFF DIODE
DIODE_BLOCK_ON DIODE_BLOCK_OFF
DIRT DIODE_BLOCK_ON
DISPENSER DIRT
DOUBLE_PLANT DISPENSER
DOUBLE_STEP DOUBLE_PLANT
DOUBLE_STONE_SLAB2 DOUBLE_STEP
DRAGON_EGG DOUBLE_STONE_SLAB2
DRAGONS_BREATH DRAGON_EGG
DROPPER DRAGONS_BREATH
EGG DROPPER
ELYTRA EGG
EMERALD ELYTRA
EMERALD_BLOCK EMERALD
EMERALD_ORE EMERALD_BLOCK
EMPTY_MAP EMERALD_ORE
ENCHANTED_BOOK EMPTY_MAP
ENCHANTMENT_TABLE ENCHANTED_BOOK
END_BRICKS ENCHANTMENT_TABLE
END_CRYSTAL END_BRICKS
END_GATEWAY END_CRYSTAL
END_ROD END_GATEWAY
ENDER_CHEST END_ROD
ENDER_PEARL ENDER_CHEST
ENDER_PORTAL ENDER_PEARL
ENDER_PORTAL_FRAME ENDER_PORTAL
ENDER_STONE ENDER_PORTAL_FRAME
EXP_BOTTLE ENDER_STONE
EXPLOSIVE_MINECART EXP_BOTTLE
EYE_OF_ENDER EXPLOSIVE_MINECART
FEATHER EYE_OF_ENDER
FENCE FEATHER
FENCE_GATE FENCE
FERMENTED_SPIDER_EYE FENCE_GATE
FIRE FERMENTED_SPIDER_EYE
FIREBALL FIRE
FIREWORK FIREBALL
FIREWORK_CHARGE FIREWORK
FISHING_ROD FIREWORK_CHARGE
FLINT FISHING_ROD
FLINT_AND_STEEL FLINT
FLOWER_POT FLINT_AND_STEEL
FLOWER_POT_ITEM FLOWER_POT
FROSTED_ICE FLOWER_POT_ITEM
FURNACE FROSTED_ICE
GHAST_TEAR FURNACE
GLASS GHAST_TEAR
GLASS_BOTTLE GLASS
GLOWING_REDSTONE_ORE GLASS_BOTTLE
GLOWSTONE GLOWING_REDSTONE_ORE
GLOWSTONE_DUST GLOWSTONE
GOLD_AXE GLOWSTONE_DUST
GOLD_BARDING GOLD_AXE
GOLD_BLOCK GOLD_BARDING
GOLD_BOOTS GOLD_BLOCK
GOLD_CHESTPLATE GOLD_BOOTS
GOLD_HELMET GOLD_CHESTPLATE
GOLD_HOE GOLD_HELMET
GOLD_INGOT GOLD_HOE
GOLD_LEGGINGS GOLD_INGOT
GOLD_NUGGET GOLD_LEGGINGS
GOLD_ORE GOLD_NUGGET
GOLD_PICKAXE GOLD_ORE
GOLD_PLATE GOLD_PICKAXE
GOLD_RECORD GOLD_PLATE
GOLD_SPADE GOLD_RECORD
GOLD_SWORD GOLD_SPADE
GOLDEN_APPLE GOLD_SWORD
GOLDEN_CARROT GOLDEN_APPLE
GRASS GOLDEN_CARROT
GRASS_PATH GRASS
GRAVEL GRASS_PATH
GREEN_RECORD GRAVEL
GRILLED_PORK GREEN_RECORD
HARD_CLAY GRILLED_PORK
HAY_BLOCK HARD_CLAY
HOPPER HAY_BLOCK
HOPPER_MINECART HOPPER
HUGE_MUSHROOM_1 HOPPER_MINECART
HUGE_MUSHROOM_2 HUGE_MUSHROOM_1
ICE HUGE_MUSHROOM_2
INK_SACK ICE
IRON_AXE INK_SACK
IRON_BARDING IRON_AXE
IRON_BLOCK IRON_BARDING
IRON_BOOTS IRON_BLOCK
IRON_CHESTPLATE IRON_BOOTS
IRON_DOOR IRON_CHESTPLATE
IRON_DOOR_BLOCK IRON_DOOR
IRON_FENCE IRON_DOOR_BLOCK
IRON_HELMET IRON_FENCE
IRON_HOE IRON_HELMET
IRON_INGOT IRON_HOE
IRON_LEGGINGS IRON_INGOT
IRON_ORE IRON_LEGGINGS
IRON_PICKAXE IRON_ORE
IRON_PLATE IRON_PICKAXE
IRON_SPADE IRON_PLATE
IRON_SWORD IRON_SPADE
IRON_TRAPDOOR IRON_SWORD
ITEM_FRAME IRON_TRAPDOOR
JACK_O_LANTERN ITEM_FRAME
JUKEBOX JACK_O_LANTERN
JUNGLE_DOOR JUKEBOX
JUNGLE_DOOR_ITEM JUNGLE_DOOR
JUNGLE_FENCE JUNGLE_DOOR_ITEM
JUNGLE_FENCE_GATE JUNGLE_FENCE
JUNGLE_WOOD_STAIRS JUNGLE_FENCE_GATE
LADDER JUNGLE_WOOD_STAIRS
LAPIS_BLOCK LADDER
LAPIS_ORE LAPIS_BLOCK
LAVA LAPIS_ORE
LAVA_BUCKET LAVA
LEASH LAVA_BUCKET
LEATHER LEASH
LEATHER_BOOTS LEATHER
LEATHER_CHESTPLATE LEATHER_BOOTS
LEATHER_HELMET LEATHER_CHESTPLATE
LEATHER_LEGGINGS LEATHER_HELMET
LEAVES LEATHER_LEGGINGS
LEAVES_2 LEAVES
LEVER LEAVES_2
LINGERING_POTION LEVER
LOG LINGERING_POTION
LOG_2 LOG
LONG_GRASS LOG_2
MAGMA_CREAM LONG_GRASS
MAP MAGMA
MELON MAGMA_CREAM
MELON_BLOCK MAP
MELON_SEEDS MELON
MELON_STEM MELON_BLOCK
MILK_BUCKET MELON_SEEDS
MINECART MELON_STEM
MOB_SPAWNER MILK_BUCKET
MONSTER_EGG MINECART
MONSTER_EGGS MOB_SPAWNER
MOSSY_COBBLESTONE MONSTER_EGG
MUSHROOM_SOUP MONSTER_EGGS
MUTTON MOSSY_COBBLESTONE
MYCEL MUSHROOM_SOUP
NAME_TAG MUTTON
NETHER_BRICK MYCEL
NETHER_BRICK_ITEM NAME_TAG
NETHER_BRICK_STAIRS NETHER_BRICK
NETHER_FENCE NETHER_BRICK_ITEM
NETHER_STALK NETHER_BRICK_STAIRS
NETHER_STAR NETHER_FENCE
NETHER_WARTS NETHER_STALK
NETHERRACK NETHER_STAR
NOTE_BLOCK NETHER_WART_BLOCK
OBSIDIAN NETHER_WARTS
PACKED_ICE NETHERRACK
PAINTING NOTE_BLOCK
PAPER OBSIDIAN
PISTON_BASE PACKED_ICE
PISTON_EXTENSION PAINTING
PISTON_MOVING_PIECE PAPER
PISTON_STICKY_BASE PISTON_BASE
POISONOUS_POTATO PISTON_EXTENSION
PORK PISTON_MOVING_PIECE
PORTAL PISTON_STICKY_BASE
POTATO POISONOUS_POTATO
POTATO_ITEM PORK
POTION PORTAL
POWERED_MINECART POTATO
POWERED_RAIL POTATO_ITEM
PRISMARINE POTION
PRISMARINE_CRYSTALS POWERED_MINECART
PRISMARINE_SHARD POWERED_RAIL
PUMPKIN PRISMARINE
PUMPKIN_PIE PRISMARINE_CRYSTALS
PUMPKIN_SEEDS PRISMARINE_SHARD
PUMPKIN_STEM PUMPKIN
PURPUR_BLOCK PUMPKIN_PIE
PURPUR_DOUBLE_SLAB PUMPKIN_SEEDS
PURPUR_PILLAR PUMPKIN_STEM
PURPUR_SLAB PURPUR_BLOCK
PURPUR_STAIRS PURPUR_DOUBLE_SLAB
QUARTZ PURPUR_PILLAR
QUARTZ_BLOCK PURPUR_SLAB
QUARTZ_ORE PURPUR_STAIRS
QUARTZ_STAIRS QUARTZ
RABBIT QUARTZ_BLOCK
RABBIT_FOOT QUARTZ_ORE
RABBIT_HIDE QUARTZ_STAIRS
RABBIT_STEW RABBIT
RAILS RABBIT_FOOT
RAW_BEEF RABBIT_HIDE
RAW_CHICKEN RABBIT_STEW
RAW_FISH RAILS
RECORD_10 RAW_BEEF
RECORD_11 RAW_CHICKEN
RECORD_12 RAW_FISH
RECORD_3 RECORD_10
RECORD_4 RECORD_11
RECORD_5 RECORD_12
RECORD_6 RECORD_3
RECORD_7 RECORD_4
RECORD_8 RECORD_5
RECORD_9 RECORD_6
RED_MUSHROOM RECORD_7
RED_ROSE RECORD_8
RED_SANDSTONE RECORD_9
RED_SANDSTONE_STAIRS RED_MUSHROOM
REDSTONE RED_NETHER_BRICK
REDSTONE_BLOCK RED_ROSE
REDSTONE_COMPARATOR RED_SANDSTONE
REDSTONE_COMPARATOR_OFF RED_SANDSTONE_STAIRS
REDSTONE_COMPARATOR_ON REDSTONE
REDSTONE_LAMP_OFF REDSTONE_BLOCK
REDSTONE_LAMP_ON REDSTONE_COMPARATOR
REDSTONE_ORE REDSTONE_COMPARATOR_OFF
REDSTONE_TORCH_OFF REDSTONE_COMPARATOR_ON
REDSTONE_TORCH_ON REDSTONE_LAMP_OFF
REDSTONE_WIRE REDSTONE_LAMP_ON
ROTTEN_FLESH REDSTONE_ORE
SADDLE REDSTONE_TORCH_OFF
SAND REDSTONE_TORCH_ON
SANDSTONE REDSTONE_WIRE
SANDSTONE_STAIRS ROTTEN_FLESH
SAPLING SADDLE
SEA_LANTERN SAND
SEEDS SANDSTONE
SHEARS SANDSTONE_STAIRS
SHIELD SAPLING
SIGN SEA_LANTERN
SIGN_POST SEEDS
SKULL SHEARS
SKULL_ITEM SHIELD
SLIME_BALL SIGN
SLIME_BLOCK SIGN_POST
SMOOTH_BRICK SKULL
SMOOTH_STAIRS SKULL_ITEM
SNOW SLIME_BALL
SNOW_BALL SLIME_BLOCK
SNOW_BLOCK SMOOTH_BRICK
SOIL SMOOTH_STAIRS
SOUL_SAND SNOW
SPECKLED_MELON SNOW_BALL
SPECTRAL_ARROW SNOW_BLOCK
SPIDER_EYE SOIL
SPLASH_POTION SOUL_SAND
SPONGE SPECKLED_MELON
SPRUCE_DOOR SPECTRAL_ARROW
SPRUCE_DOOR_ITEM SPIDER_EYE
SPRUCE_FENCE SPLASH_POTION
SPRUCE_FENCE_GATE SPONGE
SPRUCE_WOOD_STAIRS SPRUCE_DOOR
STAINED_CLAY SPRUCE_DOOR_ITEM
STAINED_GLASS SPRUCE_FENCE
STAINED_GLASS_PANE SPRUCE_FENCE_GATE
STANDING_BANNER SPRUCE_WOOD_STAIRS
STATIONARY_LAVA STAINED_CLAY
STATIONARY_WATER STAINED_GLASS
STEP STAINED_GLASS_PANE
STICK STANDING_BANNER
STONE STATIONARY_LAVA
STONE_AXE STATIONARY_WATER
STONE_BUTTON STEP
STONE_HOE STICK
STONE_PICKAXE STONE
STONE_PLATE STONE_AXE
STONE_SLAB2 STONE_BUTTON
STONE_SPADE STONE_HOE
STONE_SWORD STONE_PICKAXE
STORAGE_MINECART STONE_PLATE
STRING STONE_SLAB2
STRUCTURE_BLOCK STONE_SPADE
SUGAR STONE_SWORD
SUGAR_CANE STORAGE_MINECART
SUGAR_CANE_BLOCK STRING
SULPHUR STRUCTURE_BLOCK
THIN_GLASS STRUCTURE_VOID
TIPPED_ARROW SUGAR
TNT SUGAR_CANE
TORCH SUGAR_CANE_BLOCK
TRAP_DOOR SULPHUR
TRAPPED_CHEST THIN_GLASS
TRIPWIRE TIPPED_ARROW
TRIPWIRE_HOOK TNT
VINE TORCH
WALL_BANNER TRAP_DOOR
WALL_SIGN TRAPPED_CHEST
WATCH TRIPWIRE
WATER TRIPWIRE_HOOK
WATER_BUCKET VINE
WATER_LILY WALL_BANNER
WEB WALL_SIGN
WHEAT WATCH
WOOD WATER
WOOD_AXE WATER_BUCKET
WOOD_BUTTON WATER_LILY
WOOD_DOOR WEB
WOOD_DOUBLE_STEP WHEAT
WOOD_HOE WOOD
WOOD_PICKAXE WOOD_AXE
WOOD_PLATE WOOD_BUTTON
WOOD_SPADE WOOD_DOOR
WOOD_STAIRS WOOD_DOUBLE_STEP
WOOD_STEP WOOD_HOE
WOOD_SWORD WOOD_PICKAXE
WOODEN_DOOR WOOD_PLATE
WOOL WOOD_SPADE
WORKBENCH WOOD_STAIRS
WRITTEN_BOOK WOOD_STEP
YELLOW_FLOWER WOOD_SWORD
WOODEN_DOOR
WOOL
WORKBENCH
WRITTEN_BOOK
YELLOW_FLOWER

View File

@ -2,7 +2,6 @@ package de.epiceric.shopchest;
import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.interfaces.JsonBuilder; import de.epiceric.shopchest.interfaces.JsonBuilder;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.interfaces.jsonbuilder.*; import de.epiceric.shopchest.interfaces.jsonbuilder.*;
import de.epiceric.shopchest.shop.Shop.ShopType; import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.utils.ClickType; import de.epiceric.shopchest.utils.ClickType;
@ -10,6 +9,7 @@ import de.epiceric.shopchest.utils.ClickType.EnumClickType;
import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.UpdateChecker; import de.epiceric.shopchest.utils.UpdateChecker;
import de.epiceric.shopchest.utils.UpdateChecker.UpdateCheckerResult; import de.epiceric.shopchest.utils.UpdateChecker.UpdateCheckerResult;
import de.epiceric.shopchest.utils.Utils;
import net.milkbowl.vault.economy.EconomyResponse; import net.milkbowl.vault.economy.EconomyResponse;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -153,6 +153,9 @@ public class Commands extends BukkitCommand {
case "v1_9_R2": case "v1_9_R2":
jb = new JsonBuilder_1_9_R2(Config.update_available(ShopChest.latestVersion)); jb = new JsonBuilder_1_9_R2(Config.update_available(ShopChest.latestVersion));
break; break;
case "v1_10_R1":
jb = new JsonBuilder_1_10_R1(Config.update_available(ShopChest.latestVersion));
break;
default: default:
return; return;
} }

View File

@ -3,7 +3,6 @@ package de.epiceric.shopchest;
import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.*; import de.epiceric.shopchest.event.*;
import de.epiceric.shopchest.interfaces.JsonBuilder; import de.epiceric.shopchest.interfaces.JsonBuilder;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.interfaces.jsonbuilder.*; import de.epiceric.shopchest.interfaces.jsonbuilder.*;
import de.epiceric.shopchest.shop.Shop; import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType; import de.epiceric.shopchest.shop.Shop.ShopType;
@ -16,6 +15,7 @@ import de.epiceric.shopchest.utils.Metrics.Plotter;
import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.UpdateChecker; import de.epiceric.shopchest.utils.UpdateChecker;
import de.epiceric.shopchest.utils.UpdateChecker.UpdateCheckerResult; import de.epiceric.shopchest.utils.UpdateChecker.UpdateCheckerResult;
import de.epiceric.shopchest.utils.Utils;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -78,6 +78,20 @@ public class ShopChest extends JavaPlugin {
return; return;
} }
switch (Utils.getVersion(getServer())) {
case "v1_8_R1":
case "v1_8_R2":
case "v1_8_R3":
case "v1_9_R1":
case "v1_9_R2":
case "v1_10_R1":
break;
default:
logger.severe("Incompatible Server Version: " + Utils.getVersion(getServer()) + "!");
getServer().getPluginManager().disablePlugin(this);
return;
}
try { try {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);
Graph shopType = metrics.createGraph("Shop Type"); Graph shopType = metrics.createGraph("Shop Type");
@ -153,20 +167,6 @@ public class ShopChest extends JavaPlugin {
database = new MySQL(this); database = new MySQL(this);
} }
switch (Utils.getVersion(getServer())) {
case "v1_8_R1":
case "v1_8_R2":
case "v1_8_R3":
case "v1_9_R1":
case "v1_9_R2":
break;
default:
logger.severe("Incompatible Server Version: " + Utils.getVersion(getServer()) + "!");
getServer().getPluginManager().disablePlugin(this);
return;
}
lockette = getServer().getPluginManager().getPlugin("Lockette") != null; lockette = getServer().getPluginManager().getPlugin("Lockette") != null;
lwc = getServer().getPluginManager().getPlugin("LWC") != null; lwc = getServer().getPluginManager().getPlugin("LWC") != null;
@ -203,6 +203,9 @@ public class ShopChest extends JavaPlugin {
case "v1_9_R2": case "v1_9_R2":
jb = new JsonBuilder_1_9_R2(Config.update_available(latestVersion)); jb = new JsonBuilder_1_9_R2(Config.update_available(latestVersion));
break; break;
case "v1_10_R1":
jb = new JsonBuilder_1_10_R1(Config.update_available(latestVersion));
break;
default: default:
return; return;
} }

View File

@ -3,8 +3,8 @@ package de.epiceric.shopchest.event;
import de.epiceric.shopchest.ShopChest; import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.interfaces.JsonBuilder; import de.epiceric.shopchest.interfaces.JsonBuilder;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.interfaces.jsonbuilder.*; import de.epiceric.shopchest.interfaces.jsonbuilder.*;
import de.epiceric.shopchest.utils.Utils;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -43,6 +43,9 @@ public class NotifyUpdate implements Listener {
case "v1_9_R2": case "v1_9_R2":
jb = new JsonBuilder_1_9_R2(Config.update_available(ShopChest.latestVersion)); jb = new JsonBuilder_1_9_R2(Config.update_available(ShopChest.latestVersion));
break; break;
case "v1_10_R1":
jb = new JsonBuilder_1_10_R1(Config.update_available(ShopChest.latestVersion));
break;
default: default:
return; return;
} }

View File

@ -0,0 +1,94 @@
package de.epiceric.shopchest.interfaces.hologram;
import de.epiceric.shopchest.interfaces.Hologram;
import net.minecraft.server.v1_10_R1.EntityArmorStand;
import net.minecraft.server.v1_10_R1.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_10_R1.PacketPlayOutSpawnEntityLiving;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class Hologram_1_10_R1 implements Hologram {
private boolean exists = false;
private int count;
private List<EntityArmorStand> entitylist = new ArrayList<EntityArmorStand>();
private String[] text;
private Location location;
private double DISTANCE = 0.25D;
private HashMap<OfflinePlayer, Boolean> visible = new HashMap<OfflinePlayer, Boolean>();
public Hologram_1_10_R1(String[] text, Location location) {
this.text = text;
this.location = location;
create();
}
public Location getLocation() {
return location;
}
public List<EntityArmorStand> getEntities() {
return entitylist;
}
public void showPlayer(OfflinePlayer p) {
for (Object o : entitylist) {
EntityArmorStand armor = (EntityArmorStand) o;
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(armor);
((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet);
}
visible.put(p, true);
}
public void hidePlayer(OfflinePlayer p) {
for (Object o : entitylist) {
EntityArmorStand armor = (EntityArmorStand) o;
PacketPlayOutEntityDestroy packet = new PacketPlayOutEntityDestroy(armor.getId());
((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet);
}
visible.put(p, false);
}
public boolean isVisible(OfflinePlayer p) {
if (visible.containsKey(p)) return visible.get(p);
else return false;
}
private void create() {
for (String text : this.text) {
EntityArmorStand entity = new EntityArmorStand(((CraftWorld) this.location.getWorld()).getHandle(), this.location.getX(), this.location.getY(), this.location.getZ());
entity.setCustomName(text);
entity.setCustomNameVisible(true);
entity.setInvisible(true);
entity.setNoGravity(true);
entitylist.add(entity);
this.location.subtract(0, this.DISTANCE, 0);
count++;
}
for (int i = 0; i < count; i++) {
this.location.add(0, this.DISTANCE, 0);
}
count = 0;
exists = true;
}
public boolean exists() {
return exists;
}
public void remove() {
for (EntityArmorStand e : entitylist) {
e.die();
}
exists = false;
}
}

View File

@ -0,0 +1,111 @@
package de.epiceric.shopchest.interfaces.jsonbuilder;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.interfaces.JsonBuilder;
import net.minecraft.server.v1_10_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class JsonBuilder_1_10_R1 implements JsonBuilder {
/* JsonBuilder by FisheyLP */
private List<String> extras = new ArrayList<String>();
public JsonBuilder_1_10_R1(String... text) {
for (String extra : text)
parse(extra);
}
@Override
public JsonBuilder_1_10_R1 parse(String text) {
String regex = "[&<26>]{1}([a-fA-Fl-oL-O0-9]){1}";
text = text.replaceAll(regex, "<EFBFBD>$1");
if (!Pattern.compile(regex).matcher(text).find()) {
withText(text).withHoverEvent(HoverAction.SHOW_TEXT, Config.click_to_download()).withClickEvent(ClickAction.OPEN_URL, ShopChest.downloadLink);
return this;
}
String[] words = text.split(regex);
int index = words[0].length();
for (String word : words) {
try {
if (index != words[0].length())
withText(word).withColor("<EFBFBD>" + text.charAt(index - 1)).withHoverEvent(HoverAction.SHOW_TEXT, Config.click_to_download()).withClickEvent(ClickAction.OPEN_URL, ShopChest.downloadLink);
} catch (Exception e) {
}
index += word.length() + 2;
}
return this;
}
@Override
public JsonBuilder_1_10_R1 withText(String text) {
extras.add("{\"text\":\"" + text + "\"}");
return this;
}
@Override
public JsonBuilder_1_10_R1 withColor(ChatColor color) {
String c = color.name().toLowerCase();
addSegment(color.isColor() ? "\"color\":\"" + c + "\"" : "\"" + c + "\"" + ":true");
return this;
}
@Override
public JsonBuilder_1_10_R1 withColor(String color) {
while (color.length() != 1) color = color.substring(1).trim();
withColor(ChatColor.getByChar(color));
return this;
}
@Override
public JsonBuilder_1_10_R1 withClickEvent(ClickAction action, String value) {
addSegment("\"clickEvent\":{\"action\":\"" + action.toString().toLowerCase()
+ "\",\"value\":\"" + value + "\"}");
return this;
}
@Override
public JsonBuilder_1_10_R1 withHoverEvent(HoverAction action, String value) {
addSegment("\"hoverEvent\":{\"action\":\"" + action.toString().toLowerCase()
+ "\",\"value\":\"" + value + "\"}");
return this;
}
private void addSegment(String segment) {
String lastText = extras.get(extras.size() - 1);
lastText = lastText.substring(0, lastText.length() - 1)
+ "," + segment + "}";
extras.remove(extras.size() - 1);
extras.add(lastText);
}
@Override
public String toString() {
if (extras.size() <= 1) return extras.size() == 0 ? "{\"text\":\"\"}" : extras.get(0);
String text = extras.get(0).substring(0, extras.get(0).length() - 1) + ",\"extra\":[";
extras.remove(0);
for (String extra : extras)
text = text + extra + ",";
text = text.substring(0, text.length() - 1) + "]}";
return text;
}
@Override
public void sendJson(Player p) {
((CraftPlayer) p).getHandle().playerConnection.sendPacket(
new PacketPlayOutChat(ChatSerializer.a(toString())));
}
}

View File

@ -3,9 +3,9 @@ package de.epiceric.shopchest.shop;
import de.epiceric.shopchest.ShopChest; import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.interfaces.Hologram; import de.epiceric.shopchest.interfaces.Hologram;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.interfaces.hologram.*; import de.epiceric.shopchest.interfaces.hologram.*;
import de.epiceric.shopchest.utils.ItemNames; import de.epiceric.shopchest.utils.ItemNames;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -178,8 +178,9 @@ public class Shop {
case "v1_9_R2": case "v1_9_R2":
hologram = new Hologram_1_9_R2(holoText, holoLocation); hologram = new Hologram_1_9_R2(holoText, holoLocation);
break; break;
default: case "v1_10_R1":
return; hologram = new Hologram_1_10_R1(holoText, holoLocation);
break;
} }
} }
@ -218,7 +219,7 @@ public class Shop {
public enum ShopType { public enum ShopType {
NORMAL, NORMAL,
ADMIN; ADMIN
} }
} }

View File

@ -312,6 +312,11 @@ public class ItemNames {
.put("210", "Repeating Command Block") .put("210", "Repeating Command Block")
.put("211", "Chain Command Block") .put("211", "Chain Command Block")
.put("212", "Frosted Ice") .put("212", "Frosted Ice")
.put("213", "Magma Block")
.put("214", "Nether Wart Block")
.put("215", "Red Nether Brick")
.put("216", "Bone Block")
.put("217", "Structure Void")
.put("255", "Structure Block") .put("255", "Structure Block")
.put("256", "Iron Shovel") .put("256", "Iron Shovel")
.put("257", "Iron Pickaxe") .put("257", "Iron Pickaxe")