From 7cffdac4001ebc233f6dc3ae01f818c52a373022 Mon Sep 17 00:00:00 2001 From: ZeroEpoch1969 <13510767+ZeroEpoch1969@users.noreply.github.com> Date: Sat, 14 Dec 2019 13:39:57 -0700 Subject: [PATCH] 1.15 --- README.md | 2 +- TotalFreedomMod.iml | 71 +++---------------- pom.xml | 2 +- .../totalfreedommod/MovementValidator.java | 10 +-- .../totalfreedommod/ServerInterface.java | 8 +-- .../totalfreedommod/blocking/SignBlocker.java | 7 +- .../command/Command_modifyitem.java | 19 ++--- .../totalfreedommod/util/Groups.java | 2 + 8 files changed, 37 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index f74c7647..784444cb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TotalFreedomMod [![Build Status](https://travis-ci.org/TFPatches/TotalFreedomMod.svg?branch=TFM-1.14)](https://travis-ci.org/TFPatches/TotalFreedomMod) [![codebeat badge](https://codebeat.co/badges/5f078e55-8a02-4120-9076-70f6994f48d1)](https://codebeat.co/projects/github-com-tfpatches-totalfreedommod-tfm-1-14-fa58c58f-b1c4-4221-bf78-346e07db6961) +# TotalFreedomMod [![Build Status](https://travis-ci.org/TFPatches/TotalFreedomMod.svg?branch=TFM-1.15)](https://travis-ci.org/TFPatches/TotalFreedomMod) [![codebeat badge](https://codebeat.co/badges/5f078e55-8a02-4120-9076-70f6994f48d1)](https://codebeat.co/projects/github-com-tfpatches-totalfreedommod-tfm-1-14-fa58c58f-b1c4-4221-bf78-346e07db6961) TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server. diff --git a/TotalFreedomMod.iml b/TotalFreedomMod.iml index 881b7013..9747bc55 100644 --- a/TotalFreedomMod.iml +++ b/TotalFreedomMod.iml @@ -27,10 +27,20 @@ + + + + + + + + + + - + @@ -100,64 +110,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 565ad15d..9b8eb1dd 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.spigotmc spigot - 1.14.4-R0.1-SNAPSHOT + 1.15-R0.1-SNAPSHOT provided diff --git a/src/main/java/me/totalfreedom/totalfreedommod/MovementValidator.java b/src/main/java/me/totalfreedom/totalfreedommod/MovementValidator.java index 60ed6335..8acc9e3e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/MovementValidator.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/MovementValidator.java @@ -5,11 +5,11 @@ import ca.momothereal.mojangson.value.MojangsonCompound; import ca.momothereal.mojangson.value.MojangsonValue; import java.util.List; import java.util.Objects; -import net.minecraft.server.v1_14_R1.NBTTagCompound; -import net.minecraft.server.v1_14_R1.NBTTagList; +import net.minecraft.server.v1_15_R1.NBTTagCompound; +import net.minecraft.server.v1_15_R1.NBTTagList; import org.bukkit.ChatColor; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -128,7 +128,7 @@ public class MovementValidator extends FreedomService private Boolean exploitItem(ItemStack item) { - net.minecraft.server.v1_14_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); + net.minecraft.server.v1_15_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); NBTTagList modifiers = getAttributeList(nmsStack); MojangsonCompound compound = new MojangsonCompound(); boolean foundNegative = false; @@ -165,7 +165,7 @@ public class MovementValidator extends FreedomService } - private NBTTagList getAttributeList(net.minecraft.server.v1_14_R1.ItemStack stack) + private NBTTagList getAttributeList(net.minecraft.server.v1_15_R1.ItemStack stack) { if (stack.getTag() == null) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java index 457b91f7..2d69d9ea 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java @@ -4,15 +4,15 @@ 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_14_R1.EntityPlayer; -import net.minecraft.server.v1_14_R1.MinecraftServer; +import net.minecraft.server.v1_15_R1.EntityPlayer; +import net.minecraft.server.v1_15_R1.MinecraftServer; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_14_R1.CraftServer; +import org.bukkit.craftbukkit.v1_15_R1.CraftServer; public class ServerInterface extends FreedomService { - public static final String COMPILE_NMS_VERSION = "v1_14_R1"; + public static final String COMPILE_NMS_VERSION = "v1_15_R1"; public ServerInterface(TotalFreedomMod plugin) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java index 1e1d049a..c97d30a7 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/SignBlocker.java @@ -2,11 +2,11 @@ package me.totalfreedom.totalfreedommod.blocking; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import net.minecraft.server.v1_14_R1.NBTTagCompound; +import net.minecraft.server.v1_15_R1.NBTTagCompound; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Tag; -import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -42,9 +42,8 @@ public class SignBlocker extends FreedomService final Player player = event.getPlayer(); if (Tag.SIGNS.getValues().contains(event.getBlock().getType())) { - ItemStack sign = event.getItemInHand(); - net.minecraft.server.v1_14_R1.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign); + net.minecraft.server.v1_15_R1.ItemStack nmsSign = CraftItemStack.asNMSCopy(sign); NBTTagCompound compound = (nmsSign.hasTag()) ? nmsSign.getTag() : new NBTTagCompound(); NBTTagCompound bet = compound.getCompound("BlockEntityTag"); String line1 = bet.getString("Text1"); 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 e95cfd4e..53c4b91c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import net.minecraft.server.v1_14_R1.NBTTagCompound; -import net.minecraft.server.v1_14_R1.NBTTagInt; -import net.minecraft.server.v1_14_R1.NBTTagList; -import net.minecraft.server.v1_14_R1.NBTTagString; +import net.minecraft.server.v1_15_R1.NBTTagCompound; +import net.minecraft.server.v1_15_R1.NBTTagInt; +import net.minecraft.server.v1_15_R1.NBTTagList; +import net.minecraft.server.v1_15_R1.NBTTagString; 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_14_R1.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -144,12 +144,13 @@ public class Command_modifyitem extends FreedomCommand item.setItemMeta(potionMeta); break; } - case "attribute": + // TODO: Fix code here bc 1.15 made some things private for some reason + /*case "attribute": if (args.length < 3) { return false; } - net.minecraft.server.v1_14_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); + net.minecraft.server.v1_15_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(item); NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound(); NBTTagList modifiers = getAttributeList(nmsStack); NBTTagCompound cmpnd = new NBTTagCompound(); @@ -180,7 +181,7 @@ public class Command_modifyitem extends FreedomCommand compound.set("AttributeModifiers", modifiers); nmsStack.setTag(compound); item = CraftItemStack.asBukkitCopy(nmsStack); - break; + break;*/ default: return false; } @@ -188,7 +189,7 @@ public class Command_modifyitem extends FreedomCommand return true; } - private NBTTagList getAttributeList(net.minecraft.server.v1_14_R1.ItemStack stack) + private NBTTagList getAttributeList(net.minecraft.server.v1_15_R1.ItemStack stack) { if (stack.getTag() == null) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/Groups.java b/src/main/java/me/totalfreedom/totalfreedommod/util/Groups.java index 5b9f2e55..a94dfe70 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/Groups.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/Groups.java @@ -45,6 +45,7 @@ public class Groups public static final List MOB_TYPES = Arrays.asList( EntityType.BAT, + EntityType.BEE, EntityType.BLAZE, EntityType.CAVE_SPIDER, EntityType.CHICKEN, @@ -101,6 +102,7 @@ public class Groups public static final List 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,