This commit is contained in:
Telesphoreo 2018-07-24 19:44:00 -07:00 committed by Seth
parent 0d503a6c06
commit 7278176143
24 changed files with 184 additions and 53 deletions

View File

@ -40,7 +40,7 @@
<scm> <scm>
<connection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</connection> <connection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</connection>
<developerConnection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</developerConnection> <developerConnection>scm:git:git@github.com:TFPatches/TotalFreedomMod.git</developerConnection>
<url>git@github.com:TotalFreedom/TFPatches.git</url> <url>git@github.com:TFPatches/TotalFreedomMod.git</url>
</scm> </scm>
<repositories> <repositories>
@ -151,6 +151,7 @@
<groupId>net.dv8tion</groupId> <groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId> <artifactId>JDA</artifactId>
<version>3.7.1_385</version> <version>3.7.1_385</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -286,28 +286,39 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
try try
{ {
final Properties props; final Properties props;
final Properties gitprops;
try (InputStream in = plugin.getResource("build.properties")) try (InputStream in = plugin.getResource("build.properties"))
{ {
props = new Properties(); props = new Properties();
props.load(in); props.load(in);
} }
try (InputStream in = plugin.getResource("git.properties"))
{
gitprops = new Properties();
gitprops.load(in);
}
author = props.getProperty("buildAuthor", "unknown"); author = props.getProperty("buildAuthor", "unknown");
codename = props.getProperty("buildCodeName", "unknown"); codename = props.getProperty("buildCodeName", "unknown");
version = props.getProperty("buildVersion", pluginVersion); version = props.getProperty("buildVersion", pluginVersion);
number = props.getProperty("buildNumber", "1"); number = props.getProperty("buildNumber", "1");
date = gitprops.getProperty("git.build.time", "unknown"); date = props.getProperty("buildDate", "unknown");
}
catch (Exception ex)
{
FLog.severe("Could not load build properties! Did you compile with NetBeans/Maven?");
FLog.severe(ex);
}
try
{
final Properties gitprops;
try (InputStream in = plugin.getResource("git.properties"))
{
gitprops = new Properties();
gitprops.load(in);
}
head = gitprops.getProperty("git.commit.id.abbrev", "unknown"); head = gitprops.getProperty("git.commit.id.abbrev", "unknown");
} }
catch (Exception ex) catch (Exception ex)
{ {
FLog.severe("Could not load build properties! Did you compile with Netbeans/Maven?"); FLog.severe("Could not load Git properties! Is there a valid .git directory?");
FLog.severe(ex); FLog.severe(ex);
} }
} }

View File

@ -182,6 +182,7 @@ public class CoreProtectBridge extends FreedomService
} }
}.runTaskTimer(plugin, interval, interval); }.runTaskTimer(plugin, interval, interval);
} }
public double getDBSize() public double getDBSize()
{ {
double bytes = getDatabase().length(); double bytes = getDatabase().length();
@ -189,6 +190,7 @@ public class CoreProtectBridge extends FreedomService
double megabytes = (kilobytes / 1024); double megabytes = (kilobytes / 1024);
return (megabytes / 1024); return (megabytes / 1024);
} }
// Wipes DB for the specified world // Wipes DB for the specified world
public void clearDatabase(World world) public void clearDatabase(World world)
{ {

View File

@ -85,6 +85,7 @@ public class Command_cage extends FreedomCommand
} }
} }
} }
Location location = player.getLocation().clone().add(0.0, 1.0, 0.0); Location location = player.getLocation().clone().add(0.0, 1.0, 0.0);
if (skullName != null) if (skullName != null)
{ {
@ -95,7 +96,7 @@ public class Command_cage extends FreedomCommand
fPlayer.getCageData().cage(location, outerMaterial, innerMaterial); fPlayer.getCageData().cage(location, outerMaterial, innerMaterial);
} }
player.setGameMode(GameMode.SURVIVAL); player.setGameMode(GameMode.SURVIVAL);
if (outerMaterial == Material.PLAYER_HEAD)
{ {
FUtil.adminAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true); FUtil.adminAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true);
} }

View File

@ -71,7 +71,7 @@ public class Command_premium extends FreedomCommand
catch (Exception ex) catch (Exception ex)
{ {
FLog.severe(ex); FLog.severe(ex);
msg("There was an error querying the mojang server.", ChatColor.RED); msg("There was an error querying the Mojang server.", ChatColor.RED);
} }
} }
}.runTaskAsynchronously(plugin); }.runTaskAsynchronously(plugin);

View File

@ -15,6 +15,12 @@ public class Command_wipecoreprotectdata extends FreedomCommand
@Override @Override
public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
if (!plugin.cpb.isEnabled())
{
msg("CoreProtect is not enabled on this server");
return true;
}
FUtil.adminAction(sender.getName(), "Wiping CoreProtect data for the flatlands", true); FUtil.adminAction(sender.getName(), "Wiping CoreProtect data for the flatlands", true);
new BukkitRunnable() new BukkitRunnable()

View File

@ -6,7 +6,6 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true) @CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
@CommandParameters(description = "Wipe the flatlands map. Requires manual restart after command is used.", usage = "/<command>") @CommandParameters(description = "Wipe the flatlands map. Requires manual restart after command is used.", usage = "/<command>")
@ -20,7 +19,10 @@ public class Command_wipeflatlands extends FreedomCommand
FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY); FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);
if (plugin.wgb.isPluginEnabled())
{
plugin.wgb.wipeRegions(plugin.wm.flatlands.getWorld()); plugin.wgb.wipeRegions(plugin.wm.flatlands.getWorld());
}
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {

View File

@ -38,7 +38,6 @@ public class Command_wipeuserdata extends FreedomCommand
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "stats")); FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "stats"));
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "stats")); FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "stats"));
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "playerdata")); FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "playerdata"));
msg("All playerdata deleted."); msg("All playerdata deleted.");
return true; return true;
} }

View File

@ -3,6 +3,8 @@ package me.totalfreedom.totalfreedommod.freeze;
import lombok.Getter; import lombok.Getter;
import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.FPlayer;
import static me.totalfreedom.totalfreedommod.TotalFreedomMod.plugin;
import static me.totalfreedom.totalfreedommod.player.FPlayer.AUTO_PURGE_TICKS; import static me.totalfreedom.totalfreedommod.player.FPlayer.AUTO_PURGE_TICKS;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
@ -36,7 +38,7 @@ public class FreezeData
final Player player = fPlayer.getPlayer(); final Player player = fPlayer.getPlayer();
if (player == null) if (player == null)
{ {
FLog.info("Could not freeze " + fPlayer.getName() + ". Player not online!"); FLog.info("Could not freeze " + player.getName() + ". Player not online!");
return; return;
} }
@ -62,14 +64,14 @@ public class FreezeData
@Override @Override
public void run() public void run()
{ {
if (!fPlayer.getPlugin().al.isAdminImpostor(player) && !fPlayer.getPlugin().pv.isPlayerImpostor(player)) if (!plugin().al.isAdminImpostor(player) && plugin().pv.isPlayerImpostor(player))
{ {
FUtil.adminAction("TotalFreedom", "Unfreezing " + player.getName(), false); FUtil.adminAction("TotalFreedom", "Unfreezing " + player.getName(), false);
setFrozen(false); setFrozen(false);
} }
} }
}.runTaskLater(fPlayer.getPlugin(), AUTO_PURGE_TICKS); }.runTaskLater(plugin(), AUTO_PURGE_TICKS);
} }
} }

View File

@ -32,6 +32,11 @@ public class Freezer extends FreedomService
{ {
} }
public boolean isGlobalFreeze()
{
return this.globalFreeze;
}
public void setGlobalFreeze(boolean frozen) public void setGlobalFreeze(boolean frozen)
{ {
this.globalFreeze = frozen; this.globalFreeze = frozen;
@ -65,7 +70,7 @@ public class Freezer extends FreedomService
FUtil.setFlying(player, true); FUtil.setFlying(player, true);
Location loc = fd.getLocation(); Location loc = player.getLocation();
if (loc == null) if (loc == null)
{ {
loc = event.getFrom(); loc = event.getFrom();

View File

@ -56,7 +56,6 @@ public class ItemFun extends FreedomService
switch (event.getMaterial()) switch (event.getMaterial())
{ {
case TROPICAL_FISH:
{ {
final int RADIUS_HIT = 5; final int RADIUS_HIT = 5;
final int STRENGTH = 4; final int STRENGTH = 4;

View File

@ -141,6 +141,31 @@ public class FPlayer
this.invSee = toggle; this.invSee = toggle;
} }
public boolean isEditBlocked()
{
return editBlocked;
}
public void setEditBlocked(boolean toggle)
{
this.editBlocked = toggle;
}
public boolean isPvpBlocked()
{
return pvpBlocked;
}
public CageData getCageData()
{
return cageData;
}
public void setPvpBlocked(boolean toggle)
{
this.pvpBlocked = toggle;
}
public boolean isFuckOff() public boolean isFuckOff()
{ {
return fuckoffRadius > 0; return fuckoffRadius > 0;
@ -353,6 +378,12 @@ public class FPlayer
this.inAdminchat = inAdminchat; this.inAdminchat = inAdminchat;
} }
public FreezeData getFreezeData()
{
return freezeData;
}
public boolean inAdminChat() public boolean inAdminChat()
{ {
return this.inAdminchat; return this.inAdminchat;

View File

@ -82,20 +82,15 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
return ips.remove(ip); return ips.remove(ip);
} }
public void setDiscordId(final String discordId)
{
this.discordId = discordId;
}
@Override @Override
public boolean isValid() public boolean isValid()
{ {
return name != null return name != null
&& !ips.isEmpty(); && !ips.isEmpty();
} }
public boolean getForumEnabled()
{
return this.forumEnabled;
}
public boolean getDiscordEnabled()
{
return this.discordEnabled;
}
} }

View File

@ -56,7 +56,7 @@ public final class AdminWorld extends CustomWorld
@Override @Override
protected World generateWorld() protected World generateWorld()
{ {
final WorldCreator worldCreator = new WorldCreator(getName()); final WorldCreator worldCreator = new WorldCreator(WORLD_NAME);
worldCreator.generateStructures(false); worldCreator.generateStructures(false);
worldCreator.type(WorldType.NORMAL); worldCreator.type(WorldType.NORMAL);
worldCreator.environment(World.Environment.NORMAL); worldCreator.environment(World.Environment.NORMAL);

View File

@ -23,6 +23,7 @@ public class Flatlands extends CustomWorld
{ {
super("flatlands"); super("flatlands");
} }
private static final String WORLD_NAME = "flatlands";
@Override @Override
protected World generateWorld() protected World generateWorld()
@ -89,4 +90,8 @@ public class Flatlands extends CustomWorld
} }
} }
public String getName()
{
return this.WORLD_NAME;
}
} }

View File

@ -28,6 +28,7 @@ public final class MasterBuilderWorld extends CustomWorld
// //
private WorldWeather weather = WorldWeather.OFF; private WorldWeather weather = WorldWeather.OFF;
private WorldTime time = WorldTime.INHERIT; private WorldTime time = WorldTime.INHERIT;
private static final String WORLD_NAME = "masterbuilderworld";
public MasterBuilderWorld() public MasterBuilderWorld()
{ {
@ -43,7 +44,7 @@ public final class MasterBuilderWorld extends CustomWorld
@Override @Override
protected World generateWorld() protected World generateWorld()
{ {
final WorldCreator worldCreator = new WorldCreator(getName()); final WorldCreator worldCreator = new WorldCreator(WORLD_NAME);
worldCreator.generateStructures(false); worldCreator.generateStructures(false);
worldCreator.type(WorldType.NORMAL); worldCreator.type(WorldType.NORMAL);
worldCreator.environment(World.Environment.NORMAL); worldCreator.environment(World.Environment.NORMAL);

View File

@ -1,5 +1,5 @@
# #
# TotalFreedomMod 5.0 Admin List # TotalFreedomMod 5.2 Admin List
# #
prozza: prozza:

View File

@ -1,3 +1,3 @@
# #
# TotalFreedomMod 5.0 Player Bans # TotalFreedomMod 5.2 Player Bans
# #

View File

@ -1,5 +1,5 @@
# #
# TotalFreedomMod 5.0 Configuration # TotalFreedomMod 5.2 Configuration
# by Madgeek1450 and Prozza # by Madgeek1450 and Prozza
# #

View File

@ -1,3 +1,3 @@
# #
# TotalFreedomMod 5.0 Master Builder List # TotalFreedomMod 5.2 Master Builder List
# #

View File

@ -1,5 +1,5 @@
# #
# TotalFreedomMod 5.0 Permanent Bans # TotalFreedomMod 5.2 Permanent Bans
# #
badplayer1: badplayer1:

View File

@ -1,3 +1,3 @@
# #
# TotalFreedomMod 5.0 Player Punishments # TotalFreedomMod 5.2 Player Punishments
# #

71
totalfreedom.iml Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.13-pre7-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.Pravian:Aero:5f82926" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.12-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.18" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TotalFreedom:BukkitTelnet:4.5-pre1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-core:2.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-api:2.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TFPatches:TF-LibsDisguises:c213295f95" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.comphenix.protocol:ProtocolLib:4.4.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.comphenix.protocol:ProtocolLib-API:4.4.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: cglib:cglib-nodep:3.2.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.comphenix.executors:BukkitExecutors:1.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TFPatches.TF-WorldEdit:worldedit-bukkit:2e79570525" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TFPatches.TF-WorldEdit:worldedit-core:2e79570525" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:jchronic:0.2.4a" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.thoughtworks.paranamer:paranamer:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.lib:jlibnoise:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.sk89q.bukkit:bukkit-classloader-check:1.7.9-R0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:dummypermscompat:1.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.9.4-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:Essentials:2.13.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:craftbukkit:1.13-pre7-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.dv8tion:JDA:3.7.1_385" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: club.minnced:opus-java:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: club.minnced:opus-java-api:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.dev.jna:jna:4.4.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: club.minnced:opus-java-natives:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.neovisionaries:nv-websocket-client:2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.squareup.okhttp3:okhttp:3.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="module-library">
<library name="Maven: net.coreprotect:CoreProtect:2.14.2">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/CoreProtect_2.14.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-legacy:6.2" level="project" />
</component>
</module>