mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-30 13:27:37 +00:00
cubev3.com
This commit is contained in:
parent
4f339b29b8
commit
b525e53348
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>totalfreedom</artifactId>
|
||||
<version>6.0</version>
|
||||
<version>5.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -70,6 +70,7 @@ public class EntityWiper extends FreedomService
|
||||
wipables.add(ArmorStand.class);
|
||||
wipables.add(Fireball.class);
|
||||
wipables.add(DragonFireball.class);
|
||||
wipables.add(Minecart.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -126,7 +126,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
|
||||
public MasterBuilderWorldRestrictions mbwr;
|
||||
public SignBlocker snp;
|
||||
public PlayerVerification pv;
|
||||
public HubWorldRestrictions hwr;
|
||||
//public HubWorldRestrictions hwr;
|
||||
//
|
||||
// Bridges
|
||||
public ServiceManager<TotalFreedomMod> bridges;
|
||||
@ -201,7 +201,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
|
||||
as = services.registerService(AntiSpam.class);
|
||||
mbl = services.registerService(MasterBuilderList.class);
|
||||
mbwr = services.registerService(MasterBuilderWorldRestrictions.class);
|
||||
hwr = services.registerService(HubWorldRestrictions.class);
|
||||
//hwr = services.registerService(HubWorldRestrictions.class);
|
||||
|
||||
pl = services.registerService(PlayerList.class);
|
||||
an = services.registerService(Announcer.class);
|
||||
|
@ -110,6 +110,13 @@ public class BlockBlocker extends FreedomService
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
case SPAWNER:
|
||||
player.sendMessage(ChatColor.GRAY + "Spawners are disabled.");
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,23 @@
|
||||
package me.totalfreedom.totalfreedommod.blocking;
|
||||
|
||||
import com.sk89q.worldedit.command.util.CreatureButcher;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import me.libraryaddict.disguise.disguisetypes.watchers.MinecartCommandWatcher;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.ShulkerBox;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -19,6 +27,7 @@ import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
@ -218,7 +227,8 @@ public class EventBlocker extends FreedomService
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onBlockDispense(BlockDispenseEvent event)
|
||||
{
|
||||
if (Groups.SPAWN_EGGS.contains(event.getItem().getType()))
|
||||
List<Material> banned = Arrays.asList(Material.TNT_MINECART, Material.MINECART);
|
||||
if (Groups.SPAWN_EGGS.contains(event.getItem().getType()) || banned.contains(event.getItem().getType()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -141,6 +141,18 @@ public class InteractBlocker extends FreedomService
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
case MINECART:
|
||||
{
|
||||
if (ConfigEntry.ALLOW_MINECARTS.getBoolean())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
player.sendMessage(ChatColor.GRAY + "Minecarts are currently disabled.");
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,11 @@ public class SignBlocker extends FreedomService
|
||||
player.sendMessage(ChatColor.GRAY + "You are not allowed to place command signs.");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
if (line1.contains("translate") || line2.contains("translate") || line3.contains("translate") || line4.contains("translate"))
|
||||
{
|
||||
player.sendMessage(ChatColor.GRAY + "You are not allowed to place broken strings that Mojang never fixed.");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.command.CommandReflection;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -129,6 +130,12 @@ public class CommandBlocker extends FreedomService
|
||||
// CommandBlocker handles messages and broadcasts
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (event.getMessage().contains("translation.test."))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
FUtil.playerMsg(event.getPlayer(), ChatColor.RED + "No crishy crashy faggy");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCommandBlocked(String command, CommandSender sender)
|
||||
|
@ -27,7 +27,10 @@ public class Command_hubworld extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
CommandMode commandMode = null;
|
||||
msg(UNKNOWN_COMMAND);
|
||||
return true;
|
||||
}
|
||||
/*CommandMode commandMode = null;
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
@ -198,6 +201,7 @@ public class Command_hubworld extends FreedomCommand
|
||||
{
|
||||
super(string);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Link your Discord account to your Minecraft account", usage = "/<command>")
|
||||
public class Command_linkdiscord extends FreedomCommand
|
||||
{
|
||||
|
@ -1,6 +1,8 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -11,7 +13,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "See who has a block and optionally clears the item.", usage = "/<command> <item> clear", aliases = "wh")
|
||||
@CommandParameters(description = "See who has an item and optionally clear said item.", usage = "/<command> <item> [clear]", aliases = "wh")
|
||||
public class Command_whohas extends FreedomCommand
|
||||
{
|
||||
|
||||
@ -36,19 +38,17 @@ public class Command_whohas extends FreedomCommand
|
||||
|
||||
final List<String> players = new ArrayList<>();
|
||||
|
||||
if (!plugin.al.isAdmin(playerSender))
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (player.getInventory().contains(material))
|
||||
{
|
||||
players.add(player.getName());
|
||||
if (doClear && !plugin.al.isAdmin(player))
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
player.getInventory().remove(material);
|
||||
if (doClear && !plugin.al.isAdmin(player))
|
||||
{
|
||||
player.getInventory().remove(material);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,4 +64,30 @@ public class Command_whohas extends FreedomCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static List<String> getAllMaterials()
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
for (Material material : Material.values())
|
||||
{
|
||||
names.add(material.name());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return getAllMaterials();
|
||||
}
|
||||
|
||||
if (args.length == 2 && plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Arrays.asList("clear");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,12 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.spigotmc.SpigotConfig;
|
||||
|
||||
public abstract class FreedomCommand extends AbstractCommandBase<TotalFreedomMod>
|
||||
{
|
||||
|
||||
public static final String UNKNOWN_COMMAND = ChatColor.WHITE + SpigotConfig.unknownCommandMessage;
|
||||
public static final String YOU_ARE_OP = ChatColor.YELLOW + "You are now op!";
|
||||
public static final String YOU_ARE_NOT_OP = ChatColor.YELLOW + "You are no longer op!";
|
||||
public static final String PLAYER_NOT_FOUND = ChatColor.GRAY + "Player not found!";
|
||||
|
@ -24,6 +24,7 @@ public enum ConfigEntry
|
||||
ALLOW_UNSAFE_ENCHANTMENTS(Boolean.class, "allow.unsafe_enchantments"),
|
||||
ALLOW_BELLS(Boolean.class, "allow.bells"),
|
||||
ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"),
|
||||
ALLOW_MINECARTS (Boolean.class, "allow.minecarts"),
|
||||
//
|
||||
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
||||
//
|
||||
@ -54,9 +55,13 @@ public enum ConfigEntry
|
||||
DISCORD_REPORT_CHANNEL_ID(String.class, "discord.report_channel_id"),
|
||||
DISCORD_ROLE_SYNC(Boolean.class, "discord.role_sync"),
|
||||
DISCORD_SERVER_ID(String.class, "discord.server_id"),
|
||||
DISCORD_MASTER_BUILDER_ROLE_ID(String.class, "discord.master_builder_role_id"),
|
||||
DISCORD_SUPER_ROLE_ID(String.class, "discord.super_role_id"),
|
||||
DISCORD_TELNET_ROLE_ID(String.class, "discord.telnet_role_id"),
|
||||
DISCORD_SENIOR_ROLE_ID(String.class, "discord.senior_role_id"),
|
||||
DISCORD_DEVELOPER_ROLE_ID(String.class, "discord.developer_role_id"),
|
||||
DISCORD_EXECUTIVE_ROLE_ID(String.class, "discord.executive_role_id"),
|
||||
DISCORD_SERVER_OWNER_ROLE_ID(String.class, "discord.server_owner_role_id"),
|
||||
|
||||
//
|
||||
ADMINLIST_CLEAN_THESHOLD_HOURS(Integer.class, "adminlist.clean_threshold_hours"),
|
||||
|
@ -25,7 +25,6 @@ import net.dv8tion.jda.core.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.core.entities.Role;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.managers.GuildController;
|
||||
import net.dv8tion.jda.core.requests.restaction.AuditableRestAction;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -58,7 +57,7 @@ public class Discord extends FreedomService
|
||||
}
|
||||
try
|
||||
{
|
||||
bot = new JDABuilder(AccountType.BOT).setToken(ConfigEntry.DISCORD_TOKEN.getString()).addEventListener(new MessageListener()).setAudioEnabled(false).setAutoReconnect(true).buildBlocking();
|
||||
bot = new JDABuilder(AccountType.BOT).setToken(ConfigEntry.DISCORD_TOKEN.getString()).addEventListener(new PrivateMessageListener()).setAudioEnabled(false).setAutoReconnect(true).buildBlocking();
|
||||
FLog.info("Discord verification bot has successfully enabled!");
|
||||
}
|
||||
catch (LoginException e)
|
||||
|
@ -6,7 +6,7 @@ import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import net.dv8tion.jda.core.events.message.priv.PrivateMessageReceivedEvent;
|
||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||
|
||||
public class MessageListener extends ListenerAdapter
|
||||
public class PrivateMessageListener extends ListenerAdapter
|
||||
{
|
||||
public void onPrivateMessageReceived(PrivateMessageReceivedEvent event)
|
||||
{
|
@ -142,10 +142,10 @@ public class ItemFun extends FreedomService
|
||||
break;
|
||||
}
|
||||
|
||||
if (player.getWorld().equals(plugin.wm.hubworld.getWorld()) && plugin.hwr.doRestrict(player))
|
||||
/*if (player.getWorld().equals(plugin.wm.hubworld.getWorld()) && plugin.hwr.doRestrict(player))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
Location location = player.getLocation().clone();
|
||||
|
||||
|
@ -39,12 +39,13 @@ public class HubWorldRestrictions extends FreedomService
|
||||
|
||||
public boolean doRestrict(Player player)
|
||||
{
|
||||
if (!FUtil.isExecutive(player.getName()) && player.getWorld().equals(plugin.wm.hubworld.getWorld()))
|
||||
/*if (!FUtil.isExecutive(player.getName()) && player.getWorld().equals(plugin.wm.hubworld.getWorld()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;*/
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
|
@ -23,7 +23,7 @@ public class WorldManager extends FreedomService
|
||||
public Flatlands flatlands;
|
||||
public AdminWorld adminworld;
|
||||
public MasterBuilderWorld masterBuilderWorld;
|
||||
public HubWorld hubworld;
|
||||
//public HubWorld hubworld;
|
||||
|
||||
public WorldManager(TotalFreedomMod plugin)
|
||||
{
|
||||
@ -32,7 +32,7 @@ public class WorldManager extends FreedomService
|
||||
this.flatlands = new Flatlands();
|
||||
this.adminworld = new AdminWorld();
|
||||
this.masterBuilderWorld = new MasterBuilderWorld();
|
||||
this.hubworld = new HubWorld();
|
||||
//this.hubworld = new HubWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -41,7 +41,7 @@ public class WorldManager extends FreedomService
|
||||
flatlands.getWorld();
|
||||
adminworld.getWorld();
|
||||
masterBuilderWorld.getWorld();
|
||||
hubworld.getWorld();
|
||||
//hubworld.getWorld();
|
||||
|
||||
// Disable weather
|
||||
if (ConfigEntry.DISABLE_WEATHER.getBoolean())
|
||||
@ -62,7 +62,7 @@ public class WorldManager extends FreedomService
|
||||
flatlands.getWorld().save();
|
||||
adminworld.getWorld().save();
|
||||
masterBuilderWorld.getWorld().save();
|
||||
hubworld.getWorld().save();
|
||||
//hubworld.getWorld().save();
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
@ -113,10 +113,10 @@ public class WorldManager extends FreedomService
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (event.getWorld().equals(hubworld.getWorld()) && hubworld.getWeatherMode() != WorldWeather.OFF)
|
||||
/*else if (event.getWorld().equals(hubworld.getWorld()) && hubworld.getWeatherMode() != WorldWeather.OFF)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -141,10 +141,10 @@ public class WorldManager extends FreedomService
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (event.getWorld().equals(hubworld.getWorld()) && hubworld.getWeatherMode() != WorldWeather.OFF)
|
||||
/*else if (event.getWorld().equals(hubworld.getWorld()) && hubworld.getWeatherMode() != WorldWeather.OFF)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -49,12 +49,21 @@ discord:
|
||||
report_channel_id: ''
|
||||
# Do you want roles to sync with the server?
|
||||
role_sync: false
|
||||
# Master Admin role ID
|
||||
master_builder_role_id: ''
|
||||
# Super Admin role ID
|
||||
super_role_id: ''
|
||||
# Telnet Admin role ID
|
||||
telnet_role_id: ''
|
||||
# Senior Admin role ID
|
||||
senior_role_id: ''
|
||||
# Developer role ID
|
||||
developer_role_id: ''
|
||||
# Executive Admin role ID
|
||||
executive_role_id: ''
|
||||
# Owner role ID
|
||||
server_owner_role_id: ''
|
||||
|
||||
|
||||
# Admin list
|
||||
adminlist:
|
||||
@ -90,8 +99,6 @@ social_links:
|
||||
Forum: 'https://totalfreedom.boards.net/'
|
||||
Website: 'https://totalfreedom.me/'
|
||||
Discord: 'https://discordapp.com/invite/XXjmAmV/'
|
||||
Twitter: 'https://twitter.com/TotalFreedomMC'
|
||||
|
||||
|
||||
# Blocking certain events
|
||||
allow:
|
||||
@ -109,6 +116,7 @@ allow:
|
||||
unsafe_enchantments: true
|
||||
bells: true
|
||||
armorstands: false
|
||||
minecarts: false
|
||||
|
||||
# Blocked commands:
|
||||
#
|
||||
|
@ -1,4 +0,0 @@
|
||||
#
|
||||
# Config version
|
||||
#
|
||||
version: 1
|
Loading…
Reference in New Issue
Block a user