mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-30 13:27:37 +00:00
Merge branch 'development' into Wild1145-patch-1
This commit is contained in:
commit
5ef0f29ffe
21
.github/workflows/java11-maven.yml
vendored
21
.github/workflows/java11-maven.yml
vendored
@ -1,21 +0,0 @@
|
||||
name: Java11-Maven-Build
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build-java-11:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the code
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
# Java 11 Builds
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2.3.0
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: 'adopt'
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
17
pom.xml
17
pom.xml
@ -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>
|
||||
|
||||
@ -258,6 +258,13 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<build>
|
||||
<!-- Filter resources for build.properties -->
|
||||
<resources>
|
||||
@ -275,9 +282,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 +408,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<version>3.3.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -45,140 +45,9 @@ public class Groups
|
||||
Material.LIGHT_GRAY_SHULKER_BOX,
|
||||
Material.BLACK_SHULKER_BOX);
|
||||
|
||||
public static final List<EntityType> MOB_TYPES = Arrays.asList(
|
||||
EntityType.BAT,
|
||||
EntityType.BEE,
|
||||
EntityType.BLAZE,
|
||||
EntityType.CAVE_SPIDER,
|
||||
EntityType.CHICKEN,
|
||||
EntityType.CAT,
|
||||
EntityType.COD,
|
||||
EntityType.COW,
|
||||
EntityType.CREEPER,
|
||||
EntityType.DOLPHIN,
|
||||
EntityType.DONKEY,
|
||||
EntityType.DROWNED,
|
||||
EntityType.ELDER_GUARDIAN,
|
||||
EntityType.ENDERMAN,
|
||||
EntityType.ENDERMITE,
|
||||
EntityType.EVOKER,
|
||||
EntityType.FOX,
|
||||
EntityType.GHAST,
|
||||
EntityType.GUARDIAN,
|
||||
EntityType.HOGLIN,
|
||||
EntityType.HORSE,
|
||||
EntityType.HUSK,
|
||||
EntityType.ILLUSIONER,
|
||||
EntityType.IRON_GOLEM,
|
||||
EntityType.LLAMA,
|
||||
EntityType.MAGMA_CUBE,
|
||||
EntityType.MUSHROOM_COW,
|
||||
EntityType.MULE,
|
||||
EntityType.OCELOT,
|
||||
EntityType.PANDA,
|
||||
EntityType.PARROT,
|
||||
EntityType.PHANTOM,
|
||||
EntityType.PIG,
|
||||
EntityType.PIGLIN,
|
||||
EntityType.PIGLIN_BRUTE,
|
||||
EntityType.PILLAGER,
|
||||
EntityType.POLAR_BEAR,
|
||||
EntityType.PUFFERFISH,
|
||||
EntityType.RABBIT,
|
||||
EntityType.RAVAGER,
|
||||
EntityType.SALMON,
|
||||
EntityType.SHEEP,
|
||||
EntityType.SHULKER,
|
||||
EntityType.SILVERFISH,
|
||||
EntityType.SKELETON,
|
||||
EntityType.SKELETON_HORSE,
|
||||
EntityType.SLIME,
|
||||
EntityType.SNOWMAN,
|
||||
EntityType.SPIDER,
|
||||
EntityType.SQUID,
|
||||
EntityType.STRAY,
|
||||
EntityType.STRIDER,
|
||||
EntityType.TRADER_LLAMA,
|
||||
EntityType.TROPICAL_FISH,
|
||||
EntityType.TURTLE,
|
||||
EntityType.VEX,
|
||||
EntityType.VILLAGER,
|
||||
EntityType.VINDICATOR,
|
||||
EntityType.WANDERING_TRADER,
|
||||
EntityType.WITCH,
|
||||
EntityType.WITHER_SKELETON,
|
||||
EntityType.WOLF,
|
||||
EntityType.ZOGLIN,
|
||||
EntityType.ZOMBIE,
|
||||
EntityType.ZOMBIE_HORSE,
|
||||
EntityType.ZOMBIFIED_PIGLIN,
|
||||
EntityType.ZOMBIE_VILLAGER);
|
||||
public static final List<EntityType> MOB_TYPES = Arrays.stream(EntityType.values()).filter(EntityType::isAlive).filter(EntityType::isSpawnable).toList();
|
||||
|
||||
public static final List<Material> SPAWN_EGGS = Arrays.asList(
|
||||
Material.BAT_SPAWN_EGG,
|
||||
Material.BEE_SPAWN_EGG,
|
||||
Material.BLAZE_SPAWN_EGG,
|
||||
Material.CAVE_SPIDER_SPAWN_EGG,
|
||||
Material.CHICKEN_SPAWN_EGG,
|
||||
Material.CAT_SPAWN_EGG,
|
||||
Material.COD_SPAWN_EGG,
|
||||
Material.COW_SPAWN_EGG,
|
||||
Material.CREEPER_SPAWN_EGG,
|
||||
Material.DOLPHIN_SPAWN_EGG,
|
||||
Material.DONKEY_SPAWN_EGG,
|
||||
Material.DROWNED_SPAWN_EGG,
|
||||
Material.ELDER_GUARDIAN_SPAWN_EGG,
|
||||
Material.ENDERMAN_SPAWN_EGG,
|
||||
Material.ENDERMITE_SPAWN_EGG,
|
||||
Material.EVOKER_SPAWN_EGG,
|
||||
Material.FOX_SPAWN_EGG,
|
||||
Material.GHAST_SPAWN_EGG,
|
||||
Material.GUARDIAN_SPAWN_EGG,
|
||||
Material.HOGLIN_SPAWN_EGG,
|
||||
Material.HORSE_SPAWN_EGG,
|
||||
Material.HUSK_SPAWN_EGG,
|
||||
Material.LLAMA_SPAWN_EGG,
|
||||
Material.MAGMA_CUBE_SPAWN_EGG,
|
||||
Material.MOOSHROOM_SPAWN_EGG,
|
||||
Material.MULE_SPAWN_EGG,
|
||||
Material.OCELOT_SPAWN_EGG,
|
||||
Material.PANDA_SPAWN_EGG,
|
||||
Material.PARROT_SPAWN_EGG,
|
||||
Material.PHANTOM_SPAWN_EGG,
|
||||
Material.PIG_SPAWN_EGG,
|
||||
Material.PIGLIN_SPAWN_EGG,
|
||||
Material.PIGLIN_BRUTE_SPAWN_EGG,
|
||||
Material.PILLAGER_SPAWN_EGG,
|
||||
Material.POLAR_BEAR_SPAWN_EGG,
|
||||
Material.PUFFERFISH_SPAWN_EGG,
|
||||
Material.RABBIT_SPAWN_EGG,
|
||||
Material.RAVAGER_SPAWN_EGG,
|
||||
Material.SALMON_SPAWN_EGG,
|
||||
Material.SHEEP_SPAWN_EGG,
|
||||
Material.SHULKER_SPAWN_EGG,
|
||||
Material.SILVERFISH_SPAWN_EGG,
|
||||
Material.SKELETON_SPAWN_EGG,
|
||||
Material.SKELETON_HORSE_SPAWN_EGG,
|
||||
Material.SLIME_SPAWN_EGG,
|
||||
Material.SPIDER_SPAWN_EGG,
|
||||
Material.SQUID_SPAWN_EGG,
|
||||
Material.STRAY_SPAWN_EGG,
|
||||
Material.STRIDER_SPAWN_EGG,
|
||||
Material.TRADER_LLAMA_SPAWN_EGG,
|
||||
Material.TROPICAL_FISH_SPAWN_EGG,
|
||||
Material.TURTLE_SPAWN_EGG,
|
||||
Material.VEX_SPAWN_EGG,
|
||||
Material.VILLAGER_SPAWN_EGG,
|
||||
Material.VINDICATOR_SPAWN_EGG,
|
||||
Material.WANDERING_TRADER_SPAWN_EGG,
|
||||
Material.WITCH_SPAWN_EGG,
|
||||
Material.WITHER_SKELETON_SPAWN_EGG,
|
||||
Material.WOLF_SPAWN_EGG,
|
||||
Material.ZOGLIN_SPAWN_EGG,
|
||||
Material.ZOMBIE_SPAWN_EGG,
|
||||
Material.ZOMBIE_HORSE_SPAWN_EGG,
|
||||
Material.ZOMBIFIED_PIGLIN_SPAWN_EGG,
|
||||
Material.ZOMBIE_VILLAGER_SPAWN_EGG);
|
||||
public static final List<Material> SPAWN_EGGS = Arrays.stream(Material.values()).filter((mat) -> mat.name().endsWith("_SPAWN_EGG")).toList();
|
||||
|
||||
public static final List<Material> BANNERS = Arrays.asList(
|
||||
Material.BLACK_BANNER,
|
||||
|
Loading…
Reference in New Issue
Block a user