Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development

This commit is contained in:
William Bergh 2020-09-06 18:52:04 +02:00
commit 2072c89f77
18 changed files with 64 additions and 54 deletions

34
pom.xml
View File

@ -46,7 +46,12 @@
<repository> <repository>
<id>CodeMC</id> <id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url> <url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<repository>
<id>nms-repo</id>
<url>https://repo.codemc.org/repository/nms/</url>
</repository> </repository>
<repository> <repository>
@ -136,14 +141,14 @@
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.9</version> <version>1.14</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<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.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -171,7 +176,7 @@
<dependency> <dependency>
<groupId>net.ess3</groupId> <groupId>net.ess3</groupId>
<artifactId>EssentialsX</artifactId> <artifactId>EssentialsX</artifactId>
<version>2.18.0</version> <version>2.18.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -185,7 +190,7 @@
<dependency> <dependency>
<groupId>net.coreprotect</groupId> <groupId>net.coreprotect</groupId>
<artifactId>coreprotect</artifactId> <artifactId>coreprotect</artifactId>
<version>2.18.2</version> <version>19.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -197,10 +202,10 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.destroystokyo.paper</groupId> <groupId>io.papermc</groupId>
<artifactId>paper-api</artifactId> <artifactId>paperlib</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version> <version>1.0.5</version>
<scope>provided</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -217,13 +222,6 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>net.goldtreeservers</groupId> <groupId>net.goldtreeservers</groupId>
<artifactId>worldguardextraflags</artifactId> <artifactId>worldguardextraflags</artifactId>
@ -291,7 +289,7 @@
<plugin> <plugin>
<groupId>pl.project13.maven</groupId> <groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId> <artifactId>git-commit-id-plugin</artifactId>
<version>4.0.1</version> <version>4.0.2</version>
<executions> <executions>
<execution> <execution>
<id>get-the-git-infos</id> <id>get-the-git-infos</id>
@ -439,8 +437,8 @@
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<version>3.1.1</version>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<configuration> <configuration>
<configLocation>checkstyle.xml</configLocation> <configLocation>checkstyle.xml</configLocation>
<failOnViolation>true</failOnViolation> <failOnViolation>true</failOnViolation>

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod; package me.totalfreedom.totalfreedommod;
import io.papermc.lib.PaperLib;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -197,7 +198,7 @@ public class LoginProcess extends FreedomService
int z = FUtil.randomInteger(-10000, 10000); int z = FUtil.randomInteger(-10000, 10000);
int y = player.getWorld().getHighestBlockYAt(x, z); int y = player.getWorld().getHighestBlockYAt(x, z);
Location location = new Location(player.getLocation().getWorld(), x, y, z); Location location = new Location(player.getLocation().getWorld(), x, y, z);
player.teleport(location); PaperLib.teleportAsync(player, location);
player.sendMessage(ChatColor.AQUA + "You have been teleported to a random location automatically."); player.sendMessage(ChatColor.AQUA + "You have been teleported to a random location automatically.");
return; return;
} }

View File

@ -3,14 +3,15 @@ package me.totalfreedom.totalfreedommod;
import ca.momothereal.mojangson.ex.MojangsonParseException; import ca.momothereal.mojangson.ex.MojangsonParseException;
import ca.momothereal.mojangson.value.MojangsonCompound; import ca.momothereal.mojangson.value.MojangsonCompound;
import ca.momothereal.mojangson.value.MojangsonValue; import ca.momothereal.mojangson.value.MojangsonValue;
import io.papermc.lib.PaperLib;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.minecraft.server.v1_16_R1.NBTTagCompound; import net.minecraft.server.v1_16_R2.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagList; import net.minecraft.server.v1_16_R2.NBTTagList;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_16_R2.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;
@ -61,7 +62,7 @@ public class MovementValidator extends FreedomService
if (Math.abs(event.getTo().getX()) >= MAX_XYZ_COORD || Math.abs(event.getTo().getZ()) >= MAX_XYZ_COORD || Math.abs(event.getTo().getY()) >= MAX_XYZ_COORD) if (Math.abs(event.getTo().getX()) >= MAX_XYZ_COORD || Math.abs(event.getTo().getZ()) >= MAX_XYZ_COORD || Math.abs(event.getTo().getY()) >= MAX_XYZ_COORD)
{ {
event.setCancelled(true); event.setCancelled(true);
player.teleport(player.getWorld().getSpawnLocation()); PaperLib.teleportAsync(player, player.getWorld().getSpawnLocation());
} }
if (exploitItem(event.getPlayer().getInventory().getHelmet())) if (exploitItem(event.getPlayer().getInventory().getHelmet()))
@ -110,7 +111,7 @@ public class MovementValidator extends FreedomService
// Validate position // Validate position
if (Math.abs(player.getLocation().getX()) >= MAX_XYZ_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XYZ_COORD || Math.abs(player.getLocation().getY()) >= MAX_XYZ_COORD) if (Math.abs(player.getLocation().getX()) >= MAX_XYZ_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XYZ_COORD || Math.abs(player.getLocation().getY()) >= MAX_XYZ_COORD)
{ {
player.teleport(player.getWorld().getSpawnLocation()); // Illegal position, teleport to spawn PaperLib.teleportAsync(player, player.getWorld().getSpawnLocation()); // Illegal position, teleport to spawn
} }
} }
@ -131,7 +132,7 @@ public class MovementValidator extends FreedomService
private Boolean exploitItem(ItemStack item) private Boolean exploitItem(ItemStack item)
{ {
net.minecraft.server.v1_16_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); net.minecraft.server.v1_16_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(item);
NBTTagList modifiers = getAttributeList(nmsStack); NBTTagList modifiers = getAttributeList(nmsStack);
MojangsonCompound compound = new MojangsonCompound(); MojangsonCompound compound = new MojangsonCompound();
boolean foundNegative = false; boolean foundNegative = false;
@ -168,7 +169,7 @@ public class MovementValidator extends FreedomService
} }
private NBTTagList getAttributeList(net.minecraft.server.v1_16_R1.ItemStack stack) private NBTTagList getAttributeList(net.minecraft.server.v1_16_R2.ItemStack stack)
{ {
if (stack.getTag() == null) if (stack.getTag() == null)
{ {

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_R1.EntityPlayer; import net.minecraft.server.v1_16_R2.EntityPlayer;
import net.minecraft.server.v1_16_R1.MinecraftServer; import net.minecraft.server.v1_16_R2.MinecraftServer;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_16_R1.CraftServer; import org.bukkit.craftbukkit.v1_16_R2.CraftServer;
public class ServerInterface extends FreedomService public class ServerInterface extends FreedomService
{ {
public static final String COMPILE_NMS_VERSION = "v1_16_R1"; public static final String COMPILE_NMS_VERSION = "v1_16_R2";
@Override @Override
public void onStart() public void onStart()

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_R1.NBTTagCompound; import net.minecraft.server.v1_16_R2.NBTTagCompound;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Tag; import org.bukkit.Tag;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_16_R2.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_R1.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign); net.minecraft.server.v1_16_R2.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign);
NBTTagCompound compound = (nmsSign.hasTag()) ? nmsSign.getTag() : new NBTTagCompound(); NBTTagCompound compound = (nmsSign.hasTag()) ? nmsSign.getTag() : new NBTTagCompound();
NBTTagCompound bet = compound.getCompound("BlockEntityTag"); NBTTagCompound bet = compound.getCompound("BlockEntityTag");
String line1 = bet.getString("Text1"); String line1 = bet.getString("Text1");

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.caging; package me.totalfreedom.totalfreedommod.caging;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
@ -71,7 +72,7 @@ public class Cager extends FreedomService
if (outOfCage) if (outOfCage)
{ {
player.getPlayer().teleport(cageLoc.subtract(0, 0.1, 0)); PaperLib.teleportAsync(player.getPlayer(), cageLoc.subtract(0, 0.1, 0));
FUtil.playerMsg(player.getPlayer(), "You may not leave your cage.", ChatColor.RED); FUtil.playerMsg(player.getPlayer(), "You may not leave your cage.", ChatColor.RED);
cage.regenerate(); cage.regenerate();
} }

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -72,7 +73,7 @@ public class Command_hubworld extends FreedomCommand
if (hubWorld == null || playerSender.getWorld() == hubWorld) if (hubWorld == null || playerSender.getWorld() == hubWorld)
{ {
msg("Going to the main world."); msg("Going to the main world.");
playerSender.teleport(server.getWorlds().get(0).getSpawnLocation()); PaperLib.teleportAsync(playerSender, server.getWorlds().get(0).getSpawnLocation());
} }
else else
{ {

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -12,7 +13,7 @@ public class Command_localspawn extends FreedomCommand
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
playerSender.teleport(playerSender.getWorld().getSpawnLocation()); PaperLib.teleportAsync(playerSender, playerSender.getWorld().getSpawnLocation());
msg("Teleported to spawnpoint for world \"" + playerSender.getWorld().getName() + "\"."); msg("Teleported to spawnpoint for world \"" + playerSender.getWorld().getName() + "\".");
return true; return true;
} }

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -72,7 +73,7 @@ public class Command_masterbuilderworld extends FreedomCommand
if (masterBuilderWorld == null || playerSender.getWorld() == masterBuilderWorld) if (masterBuilderWorld == null || playerSender.getWorld() == masterBuilderWorld)
{ {
msg("Going to the main world."); msg("Going to the main world.");
playerSender.teleport(server.getWorlds().get(0).getSpawnLocation()); PaperLib.teleportAsync(playerSender, server.getWorlds().get(0).getSpawnLocation());
} }
else else
{ {

View File

@ -5,13 +5,13 @@ import java.util.List;
import java.util.Random; import java.util.Random;
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_R1.NBTTagCompound; import net.minecraft.server.v1_16_R2.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagList; import net.minecraft.server.v1_16_R2.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_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_16_R2.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;
@ -149,7 +149,7 @@ public class Command_modifyitem extends FreedomCommand
{ {
return false; return false;
} }
net.minecraft.server.v1_16_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); net.minecraft.server.v1_16_R2.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();
@ -199,7 +199,7 @@ public class Command_modifyitem extends FreedomCommand
return true; return true;
} }
private NBTTagList getAttributeList(net.minecraft.server.v1_16_R1.ItemStack stack) private NBTTagList getAttributeList(net.minecraft.server.v1_16_R2.ItemStack stack)
{ {
if (stack.getTag() == null) if (stack.getTag() == null)
{ {

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -10,14 +11,13 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Go to the PlotWorld.", usage = "/<command>", aliases = "pw") @CommandParameters(description = "Go to the PlotWorld.", usage = "/<command>", aliases = "pw")
public class Command_plotworld extends FreedomCommand public class Command_plotworld extends FreedomCommand
{ {
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
World plotworld = server.getWorld("plotworld"); World plotworld = server.getWorld("plotworld");
if (plotworld != null) if (plotworld != null)
{ {
playerSender.teleport(plotworld.getSpawnLocation()); PaperLib.teleportAsync(playerSender, plotworld.getSpawnLocation());
} }
else else
{ {

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.TimerTask; import java.util.TimerTask;
@ -55,7 +56,7 @@ public class Command_ride extends FreedomCommand
if (requester.getWorld() != playerSender.getWorld()) if (requester.getWorld() != playerSender.getWorld())
{ {
requester.teleport(playerSender); PaperLib.teleportAsync(requester, playerSender.getLocation());
} }
playerSender.addPassenger(requester); playerSender.addPassenger(requester);
@ -145,7 +146,7 @@ public class Command_ride extends FreedomCommand
if (player.getWorld() != playerSender.getWorld()) if (player.getWorld() != playerSender.getWorld())
{ {
playerSender.teleport(player); PaperLib.teleportAsync(playerSender, player.getLocation());
} }
player.addPassenger(playerSender); player.addPassenger(playerSender);

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@ -40,7 +41,7 @@ public class Command_spectate extends FreedomCommand
if (playerSender.getWorld() != player.getWorld()) if (playerSender.getWorld() != player.getWorld())
{ {
playerSender.teleport(player); PaperLib.teleportAsync(playerSender, player.getLocation());
} }
playerSender.setSpectatorTarget(player); playerSender.setSpectatorTarget(player);

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -72,7 +73,7 @@ public class Command_staffworld extends FreedomCommand
if (staffWorld == null || playerSender.getWorld() == staffWorld) if (staffWorld == null || playerSender.getWorld() == staffWorld)
{ {
msg("Going to the main world."); msg("Going to the main world.");
playerSender.teleport(server.getWorlds().get(0).getSpawnLocation()); PaperLib.teleportAsync(playerSender, server.getWorlds().get(0).getSpawnLocation());
} }
else else
{ {

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import io.papermc.lib.PaperLib;
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 org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -19,7 +20,7 @@ public class Command_tprandom extends FreedomCommand
int z = FUtil.randomInteger(-50000, 50000); int z = FUtil.randomInteger(-50000, 50000);
int y = playerSender.getWorld().getHighestBlockYAt(x, z); int y = playerSender.getWorld().getHighestBlockYAt(x, z);
Location location = new Location(playerSender.getLocation().getWorld(), x, y, z); Location location = new Location(playerSender.getLocation().getWorld(), x, y, z);
playerSender.teleport(location); PaperLib.teleportAsync(playerSender, location);
msg("Poof!", ChatColor.GREEN); msg("Poof!", ChatColor.GREEN);
return true; return true;
} }

View File

@ -8,7 +8,6 @@ import org.bukkit.entity.EntityType;
public class Groups public class Groups
{ {
public static final List<Material> WOOL_COLORS = Arrays.asList( public static final List<Material> WOOL_COLORS = Arrays.asList(
Material.WHITE_WOOL, Material.WHITE_WOOL,
Material.RED_WOOL, Material.RED_WOOL,
@ -81,6 +80,7 @@ public class Groups
EntityType.PHANTOM, EntityType.PHANTOM,
EntityType.PIG, EntityType.PIG,
EntityType.PIGLIN, EntityType.PIGLIN,
EntityType.PIGLIN_BRUTE,
EntityType.PILLAGER, EntityType.PILLAGER,
EntityType.POLAR_BEAR, EntityType.POLAR_BEAR,
EntityType.PUFFERFISH, EntityType.PUFFERFISH,
@ -147,6 +147,7 @@ public class Groups
Material.PHANTOM_SPAWN_EGG, Material.PHANTOM_SPAWN_EGG,
Material.PIG_SPAWN_EGG, Material.PIG_SPAWN_EGG,
Material.PIGLIN_SPAWN_EGG, Material.PIGLIN_SPAWN_EGG,
Material.PIGLIN_BRUTE_SPAWN_EGG,
Material.PILLAGER_SPAWN_EGG, Material.PILLAGER_SPAWN_EGG,
Material.POLAR_BEAR_SPAWN_EGG, Material.POLAR_BEAR_SPAWN_EGG,
Material.PUFFERFISH_SPAWN_EGG, Material.PUFFERFISH_SPAWN_EGG,

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.world; package me.totalfreedom.totalfreedommod.world;
import io.papermc.lib.PaperLib;
import lombok.Getter; import lombok.Getter;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
@ -49,7 +50,7 @@ public abstract class CustomWorld extends FreedomService
{ {
try try
{ {
player.teleport(getWorld().getSpawnLocation()); PaperLib.teleportAsync(player, getWorld().getSpawnLocation());
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.world; package me.totalfreedom.totalfreedommod.world;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
@ -127,7 +128,7 @@ public class WorldManager extends FreedomService
if (player.getWorld().getName().equalsIgnoreCase(targetWorld)) if (player.getWorld().getName().equalsIgnoreCase(targetWorld))
{ {
playerMsg(player, "Going to main world.", ChatColor.GRAY); playerMsg(player, "Going to main world.", ChatColor.GRAY);
player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation()); PaperLib.teleportAsync(player, Bukkit.getWorlds().get(0).getSpawnLocation());
return; return;
} }
@ -136,12 +137,11 @@ public class WorldManager extends FreedomService
if (world.getName().equalsIgnoreCase(targetWorld)) if (world.getName().equalsIgnoreCase(targetWorld))
{ {
playerMsg(player, "Going to world: " + targetWorld, ChatColor.GRAY); playerMsg(player, "Going to world: " + targetWorld, ChatColor.GRAY);
player.teleport(world.getSpawnLocation()); PaperLib.teleportAsync(player, world.getSpawnLocation());
return; return;
} }
} }
playerMsg(player, "World " + targetWorld + " not found.", ChatColor.GRAY); playerMsg(player, "World " + targetWorld + " not found.", ChatColor.GRAY);
} }
} }