TotalFreedomMod Electrum

Version 5.0

This TotalFreedomMod release implements many changes. Most notably, the
internals have been completely revamped. TotalFreedomMod now relies on the
Aero library for core mechanics such as command handling and services.

Another important change is the UUID system. In TotalFreedomMod Electrum,
it has been completely removed. The core reason for this is that the
system as a whole was very bugged. Additionally, it did not solve the
primary reason for its conception: preserving player data when the player
changes their username. This is because TotalFreedomMod servers usually
run in offline-mode. This meaning that some of the players joining do not
have a registerd Mojang UUID whatsoever. All in all, the UUID system was
buggy, and it did not fix the reason it was implemented, so it has been
completely removed. The admin list and the ban list now use usernames and
IPs again.

Lastly, many smaller changes have been implemented. Due to the amount of
changes, they have not been named individualy. Please refer to the issues
below for more details.

Fixes #342
Fixes #350
Fixes #380
Fixes #684
Fixes #704
Fixes #716
Fixes #735
Fixes #745
Fixes #784
Fixes #765
Fixes #791
Fixes #805
Fixes #826
Fixes #883
Fixes #1524
Fixes #1534
Fixes #1536
Fixes #1538
Fixes #1545
Fixes #1546
Fixes #1568
Fixes #1627
Resolves #403
Resolves #435
Resolves #597
Resolves #603
Resolves #628
Resolves #690
Resolves #708
Resolves #747
Resolves #748
Resolves #749
Resolves #764
Resolves #767
Resolves #782
Resolves #809
Resolves #803
Resolves #811
Resolves #813
Resolves #830
Resolves #848
Resolves #856
Resolves #876
Resolves #908
Resolves #992
Resolves #1018
Resolves #1432
Resolves #1446
Resolves #1494
Resolves #1501
Resolves #1526
Resolves #1540
Resolves #1550
Resolves #1560
Resolves #1561
Resolves #1578
Resolves #1613
This commit is contained in:
Jerom van der Sar
2016-05-12 21:40:39 +02:00
parent 924f718d5a
commit aca3398d21
109 changed files with 2112 additions and 2036 deletions

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod;
import me.totalfreedom.totalfreedommod.fun.Trailer;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -11,12 +12,14 @@ import me.totalfreedom.totalfreedommod.blocking.BlockBlocker;
import me.totalfreedom.totalfreedommod.blocking.EventBlocker;
import me.totalfreedom.totalfreedommod.blocking.InteractBlocker;
import me.totalfreedom.totalfreedommod.blocking.MobBlocker;
import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
import me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker;
import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge;
import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge;
import me.totalfreedom.totalfreedommod.caging.Cager;
import me.totalfreedom.totalfreedommod.command.CommandLoader;
import me.totalfreedom.totalfreedommod.config.MainConfig;
import me.totalfreedom.totalfreedommod.freeze.Freezer;
import me.totalfreedom.totalfreedommod.fun.ItemFun;
import me.totalfreedom.totalfreedommod.fun.Jumppads;
@ -28,9 +31,12 @@ import me.totalfreedom.totalfreedommod.rank.RankManager;
import me.totalfreedom.totalfreedommod.rollback.RollbackManager;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.util.MethodTimer;
import me.totalfreedom.totalfreedommod.world.WorldManager;
import net.pravian.aero.component.service.ServiceManager;
import net.pravian.aero.plugin.AeroPlugin;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.mcstats.Metrics;
@ -41,33 +47,35 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
//
public static final BuildProperties build = new BuildProperties();
//
@SuppressWarnings("FieldNameHidesFieldInSuperclass")
public static TotalFreedomMod plugin;
public static String pluginName;
public static String pluginVersion;
//
public MainConfig config;
//
// Services
public ServiceManager<TotalFreedomMod> services;
public ServerInterface si;
public SavedFlags sf;
public WorldManager wm;
public LogViewer lv;
public AdminList al;
public RankManager rm;
public CommandLoader cl;
public CommandBlocker cb;
public EventBlocker eb;
public BlockBlocker bb;
public MobBlocker mb;
public InteractBlocker ib;
public PotionBlocker pb;
public LoginProcess lp;
public AntiNuke nu;
public AntiSpam as;
public RankManager rm;
public PlayerList pl;
public CommandLoader cl;
public CommandBlocker cb;
public Announcer an;
public ChatManager cm;
public BanManager bm;
public PermbanList pb;
public PermbanList pm;
public ProtectArea pa;
public ServiceChecker sc;
public GameRuleHandler gr;
public RollbackManager rb;
public CommandSpy cs;
@ -77,6 +85,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
public Muter mu;
public Fuckoff fo;
public AutoKick ak;
public AutoEject ae;
public MovementValidator mv;
public EntityWiper ew;
public FrontDoor fd;
@ -85,6 +94,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
public Landminer lm;
public MP44 mp;
public Jumppads jp;
public Trailer tr;
public HTTPDaemon hd;
//
// Bridges
@ -96,26 +106,23 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
@Override
public void load()
{
TotalFreedomMod.plugin = this;
TotalFreedomMod.pluginName = plugin.getDescription().getName();
TotalFreedomMod.pluginVersion = plugin.getDescription().getVersion();
FLog.setPluginLogger(plugin.getLogger());
FLog.setServerLogger(server.getLogger());
build.load();
build.load(plugin);
}
@Override
public void enable()
{
TotalFreedomMod.plugin = this;
FLog.info("Created by Madgeek1450 and Prozza");
FLog.info("Version " + build.formattedVersion());
FLog.info("Compiled " + build.date + " by " + build.author);
final FUtil.MethodTimer timer = new FUtil.MethodTimer();
final MethodTimer timer = new MethodTimer();
timer.start();
// Warn if we're running on a wrong version
@ -128,33 +135,39 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
// Convert old config files
new ConfigConverter(plugin).convert();
FUtil.createBackups(TotalFreedomMod.CONFIG_FILENAME, true);
FUtil.createBackups(AdminList.CONFIG_FILENAME);
FUtil.createBackups(PermbanList.CONFIG_FILENAME);
BackupManager backups = new BackupManager(this);
backups.createBackups(TotalFreedomMod.CONFIG_FILENAME, true);
backups.createBackups(AdminList.CONFIG_FILENAME);
backups.createBackups(PermbanList.CONFIG_FILENAME);
config = new MainConfig(this);
config.load();
// Start services
services = new ServiceManager<>(plugin);
si = services.registerService(ServerInterface.class);
sf = services.registerService(SavedFlags.class);
wm = services.registerService(WorldManager.class);
lv = services.registerService(LogViewer.class);
al = services.registerService(AdminList.class);
rm = services.registerService(RankManager.class);
cl = services.registerService(CommandLoader.class);
cb = services.registerService(CommandBlocker.class);
eb = services.registerService(EventBlocker.class);
bb = services.registerService(BlockBlocker.class);
mb = services.registerService(MobBlocker.class);
ib = services.registerService(InteractBlocker.class);
pb = services.registerService(PotionBlocker.class);
lp = services.registerService(LoginProcess.class);
nu = services.registerService(AntiNuke.class);
as = services.registerService(AntiSpam.class);
rm = services.registerService(RankManager.class);
pl = services.registerService(PlayerList.class);
cl = services.registerService(CommandLoader.class);
cb = services.registerService(CommandBlocker.class);
an = services.registerService(Announcer.class);
cm = services.registerService(ChatManager.class);
bm = services.registerService(BanManager.class);
pb = services.registerService(PermbanList.class);
pm = services.registerService(PermbanList.class);
pa = services.registerService(ProtectArea.class);
sc = services.registerService(ServiceChecker.class);
gr = services.registerService(GameRuleHandler.class);
// Single admin utils
@ -166,6 +179,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
mu = services.registerService(Muter.class);
fo = services.registerService(Fuckoff.class);
ak = services.registerService(AutoKick.class);
ae = services.registerService(AutoEject.class);
mv = services.registerService(MovementValidator.class);
ew = services.registerService(EntityWiper.class);
@ -177,6 +191,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
lm = services.registerService(Landminer.class);
mp = services.registerService(MP44.class);
jp = services.registerService(Jumppads.class);
tr = services.registerService(Trailer.class);
// HTTPD
hd = services.registerService(HTTPDaemon.class);
@ -224,29 +239,31 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
server.getScheduler().cancelTasks(plugin);
FLog.info("Plugin disabled");
TotalFreedomMod.plugin = null;
}
public static class BuildProperties
{
public String author;
public String codename;
public String version;
public String number;
public String date;
public String head;
public void load()
public void load(TotalFreedomMod plugin)
{
try
{
final InputStream in = plugin.getResource("build.properties");
final Properties props = new Properties();
props.load(in);
in.close();
final Properties props;
try (InputStream in = plugin.getResource("build.properties"))
{
props = new Properties();
props.load(in);
}
author = props.getProperty("program.build.author", "unknown");
codename = props.getProperty("program.build.codename", "unknown");
version = props.getProperty("program.build.version", "unknown");
number = props.getProperty("program.build.number", "1");
date = props.getProperty("program.build.date", "unknown");
@ -265,4 +282,16 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
}
}
public static TotalFreedomMod plugin()
{
for (Plugin plugin : Bukkit.getPluginManager().getPlugins())
{
if (plugin.getName().equalsIgnoreCase(pluginName))
{
return (TotalFreedomMod) plugin;
}
}
return null;
}
}