Merge remote-tracking branch 'upstream/master' into fix-illegal-items-in-chests

This commit is contained in:
Aleksander Jagiello 2020-08-01 00:07:27 +02:00
commit d4be957464
55 changed files with 1340 additions and 538 deletions

Binary file not shown.

25
pom.xml
View File

@ -87,13 +87,17 @@
<id>nlthijs48-repo</id>
<url>http://maven.wiefferink.me</url>
</repository>
<repository>
<id>plotsquared-repo</id>
<url>https://mvn.intellectualsites.com/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15-R0.1-SNAPSHOT</version>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -109,9 +113,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.intellectualsites.plotsquared</groupId>
<artifactId>PlotSquared-API</artifactId>
<version>4.226</version>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared</artifactId>
<version>5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -158,7 +162,14 @@
<scope>system</scope>
<systemPath>${project.basedir}/lib/IslandWorld-8.5.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.intellectualsites.plotsquared</groupId>
<artifactId>PlotSquared-API</artifactId>
<version>4.495</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PlotSquared-Bukkit-4.4.495.jar</systemPath>
</dependency>
<!-- Shaded dependencies -->
<dependency>
<groupId>org.codemc.worldguardwrapper</groupId>

View File

@ -16,6 +16,7 @@ block.minecraft.acacia_wood
block.minecraft.activator_rail
block.minecraft.air
block.minecraft.allium
block.minecraft.ancient_debris
block.minecraft.andesite
block.minecraft.andesite_slab
block.minecraft.andesite_stairs
@ -28,6 +29,7 @@ block.minecraft.bamboo
block.minecraft.bamboo_sapling
block.minecraft.barrel
block.minecraft.barrier
block.minecraft.basalt
block.minecraft.beacon
block.minecraft.bedrock
block.minecraft.bee_nest
@ -59,6 +61,10 @@ block.minecraft.black_stained_glass
block.minecraft.black_stained_glass_pane
block.minecraft.black_terracotta
block.minecraft.black_wool
block.minecraft.blackstone
block.minecraft.blackstone_slab
block.minecraft.blackstone_stairs
block.minecraft.blackstone_wall
block.minecraft.blast_furnace
block.minecraft.blue_bed
block.minecraft.blue_carpet
@ -106,9 +112,12 @@ block.minecraft.cartography_table
block.minecraft.carved_pumpkin
block.minecraft.cauldron
block.minecraft.cave_air
block.minecraft.chain
block.minecraft.chain_command_block
block.minecraft.chest
block.minecraft.chipped_anvil
block.minecraft.chiseled_nether_bricks
block.minecraft.chiseled_polished_blackstone
block.minecraft.chiseled_quartz_block
block.minecraft.chiseled_red_sandstone
block.minecraft.chiseled_sandstone
@ -130,10 +139,29 @@ block.minecraft.comparator
block.minecraft.composter
block.minecraft.conduit
block.minecraft.cornflower
block.minecraft.cracked_nether_bricks
block.minecraft.cracked_polished_blackstone_bricks
block.minecraft.cracked_stone_bricks
block.minecraft.crafting_table
block.minecraft.creeper_head
block.minecraft.creeper_wall_head
block.minecraft.crimson_button
block.minecraft.crimson_door
block.minecraft.crimson_fence
block.minecraft.crimson_fence_gate
block.minecraft.crimson_fungus
block.minecraft.crimson_hyphae
block.minecraft.crimson_nylium
block.minecraft.crimson_planks
block.minecraft.crimson_pressure_plate
block.minecraft.crimson_roots
block.minecraft.crimson_sign
block.minecraft.crimson_slab
block.minecraft.crimson_stairs
block.minecraft.crimson_stem
block.minecraft.crimson_trapdoor
block.minecraft.crimson_wall_sign
block.minecraft.crying_obsidian
block.minecraft.cut_red_sandstone
block.minecraft.cut_red_sandstone_slab
block.minecraft.cut_sandstone
@ -217,6 +245,7 @@ block.minecraft.fletching_table
block.minecraft.flower_pot
block.minecraft.frosted_ice
block.minecraft.furnace
block.minecraft.gilded_blackstone
block.minecraft.glass
block.minecraft.glass_pane
block.minecraft.glowstone
@ -333,6 +362,7 @@ block.minecraft.lime_stained_glass
block.minecraft.lime_stained_glass_pane
block.minecraft.lime_terracotta
block.minecraft.lime_wool
block.minecraft.lodestone
block.minecraft.loom
block.minecraft.magenta_bed
block.minecraft.magenta_carpet
@ -363,10 +393,13 @@ block.minecraft.nether_brick_slab
block.minecraft.nether_brick_stairs
block.minecraft.nether_brick_wall
block.minecraft.nether_bricks
block.minecraft.nether_gold_ore
block.minecraft.nether_portal
block.minecraft.nether_quartz_ore
block.minecraft.nether_sprouts
block.minecraft.nether_wart
block.minecraft.nether_wart_block
block.minecraft.netherite_block
block.minecraft.netherrack
block.minecraft.note_block
block.minecraft.oak_button
@ -420,6 +453,17 @@ block.minecraft.podzol
block.minecraft.polished_andesite
block.minecraft.polished_andesite_slab
block.minecraft.polished_andesite_stairs
block.minecraft.polished_basalt
block.minecraft.polished_blackstone
block.minecraft.polished_blackstone_brick_slab
block.minecraft.polished_blackstone_brick_stairs
block.minecraft.polished_blackstone_brick_wall
block.minecraft.polished_blackstone_bricks
block.minecraft.polished_blackstone_button
block.minecraft.polished_blackstone_pressure_plate
block.minecraft.polished_blackstone_slab
block.minecraft.polished_blackstone_stairs
block.minecraft.polished_blackstone_wall
block.minecraft.polished_diorite
block.minecraft.polished_diorite_slab
block.minecraft.polished_diorite_stairs
@ -437,6 +481,8 @@ block.minecraft.potted_blue_orchid
block.minecraft.potted_brown_mushroom
block.minecraft.potted_cactus
block.minecraft.potted_cornflower
block.minecraft.potted_crimson_fungus
block.minecraft.potted_crimson_roots
block.minecraft.potted_dandelion
block.minecraft.potted_dark_oak_sapling
block.minecraft.potted_dead_bush
@ -451,6 +497,8 @@ block.minecraft.potted_poppy
block.minecraft.potted_red_mushroom
block.minecraft.potted_red_tulip
block.minecraft.potted_spruce_sapling
block.minecraft.potted_warped_fungus
block.minecraft.potted_warped_roots
block.minecraft.potted_white_tulip
block.minecraft.potted_wither_rose
block.minecraft.powered_rail
@ -478,6 +526,7 @@ block.minecraft.purpur_pillar
block.minecraft.purpur_slab
block.minecraft.purpur_stairs
block.minecraft.quartz_block
block.minecraft.quartz_bricks
block.minecraft.quartz_pillar
block.minecraft.quartz_slab
block.minecraft.quartz_stairs
@ -512,6 +561,7 @@ block.minecraft.redstone_wall_torch
block.minecraft.redstone_wire
block.minecraft.repeater
block.minecraft.repeating_command_block
block.minecraft.respawn_anchor
block.minecraft.rose_bush
block.minecraft.sand
block.minecraft.sandstone
@ -522,6 +572,7 @@ block.minecraft.scaffolding
block.minecraft.sea_lantern
block.minecraft.sea_pickle
block.minecraft.seagrass
block.minecraft.shroomlight
block.minecraft.shulker_box
block.minecraft.skeleton_skull
block.minecraft.skeleton_wall_skull
@ -541,7 +592,13 @@ block.minecraft.smooth_stone
block.minecraft.smooth_stone_slab
block.minecraft.snow
block.minecraft.snow_block
block.minecraft.soul_campfire
block.minecraft.soul_fire
block.minecraft.soul_lantern
block.minecraft.soul_sand
block.minecraft.soul_soil
block.minecraft.soul_torch
block.minecraft.soul_wall_torch
block.minecraft.spawner
block.minecraft.sponge
block.minecraft.spruce_button
@ -573,6 +630,8 @@ block.minecraft.stripped_acacia_log
block.minecraft.stripped_acacia_wood
block.minecraft.stripped_birch_log
block.minecraft.stripped_birch_wood
block.minecraft.stripped_crimson_hyphae
block.minecraft.stripped_crimson_stem
block.minecraft.stripped_dark_oak_log
block.minecraft.stripped_dark_oak_wood
block.minecraft.stripped_jungle_log
@ -581,6 +640,8 @@ block.minecraft.stripped_oak_log
block.minecraft.stripped_oak_wood
block.minecraft.stripped_spruce_log
block.minecraft.stripped_spruce_wood
block.minecraft.stripped_warped_hyphae
block.minecraft.stripped_warped_stem
block.minecraft.structure_block
block.minecraft.structure_void
block.minecraft.sugar_cane
@ -588,6 +649,7 @@ block.minecraft.sunflower
block.minecraft.sweet_berry_bush
block.minecraft.tall_grass
block.minecraft.tall_seagrass
block.minecraft.target
block.minecraft.terracotta
block.minecraft.tnt
block.minecraft.torch
@ -598,11 +660,32 @@ block.minecraft.tube_coral
block.minecraft.tube_coral_block
block.minecraft.tube_coral_fan
block.minecraft.turtle_egg
block.minecraft.twisting_vines
block.minecraft.twisting_vines_plant
block.minecraft.vine
block.minecraft.void_air
block.minecraft.wall_sign
block.minecraft.wall_torch
block.minecraft.warped_button
block.minecraft.warped_door
block.minecraft.warped_fence
block.minecraft.warped_fence_gate
block.minecraft.warped_fungus
block.minecraft.warped_hyphae
block.minecraft.warped_nylium
block.minecraft.warped_planks
block.minecraft.warped_pressure_plate
block.minecraft.warped_roots
block.minecraft.warped_sign
block.minecraft.warped_slab
block.minecraft.warped_stairs
block.minecraft.warped_stem
block.minecraft.warped_trapdoor
block.minecraft.warped_wall_sign
block.minecraft.warped_wart_block
block.minecraft.water
block.minecraft.weeping_vines
block.minecraft.weeping_vines_plant
block.minecraft.wet_sponge
block.minecraft.wheat
block.minecraft.white_bed
@ -853,6 +936,7 @@ item.minecraft.green_dye
item.minecraft.guardian_spawn_egg
item.minecraft.gunpowder
item.minecraft.heart_of_the_sea
item.minecraft.hoglin_spawn_egg
item.minecraft.honey_bottle
item.minecraft.honeycomb
item.minecraft.hopper_minecart
@ -910,6 +994,7 @@ item.minecraft.lingering_potion.effect.water
item.minecraft.lingering_potion.effect.water_breathing
item.minecraft.lingering_potion.effect.weakness
item.minecraft.llama_spawn_egg
item.minecraft.lodestone_compass
item.minecraft.magenta_dye
item.minecraft.magma_cream
item.minecraft.magma_cube_spawn_egg
@ -939,6 +1024,10 @@ item.minecraft.music_disc_mall
item.minecraft.music_disc_mall.desc
item.minecraft.music_disc_mellohi
item.minecraft.music_disc_mellohi.desc
item.minecraft.music_disc_pigstep
item.minecraft.music_disc_pigstep
item.minecraft.music_disc_pigstep.desc
item.minecraft.music_disc_pigstep.desc
item.minecraft.music_disc_stal
item.minecraft.music_disc_stal.desc
item.minecraft.music_disc_strad
@ -953,6 +1042,17 @@ item.minecraft.nautilus_shell
item.minecraft.nether_brick
item.minecraft.nether_star
item.minecraft.nether_wart
item.minecraft.netherite_axe
item.minecraft.netherite_boots
item.minecraft.netherite_chestplate
item.minecraft.netherite_helmet
item.minecraft.netherite_hoe
item.minecraft.netherite_ingot
item.minecraft.netherite_leggings
item.minecraft.netherite_pickaxe
item.minecraft.netherite_scrap
item.minecraft.netherite_shovel
item.minecraft.netherite_sword
item.minecraft.oak_boat
item.minecraft.ocelot_spawn_egg
item.minecraft.orange_dye
@ -963,6 +1063,8 @@ item.minecraft.parrot_spawn_egg
item.minecraft.phantom_membrane
item.minecraft.phantom_spawn_egg
item.minecraft.pig_spawn_egg
item.minecraft.piglin_banner_pattern.desc
item.minecraft.piglin_spawn_egg
item.minecraft.pillager_spawn_egg
item.minecraft.pink_dye
item.minecraft.poisonous_potato
@ -1066,6 +1168,7 @@ item.minecraft.stone_pickaxe
item.minecraft.stone_shovel
item.minecraft.stone_sword
item.minecraft.stray_spawn_egg
item.minecraft.strider_spawn_egg
item.minecraft.string
item.minecraft.sugar
item.minecraft.suspicious_stew
@ -1106,6 +1209,7 @@ item.minecraft.vex_spawn_egg
item.minecraft.villager_spawn_egg
item.minecraft.vindicator_spawn_egg
item.minecraft.wandering_trader_spawn_egg
item.minecraft.warped_fungus_on_a_stick
item.minecraft.water_bucket
item.minecraft.wheat
item.minecraft.wheat_seeds
@ -1122,8 +1226,10 @@ item.minecraft.wooden_sword
item.minecraft.writable_book
item.minecraft.written_book
item.minecraft.yellow_dye
item.minecraft.zoglin_spawn_egg
item.minecraft.zombie_head
item.minecraft.zombie_horse_spawn_egg
item.minecraft.zombie_pigman_spawn_egg
item.minecraft.zombie_spawn_egg
item.minecraft.zombie_villager_spawn_egg
item.minecraft.zombie_villager_spawn_egg
item.minecraft.zombified_piglin_spawn_egg

View File

@ -1,12 +1,41 @@
package de.epiceric.shopchest;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import com.palmergames.bukkit.towny.Towny;
import com.plotsquared.core.PlotSquared;
import com.wasteofplastic.askyblock.ASkyBlock;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.codemc.worldguardwrapper.WorldGuardWrapper;
import de.epiceric.shopchest.command.ShopCommand;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.HologramFormat;
import de.epiceric.shopchest.event.ShopInitializedEvent;
import de.epiceric.shopchest.external.BentoBoxShopFlag;
import de.epiceric.shopchest.external.PlotSquaredOldShopFlag;
import de.epiceric.shopchest.external.PlotSquaredShopFlag;
import de.epiceric.shopchest.external.WorldGuardShopFlag;
import de.epiceric.shopchest.external.listeners.ASkyBlockListener;
@ -43,36 +72,10 @@ import fr.xephi.authme.AuthMe;
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import me.wiefferink.areashop.AreaShop;
import net.milkbowl.vault.economy.Economy;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.codemc.worldguardwrapper.WorldGuardWrapper;
import pl.islandworld.IslandWorld;
import us.talabrek.ultimateskyblock.api.uSkyBlockAPI;
import world.bentobox.bentobox.BentoBox;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
public class ShopChest extends JavaPlugin {
private static ShopChest instance;
@ -181,6 +184,7 @@ public class ShopChest extends JavaPlugin {
case "v1_13_R2":
case "v1_14_R1":
case "v1_15_R1":
case "v1_16_R1":
break;
default:
debug("Server version not officially supported: " + Utils.getServerVersion() + "!");
@ -211,6 +215,8 @@ public class ShopChest extends JavaPlugin {
registerExternalListeners();
initializeShops();
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
updater = new ShopUpdater(this);
updater.start();
}
@ -248,12 +254,12 @@ public class ShopChest extends JavaPlugin {
shopCreationThreadPool.shutdown();
}
for (Shop shop : shopUtils.getShopsCopy()) {
for (Shop shop : shopUtils.getShops()) {
shopUtils.removeShop(shop, false);
debug("Removed shop (#" + shop.getID() + ")");
}
if (database != null) {
if (database != null && database.isInitialized()) {
if (database instanceof SQLite) {
((SQLite) database).vacuum();
}
@ -317,7 +323,12 @@ public class ShopChest extends JavaPlugin {
}
if (hasPlotSquared()) {
PlotSquaredShopFlag.register(this);
try {
Class.forName("com.plotsquared.core.PlotSquared");
PlotSquaredShopFlag.register(this);
} catch (ClassNotFoundException ex) {
PlotSquaredOldShopFlag.register(this);
}
}
if (hasBentoBox()) {

View File

@ -1,21 +1,5 @@
package de.epiceric.shopchest.command;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ClickType.SelectClickType;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@ -24,6 +8,28 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.SimpleCommandMap;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.utils.ClickType.SelectClickType;
import de.epiceric.shopchest.utils.Permissions;
public class ShopCommand {
private static boolean commandCreated = false;

View File

@ -1,5 +1,22 @@
package de.epiceric.shopchest.command;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
@ -13,35 +30,17 @@ import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.utils.Callback;
import de.epiceric.shopchest.utils.ClickType;
import de.epiceric.shopchest.utils.ClickType.CreateClickType;
import de.epiceric.shopchest.utils.ClickType.SelectClickType;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.UpdateChecker;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.utils.ClickType.CreateClickType;
import de.epiceric.shopchest.utils.ClickType.SelectClickType;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Stream;
class ShopCommandExecutor implements CommandExecutor {
@ -202,9 +201,8 @@ class ShopCommandExecutor implements CommandExecutor {
plugin.getUpdater().restart();
// Remove all shops
Iterator<Shop> iter = shopUtils.getShops().iterator();
while (iter.hasNext()) {
shopUtils.removeShop(iter.next(), false);
for (Shop shop : shopUtils.getShops()) {
shopUtils.removeShop(shop, false);
}
Chunk[] loadedChunks = Bukkit.getWorlds().stream().map(World::getLoadedChunks)

View File

@ -1,13 +1,13 @@
package de.epiceric.shopchest.command;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import java.util.ArrayList;
import java.util.List;
public abstract class ShopSubCommand {
private String name;
private boolean playerCommand;

View File

@ -1,22 +1,21 @@
package de.epiceric.shopchest.command;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
class ShopTabCompleter implements TabCompleter {
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
class ShopTabCompleter implements TabCompleter {
private ShopChest plugin;
ShopTabCompleter(ShopChest plugin) {
@ -27,7 +26,7 @@ class ShopTabCompleter implements TabCompleter {
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equalsIgnoreCase(Config.mainCommandName)) {
List<String> createSubCommands = Arrays.asList("admin", "normal");
List<String> createSubCommands = Arrays.asList("admin");
List<String> configSubCommands = Arrays.asList("add", "remove", "set");
List<String> areaShopRemoveEvents = Arrays.asList("DELETE", "RESELL", "SELL", "UNRENT");
List<String> townyShopPlots = Arrays.asList("ARENA", "COMMERCIAL", "EMBASSY", "FARM", "INN", "JAIL", "RESIDENTIAL", "SPLEEF", "WILDS");

View File

@ -1,14 +1,5 @@
package de.epiceric.shopchest.config;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.sql.Database;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.inventory.ItemStack;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@ -19,6 +10,15 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.inventory.ItemStack;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.sql.Database;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Utils;
public class Config {
/**
@ -219,6 +219,11 @@ public class Config {
**/
public static boolean enableVendorMessages;
/**
* Whether the vendor of the shop should get messages on all servers about buys and sells
**/
public static boolean enableVendorBungeeMessages;
/**
* Whether the extension of a potion or tipped arrow (if available) should be appended to the item name.
**/
@ -486,6 +491,7 @@ public class Config {
enableGriefPreventionIntegration = plugin.getConfig().getBoolean("enable-griefprevention-integration");
enableAreaShopIntegration = plugin.getConfig().getBoolean("enable-areashop-integration");
enableVendorMessages = plugin.getConfig().getBoolean("enable-vendor-messages");
enableVendorBungeeMessages = plugin.getConfig().getBoolean("enable-vendor-bungee-messages");
onlyShowShopsInSight = plugin.getConfig().getBoolean("only-show-shops-in-sight");
appendPotionLevelToItemName = plugin.getConfig().getBoolean("append-potion-level-to-item-name");
removeShopOnError = plugin.getConfig().getBoolean("remove-shop-on-error");

View File

@ -1,19 +1,21 @@
package de.epiceric.shopchest.config;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Operator;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Operator;
public class HologramFormat {
public enum Requirement {

View File

@ -1,14 +1,20 @@
package de.epiceric.shopchest.config;
import de.epiceric.shopchest.ShopChest;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import de.epiceric.shopchest.ShopChest;
public class LanguageConfiguration extends FileConfiguration {
private ArrayList<String> lines = new ArrayList<>();

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player buys or sells something from or to a shop
*/

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player creates a shop (clicks on a chest)
*/

View File

@ -1,10 +1,11 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import de.epiceric.shopchest.shop.Shop;
public abstract class ShopEvent extends Event {
private static final HandlerList handlers = new HandlerList();

View File

@ -1,11 +1,11 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player extends a shop (making a chest a double chest)
*/

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player retrieves information about a shop (clicks on a chest)
*/

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player opens a shop (clicks on a chest)
*/

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player wants to create a shop (enters the command)
*/

View File

@ -1,13 +1,14 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import java.util.List;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import java.util.List;
import de.epiceric.shopchest.shop.Shop;
public class ShopRemoveAllEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@ -1,9 +1,10 @@
package de.epiceric.shopchest.event;
import de.epiceric.shopchest.shop.Shop;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import de.epiceric.shopchest.shop.Shop;
/**
* Called when a player removes a shop (clicks on a chest)
*/

View File

@ -0,0 +1,112 @@
package de.epiceric.shopchest.external;
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import org.bukkit.entity.Player;
import de.epiceric.shopchest.ShopChest;
import java.util.Locale;
public class PlotSquaredOldShopFlag {
public enum Group {
OWNERS, MEMBERS, TRUSTED, EVERYONE, NONE
}
public static final GroupFlag CREATE_SHOP = new GroupFlag("create-shop");
public static final GroupFlag USE_SHOP = new GroupFlag("use-shop");
public static final GroupFlag USE_ADMIN_SHOP = new GroupFlag("use-admin-shop");
private static boolean registered = false;
public static void register(ShopChest plugin) {
if (registered) return;
Flags.registerFlag(CREATE_SHOP);
Flags.registerFlag(USE_SHOP);
Flags.registerFlag(USE_ADMIN_SHOP);
registered = true;
plugin.debug("Registered custom PlotSquared flags");
}
/**
* Check if a flag is allowed for a player on a plot from PlotSquared
* @param plot Plot from PlotSquared
* @param flag Flag to check
* @param p Player to check
* @return Whether the flag is allowed for the player
*/
public static boolean isFlagAllowedOnPlot(Plot plot, GroupFlag flag, Player p) {
if (plot != null && flag != null) {
Group group = plot.getFlag(flag, Group.NONE);
ShopChest.getInstance().debug("Flag " + flag.getName() + " is set to " + group);
switch (group) {
case OWNERS:
return plot.getOwners().contains(p.getUniqueId());
case TRUSTED:
return plot.getOwners().contains(p.getUniqueId()) || plot.getTrusted().contains(p.getUniqueId());
case MEMBERS:
return plot.getOwners().contains(p.getUniqueId()) || plot.getTrusted().contains(p.getUniqueId()) || plot.getMembers().contains(p.getUniqueId());
case EVERYONE:
return true;
case NONE:
return false;
}
}
ShopChest.getInstance().debug("Flag or plot is null, or value of flag is not a group");
return true;
}
public static class GroupFlag extends Flag<Group> {
public GroupFlag(String name) {
super(name);
}
@Override
public String valueToString(Object value) {
return String.valueOf(value);
}
@Override
public Group parseValue(String s) {
String val = s.toLowerCase(Locale.ENGLISH);
switch (val) {
case "owners":
case "owner":
return Group.OWNERS;
case "members":
case "member":
case "helpers":
case "helper":
return Group.MEMBERS;
case "trusted":
return Group.TRUSTED;
case "everyone":
case "all":
return Group.EVERYONE;
case "deny":
case "disallow":
case "false":
case "no":
case "0":
case "none":
case "noone":
return Group.NONE;
}
return null;
}
@Override
public String getValueDescription() {
return "Flag value must be a group: 'owner' , 'members', 'trusted', 'everyone' or 'none'";
}
}
}

View File

@ -1,33 +1,41 @@
package de.epiceric.shopchest.external;
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import java.util.Arrays;
import java.util.Collection;
import java.util.Locale;
import com.plotsquared.core.configuration.Caption;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.StaticCaption;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
import com.plotsquared.core.plot.flag.PlotFlag;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import de.epiceric.shopchest.ShopChest;
import java.util.Locale;
public class PlotSquaredShopFlag {
private static boolean registered = false;
public enum Group {
OWNERS, MEMBERS, TRUSTED, EVERYONE, NONE
}
public static GroupFlag CREATE_SHOP = new GroupFlag("create-shop");
public static GroupFlag USE_SHOP = new GroupFlag("use-shop");
public static GroupFlag USE_ADMIN_SHOP = new GroupFlag("use-admin-shop");
private static final String[] lowercaseValues = Arrays.asList(Group.values()).stream()
.map(value -> String.valueOf(value).toLowerCase(Locale.ENGLISH))
.toArray(String[]::new);
public static final GroupFlag<?> CREATE_SHOP = new CreateShopFlag(Group.MEMBERS);
public static final GroupFlag<?> USE_SHOP = new UseShopFlag(Group.EVERYONE);
private static boolean registered = false;
public static void register(ShopChest plugin) {
if (registered) return;
Flags.registerFlag(CREATE_SHOP);
Flags.registerFlag(USE_SHOP);
Flags.registerFlag(USE_ADMIN_SHOP);
GlobalFlagContainer.getInstance().addFlag(CREATE_SHOP);
GlobalFlagContainer.getInstance().addFlag(USE_SHOP);
registered = true;
plugin.debug("Registered custom PlotSquared flags");
@ -35,14 +43,15 @@ public class PlotSquaredShopFlag {
/**
* Check if a flag is allowed for a player on a plot from PlotSquared
*
* @param plot Plot from PlotSquared
* @param flag Flag to check
* @param p Player to check
* @return Whether the flag is allowed for the player
*/
public static boolean isFlagAllowedOnPlot(Plot plot, GroupFlag flag, Player p) {
public static boolean isFlagAllowedOnPlot(Plot plot, GroupFlag<?> flag, Player p) {
if (plot != null && flag != null) {
Group group = plot.getFlag(flag, PlotSquaredShopFlag.Group.NONE);
Group group = plot.getFlag(flag);
ShopChest.getInstance().debug("Flag " + flag.getName() + " is set to " + group);
switch (group) {
@ -64,51 +73,80 @@ public class PlotSquaredShopFlag {
return true;
}
public static class GroupFlag extends Flag<Group> {
public GroupFlag(String name) {
super(name);
public static class CreateShopFlag extends GroupFlag<CreateShopFlag> {
public CreateShopFlag(Group value) {
super(value, new StaticCaption("Set to the group that is allowed to create shops."));
}
@Override
public String valueToString(Object value) {
return String.valueOf(value);
protected CreateShopFlag flagOf(@NotNull Group value) {
return new CreateShopFlag(value);
}
}
public static class UseShopFlag extends GroupFlag<UseShopFlag> {
public UseShopFlag(Group value) {
super(value, new StaticCaption("Set to the group that is allowed to use shops."));
}
@Override
public Group parseValue(String s) {
String val = s.toLowerCase(Locale.ENGLISH);
protected UseShopFlag flagOf(@NotNull Group value) {
return new UseShopFlag(value);
}
}
switch (val) {
public abstract static class GroupFlag<F extends PlotFlag<Group, F>> extends PlotFlag<Group, F> {
public GroupFlag(Group value, Caption description) {
super(value, Captions.FLAG_CATEGORY_ENUM, description);
}
@Override
public String toString() {
return String.valueOf(getValue()).toLowerCase(Locale.ENGLISH);
}
@Override
public String getExample() {
return "members";
}
@Override
public F merge(@NotNull Group newValue) {
return flagOf(newValue);
}
@Override
public F parse(@NotNull String input) throws FlagParseException {
switch (input.toLowerCase(Locale.ENGLISH)) {
case "owners":
case "owner":
return Group.OWNERS;
return this.flagOf(Group.OWNERS);
case "members":
case "member":
case "helpers":
case "helper":
return Group.MEMBERS;
return this.flagOf(Group.MEMBERS);
case "trusted":
return Group.TRUSTED;
return this.flagOf(Group.TRUSTED);
case "everyone":
case "all":
return Group.EVERYONE;
return this.flagOf(Group.EVERYONE);
case "deny":
case "disallow":
case "false":
case "no":
case "0":
case "none":
case "noone":
return Group.NONE;
return this.flagOf(Group.NONE);
}
return null;
throw new FlagParseException(this, input, Captions.FLAG_ERROR_ENUM, (Object[]) lowercaseValues);
}
@Override
public String getValueDescription() {
return "Flag value must be a group: 'owner' , 'members', 'trusted', 'everyone' or 'none'";
public Collection<String> getTabCompletions() {
return Arrays.asList(lowercaseValues);
}
}
}

View File

@ -2,8 +2,8 @@ package de.epiceric.shopchest.external.listeners;
import java.util.Set;
import com.github.intellectualsites.plotsquared.plot.object.Location;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@ -15,6 +15,7 @@ import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.ShopCreateEvent;
import de.epiceric.shopchest.event.ShopExtendEvent;
import de.epiceric.shopchest.external.PlotSquaredOldShopFlag;
import de.epiceric.shopchest.external.PlotSquaredShopFlag;
import de.epiceric.shopchest.utils.Utils;
@ -51,15 +52,12 @@ public class PlotSquaredListener implements Listener {
// public void onBuySell(ShopBuySellEvent e) {
// if (!Config.enablePlotsquaredIntegration)
// return;
// ShopType shopType = e.getShop().getShopType();
// GroupFlag flag = shopType == ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
// Set<org.bukkit.Location> chestLocations = Utils.getChestLocations(e.getShop());
// for (org.bukkit.Location loc : chestLocations) {
// Location plotLocation = new Location(loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
// Plot plot = plotLocation.getOwnedPlot();
// if (!isFlagAllowed(plot, flag, e.getPlayer())) {
// if (!isFlagAllowed(plot, PlotSquaredShopFlag.USE_SHOP, e.getPlayer())) {
// e.setCancelled(true);
// plugin.debug("Cancel Reason: PlotSquared");
// return;
@ -68,9 +66,21 @@ public class PlotSquaredListener implements Listener {
// }
private boolean handleForLocation(Player player, org.bukkit.Location loc, Cancellable e) {
Location plotLocation = new Location(loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
Plot plot = plotLocation.getOwnedPlot();
if (!PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredShopFlag.CREATE_SHOP, player)) {
boolean isAllowed = false;
try {
Class.forName("com.plotsquared.core.PlotSquared");
Location plotLocation = new Location(loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
Plot plot = plotLocation.getOwnedPlot();
isAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredShopFlag.CREATE_SHOP, player);
} catch (ClassNotFoundException ex) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation = new com.github.intellectualsites.plotsquared.plot.object.Location(
loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
com.github.intellectualsites.plotsquared.plot.object.Plot plot = plotLocation.getOwnedPlot();
isAllowed = PlotSquaredOldShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredOldShopFlag.CREATE_SHOP, player);
}
if (!isAllowed) {
e.setCancelled(true);
plugin.debug("Cancel Reason: PlotSquared");
return true;

View File

@ -1,12 +1,8 @@
package de.epiceric.shopchest.language;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.LanguageConfiguration;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.nms.CustomBookMeta;
import de.epiceric.shopchest.nms.SpawnEggMeta;
import de.epiceric.shopchest.utils.Utils;
import java.util.ArrayList;
import java.util.Map;
import java.util.StringJoiner;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -21,9 +17,13 @@ import org.bukkit.potion.Potion;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import java.util.ArrayList;
import java.util.Map;
import java.util.StringJoiner;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.LanguageConfiguration;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.nms.CustomBookMeta;
import de.epiceric.shopchest.nms.SpawnEggMeta;
import de.epiceric.shopchest.utils.Utils;
public class LanguageUtils {
@ -793,7 +793,7 @@ public class LanguageUtils {
entityNames.add(new EntityName(EntityType.ZOMBIE, langConfig.getString("entity.Zombie.name", "Zombie")));
entityNames.add(new EntityName(EntityType.SLIME, langConfig.getString("entity.Slime.name", "Slime")));
entityNames.add(new EntityName(EntityType.GHAST, langConfig.getString("entity.Ghast.name", "Ghast")));
entityNames.add(new EntityName(EntityType.PIG_ZOMBIE, langConfig.getString("entity.PigZombie.name", "Zombie Pigman")));
entityNames.add(new EntityName(EntityType.valueOf("PIG_ZOMBIE"), langConfig.getString("entity.PigZombie.name", "Zombie Pigman")));
entityNames.add(new EntityName(EntityType.ENDERMAN, langConfig.getString("entity.Enderman.name", "Enderman")));
entityNames.add(new EntityName(EntityType.CAVE_SPIDER, langConfig.getString("entity.CaveSpider.name", "Cave Spider")));
entityNames.add(new EntityName(EntityType.SILVERFISH, langConfig.getString("entity.Silverfish.name", "Silverfish")));
@ -1778,7 +1778,6 @@ public class LanguageUtils {
itemNames.add(new ItemName(Material.WOLF_SPAWN_EGG, langConfig.getString("item.minecraft.wolf_spawn_egg", "Wolf Spawn Egg")));
itemNames.add(new ItemName(Material.ZOMBIE_SPAWN_EGG, langConfig.getString("item.minecraft.zombie_spawn_egg", "Zombie Spawn Egg")));
itemNames.add(new ItemName(Material.ZOMBIE_HORSE_SPAWN_EGG, langConfig.getString("item.minecraft.zombie_horse_spawn_egg", "Zombie Horse Spawn Egg")));
itemNames.add(new ItemName(Material.ZOMBIE_PIGMAN_SPAWN_EGG, langConfig.getString("item.minecraft.zombie_pigman_spawn_egg", "Zombie Pigman Spawn Egg")));
itemNames.add(new ItemName(Material.ZOMBIE_VILLAGER_SPAWN_EGG, langConfig.getString("item.minecraft.zombie_villager_spawn_egg", "Zombie Villager Spawn Egg")));
itemNames.add(new ItemName(Material.EXPERIENCE_BOTTLE, langConfig.getString("item.minecraft.experience_bottle", "Bottle o' Enchanting")));
itemNames.add(new ItemName(Material.FIRE_CHARGE, langConfig.getString("item.minecraft.fire_charge", "Fire Charge")));
@ -1957,6 +1956,114 @@ public class LanguageUtils {
itemNames.add(new ItemName(Material.HONEYCOMB_BLOCK, langConfig.getString("block.minecraft.honeycomb_block", "Honeycomb Block")));
}
if (Utils.getMajorVersion() >= 16) {
itemNames.add(new ItemName(Material.ANCIENT_DEBRIS, langConfig.getString("block.minecraft.ancient_debris", "Ancient Debris")));
itemNames.add(new ItemName(Material.BASALT, langConfig.getString("block.minecraft.basalt", "Basalt")));
itemNames.add(new ItemName(Material.BLACKSTONE, langConfig.getString("block.minecraft.blackstone", "Blackstone")));
itemNames.add(new ItemName(Material.BLACKSTONE_SLAB, langConfig.getString("block.minecraft.blackstone_slab", "Blackstone Slab")));
itemNames.add(new ItemName(Material.BLACKSTONE_STAIRS, langConfig.getString("block.minecraft.blackstone_stairs", "Blackstone Stairs")));
itemNames.add(new ItemName(Material.BLACKSTONE_WALL, langConfig.getString("block.minecraft.blackstone_wall", "Blackstone Wall")));
itemNames.add(new ItemName(Material.CHAIN, langConfig.getString("block.minecraft.chain", "Chain")));
itemNames.add(new ItemName(Material.CHISELED_NETHER_BRICKS, langConfig.getString("block.minecraft.chiseled_nether_bricks", "Chiseled Nether Bricks")));
itemNames.add(new ItemName(Material.CHISELED_POLISHED_BLACKSTONE, langConfig.getString("block.minecraft.chiseled_polished_blackstone", "Chiseled Polished Blackstone")));
itemNames.add(new ItemName(Material.CRACKED_NETHER_BRICKS, langConfig.getString("block.minecraft.cracked_nether_bricks", "Cracked Nether Bricks")));
itemNames.add(new ItemName(Material.CRACKED_POLISHED_BLACKSTONE_BRICKS, langConfig.getString("block.minecraft.cracked_polished_blackstone_bricks", "Cracked Polished Blackstone Bricks")));
itemNames.add(new ItemName(Material.CRIMSON_BUTTON, langConfig.getString("block.minecraft.crimson_button", "Crimson Button")));
itemNames.add(new ItemName(Material.CRIMSON_DOOR, langConfig.getString("block.minecraft.crimson_door", "Crimson Door")));
itemNames.add(new ItemName(Material.CRIMSON_FENCE, langConfig.getString("block.minecraft.crimson_fence", "Crimson Fence")));
itemNames.add(new ItemName(Material.CRIMSON_FENCE_GATE, langConfig.getString("block.minecraft.crimson_fence_gate", "Crimson Fence Gate")));
itemNames.add(new ItemName(Material.CRIMSON_FUNGUS, langConfig.getString("block.minecraft.crimson_fungus", "Crimson Fungus")));
itemNames.add(new ItemName(Material.CRIMSON_HYPHAE, langConfig.getString("block.minecraft.crimson_hyphae", "Crimson Hyphae")));
itemNames.add(new ItemName(Material.CRIMSON_NYLIUM, langConfig.getString("block.minecraft.crimson_nylium", "Crimson Nylium")));
itemNames.add(new ItemName(Material.CRIMSON_PLANKS, langConfig.getString("block.minecraft.crimson_planks", "Crimson Planks")));
itemNames.add(new ItemName(Material.CRIMSON_PRESSURE_PLATE, langConfig.getString("block.minecraft.crimson_pressure_plate", "Crimson Pressure Plate")));
itemNames.add(new ItemName(Material.CRIMSON_ROOTS, langConfig.getString("block.minecraft.crimson_roots", "Crimson Roots")));
itemNames.add(new ItemName(Material.CRIMSON_SIGN, langConfig.getString("block.minecraft.crimson_sign", "Crimson Sign")));
itemNames.add(new ItemName(Material.CRIMSON_SLAB, langConfig.getString("block.minecraft.crimson_slab", "Crimson Slab")));
itemNames.add(new ItemName(Material.CRIMSON_STAIRS, langConfig.getString("block.minecraft.crimson_stairs", "Crimson Stairs")));
itemNames.add(new ItemName(Material.CRIMSON_STEM, langConfig.getString("block.minecraft.crimson_stem", "Crimson Stem")));
itemNames.add(new ItemName(Material.CRIMSON_TRAPDOOR, langConfig.getString("block.minecraft.crimson_trapdoor", "Crimson Trapdoor")));
itemNames.add(new ItemName(Material.CRIMSON_WALL_SIGN, langConfig.getString("block.minecraft.crimson_wall_sign", "Crimson Wall Sign")));
itemNames.add(new ItemName(Material.CRYING_OBSIDIAN, langConfig.getString("block.minecraft.crying_obsidian", "Crying Obsidian")));
itemNames.add(new ItemName(Material.GILDED_BLACKSTONE, langConfig.getString("block.minecraft.gilded_blackstone", "Gilded Blackstone")));
itemNames.add(new ItemName(Material.HOGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.hoglin_spawn_egg", "Hoglin Spawn Egg")));
itemNames.add(new ItemName(Material.LODESTONE, langConfig.getString("block.minecraft.lodestone", "Lodestone")));
// itemNames.add(new ItemName(Material.LODESTONE_COMPASS, langConfig.getString("item.minecraft.lodestone_compass", "Lodestone Compass")));
itemNames.add(new ItemName(Material.MUSIC_DISC_PIGSTEP, langConfig.getString("item.minecraft.music_disc_pigstep", "Music Disc")));
itemNames.add(new ItemName(Material.NETHER_GOLD_ORE, langConfig.getString("block.minecraft.nether_gold_ore", "Nether Gold Ore")));
itemNames.add(new ItemName(Material.NETHER_SPROUTS, langConfig.getString("block.minecraft.nether_sprouts", "Nether Sprouts")));
itemNames.add(new ItemName(Material.NETHERITE_AXE, langConfig.getString("item.minecraft.netherite_axe", "Netherite Axe")));
itemNames.add(new ItemName(Material.NETHERITE_BLOCK, langConfig.getString("block.minecraft.netherite_block", "Netherite Block")));
itemNames.add(new ItemName(Material.NETHERITE_BOOTS, langConfig.getString("item.minecraft.netherite_boots", "Netherite Boots")));
itemNames.add(new ItemName(Material.NETHERITE_CHESTPLATE, langConfig.getString("item.minecraft.netherite_chestplate", "Netherite Chestplate")));
itemNames.add(new ItemName(Material.NETHERITE_HELMET, langConfig.getString("item.minecraft.netherite_helmet", "Netherite Helmet")));
itemNames.add(new ItemName(Material.NETHERITE_HOE, langConfig.getString("item.minecraft.netherite_hoe", "Netherite Hoe")));
itemNames.add(new ItemName(Material.NETHERITE_INGOT, langConfig.getString("item.minecraft.netherite_ingot", "Netherite Ingot")));
itemNames.add(new ItemName(Material.NETHERITE_LEGGINGS, langConfig.getString("item.minecraft.netherite_leggings", "Netherite Leggings")));
itemNames.add(new ItemName(Material.NETHERITE_PICKAXE, langConfig.getString("item.minecraft.netherite_pickaxe", "Netherite Pickaxe")));
itemNames.add(new ItemName(Material.NETHERITE_SCRAP, langConfig.getString("item.minecraft.netherite_scrap", "Netherite Scrap")));
itemNames.add(new ItemName(Material.NETHERITE_SHOVEL, langConfig.getString("item.minecraft.netherite_shovel", "Netherite Shovel")));
itemNames.add(new ItemName(Material.NETHERITE_SWORD, langConfig.getString("item.minecraft.netherite_sword", "Netherite Sword")));
itemNames.add(new ItemName(Material.PIGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.piglin_spawn_egg", "Piglin Spawn Egg")));
itemNames.add(new ItemName(Material.POLISHED_BASALT, langConfig.getString("block.minecraft.polished_basalt", "Polished Basalt")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE, langConfig.getString("block.minecraft.polished_blackstone", "Polished Blackstone")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_BRICK_SLAB, langConfig.getString("block.minecraft.polished_blackstone_brick_slab", "Polished Blackstone Brick Slab")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_BRICK_STAIRS, langConfig.getString("block.minecraft.polished_blackstone_brick_stairs", "Polished Blackstone Brick Stairs")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_BRICK_WALL, langConfig.getString("block.minecraft.polished_blackstone_brick_wall", "Polished Blackstone Brick Wall")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_BRICKS, langConfig.getString("block.minecraft.polished_blackstone_bricks", "Polished Blackstone Bricks")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_BUTTON, langConfig.getString("block.minecraft.polished_blackstone_button", "Polished Blackstone Button")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_PRESSURE_PLATE, langConfig.getString("block.minecraft.polished_blackstone_pressure_plate", "Polished Blackstone Pressure Plate")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_SLAB, langConfig.getString("block.minecraft.polished_blackstone_slab", "Polished Blackstone Slab")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_STAIRS, langConfig.getString("block.minecraft.polished_blackstone_stairs", "Polished Blackstone Stairs")));
itemNames.add(new ItemName(Material.POLISHED_BLACKSTONE_WALL, langConfig.getString("block.minecraft.polished_blackstone_wall", "Polished Blackstone Wall")));
itemNames.add(new ItemName(Material.POTTED_CRIMSON_FUNGUS, langConfig.getString("block.minecraft.potted_crimson_fungus", "Potted Crimson Fungus")));
itemNames.add(new ItemName(Material.POTTED_CRIMSON_ROOTS, langConfig.getString("block.minecraft.potted_crimson_roots", "Potted Crimson Roots")));
itemNames.add(new ItemName(Material.POTTED_WARPED_FUNGUS, langConfig.getString("block.minecraft.potted_warped_fungus", "Potted Warped Fungus")));
itemNames.add(new ItemName(Material.POTTED_WARPED_ROOTS, langConfig.getString("block.minecraft.potted_warped_roots", "Potted Warped Roots")));
itemNames.add(new ItemName(Material.QUARTZ_BRICKS, langConfig.getString("block.minecraft.quartz_bricks", "Quartz Bricks")));
itemNames.add(new ItemName(Material.RESPAWN_ANCHOR, langConfig.getString("block.minecraft.respawn_anchor", "Respawn Anchor")));
itemNames.add(new ItemName(Material.SHROOMLIGHT, langConfig.getString("block.minecraft.shroomlight", "Shroomlight")));
itemNames.add(new ItemName(Material.SOUL_CAMPFIRE, langConfig.getString("block.minecraft.soul_campfire", "Soul Campfire")));
itemNames.add(new ItemName(Material.SOUL_FIRE, langConfig.getString("block.minecraft.soul_fire", "Soul Fire")));
itemNames.add(new ItemName(Material.SOUL_LANTERN, langConfig.getString("block.minecraft.soul_lantern", "Soul Lantern")));
itemNames.add(new ItemName(Material.SOUL_SOIL, langConfig.getString("block.minecraft.soul_soil", "Soul Soil")));
itemNames.add(new ItemName(Material.SOUL_TORCH, langConfig.getString("block.minecraft.soul_torch", "Soul Torch")));
itemNames.add(new ItemName(Material.SOUL_WALL_TORCH, langConfig.getString("block.minecraft.soul_wall_torch", "Soul Wall Torch")));
itemNames.add(new ItemName(Material.STRIDER_SPAWN_EGG, langConfig.getString("item.minecraft.strider_spawn_egg", "Strider Spawn Egg")));
itemNames.add(new ItemName(Material.STRIPPED_CRIMSON_HYPHAE, langConfig.getString("block.minecraft.stripped_crimson_hyphae", "Stripped Crimson Hyphae")));
itemNames.add(new ItemName(Material.STRIPPED_CRIMSON_STEM, langConfig.getString("block.minecraft.stripped_crimson_stem", "Stripped Crimson Stem")));
itemNames.add(new ItemName(Material.STRIPPED_WARPED_HYPHAE, langConfig.getString("block.minecraft.stripped_warped_hyphae", "Stripped Warped Hyphae")));
itemNames.add(new ItemName(Material.STRIPPED_WARPED_STEM, langConfig.getString("block.minecraft.stripped_warped_stem", "Stripped Warped Stem")));
itemNames.add(new ItemName(Material.TARGET, langConfig.getString("block.minecraft.target", "Target")));
itemNames.add(new ItemName(Material.TWISTING_VINES, langConfig.getString("block.minecraft.twisting_vines", "Twisting Vines")));
itemNames.add(new ItemName(Material.TWISTING_VINES_PLANT, langConfig.getString("block.minecraft.twisting_vines_plant", "Twisting Vines Plant")));
itemNames.add(new ItemName(Material.WARPED_BUTTON, langConfig.getString("block.minecraft.warped_button", "Warped Button")));
itemNames.add(new ItemName(Material.WARPED_DOOR, langConfig.getString("block.minecraft.warped_door", "Warped Door")));
itemNames.add(new ItemName(Material.WARPED_FENCE, langConfig.getString("block.minecraft.warped_fence", "Warped Fence")));
itemNames.add(new ItemName(Material.WARPED_FENCE_GATE, langConfig.getString("block.minecraft.warped_fence_gate", "Warped Fence Gate")));
itemNames.add(new ItemName(Material.WARPED_FUNGUS, langConfig.getString("block.minecraft.warped_fungus", "Warped Fungus")));
itemNames.add(new ItemName(Material.WARPED_FUNGUS_ON_A_STICK, langConfig.getString("item.minecraft.warped_fungus_on_a_stick", "Warped Fungus on a Stick")));
itemNames.add(new ItemName(Material.WARPED_HYPHAE, langConfig.getString("block.minecraft.warped_hyphae", "Warped Hyphae")));
itemNames.add(new ItemName(Material.WARPED_NYLIUM, langConfig.getString("block.minecraft.warped_nylium", "Warped Nylium")));
itemNames.add(new ItemName(Material.WARPED_PLANKS, langConfig.getString("block.minecraft.warped_planks", "Warped Planks")));
itemNames.add(new ItemName(Material.WARPED_PRESSURE_PLATE, langConfig.getString("block.minecraft.warped_pressure_plate", "Warped Pressure Plate")));
itemNames.add(new ItemName(Material.WARPED_ROOTS, langConfig.getString("block.minecraft.warped_roots", "Warped Roots")));
itemNames.add(new ItemName(Material.WARPED_SIGN, langConfig.getString("block.minecraft.warped_sign", "Warped Sign")));
itemNames.add(new ItemName(Material.WARPED_SLAB, langConfig.getString("block.minecraft.warped_slab", "Warped Slab")));
itemNames.add(new ItemName(Material.WARPED_STAIRS, langConfig.getString("block.minecraft.warped_stairs", "Warped Stairs")));
itemNames.add(new ItemName(Material.WARPED_STEM, langConfig.getString("block.minecraft.warped_stem", "Warped Stem")));
itemNames.add(new ItemName(Material.WARPED_TRAPDOOR, langConfig.getString("block.minecraft.warped_trapdoor", "Warped Trapdoor")));
itemNames.add(new ItemName(Material.WARPED_WALL_SIGN, langConfig.getString("block.minecraft.warped_wall_sign", "Warped Wall Sign")));
itemNames.add(new ItemName(Material.WARPED_WART_BLOCK, langConfig.getString("block.minecraft.warped_wart_block", "Warped Wart Block")));
itemNames.add(new ItemName(Material.WEEPING_VINES, langConfig.getString("block.minecraft.weeping_vines", "Weeping Vines")));
itemNames.add(new ItemName(Material.WEEPING_VINES_PLANT, langConfig.getString("block.minecraft.weeping_vines_plant", "Weeping Vines Plant")));
itemNames.add(new ItemName(Material.ZOGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.zoglin_spawn_egg", "Zoglin Spawn Egg")));
itemNames.add(new ItemName(Material.ZOMBIFIED_PIGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.zombified_piglin_spawn_egg", "Zombified Piglin Spawn Egg")));
} else {
// Add pre-1.16 item names that don't exist anymore
itemNames.add(new ItemName(Material.valueOf("ZOMBIE_PIGMAN_SPAWN_EGG"), langConfig.getString("item.minecraft.zombie_pigman_spawn_egg", "Zombie Pigman Spawn Egg")));
}
// Add Enchantment Names
enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_ALL, langConfig.getString("enchantment.minecraft.sharpness", "Sharpness")));
enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_UNDEAD, langConfig.getString("enchantment.minecraft.smite", "Smite")));
@ -2162,6 +2269,10 @@ public class LanguageUtils {
musicDiscNames.add(new MusicDiscName(Material.MUSIC_DISC_11, langConfig.getString("item.minecraft.music_disc_11.desc", "C418 - 11")));
musicDiscNames.add(new MusicDiscName(Material.MUSIC_DISC_WAIT, langConfig.getString("item.minecraft.music_disc_wait.desc", "C418 - wait")));
if (Utils.getMajorVersion() >= 16) {
musicDiscNames.add(new MusicDiscName(Material.MUSIC_DISC_PIGSTEP, langConfig.getString("item.minecraft.music_disc_pigstep.desc", "Lena Raine - Pigstep")));
}
if (Utils.getMajorVersion() >= 14) {
// Add Banner Pattern Names
bannerPatternNames.add(new BannerPatternName(Material.CREEPER_BANNER_PATTERN, langConfig.getString("item.minecraft.creeper_banner_pattern.desc", "Creeper Charge")));
@ -2169,6 +2280,10 @@ public class LanguageUtils {
bannerPatternNames.add(new BannerPatternName(Material.FLOWER_BANNER_PATTERN, langConfig.getString("item.minecraft.flower_banner_pattern.desc", "Flower Charge")));
bannerPatternNames.add(new BannerPatternName(Material.MOJANG_BANNER_PATTERN, langConfig.getString("item.minecraft.mojang_banner_pattern.desc", "Thing")));
bannerPatternNames.add(new BannerPatternName(Material.GLOBE_BANNER_PATTERN, langConfig.getString("item.minecraft.globe_banner_pattern.desc", "Globe")));
if (Utils.getMajorVersion() >= 16) {
bannerPatternNames.add(new BannerPatternName(Material.PIGLIN_BANNER_PATTERN, langConfig.getString("item.minecraft.piglin_banner_pattern.desc", "Snout")));
}
}
// Add Book Generation Names
@ -2265,7 +2380,7 @@ public class LanguageUtils {
messages.add(new LocalizedMessage(Message.COMMAND_DESC_HEADER, langConfig.getString("message.commandDescription.header", "&6==== &c/%COMMAND% &6Help")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_FOOTER, langConfig.getString("message.commandDescription.footer", "&6==== End")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_CREATE, langConfig.getString("message.commandDescription.create", "&a/%COMMAND% create <amount> <buy-price> <sell-price> - Create a shop.")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_CREATE_ADMIN, langConfig.getString("message.commandDescription.create-admin", "&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Create a shop.")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_CREATE_ADMIN, langConfig.getString("message.commandDescription.create-admin", "&a/%COMMAND% create <amount> <buy-price> <sell-price> [admin] - Create a shop.")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_REMOVE, langConfig.getString("message.commandDescription.remove", "&a/%COMMAND% remove - Remove a shop.")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_INFO, langConfig.getString("message.commandDescription.info", "&a/%COMMAND% info - Retrieve shop information.")));
messages.add(new LocalizedMessage(Message.COMMAND_DESC_REMOVEALL, langConfig.getString("message.commandDescription.removeall", "&a/%COMMAND% removeall - Remove all shops of a player.")));

View File

@ -1,6 +1,5 @@
package de.epiceric.shopchest.language;
import org.bukkit.potion.PotionType;
public class PotionName {

View File

@ -1,5 +1,10 @@
package de.epiceric.shopchest.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.codemc.worldguardwrapper.WorldGuardWrapper;
import org.codemc.worldguardwrapper.region.IWrappedRegion;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.shop.Shop;
@ -8,10 +13,6 @@ import me.wiefferink.areashop.events.notify.ResoldRegionEvent;
import me.wiefferink.areashop.events.notify.SoldRegionEvent;
import me.wiefferink.areashop.events.notify.UnrentedRegionEvent;
import me.wiefferink.areashop.regions.GeneralRegion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.codemc.worldguardwrapper.WorldGuardWrapper;
import org.codemc.worldguardwrapper.region.IWrappedRegion;
public class AreaShopListener implements Listener {
@ -52,7 +53,7 @@ public class AreaShopListener implements Listener {
private void removeShopsInRegion(GeneralRegion generalRegion) {
if (!plugin.hasWorldGuard()) return;
for (Shop shop : plugin.getShopUtils().getShopsCopy()) {
for (Shop shop : plugin.getShopUtils().getShops()) {
if (!shop.getLocation().getWorld().getName().equals(generalRegion.getWorldName())) continue;
for (IWrappedRegion r : WorldGuardWrapper.getInstance().getRegions(shop.getLocation())) {

View File

@ -70,7 +70,7 @@ public class BentoBoxListener implements Listener {
if (!Config.enableBentoBoxIntegration)
return;
Collection<Shop> shops = plugin.getShopUtils().getShopsCopy();
Collection<Shop> shops = plugin.getShopUtils().getShops();
for (Shop shop : shops) {
if (!shop.getLocation().getWorld().getName().equals(world.getName())) {
continue;

View File

@ -1,13 +1,14 @@
package de.epiceric.shopchest.listeners;
import de.epiceric.shopchest.ShopChest;
import java.util.ArrayList;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import java.util.ArrayList;
import de.epiceric.shopchest.ShopChest;
public class BlockExplodeListener implements Listener {

View File

@ -1,20 +1,6 @@
package de.epiceric.shopchest.listeners;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.event.ShopExtendEvent;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.utils.Callback;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.Utils;
import net.milkbowl.vault.economy.EconomyResponse;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -35,7 +21,21 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.InventoryHolder;
import java.util.ArrayList;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.event.ShopExtendEvent;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.utils.Callback;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.Utils;
import net.milkbowl.vault.economy.EconomyResponse;
public class ChestProtectListener implements Listener {

View File

@ -1,34 +1,19 @@
package de.epiceric.shopchest.listeners;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.gson.JsonPrimitive;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.event.ShopBuySellEvent;
import de.epiceric.shopchest.event.ShopCreateEvent;
import de.epiceric.shopchest.event.ShopInfoEvent;
import de.epiceric.shopchest.event.ShopOpenEvent;
import de.epiceric.shopchest.event.ShopRemoveEvent;
import de.epiceric.shopchest.external.PlotSquaredShopFlag;
import de.epiceric.shopchest.external.PlotSquaredShopFlag.GroupFlag;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.nms.JsonBuilder;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.sql.Database;
import de.epiceric.shopchest.utils.ClickType;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.Utils;
import de.epiceric.shopchest.utils.ClickType.CreateClickType;
import fr.xephi.authme.api.v3.AuthMeApi;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
@ -58,16 +43,33 @@ import org.codemc.worldguardwrapper.WorldGuardWrapper;
import org.codemc.worldguardwrapper.flag.IWrappedFlag;
import org.codemc.worldguardwrapper.flag.WrappedState;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.event.ShopBuySellEvent;
import de.epiceric.shopchest.event.ShopCreateEvent;
import de.epiceric.shopchest.event.ShopInfoEvent;
import de.epiceric.shopchest.event.ShopOpenEvent;
import de.epiceric.shopchest.event.ShopRemoveEvent;
import de.epiceric.shopchest.external.PlotSquaredOldShopFlag;
import de.epiceric.shopchest.external.PlotSquaredShopFlag;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import de.epiceric.shopchest.language.Replacement;
import de.epiceric.shopchest.nms.JsonBuilder;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.sql.Database;
import de.epiceric.shopchest.utils.ClickType;
import de.epiceric.shopchest.utils.ClickType.CreateClickType;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Permissions;
import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.Utils;
import fr.xephi.authme.api.v3.AuthMeApi;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
public class ShopInteractListener implements Listener {
private static final Pattern COLOR_CODE_PATTERN = Pattern.compile(".*([§]([a-fA-F0-9]))");
@ -260,13 +262,18 @@ public class ShopInteractListener implements Listener {
boolean externalPluginsAllowed = true;
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
Plot plot = plotLocation.getOwnedPlot();
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, flag, p);
try {
Class.forName("com.plotsquared.core.PlotSquared");
com.plotsquared.core.location.Location plotLocation =
new com.plotsquared.core.location.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.plotsquared.core.plot.Plot plot = plotLocation.getOwnedPlot();
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredShopFlag.USE_SHOP, p);
} catch (ClassNotFoundException ex) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.github.intellectualsites.plotsquared.plot.object.Plot plot = plotLocation.getOwnedPlot();
externalPluginsAllowed = PlotSquaredOldShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredOldShopFlag.USE_SHOP, p);
}
}
if (externalPluginsAllowed && plugin.hasWorldGuard() && Config.enableWorldGuardIntegration) {
@ -344,6 +351,11 @@ public class ShopInteractListener implements Listener {
shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(Message.VENDOR_OUT_OF_STOCK,
new Replacement(Placeholder.AMOUNT, String.valueOf(shop.getProduct().getAmount())),
new Replacement(Placeholder.ITEM_NAME, shop.getProduct().getLocalizedName())));
} else if(!shop.getVendor().isOnline() && Config.enableVendorBungeeMessages){
String message = LanguageUtils.getMessage(Message.VENDOR_OUT_OF_STOCK,
new Replacement(Placeholder.AMOUNT, String.valueOf(shop.getProduct().getAmount())),
new Replacement(Placeholder.ITEM_NAME, shop.getProduct().getLocalizedName()));
sendBungeeMessage(shop.getVendor().getName(), message);
}
plugin.debug("Shop is out of stock");
}
@ -375,13 +387,18 @@ public class ShopInteractListener implements Listener {
boolean externalPluginsAllowed = true;
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
Plot plot = plotLocation.getOwnedPlot();
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, flag, p);
try {
Class.forName("com.plotsquared.core.PlotSquared");
com.plotsquared.core.location.Location plotLocation =
new com.plotsquared.core.location.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.plotsquared.core.plot.Plot plot = plotLocation.getOwnedPlot();
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredShopFlag.USE_SHOP, p);
} catch (ClassNotFoundException ex) {
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.github.intellectualsites.plotsquared.plot.object.Plot plot = plotLocation.getOwnedPlot();
externalPluginsAllowed = PlotSquaredOldShopFlag.isFlagAllowedOnPlot(plot, PlotSquaredOldShopFlag.USE_SHOP, p);
}
}
if (externalPluginsAllowed && plugin.hasWorldGuard() && Config.enableWorldGuardIntegration) {
@ -861,6 +878,11 @@ public class ShopInteractListener implements Listener {
shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(Message.SOMEONE_BOUGHT, new Replacement(Placeholder.AMOUNT, String.valueOf(newAmount)),
new Replacement(Placeholder.ITEM_NAME, newProduct.getLocalizedName()), new Replacement(Placeholder.BUY_PRICE, String.valueOf(newPrice)),
new Replacement(Placeholder.PLAYER, executor.getName())));
} else if(!shop.getVendor().isOnline() && Config.enableVendorBungeeMessages){
String message = LanguageUtils.getMessage( Message.SOMEONE_BOUGHT, new Replacement(Placeholder.AMOUNT, String.valueOf(newAmount)),
new Replacement(Placeholder.ITEM_NAME, newProduct.getLocalizedName()), new Replacement(Placeholder.BUY_PRICE, String.valueOf(newPrice)),
new Replacement(Placeholder.PLAYER, executor.getName()));
sendBungeeMessage(shop.getVendor().getName(),message);
}
} else {
@ -1024,6 +1046,11 @@ public class ShopInteractListener implements Listener {
shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(Message.SOMEONE_SOLD, new Replacement(Placeholder.AMOUNT, String.valueOf(newAmount)),
new Replacement(Placeholder.ITEM_NAME, newProduct.getLocalizedName()), new Replacement(Placeholder.SELL_PRICE, String.valueOf(newPrice)),
new Replacement(Placeholder.PLAYER, executor.getName())));
} else if(!shop.getVendor().isOnline() && Config.enableVendorBungeeMessages){
String message = LanguageUtils.getMessage( Message.SOMEONE_SOLD, new Replacement(Placeholder.AMOUNT, String.valueOf(newAmount)),
new Replacement(Placeholder.ITEM_NAME, newProduct.getLocalizedName()), new Replacement(Placeholder.SELL_PRICE, String.valueOf(newPrice)),
new Replacement(Placeholder.PLAYER, executor.getName()));
sendBungeeMessage(shop.getVendor().getName(),message);
}
} else {
@ -1201,4 +1228,25 @@ public class ShopInteractListener implements Listener {
return (removed == amount);
}
public void sendBungeeMessage(String player, String message) {
try {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
out.writeUTF("Message");
out.writeUTF(player);
out.writeUTF(message);
if (!plugin.getServer().getOnlinePlayers().isEmpty()) {
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
Player p = plugin.getServer().getOnlinePlayers().iterator().next();
p.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
});
}
} catch (Exception e) {
plugin.debug("Failed to send bungee message");
plugin.debug(e);
plugin.getLogger().warning("Failed to send BungeeCord message");
}
}
}

View File

@ -1,8 +1,5 @@
package de.epiceric.shopchest.listeners;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.utils.ShopUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -12,10 +9,20 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockMultiPlaceEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPistonRetractEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.world.StructureGrowEvent;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.utils.ShopUtils;
public class ShopItemListener implements Listener {
private ShopUtils shopUtils;

View File

@ -1,9 +1,5 @@
package de.epiceric.shopchest.listeners;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.utils.Callback;
import java.util.HashSet;
import java.util.Set;
@ -22,6 +18,10 @@ import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.scheduler.BukkitRunnable;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.utils.Callback;
public class ShopUpdateListener implements Listener {
private final ShopChest plugin;

View File

@ -1,13 +1,14 @@
package de.epiceric.shopchest.nms;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
import java.lang.reflect.Field;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.util.UUID;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
public class ArmorStandWrapper {

View File

@ -1,10 +1,11 @@
package de.epiceric.shopchest.nms;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.inventory.ItemStack;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.InvocationTargetException;
import org.bukkit.inventory.ItemStack;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
// For versions below 1.9.4, since Bukkit's BookMeta
// didn't have generations in those versions

View File

@ -1,44 +1,22 @@
package de.epiceric.shopchest.nms;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
public class Hologram {
private static final List<Hologram> HOLOGRAMS = new ArrayList<>();
/**
* @param armorStand Armor stand that's part of a hologram
* @return Hologram, the armor stand is part of
*/
public static Hologram getHologram(ArmorStand armorStand) {
for (Hologram hologram : HOLOGRAMS) {
if (hologram.contains(armorStand)) {
return hologram;
}
}
return null;
}
/**
* @param armorStand Armor stand to check
* @return Whether the armor stand is part of a hologram
*/
public static boolean isPartOfHologram(ArmorStand armorStand) {
return getHologram(armorStand) != null;
}
// concurrent since update task is in async thread
// since this is a fake entity, hologram is hidden per default
private final Set<UUID> viewers = Collections.newSetFromMap(new ConcurrentHashMap<UUID, Boolean>());
private final Set<UUID> viewers = ConcurrentHashMap.newKeySet();
private final List<ArmorStandWrapper> wrappers = new ArrayList<>();
private final Location location;
private final ShopChest plugin;
@ -54,7 +32,6 @@ public class Hologram {
}
this.exists = true;
HOLOGRAMS.add(this);
}
/**
@ -148,7 +125,6 @@ public class Hologram {
wrappers.clear();
exists = false;
HOLOGRAMS.remove(this);
}
/**

View File

@ -1,20 +1,21 @@
package de.epiceric.shopchest.nms;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
public class JsonBuilder {
public static class Part {
@ -116,6 +117,7 @@ public class JsonBuilder {
private Class<?> iChatBaseComponentClass = Utils.getNMSClass("IChatBaseComponent");
private Class<?> packetPlayOutChatClass = Utils.getNMSClass("PacketPlayOutChat");
private Class<?> chatSerializerClass;
private Class<?> chatMessageTypeClass;
public JsonBuilder(ShopChest plugin) {
this.plugin = plugin;
@ -126,6 +128,10 @@ public class JsonBuilder {
chatSerializerClass = Utils.getNMSClass("IChatBaseComponent$ChatSerializer");
}
if (Utils.getMajorVersion() >= 16) {
chatMessageTypeClass = Utils.getNMSClass("ChatMessageType");
}
Class<?>[] requiredClasses = new Class<?>[] {
iChatBaseComponentClass, packetPlayOutChatClass, chatSerializerClass
};
@ -221,12 +227,14 @@ public class JsonBuilder {
public void sendJson(Player p) {
try {
Object iChatBaseComponent = chatSerializerClass.getMethod("a", String.class).invoke(null, toString());
Object packetPlayOutChat = packetPlayOutChatClass.getConstructor(iChatBaseComponentClass).newInstance(iChatBaseComponent);
Object packetPlayOutChat = Utils.getMajorVersion() < 16
? packetPlayOutChatClass.getConstructor(iChatBaseComponentClass).newInstance(iChatBaseComponent)
: packetPlayOutChatClass.getConstructor(iChatBaseComponentClass, chatMessageTypeClass, UUID.class)
.newInstance(iChatBaseComponent, chatMessageTypeClass.getField("CHAT").get(null), UUID.randomUUID());
Utils.sendPacket(plugin, packetPlayOutChat, p);
plugin.debug("Sent JSON: " + toString());
} catch (InstantiationException | InvocationTargetException |
IllegalAccessException | NoSuchMethodException e) {
} catch (ReflectiveOperationException e) {
plugin.getLogger().severe("Failed to send JSON with reflection");
plugin.debug("Failed to send JSON with reflection: " + toString());
plugin.debug(e);

View File

@ -1,11 +1,12 @@
package de.epiceric.shopchest.nms;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.InvocationTargetException;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
public class SpawnEggMeta {
@ -68,7 +69,7 @@ public class SpawnEggMeta {
switch (nbtEntityID) {
case "PigZombie":
return EntityType.PIG_ZOMBIE;
return EntityType.valueOf("PIG_ZOMBIE");
case "CaveSpider":
return EntityType.CAVE_SPIDER;
case "LavaSlime":

View File

@ -1,15 +1,10 @@
package de.epiceric.shopchest.shop;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.HologramFormat;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.exceptions.ChestNotFoundException;
import de.epiceric.shopchest.exceptions.NotEnoughSpaceException;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.nms.Hologram;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Utils;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
@ -25,7 +20,16 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.*;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.config.HologramFormat;
import de.epiceric.shopchest.config.Placeholder;
import de.epiceric.shopchest.exceptions.ChestNotFoundException;
import de.epiceric.shopchest.exceptions.NotEnoughSpaceException;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.nms.Hologram;
import de.epiceric.shopchest.utils.ItemUtils;
import de.epiceric.shopchest.utils.Utils;
public class Shop {

View File

@ -1,24 +1,25 @@
package de.epiceric.shopchest.shop;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.utils.Utils;
public class ShopItem {
private final ShopChest plugin;
// concurrent since update task is in async thread
// since this is a fake entity, item is hidden per default
private final Set<UUID> viewers = Collections.newSetFromMap(new ConcurrentHashMap<UUID, Boolean>());
private final Set<UUID> viewers = ConcurrentHashMap.newKeySet();
private final ItemStack itemStack;
private final Location location;
private final UUID uuid = UUID.randomUUID();

View File

@ -1,23 +1,5 @@
package de.epiceric.shopchest.sql;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.ShopBuySellEvent;
import de.epiceric.shopchest.event.ShopBuySellEvent.Type;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.utils.Callback;
import de.epiceric.shopchest.utils.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -37,6 +19,25 @@ import java.util.UUID;
import com.zaxxer.hikari.HikariDataSource;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.ShopBuySellEvent;
import de.epiceric.shopchest.event.ShopBuySellEvent.Type;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.utils.Callback;
import de.epiceric.shopchest.utils.Utils;
public abstract class Database {
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

View File

@ -1,9 +1,5 @@
package de.epiceric.shopchest.sql;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import org.bukkit.scheduler.BukkitRunnable;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
@ -11,6 +7,11 @@ import java.sql.Statement;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.bukkit.scheduler.BukkitRunnable;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
public class MySQL extends Database {
public MySQL(ShopChest plugin) {

View File

@ -1,8 +1,5 @@
package de.epiceric.shopchest.sql;
import de.epiceric.shopchest.ShopChest;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
@ -12,6 +9,8 @@ import java.sql.Statement;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import de.epiceric.shopchest.ShopChest;
public class SQLite extends Database {
public SQLite(ShopChest plugin) {

View File

@ -1,8 +1,9 @@
package de.epiceric.shopchest.utils;
import de.epiceric.shopchest.ShopChest;
import org.bukkit.scheduler.BukkitRunnable;
import de.epiceric.shopchest.ShopChest;
public abstract class Callback<T> {
private ShopChest plugin;

View File

@ -1,8 +1,9 @@
package de.epiceric.shopchest.utils;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.ShopProduct;
import de.epiceric.shopchest.shop.Shop.ShopType;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
@ -12,10 +13,9 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.shop.Shop.ShopType;
import de.epiceric.shopchest.shop.ShopProduct;
public class ClickType {
private static Map<UUID, ClickType> playerClickType = new HashMap<>();

View File

@ -1,5 +1,8 @@
package de.epiceric.shopchest.utils;
import java.util.Arrays;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
@ -8,9 +11,6 @@ import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.Potion;
import org.bukkit.potion.PotionType;
import java.util.Arrays;
import java.util.Map;
public class ItemUtils {
public static Map<Enchantment, Integer> getEnchantments(ItemStack itemStack) {

View File

@ -1,12 +1,13 @@
package de.epiceric.shopchest.utils;
import de.epiceric.shopchest.ShopChest;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import de.epiceric.shopchest.ShopChest;
public class ShopUpdater {

View File

@ -1,10 +1,15 @@
package de.epiceric.shopchest.utils;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.ShopsLoadedEvent;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
@ -17,9 +22,11 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.util.Vector;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import de.epiceric.shopchest.ShopChest;
import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.ShopsLoadedEvent;
import de.epiceric.shopchest.shop.Shop;
import de.epiceric.shopchest.shop.Shop.ShopType;
public class ShopUtils {
@ -58,23 +65,24 @@ public class ShopUtils {
}
/**
* Get all shops
* Do not use for removing while iteration!
* Get a collection of all loaded shops
* <p>
* This collection is safe to use for looping over and removing shops.
*
* @see #getShopsCopy()
* @return Read-only collection of all shops, may contain duplicates
* @return Read-only collection of all shops, may contain duplicates for double chests
*/
public Collection<Shop> getShops() {
return shopLocationValues;
return Collections.unmodifiableCollection(new ArrayList<>(shopLocationValues));
}
/**
* Get all shops
* Same as {@link #getShops()} but this is safe to remove while iterating
*
* @see #getShops()
* @return Copy of collection of all shops, may contain duplicates
* @deprecated Use {@link #getShops()} instead
*/
@Deprecated
public Collection<Shop> getShopsCopy() {
return new ArrayList<>(getShops());
}

View File

@ -1,7 +1,5 @@
package de.epiceric.shopchest.utils;
import de.epiceric.shopchest.ShopChest;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
@ -10,6 +8,8 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import de.epiceric.shopchest.ShopChest;
public class UpdateChecker {
private ShopChest plugin;

View File

@ -410,6 +410,8 @@ public class Utils {
dataWatcherObjectFieldNames = new String[] {"W", "AIR_TICKS", "aA", "az", "aB", "aC", "ITEM", "b"};
} else if ("v1_15_R1".equals(version)) {
dataWatcherObjectFieldNames = new String[] {"T", "AIR_TICKS", "aA", "az", "aB", "aC", "ITEM", "b"};
} else if ("v1_16_R1".equals(version)) {
dataWatcherObjectFieldNames = new String[] {"T", "AIR_TICKS", "ay", "ax", "az", "aA", "ITEM", "b"};
} else {
return null;
}

View File

@ -66,6 +66,10 @@ enable-areashop-integration: true
# or sell something from/to his shop or when his shop is out of stock.
enable-vendor-messages: true
# Set whether the vendor of a shop should get messages on all servers when players
# buy or sell something from/to his shop or when his shop is out of stock.
enable-vendor-bungee-messages: false
# Set whether only the shop a player is pointing at should be shown.
# If set to false, every shop near the player (with the specified
# distance) will be shown to him.

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,7 @@ message.noPermission.extend-protected=&cDu hast keine Berechtigung diesen Shop n
message.commandDescription.header=&6==== &c/%COMMAND% &6Hilfe
message.commandDescription.footer=&6==== Ende
message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell-price> - Erstelle einen Shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Erstelle einen Shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [admin] - Erstelle einen Shop.
message.commandDescription.remove=&a/%COMMAND% remove - Entferne einen Shop.
message.commandDescription.info=&a/%COMMAND% info - Rufe Informationen über den Shop ab.
message.commandDescription.removeall=&a/%COMMAND% removeall - Entferne alle Shops eines Spielers.

View File

@ -81,7 +81,7 @@ message.noPermission.extend-protected=&cDu hast keine Berechtigung diesen Shop n
message.commandDescription.header=&6==== &c/%COMMAND% &6Hilfe
message.commandDescription.footer=&6==== Ende
message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell-price> - Erstelle einen Shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Erstelle einen Shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [admin] - Erstelle einen Shop.
message.commandDescription.remove=&a/%COMMAND% remove - Entferne einen Shop.
message.commandDescription.info=&a/%COMMAND% info - Rufe Informationen über den Shop ab.
message.commandDescription.removeall=&a/%COMMAND% removeall - Entferne alle Shops eines Spielers.
@ -112,6 +112,7 @@ block.minecraft.acacia_wood=Akazienholz
block.minecraft.activator_rail=Aktivierungsschiene
block.minecraft.air=Luft
block.minecraft.allium=Sternlauch
block.minecraft.ancient_debris=Antiker Schrott
block.minecraft.andesite=Andesit
block.minecraft.andesite_slab=Andesitstufe
block.minecraft.andesite_stairs=Andesittreppe
@ -121,9 +122,10 @@ block.minecraft.attached_melon_stem=Melonenranke
block.minecraft.attached_pumpkin_stem=Kürbisranke
block.minecraft.azure_bluet=Porzellansternchen
block.minecraft.bamboo=Bambus
block.minecraft.bamboo_sapling=Bambussteckling
block.minecraft.bamboo_sapling=Bambussprössling
block.minecraft.barrel=Fass
block.minecraft.barrier=Barriere
block.minecraft.basalt=Basalt
block.minecraft.beacon=Leuchtfeuer
block.minecraft.bedrock=Grundgestein
block.minecraft.bee_nest=Bienennest
@ -155,6 +157,10 @@ block.minecraft.black_stained_glass=Schwarzes Glas
block.minecraft.black_stained_glass_pane=Schwarze Glasscheibe
block.minecraft.black_terracotta=Schwarze Keramik
block.minecraft.black_wool=Schwarze Wolle
block.minecraft.blackstone=Schwarzstein
block.minecraft.blackstone_slab=Schwarzsteinstufe
block.minecraft.blackstone_stairs=Schwarzsteintreppe
block.minecraft.blackstone_wall=Schwarzsteinmauer
block.minecraft.blast_furnace=Schmelzofen
block.minecraft.blue_bed=Blaues Bett
block.minecraft.blue_carpet=Blauer Teppich
@ -202,9 +208,12 @@ block.minecraft.cartography_table=Kartentisch
block.minecraft.carved_pumpkin=Geschnitzter Kürbis
block.minecraft.cauldron=Kessel
block.minecraft.cave_air=Höhlenluft
block.minecraft.chain=Kette
block.minecraft.chain_command_block=Ketten-Befehlsblock
block.minecraft.chest=Truhe
block.minecraft.chipped_anvil=Angeschlagener Amboss
block.minecraft.chiseled_nether_bricks=Gemeißelte Netherziegel
block.minecraft.chiseled_polished_blackstone=Gemeißelter polierter Schwarzstein
block.minecraft.chiseled_quartz_block=Gemeißelter Quarzblock
block.minecraft.chiseled_red_sandstone=Gemeißelter roter Sandstein
block.minecraft.chiseled_sandstone=Gemeißelter Sandstein
@ -226,10 +235,29 @@ block.minecraft.comparator=Redstone-Komparator
block.minecraft.composter=Komposter
block.minecraft.conduit=Aquisator
block.minecraft.cornflower=Kornblume
block.minecraft.cracked_nether_bricks=Rissige Netherziegel
block.minecraft.cracked_polished_blackstone_bricks=Rissige polierte Schwarzsteinziegel
block.minecraft.cracked_stone_bricks=Rissige Steinziegel
block.minecraft.crafting_table=Werkbank
block.minecraft.creeper_head=Creeperkopf
block.minecraft.creeper_wall_head=Creeper-Wandkopf
block.minecraft.crimson_button=Karmesinknopf
block.minecraft.crimson_door=Karmesintür
block.minecraft.crimson_fence=Karmesinzaun
block.minecraft.crimson_fence_gate=Karmesinzauntor
block.minecraft.crimson_fungus=Karmesinpilz
block.minecraft.crimson_hyphae=Karmesinhyphen
block.minecraft.crimson_nylium=Karmesin-Nezel
block.minecraft.crimson_planks=Karmesinbretter
block.minecraft.crimson_pressure_plate=Karmesindruckplatte
block.minecraft.crimson_roots=Karmesinwurzeln
block.minecraft.crimson_sign=Karmesinschild
block.minecraft.crimson_slab=Karmesinstufe
block.minecraft.crimson_stairs=Karmesintreppe
block.minecraft.crimson_stem=Karmesinstiel
block.minecraft.crimson_trapdoor=Karmesinfalltür
block.minecraft.crimson_wall_sign=Karmesinwandschild
block.minecraft.crying_obsidian=Weinender Obsidian
block.minecraft.cut_red_sandstone=Geschnittener roter Sandstein
block.minecraft.cut_red_sandstone_slab=Geschnittene rote Sandsteinstufe
block.minecraft.cut_sandstone=Geschnittener Sandstein
@ -313,6 +341,7 @@ block.minecraft.fletching_table=Bognertisch
block.minecraft.flower_pot=Blumentopf
block.minecraft.frosted_ice=Brüchiges Eis
block.minecraft.furnace=Ofen
block.minecraft.gilded_blackstone=Golddurchzogener Schwarzstein
block.minecraft.glass=Glas
block.minecraft.glass_pane=Glasscheibe
block.minecraft.glowstone=Glowstone
@ -429,6 +458,7 @@ block.minecraft.lime_stained_glass=Hellgrünes Glas
block.minecraft.lime_stained_glass_pane=Hellgrüne Glasscheibe
block.minecraft.lime_terracotta=Hellgrüne Keramik
block.minecraft.lime_wool=Hellgrüne Wolle
block.minecraft.lodestone=Leitstein
block.minecraft.loom=Webstuhl
block.minecraft.magenta_bed=Magenta Bett
block.minecraft.magenta_carpet=Magenta Teppich
@ -459,10 +489,13 @@ block.minecraft.nether_brick_slab=Netherziegelstufe
block.minecraft.nether_brick_stairs=Netherziegeltreppe
block.minecraft.nether_brick_wall=Netherziegelmauer
block.minecraft.nether_bricks=Netherziegel
block.minecraft.nether_gold_ore=Nethergolderz
block.minecraft.nether_portal=Netherportal
block.minecraft.nether_quartz_ore=Netherquarzerz
block.minecraft.nether_sprouts=Nethersprossen
block.minecraft.nether_wart=Netherwarzen
block.minecraft.nether_wart_block=Netherwarzenblock
block.minecraft.netherite_block=Netheritblock
block.minecraft.netherrack=Netherrack
block.minecraft.note_block=Notenblock
block.minecraft.oak_button=Eichenholzknopf
@ -516,6 +549,17 @@ block.minecraft.podzol=Podsol
block.minecraft.polished_andesite=Polierter Andesit
block.minecraft.polished_andesite_slab=Polierte Andesitstufe
block.minecraft.polished_andesite_stairs=Polierte Andesittreppe
block.minecraft.polished_basalt=Polierter Basalt
block.minecraft.polished_blackstone=Polierter Schwarzstein
block.minecraft.polished_blackstone_brick_slab=Polierte Schwarzsteinziegelstufe
block.minecraft.polished_blackstone_brick_stairs=Polierte Schwarzsteinziegeltreppe
block.minecraft.polished_blackstone_brick_wall=Polierte Schwarzsteinziegelmauer
block.minecraft.polished_blackstone_bricks=Polierte Schwarzsteinziegel
block.minecraft.polished_blackstone_button=Polierter Schwarzsteinknopf
block.minecraft.polished_blackstone_pressure_plate=Polierte Schwarzsteindruckplatte
block.minecraft.polished_blackstone_slab=Polierte Schwarzsteinstufe
block.minecraft.polished_blackstone_stairs=Polierte Schwarzsteintreppe
block.minecraft.polished_blackstone_wall=Polierte Schwarzsteinmauer
block.minecraft.polished_diorite=Polierter Diorit
block.minecraft.polished_diorite_slab=Polierte Dioritstufe
block.minecraft.polished_diorite_stairs=Polierte Diorittreppe
@ -533,6 +577,8 @@ block.minecraft.potted_blue_orchid=Eingetopfte blaue Orchidee
block.minecraft.potted_brown_mushroom=Eingetopfter brauner Pilz
block.minecraft.potted_cactus=Eingetopfter Kaktus
block.minecraft.potted_cornflower=Eingetopfte Kornblume
block.minecraft.potted_crimson_fungus=Eingetopfter Karmesinpilz
block.minecraft.potted_crimson_roots=Eingetopfte Karmesinwurzeln
block.minecraft.potted_dandelion=Eingetopfter Löwenzahn
block.minecraft.potted_dark_oak_sapling=Eingetopfter Schwarzeichensetzling
block.minecraft.potted_dead_bush=Eingetopfter toter Busch
@ -547,6 +593,8 @@ block.minecraft.potted_poppy=Eingetopfter Mohn
block.minecraft.potted_red_mushroom=Eingetopfter roter Pilz
block.minecraft.potted_red_tulip=Eingetopfte rote Tulpe
block.minecraft.potted_spruce_sapling=Eingetopfter Fichtensetzling
block.minecraft.potted_warped_fungus=Eingetopfter Wirrpilz
block.minecraft.potted_warped_roots=Eingetopfte Wirrwurzeln
block.minecraft.potted_white_tulip=Eingetopfte weiße Tulpe
block.minecraft.potted_wither_rose=Eingetopfte Witherrose
block.minecraft.powered_rail=Antriebsschiene
@ -574,6 +622,7 @@ block.minecraft.purpur_pillar=Purpursäule
block.minecraft.purpur_slab=Purpurstufe
block.minecraft.purpur_stairs=Purpurtreppe
block.minecraft.quartz_block=Quarzblock
block.minecraft.quartz_bricks=Quarzziegel
block.minecraft.quartz_pillar=Quarzsäule
block.minecraft.quartz_slab=Quarzstufe
block.minecraft.quartz_stairs=Quarztreppe
@ -608,6 +657,7 @@ block.minecraft.redstone_wall_torch=Redstone-Wandfackel
block.minecraft.redstone_wire=Redstone-Leitung
block.minecraft.repeater=Redstone-Verstärker
block.minecraft.repeating_command_block=Wiederhol-Befehlsblock
block.minecraft.respawn_anchor=Seelenanker
block.minecraft.rose_bush=Rosenstrauch
block.minecraft.sand=Sand
block.minecraft.sandstone=Sandstein
@ -618,6 +668,7 @@ block.minecraft.scaffolding=Gerüst
block.minecraft.sea_lantern=Seelaterne
block.minecraft.sea_pickle=Meeresgurke
block.minecraft.seagrass=Seegras
block.minecraft.shroomlight=Pilzlicht
block.minecraft.shulker_box=Shulkerkiste
block.minecraft.skeleton_skull=Skelettschädel
block.minecraft.skeleton_wall_skull=Skelett-Wandschädel
@ -637,7 +688,13 @@ block.minecraft.smooth_stone=Glatter Stein
block.minecraft.smooth_stone_slab=Glatte Steinstufe
block.minecraft.snow=Schnee
block.minecraft.snow_block=Schneeblock
block.minecraft.soul_campfire=Seelenlagerfeuer
block.minecraft.soul_fire=Seelenfeuer
block.minecraft.soul_lantern=Seelenlaterne
block.minecraft.soul_sand=Seelensand
block.minecraft.soul_soil=Seelenerde
block.minecraft.soul_torch=Seelenfackel
block.minecraft.soul_wall_torch=Seelenwandfackel
block.minecraft.spawner=Spawner
block.minecraft.sponge=Schwamm
block.minecraft.spruce_button=Fichtenholzknopf
@ -669,6 +726,8 @@ block.minecraft.stripped_acacia_log=Entrindeter Akazienstamm
block.minecraft.stripped_acacia_wood=Entrindetes Akazienholz
block.minecraft.stripped_birch_log=Entrindeter Birkenstamm
block.minecraft.stripped_birch_wood=Entrindetes Birkenholz
block.minecraft.stripped_crimson_hyphae=Geschälte Karmesinhyphen
block.minecraft.stripped_crimson_stem=Geschälter Karmesinstiel
block.minecraft.stripped_dark_oak_log=Entrindeter Schwarzeichenstamm
block.minecraft.stripped_dark_oak_wood=Entrindetes Schwarzeichenholz
block.minecraft.stripped_jungle_log=Entrindeter Tropenbaumstamm
@ -677,16 +736,19 @@ block.minecraft.stripped_oak_log=Entrindeter Eichenstamm
block.minecraft.stripped_oak_wood=Entrindetes Eichenholz
block.minecraft.stripped_spruce_log=Entrindeter Fichtenstamm
block.minecraft.stripped_spruce_wood=Entrindetes Fichtenholz
block.minecraft.stripped_warped_hyphae=Geschälte Wirrhyphen
block.minecraft.stripped_warped_stem=Geschälter Wirrstiel
block.minecraft.structure_block=Konstruktionsblock
block.minecraft.structure_void=Konstruktionsleere
block.minecraft.sugar_cane=Zuckerrohr
block.minecraft.sunflower=Sonnenblume
block.minecraft.sweet_berry_bush=Süßbeerenstrauch
block.minecraft.sweet_berry_bush=Süßbeerstrauch
block.minecraft.tall_grass=Hohes Gras
block.minecraft.tall_seagrass=Hohes Seegras
block.minecraft.target=Zielblock
block.minecraft.terracotta=Keramik
block.minecraft.tnt=TNT
block.minecraft.torch=Fackel
block.minecraft.torch=Kohlefackel
block.minecraft.trapped_chest=Redstone-Truhe
block.minecraft.tripwire=Stolperdraht
block.minecraft.tripwire_hook=Haken
@ -694,11 +756,32 @@ block.minecraft.tube_coral=Orgelkoralle
block.minecraft.tube_coral_block=Orgelkorallenblock
block.minecraft.tube_coral_fan=Orgelkorallenfächer
block.minecraft.turtle_egg=Schildkrötenei
block.minecraft.twisting_vines=Zwirbelranken
block.minecraft.twisting_vines_plant=Zwirbelrankenpflanze
block.minecraft.vine=Ranken
block.minecraft.void_air=Leerenluft
block.minecraft.wall_sign=Wandschild
block.minecraft.wall_torch=Wandfackel
block.minecraft.wall_torch=Kohlewandfackel
block.minecraft.warped_button=Wirrknopf
block.minecraft.warped_door=Wirrtür
block.minecraft.warped_fence=Wirrzaun
block.minecraft.warped_fence_gate=Wirrzauntor
block.minecraft.warped_fungus=Wirrpilz
block.minecraft.warped_hyphae=Wirrhyphen
block.minecraft.warped_nylium=Wirr-Nezel
block.minecraft.warped_planks=Wirrbretter
block.minecraft.warped_pressure_plate=Wirrdruckplatte
block.minecraft.warped_roots=Wirrwurzeln
block.minecraft.warped_sign=Wirrschild
block.minecraft.warped_slab=Wirrstufe
block.minecraft.warped_stairs=Wirrtreppe
block.minecraft.warped_stem=Wirrstiel
block.minecraft.warped_trapdoor=Wirrfalltür
block.minecraft.warped_wall_sign=Wirrwandschild
block.minecraft.warped_wart_block=Wirrwarzenblock
block.minecraft.water=Wasser
block.minecraft.weeping_vines=Trauerranken
block.minecraft.weeping_vines_plant=Trauerrankenpflanze
block.minecraft.wet_sponge=Nasser Schwamm
block.minecraft.wheat=Weizenpflanzen
block.minecraft.white_bed=Weißes Bett
@ -949,6 +1032,7 @@ item.minecraft.green_dye=Grüner Farbstoff
item.minecraft.guardian_spawn_egg=Wächter-Spawn-Ei
item.minecraft.gunpowder=Schwarzpulver
item.minecraft.heart_of_the_sea=Herz des Meeres
item.minecraft.hoglin_spawn_egg=Hoglin-Spawn-Ei
item.minecraft.honey_bottle=Honigflasche
item.minecraft.honeycomb=Honigwabe
item.minecraft.hopper_minecart=Trichterlore
@ -1006,6 +1090,7 @@ item.minecraft.lingering_potion.effect.water=Verweilende Wasserflasche
item.minecraft.lingering_potion.effect.water_breathing=Verweiltrank der Unterwasseratmung
item.minecraft.lingering_potion.effect.weakness=Verweiltrank der Schwäche
item.minecraft.llama_spawn_egg=Lama-Spawn-Ei
item.minecraft.lodestone_compass=Leitstein-Kompass
item.minecraft.magenta_dye=Magenta Farbstoff
item.minecraft.magma_cream=Magmacreme
item.minecraft.magma_cube_spawn_egg=Magmawürfel-Spawn-Ei
@ -1035,6 +1120,8 @@ item.minecraft.music_disc_mall=Schallplatte
item.minecraft.music_disc_mall.desc=C418 - Mall
item.minecraft.music_disc_mellohi=Schallplatte
item.minecraft.music_disc_mellohi.desc=C418 - Mellohi
item.minecraft.music_disc_pigstep=Schallplatte
item.minecraft.music_disc_pigstep.desc=Lena Raine Pigstep
item.minecraft.music_disc_stal=Schallplatte
item.minecraft.music_disc_stal.desc=C418 - Stal
item.minecraft.music_disc_strad=Schallplatte
@ -1049,6 +1136,17 @@ item.minecraft.nautilus_shell=Nautilusschale
item.minecraft.nether_brick=Netherziegel
item.minecraft.nether_star=Netherstern
item.minecraft.nether_wart=Netherwarze
item.minecraft.netherite_axe=Netheritaxt
item.minecraft.netherite_boots=Netheritstiefel
item.minecraft.netherite_chestplate=Netheritharnisch
item.minecraft.netherite_helmet=Netherithelm
item.minecraft.netherite_hoe=Netherithacke
item.minecraft.netherite_ingot=Netheritbarren
item.minecraft.netherite_leggings=Netheritbeinschutz
item.minecraft.netherite_pickaxe=Netheritspitzhacke
item.minecraft.netherite_scrap=Netheritplatten
item.minecraft.netherite_shovel=Netheritschaufel
item.minecraft.netherite_sword=Netheritschwert
item.minecraft.oak_boat=Eichenholzboot
item.minecraft.ocelot_spawn_egg=Ozelot-Spawn-Ei
item.minecraft.orange_dye=Oranger Farbstoff
@ -1059,10 +1157,12 @@ item.minecraft.parrot_spawn_egg=Papageien-Spawn-Ei
item.minecraft.phantom_membrane=Phantomhaut
item.minecraft.phantom_spawn_egg=Phantom-Spawn-Ei
item.minecraft.pig_spawn_egg=Schweine-Spawn-Ei
item.minecraft.piglin_banner_pattern.desc=Schnauze
item.minecraft.piglin_spawn_egg=Piglin-Spawn-Ei
item.minecraft.pillager_spawn_egg=Plünderer-Spawn-Ei
item.minecraft.pink_dye=Rosa Farbstoff
item.minecraft.poisonous_potato=Giftige Kartoffel
item.minecraft.polar_bear_spawn_egg=Eisbär-Spawn-Ei
item.minecraft.polar_bear_spawn_egg=Eisbären-Spawn-Ei
item.minecraft.popped_chorus_fruit=Geplatzte Chorusfrucht
item.minecraft.porkchop=Rohes Schweinefleisch
item.minecraft.potato=Kartoffel
@ -1114,12 +1214,12 @@ item.minecraft.salmon_bucket=Lachseimer
item.minecraft.salmon_spawn_egg=Lachs-Spawn-Ei
item.minecraft.scute=Hornschild
item.minecraft.shears=Schere
item.minecraft.sheep_spawn_egg=Schaf-Spawn-Ei
item.minecraft.sheep_spawn_egg=Schafs-Spawn-Ei
item.minecraft.shulker_shell=Shulkerschale
item.minecraft.shulker_spawn_egg=Shulker-Spawn-Ei
item.minecraft.sign=Schild
item.minecraft.silverfish_spawn_egg=Silberfischchen-Spawn-Ei
item.minecraft.skeleton_horse_spawn_egg=Skelettpferd-Spawn-Ei
item.minecraft.skeleton_horse_spawn_egg=Skelettpferde-Spawn-Ei
item.minecraft.skeleton_skull=Skelettschädel
item.minecraft.skeleton_spawn_egg=Skelett-Spawn-Ei
item.minecraft.skull_banner_pattern=Bannervorlage
@ -1162,6 +1262,7 @@ item.minecraft.stone_pickaxe=Steinspitzhacke
item.minecraft.stone_shovel=Steinschaufel
item.minecraft.stone_sword=Steinschwert
item.minecraft.stray_spawn_egg=Eiswanderer-Spawn-Ei
item.minecraft.strider_spawn_egg=Schreiter-Spawn-Ei
item.minecraft.string=Faden
item.minecraft.sugar=Zucker
item.minecraft.suspicious_stew=Seltsame Suppe
@ -1198,10 +1299,11 @@ item.minecraft.tropical_fish_bucket=Tropenfischeimer
item.minecraft.tropical_fish_spawn_egg=Tropenfisch-Spawn-Ei
item.minecraft.turtle_helmet=Schildkrötenpanzer
item.minecraft.turtle_spawn_egg=Schildkröten-Spawn-Ei
item.minecraft.vex_spawn_egg=Plagegeist-Spawn-Ei
item.minecraft.vex_spawn_egg=Plagegeister-Spawn-Ei
item.minecraft.villager_spawn_egg=Dorfbewohner-Spawn-Ei
item.minecraft.vindicator_spawn_egg=Diener-Spawn-Ei
item.minecraft.wandering_trader_spawn_egg=Fahrender-Händler-Spawn-Ei
item.minecraft.warped_fungus_on_a_stick=Wirrpilzrute
item.minecraft.water_bucket=Wassereimer
item.minecraft.wheat=Weizen
item.minecraft.wheat_seeds=Weizenkörner
@ -1209,7 +1311,7 @@ item.minecraft.white_dye=Weißer Farbstoff
item.minecraft.witch_spawn_egg=Hexen-Spawn-Ei
item.minecraft.wither_skeleton_skull=Witherskelettschädel
item.minecraft.wither_skeleton_spawn_egg=Witherskelett-Spawn-Ei
item.minecraft.wolf_spawn_egg=Wolf-Spawn-Ei
item.minecraft.wolf_spawn_egg=Wolfs-Spawn-Ei
item.minecraft.wooden_axe=Holzaxt
item.minecraft.wooden_hoe=Holzhacke
item.minecraft.wooden_pickaxe=Holzspitzhacke
@ -1219,7 +1321,9 @@ item.minecraft.writable_book=Buch und Feder
item.minecraft.written_book=Beschriebenes Buch
item.minecraft.yellow_dye=Gelber Farbstoff
item.minecraft.zombie_head=Zombiekopf
item.minecraft.zombie_horse_spawn_egg=Zombiepferd-Spawn-Ei
item.minecraft.zoglin_spawn_egg=Zoglin-Spawn-Ei
item.minecraft.zombie_horse_spawn_egg=Zombiepferde-Spawn-Ei
item.minecraft.zombie_pigman_spawn_egg=Schweinezombie-Spawn-Ei
item.minecraft.zombie_spawn_egg=Zombie-Spawn-Ei
item.minecraft.zombie_villager_spawn_egg=Dorfbewohnerzombie-Spawn-Ei
item.minecraft.zombie_villager_spawn_egg=Zombiedorfbewohner-Spawn-Ei
item.minecraft.zombified_piglin_spawn_egg=Zombifizierter-Piglin-Spawn-Ei

View File

@ -292,7 +292,7 @@ message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell
# Set the command description message for '/shop create' when you type '/shop' and have permission "shopchest.create.admin"
# Usable Placeholders: %COMMAND%
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Create a shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [admin] - Create a shop.
# Set the command description message for '/shop remove' when you type '/shop'.
# Usable Placeholders: %COMMAND%

View File

@ -285,7 +285,7 @@ message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell
# Set the command description message for '/shop create' when you type '/shop' and have permission "shopchest.create.admin"
# Usable Placeholders: %COMMAND%
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Create a shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [admin] - Create a shop.
# Set the command description message for '/shop remove' when you type '/shop'.
# Usable Placeholders: %COMMAND%
@ -381,6 +381,7 @@ block.minecraft.chiseled_red_sandstone=Chiseled Red Sandstone
block.minecraft.cut_red_sandstone=Cut Red Sandstone
block.minecraft.gravel=Gravel
block.minecraft.gold_ore=Gold Ore
block.minecraft.nether_gold_ore=Nether Gold Ore
block.minecraft.iron_ore=Iron Ore
block.minecraft.coal_ore=Coal Ore
block.minecraft.oak_wood=Oak Wood
@ -486,7 +487,7 @@ block.minecraft.iron_block=Block of Iron
block.minecraft.smooth_stone=Smooth Stone
block.minecraft.smooth_sandstone=Smooth Sandstone
block.minecraft.smooth_red_sandstone=Smooth Red Sandstone
block.minecraft.smooth_quartz=Smooth Quartz
block.minecraft.smooth_quartz=Smooth Quartz Block
block.minecraft.stone_slab=Stone Slab
block.minecraft.smooth_stone_slab=Smooth Stone Slab
block.minecraft.sandstone_slab=Sandstone Slab
@ -515,8 +516,11 @@ block.minecraft.mossy_cobblestone=Mossy Cobblestone
block.minecraft.obsidian=Obsidian
block.minecraft.torch=Torch
block.minecraft.wall_torch=Wall Torch
block.minecraft.soul_torch=Soul Torch
block.minecraft.soul_wall_torch=Soul Wall Torch
block.minecraft.fire=Fire
block.minecraft.spawner=Spawner
block.minecraft.respawn_anchor=Respawn Anchor
block.minecraft.oak_stairs=Oak Stairs
block.minecraft.spruce_stairs=Spruce Stairs
block.minecraft.birch_stairs=Birch Stairs
@ -693,6 +697,53 @@ block.minecraft.nether_bricks=Nether Bricks
block.minecraft.nether_brick_fence=Nether Brick Fence
block.minecraft.nether_brick_stairs=Nether Brick Stairs
block.minecraft.nether_wart=Nether Wart
block.minecraft.warped_wart_block=Warped Wart Block
block.minecraft.warped_stem=Warped Stem
block.minecraft.stripped_warped_stem=Stripped Warped Stem
block.minecraft.warped_hyphae=Warped Hyphae
block.minecraft.stripped_warped_hyphae=Stripped Warped Hyphae
block.minecraft.crimson_stem=Crimson Stem
block.minecraft.stripped_crimson_stem=Stripped Crimson Stem
block.minecraft.crimson_hyphae=Crimson Hyphae
block.minecraft.stripped_crimson_hyphae=Stripped Crimson Hyphae
block.minecraft.warped_nylium=Warped Nylium
block.minecraft.crimson_nylium=Crimson Nylium
block.minecraft.warped_fungus=Warped Fungus
block.minecraft.crimson_fungus=Crimson Fungus
block.minecraft.crimson_roots=Crimson Roots
block.minecraft.warped_roots=Warped Roots
block.minecraft.nether_sprouts=Nether Sprouts
block.minecraft.shroomlight=Shroomlight
block.minecraft.weeping_vines=Weeping Vines
block.minecraft.weeping_vines_plant=Weeping Vines Plant
block.minecraft.twisting_vines=Twisting Vines
block.minecraft.twisting_vines_plant=Twisting Vines Plant
block.minecraft.soul_soil=Soul Soil
block.minecraft.basalt=Basalt
block.minecraft.polished_basalt=Polished Basalt
block.minecraft.warped_planks=Warped Planks
block.minecraft.warped_slab=Warped Slab
block.minecraft.warped_pressure_plate=Warped Pressure Plate
block.minecraft.warped_fence=Warped Fence
block.minecraft.warped_trapdoor=Warped Trapdoor
block.minecraft.warped_fence_gate=Warped Fence Gate
block.minecraft.warped_stairs=Warped Stairs
block.minecraft.warped_button=Warped Button
block.minecraft.warped_door=Warped Door
block.minecraft.warped_sign=Warped Sign
block.minecraft.warped_wall_sign=Warped Wall Sign
block.minecraft.crimson_planks=Crimson Planks
block.minecraft.crimson_slab=Crimson Slab
block.minecraft.crimson_pressure_plate=Crimson Pressure Plate
block.minecraft.crimson_fence=Crimson Fence
block.minecraft.crimson_trapdoor=Crimson Trapdoor
block.minecraft.crimson_fence_gate=Crimson Fence Gate
block.minecraft.crimson_stairs=Crimson Stairs
block.minecraft.crimson_button=Crimson Button
block.minecraft.crimson_door=Crimson Door
block.minecraft.crimson_sign=Crimson Sign
block.minecraft.crimson_wall_sign=Crimson Wall Sign
block.minecraft.soul_fire=Soul Fire
block.minecraft.cauldron=Cauldron
block.minecraft.enchanting_table=Enchanting Table
block.minecraft.anvil=Anvil
@ -846,6 +897,10 @@ block.minecraft.potted_brown_mushroom=Potted Brown Mushroom
block.minecraft.potted_dead_bush=Potted Dead Bush
block.minecraft.potted_cactus=Potted Cactus
block.minecraft.potted_bamboo=Potted Bamboo
block.minecraft.potted_crimson_fungus=Potted Crimson Fungus
block.minecraft.potted_warped_fungus=Potted Warped Fungus
block.minecraft.potted_crimson_roots=Potted Crimson Roots
block.minecraft.potted_warped_roots=Potted Warped Roots
block.minecraft.skeleton_wall_skull=Skeleton Wall Skull
block.minecraft.skeleton_skull=Skeleton Skull
block.minecraft.wither_skeleton_wall_skull=Wither Skeleton Wall Skull
@ -892,9 +947,10 @@ block.minecraft.horn_coral_fan=Horn Coral Fan
block.minecraft.loom=Loom
block.minecraft.conduit=Conduit
block.minecraft.bamboo=Bamboo
block.minecraft.bamboo_sapling=Bamboo Sapling
block.minecraft.bamboo_sapling=Bamboo Shoot
block.minecraft.jigsaw=Jigsaw Block
block.minecraft.composter=Composter
block.minecraft.target=Target
block.minecraft.polished_granite_stairs=Polished Granite Stairs
block.minecraft.smooth_red_sandstone_stairs=Smooth Red Sandstone Stairs
block.minecraft.mossy_stone_brick_stairs=Mossy Stone Brick Stairs
@ -944,12 +1000,39 @@ block.minecraft.lectern=Lectern
block.minecraft.stonecutter=Stonecutter
block.minecraft.bell=Bell
block.minecraft.lantern=Lantern
block.minecraft.soul_lantern=Soul Lantern
block.minecraft.sweet_berry_bush=Sweet Berry Bush
block.minecraft.campfire=Campfire
block.minecraft.soul_campfire=Soul Campfire
block.minecraft.beehive=Beehive
block.minecraft.bee_nest=Bee Nest
block.minecraft.honey_block=Honey Block
block.minecraft.honeycomb_block=Honeycomb Block
block.minecraft.lodestone=Lodestone
block.minecraft.netherite_block=Block of Netherite
block.minecraft.ancient_debris=Ancient Debris
block.minecraft.crying_obsidian=Crying Obsidian
block.minecraft.blackstone=Blackstone
block.minecraft.blackstone_slab=Blackstone Slab
block.minecraft.blackstone_stairs=Blackstone Stairs
block.minecraft.blackstone_wall=Blackstone Wall
block.minecraft.polished_blackstone_bricks=Polished Blackstone Bricks
block.minecraft.polished_blackstone_brick_slab=Polished Blackstone Brick Slab
block.minecraft.polished_blackstone_brick_stairs=Polished Blackstone Brick Stairs
block.minecraft.polished_blackstone_brick_wall=Polished Blackstone Brick Wall
block.minecraft.chiseled_polished_blackstone=Chiseled Polished Blackstone
block.minecraft.cracked_polished_blackstone_bricks=Cracked Polished Blackstone Bricks
block.minecraft.gilded_blackstone=Gilded Blackstone
block.minecraft.polished_blackstone=Polished Blackstone
block.minecraft.polished_blackstone_wall=Polished Blackstone Wall
block.minecraft.polished_blackstone_slab=Polished Blackstone Slab
block.minecraft.polished_blackstone_stairs=Polished Blackstone Stairs
block.minecraft.polished_blackstone_pressure_plate=Polished Blackstone Pressure Plate
block.minecraft.polished_blackstone_button=Polished Blackstone Button
block.minecraft.cracked_nether_bricks=Cracked Nether Bricks
block.minecraft.chiseled_nether_bricks=Chiseled Nether Bricks
block.minecraft.quartz_bricks=Quartz Bricks
block.minecraft.chain=Chain
item.minecraft.name_tag=Name Tag
item.minecraft.lead=Lead
item.minecraft.iron_shovel=Iron Shovel
@ -1062,7 +1145,7 @@ item.minecraft.dark_oak_boat=Dark Oak Boat
item.minecraft.leather=Leather
item.minecraft.milk_bucket=Milk Bucket
item.minecraft.brick=Brick
item.minecraft.clay_ball=Clay
item.minecraft.clay_ball=Clay Ball
item.minecraft.paper=Paper
item.minecraft.book=Book
item.minecraft.slime_ball=Slimeball
@ -1094,6 +1177,7 @@ item.minecraft.music_disc_strad=Music Disc
item.minecraft.music_disc_ward=Music Disc
item.minecraft.music_disc_11=Music Disc
item.minecraft.music_disc_wait=Music Disc
item.minecraft.music_disc_pigstep=Music Disc
item.minecraft.music_disc_13.desc=C418 - 13
item.minecraft.music_disc_cat.desc=C418 - cat
item.minecraft.music_disc_blocks.desc=C418 - blocks
@ -1106,6 +1190,7 @@ item.minecraft.music_disc_strad.desc=C418 - strad
item.minecraft.music_disc_ward.desc=C418 - ward
item.minecraft.music_disc_11.desc=C418 - 11
item.minecraft.music_disc_wait.desc=C418 - wait
item.minecraft.music_disc_pigstep.desc=Lena Raine - Pigstep
item.minecraft.bone=Bone
item.minecraft.ink_sac=Ink Sac
item.minecraft.cactus_green=Cactus Green
@ -1188,6 +1273,7 @@ item.minecraft.endermite_spawn_egg=Endermite Spawn Egg
item.minecraft.evoker_spawn_egg=Evoker Spawn Egg
item.minecraft.ghast_spawn_egg=Ghast Spawn Egg
item.minecraft.guardian_spawn_egg=Guardian Spawn Egg
item.minecraft.hoglin_spawn_egg=Hoglin Spawn Egg
item.minecraft.horse_spawn_egg=Horse Spawn Egg
item.minecraft.husk_spawn_egg=Husk Spawn Egg
item.minecraft.ravager_spawn_egg=Ravager Spawn Egg
@ -1199,6 +1285,7 @@ item.minecraft.ocelot_spawn_egg=Ocelot Spawn Egg
item.minecraft.panda_spawn_egg=Panda Spawn Egg
item.minecraft.parrot_spawn_egg=Parrot Spawn Egg
item.minecraft.pig_spawn_egg=Pig Spawn Egg
item.minecraft.piglin_spawn_egg=Piglin Spawn Egg
item.minecraft.pillager_spawn_egg=Pillager Spawn Egg
item.minecraft.phantom_spawn_egg=Phantom Spawn Egg
item.minecraft.polar_bear_spawn_egg=Polar Bear Spawn Egg
@ -1215,6 +1302,7 @@ item.minecraft.slime_spawn_egg=Slime Spawn Egg
item.minecraft.spider_spawn_egg=Spider Spawn Egg
item.minecraft.squid_spawn_egg=Squid Spawn Egg
item.minecraft.stray_spawn_egg=Stray Spawn Egg
item.minecraft.strider_spawn_egg=Strider Spawn Egg
item.minecraft.trader_llama_spawn_egg=Trader Llama Spawn Egg
item.minecraft.tropical_fish_spawn_egg=Tropical Fish Spawn Egg
item.minecraft.turtle_spawn_egg=Turtle Spawn Egg
@ -1225,9 +1313,11 @@ item.minecraft.vindicator_spawn_egg=Vindicator Spawn Egg
item.minecraft.witch_spawn_egg=Witch Spawn Egg
item.minecraft.wither_skeleton_spawn_egg=Wither Skeleton Spawn Egg
item.minecraft.wolf_spawn_egg=Wolf Spawn Egg
item.minecraft.zoglin_spawn_egg=Zoglin Spawn Egg
item.minecraft.zombie_spawn_egg=Zombie Spawn Egg
item.minecraft.zombie_horse_spawn_egg=Zombie Horse Spawn Egg
item.minecraft.zombie_pigman_spawn_egg=Zombie Pigman Spawn Egg
item.minecraft.zombified_piglin_spawn_egg=Zombified Piglin Spawn Egg
item.minecraft.zombie_villager_spawn_egg=Zombie Villager Spawn Egg
item.minecraft.experience_bottle=Bottle o' Enchanting
item.minecraft.fire_charge=Fire Charge
@ -1290,9 +1380,23 @@ item.minecraft.skull_banner_pattern.desc=Skull Charge
item.minecraft.flower_banner_pattern.desc=Flower Charge
item.minecraft.mojang_banner_pattern.desc=Thing
item.minecraft.globe_banner_pattern.desc=Globe
item.minecraft.piglin_banner_pattern.desc=Snout
item.minecraft.sweet_berries=Sweet Berries
item.minecraft.honey_bottle=Honey Bottle
item.minecraft.honeycomb=Honeycomb
item.minecraft.lodestone_compass=Lodestone Compass
item.minecraft.netherite_scrap=Netherite Scrap
item.minecraft.netherite_ingot=Netherite Ingot
item.minecraft.netherite_helmet=Netherite Helmet
item.minecraft.netherite_chestplate=Netherite Chestplate
item.minecraft.netherite_leggings=Netherite Leggings
item.minecraft.netherite_boots=Netherite Boots
item.minecraft.netherite_axe=Netherite Axe
item.minecraft.netherite_pickaxe=Netherite Pickaxe
item.minecraft.netherite_hoe=Netherite Hoe
item.minecraft.netherite_shovel=Netherite Shovel
item.minecraft.netherite_sword=Netherite Sword
item.minecraft.warped_fungus_on_a_stick=Warped Fungus on a Stick
effect.minecraft.speed=Speed
effect.minecraft.slowness=Slowness
effect.minecraft.haste=Haste