From f190bbeac10406d2a85563055c4c0e777323cb53 Mon Sep 17 00:00:00 2001 From: Video Date: Tue, 23 Nov 2021 00:27:57 -0700 Subject: [PATCH] FS-292 --- pom.xml | 12 ++++++------ .../totalfreedommod/ServerInterface.java | 15 +++++---------- .../totalfreedommod/blocking/SignBlocker.java | 6 +++--- .../command/Command_modifyitem.java | 10 +++++----- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index 77a1b10f..306e9453 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ org.spigotmc spigot - 1.16.5-R0.1-SNAPSHOT + 1.17.1-R0.1-SNAPSHOT provided @@ -177,7 +177,7 @@ net.coreprotect coreprotect - 19.5 + 20.1 provided @@ -275,9 +275,9 @@ 3.8.1 TotalFreedomMod.jar - 11 - 11 - 11 + 17 + 17 + 17 @@ -401,7 +401,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.4 + 3.3.0-SNAPSHOT package diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java index 40abc384..3821a949 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java @@ -4,14 +4,14 @@ import java.util.Arrays; import java.util.List; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; -import net.minecraft.server.v1_16_R3.EntityPlayer; -import net.minecraft.server.v1_16_R3.MinecraftServer; +import net.minecraft.server.level.EntityPlayer; +import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_16_R3.CraftServer; +import org.bukkit.craftbukkit.v1_17_R1.CraftServer; public class ServerInterface extends FreedomService { - public static final String COMPILE_NMS_VERSION = "v1_16_R3"; + public static final String COMPILE_NMS_VERSION = "v1_17_R1"; public static void warnVersion() { @@ -34,16 +34,11 @@ public class ServerInterface extends FreedomService { } - public void setOnlineMode(boolean mode) - { - getServer().setOnlineMode(mode); - } - public int purgeWhitelist() { String[] whitelisted = getServer().getPlayerList().getWhitelisted(); int size = whitelisted.length; - for (EntityPlayer player : getServer().getPlayerList().players) + for (EntityPlayer player : getServer().getPlayerList().getPlayers()) { getServer().getPlayerList().getWhitelist().remove(player.getProfile()); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java index 261ce274..3fabc837 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java @@ -1,10 +1,10 @@ package me.totalfreedom.totalfreedommod.blocking; import me.totalfreedom.totalfreedommod.FreedomService; -import net.minecraft.server.v1_16_R3.NBTTagCompound; +import net.minecraft.nbt.NBTTagCompound; import org.bukkit.ChatColor; import org.bukkit.Tag; -import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -35,7 +35,7 @@ public class SignBlocker extends FreedomService if (Tag.SIGNS.getValues().contains(event.getBlock().getType())) { ItemStack sign = event.getItemInHand(); - net.minecraft.server.v1_16_R3.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign); + net.minecraft.world.item.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign); NBTTagCompound compound = (nmsSign.hasTag()) ? nmsSign.getTag() : new NBTTagCompound(); assert compound != null; NBTTagCompound bet = compound.getCompound("BlockEntityTag"); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java index bb7d6ec7..4ba7ab88 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java @@ -5,13 +5,13 @@ import java.util.List; import java.util.SplittableRandom; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import net.minecraft.server.v1_16_R3.NBTTagCompound; -import net.minecraft.server.v1_16_R3.NBTTagList; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import org.apache.commons.lang.StringUtils; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -151,7 +151,7 @@ public class Command_modifyitem extends FreedomCommand { return false; } - net.minecraft.server.v1_16_R3.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); + net.minecraft.world.item.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound(); NBTTagList modifiers = getAttributeList(nmsStack); NBTTagCompound cmpnd = new NBTTagCompound(); @@ -202,7 +202,7 @@ public class Command_modifyitem extends FreedomCommand return true; } - private NBTTagList getAttributeList(net.minecraft.server.v1_16_R3.ItemStack stack) + private NBTTagList getAttributeList(net.minecraft.world.item.ItemStack stack) { if (stack.getTag() == null) {