Add support for 1.16.4, drop 1.16.1

This commit is contained in:
Jikoo 2020-11-03 18:18:25 -05:00
parent 00113cc4d4
commit 3fee84fc58
No known key found for this signature in database
GPG key ID: 37FF68B07F639098
7 changed files with 100 additions and 122 deletions

View file

@ -35,8 +35,8 @@
<modules> <modules>
<module>v1_8_R3</module> <module>v1_8_R3</module>
<module>v1_15_R1</module> <module>v1_15_R1</module>
<module>v1_16_R1</module>
<module>v1_16_R2</module> <module>v1_16_R2</module>
<module>v1_16_R3</module>
</modules> </modules>
</profile> </profile>

View file

@ -25,14 +25,14 @@
<version>4.1.5-SNAPSHOT</version> <version>4.1.5-SNAPSHOT</version>
</parent> </parent>
<artifactId>openinvadapter1_16_R1</artifactId> <artifactId>openinvadapter1_16_R3</artifactId>
<name>OpenInvAdapter1_16_R1</name> <name>OpenInvAdapter1_16_R3</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version> <version>1.16.4-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -72,4 +72,4 @@
</plugins> </plugins>
</build> </build>
</project> </project>

View file

@ -14,39 +14,38 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
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.OpenInv;
import com.lishid.openinv.internal.IAnySilentContainer; import com.lishid.openinv.internal.IAnySilentContainer;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import net.minecraft.server.v1_16_R1.Block; import net.minecraft.server.v1_16_R3.Block;
import net.minecraft.server.v1_16_R1.BlockBarrel; import net.minecraft.server.v1_16_R3.BlockBarrel;
import net.minecraft.server.v1_16_R1.BlockChest; import net.minecraft.server.v1_16_R3.BlockChest;
import net.minecraft.server.v1_16_R1.BlockChestTrapped; import net.minecraft.server.v1_16_R3.BlockChestTrapped;
import net.minecraft.server.v1_16_R1.BlockEnderChest; import net.minecraft.server.v1_16_R3.BlockPosition;
import net.minecraft.server.v1_16_R1.BlockPosition; import net.minecraft.server.v1_16_R3.BlockPropertyChestType;
import net.minecraft.server.v1_16_R1.BlockPropertyChestType; import net.minecraft.server.v1_16_R3.BlockShulkerBox;
import net.minecraft.server.v1_16_R1.BlockShulkerBox; import net.minecraft.server.v1_16_R3.ChatMessage;
import net.minecraft.server.v1_16_R1.ChatMessage; import net.minecraft.server.v1_16_R3.Container;
import net.minecraft.server.v1_16_R1.Container; import net.minecraft.server.v1_16_R3.ContainerChest;
import net.minecraft.server.v1_16_R1.ContainerChest; import net.minecraft.server.v1_16_R3.Containers;
import net.minecraft.server.v1_16_R1.Containers; import net.minecraft.server.v1_16_R3.EntityHuman;
import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R1.EntityPlayer; import net.minecraft.server.v1_16_R3.EnumGamemode;
import net.minecraft.server.v1_16_R1.EnumGamemode; import net.minecraft.server.v1_16_R3.IBlockData;
import net.minecraft.server.v1_16_R1.IBlockData; import net.minecraft.server.v1_16_R3.IChatBaseComponent;
import net.minecraft.server.v1_16_R1.IChatBaseComponent; import net.minecraft.server.v1_16_R3.ITileInventory;
import net.minecraft.server.v1_16_R1.ITileInventory; import net.minecraft.server.v1_16_R3.InventoryEnderChest;
import net.minecraft.server.v1_16_R1.InventoryEnderChest; import net.minecraft.server.v1_16_R3.InventoryLargeChest;
import net.minecraft.server.v1_16_R1.InventoryLargeChest; import net.minecraft.server.v1_16_R3.PlayerInteractManager;
import net.minecraft.server.v1_16_R1.PlayerInteractManager; import net.minecraft.server.v1_16_R3.PlayerInventory;
import net.minecraft.server.v1_16_R1.PlayerInventory; import net.minecraft.server.v1_16_R3.TileEntity;
import net.minecraft.server.v1_16_R1.TileEntity; import net.minecraft.server.v1_16_R3.TileEntityChest;
import net.minecraft.server.v1_16_R1.TileEntityChest; import net.minecraft.server.v1_16_R3.TileEntityEnderChest;
import net.minecraft.server.v1_16_R1.TileEntityEnderChest; import net.minecraft.server.v1_16_R3.TileEntityLootable;
import net.minecraft.server.v1_16_R1.TileEntityLootable; import net.minecraft.server.v1_16_R3.TileInventory;
import net.minecraft.server.v1_16_R1.TileInventory; import net.minecraft.server.v1_16_R3.World;
import net.minecraft.server.v1_16_R1.World;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Statistic; import org.bukkit.Statistic;
import org.bukkit.block.Barrel; import org.bukkit.block.Barrel;
@ -149,7 +148,7 @@ public class AnySilentContainer implements IAnySilentContainer {
if (!(relativeData instanceof Chest)) { if (!(relativeData instanceof Chest)) {
return false; return false;
} }
Chest relativeChest = (Chest) relativeData; Chest relativeChest = (Chest) relativeData;
if (relativeChest.getFacing() != chest.getFacing() if (relativeChest.getFacing() != chest.getFacing()
|| relativeChest.getType() != (chest.getType() == Chest.Type.RIGHT ? Chest.Type.LEFT : Chest.Type.RIGHT)) { || relativeChest.getType() != (chest.getType() == Chest.Type.RIGHT ? Chest.Type.LEFT : Chest.Type.RIGHT)) {
@ -215,7 +214,7 @@ public class AnySilentContainer implements IAnySilentContainer {
break; break;
} }
return new ContainerChest(containers, containerCounter, playerInventory, enderChest, rows); return new ContainerChest(containers, containerCounter, playerInventory, enderChest, rows);
}, BlockEnderChest.e)); }, new ChatMessage("container.enderchest")));
bukkitPlayer.incrementStatistic(Statistic.ENDERCHEST_OPENED); bukkitPlayer.incrementStatistic(Statistic.ENDERCHEST_OPENED);
return true; return true;
} }
@ -324,9 +323,9 @@ public class AnySilentContainer implements IAnySilentContainer {
case ENDER_CHEST: case ENDER_CHEST:
case SHULKER_BOX: case SHULKER_BOX:
case BARREL: case BARREL:
break; break;
default: default:
return; return;
} }
EntityPlayer player = PlayerDataManager.getHandle(bukkitPlayer); EntityPlayer player = PlayerDataManager.getHandle(bukkitPlayer);

View file

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
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.OpenInv;
import com.lishid.openinv.internal.IPlayerDataManager; import com.lishid.openinv.internal.IPlayerDataManager;
@ -23,32 +23,32 @@ import com.mojang.authlib.GameProfile;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import net.minecraft.server.v1_16_R1.ChatComponentText; import net.minecraft.server.v1_16_R3.ChatComponentText;
import net.minecraft.server.v1_16_R1.ChatMessageType; import net.minecraft.server.v1_16_R3.ChatMessageType;
import net.minecraft.server.v1_16_R1.Container; import net.minecraft.server.v1_16_R3.Container;
import net.minecraft.server.v1_16_R1.Containers; import net.minecraft.server.v1_16_R3.Containers;
import net.minecraft.server.v1_16_R1.Entity; import net.minecraft.server.v1_16_R3.Entity;
import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R3.EntityHuman;
import net.minecraft.server.v1_16_R1.EntityPlayer; import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R1.MinecraftServer; import net.minecraft.server.v1_16_R3.MinecraftServer;
import net.minecraft.server.v1_16_R1.NBTCompressedStreamTools; import net.minecraft.server.v1_16_R3.NBTCompressedStreamTools;
import net.minecraft.server.v1_16_R1.NBTTagCompound; import net.minecraft.server.v1_16_R3.NBTTagCompound;
import net.minecraft.server.v1_16_R1.PacketPlayOutChat; import net.minecraft.server.v1_16_R3.PacketPlayOutChat;
import net.minecraft.server.v1_16_R1.PacketPlayOutOpenWindow; import net.minecraft.server.v1_16_R3.PacketPlayOutOpenWindow;
import net.minecraft.server.v1_16_R1.PlayerInteractManager; import net.minecraft.server.v1_16_R3.PlayerInteractManager;
import net.minecraft.server.v1_16_R1.PlayerInventory; import net.minecraft.server.v1_16_R3.PlayerInventory;
import net.minecraft.server.v1_16_R1.SystemUtils; import net.minecraft.server.v1_16_R3.SystemUtils;
import net.minecraft.server.v1_16_R1.World; import net.minecraft.server.v1_16_R3.World;
import net.minecraft.server.v1_16_R1.WorldNBTStorage; import net.minecraft.server.v1_16_R3.WorldNBTStorage;
import net.minecraft.server.v1_16_R1.WorldServer; import net.minecraft.server.v1_16_R3.WorldServer;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.craftbukkit.v1_16_R1.CraftServer; import org.bukkit.craftbukkit.v1_16_R3.CraftServer;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R1.event.CraftEventFactory; import org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftContainer; import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftContainer;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.InventoryType;
@ -161,11 +161,10 @@ public class PlayerDataManager implements IPlayerDataManager {
NBTCompressedStreamTools.a(playerData, new FileOutputStream(file)); NBTCompressedStreamTools.a(playerData, new FileOutputStream(file));
if (file1.exists()) { if (file1.exists() && !file1.delete() || !file.renameTo(file1)) {
file1.delete(); LogManager.getLogger().warn("Failed to save player data for {}", player.getDisplayName().getString());
} }
file.renameTo(file1);
} catch (Exception e) { } catch (Exception e) {
LogManager.getLogger().warn("Failed to save player data for {}", player.getDisplayName().getString()); LogManager.getLogger().warn("Failed to save player data for {}", player.getDisplayName().getString());
} }
@ -187,7 +186,7 @@ public class PlayerDataManager implements IPlayerDataManager {
} }
@Nullable @Nullable
@Override @Override
public InventoryView openInventory(@NotNull Player player, @NotNull ISpecialInventory inventory) { public InventoryView openInventory(@NotNull Player player, @NotNull ISpecialInventory inventory) {
EntityPlayer nmsPlayer = getHandle(player); EntityPlayer nmsPlayer = getHandle(player);

View file

@ -14,21 +14,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.lishid.openinv.internal.v1_16_R1; package com.lishid.openinv.internal.v1_16_R3;
import com.lishid.openinv.internal.ISpecialEnderChest; import com.lishid.openinv.internal.ISpecialEnderChest;
import java.util.List; import java.util.List;
import net.minecraft.server.v1_16_R1.AutoRecipeStackManager; import net.minecraft.server.v1_16_R3.AutoRecipeStackManager;
import net.minecraft.server.v1_16_R1.ContainerUtil; import net.minecraft.server.v1_16_R3.ContainerUtil;
import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R3.EntityHuman;
import net.minecraft.server.v1_16_R1.EntityPlayer; import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R1.IInventoryListener; import net.minecraft.server.v1_16_R3.IInventoryListener;
import net.minecraft.server.v1_16_R1.InventoryEnderChest; import net.minecraft.server.v1_16_R3.InventoryEnderChest;
import net.minecraft.server.v1_16_R1.ItemStack; import net.minecraft.server.v1_16_R3.ItemStack;
import net.minecraft.server.v1_16_R1.NonNullList; import net.minecraft.server.v1_16_R3.NonNullList;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftHumanEntity; import org.bukkit.craftbukkit.v1_16_R3.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory; import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;

View file

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.lishid.openinv.internal.v1_16_R1; package com.lishid.openinv.internal.v1_16_R3;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.lishid.openinv.internal.ISpecialPlayerInventory; import com.lishid.openinv.internal.ISpecialPlayerInventory;
@ -22,31 +22,31 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.minecraft.server.v1_16_R1.AutoRecipeStackManager; import net.minecraft.server.v1_16_R3.AutoRecipeStackManager;
import net.minecraft.server.v1_16_R1.ChatMessage; import net.minecraft.server.v1_16_R3.ChatMessage;
import net.minecraft.server.v1_16_R1.ContainerUtil; import net.minecraft.server.v1_16_R3.ContainerUtil;
import net.minecraft.server.v1_16_R1.CrashReport; import net.minecraft.server.v1_16_R3.CrashReport;
import net.minecraft.server.v1_16_R1.CrashReportSystemDetails; import net.minecraft.server.v1_16_R3.CrashReportSystemDetails;
import net.minecraft.server.v1_16_R1.DamageSource; import net.minecraft.server.v1_16_R3.DamageSource;
import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R3.EntityHuman;
import net.minecraft.server.v1_16_R1.EntityPlayer; import net.minecraft.server.v1_16_R3.EntityPlayer;
import net.minecraft.server.v1_16_R1.EnumItemSlot; import net.minecraft.server.v1_16_R3.EnumItemSlot;
import net.minecraft.server.v1_16_R1.IBlockData; import net.minecraft.server.v1_16_R3.IBlockData;
import net.minecraft.server.v1_16_R1.IChatBaseComponent; import net.minecraft.server.v1_16_R3.IChatBaseComponent;
import net.minecraft.server.v1_16_R1.IInventory; import net.minecraft.server.v1_16_R3.IInventory;
import net.minecraft.server.v1_16_R1.Item; import net.minecraft.server.v1_16_R3.Item;
import net.minecraft.server.v1_16_R1.ItemArmor; import net.minecraft.server.v1_16_R3.ItemArmor;
import net.minecraft.server.v1_16_R1.ItemStack; import net.minecraft.server.v1_16_R3.ItemStack;
import net.minecraft.server.v1_16_R1.NBTTagCompound; import net.minecraft.server.v1_16_R3.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagList; import net.minecraft.server.v1_16_R3.NBTTagList;
import net.minecraft.server.v1_16_R1.NonNullList; import net.minecraft.server.v1_16_R3.NonNullList;
import net.minecraft.server.v1_16_R1.PacketPlayOutSetSlot; import net.minecraft.server.v1_16_R3.PacketPlayOutSetSlot;
import net.minecraft.server.v1_16_R1.PlayerInventory; import net.minecraft.server.v1_16_R3.PlayerInventory;
import net.minecraft.server.v1_16_R1.ReportedException; import net.minecraft.server.v1_16_R3.ReportedException;
import net.minecraft.server.v1_16_R1.World; import net.minecraft.server.v1_16_R3.World;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftHumanEntity; import org.bukkit.craftbukkit.v1_16_R3.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory; import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;

20
pom.xml
View file

@ -54,26 +54,6 @@
</activation> </activation>
</profile> </profile>
<profile>
<id>latest</id>
<activation>
<property>
<name>latest</name>
<value>true</value>
</property>
</activation>
</profile>
<profile>
<id>recent</id>
<activation>
<property>
<name>recent</name>
<value>true</value>
</property>
</activation>
</profile>
</profiles> </profiles>
<repositories> <repositories>