This commit is contained in:
Video 2021-11-23 00:27:57 -07:00
parent 42143c1163
commit f190bbeac1
4 changed files with 19 additions and 24 deletions

12
pom.xml
View File

@ -142,7 +142,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
@ -177,7 +177,7 @@
<dependency>
<groupId>net.coreprotect</groupId>
<artifactId>coreprotect</artifactId>
<version>19.5</version>
<version>20.1</version>
<scope>provided</scope>
</dependency>
@ -275,9 +275,9 @@
<version>3.8.1</version>
<configuration>
<outputFileName>TotalFreedomMod.jar</outputFileName>
<compilerVersion>11</compilerVersion>
<source>11</source>
<target>11</target>
<compilerVersion>17</compilerVersion>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
@ -401,7 +401,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>

View File

@ -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());
}

View File

@ -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");

View File

@ -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)
{