From cb401577a4ddef593a5defae5ebfd5670a16ad24 Mon Sep 17 00:00:00 2001 From: Allink Date: Mon, 20 Jun 2022 02:46:09 +0100 Subject: [PATCH 01/10] Fix beds exploding in the Nether & End dimensions with explosions off --- .../blocking/EventBlocker.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java index fb3713cd..5a004763 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java @@ -20,15 +20,7 @@ import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Tameable; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.block.BlockBurnEvent; -import org.bukkit.event.block.BlockDispenseEvent; -import org.bukkit.event.block.BlockFromToEvent; -import org.bukkit.event.block.BlockGrowEvent; -import org.bukkit.event.block.BlockIgniteEvent; -import org.bukkit.event.block.BlockPhysicsEvent; -import org.bukkit.event.block.BlockPistonExtendEvent; -import org.bukkit.event.block.BlockPistonRetractEvent; -import org.bukkit.event.block.LeavesDecayEvent; +import org.bukkit.event.block.*; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; @@ -116,6 +108,16 @@ public class EventBlocker extends FreedomService event.setRadius(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue()); } + + @EventHandler(priority = EventPriority.HIGH) + public void onBlockExplode(BlockExplodeEvent event) { + if(!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) { + event.setCancelled(true); + return; + } + + event.setYield(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue()); + } @EventHandler(priority = EventPriority.HIGH) public void onEntityCombust(EntityCombustEvent event) From 073356be49e067201d335e7e449c5c7fe2dae92a Mon Sep 17 00:00:00 2001 From: Allink <44676012+allinkdev@users.noreply.github.com> Date: Sat, 16 Jul 2022 23:03:23 +0100 Subject: [PATCH 02/10] Properly patch Game Master Blocks (#245) * Break cancelled blocks on interact * Cancel master blocks * Add Scissors maven repository * Remove Scissors repo (it is already included in the AMG repo) * Remove unused import & add TODO for the 1.19 port --- pom.xml | 7 +++--- .../blocking/BlockBlocker.java | 14 +++++++++-- .../blocking/EventBlocker.java | 23 +++++++++++++++---- .../blocking/InteractBlocker.java | 20 ++++++++-------- .../command/Command_toggle.java | 12 +++------- .../totalfreedommod/config/ConfigEntry.java | 3 +-- src/main/resources/config.yml | 3 +-- 7 files changed, 47 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index fd106e42..aa17eabe 100644 --- a/pom.xml +++ b/pom.xml @@ -100,8 +100,7 @@ esentialsx-repo https://repo.essentialsx.net/releases/ - - + @@ -128,8 +127,8 @@ - io.papermc.paper - paper-api + me.totalfreedom.scissors + scissors-api 1.17.1-R0.1-SNAPSHOT provided diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/BlockBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/BlockBlocker.java index 746ce186..492deea9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/BlockBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/BlockBlocker.java @@ -71,7 +71,7 @@ public class BlockBlocker extends FreedomService } case STRUCTURE_BLOCK: { - if (!ConfigEntry.ALLOW_STRUCTURE_BLOCKS.getBoolean()) + if (!ConfigEntry.ALLOW_MASTERBLOCKS.getBoolean()) { player.sendMessage(ChatColor.GRAY + "Structure blocks are disabled."); player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); @@ -81,7 +81,7 @@ public class BlockBlocker extends FreedomService } case JIGSAW: { - if (!ConfigEntry.ALLOW_JIGSAWS.getBoolean()) + if (!ConfigEntry.ALLOW_MASTERBLOCKS.getBoolean()) { player.sendMessage(ChatColor.GRAY + "Jigsaws are disabled."); player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); @@ -89,6 +89,16 @@ public class BlockBlocker extends FreedomService } break; } + case REPEATING_COMMAND_BLOCK: + case CHAIN_COMMAND_BLOCK: + case COMMAND_BLOCK: + if (!ConfigEntry.ALLOW_MASTERBLOCKS.getBoolean()) + { + player.sendMessage(ChatColor.GRAY + "Command blocks are disabled."); + player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); + event.setCancelled(true); + } + break; case GRINDSTONE: { if (!ConfigEntry.ALLOW_GRINDSTONES.getBoolean()) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java index 5a004763..bc2ec9ba 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java @@ -4,7 +4,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; - +/* TODO This will have to be changed from com.github.atlasmediagroup.scissors to me.totalfreedom.scissors when we migrate to 1.19 */ +import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent; import io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.config.ConfigEntry; @@ -108,10 +109,12 @@ public class EventBlocker extends FreedomService event.setRadius(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue()); } - + @EventHandler(priority = EventPriority.HIGH) - public void onBlockExplode(BlockExplodeEvent event) { - if(!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) { + public void onBlockExplode(BlockExplodeEvent event) + { + if (!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) + { event.setCancelled(true); return; } @@ -119,6 +122,16 @@ public class EventBlocker extends FreedomService event.setYield(ConfigEntry.EXPLOSIVE_RADIUS.getDouble().floatValue()); } + @EventHandler(priority = EventPriority.HIGHEST) + public void onMasterBlockFire(MasterBlockFireEvent event) + { + if (!ConfigEntry.ALLOW_MASTERBLOCKS.getBoolean()) + { + event.setCancelled(true); + event.getAt().getBlock().setType(Material.CAKE); + } + } + @EventHandler(priority = EventPriority.HIGH) public void onEntityCombust(EntityCombustEvent event) { @@ -152,7 +165,7 @@ public class EventBlocker extends FreedomService Entity entity = event.getEntity(); if (entity instanceof Tameable) { - if (((Tameable)entity).isTamed()) + if (((Tameable) entity).isTamed()) { event.setCancelled(true); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java index 17f6c5fe..f9aa91fe 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java @@ -69,24 +69,22 @@ public class InteractBlocker extends FreedomService private void handleRightClick(PlayerInteractEvent event) { final Player player = event.getPlayer(); + final Block clickedBlock = event.getClickedBlock(); - if (event.getClickedBlock() != null) + if (clickedBlock == null) { - if (event.getClickedBlock().getType().equals(Material.STRUCTURE_BLOCK) || event.getClickedBlock().getType().equals(Material.JIGSAW) || event.getClickedBlock().getType().equals(Material.RESPAWN_ANCHOR)) - { - event.setCancelled(true); - event.getPlayer().closeInventory(); - } + return; + } + + if (clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean()) + { + event.setCancelled(true); + return; } if (Groups.SPAWN_EGGS.contains(event.getMaterial())) { event.setCancelled(true); - Block clickedBlock = event.getClickedBlock(); - if (clickedBlock == null) - { - return; - } EntityType eggType = null; try { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java index 712ff7ff..2639b9d5 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_toggle.java @@ -19,7 +19,7 @@ public class Command_toggle extends FreedomCommand private final List toggles = Arrays.asList( "waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk", "firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke [range] [count]", - "explosives [radius]", "unsafeenchs", "bells", "armorstands", "structureblocks", "jigsaws", "grindstones", + "explosives [radius]", "unsafeenchs", "bells", "armorstands", "masterblocks", "grindstones", "jukeboxes", "spawners", "4chan", "beehives", "respawnanchors", "autotp", "autoclear", "minecarts", "mp44", "landmines", "tossmob", "gravity"); @@ -193,15 +193,9 @@ public class Command_toggle extends FreedomCommand break; } - case "structureblocks": + case "masterblocks": { - toggle("Structure blocks are", ConfigEntry.ALLOW_STRUCTURE_BLOCKS); - break; - } - - case "jigsaws": - { - toggle("Jigsaws are", ConfigEntry.ALLOW_JIGSAWS); + toggle("Master blocks are", ConfigEntry.ALLOW_MASTERBLOCKS); break; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 598c3d1f..4c58eb10 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -25,8 +25,6 @@ public enum ConfigEntry ALLOW_BELLS(Boolean.class, "allow.bells"), ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"), ALLOW_MINECARTS(Boolean.class, "allow.minecarts"), - ALLOW_STRUCTURE_BLOCKS(Boolean.class, "allow.structureblocks"), - ALLOW_JIGSAWS(Boolean.class, "allow.jigsaws"), ALLOW_GRINDSTONES(Boolean.class, "allow.grindstones"), ALLOW_JUKEBOXES(Boolean.class, "allow.jukeboxes"), ALLOW_SPAWNERS(Boolean.class, "allow.spawners"), @@ -35,6 +33,7 @@ public enum ConfigEntry AUTO_TP(Boolean.class, "allow.auto_tp"), AUTO_CLEAR(Boolean.class, "allow.auto_clear"), ALLOW_GRAVITY(Boolean.class, "allow.gravity"), + ALLOW_MASTERBLOCKS(Boolean.class, "allow.masterblocks"), // BLOCKED_CHATCODES(String.class, "blocked_chatcodes"), // diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d0f9ff4d..2aa7a488 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -224,8 +224,6 @@ allow: minecarts: true clearonjoin: false tpronjoin: false - structureblocks: false - jigsaws: false grindstones: true jukeboxes: true spawners: false @@ -234,6 +232,7 @@ allow: auto_tp: false auto_clear: false gravity: false + masterblocks: false blocked_commands: # From 97544977b0eec0a20ff92782f1ac316f1e95ff52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 01:34:57 +0000 Subject: [PATCH 03/10] Bump junit-jupiter from 5.8.2 to 5.9.0 Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.8.2 to 5.9.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.8.2...r5.9.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa17eabe..81bcaa81 100644 --- a/pom.xml +++ b/pom.xml @@ -234,7 +234,7 @@ org.junit.jupiter junit-jupiter - 5.8.2 + 5.9.0 compile From 7bda4beab0d7783fe0fc545db37cf12eda62e460 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:42:07 +0000 Subject: [PATCH 04/10] Bump worldedit-bukkit from 7.2.10 to 7.2.12 Bumps worldedit-bukkit from 7.2.10 to 7.2.12. --- updated-dependencies: - dependency-name: com.sk89q.worldedit:worldedit-bukkit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa17eabe..41e6da6f 100644 --- a/pom.xml +++ b/pom.xml @@ -150,7 +150,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.2.10 + 7.2.12 provided From b05238c51f1d1b7344c8d5afee1563949b08278d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 01:27:24 +0000 Subject: [PATCH 05/10] Bump javassist from 3.29.0-GA to 3.29.1-GA Bumps [javassist](https://github.com/jboss-javassist/javassist) from 3.29.0-GA to 3.29.1-GA. - [Release notes](https://github.com/jboss-javassist/javassist/releases) - [Changelog](https://github.com/jboss-javassist/javassist/blob/master/Changes.md) - [Commits](https://github.com/jboss-javassist/javassist/commits) --- updated-dependencies: - dependency-name: org.javassist:javassist dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa17eabe..49c8fff7 100644 --- a/pom.xml +++ b/pom.xml @@ -206,7 +206,7 @@ org.javassist javassist - 3.29.0-GA + 3.29.1-GA compile From 05bb64ce8576b72451eb426a0cf5bad275100386 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 01:45:49 +0000 Subject: [PATCH 06/10] Bump EssentialsX from 2.19.4 to 2.19.6 Bumps [EssentialsX](https://github.com/EssentialsX/Essentials) from 2.19.4 to 2.19.6. - [Release notes](https://github.com/EssentialsX/Essentials/releases) - [Commits](https://github.com/EssentialsX/Essentials/compare/2.19.4...2.19.6) --- updated-dependencies: - dependency-name: net.essentialsx:EssentialsX dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa17eabe..56c2e376 100644 --- a/pom.xml +++ b/pom.xml @@ -192,7 +192,7 @@ net.essentialsx EssentialsX - 2.19.4 + 2.19.6 provided From ebafc1c6691e5d00d1317c3f2372f7ab86a0c2cb Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 12 Sep 2022 22:54:44 +0100 Subject: [PATCH 07/10] Hopefully fixing it this time (#119) This is proving to be more of a PITA than I had expected. --- .github/workflows/downstream.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index b5e72dcc..33365e0b 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -17,10 +17,10 @@ jobs: steps: # Step 1: run a standard checkout action, provided by github - - name: Checkout main + - name: Checkout current development branch uses: actions/checkout@v2 with: - ref: main + ref: development # submodules: 'recursive' ### may be needed in your situation # Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch From 88f53c05b9f1c156cf292b9da66a3db2b4f533a2 Mon Sep 17 00:00:00 2001 From: Allink Date: Wed, 5 Oct 2022 08:55:34 +0100 Subject: [PATCH 08/10] Remove guard clause causing unintended side effects --- .../totalfreedommod/blocking/InteractBlocker.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java index f9aa91fe..6a70f7d4 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java @@ -71,12 +71,7 @@ public class InteractBlocker extends FreedomService final Player player = event.getPlayer(); final Block clickedBlock = event.getClickedBlock(); - if (clickedBlock == null) - { - return; - } - - if (clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean()) + if (clickedBlock != null && clickedBlock.getType() == Material.RESPAWN_ANCHOR && !ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean()) { event.setCancelled(true); return; @@ -102,7 +97,7 @@ public class InteractBlocker extends FreedomService { // } - if (eggType != null) + if (eggType != null && clickedBlock != null) { clickedBlock.getWorld().spawnEntity(clickedBlock.getLocation().add(event.getBlockFace().getDirection()).add(0.5, 0.5, 0.5), eggType); } From 21c84d76d380826f08c48c6ee03a136835dc815e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Oct 2022 15:06:56 +0100 Subject: [PATCH 09/10] Bump actions/setup-java from 3.3.0 to 3.5.1 (#271) Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.3.0 to 3.5.1. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3.3.0...v3.5.1) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/java17-maven.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 972ab7f7..66e07f7e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: uses: actions/checkout@v3 - name: Setup Java JDK - uses: actions/setup-java@v3.3.0 + uses: actions/setup-java@v3.5.1 with: # The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 java-version: 17 diff --git a/.github/workflows/java17-maven.yml b/.github/workflows/java17-maven.yml index 6f55c804..b2571e94 100644 --- a/.github/workflows/java17-maven.yml +++ b/.github/workflows/java17-maven.yml @@ -13,7 +13,7 @@ jobs: # Java 16 Builds - name: Set up JDK 17 - uses: actions/setup-java@v3.3.0 + uses: actions/setup-java@v3.5.1 with: java-version: 17 distribution: 'adopt' From 7fb4a477dc801059de75a277d9e291f5572f6579 Mon Sep 17 00:00:00 2001 From: Video Date: Wed, 12 Oct 2022 14:36:49 -0600 Subject: [PATCH 10/10] Removes TFGuilds integration (#264) TFGuilds was shitcanned the other day (good riddence), so there's no point in bridging it anymore. Co-authored-by: Allink <44676012+allinkdev@users.noreply.github.com> Co-authored-by: Ryan --- pom.xml | 7 --- .../totalfreedommod/ChatManager.java | 2 +- .../totalfreedommod/TotalFreedomMod.java | 3 - .../bridge/TFGuildsBridge.java | 58 ------------------- 4 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 src/main/java/me/totalfreedom/totalfreedommod/bridge/TFGuildsBridge.java diff --git a/pom.xml b/pom.xml index cd579a65..18babb6e 100644 --- a/pom.xml +++ b/pom.xml @@ -210,13 +210,6 @@ compile - - me.totalfreedom - tfguilds - 2021.06-RC2 - provided - - org.jetbrains annotations diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java index 2156af99..fd8c3d8d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java @@ -136,7 +136,7 @@ public class ChatManager extends FreedomService event.setFormat(format); // Send to discord - if (!ConfigEntry.ADMIN_ONLY_MODE.getBoolean() && !Bukkit.hasWhitelist() && !plugin.pl.getPlayer(player).isMuted() && !plugin.tfg.inGuildChat(player)) + if (!ConfigEntry.ADMIN_ONLY_MODE.getBoolean() && !Bukkit.hasWhitelist() && !plugin.pl.getPlayer(player).isMuted()) { plugin.dc.messageChatChannel(player.getName() + " \u00BB " + ChatColor.stripColor(message)); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 31dff85b..bcab4b04 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -19,7 +19,6 @@ import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge; import me.totalfreedom.totalfreedommod.bridge.CoreProtectBridge; import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge; import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge; -import me.totalfreedom.totalfreedommod.bridge.TFGuildsBridge; import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge; import me.totalfreedom.totalfreedommod.bridge.WorldGuardBridge; import me.totalfreedom.totalfreedommod.caging.Cager; @@ -128,7 +127,6 @@ public class TotalFreedomMod extends JavaPlugin public EssentialsBridge esb; public LibsDisguisesBridge ldb; public CoreProtectBridge cpb; - public TFGuildsBridge tfg; public WorldEditBridge web; public WorldGuardBridge wgb; @@ -342,7 +340,6 @@ public class TotalFreedomMod extends JavaPlugin cpb = new CoreProtectBridge(); esb = new EssentialsBridge(); ldb = new LibsDisguisesBridge(); - tfg = new TFGuildsBridge(); web = new WorldEditBridge(); wgb = new WorldGuardBridge(); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/TFGuildsBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/TFGuildsBridge.java deleted file mode 100644 index e315b15c..00000000 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/TFGuildsBridge.java +++ /dev/null @@ -1,58 +0,0 @@ -package me.totalfreedom.totalfreedommod.bridge; - -import me.totalfreedom.tfguilds.Common; -import me.totalfreedom.tfguilds.TFGuilds; -import me.totalfreedom.totalfreedommod.FreedomService; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -public class TFGuildsBridge extends FreedomService -{ - public boolean enabled = false; - - @Override - public void onStart() - { - } - - @Override - public void onStop() - { - } - - public boolean isTFGuildsEnabled() - { - if (enabled) - { - return true; - } - - try - { - final Plugin tfGuilds = server.getPluginManager().getPlugin("TFGuilds"); - if (tfGuilds != null && tfGuilds.isEnabled()) - { - if (tfGuilds instanceof TFGuilds) - { - enabled = true; - return true; - } - } - } - catch (NoClassDefFoundError ex) - { - return false; - } - - return false; - } - - public boolean inGuildChat(Player player) - { - if (!isTFGuildsEnabled()) - { - return false; - } - return Common.GUILD_CHAT.contains(player); - } -} \ No newline at end of file