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

View File

@ -4,14 +4,14 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import net.minecraft.server.v1_16_R3.EntityPlayer; import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.v1_16_R3.MinecraftServer; import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit; 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 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() public static void warnVersion()
{ {
@ -34,16 +34,11 @@ public class ServerInterface extends FreedomService
{ {
} }
public void setOnlineMode(boolean mode)
{
getServer().setOnlineMode(mode);
}
public int purgeWhitelist() public int purgeWhitelist()
{ {
String[] whitelisted = getServer().getPlayerList().getWhitelisted(); String[] whitelisted = getServer().getPlayerList().getWhitelisted();
int size = whitelisted.length; int size = whitelisted.length;
for (EntityPlayer player : getServer().getPlayerList().players) for (EntityPlayer player : getServer().getPlayerList().getPlayers())
{ {
getServer().getPlayerList().getWhitelist().remove(player.getProfile()); getServer().getPlayerList().getWhitelist().remove(player.getProfile());
} }

View File

@ -1,10 +1,10 @@
package me.totalfreedom.totalfreedommod.blocking; package me.totalfreedom.totalfreedommod.blocking;
import me.totalfreedom.totalfreedommod.FreedomService; 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.ChatColor;
import org.bukkit.Tag; 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.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -35,7 +35,7 @@ public class SignBlocker extends FreedomService
if (Tag.SIGNS.getValues().contains(event.getBlock().getType())) if (Tag.SIGNS.getValues().contains(event.getBlock().getType()))
{ {
ItemStack sign = event.getItemInHand(); 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(); NBTTagCompound compound = (nmsSign.hasTag()) ? nmsSign.getTag() : new NBTTagCompound();
assert compound != null; assert compound != null;
NBTTagCompound bet = compound.getCompound("BlockEntityTag"); NBTTagCompound bet = compound.getCompound("BlockEntityTag");

View File

@ -5,13 +5,13 @@ import java.util.List;
import java.util.SplittableRandom; import java.util.SplittableRandom;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import net.minecraft.server.v1_16_R3.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.v1_16_R3.NBTTagList; import net.minecraft.nbt.NBTTagList;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; 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.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -151,7 +151,7 @@ public class Command_modifyitem extends FreedomCommand
{ {
return false; 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(); NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
NBTTagList modifiers = getAttributeList(nmsStack); NBTTagList modifiers = getAttributeList(nmsStack);
NBTTagCompound cmpnd = new NBTTagCompound(); NBTTagCompound cmpnd = new NBTTagCompound();
@ -202,7 +202,7 @@ public class Command_modifyitem extends FreedomCommand
return true; 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) if (stack.getTag() == null)
{ {