Readd support for 1.16.x, HopperFilter fix
This commit is contained in:
parent
8f962a4924
commit
abf802de4e
|
@ -16,8 +16,8 @@
|
|||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>16</maven.compiler.target>
|
||||
<maven.compiler.source>16</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -6,9 +6,32 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public record CraftingResult(ItemStack result, ItemStack[] matrixResult, List<ItemStack> overflowItems) {
|
||||
public class CraftingResult {
|
||||
|
||||
private ItemStack result;
|
||||
private ItemStack[] matrixResult;
|
||||
private List<ItemStack> overflowItems;
|
||||
|
||||
public CraftingResult(ItemStack result, ItemStack[] matrixResult, List<ItemStack> overflowItems) {
|
||||
this.result = result;
|
||||
this.matrixResult = matrixResult;
|
||||
this.overflowItems = overflowItems;
|
||||
}
|
||||
|
||||
public void setResultMatrix(int i, ItemStack asBukkitCopy) {
|
||||
matrixResult[i] = Objects.requireNonNullElseGet(asBukkitCopy, () -> new ItemStack(Material.AIR));
|
||||
if (asBukkitCopy == null) asBukkitCopy = new ItemStack(Material.AIR);
|
||||
matrixResult[i] = asBukkitCopy;
|
||||
}
|
||||
|
||||
public List<ItemStack> getOverflowItems() {
|
||||
return overflowItems;
|
||||
}
|
||||
|
||||
public ItemStack getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public ItemStack[] getMatrixResult() {
|
||||
return matrixResult;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.jamesdpeters.minecraft.chests;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
public interface NMSProvider {
|
||||
|
@ -7,6 +8,7 @@ public interface NMSProvider {
|
|||
MaterialChecker getMaterialChecker();
|
||||
CraftingProvider getCraftingProvider();
|
||||
EntityEventListener getEntityEventListener();
|
||||
boolean isEntitiesLoadedOnChunk(Chunk chunk);
|
||||
|
||||
void setItemFrameVisible(ItemFrame itemFrame, boolean visible);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
<artifactId>ChestsPlusPlus_1_16</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigotmc-repo</id>
|
||||
|
|
|
@ -109,7 +109,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.add(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.jamesdpeters.minecraft.chests.CraftingProvider;
|
|||
import com.jamesdpeters.minecraft.chests.EntityEventListener;
|
||||
import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
||||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
|
@ -42,6 +43,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_16();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
<artifactId>ChestsPlusPlus_1_16_R2</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigotmc-repo</id>
|
||||
|
|
|
@ -109,7 +109,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.add(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.jamesdpeters.minecraft.chests.EntityEventListener;
|
|||
import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
||||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import com.jamesdpeters.minecraft.chests.v1_16_R1.EntityEventListener_1_16;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
|
@ -43,6 +44,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_16();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
<artifactId>ChestsPlusPlus_1_16_R3</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigotmc-repo</id>
|
||||
|
|
|
@ -118,7 +118,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.add(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.jamesdpeters.minecraft.chests.EntityEventListener;
|
|||
import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
||||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import com.jamesdpeters.minecraft.chests.v1_16_R1.EntityEventListener_1_16;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
|
@ -43,6 +44,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_16();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.add(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.jamesdpeters.minecraft.chests.CraftingProvider;
|
|||
import com.jamesdpeters.minecraft.chests.EntityEventListener;
|
||||
import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
||||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
|
@ -39,6 +40,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_17();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return chunk.isEntitiesLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.grow(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
|||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import com.jamesdpeters.minecraft.chests.v1_17_R1.EntityEventListener_1_17;
|
||||
import com.jamesdpeters.minecraft.chests.v1_17_R1.MaterialChecker_1_17_R1;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
|
@ -41,6 +42,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_17();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return chunk.isEntitiesLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Crafting implements CraftingProvider {
|
|||
itemstack2.grow(itemstack1.getCount());
|
||||
inventoryCrafting.setItem(i, itemstack2);
|
||||
} else {
|
||||
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
craftItemResult.getOverflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,13 @@ import com.jamesdpeters.minecraft.chests.MaterialChecker;
|
|||
import com.jamesdpeters.minecraft.chests.NMSProvider;
|
||||
import com.jamesdpeters.minecraft.chests.v1_17_R1.EntityEventListener_1_17;
|
||||
import com.jamesdpeters.minecraft.chests.v1_17_R1.MaterialChecker_1_17_R1;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Lidded;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.CraftChunk;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class NMSProviderImpl implements NMSProvider {
|
||||
|
||||
@Override
|
||||
|
@ -41,6 +45,11 @@ public class NMSProviderImpl implements NMSProvider {
|
|||
return new EntityEventListener_1_17();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return chunk.isEntitiesLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
itemFrame.setVisible(visible);
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<version>2.6.3-Beta</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>16</maven.compiler.target>
|
||||
<maven.compiler.source>16</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
|
|
|
@ -96,8 +96,6 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||
//API initialisation
|
||||
ApiSpecific.init(this);
|
||||
|
||||
|
||||
|
||||
//Load storage
|
||||
ServerType.init();
|
||||
SpigotConfig.load(this);
|
||||
|
@ -122,10 +120,7 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||
}), 0, PluginConfig.UPDATE_CHECKER_PERIOD.get() * 20);
|
||||
}
|
||||
|
||||
getServer().getPluginManager().registerEvents(ApiSpecific.getNmsProvider().getEntityEventListener(), this);
|
||||
Bukkit.getWorlds().forEach(world -> {
|
||||
ApiSpecific.getNmsProvider().getEntityEventListener().fixEntities(world);
|
||||
});
|
||||
|
||||
|
||||
//Load storages after load.
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> {
|
||||
|
@ -133,17 +128,33 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||
new Config();
|
||||
getLogger().info("Chests++ Successfully Loaded Config and Recipes");
|
||||
|
||||
//Register commands
|
||||
if (PluginConfig.CHESTLINKS_ENABLED.get()) new ChestLinkCommand().register(this);
|
||||
if (PluginConfig.AUTOCRAFTERS_ENABLED.get()) new AutoCraftCommand().register(this);
|
||||
//LinkedChest
|
||||
if (PluginConfig.CHESTLINKS_ENABLED.get()) {
|
||||
new ChestLinkCommand().register(this);
|
||||
getServer().getPluginManager().registerEvents(new LinkedChestHopperListener(), this);
|
||||
}
|
||||
|
||||
//AutoCrafter
|
||||
if (PluginConfig.AUTOCRAFTERS_ENABLED.get()) {
|
||||
new AutoCraftCommand().register(this);
|
||||
getServer().getPluginManager().registerEvents(new AutoCrafterListener(), this);
|
||||
}
|
||||
|
||||
//HopperFilter
|
||||
if (PluginConfig.HOPPER_FILTERS_ENABLED.get()) {
|
||||
getServer().getPluginManager().registerEvents(new FilterHopperListener(), this);
|
||||
}
|
||||
|
||||
//Shared
|
||||
if (PluginConfig.CHESTLINKS_ENABLED.get() || PluginConfig.AUTOCRAFTERS_ENABLED.get()) {
|
||||
getServer().getPluginManager().registerEvents(new StorageListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
||||
}
|
||||
|
||||
//Other
|
||||
getServer().getPluginManager().registerEvents(new WorldListener(), this);
|
||||
new ChestsPlusPlusCommand().register(this);
|
||||
|
||||
//Register event listeners
|
||||
if (PluginConfig.CHESTLINKS_ENABLED.get() || PluginConfig.AUTOCRAFTERS_ENABLED.get()) getServer().getPluginManager().registerEvents(new StorageListener(), this);
|
||||
if (PluginConfig.AUTOCRAFTERS_ENABLED.get() || PluginConfig.CHESTLINKS_ENABLED.get()) getServer().getPluginManager().registerEvents(new InventoryListener(), this);
|
||||
if (PluginConfig.AUTOCRAFTERS_ENABLED.get()) getServer().getPluginManager().registerEvents(new AutoCrafterListener(), this);
|
||||
if (PluginConfig.HOPPER_FILTERS_ENABLED.get()) getServer().getPluginManager().registerEvents(new HopperListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new WorldListener(), this);
|
||||
Config.getStorageTypes().forEach(storageType -> {
|
||||
if (storageType instanceof AutoCraftingStorageType && PluginConfig.AUTOCRAFTERS_ENABLED.get()) {
|
||||
getServer().getPluginManager().registerEvents(storageType, this);
|
||||
|
@ -152,6 +163,8 @@ public class ChestsPlusPlus extends JavaPlugin {
|
|||
getServer().getPluginManager().registerEvents(storageType, this);
|
||||
}
|
||||
});
|
||||
getServer().getPluginManager().registerEvents(ApiSpecific.getNmsProvider().getEntityEventListener(), this);
|
||||
//Bukkit.getWorlds().forEach(world -> ApiSpecific.getNmsProvider().getEntityEventListener().fixEntities(world));
|
||||
getLogger().info("Chests++ enabled!");
|
||||
}, 1);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.jamesdpeters.minecraft.chests.api;
|
|||
|
||||
import com.jamesdpeters.minecraft.chests.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
||||
public class NMSProviderDefault implements NMSProvider {
|
||||
|
@ -14,17 +15,25 @@ public class NMSProviderDefault implements NMSProvider {
|
|||
String NAME = Bukkit.getServer().getClass().getPackage().getName();
|
||||
String VERSION = NAME.substring(NAME.lastIndexOf('.') + 1);
|
||||
switch (VERSION) {
|
||||
case "v1_16_R2" -> defaultProvider = new com.jamesdpeters.minecraft.chests.v1_16_R2.NMSProviderImpl();
|
||||
case "v1_16_R3" -> defaultProvider = new com.jamesdpeters.minecraft.chests.v1_16_R3.NMSProviderImpl();
|
||||
case "v1_17_R1" -> defaultProvider = new com.jamesdpeters.minecraft.chests.v1_17_R1.NMSProviderImpl();
|
||||
case "v1_18_R1" -> defaultProvider = new com.jamesdpeters.minecraft.chests.v1_18_R1.NMSProviderImpl();
|
||||
case "v1_18_R2" -> defaultProvider = new com.jamesdpeters.minecraft.chests.v1_18_R2.NMSProviderImpl();
|
||||
default -> {
|
||||
case "v1_16_R2":
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_16_R2.NMSProviderImpl();
|
||||
break;
|
||||
case "v1_16_R3":
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_16_R3.NMSProviderImpl();
|
||||
break;
|
||||
case "v1_17_R1":
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_17_R1.NMSProviderImpl();
|
||||
break;
|
||||
case "v1_18_R1":
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_18_R1.NMSProviderImpl();
|
||||
case "v1_18_R2":
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_18_R2.NMSProviderImpl();
|
||||
break;
|
||||
default:
|
||||
ChestsPlusPlus.PLUGIN.getLogger().severe("§c=======================================================");
|
||||
ChestsPlusPlus.PLUGIN.getLogger().severe("§cThis version is not supported. Please update your server!");
|
||||
ChestsPlusPlus.PLUGIN.getLogger().severe("§c=======================================================");
|
||||
defaultProvider = new com.jamesdpeters.minecraft.chests.v1_16_R1.NMSProviderImpl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +59,11 @@ public class NMSProviderDefault implements NMSProvider {
|
|||
return defaultProvider.getEntityEventListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntitiesLoadedOnChunk(Chunk chunk) {
|
||||
return defaultProvider.isEntitiesLoadedOnChunk(chunk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
|
||||
//Not supported in Bukkit api 1.14.
|
||||
|
|
|
@ -60,11 +60,11 @@ public class AutoCraftCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Only a player can use this command");
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
if (args != null && args.length > 0) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
|
@ -183,8 +183,8 @@ public class AutoCraftCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if ((sender instanceof Player player)) {
|
||||
|
||||
if ((sender instanceof Player)) {
|
||||
Player player = (Player) sender;
|
||||
if (args.length == 1) {
|
||||
return OPTIONS.valuesList;
|
||||
}
|
||||
|
@ -205,22 +205,19 @@ public class AutoCraftCommand extends ServerCommand {
|
|||
}
|
||||
if (args.length == 3) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
case MEMBER -> {
|
||||
if (args[1].equals("add-to-all")) return Utils.filterList(Utils.getAllPlayers(), args[2]);
|
||||
if (args[1].equals("remove-from-all"))
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[2]);
|
||||
return Config.getAutoCraft().getStorageList(player, args[2]);
|
||||
}
|
||||
if (OPTIONS.valueOf(args[0].toUpperCase()) == OPTIONS.MEMBER) {
|
||||
if (args[1].equals("add-to-all")) return Utils.filterList(Utils.getAllPlayers(), args[2]);
|
||||
if (args[1].equals("remove-from-all"))
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[2]);
|
||||
return Config.getAutoCraft().getStorageList(player, args[2]);
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
if (args.length == 4) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
case MEMBER:
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[3]);
|
||||
if (OPTIONS.valueOf(args[0].toUpperCase()) == OPTIONS.MEMBER) {
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[3]);
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
|
|
|
@ -64,11 +64,11 @@ public class ChestLinkCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Only a player can use this command");
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
if (args != null && args.length > 0) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
|
@ -205,8 +205,8 @@ public class ChestLinkCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if ((sender instanceof Player player)) {
|
||||
|
||||
if ((sender instanceof Player)) {
|
||||
Player player = (Player) sender;
|
||||
if (args.length == 1) {
|
||||
return OPTIONS.valuesList;
|
||||
}
|
||||
|
|
|
@ -49,10 +49,11 @@ public class ChestsPlusPlusCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Only a player can use this command");
|
||||
return false;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
if (args != null && args.length > 0) {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
case VERSION:
|
||||
|
@ -83,7 +84,7 @@ public class ChestsPlusPlusCommand extends ServerCommand {
|
|||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if ((sender instanceof Player player)) {
|
||||
if ((sender instanceof Player)) {
|
||||
if (args.length == 1) {
|
||||
return OPTIONS.valuesList;
|
||||
}
|
||||
|
@ -96,15 +97,14 @@ public class ChestsPlusPlusCommand extends ServerCommand {
|
|||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
if (args.length == 3) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
case PARTY -> {
|
||||
String arg = args[1];
|
||||
if (arg.equals("delete") || arg.equals("invite") || arg.equals("remove-member")) {
|
||||
List<String> strings = PartyUtils.getPlayerPartyStorage(player).getOwnedPartiesAsStrings();
|
||||
return Utils.filterList(strings, args[2]);
|
||||
}
|
||||
if (OPTIONS.valueOf(args[0].toUpperCase()) == OPTIONS.PARTY) {
|
||||
String arg = args[1];
|
||||
if (arg.equals("delete") || arg.equals("invite") || arg.equals("remove-member")) {
|
||||
List<String> strings = PartyUtils.getPlayerPartyStorage(player).getOwnedPartiesAsStrings();
|
||||
return Utils.filterList(strings, args[2]);
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
|
@ -112,13 +112,10 @@ public class ChestsPlusPlusCommand extends ServerCommand {
|
|||
}
|
||||
if (args.length == 4) {
|
||||
try {
|
||||
switch (OPTIONS.valueOf(args[0].toUpperCase())) {
|
||||
case PARTY -> {
|
||||
String arg = args[2];
|
||||
if (arg.equals("invite") || arg.equals("remove-member")) {
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[3]);
|
||||
}
|
||||
|
||||
if (OPTIONS.valueOf(args[0].toUpperCase()) == OPTIONS.PARTY) {
|
||||
String arg = args[2];
|
||||
if (arg.equals("invite") || arg.equals("remove-member")) {
|
||||
return Utils.filterList(Utils.getAllPlayers(), args[3]);
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
|
|
|
@ -27,7 +27,8 @@ public class HopperFilter {
|
|||
Collection<Entity> ent = block.getWorld().getNearbyEntities(block.getLocation(), 1.01, 1.01, 1.01);
|
||||
List<Filter> filters = new ArrayList<>(ent.size());
|
||||
for (Entity entity : ent) {
|
||||
if (entity instanceof ItemFrame frame) {
|
||||
if (entity instanceof ItemFrame) {
|
||||
ItemFrame frame = (ItemFrame) entity;
|
||||
if (frame.getItem().getType().equals(Material.AIR)) continue;
|
||||
Block attachedBlock = frame.getLocation().getBlock().getRelative(frame.getAttachedFace());
|
||||
if (block.equals(attachedBlock)) {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package com.jamesdpeters.minecraft.chests.filters;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.jamesdpeters.minecraft.chests.ChestsPlusPlus;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
@ -19,16 +18,17 @@ public class ItemTypeUtil {
|
|||
static {
|
||||
tags = new ArrayList<>();
|
||||
|
||||
tags.add(new Tag<>() {
|
||||
tags.add(new Tag() {
|
||||
|
||||
@Override
|
||||
public boolean isTagged(@NotNull Material item) {
|
||||
public boolean isTagged(@NotNull Keyed item) {
|
||||
return item.equals(Material.WHEAT_SEEDS) || item.equals(Material.PUMPKIN_SEEDS) || item.equals(Material.MELON_SEEDS) || item.equals(Material.BEETROOT_SEEDS);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<Material> getValues() {
|
||||
return Set.of(Material.WHEAT_SEEDS, Material.PUMPKIN_SEEDS, Material.MELON_SEEDS, Material.BEETROOT_SEEDS);
|
||||
return Sets.newHashSet(Material.WHEAT_SEEDS, Material.PUMPKIN_SEEDS, Material.MELON_SEEDS, Material.BEETROOT_SEEDS);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.jamesdpeters.minecraft.chests.serialize.Config;
|
|||
import com.jamesdpeters.minecraft.chests.serialize.LocationInfo;
|
||||
import com.jamesdpeters.minecraft.chests.storage.autocraft.AutoCraftingStorage;
|
||||
import com.jamesdpeters.minecraft.chests.storage.chestlink.ChestLinkStorage;
|
||||
import lombok.var;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
|
@ -98,7 +99,7 @@ public class VirtualCraftingHolder implements InventoryHolder {
|
|||
else if (recipe instanceof ShapelessRecipe) setCrafting((ShapelessRecipe) recipe);
|
||||
else {
|
||||
// For ComplexRecipes or other implementations just use the result and original matrix for choices.
|
||||
result = ApiSpecific.getNmsProvider().getCraftingProvider().craft(Bukkit.getWorlds().get(0), matrix).result();
|
||||
result = ApiSpecific.getNmsProvider().getCraftingProvider().craft(Bukkit.getWorlds().get(0), matrix).getResult();
|
||||
recipeChoices = new RecipeChoice[9];
|
||||
for (int i = 0; i < matrix.length; i++) {
|
||||
var item = matrix[i];
|
||||
|
@ -245,7 +246,8 @@ public class VirtualCraftingHolder implements InventoryHolder {
|
|||
|
||||
Inventory output;
|
||||
|
||||
if (blockBelow.getState() instanceof Hopper hopper) {
|
||||
if (blockBelow.getState() instanceof Hopper) {
|
||||
Hopper hopper = (Hopper) blockBelow.getState();
|
||||
if (blockBelow.isBlockPowered() || blockBelow.isBlockIndirectlyPowered()) {
|
||||
continue; //If hopper is powered no crafting should happen.
|
||||
}
|
||||
|
@ -392,20 +394,20 @@ public class VirtualCraftingHolder implements InventoryHolder {
|
|||
// PrepareItemCraftEvent itemCraftEvent = new PrepareItemCraftEvent(craftingInventoryImpl, inventoryView, false);
|
||||
// Bukkit.getPluginManager().callEvent(itemCraftEvent);
|
||||
|
||||
if (craftingResult.result() == null) return false;
|
||||
if (craftingResult.getResult() == null) return false;
|
||||
|
||||
//If we reach here there are enough materials so check for space in the Hopper and update inventory.
|
||||
//Check if output and input are the same inventory to avoid duplication.
|
||||
Inventory tempOutput = sameInv ? sameInventory : Utils.copyInventory(output);
|
||||
HashMap<Integer, ItemStack> map = tempOutput.addItem(craftingResult.result());
|
||||
HashMap<Integer, ItemStack> map = tempOutput.addItem(craftingResult.getResult());
|
||||
|
||||
boolean isEmpty = Arrays.stream(craftingResult.matrixResult())
|
||||
boolean isEmpty = Arrays.stream(craftingResult.getMatrixResult())
|
||||
.allMatch(itemStack -> (itemStack == null || itemStack.getType() == Material.AIR));
|
||||
|
||||
// Add any leftover items from the recipe e.g buckets.
|
||||
HashMap<Integer, ItemStack> craftingMatrixLeftOvers =
|
||||
isEmpty ? Maps.newHashMap()
|
||||
: tempOutput.addItem(craftingResult.matrixResult());
|
||||
: tempOutput.addItem(craftingResult.getMatrixResult());
|
||||
|
||||
//If result fits into output copy over the temporary inventories.
|
||||
if (map.isEmpty() && craftingMatrixLeftOvers.isEmpty()) {
|
||||
|
|
|
@ -43,13 +43,12 @@ public class LanguageFile extends Properties {
|
|||
if (generated) {
|
||||
writeComments(bw, " Chests++ Language File (Version " + BuildConstants.VERSION + ")");
|
||||
writeComments(bw,
|
||||
"""
|
||||
NOTE: This file gets replaced when the plugin launches! If you want to make modifications create a copy first!
|
||||
To create a new language file simply create a copy of this file and rename it to your desired choice for example 'en_US.properties'
|
||||
It should be located in the 'lang' folder
|
||||
Then in config.yml 'language-file: default' would be renamed to 'language-file: en_US'
|
||||
To help contribute to the plugin and provide new language files you can create a pull-request at https://github.com/JamesPeters98/ChestsPlusPlus or join our Discord https://discord.gg/YRs3mP5
|
||||
""".indent(1));
|
||||
"NOTE: This file gets replaced when the plugin launches! If you want to make modifications create a copy first!" + System.lineSeparator() +
|
||||
"To create a new language file simply create a copy of this file and rename it to your desired choice for example 'en_US.properties'" + System.lineSeparator() +
|
||||
"It should be located in the 'lang' folder" + System.lineSeparator() +
|
||||
"Then in config.yml 'language-file: default' would be renamed to 'language-file: en_US'" + System.lineSeparator() +
|
||||
"To help contribute to the plugin and provide new language files you can create a pull-request at https://github.com/JamesPeters98/ChestsPlusPlus or join our Discord https://discord.gg/YRs3mP5"
|
||||
);
|
||||
|
||||
for (String additionalComment : additionalComments) {
|
||||
writeComments(bw, additionalComment);
|
||||
|
|
|
@ -7,10 +7,7 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
import org.bukkit.event.inventory.InventoryInteractEvent;
|
||||
import org.bukkit.event.inventory.*;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -49,12 +46,22 @@ public class AutoCrafterListener implements Listener {
|
|||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onCraftingPlayerUpdate(InventoryClickEvent event) {
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
if (event.getClickedInventory() == player.getOpenInventory().getTopInventory()) {
|
||||
if (event.getSlot() == 0) event.setCancelled(true);
|
||||
if (event.getSlot() >= 1 && event.getSlot() <= 9) {
|
||||
setCraftingItem(event.getInventory(), event.getSlot(), event.getCursor());
|
||||
|
||||
if (event.getView().getTopInventory().getHolder() instanceof VirtualCraftingHolder) {
|
||||
if (event.getAction() == InventoryAction.COLLECT_TO_CURSOR ||
|
||||
event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY ||
|
||||
event.getAction() == InventoryAction.NOTHING) {
|
||||
event.setCancelled(true);
|
||||
craftingUpdate(event);
|
||||
player.updateInventory();
|
||||
return;
|
||||
}
|
||||
if (event.getClickedInventory() == player.getOpenInventory().getTopInventory()) {
|
||||
if (event.getSlot() == 0) event.setCancelled(true);
|
||||
if (event.getSlot() >= 1 && event.getSlot() <= 9) {
|
||||
setCraftingItem(event.getInventory(), event.getSlot(), event.getCursor());
|
||||
event.setCancelled(true);
|
||||
craftingUpdate(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
package com.jamesdpeters.minecraft.chests.listeners;
|
||||
|
||||
import com.jamesdpeters.minecraft.chests.ChestsPlusPlus;
|
||||
import com.jamesdpeters.minecraft.chests.PluginConfig;
|
||||
import com.jamesdpeters.minecraft.chests.api.ApiSpecific;
|
||||
import com.jamesdpeters.minecraft.chests.filters.HopperFilter;
|
||||
import com.jamesdpeters.minecraft.chests.lang.Message;
|
||||
import com.jamesdpeters.minecraft.chests.misc.ServerType;
|
||||
import com.jamesdpeters.minecraft.chests.misc.Utils;
|
||||
import com.jamesdpeters.minecraft.chests.serialize.Config;
|
||||
import com.jamesdpeters.minecraft.chests.PluginConfig;
|
||||
import com.jamesdpeters.minecraft.chests.serialize.SpigotConfig;
|
||||
import com.jamesdpeters.minecraft.chests.storage.chestlink.ChestLinkStorage;
|
||||
import com.jamesdpeters.minecraft.chests.storage.chestlink.ChestLinkStorageType;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Rotation;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
|
@ -26,88 +22,10 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
|||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class HopperListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onHopperMoveEvent(InventoryMoveItemEvent event) {
|
||||
//TO HOPPER
|
||||
if(event.getDestination().getHolder() instanceof Hopper){
|
||||
if(event.getDestination().getLocation() != null){
|
||||
// If the event is cancelled by other plugin
|
||||
if(event.isCancelled()) return;
|
||||
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
|
||||
}
|
||||
|
||||
Function<ItemStack, Boolean> isFilteredItem = (itemStack ->
|
||||
HopperFilter.isInFilter(event.getDestination().getLocation().getBlock(), itemStack));
|
||||
|
||||
event.setCancelled(!isFilteredItem.apply(event.getItem()));
|
||||
|
||||
// Item shouldn't be allowed
|
||||
if (event.isCancelled() && ServerType.getType() == ServerType.Type.PAPER) {
|
||||
int index = event.getSource().first(event.getItem());
|
||||
int hopperAmount = SpigotConfig.getWorldSettings(event.getSource().getLocation()).getHopperAmount();
|
||||
|
||||
// Loop over the inventory until next item is found, if no item found return.
|
||||
while (true) {
|
||||
if (index >= event.getSource().getSize()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack item = event.getSource().getItem(index++);
|
||||
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isFilteredItem.apply(item)) {
|
||||
Utils.hopperMove(event.getSource(), item, hopperAmount, event.getDestination());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void fromHopper(InventoryMoveItemEvent event){
|
||||
//FROM HOPPER
|
||||
if (event.getInitiator().getHolder() instanceof Hopper) {
|
||||
Location location = event.getDestination().getLocation();
|
||||
ChestLinkStorageType storageType = Config.getChestLink();
|
||||
if (storageType == null) return;
|
||||
ChestLinkStorage storage = storageType.getStorage(location);
|
||||
if (storage != null) {
|
||||
if(!event.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(location != null) {
|
||||
int hopperAmount = SpigotConfig.getWorldSettings(location.getWorld()).getHopperAmount();
|
||||
if (Utils.hopperMove(event.getSource(), hopperAmount, storage.getInventory())) {
|
||||
storage.updateDisplayItem();
|
||||
}
|
||||
if (event.getDestination().getHolder() != null) event.getDestination().getHolder().getInventory().clear();
|
||||
if (storage.getInventory().getViewers().size() > 0) storage.sort();
|
||||
}
|
||||
}
|
||||
}.runTaskLater(ChestsPlusPlus.PLUGIN, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onHopperPickup(InventoryPickupItemEvent event) {
|
||||
if (event.getInventory().getHolder() instanceof Hopper) {
|
||||
event.setCancelled(!HopperFilter.isInFilter(event.getInventory().getLocation().getBlock(), event.getItem().getItemStack()));
|
||||
}
|
||||
}
|
||||
public class FilterHopperListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void itemFrameInteract(PlayerInteractEntityEvent event) {
|
||||
|
@ -135,4 +53,51 @@ public class HopperListener implements Listener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onHopperPickup(InventoryPickupItemEvent event) {
|
||||
if (event.getInventory().getHolder() instanceof Hopper) {
|
||||
event.setCancelled(!HopperFilter.isInFilter(event.getInventory().getLocation().getBlock(), event.getItem().getItemStack()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onHopperMoveEvent(InventoryMoveItemEvent event) {
|
||||
//TO HOPPER
|
||||
if(event.getDestination().getHolder() instanceof Hopper) {
|
||||
if(event.getDestination().getLocation() != null) {
|
||||
// If the event is cancelled by other plugin
|
||||
if(event.isCancelled()) return;
|
||||
if(event.getDestination().getLocation().getBlock().isBlockPowered()) return;
|
||||
}
|
||||
|
||||
Function<ItemStack, Boolean> isFilteredItem = (itemStack ->
|
||||
HopperFilter.isInFilter(event.getDestination().getLocation().getBlock(), itemStack));
|
||||
|
||||
event.setCancelled(!isFilteredItem.apply(event.getItem()));
|
||||
|
||||
// Item shouldn't be allowed
|
||||
if (event.isCancelled() && ServerType.getType() == ServerType.Type.PAPER) {
|
||||
int index = event.getSource().first(event.getItem());
|
||||
int hopperAmount = SpigotConfig.getWorldSettings(event.getSource().getLocation()).getHopperAmount();
|
||||
// Loop over the inventory until next item is found, if no item found return.
|
||||
while (true) {
|
||||
if (index >= event.getSource().getSize()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack item = event.getSource().getItem(index++);
|
||||
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isFilteredItem.apply(item)) {
|
||||
Utils.hopperMove(event.getSource(), item, hopperAmount, event.getDestination());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,7 +30,8 @@ public class InventoryListener implements Listener {
|
|||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
try {
|
||||
InventoryHolder holder = event.getInventory().getHolder();
|
||||
if (holder instanceof VirtualInventoryHolder vHolder) {
|
||||
if (holder instanceof VirtualInventoryHolder) {
|
||||
VirtualInventoryHolder vHolder = (VirtualInventoryHolder) holder;
|
||||
vHolder.openPreviousInventory();
|
||||
if (vHolder.didPlayerRemoteOpen(event.getPlayer().getUniqueId())) {
|
||||
Utils.closeInventorySound((Player) event.getPlayer(), event.getInventory());
|
||||
|
@ -45,7 +46,8 @@ public class InventoryListener implements Listener {
|
|||
|
||||
public void inventoryUpdate(InventoryInteractEvent event) {
|
||||
InventoryHolder holder = event.getInventory().getHolder();
|
||||
if (holder instanceof VirtualInventoryHolder vHolder) {
|
||||
if (holder instanceof VirtualInventoryHolder) {
|
||||
VirtualInventoryHolder vHolder = (VirtualInventoryHolder) holder;
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(ChestsPlusPlus.PLUGIN, () -> {
|
||||
vHolder.getStorage().sort();
|
||||
vHolder.getStorage().onItemDisplayUpdate(InventorySorter.getMostCommonItem(event.getInventory()));
|
||||
|
@ -58,18 +60,4 @@ public class InventoryListener implements Listener {
|
|||
public void onInventoryPlayerUpdate(InventoryDragEvent event) {
|
||||
inventoryUpdate(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onCraftingPlayerUpdate(InventoryClickEvent event) {
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
|
||||
if (event.getView().getTopInventory().getHolder() instanceof VirtualCraftingHolder) {
|
||||
if (event.getAction() == InventoryAction.COLLECT_TO_CURSOR ||
|
||||
event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY ||
|
||||
event.getAction() == InventoryAction.NOTHING) {
|
||||
event.setCancelled(true);
|
||||
player.updateInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package com.jamesdpeters.minecraft.chests.listeners;
|
||||
|
||||
import com.jamesdpeters.minecraft.chests.ChestsPlusPlus;
|
||||
import com.jamesdpeters.minecraft.chests.api.ApiSpecific;
|
||||
import com.jamesdpeters.minecraft.chests.filters.HopperFilter;
|
||||
import com.jamesdpeters.minecraft.chests.lang.Message;
|
||||
import com.jamesdpeters.minecraft.chests.misc.ServerType;
|
||||
import com.jamesdpeters.minecraft.chests.misc.Utils;
|
||||
import com.jamesdpeters.minecraft.chests.serialize.Config;
|
||||
import com.jamesdpeters.minecraft.chests.PluginConfig;
|
||||
import com.jamesdpeters.minecraft.chests.serialize.SpigotConfig;
|
||||
import com.jamesdpeters.minecraft.chests.storage.chestlink.ChestLinkStorage;
|
||||
import com.jamesdpeters.minecraft.chests.storage.chestlink.ChestLinkStorageType;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Rotation;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class LinkedChestHopperListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void fromHopper(InventoryMoveItemEvent event) {
|
||||
//FROM HOPPER
|
||||
if (event.getInitiator().getHolder() instanceof Hopper) {
|
||||
Location location = event.getDestination().getLocation();
|
||||
if (location == null) return;
|
||||
if (!Utils.isLocationChunkLoaded(location)) return;
|
||||
|
||||
ChestLinkStorageType storageType = Config.getChestLink();
|
||||
if (storageType == null) return;
|
||||
ChestLinkStorage storage = storageType.getStorage(location);
|
||||
if (storage != null) {
|
||||
if(!event.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
int hopperAmount = SpigotConfig.getWorldSettings(location.getWorld()).getHopperAmount();
|
||||
if (Utils.hopperMove(event.getSource(), hopperAmount, storage.getInventory())) {
|
||||
storage.updateDisplayItem();
|
||||
}
|
||||
if (event.getDestination().getHolder() != null) event.getDestination().getHolder().getInventory().clear();
|
||||
if (storage.getInventory().getViewers().size() > 0) storage.sort();
|
||||
}
|
||||
}.runTaskLater(ChestsPlusPlus.PLUGIN, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -89,7 +89,8 @@ public class StorageListener implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onSignBreak(BlockBreakEvent event) {
|
||||
if (event.getBlock().getState() instanceof Sign sign) {
|
||||
if (event.getBlock().getState() instanceof Sign) {
|
||||
Sign sign = (Sign) event.getBlock().getState();
|
||||
//Get blockface of sign.
|
||||
if (sign.getBlockData() instanceof Directional) {
|
||||
|
||||
|
|
|
@ -110,10 +110,18 @@ public class PartySelectorMenu implements InventoryProvider {
|
|||
}
|
||||
|
||||
private List<PlayerParty> getParties(OfflinePlayer player) {
|
||||
return switch (type) {
|
||||
case ALL -> PartyUtils.getPlayerPartyStorage(player).getAllParties();
|
||||
case OWNED -> PartyUtils.getPlayerPartyStorage(player).getOwnedPartiesList();
|
||||
case MEMBER_OF -> PartyUtils.getPlayerPartyStorage(player).getPartiesMemberOf();
|
||||
List<PlayerParty> result;
|
||||
switch (type) {
|
||||
case ALL:
|
||||
result = PartyUtils.getPlayerPartyStorage(player).getAllParties();
|
||||
break;
|
||||
case OWNED:
|
||||
result = PartyUtils.getPlayerPartyStorage(player).getOwnedPartiesList();
|
||||
break;
|
||||
default:
|
||||
result = PartyUtils.getPlayerPartyStorage(player).getPartiesMemberOf();
|
||||
break;
|
||||
};
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,8 @@ public class ItemBuilder {
|
|||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
}
|
||||
|
||||
if (skullOwner != null && meta instanceof SkullMeta skullMeta) {
|
||||
if (skullOwner != null && meta instanceof SkullMeta) {
|
||||
SkullMeta skullMeta = (SkullMeta) meta;
|
||||
skullMeta.setOwningPlayer(skullOwner);
|
||||
}
|
||||
itemStack.setItemMeta(meta);
|
||||
|
|
|
@ -29,12 +29,7 @@ import org.bukkit.util.Vector;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -59,7 +54,8 @@ public class Utils {
|
|||
private static void containerAnimation(Inventory inventory, LocationInfo location, boolean open) {
|
||||
if (location != null && Utils.isLocationChunkLoaded(location.getLocation())) {
|
||||
Block block = location.getLocation().getBlock();
|
||||
if (block.getState() instanceof Container chest) {
|
||||
if (block.getState() instanceof Container) {
|
||||
Container chest = (Container) block.getState();
|
||||
if (open) {
|
||||
location.setTileEntityOpener(ApiSpecific.getChestOpener().updateState(inventory, chest, location.getTileEntityOpener()));
|
||||
} else {
|
||||
|
@ -303,14 +299,16 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static List<ItemStack> getItemsFromRecipeChoice(RecipeChoice recipeChoice) {
|
||||
if (recipeChoice instanceof RecipeChoice.MaterialChoice materialChoice) {
|
||||
return materialChoice.getChoices().stream().map(ItemStack::new).toList();
|
||||
if (recipeChoice instanceof RecipeChoice.MaterialChoice) {
|
||||
RecipeChoice.MaterialChoice materialChoice = (RecipeChoice.MaterialChoice) recipeChoice;
|
||||
return materialChoice.getChoices().stream().map(ItemStack::new).collect(Collectors.toList());
|
||||
}
|
||||
else if (recipeChoice instanceof RecipeChoice.ExactChoice exactChoice) {
|
||||
else if (recipeChoice instanceof RecipeChoice.ExactChoice) {
|
||||
RecipeChoice.ExactChoice exactChoice = (RecipeChoice.ExactChoice) recipeChoice;
|
||||
return exactChoice.getChoices();
|
||||
}
|
||||
else {
|
||||
return List.of(recipeChoice.getItemStack());
|
||||
return Collections.singletonList(recipeChoice.getItemStack());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ public class ChestLinkVerifier extends BukkitRunnable {
|
|||
public void run() {
|
||||
Chest chest = (Chest) block.getState();
|
||||
|
||||
if (chest.getInventory().getHolder() instanceof DoubleChest doubleChest) {
|
||||
if (chest.getInventory().getHolder() instanceof DoubleChest) {
|
||||
DoubleChest doubleChest = (DoubleChest) chest.getInventory().getHolder();
|
||||
InventoryHolder right = doubleChest.getRightSide();
|
||||
InventoryHolder left = doubleChest.getLeftSide();
|
||||
if (isChestLinked(doubleChest) && left != null && right != null) {
|
||||
|
@ -79,8 +80,8 @@ public class ChestLinkVerifier extends BukkitRunnable {
|
|||
}
|
||||
|
||||
private void manualCheck(Chest chest) {
|
||||
if (chest.getBlockData() instanceof Directional directional) {
|
||||
BlockFace facing = directional.getFacing();
|
||||
if (chest.getBlockData() instanceof Directional) {
|
||||
BlockFace facing = ((Directional)chest.getBlockData()).getFacing();
|
||||
BlockFace[] perpendulcarFaces = getPerpendicularFaces(facing);
|
||||
if (perpendulcarFaces == null) return;
|
||||
for (BlockFace perpendicularFace : perpendulcarFaces) {
|
||||
|
@ -98,10 +99,15 @@ public class ChestLinkVerifier extends BukkitRunnable {
|
|||
private static final BlockFace[] WE = new BlockFace[]{BlockFace.NORTH, BlockFace.SOUTH};
|
||||
|
||||
private BlockFace[] getPerpendicularFaces(BlockFace face) {
|
||||
return switch (face) {
|
||||
case NORTH, SOUTH -> NS;
|
||||
case WEST, EAST -> WE;
|
||||
default -> null;
|
||||
};
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
return NS;
|
||||
case WEST:
|
||||
case EAST:
|
||||
return WE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.jamesdpeters.minecraft.chests.runnables;
|
||||
|
||||
import com.jamesdpeters.minecraft.chests.ChestsPlusPlus;
|
||||
import com.jamesdpeters.minecraft.chests.api.ApiSpecific;
|
||||
import com.jamesdpeters.minecraft.chests.filters.HopperFilter;
|
||||
import com.jamesdpeters.minecraft.chests.misc.Utils;
|
||||
import com.jamesdpeters.minecraft.chests.serialize.LocationInfo;
|
||||
|
@ -23,7 +24,7 @@ public class VirtualChestToHopper extends BukkitRunnable {
|
|||
}
|
||||
|
||||
public void start() {
|
||||
task = runTaskTimer(ChestsPlusPlus.PLUGIN, 1, 8);
|
||||
task = runTaskTimer(ChestsPlusPlus.PLUGIN, 2, SpigotConfig.getDefault().getTicksPerHopperTransfer());
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
|
@ -35,14 +36,17 @@ public class VirtualChestToHopper extends BukkitRunnable {
|
|||
for (LocationInfo location : storage.getLocations()) {
|
||||
if (location != null) {
|
||||
if (location.getLocation() != null) {
|
||||
if (!PluginConfig.SHOULD_RUN_HOPPERS_UNLOADED_CHUNKS.get() && !Utils.isLocationChunkLoaded(location.getLocation()))
|
||||
if (!Utils.isLocationChunkLoaded(location.getLocation()) || !ApiSpecific.getNmsProvider().isEntitiesLoadedOnChunk(location.getLocation().getChunk())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Location below = location.getLocation().clone().subtract(0, 1, 0);
|
||||
if (below.getBlock().getState() instanceof Hopper hopper) {
|
||||
if (below.getBlock().getState() instanceof Hopper) {
|
||||
if (below.getBlock().isBlockIndirectlyPowered() || below.getBlock().isBlockPowered()) {
|
||||
continue;
|
||||
}
|
||||
if (move(hopper.getLocation(), storage.getInventory(), hopper.getInventory())) {
|
||||
|
||||
if (move(below, storage.getInventory(), ((Hopper)below.getBlock().getState()).getInventory())) {
|
||||
storage.updateDisplayItem();
|
||||
}
|
||||
if (storage.getInventory().getViewers().size() > 0) storage.sort();
|
||||
|
|
|
@ -37,8 +37,8 @@ public class RecipeSerializable implements ConfigurationSerializable {
|
|||
public RecipeSerializable(Map<String, Object> map) {
|
||||
Object obj = map.get("items");
|
||||
if (obj != null) {
|
||||
if (obj instanceof ItemStack[] itemArray) {
|
||||
items = itemArray;
|
||||
if (obj instanceof ItemStack[]) {
|
||||
items = (ItemStack[]) obj;
|
||||
} else {
|
||||
//noinspection unchecked
|
||||
items = ((List<ItemStack>)obj).toArray(new ItemStack[9]);
|
||||
|
|
|
@ -19,7 +19,13 @@ import org.bukkit.persistence.PersistentDataType;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
public record StorageUtils<T extends StorageInfo<S>, S extends AbstractStorage>(StorageType<S> storageType) {
|
||||
public class StorageUtils<S extends AbstractStorage> {
|
||||
|
||||
private StorageType<S> storageType;
|
||||
|
||||
public StorageUtils(StorageType<S> storageType) {
|
||||
this.storageType = storageType;
|
||||
}
|
||||
|
||||
public StorageInfo<S> getStorageInfo(Sign sign, String[] lines, UUID uuid) {
|
||||
if (lines != null) {
|
||||
|
@ -65,11 +71,13 @@ public record StorageUtils<T extends StorageInfo<S>, S extends AbstractStorage>(
|
|||
if (face == null) return null;
|
||||
Block sign = block.getRelative(face);
|
||||
|
||||
if (sign.getBlockData() instanceof Directional directional) {
|
||||
if (sign.getBlockData() instanceof Directional) {
|
||||
Directional directional = (Directional) sign.getBlockData();
|
||||
//Check if the sign is attached to the given block.
|
||||
if (directional.getFacing() != face) return null;
|
||||
//If it is we can extract info from it.
|
||||
if (sign.getState() instanceof Sign s) {
|
||||
if (sign.getState() instanceof Sign) {
|
||||
Sign s = (Sign) sign.getState();
|
||||
return getStorageInfo(s);
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +93,8 @@ public record StorageUtils<T extends StorageInfo<S>, S extends AbstractStorage>(
|
|||
*/
|
||||
public boolean isValidSignPosition(Location location) {
|
||||
Block block = location.getBlock();
|
||||
if (block.getBlockData() instanceof Directional sign) {
|
||||
if (block.getBlockData() instanceof Directional) {
|
||||
Directional sign = (Directional) block.getBlockData();
|
||||
BlockFace facing = sign.getFacing().getOppositeFace();
|
||||
Block toTest = block.getRelative(facing);
|
||||
|
||||
|
|
|
@ -292,7 +292,8 @@ public abstract class AbstractStorage implements ConfigurationSerializable {
|
|||
BlockFace face = getStorageType().getStorageFacing(block);
|
||||
if (face != null) {
|
||||
Block signBlock = block.getRelative(face);
|
||||
if (signBlock.getState() instanceof Sign sign) {
|
||||
if (signBlock.getState() instanceof Sign) {
|
||||
Sign sign = (Sign) signBlock.getState();
|
||||
sign.setLine(1, ChatColor.GREEN + ChatColor.stripColor("[" + newName + "]"));
|
||||
sign.update();
|
||||
}
|
||||
|
@ -411,7 +412,8 @@ public abstract class AbstractStorage implements ConfigurationSerializable {
|
|||
List<LocationInfo> locationInfos = locationInfoList.stream().filter(locationInfo -> locationInfo.isInWorld(player)).collect(Collectors.toList()); // Create a utility method for this
|
||||
locationInfos.forEach(locationInfo -> {
|
||||
if (Utils.isLocationInViewDistance(player, locationInfo.getSignLocation())) {
|
||||
if (locationInfo.getSignLocation().getBlock().getState() instanceof Sign sign) {
|
||||
if (locationInfo.getSignLocation().getBlock().getState() instanceof Sign) {
|
||||
Sign sign = (Sign) locationInfo.getSignLocation().getBlock().getState();
|
||||
player.sendBlockChange(locationInfo.getSignLocation(), sign.getBlockData());
|
||||
player.sendSignChange(locationInfo.getSignLocation(), sign.getLines());
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ public class StorageInfo<T extends AbstractStorage> {
|
|||
this.player = Bukkit.getOfflinePlayer(playerUUID);
|
||||
this.storage = storageType.getStorage(playerUUID, group);
|
||||
if (storage == null) {
|
||||
if (sign.getBlockData() instanceof Directional directional) {
|
||||
if (sign.getBlockData() instanceof Directional) {
|
||||
Directional directional = (Directional) sign.getBlockData();
|
||||
BlockFace storageFace = directional.getFacing().getOppositeFace();
|
||||
Block storageBlock = sign.getBlock().getRelative(storageFace);
|
||||
Player player = Bukkit.getPlayer(playerUUID);
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.jamesdpeters.minecraft.chests.serialize.ConfigStorage;
|
|||
import com.jamesdpeters.minecraft.chests.serialize.LocationInfo;
|
||||
import com.jamesdpeters.minecraft.chests.PluginConfig;
|
||||
import com.jamesdpeters.minecraft.chests.storage.StorageUtils;
|
||||
import lombok.var;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.GameMode;
|
||||
|
@ -47,7 +48,7 @@ import java.util.stream.Collectors;
|
|||
public abstract class StorageType<T extends AbstractStorage> implements Listener {
|
||||
|
||||
private final ConfigStorage store;
|
||||
private final StorageUtils<StorageInfo<T>, T> storageUtils;
|
||||
private final StorageUtils<T> storageUtils;
|
||||
private final HashMap<Location, T> storageCache;
|
||||
|
||||
protected StorageType(ConfigStorage store) {
|
||||
|
@ -56,7 +57,7 @@ public abstract class StorageType<T extends AbstractStorage> implements Listener
|
|||
storageCache = new HashMap<>();
|
||||
}
|
||||
|
||||
public StorageUtils<StorageInfo<T>, T> getStorageUtils() {
|
||||
public StorageUtils<T> getStorageUtils() {
|
||||
return storageUtils;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ public class ChestLinkStorage extends AbstractStorage implements ConfigurationSe
|
|||
this.sortMethod = SortMethod.OFF;
|
||||
|
||||
Block block = location.getBlock();
|
||||
if (block.getState() instanceof Container container) {
|
||||
if (block.getState() instanceof Container) {
|
||||
Container container = (Container) block.getState();
|
||||
getInventory().setContents(container.getInventory().getContents());
|
||||
container.getInventory().clear();
|
||||
updateDisplayItem();
|
||||
|
@ -102,7 +103,8 @@ public class ChestLinkStorage extends AbstractStorage implements ConfigurationSe
|
|||
@Override
|
||||
public void onStorageAdded(Block block, Player player) {
|
||||
//Migrates that chest into InventoryStorage and if full drops it at the chest location.
|
||||
if (block.getState() instanceof Container chest) {
|
||||
if (block.getState() instanceof Container) {
|
||||
Chest chest = (Chest) block.getState();
|
||||
boolean hasOverflow = false;
|
||||
for (ItemStack chestItem : chest.getInventory().getContents()) {
|
||||
if (chestItem != null) {
|
||||
|
@ -147,8 +149,8 @@ public class ChestLinkStorage extends AbstractStorage implements ConfigurationSe
|
|||
public ClickableItem getClickableItem(Player player) {
|
||||
return ClickableItem.from(getIventoryIcon(player), event -> {
|
||||
InventoryHolder inventoryHolder = getInventory().getHolder();
|
||||
if (inventoryHolder instanceof VirtualInventoryHolder virtualInventoryHolder) {
|
||||
virtualInventoryHolder.setPreviousInventory(() ->
|
||||
if (inventoryHolder instanceof VirtualInventoryHolder) {
|
||||
((VirtualInventoryHolder)inventoryHolder).setPreviousInventory(() ->
|
||||
Bukkit.getScheduler().runTask(ChestsPlusPlus.PLUGIN, () -> ChestLinkMenu.getMenu(player).openLastPage(player)));
|
||||
}
|
||||
Utils.openChestInventory(player, getInventory());
|
||||
|
|
|
@ -68,7 +68,8 @@ public class ChestLinkStorageType extends StorageType<ChestLinkStorage> {
|
|||
}
|
||||
|
||||
private void createStorageForBlock(Player player, OfflinePlayer owner, Block block, String identifier, boolean requireSign) {
|
||||
if (block.getBlockData() instanceof Directional chest) {
|
||||
if (block.getBlockData() instanceof Directional) {
|
||||
Directional chest = (Directional) block.getBlockData();
|
||||
BlockFace facing = chest.getFacing();
|
||||
Block toReplace = block.getRelative(facing);
|
||||
placeSign(block, toReplace, facing, player, owner, identifier, Values.ChestLinkTag, requireSign);
|
||||
|
@ -97,7 +98,8 @@ public class ChestLinkStorageType extends StorageType<ChestLinkStorage> {
|
|||
|
||||
@Override
|
||||
public BlockFace getStorageFacing(Block block) {
|
||||
if (block.getBlockData() instanceof Directional chest) {
|
||||
if (block.getBlockData() instanceof Directional) {
|
||||
Directional chest = (Directional) block.getBlockData();
|
||||
return chest.getFacing();
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Chests++ Language File (Version 2.6.3-Beta)
|
||||
# NOTE: This file gets replaced when the plugin launches! If you want to make modifications create a copy first!
|
||||
# To create a new language file simply create a copy of this file and rename it to your desired choice for example 'en_US.properties'
|
||||
# It should be located in the 'lang' folder
|
||||
# Then in config.yml 'language-file: default' would be renamed to 'language-file: en_US'
|
||||
# To help contribute to the plugin and provide new language files you can create a pull-request at https://github.com/JamesPeters98/ChestsPlusPlus or join our Discord https://discord.gg/YRs3mP5
|
||||
#
|
||||
#NOTE: This file gets replaced when the plugin launches! If you want to make modifications create a copy first!
|
||||
#To create a new language file simply create a copy of this file and rename it to your desired choice for example 'en_US.properties'
|
||||
#It should be located in the 'lang' folder
|
||||
#Then in config.yml 'language-file: default' would be renamed to 'language-file: en_US'
|
||||
#To help contribute to the plugin and provide new language files you can create a pull-request at https://github.com/JamesPeters98/ChestsPlusPlus or join our Discord https://discord.gg/YRs3mP5
|
||||
ADDED_MEMBER = Successfully added {player_name} to {storage_type} group {storage_identifier}
|
||||
ADDED_MEMBER_TO_ALL = Successfully added {player_name} to all {storage_type} groups
|
||||
ALREADY_EXISTS_ANVIL = Already exists\!
|
||||
|
|
Loading…
Reference in New Issue