diff --git a/internal/pom.xml b/internal/pom.xml index 7db019b..948b922 100644 --- a/internal/pom.xml +++ b/internal/pom.xml @@ -35,8 +35,8 @@ v1_8_R3 v1_15_R1 - v1_16_R1 v1_16_R2 + v1_16_R3 diff --git a/internal/v1_16_R1/pom.xml b/internal/v1_16_R3/pom.xml similarity index 93% rename from internal/v1_16_R1/pom.xml rename to internal/v1_16_R3/pom.xml index 7e6c28a..4661a32 100644 --- a/internal/v1_16_R1/pom.xml +++ b/internal/v1_16_R3/pom.xml @@ -25,14 +25,14 @@ 4.1.5-SNAPSHOT - openinvadapter1_16_R1 - OpenInvAdapter1_16_R1 + openinvadapter1_16_R3 + OpenInvAdapter1_16_R3 org.spigotmc spigot - 1.16.1-R0.1-SNAPSHOT + 1.16.4-R0.1-SNAPSHOT provided @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/AnySilentContainer.java similarity index 89% rename from internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java rename to internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/AnySilentContainer.java index f5bbd2f..e6a2083 100644 --- a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java +++ b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/AnySilentContainer.java @@ -14,39 +14,38 @@ * along with this program. If not, see . */ -package com.lishid.openinv.internal.v1_16_R1; +package com.lishid.openinv.internal.v1_16_R3; import com.lishid.openinv.OpenInv; import com.lishid.openinv.internal.IAnySilentContainer; import java.lang.reflect.Field; -import net.minecraft.server.v1_16_R1.Block; -import net.minecraft.server.v1_16_R1.BlockBarrel; -import net.minecraft.server.v1_16_R1.BlockChest; -import net.minecraft.server.v1_16_R1.BlockChestTrapped; -import net.minecraft.server.v1_16_R1.BlockEnderChest; -import net.minecraft.server.v1_16_R1.BlockPosition; -import net.minecraft.server.v1_16_R1.BlockPropertyChestType; -import net.minecraft.server.v1_16_R1.BlockShulkerBox; -import net.minecraft.server.v1_16_R1.ChatMessage; -import net.minecraft.server.v1_16_R1.Container; -import net.minecraft.server.v1_16_R1.ContainerChest; -import net.minecraft.server.v1_16_R1.Containers; -import net.minecraft.server.v1_16_R1.EntityHuman; -import net.minecraft.server.v1_16_R1.EntityPlayer; -import net.minecraft.server.v1_16_R1.EnumGamemode; -import net.minecraft.server.v1_16_R1.IBlockData; -import net.minecraft.server.v1_16_R1.IChatBaseComponent; -import net.minecraft.server.v1_16_R1.ITileInventory; -import net.minecraft.server.v1_16_R1.InventoryEnderChest; -import net.minecraft.server.v1_16_R1.InventoryLargeChest; -import net.minecraft.server.v1_16_R1.PlayerInteractManager; -import net.minecraft.server.v1_16_R1.PlayerInventory; -import net.minecraft.server.v1_16_R1.TileEntity; -import net.minecraft.server.v1_16_R1.TileEntityChest; -import net.minecraft.server.v1_16_R1.TileEntityEnderChest; -import net.minecraft.server.v1_16_R1.TileEntityLootable; -import net.minecraft.server.v1_16_R1.TileInventory; -import net.minecraft.server.v1_16_R1.World; +import net.minecraft.server.v1_16_R3.Block; +import net.minecraft.server.v1_16_R3.BlockBarrel; +import net.minecraft.server.v1_16_R3.BlockChest; +import net.minecraft.server.v1_16_R3.BlockChestTrapped; +import net.minecraft.server.v1_16_R3.BlockPosition; +import net.minecraft.server.v1_16_R3.BlockPropertyChestType; +import net.minecraft.server.v1_16_R3.BlockShulkerBox; +import net.minecraft.server.v1_16_R3.ChatMessage; +import net.minecraft.server.v1_16_R3.Container; +import net.minecraft.server.v1_16_R3.ContainerChest; +import net.minecraft.server.v1_16_R3.Containers; +import net.minecraft.server.v1_16_R3.EntityHuman; +import net.minecraft.server.v1_16_R3.EntityPlayer; +import net.minecraft.server.v1_16_R3.EnumGamemode; +import net.minecraft.server.v1_16_R3.IBlockData; +import net.minecraft.server.v1_16_R3.IChatBaseComponent; +import net.minecraft.server.v1_16_R3.ITileInventory; +import net.minecraft.server.v1_16_R3.InventoryEnderChest; +import net.minecraft.server.v1_16_R3.InventoryLargeChest; +import net.minecraft.server.v1_16_R3.PlayerInteractManager; +import net.minecraft.server.v1_16_R3.PlayerInventory; +import net.minecraft.server.v1_16_R3.TileEntity; +import net.minecraft.server.v1_16_R3.TileEntityChest; +import net.minecraft.server.v1_16_R3.TileEntityEnderChest; +import net.minecraft.server.v1_16_R3.TileEntityLootable; +import net.minecraft.server.v1_16_R3.TileInventory; +import net.minecraft.server.v1_16_R3.World; import org.bukkit.Material; import org.bukkit.Statistic; import org.bukkit.block.Barrel; @@ -149,7 +148,7 @@ public class AnySilentContainer implements IAnySilentContainer { if (!(relativeData instanceof Chest)) { return false; } - + Chest relativeChest = (Chest) relativeData; if (relativeChest.getFacing() != chest.getFacing() || relativeChest.getType() != (chest.getType() == Chest.Type.RIGHT ? Chest.Type.LEFT : Chest.Type.RIGHT)) { @@ -215,7 +214,7 @@ public class AnySilentContainer implements IAnySilentContainer { break; } return new ContainerChest(containers, containerCounter, playerInventory, enderChest, rows); - }, BlockEnderChest.e)); + }, new ChatMessage("container.enderchest"))); bukkitPlayer.incrementStatistic(Statistic.ENDERCHEST_OPENED); return true; } @@ -324,9 +323,9 @@ public class AnySilentContainer implements IAnySilentContainer { case ENDER_CHEST: case SHULKER_BOX: case BARREL: - break; - default: - return; + break; + default: + return; } EntityPlayer player = PlayerDataManager.getHandle(bukkitPlayer); diff --git a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/PlayerDataManager.java b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/PlayerDataManager.java similarity index 87% rename from internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/PlayerDataManager.java rename to internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/PlayerDataManager.java index b127b43..e0737c5 100644 --- a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/PlayerDataManager.java +++ b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/PlayerDataManager.java @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -package com.lishid.openinv.internal.v1_16_R1; +package com.lishid.openinv.internal.v1_16_R3; import com.lishid.openinv.OpenInv; import com.lishid.openinv.internal.IPlayerDataManager; @@ -23,32 +23,32 @@ import com.mojang.authlib.GameProfile; import java.io.File; import java.io.FileOutputStream; import java.lang.reflect.Field; -import net.minecraft.server.v1_16_R1.ChatComponentText; -import net.minecraft.server.v1_16_R1.ChatMessageType; -import net.minecraft.server.v1_16_R1.Container; -import net.minecraft.server.v1_16_R1.Containers; -import net.minecraft.server.v1_16_R1.Entity; -import net.minecraft.server.v1_16_R1.EntityHuman; -import net.minecraft.server.v1_16_R1.EntityPlayer; -import net.minecraft.server.v1_16_R1.MinecraftServer; -import net.minecraft.server.v1_16_R1.NBTCompressedStreamTools; -import net.minecraft.server.v1_16_R1.NBTTagCompound; -import net.minecraft.server.v1_16_R1.PacketPlayOutChat; -import net.minecraft.server.v1_16_R1.PacketPlayOutOpenWindow; -import net.minecraft.server.v1_16_R1.PlayerInteractManager; -import net.minecraft.server.v1_16_R1.PlayerInventory; -import net.minecraft.server.v1_16_R1.SystemUtils; -import net.minecraft.server.v1_16_R1.World; -import net.minecraft.server.v1_16_R1.WorldNBTStorage; -import net.minecraft.server.v1_16_R1.WorldServer; +import net.minecraft.server.v1_16_R3.ChatComponentText; +import net.minecraft.server.v1_16_R3.ChatMessageType; +import net.minecraft.server.v1_16_R3.Container; +import net.minecraft.server.v1_16_R3.Containers; +import net.minecraft.server.v1_16_R3.Entity; +import net.minecraft.server.v1_16_R3.EntityHuman; +import net.minecraft.server.v1_16_R3.EntityPlayer; +import net.minecraft.server.v1_16_R3.MinecraftServer; +import net.minecraft.server.v1_16_R3.NBTCompressedStreamTools; +import net.minecraft.server.v1_16_R3.NBTTagCompound; +import net.minecraft.server.v1_16_R3.PacketPlayOutChat; +import net.minecraft.server.v1_16_R3.PacketPlayOutOpenWindow; +import net.minecraft.server.v1_16_R3.PlayerInteractManager; +import net.minecraft.server.v1_16_R3.PlayerInventory; +import net.minecraft.server.v1_16_R3.SystemUtils; +import net.minecraft.server.v1_16_R3.World; +import net.minecraft.server.v1_16_R3.WorldNBTStorage; +import net.minecraft.server.v1_16_R3.WorldServer; import org.apache.logging.log4j.LogManager; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.Server; -import org.bukkit.craftbukkit.v1_16_R1.CraftServer; -import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_16_R1.event.CraftEventFactory; -import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftContainer; +import org.bukkit.craftbukkit.v1_16_R3.CraftServer; +import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftContainer; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryType; @@ -161,11 +161,10 @@ public class PlayerDataManager implements IPlayerDataManager { NBTCompressedStreamTools.a(playerData, new FileOutputStream(file)); - if (file1.exists()) { - file1.delete(); + if (file1.exists() && !file1.delete() || !file.renameTo(file1)) { + LogManager.getLogger().warn("Failed to save player data for {}", player.getDisplayName().getString()); } - file.renameTo(file1); } catch (Exception e) { LogManager.getLogger().warn("Failed to save player data for {}", player.getDisplayName().getString()); } @@ -187,7 +186,7 @@ public class PlayerDataManager implements IPlayerDataManager { } @Nullable - @Override + @Override public InventoryView openInventory(@NotNull Player player, @NotNull ISpecialInventory inventory) { EntityPlayer nmsPlayer = getHandle(player); diff --git a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialEnderChest.java b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialEnderChest.java similarity index 91% rename from internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialEnderChest.java rename to internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialEnderChest.java index bacfcaa..7fe8bee 100644 --- a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialEnderChest.java +++ b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialEnderChest.java @@ -14,21 +14,21 @@ * along with this program. If not, see . */ -package com.lishid.openinv.internal.v1_16_R1; +package com.lishid.openinv.internal.v1_16_R3; import com.lishid.openinv.internal.ISpecialEnderChest; import java.util.List; -import net.minecraft.server.v1_16_R1.AutoRecipeStackManager; -import net.minecraft.server.v1_16_R1.ContainerUtil; -import net.minecraft.server.v1_16_R1.EntityHuman; -import net.minecraft.server.v1_16_R1.EntityPlayer; -import net.minecraft.server.v1_16_R1.IInventoryListener; -import net.minecraft.server.v1_16_R1.InventoryEnderChest; -import net.minecraft.server.v1_16_R1.ItemStack; -import net.minecraft.server.v1_16_R1.NonNullList; +import net.minecraft.server.v1_16_R3.AutoRecipeStackManager; +import net.minecraft.server.v1_16_R3.ContainerUtil; +import net.minecraft.server.v1_16_R3.EntityHuman; +import net.minecraft.server.v1_16_R3.EntityPlayer; +import net.minecraft.server.v1_16_R3.IInventoryListener; +import net.minecraft.server.v1_16_R3.InventoryEnderChest; +import net.minecraft.server.v1_16_R3.ItemStack; +import net.minecraft.server.v1_16_R3.NonNullList; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_16_R1.entity.CraftHumanEntity; -import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_16_R3.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.InventoryHolder; diff --git a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialPlayerInventory.java b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialPlayerInventory.java similarity index 94% rename from internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialPlayerInventory.java rename to internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialPlayerInventory.java index 0d00da4..ada345c 100644 --- a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/SpecialPlayerInventory.java +++ b/internal/v1_16_R3/src/main/java/com/lishid/openinv/internal/v1_16_R3/SpecialPlayerInventory.java @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -package com.lishid.openinv.internal.v1_16_R1; +package com.lishid.openinv.internal.v1_16_R3; import com.google.common.collect.ImmutableList; import com.lishid.openinv.internal.ISpecialPlayerInventory; @@ -22,31 +22,31 @@ import java.util.Iterator; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; -import net.minecraft.server.v1_16_R1.AutoRecipeStackManager; -import net.minecraft.server.v1_16_R1.ChatMessage; -import net.minecraft.server.v1_16_R1.ContainerUtil; -import net.minecraft.server.v1_16_R1.CrashReport; -import net.minecraft.server.v1_16_R1.CrashReportSystemDetails; -import net.minecraft.server.v1_16_R1.DamageSource; -import net.minecraft.server.v1_16_R1.EntityHuman; -import net.minecraft.server.v1_16_R1.EntityPlayer; -import net.minecraft.server.v1_16_R1.EnumItemSlot; -import net.minecraft.server.v1_16_R1.IBlockData; -import net.minecraft.server.v1_16_R1.IChatBaseComponent; -import net.minecraft.server.v1_16_R1.IInventory; -import net.minecraft.server.v1_16_R1.Item; -import net.minecraft.server.v1_16_R1.ItemArmor; -import net.minecraft.server.v1_16_R1.ItemStack; -import net.minecraft.server.v1_16_R1.NBTTagCompound; -import net.minecraft.server.v1_16_R1.NBTTagList; -import net.minecraft.server.v1_16_R1.NonNullList; -import net.minecraft.server.v1_16_R1.PacketPlayOutSetSlot; -import net.minecraft.server.v1_16_R1.PlayerInventory; -import net.minecraft.server.v1_16_R1.ReportedException; -import net.minecraft.server.v1_16_R1.World; +import net.minecraft.server.v1_16_R3.AutoRecipeStackManager; +import net.minecraft.server.v1_16_R3.ChatMessage; +import net.minecraft.server.v1_16_R3.ContainerUtil; +import net.minecraft.server.v1_16_R3.CrashReport; +import net.minecraft.server.v1_16_R3.CrashReportSystemDetails; +import net.minecraft.server.v1_16_R3.DamageSource; +import net.minecraft.server.v1_16_R3.EntityHuman; +import net.minecraft.server.v1_16_R3.EntityPlayer; +import net.minecraft.server.v1_16_R3.EnumItemSlot; +import net.minecraft.server.v1_16_R3.IBlockData; +import net.minecraft.server.v1_16_R3.IChatBaseComponent; +import net.minecraft.server.v1_16_R3.IInventory; +import net.minecraft.server.v1_16_R3.Item; +import net.minecraft.server.v1_16_R3.ItemArmor; +import net.minecraft.server.v1_16_R3.ItemStack; +import net.minecraft.server.v1_16_R3.NBTTagCompound; +import net.minecraft.server.v1_16_R3.NBTTagList; +import net.minecraft.server.v1_16_R3.NonNullList; +import net.minecraft.server.v1_16_R3.PacketPlayOutSetSlot; +import net.minecraft.server.v1_16_R3.PlayerInventory; +import net.minecraft.server.v1_16_R3.ReportedException; +import net.minecraft.server.v1_16_R3.World; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_16_R1.entity.CraftHumanEntity; -import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_16_R3.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.InventoryHolder; diff --git a/pom.xml b/pom.xml index ac7b02c..e2f4b06 100644 --- a/pom.xml +++ b/pom.xml @@ -54,26 +54,6 @@ - - latest - - - latest - true - - - - - - recent - - - recent - true - - - -