diff --git a/README.md b/README.md index 1013a72d..33ccbea7 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ -FTBUtilities +SeverUtilities =============== +ServerUtilities for server owners. Fork and Rebrand of FTBUtilities, FTBLibrary, and LatCore 1.7.10. -(LatCoreMC before) -CurseForge link: -http://minecraft.curseforge.com/mc-mods/224778 ### License GTNH Modifications Copyright (C) 2021-2022 The GTNH Team GTNH Changes are Dual Licensed:
-For LatvianModder - Original MIT License
+For LatvianModder/FTBTeam - Original MIT License
For everyone else, this code is licensed LGPL v3.0 or later. Feel free to use our changes, just give back any changes you make to the community as well! Original code Copyright (c) 2016 LatvianModder and licensed MIT (Based on LatMod Discord and the original https://latmod.com/) - -![MIT License](license-support.png) + +### License Support: +* Latvian Modder's statement on mods he worked on, including FTBUtilities: +![Lat MIT License](lat-mit-license.png) +![Lat FTBU License](lat-ftbu-license-discord.png) + +* [FTB Utilities wayback machine license](https://web.archive.org/web/20190418033327/https://minecraft.curseforge.com/projects/ftb-utilities) +![FTB Utilities License CF Wayback](ftbu-license-wayback.png) +* [FTB Library wayback machine license](https://web.archive.org/web/20190418011645/https://minecraft.curseforge.com/projects/ftblib) +![FTB Library License CF Wayback](ftbl-license-wayback.png) diff --git a/ftbl-license-wayback.png b/ftbl-license-wayback.png new file mode 100644 index 00000000..d5293964 Binary files /dev/null and b/ftbl-license-wayback.png differ diff --git a/ftbu-license-wayback.png b/ftbu-license-wayback.png new file mode 100644 index 00000000..0b32f9c7 Binary files /dev/null and b/ftbu-license-wayback.png differ diff --git a/gradle.properties b/gradle.properties index 8d794b05..021ef6d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ -modName = FTBUtilities +modName = ServerUtilities # This is a case-sensitive string to identify your mod. Convention is to use lower case. -modId = FTBU +modId = ServerUtilities -modGroup = ftb.utils +modGroup = serverutils.utils # WHY is there no version field? # The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the @@ -26,7 +26,7 @@ developmentEnvironmentUserName = Developer # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # version in @Mod([...], version = VERSION, [...]) # Leave these properties empty to skip individual token replacements -replaceGradleTokenInFile = FTBUFinals.java +replaceGradleTokenInFile = ServerUtilitiesFinals.java gradleTokenModId = gradleTokenModName = gradleTokenVersion = GRADLETOKEN_VERSION @@ -61,7 +61,7 @@ usesShadowedDependencies = false # Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older # projects. New projects should not use this parameter. -customArchiveBaseName = FTBUtilities +customArchiveBaseName = ServerUtilities # Optional parameter to prevent the source code from being published # noPublishedSources = diff --git a/lat-ftbu-license-discord.png b/lat-ftbu-license-discord.png new file mode 100644 index 00000000..bfc8dae3 Binary files /dev/null and b/lat-ftbu-license-discord.png differ diff --git a/license-support.png b/lat-mit-license.png similarity index 100% rename from license-support.png rename to lat-mit-license.png diff --git a/src/main/java/ftb/lib/api/EventFTBReload.java b/src/main/java/ftb/lib/api/EventFTBReload.java deleted file mode 100644 index 1aa509ba..00000000 --- a/src/main/java/ftb/lib/api/EventFTBReload.java +++ /dev/null @@ -1,18 +0,0 @@ -package ftb.lib.api; - -import net.minecraft.command.ICommandSender; - -import ftb.lib.FTBWorld; - -public class EventFTBReload extends EventLM { - - public final FTBWorld world; - public final ICommandSender sender; - public final boolean reloadingClient; - - public EventFTBReload(FTBWorld w, ICommandSender ics, boolean b) { - world = w; - sender = ics; - reloadingClient = b; - } -} diff --git a/src/main/java/ftb/lib/api/EventFTBWorldClient.java b/src/main/java/ftb/lib/api/EventFTBWorldClient.java deleted file mode 100644 index baff0eac..00000000 --- a/src/main/java/ftb/lib/api/EventFTBWorldClient.java +++ /dev/null @@ -1,12 +0,0 @@ -package ftb.lib.api; - -import ftb.lib.FTBWorld; - -public class EventFTBWorldClient extends EventLM { - - public final FTBWorld world; - - public EventFTBWorldClient(FTBWorld w) { - world = w; - } -} diff --git a/src/main/java/ftb/lib/api/EventFTBWorldServer.java b/src/main/java/ftb/lib/api/EventFTBWorldServer.java deleted file mode 100644 index b9cda5d7..00000000 --- a/src/main/java/ftb/lib/api/EventFTBWorldServer.java +++ /dev/null @@ -1,16 +0,0 @@ -package ftb.lib.api; - -import net.minecraft.server.MinecraftServer; - -import ftb.lib.FTBWorld; - -public class EventFTBWorldServer extends EventLM { - - public final FTBWorld world; - public final MinecraftServer server; - - public EventFTBWorldServer(FTBWorld w, MinecraftServer s) { - world = w; - server = s; - } -} diff --git a/src/main/java/ftb/lib/api/FTBLibLang.java b/src/main/java/ftb/lib/api/FTBLibLang.java deleted file mode 100644 index 6c2a9bdf..00000000 --- a/src/main/java/ftb/lib/api/FTBLibLang.java +++ /dev/null @@ -1,39 +0,0 @@ -package ftb.lib.api; - -public class FTBLibLang { - - public static final LangKey button_settings = new LangKey("ftbl.button.settings"); - public static final LangKey button_back = new LangKey("ftbl.button.back"); - public static final LangKey button_up = new LangKey("ftbl.button.up"); - public static final LangKey button_down = new LangKey("ftbl.button.down"); - public static final LangKey button_prev = new LangKey("ftbl.button.prev"); - public static final LangKey button_next = new LangKey("ftbl.button.next"); - public static final LangKey button_cancel = new LangKey("ftbl.button.cancel"); - public static final LangKey button_accept = new LangKey("ftbl.button.accept"); - public static final LangKey button_add = new LangKey("ftbl.button.add"); - public static final LangKey button_remove = new LangKey("ftbl.button.remove"); - public static final LangKey button_close = new LangKey("ftbl.button.close"); - public static final LangKey button_save = new LangKey("ftbl.button.save"); - public static final LangKey button_refresh = new LangKey("ftbl.button.refresh"); - public static final LangKey button_edit = new LangKey("ftbl.button.edit"); - public static final LangKey button_info = new LangKey("ftbl.button.info"); - - public static final LangKey client_config = new LangKey("client_config"); - public static final LangKey feature_disabled = new LangKey("ftbl.feature_disabled"); - public static final LangKey invalid_subcmd = new LangKey("ftbl.invalid_subcmd"); - public static final LangKey missing_args = new LangKey("ftbl.missing_args"); - public static final LangKey delete_item = new LangKey("ftbl.delete_item"); - - public static final LangKey label_server_forced = new LangKey("ftbl.label.server_forced"); - public static final LangKey label_true = new LangKey("ftbl.label.true"); - public static final LangKey label_false = new LangKey("ftbl.label.false"); - public static final LangKey label_enabled = new LangKey("ftbl.label.enabled"); - public static final LangKey label_disabled = new LangKey("ftbl.label.disabled"); - public static final LangKey label_on = new LangKey("ftbl.label.on"); - public static final LangKey label_off = new LangKey("ftbl.label.off"); - public static final LangKey label_online = new LangKey("ftbl.label.online"); - public static final LangKey label_offline = new LangKey("ftbl.label.offline"); - public static final LangKey label_whitelist = new LangKey("ftbl.label.whitelist"); - public static final LangKey label_blacklist = new LangKey("ftbl.label.blacklist"); - -} diff --git a/src/main/java/ftb/lib/mod/FTBLibFinals.java b/src/main/java/ftb/lib/mod/FTBLibFinals.java deleted file mode 100644 index 35d4e33d..00000000 --- a/src/main/java/ftb/lib/mod/FTBLibFinals.java +++ /dev/null @@ -1,11 +0,0 @@ -package ftb.lib.mod; - -import ftb.utils.mod.FTBUFinals; - -public class FTBLibFinals { - - public static final String MOD_ID = "FTBL"; - public static final String MOD_NAME = "FTBLib"; - public static final String MOD_VERSION = FTBUFinals.MOD_VERSION; - public static final String MOD_DEP = "required-after:Forge@[10.13.4.1558,);after:Baubles;after:NotEnoughItems;after:Waila;after:MineTweaker3"; -} diff --git a/src/main/java/ftb/lib/mod/FTBLibMod.java b/src/main/java/ftb/lib/mod/FTBLibMod.java deleted file mode 100644 index cb5c8d90..00000000 --- a/src/main/java/ftb/lib/mod/FTBLibMod.java +++ /dev/null @@ -1,130 +0,0 @@ -package ftb.lib.mod; - -import java.io.File; -import java.util.Map; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import cpw.mods.fml.common.*; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.network.NetworkCheckHandler; -import cpw.mods.fml.relauncher.Side; -import ftb.lib.EventBusHelper; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.JsonHelper; -import ftb.lib.LMAccessToken; -import ftb.lib.LMMod; -import ftb.lib.api.EventFTBWorldServer; -import ftb.lib.api.GameModes; -import ftb.lib.api.config.ConfigRegistry; -import ftb.lib.api.item.ODItems; -import ftb.lib.mod.cmd.CmdEditConfig; -import ftb.lib.mod.cmd.CmdHelpOverride; -import ftb.lib.mod.cmd.CmdListOverride; -import ftb.lib.mod.cmd.CmdMode; -import ftb.lib.mod.cmd.CmdNotify; -import ftb.lib.mod.cmd.CmdReload; -import ftb.lib.mod.cmd.CmdSetItemName; -import ftb.lib.mod.cmd.CmdTrashCan; -import ftb.lib.mod.config.FTBLibConfig; -import ftb.lib.mod.config.FTBLibConfigCmd; -import ftb.lib.mod.net.FTBLibNetHandler; -import latmod.lib.util.OS; - -@Mod( - modid = FTBLibFinals.MOD_ID, - name = FTBLibFinals.MOD_NAME, - version = FTBLibFinals.MOD_VERSION, - dependencies = FTBLibFinals.MOD_DEP, - acceptedMinecraftVersions = "1.7.10") -public class FTBLibMod { - - @Mod.Instance(FTBLibFinals.MOD_ID) - public static FTBLibMod inst; - - @SidedProxy(serverSide = "ftb.lib.mod.FTBLibModCommon", clientSide = "ftb.lib.mod.client.FTBLibModClient") - public static FTBLibModCommon proxy; - - public static final Logger logger = LogManager.getLogger("FTBLib"); - - public static LMMod mod; - - @Mod.EventHandler - public void onPreInit(FMLPreInitializationEvent e) { - if (FTBLib.DEV_ENV) logger.info("Loading FTBLib, DevEnv"); - else logger.info("Loading FTBLib, v" + FTBLibFinals.MOD_VERSION); - - logger.info("OS: " + OS.current + ", 64bit: " + OS.is64); - - mod = LMMod.create(FTBLibFinals.MOD_ID); - - FTBLib.init(e.getModConfigurationDirectory()); - JsonHelper.init(); - FTBLibNetHandler.init(); - ODItems.preInit(); - - FTBLibConfig.load(); - EventBusHelper.register(new FTBLibEventHandler()); - proxy.preInit(); - } - - @Mod.EventHandler - public void init(FMLInitializationEvent e) { - FMLInterModComms.sendMessage("Waila", "register", "ftb.lib.api.waila.EventRegisterWaila.registerHandlers"); - } - - @Mod.EventHandler - public void onPostInit(FMLPostInitializationEvent e) { - ODItems.postInit(); - proxy.postInit(); - GameModes.reload(); - ConfigRegistry.reload(); - } - - @Mod.EventHandler - public void onServerStarting(FMLServerStartingEvent e) { - if (FTBLibConfigCmd.override_list.getAsBoolean()) FTBLib.addCommand(e, new CmdListOverride()); - if (FTBLibConfigCmd.override_help.getAsBoolean()) FTBLib.addCommand(e, new CmdHelpOverride()); - FTBLib.addCommand(e, new CmdEditConfig()); - FTBLib.addCommand(e, new CmdMode()); - FTBLib.addCommand(e, new CmdReload()); - FTBLib.addCommand(e, new CmdNotify()); - FTBLib.addCommand(e, new CmdSetItemName()); - FTBLib.addCommand(e, new CmdTrashCan()); - } - - @Mod.EventHandler - public void onServerAboutToStart(FMLServerAboutToStartEvent e) { - FTBLib.folderWorld = new File(FMLCommonHandler.instance().getSavesDirectory(), e.getServer().getFolderName()); - ConfigRegistry.reload(); - - GameModes.reload(); - FTBWorld.server = new FTBWorld(Side.SERVER); - EventFTBWorldServer event = new EventFTBWorldServer(FTBWorld.server, e.getServer()); - if (FTBLib.ftbu != null) FTBLib.ftbu.onFTBWorldServer(event); - event.post(); - } - - @Mod.EventHandler - public void onServerStarted(FMLServerStartedEvent e) { - FTBLib.reload(FTBLib.getServer(), false, false); - } - - @Mod.EventHandler - public void onServerShutDown(FMLServerStoppedEvent e) { - if (FTBLib.ftbu != null) FTBLib.ftbu.onFTBWorldServerClosed(); - FTBWorld.server = null; - FTBLib.folderWorld = null; - LMAccessToken.clear(); - ConfigRegistry.clearTemp(); - // FTBLibEventHandler.loaded = false; - } - - @NetworkCheckHandler - public boolean checkNetwork(Map m, Side side) { - String s = m.get(FTBLibFinals.MOD_ID); - return s == null || s.equals(FTBLibFinals.MOD_VERSION); - } -} diff --git a/src/main/java/ftb/lib/mod/client/FTBLibClientEventHandler.java b/src/main/java/ftb/lib/mod/client/FTBLibClientEventHandler.java deleted file mode 100644 index c4c27e97..00000000 --- a/src/main/java/ftb/lib/mod/client/FTBLibClientEventHandler.java +++ /dev/null @@ -1,83 +0,0 @@ -package ftb.lib.mod.client; - -import java.util.List; - -import net.minecraft.client.multiplayer.ServerData; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.client.event.*; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; - -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.network.FMLNetworkEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.api.EventFTBWorldClient; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.item.LMInvUtils; -import ftb.lib.api.item.ODItems; - -@SideOnly(Side.CLIENT) -public class FTBLibClientEventHandler { - - public static final FTBLibClientEventHandler instance = new FTBLibClientEventHandler(); - - @SubscribeEvent - public void onConnected(FMLNetworkEvent.ClientConnectedToServerEvent e) { - ServerData sd = FTBLibClient.mc.func_147104_D(); - EventFTBWorldClient event = new EventFTBWorldClient(null); - if (FTBLib.ftbu != null) FTBLib.ftbu.onFTBWorldClient(event); - FTBWorld.client = null; - event.post(); - } - - @SubscribeEvent - public void onDisconnected(FMLNetworkEvent.ClientDisconnectionFromServerEvent e) { - EventFTBWorldClient event = new EventFTBWorldClient(null); - if (FTBLib.ftbu != null) FTBLib.ftbu.onFTBWorldClient(event); - event.post(); - FTBWorld.client = null; - } - - @SubscribeEvent - public void onTooltip(ItemTooltipEvent e) { - if (e.itemStack == null || e.itemStack.getItem() == null) return; - - if (FTBLibModClient.item_reg_names.getAsBoolean()) { - e.toolTip.add(LMInvUtils.getRegName(e.itemStack).toString()); - } - - if (FTBLibModClient.item_ore_names.getAsBoolean()) { - List ores = ODItems.getOreNames(e.itemStack); - - if (ores != null && !ores.isEmpty()) { - e.toolTip.add("Ore Dictionary names:"); - for (String or : ores) e.toolTip.add("> " + or); - } - } - - if (FTBLib.ftbu != null) FTBLib.ftbu.onTooltip(e); - } - - @SubscribeEvent - public void onDrawDebugText(RenderGameOverlayEvent.Text e) { - if (!FTBLibClient.mc.gameSettings.showDebugInfo) { - if (FTBLib.DEV_ENV) { - e.left.add( - "[MC " + EnumChatFormatting.GOLD + Loader.MC_VERSION + EnumChatFormatting.WHITE + " DevEnv]"); - } - } else { - // if(DevConsole.enabled()) e.left.add("r: " + MathHelperMC.get2DRotation(FTBLibClient.mc.thePlayer)); - } - } - - @SubscribeEvent - public void preTexturesLoaded(TextureStitchEvent.Pre e) { - if (e.map.getTextureType() == 0) { - FTBLibClient.blockNullIcon = e.map.registerIcon("ftbl:empty_block"); - FTBLibClient.clearCachedData(); - } - } -} diff --git a/src/main/java/ftb/lib/mod/cmd/CmdReload.java b/src/main/java/ftb/lib/mod/cmd/CmdReload.java deleted file mode 100644 index d2046e5e..00000000 --- a/src/main/java/ftb/lib/mod/cmd/CmdReload.java +++ /dev/null @@ -1,21 +0,0 @@ -package ftb.lib.mod.cmd; - -import net.minecraft.command.ICommandSender; -import net.minecraft.util.IChatComponent; - -import ftb.lib.FTBLib; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.mod.config.FTBLibConfigCmdNames; - -public class CmdReload extends CommandLM { - - public CmdReload() { - super(FTBLibConfigCmdNames.reload.getAsString(), CommandLevel.OP); - } - - public IChatComponent onCommand(ICommandSender ics, String[] args) { - FTBLib.reload(ics, true, args.length > 0 && args[0].equalsIgnoreCase("client")); - return null; - } -} diff --git a/src/main/java/ftb/lib/mod/config/FTBLibConfig.java b/src/main/java/ftb/lib/mod/config/FTBLibConfig.java deleted file mode 100644 index e22a9d0f..00000000 --- a/src/main/java/ftb/lib/mod/config/FTBLibConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package ftb.lib.mod.config; - -import java.io.File; - -import ftb.lib.FTBLib; -import ftb.lib.api.config.ConfigFile; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.ConfigRegistry; - -public class FTBLibConfig { - - public static final ConfigFile configFile = new ConfigFile("ftblib"); - - public static void load() { - configFile.setFile(new File(FTBLib.folderLocal, "ftblib.json")); - configFile.setDisplayName("FTBLib"); - configFile.add(new ConfigGroup("compat").addAll(FTBLibConfigCompat.class, null, false), false); - configFile.add(new ConfigGroup("commands").addAll(FTBLibConfigCmd.class, null, false), false); - configFile.add(new ConfigGroup("command_names").addAll(FTBLibConfigCmdNames.class, null, false), false); - ConfigRegistry.add(configFile); - configFile.load(); - } -} diff --git a/src/main/java/ftb/lib/mod/net/MessageNotifyPlayer.java b/src/main/java/ftb/lib/mod/net/MessageNotifyPlayer.java deleted file mode 100644 index ca8658a3..00000000 --- a/src/main/java/ftb/lib/mod/net/MessageNotifyPlayer.java +++ /dev/null @@ -1,45 +0,0 @@ -package ftb.lib.mod.net; - -import cpw.mods.fml.common.network.simpleimpl.*; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.EnumScreen; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.api.notification.ClientNotifications; -import ftb.lib.api.notification.Notification; -import ftb.lib.mod.client.FTBLibModClient; -import latmod.lib.ByteCount; -import latmod.lib.json.JsonElementIO; - -public class MessageNotifyPlayer extends MessageLM { - - public MessageNotifyPlayer() { - super(ByteCount.SHORT); - } - - public MessageNotifyPlayer(Notification n) { - this(); - JsonElementIO.write(io, n.getSerializableElement()); - } - - public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET_GUI; - } - - @SideOnly(Side.CLIENT) - public IMessage onMessage(MessageContext ctx) { - if (FTBLibModClient.notifications.get() != EnumScreen.OFF) { - Notification n = Notification.deserialize(JsonElementIO.read(io)); - - if (FTBLibModClient.notifications.get() == EnumScreen.SCREEN) ClientNotifications.add(n); - else { - FTBLibClient.mc.thePlayer.addChatMessage(n.title); - if (n.desc != null) FTBLibClient.mc.thePlayer.addChatMessage(n.desc); - } - } - - return null; - } -} diff --git a/src/main/java/ftb/lib/mod/net/MessageReload.java b/src/main/java/ftb/lib/mod/net/MessageReload.java deleted file mode 100644 index 25b89c2a..00000000 --- a/src/main/java/ftb/lib/mod/net/MessageReload.java +++ /dev/null @@ -1,106 +0,0 @@ -package ftb.lib.mod.net; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; - -import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.LMNBTUtils; -import ftb.lib.api.EventFTBReload; -import ftb.lib.api.GameModes; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.ConfigRegistry; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.api.notification.ClientNotifications; -import ftb.lib.api.notification.Notification; -import ftb.lib.mod.FTBLibMod; -import ftb.lib.mod.client.FTBLibModClient; -import latmod.lib.ByteCount; -import latmod.lib.ByteIOStream; -import latmod.lib.LMUtils; - -public class MessageReload extends MessageLM { - - public MessageReload() { - super(ByteCount.INT); - } - - public MessageReload(FTBWorld w, int reloadClient) { - this(); - io.writeByte(reloadClient); - - if (reloadClient > 0) { - w.writeReloadData(io); - writeSyncedConfig(io); - } - } - - public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET; - } - - public IMessage onMessage(MessageContext ctx) { - if (FTBLib.DEV_ENV) { - FTBLib.dev_logger.info("--------< RELOADING >----------"); - } - - byte reload = io.readByte(); - - if (reload == 0) { - Notification n = new Notification( - "reload_client_config", - FTBLibMod.mod.chatComponent("reload_client_config"), - 7000); - n.title.getChatStyle().setColor(EnumChatFormatting.WHITE); - n.desc = new ChatComponentText("/" + FTBLibModClient.reload_client_cmd.getAsString()); - n.setColor(0xFF333333); - ClientNotifications.add(n); - return null; - } - - long ms = LMUtils.millis(); - FTBWorld.client.readReloadData(io); - readSyncedConfig(io); - - if (reload > 0) { - reloadClient(ms, reload > 1); - } - - return null; - } - - public static void reloadClient(long ms, boolean printMessage) { - if (ms == 0L) ms = LMUtils.millis(); - GameModes.reload(); - EntityPlayer ep = FTBLibMod.proxy.getClientPlayer(); - EventFTBReload event = new EventFTBReload(FTBWorld.client, ep, true); - if (FTBLib.ftbu != null) FTBLib.ftbu.onReloaded(event); - event.post(); - - if (printMessage) { - FTBLib.printChat(ep, FTBLibMod.mod.chatComponent("reloaded_client", ((LMUtils.millis() - ms) + "ms"))); - } - - FTBLibMod.logger.info("Current Mode: " + FTBWorld.client.getMode()); - } - - static void writeSyncedConfig(ByteIOStream out) { - NBTTagCompound tag = new NBTTagCompound(); - ConfigRegistry.synced.writeToNBT(tag, false); - LMNBTUtils.writeTag(out, tag); - - if (FTBLib.DEV_ENV) - FTBLib.dev_logger.info("Synced config TX: " + ConfigRegistry.synced.getSerializableElement()); - } - - static void readSyncedConfig(ByteIOStream in) { - NBTTagCompound tag = LMNBTUtils.readTag(in); - ConfigGroup synced = new ConfigGroup(ConfigRegistry.synced.getID()); - synced.readFromNBT(tag, false); - ConfigRegistry.synced.loadFromGroup(synced, true); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("Synced config RX: " + synced.getSerializableElement()); - } -} diff --git a/src/main/java/ftb/lib/mod/net/MessageSendWorldID.java b/src/main/java/ftb/lib/mod/net/MessageSendWorldID.java deleted file mode 100644 index fdb431c5..00000000 --- a/src/main/java/ftb/lib/mod/net/MessageSendWorldID.java +++ /dev/null @@ -1,44 +0,0 @@ -package ftb.lib.mod.net; - -import net.minecraft.entity.player.EntityPlayerMP; - -import cpw.mods.fml.common.network.simpleimpl.*; -import cpw.mods.fml.relauncher.Side; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.api.EventFTBWorldClient; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import latmod.lib.ByteCount; - -public class MessageSendWorldID extends MessageLM { - - public MessageSendWorldID() { - super(ByteCount.INT); - } - - public MessageSendWorldID(FTBWorld w, EntityPlayerMP ep) { - this(); - MessageReload.writeSyncedConfig(io); - io.writeBoolean(FTBLib.ftbu != null); - w.writeReloadData(io); - if (FTBLib.ftbu != null) FTBLib.ftbu.writeWorldData(io, ep); - } - - public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET; - } - - public IMessage onMessage(MessageContext ctx) { - MessageReload.readSyncedConfig(io); - boolean hasFTBU = io.readBoolean(); - - boolean first = FTBWorld.client == null; - if (first) FTBWorld.client = new FTBWorld(Side.CLIENT); - FTBWorld.client.readReloadData(io); - new EventFTBWorldClient(FTBWorld.client).post(); - if (first && hasFTBU && FTBLib.ftbu != null) FTBLib.ftbu.readWorldData(io); - - return null; - } -} diff --git a/src/main/java/ftb/utils/api/guide/EventFTBUClientGuide.java b/src/main/java/ftb/utils/api/guide/EventFTBUClientGuide.java deleted file mode 100644 index 4eb41ba0..00000000 --- a/src/main/java/ftb/utils/api/guide/EventFTBUClientGuide.java +++ /dev/null @@ -1,12 +0,0 @@ -package ftb.utils.api.guide; - -import ftb.lib.api.EventLM; - -public class EventFTBUClientGuide extends EventLM { - - public final ClientGuideFile file; - - public EventFTBUClientGuide(ClientGuideFile f) { - file = f; - } -} diff --git a/src/main/java/ftb/utils/api/guide/EventFTBUServerGuide.java b/src/main/java/ftb/utils/api/guide/EventFTBUServerGuide.java deleted file mode 100644 index b66f67f8..00000000 --- a/src/main/java/ftb/utils/api/guide/EventFTBUServerGuide.java +++ /dev/null @@ -1,17 +0,0 @@ -package ftb.utils.api.guide; - -import ftb.lib.api.EventLM; -import ftb.utils.world.LMPlayerServer; - -public class EventFTBUServerGuide extends EventLM { - - public final ServerGuideFile file; - public final LMPlayerServer player; - public final boolean isOP; - - public EventFTBUServerGuide(ServerGuideFile f, LMPlayerServer p) { - file = f; - player = p; - isOP = p.isOP(); - } -} diff --git a/src/main/java/ftb/utils/mod/FTBU.java b/src/main/java/ftb/utils/mod/FTBU.java deleted file mode 100644 index 4b5235ea..00000000 --- a/src/main/java/ftb/utils/mod/FTBU.java +++ /dev/null @@ -1,99 +0,0 @@ -package ftb.utils.mod; - -import java.util.Map; - -import net.minecraft.entity.player.EntityPlayerMP; - -import org.apache.logging.log4j.*; - -import cpw.mods.fml.common.*; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.network.NetworkCheckHandler; -import cpw.mods.fml.relauncher.Side; -import ftb.lib.*; -import ftb.utils.mod.cmd.*; -import ftb.utils.mod.cmd.admin.CmdAdmin; -import ftb.utils.mod.config.*; -import ftb.utils.mod.handlers.*; -import ftb.utils.mod.handlers.ftbl.FTBLIntegration; -import ftb.utils.net.FTBUNetHandler; -import ftb.utils.world.Backups; - -@Mod( - modid = FTBUFinals.MOD_ID, - version = FTBUFinals.MOD_VERSION, - name = FTBUFinals.MOD_NAME, - dependencies = FTBUFinals.MOD_DEP, - acceptedMinecraftVersions = "1.7.10") -public class FTBU { - - @Mod.Instance(FTBUFinals.MOD_ID) - public static FTBU inst; - - @SidedProxy(clientSide = "ftb.utils.mod.client.FTBUClient", serverSide = "ftb.utils.mod.FTBUCommon") - public static FTBUCommon proxy; - - @SidedProxy( - clientSide = "ftb.utils.mod.handlers.ftbl.FTBLIntegrationClient", - serverSide = "ftb.utils.mod.handlers.ftbl.FTBLIntegration") - public static FTBLIntegration ftbl_int; - - public static LMMod mod; - - public static Logger logger; - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent e) { - mod = LMMod.create(FTBUFinals.MOD_ID); - FTBLib.ftbu = ftbl_int; - logger = LogManager.getLogger(FTBUFinals.MOD_ID); - - FTBUConfig.load(); - - EventBusHelper.register(new FTBUPlayerEventHandler()); - EventBusHelper.register(new FTBUWorldEventHandler()); - EventBusHelper.register(new FTBUChatEventHandler()); - FTBUChunkEventHandler.instance.init(); - - FTBUNetHandler.init(); - Backups.init(); - proxy.preInit(); - } - - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent e) { - proxy.postInit(); - } - - @Mod.EventHandler - public void registerCommands(FMLServerStartingEvent e) { - FTBLib.addCommand(e, new CmdAdmin()); - FTBLib.addCommand(e, new CmdLMPlayerSettings()); - - if (FTBUConfigCmd.back.getAsBoolean()) FTBLib.addCommand(e, new CmdBack()); - if (FTBUConfigCmd.spawn.getAsBoolean()) FTBLib.addCommand(e, new CmdSpawn()); - if (FTBUConfigCmd.tplast.getAsBoolean()) FTBLib.addCommand(e, new CmdTplast()); - if (FTBUConfigCmd.warp.getAsBoolean()) FTBLib.addCommand(e, new CmdWarp()); - - if (FTBUConfigCmd.home.getAsBoolean()) { - FTBLib.addCommand(e, new CmdSetHome()); - FTBLib.addCommand(e, new CmdHome()); - FTBLib.addCommand(e, new CmdDelHome()); - } - } - - @Mod.EventHandler - public void serverStopping(FMLServerStoppingEvent e) { - if (FTBLib.hasOnlinePlayers()) { - for (EntityPlayerMP ep : FTBLib.getAllOnlinePlayers(null)) { - FTBUPlayerEventHandler.playerLoggedOut(ep); - } - } - } - - @NetworkCheckHandler - public boolean checkNetwork(Map m, Side side) { - String s = m.get(FTBUFinals.MOD_ID); - return s == null || s.equals(FTBUFinals.MOD_VERSION); - } -} diff --git a/src/main/java/ftb/utils/mod/FTBUFinals.java b/src/main/java/ftb/utils/mod/FTBUFinals.java deleted file mode 100644 index ce50d8e0..00000000 --- a/src/main/java/ftb/utils/mod/FTBUFinals.java +++ /dev/null @@ -1,10 +0,0 @@ -package ftb.utils.mod; - -public class FTBUFinals // FTBU -{ - - public static final String MOD_ID = "FTBU"; - public static final String MOD_VERSION = "GRADLETOKEN_VERSION"; - public static final String MOD_NAME = "FTBUtilities"; - public static final String MOD_DEP = "required-after:FTBL;after:Baubles;after:Waila"; -} diff --git a/src/main/java/ftb/utils/mod/client/FTBUClient.java b/src/main/java/ftb/utils/mod/client/FTBUClient.java deleted file mode 100644 index c3ca20ae..00000000 --- a/src/main/java/ftb/utils/mod/client/FTBUClient.java +++ /dev/null @@ -1,41 +0,0 @@ -package ftb.utils.mod.client; - -import net.minecraftforge.client.ClientCommandHandler; - -import cpw.mods.fml.relauncher.*; -import ftb.lib.EventBusHelper; -import ftb.lib.api.config.*; -import ftb.lib.api.gui.LMGuiHandlerRegistry; -import ftb.utils.badges.BadgeRenderer; -import ftb.utils.mod.*; -import ftb.utils.mod.client.gui.guide.ClientSettings; -import ftb.utils.mod.cmd.CmdMath; -import ftb.utils.world.*; - -@SideOnly(Side.CLIENT) -public class FTBUClient extends FTBUCommon // FTBLibModClient -{ - - public static final ConfigEntryBool render_badges = new ConfigEntryBool("render_badges", true); - - public static final ConfigEntryBool sort_friends_az = new ConfigEntryBool("sort_friends_az", false); - public static final ConfigEntryBool loaded_chunks_space_key = new ConfigEntryBool("loaded_chunks_space_key", false); - - public void preInit() { - ClientConfigRegistry.addGroup("ftbu", FTBUClient.class); - ClientConfigRegistry.addGroup("ftbu_guide", ClientSettings.class); - ClientCommandHandler.instance.registerCommand(new CmdMath()); - FTBUActions.init(); - } - - public void postInit() { - LMGuiHandlerRegistry.add(FTBUGuiHandler.instance); - FTBUClickAction.init(); - - EventBusHelper.register(BadgeRenderer.instance); - } - - public LMWorld getClientWorldLM() { - return LMWorldClient.inst; - } -} diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfig.java b/src/main/java/ftb/utils/mod/config/FTBUConfig.java deleted file mode 100644 index dd3a4fac..00000000 --- a/src/main/java/ftb/utils/mod/config/FTBUConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -package ftb.utils.mod.config; - -import java.io.File; - -import ftb.lib.FTBLib; -import ftb.lib.api.config.*; -import ftb.utils.world.ranks.Ranks; - -public class FTBUConfig // FTBU -{ - - public static final ConfigFile configFile = new ConfigFile("ftbu"); - - public static void load() { - configFile.setFile(new File(FTBLib.folderLocal, "ftbu/config.json")); - configFile.setDisplayName("FTBUtilities"); - configFile.addGroup("backups", FTBUConfigBackups.class); - configFile.addGroup("commands", FTBUConfigCmd.class); - configFile.addGroup("general", FTBUConfigGeneral.class); - configFile.addGroup("login", FTBUConfigLogin.class); - configFile.addGroup("tops", FTBUConfigTops.class); - configFile.addGroup("chunkloading", FTBUConfigChunkloading.class); - Ranks.load(configFile); - - ConfigRegistry.add(configFile); - configFile.load(); - } -} diff --git a/src/main/java/ftb/utils/net/MessageFTBU.java b/src/main/java/ftb/utils/net/MessageFTBU.java deleted file mode 100644 index 985a552f..00000000 --- a/src/main/java/ftb/utils/net/MessageFTBU.java +++ /dev/null @@ -1,15 +0,0 @@ -package ftb.utils.net; - -import ftb.lib.api.net.*; -import latmod.lib.ByteCount; - -abstract class MessageFTBU extends MessageLM { - - public MessageFTBU(ByteCount t) { - super(t); - } - - public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET; - } -} diff --git a/src/main/java/ftb/lib/BaublesHelper.java b/src/main/java/serverutils/lib/BaublesHelper.java similarity index 97% rename from src/main/java/ftb/lib/BaublesHelper.java rename to src/main/java/serverutils/lib/BaublesHelper.java index 053cf0aa..a2c21055 100644 --- a/src/main/java/ftb/lib/BaublesHelper.java +++ b/src/main/java/serverutils/lib/BaublesHelper.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.lang.reflect.Method; diff --git a/src/main/java/ftb/lib/BlockDimPos.java b/src/main/java/serverutils/lib/BlockDimPos.java similarity index 98% rename from src/main/java/ftb/lib/BlockDimPos.java rename to src/main/java/serverutils/lib/BlockDimPos.java index f50a2efa..7cc946c3 100644 --- a/src/main/java/ftb/lib/BlockDimPos.java +++ b/src/main/java/serverutils/lib/BlockDimPos.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.util.ChunkCoordinates; diff --git a/src/main/java/ftb/lib/BroadcastSender.java b/src/main/java/serverutils/lib/BroadcastSender.java similarity index 73% rename from src/main/java/ftb/lib/BroadcastSender.java rename to src/main/java/serverutils/lib/BroadcastSender.java index 1d1bc59b..c76c2287 100644 --- a/src/main/java/ftb/lib/BroadcastSender.java +++ b/src/main/java/serverutils/lib/BroadcastSender.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.command.ICommandSender; import net.minecraft.util.*; @@ -17,7 +17,7 @@ public IChatComponent func_145748_c_() { } public void addChatMessage(IChatComponent component) { - FTBLib.getServer().getConfigurationManager().sendChatMsgImpl(component, true); + ServerUtilitiesLib.getServer().getConfigurationManager().sendChatMsgImpl(component, true); } public boolean canCommandSenderUseCommand(int permLevel, String commandName) { @@ -25,10 +25,10 @@ public boolean canCommandSenderUseCommand(int permLevel, String commandName) { } public ChunkCoordinates getPlayerCoordinates() { - return FTBLib.getServerWorld().getSpawnPoint(); + return ServerUtilitiesLib.getServerWorld().getSpawnPoint(); } public World getEntityWorld() { - return FTBLib.getServerWorld(); + return ServerUtilitiesLib.getServerWorld(); } } diff --git a/src/main/java/ftb/lib/EntityPos.java b/src/main/java/serverutils/lib/EntityPos.java similarity index 98% rename from src/main/java/ftb/lib/EntityPos.java rename to src/main/java/serverutils/lib/EntityPos.java index 9bda2cf7..179360dd 100644 --- a/src/main/java/ftb/lib/EntityPos.java +++ b/src/main/java/serverutils/lib/EntityPos.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.entity.Entity; import net.minecraft.util.Vec3; diff --git a/src/main/java/ftb/lib/EnumMCColor.java b/src/main/java/serverutils/lib/EnumMCColor.java similarity index 95% rename from src/main/java/ftb/lib/EnumMCColor.java rename to src/main/java/serverutils/lib/EnumMCColor.java index a3685d55..02365aa6 100644 --- a/src/main/java/ftb/lib/EnumMCColor.java +++ b/src/main/java/serverutils/lib/EnumMCColor.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.client.resources.I18n; import net.minecraft.init.Items; @@ -42,7 +42,7 @@ public enum EnumMCColor // ItemDye EnumMCColor(String s, int c) { ID = ordinal(); name = ItemDye.field_150921_b[ID]; - lang = "ftbl.color." + s.toLowerCase(); + lang = "serverlib.color." + s.toLowerCase(); color = ItemDye.field_150922_c[ID]; colorBright = c; diff --git a/src/main/java/ftb/lib/EnumScreen.java b/src/main/java/serverutils/lib/EnumScreen.java similarity index 70% rename from src/main/java/ftb/lib/EnumScreen.java rename to src/main/java/serverutils/lib/EnumScreen.java index 15b4c303..53e4c2ae 100644 --- a/src/main/java/ftb/lib/EnumScreen.java +++ b/src/main/java/serverutils/lib/EnumScreen.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; public enum EnumScreen { OFF, diff --git a/src/main/java/ftb/lib/EventBusHelper.java b/src/main/java/serverutils/lib/EventBusHelper.java similarity index 95% rename from src/main/java/ftb/lib/EventBusHelper.java rename to src/main/java/serverutils/lib/EventBusHelper.java index 8ef9658b..76327cd0 100644 --- a/src/main/java/ftb/lib/EventBusHelper.java +++ b/src/main/java/serverutils/lib/EventBusHelper.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/ftb/lib/JsonHelper.java b/src/main/java/serverutils/lib/JsonHelper.java similarity index 98% rename from src/main/java/ftb/lib/JsonHelper.java rename to src/main/java/serverutils/lib/JsonHelper.java index 18da036d..dd6e45f6 100644 --- a/src/main/java/ftb/lib/JsonHelper.java +++ b/src/main/java/serverutils/lib/JsonHelper.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.util.*; diff --git a/src/main/java/ftb/lib/LMAccessToken.java b/src/main/java/serverutils/lib/LMAccessToken.java similarity index 97% rename from src/main/java/ftb/lib/LMAccessToken.java rename to src/main/java/serverutils/lib/LMAccessToken.java index c5fdf936..a51397ee 100644 --- a/src/main/java/ftb/lib/LMAccessToken.java +++ b/src/main/java/serverutils/lib/LMAccessToken.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.util.HashMap; import java.util.Random; diff --git a/src/main/java/ftb/lib/LMDimUtils.java b/src/main/java/serverutils/lib/LMDimUtils.java similarity index 97% rename from src/main/java/ftb/lib/LMDimUtils.java rename to src/main/java/serverutils/lib/LMDimUtils.java index 13a4c8d0..4b3fc975 100644 --- a/src/main/java/ftb/lib/LMDimUtils.java +++ b/src/main/java/serverutils/lib/LMDimUtils.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.entity.Entity; import net.minecraft.entity.player.*; @@ -33,7 +33,8 @@ public static boolean teleportPlayer(Entity entity, double x, double y, double z } } - // FTBLib.dev_logger.info("Teleporting " + entity + " from " + new EntityPos(entity) + " to " + new EntityPos(x, + // ServerUtilitiesLibrary.dev_logger.info("Teleporting " + entity + " from " + new EntityPos(entity) + " to " + + // new EntityPos(x, // y, z, dim)); int from = entity.dimension; float rotationYaw = entity.rotationYaw; diff --git a/src/main/java/ftb/lib/LMMod.java b/src/main/java/serverutils/lib/LMMod.java similarity index 80% rename from src/main/java/ftb/lib/LMMod.java rename to src/main/java/serverutils/lib/LMMod.java index 2e73e461..16fa012a 100644 --- a/src/main/java/ftb/lib/LMMod.java +++ b/src/main/java/serverutils/lib/LMMod.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.util.ArrayList; import java.util.List; @@ -12,18 +12,18 @@ import cpw.mods.fml.common.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.block.IBlockLM; -import ftb.lib.api.item.IItemLM; -import ftb.lib.api.recipes.LMRecipes; -import ftb.lib.api.tile.TileLM; -import ftb.lib.mod.FTBLibMod; import latmod.lib.util.FinalIDObject; +import serverutils.lib.api.block.IBlockLM; +import serverutils.lib.api.item.IItemLM; +import serverutils.lib.api.recipes.LMRecipes; +import serverutils.lib.api.tile.TileLM; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public class LMMod extends FinalIDObject { public static LMMod create(String s) { LMMod mod = new LMMod(s); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("LMMod '" + mod.getID() + "' created"); + if (ServerUtilitiesLib.DEV_ENV) ServerUtilitiesLib.dev_logger.info("LMMod '" + mod.getID() + "' created"); return mod; } @@ -90,15 +90,15 @@ public String getItemName(String s) { } public String translate(String s, Object... args) { - return FTBLibMod.proxy.translate(lowerCaseModID + '.' + s, args); + return ServerUtilitiesLibraryMod.proxy.translate(lowerCaseModID + '.' + s, args); } public void addItem(IItemLM... ai) { for (IItemLM i : ai) { if (i instanceof IBlockLM) { - FTBLib.addBlock((Block) i, ((IBlockLM) i).getItemBlock(), i.getItemID()); + ServerUtilitiesLib.addBlock((Block) i, ((IBlockLM) i).getItemBlock(), i.getItemID()); } else { - FTBLib.addItem(i.getItem(), i.getItemID()); + ServerUtilitiesLib.addItem(i.getItem(), i.getItemID()); } itemsAndBlocks.add(i); @@ -106,11 +106,11 @@ public void addItem(IItemLM... ai) { } public void addTile(Class c, String s, String... alt) { - FTBLib.addTileEntity(c, getID() + '.' + s, alt); + ServerUtilitiesLib.addTileEntity(c, getID() + '.' + s, alt); } public void addEntity(Class c, String s, int id) { - FTBLib.addEntity(c, s, id, getID()); + ServerUtilitiesLib.addEntity(c, s, id, getID()); } public void onPostLoaded() { diff --git a/src/main/java/ftb/lib/LMNBTUtils.java b/src/main/java/serverutils/lib/LMNBTUtils.java similarity index 95% rename from src/main/java/ftb/lib/LMNBTUtils.java rename to src/main/java/serverutils/lib/LMNBTUtils.java index d4f83104..0ae3eeb4 100644 --- a/src/main/java/ftb/lib/LMNBTUtils.java +++ b/src/main/java/serverutils/lib/LMNBTUtils.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.io.File; import java.io.FileInputStream; @@ -12,10 +12,10 @@ import net.minecraft.nbt.*; -import ftb.lib.mod.FTBLibMod; import latmod.lib.ByteCount; import latmod.lib.ByteIOStream; import latmod.lib.LMListUtils; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; @SuppressWarnings("all") public class LMNBTUtils { @@ -64,7 +64,7 @@ public static NBTTagCompound readMap(File f) { return CompressedStreamTools.read(f); } catch (Exception e) { e.printStackTrace(); - FTBLibMod.logger.info("Possibly corrupted / old file. Trying the old method"); + ServerUtilitiesLibraryMod.logger.info("Possibly corrupted / old file. Trying the old method"); try { FileInputStream is = new FileInputStream(f); diff --git a/src/main/java/ftb/lib/LMSecurity.java b/src/main/java/serverutils/lib/LMSecurity.java similarity index 68% rename from src/main/java/ftb/lib/LMSecurity.java rename to src/main/java/serverutils/lib/LMSecurity.java index 05b66a7c..71841d16 100644 --- a/src/main/java/ftb/lib/LMSecurity.java +++ b/src/main/java/serverutils/lib/LMSecurity.java @@ -1,11 +1,11 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; -import ftb.lib.api.friends.ILMPlayer; +import serverutils.lib.api.friends.ILMPlayer; public class LMSecurity { @@ -22,14 +22,15 @@ public int getOwnerID() { } public ILMPlayer getOwner() { - return (FTBLib.ftbu == null) ? null : FTBLib.ftbu.getLMPlayer(ownerID); + return (ServerUtilitiesLib.serverUtilitiesIntegration == null) ? null + : ServerUtilitiesLib.serverUtilitiesIntegration.getLMPlayer(ownerID); } public void setOwner(Object o) { ownerID = 0; - if (o != null && FTBLib.ftbu != null) { - ILMPlayer p = FTBLib.ftbu.getLMPlayer(o); + if (o != null && ServerUtilitiesLib.serverUtilitiesIntegration != null) { + ILMPlayer p = ServerUtilitiesLib.serverUtilitiesIntegration.getLMPlayer(o); if (p != null) ownerID = p.getPlayerID(); } } @@ -59,8 +60,8 @@ public boolean hasOwner() { } public final boolean isOwner(EntityPlayer ep) { - if (FTBLib.ftbu == null) return true; - return isOwner(FTBLib.ftbu.getLMPlayer(ep)); + if (ServerUtilitiesLib.serverUtilitiesIntegration == null) return true; + return isOwner(ServerUtilitiesLib.serverUtilitiesIntegration.getLMPlayer(ep)); } public boolean isOwner(ILMPlayer player) { @@ -68,12 +69,12 @@ public boolean isOwner(ILMPlayer player) { } public final boolean canInteract(EntityPlayer ep) { - if (FTBLib.ftbu == null) return true; - return canInteract(FTBLib.ftbu.getLMPlayer(ep)); + if (ServerUtilitiesLib.serverUtilitiesIntegration == null) return true; + return canInteract(ServerUtilitiesLib.serverUtilitiesIntegration.getLMPlayer(ep)); } public boolean canInteract(ILMPlayer playerLM) { - if (FTBLib.ftbu == null) return true; + if (ServerUtilitiesLib.serverUtilitiesIntegration == null) return true; if (level == PrivacyLevel.PUBLIC || getOwner() == null) return true; if (playerLM == null) return false; if (isOwner(playerLM)) return true; @@ -87,6 +88,8 @@ public boolean canInteract(ILMPlayer playerLM) { public void printOwner(ICommandSender ep) { ep.addChatMessage( - new ChatComponentTranslation("ftbl.owner", hasOwner() ? getOwner().getProfile().getName() : "null")); + new ChatComponentTranslation( + "serverlib.owner", + hasOwner() ? getOwner().getProfile().getName() : "null")); } } diff --git a/src/main/java/ftb/lib/MathHelperMC.java b/src/main/java/serverutils/lib/MathHelperMC.java similarity index 97% rename from src/main/java/ftb/lib/MathHelperMC.java rename to src/main/java/serverutils/lib/MathHelperMC.java index 178e8f5f..6c85bb5f 100644 --- a/src/main/java/ftb/lib/MathHelperMC.java +++ b/src/main/java/serverutils/lib/MathHelperMC.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.util.List; import java.util.Random; @@ -9,9 +9,9 @@ import net.minecraft.util.*; import net.minecraft.world.World; -import ftb.lib.mod.FTBLibMod; import latmod.lib.MathHelperLM; import latmod.lib.util.VecLM; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public class MathHelperMC { @@ -53,7 +53,7 @@ public static MovingObjectPosition rayTrace(EntityPlayer ep, double d) { } public static MovingObjectPosition rayTrace(EntityPlayer ep) { - return rayTrace(ep, FTBLibMod.proxy.getReachDist(ep)); + return rayTrace(ep, ServerUtilitiesLibraryMod.proxy.getReachDist(ep)); } public static MovingObjectPosition collisionRayTrace(World w, int x, int y, int z, Vec3 start, Vec3 end, diff --git a/src/main/java/ftb/lib/OtherMods.java b/src/main/java/serverutils/lib/OtherMods.java similarity index 96% rename from src/main/java/ftb/lib/OtherMods.java rename to src/main/java/serverutils/lib/OtherMods.java index bb6a44fb..2b1a00d6 100644 --- a/src/main/java/ftb/lib/OtherMods.java +++ b/src/main/java/serverutils/lib/OtherMods.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; public class OtherMods { diff --git a/src/main/java/ftb/lib/PrivacyLevel.java b/src/main/java/serverutils/lib/PrivacyLevel.java similarity index 88% rename from src/main/java/ftb/lib/PrivacyLevel.java rename to src/main/java/serverutils/lib/PrivacyLevel.java index 7bda0f9e..25dcd735 100644 --- a/src/main/java/ftb/lib/PrivacyLevel.java +++ b/src/main/java/serverutils/lib/PrivacyLevel.java @@ -1,7 +1,7 @@ -package ftb.lib; +package serverutils.lib; -import ftb.lib.api.LangKey; -import ftb.lib.api.gui.GuiIcons; +import serverutils.lib.api.LangKey; +import serverutils.lib.api.gui.GuiIcons; public enum PrivacyLevel { @@ -11,7 +11,7 @@ public enum PrivacyLevel { public static final PrivacyLevel[] VALUES_3 = new PrivacyLevel[] { PUBLIC, PRIVATE, FRIENDS }; public static final PrivacyLevel[] VALUES_2 = new PrivacyLevel[] { PUBLIC, PRIVATE }; - public static final String enumLangKey = "ftbl.security"; + public static final String enumLangKey = "serverlib.security"; public final int ID; public final LangKey lang; diff --git a/src/main/java/ftb/lib/FTBLib.java b/src/main/java/serverutils/lib/ServerUtilitiesLib.java similarity index 86% rename from src/main/java/ftb/lib/FTBLib.java rename to src/main/java/serverutils/lib/ServerUtilitiesLib.java index d8811498..a49d6325 100644 --- a/src/main/java/ftb/lib/FTBLib.java +++ b/src/main/java/serverutils/lib/ServerUtilitiesLib.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import java.io.File; import java.util.ArrayList; @@ -36,34 +36,34 @@ import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.registry.*; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.EventFTBReload; -import ftb.lib.api.GameModes; -import ftb.lib.api.ServerTickCallback; -import ftb.lib.api.config.ConfigRegistry; -import ftb.lib.api.notification.Notification; -import ftb.lib.api.tile.IGuiTile; -import ftb.lib.mod.FTBLibEventHandler; -import ftb.lib.mod.FTBLibMod; -import ftb.lib.mod.FTBUIntegration; -import ftb.lib.mod.net.MessageNotifyPlayer; -import ftb.lib.mod.net.MessageOpenGuiTile; -import ftb.lib.mod.net.MessageReload; import latmod.lib.LMJsonUtils; import latmod.lib.LMStringUtils; import latmod.lib.LMUtils; import latmod.lib.net.LMURLConnection; import latmod.lib.net.RequestMethod; - -public class FTBLib { +import serverutils.lib.api.EventServerUtilitiesReload; +import serverutils.lib.api.GameModes; +import serverutils.lib.api.ServerTickCallback; +import serverutils.lib.api.config.ConfigRegistry; +import serverutils.lib.api.notification.Notification; +import serverutils.lib.api.tile.IGuiTile; +import serverutils.lib.mod.ServerUtilitiesIntegration; +import serverutils.lib.mod.ServerUtilitiesLibEventHandler; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.lib.mod.net.MessageNotifyPlayer; +import serverutils.lib.mod.net.MessageOpenGuiTile; +import serverutils.lib.mod.net.MessageReload; + +public class ServerUtilitiesLib { public static final boolean DEV_ENV = ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) .booleanValue(); public static boolean userIsLatvianModder = false; - public static final Logger dev_logger = LogManager.getLogger("FTBLibDev"); + public static final Logger dev_logger = LogManager.getLogger("ServerUtilitiesLibraryDev"); public static final String FORMATTING = "\u00a7"; public static final Pattern textFormattingPattern = Pattern.compile("(?i)" + FORMATTING + "[0-9A-FK-OR]"); private static final HashMap cachedUUIDs = new HashMap<>(); - public static FTBUIntegration ftbu = null; + public static ServerUtilitiesIntegration serverUtilitiesIntegration = null; public static final EnumChatFormatting[] chatColors = new EnumChatFormatting[] { EnumChatFormatting.BLACK, EnumChatFormatting.DARK_BLUE, EnumChatFormatting.DARK_GREEN, EnumChatFormatting.DARK_AQUA, @@ -90,25 +90,28 @@ public static void init(File configFolder) { if (dev_logger instanceof org.apache.logging.log4j.core.Logger) { if (DEV_ENV) ((org.apache.logging.log4j.core.Logger) dev_logger).setLevel(Level.ALL); else((org.apache.logging.log4j.core.Logger) dev_logger).setLevel(Level.OFF); - } else FTBLibMod.logger + } else ServerUtilitiesLibraryMod.logger .info("DevLogger isn't org.apache.logging.log4j.core.Logger! It's " + dev_logger.getClass().getName()); } public static void reload(ICommandSender sender, boolean printMessage, boolean reloadClient) { - if (FTBWorld.server == null) return; + if (ServerUtilsWorld.server == null) return; long ms = LMUtils.millis(); ConfigRegistry.reload(); GameModes.reload(); - EventFTBReload event = new EventFTBReload(FTBWorld.server, sender, reloadClient); - if (ftbu != null) ftbu.onReloaded(event); + EventServerUtilitiesReload event = new EventServerUtilitiesReload( + ServerUtilsWorld.server, + sender, + reloadClient); + if (serverUtilitiesIntegration != null) serverUtilitiesIntegration.onReloaded(event); event.post(); if (printMessage) printChat( BroadcastSender.inst, - FTBLibMod.mod.chatComponent("reloaded_server", ((LMUtils.millis() - ms) + "ms"))); - new MessageReload(FTBWorld.server, 2).sendTo(null); + ServerUtilitiesLibraryMod.mod.chatComponent("reloaded_server", ((LMUtils.millis() - ms) + "ms"))); + new MessageReload(ServerUtilsWorld.server, 2).sendTo(null); } public static IChatComponent getChatComponent(Object o) { @@ -155,7 +158,7 @@ public static void addCommand(FMLServerStartingEvent e, ICommand c) { * Prints message to chat (doesn't translate it) */ public static void printChat(ICommandSender ep, Object o) { - if (ep == null) ep = FTBLibMod.proxy.getClientPlayer(); + if (ep == null) ep = ServerUtilitiesLibraryMod.proxy.getClientPlayer(); if (ep != null) ep.addChatMessage(getChatComponent(o)); else System.out.println(o); } @@ -178,7 +181,7 @@ public static String getPath(ResourceLocation res) { } public static boolean resourceExists(ResourceLocation res) { - return FTBLib.class.getResource(getPath(res)) != null; + return ServerUtilitiesLib.class.getResource(getPath(res)) != null; } public static boolean hasOnlinePlayers() { @@ -222,7 +225,7 @@ public static EntityPlayerMP getPlayerMP(UUID id) { } public static List getPlayerNames(boolean online) { - if (ftbu != null) return Arrays.asList(ftbu.getPlayerNames(online)); + if (serverUtilitiesIntegration != null) return Arrays.asList(serverUtilitiesIntegration.getPlayerNames(online)); ArrayList l = new ArrayList<>(); if (online) { @@ -302,13 +305,13 @@ else if (ep instanceof EntityPlayerMP) { epM.openContainer.windowId = epM.currentWindowId; epM.openContainer.addCraftingToCrafters(epM); new MessageOpenGuiTile((TileEntity) t, data, epM.currentWindowId).sendTo(epM); - } else if (!getEffectiveSide().isServer()) - FTBLibMod.proxy.openClientTileGui((ep == null) ? FTBLibMod.proxy.getClientPlayer() : ep, t, data); + } else if (!getEffectiveSide().isServer()) ServerUtilitiesLibraryMod.proxy + .openClientTileGui((ep == null) ? ServerUtilitiesLibraryMod.proxy.getClientPlayer() : ep, t, data); } public static void addCallback(ServerTickCallback c) { if (c.maxTick == 0) c.onCallback(); - else FTBLibEventHandler.pendingCallbacks.add(c); + else ServerUtilitiesLibEventHandler.pendingCallbacks.add(c); } public static boolean isOP(GameProfile p) { diff --git a/src/main/java/ftb/lib/FTBWorld.java b/src/main/java/serverutils/lib/ServerUtilsWorld.java similarity index 81% rename from src/main/java/ftb/lib/FTBWorld.java rename to src/main/java/serverutils/lib/ServerUtilsWorld.java index de0ab8d1..398a9608 100644 --- a/src/main/java/ftb/lib/FTBWorld.java +++ b/src/main/java/serverutils/lib/ServerUtilsWorld.java @@ -1,18 +1,18 @@ -package ftb.lib; +package serverutils.lib; import java.io.File; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.GameMode; -import ftb.lib.api.GameModes; import latmod.lib.ByteIOStream; import latmod.lib.LMFileUtils; +import serverutils.lib.api.GameMode; +import serverutils.lib.api.GameModes; -public class FTBWorld { +public class ServerUtilsWorld { - public static FTBWorld server = null, client = null; + public static ServerUtilsWorld server = null, client = null; - public static FTBWorld get(Side s) { + public static ServerUtilsWorld get(Side s) { return s.isServer() ? server : client; } @@ -22,7 +22,7 @@ public static FTBWorld get(Side s) { private File currentModeFile = null; private File currentWorldIDFile = null; - public FTBWorld(Side sd) { + public ServerUtilsWorld(Side sd) { side = sd; if (side.isClient()) { @@ -30,7 +30,7 @@ public FTBWorld(Side sd) { } else { currentMode = GameModes.getGameModes().defaultMode; try { - currentModeFile = new File(FTBLib.folderWorld, "ftb_gamemode.txt"); + currentModeFile = new File(ServerUtilitiesLib.folderWorld, "server_gamemode.txt"); currentMode = GameModes.getGameModes().get(LMFileUtils.loadAsText(currentModeFile).trim()); } catch (Exception ex) { /* ex.printStackTrace(); */ } diff --git a/src/main/java/ftb/lib/SidedDirection.java b/src/main/java/serverutils/lib/SidedDirection.java similarity index 98% rename from src/main/java/ftb/lib/SidedDirection.java rename to src/main/java/serverutils/lib/SidedDirection.java index ba0d8188..8c50decb 100644 --- a/src/main/java/ftb/lib/SidedDirection.java +++ b/src/main/java/serverutils/lib/SidedDirection.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.util.Facing; diff --git a/src/main/java/ftb/lib/TempLMPlayerFromEntity.java b/src/main/java/serverutils/lib/TempLMPlayerFromEntity.java similarity index 93% rename from src/main/java/ftb/lib/TempLMPlayerFromEntity.java rename to src/main/java/serverutils/lib/TempLMPlayerFromEntity.java index 426bf726..caa29fbb 100644 --- a/src/main/java/ftb/lib/TempLMPlayerFromEntity.java +++ b/src/main/java/serverutils/lib/TempLMPlayerFromEntity.java @@ -1,11 +1,11 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.entity.player.EntityPlayer; import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.friends.ILMPlayer; +import serverutils.lib.api.friends.ILMPlayer; /** * Created by LatvianModder on 15.01.2016. diff --git a/src/main/java/ftb/lib/TextureCoords.java b/src/main/java/serverutils/lib/TextureCoords.java similarity index 99% rename from src/main/java/ftb/lib/TextureCoords.java rename to src/main/java/serverutils/lib/TextureCoords.java index ae67ceca..3924519a 100644 --- a/src/main/java/ftb/lib/TextureCoords.java +++ b/src/main/java/serverutils/lib/TextureCoords.java @@ -1,4 +1,4 @@ -package ftb.lib; +package serverutils.lib; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/ftb/lib/api/EventLM.java b/src/main/java/serverutils/lib/api/EventLM.java similarity index 88% rename from src/main/java/ftb/lib/api/EventLM.java rename to src/main/java/serverutils/lib/api/EventLM.java index f17e7362..a22dd247 100644 --- a/src/main/java/ftb/lib/api/EventLM.java +++ b/src/main/java/serverutils/lib/api/EventLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api; +package serverutils.lib.api; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/serverutils/lib/api/EventServerUtilitiesReload.java b/src/main/java/serverutils/lib/api/EventServerUtilitiesReload.java new file mode 100644 index 00000000..6e50aded --- /dev/null +++ b/src/main/java/serverutils/lib/api/EventServerUtilitiesReload.java @@ -0,0 +1,18 @@ +package serverutils.lib.api; + +import net.minecraft.command.ICommandSender; + +import serverutils.lib.ServerUtilsWorld; + +public class EventServerUtilitiesReload extends EventLM { + + public final ServerUtilsWorld world; + public final ICommandSender sender; + public final boolean reloadingClient; + + public EventServerUtilitiesReload(ServerUtilsWorld w, ICommandSender ics, boolean b) { + world = w; + sender = ics; + reloadingClient = b; + } +} diff --git a/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldClient.java b/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldClient.java new file mode 100644 index 00000000..f933ec38 --- /dev/null +++ b/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldClient.java @@ -0,0 +1,12 @@ +package serverutils.lib.api; + +import serverutils.lib.ServerUtilsWorld; + +public class EventServerUtilitiesWorldClient extends EventLM { + + public final ServerUtilsWorld world; + + public EventServerUtilitiesWorldClient(ServerUtilsWorld w) { + world = w; + } +} diff --git a/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldServer.java b/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldServer.java new file mode 100644 index 00000000..015ae15e --- /dev/null +++ b/src/main/java/serverutils/lib/api/EventServerUtilitiesWorldServer.java @@ -0,0 +1,16 @@ +package serverutils.lib.api; + +import net.minecraft.server.MinecraftServer; + +import serverutils.lib.ServerUtilsWorld; + +public class EventServerUtilitiesWorldServer extends EventLM { + + public final ServerUtilsWorld world; + public final MinecraftServer server; + + public EventServerUtilitiesWorldServer(ServerUtilsWorld w, MinecraftServer s) { + world = w; + server = s; + } +} diff --git a/src/main/java/ftb/lib/api/GameMode.java b/src/main/java/serverutils/lib/api/GameMode.java similarity index 73% rename from src/main/java/ftb/lib/api/GameMode.java rename to src/main/java/serverutils/lib/api/GameMode.java index aca1ae88..8a629436 100644 --- a/src/main/java/ftb/lib/api/GameMode.java +++ b/src/main/java/serverutils/lib/api/GameMode.java @@ -1,9 +1,9 @@ -package ftb.lib.api; +package serverutils.lib.api; import java.io.File; -import ftb.lib.FTBLib; import latmod.lib.util.FinalIDObject; +import serverutils.lib.ServerUtilitiesLib; /** * Created by LatvianModder on 07.01.2016. @@ -15,7 +15,7 @@ public GameMode(String id) { } public File getFolder() { - File f = new File(FTBLib.folderModpack, getID()); + File f = new File(ServerUtilitiesLib.folderModpack, getID()); if (!f.exists()) f.mkdirs(); return f; } diff --git a/src/main/java/ftb/lib/api/GameModes.java b/src/main/java/serverutils/lib/api/GameModes.java similarity index 91% rename from src/main/java/ftb/lib/api/GameModes.java rename to src/main/java/serverutils/lib/api/GameModes.java index f9c69b17..db320018 100644 --- a/src/main/java/ftb/lib/api/GameModes.java +++ b/src/main/java/serverutils/lib/api/GameModes.java @@ -1,4 +1,4 @@ -package ftb.lib.api; +package serverutils.lib.api; import java.io.File; import java.util.Collections; @@ -10,9 +10,9 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import ftb.lib.FTBLib; import latmod.lib.LMFileUtils; import latmod.lib.LMJsonUtils; +import serverutils.lib.ServerUtilitiesLib; public class GameModes { @@ -53,7 +53,8 @@ public GameModes(JsonElement el) { defaultMode = modes0.get(o.get("default").getAsString()); String common = o.get("common").getAsString(); - if (modes0.containsKey(common)) throw new RuntimeException("FTBLib: common mode name can't be one of 'modes'!"); + if (modes0.containsKey(common)) + throw new RuntimeException("ServerUtilitiesLibrary: common mode name can't be one of 'modes'!"); commonMode = new GameMode(common); modes = Collections.unmodifiableMap(modes0); @@ -94,7 +95,7 @@ public JsonObject toJsonObject() { private static GameModes gameModes = null; public static void reload() { - File file = LMFileUtils.newFile(new File(FTBLib.folderModpack, "gamemodes.json")); + File file = LMFileUtils.newFile(new File(ServerUtilitiesLib.folderModpack, "gamemodes.json")); gameModes = new GameModes(LMJsonUtils.fromJson(file)); LMJsonUtils.toJson(file, gameModes.toJsonObject()); } diff --git a/src/main/java/ftb/lib/api/IClickable.java b/src/main/java/serverutils/lib/api/IClickable.java similarity index 71% rename from src/main/java/ftb/lib/api/IClickable.java rename to src/main/java/serverutils/lib/api/IClickable.java index 97f5eed3..cf06c914 100644 --- a/src/main/java/ftb/lib/api/IClickable.java +++ b/src/main/java/serverutils/lib/api/IClickable.java @@ -1,4 +1,4 @@ -package ftb.lib.api; +package serverutils.lib.api; public interface IClickable { diff --git a/src/main/java/ftb/lib/api/LangKey.java b/src/main/java/serverutils/lib/api/LangKey.java similarity index 95% rename from src/main/java/ftb/lib/api/LangKey.java rename to src/main/java/serverutils/lib/api/LangKey.java index cf7afa07..b6e06564 100644 --- a/src/main/java/ftb/lib/api/LangKey.java +++ b/src/main/java/serverutils/lib/api/LangKey.java @@ -1,4 +1,4 @@ -package ftb.lib.api; +package serverutils.lib.api; import net.minecraft.client.resources.I18n; import net.minecraft.util.*; diff --git a/src/main/java/ftb/lib/api/PlayerAction.java b/src/main/java/serverutils/lib/api/PlayerAction.java similarity index 79% rename from src/main/java/ftb/lib/api/PlayerAction.java rename to src/main/java/serverutils/lib/api/PlayerAction.java index 28a9144d..d7e9aaf7 100644 --- a/src/main/java/ftb/lib/api/PlayerAction.java +++ b/src/main/java/serverutils/lib/api/PlayerAction.java @@ -1,13 +1,13 @@ -package ftb.lib.api; +package serverutils.lib.api; import java.util.List; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.mod.FTBLibMod; import latmod.lib.util.FinalIDObject; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public abstract class PlayerAction extends FinalIDObject { @@ -46,13 +46,13 @@ public PlayerAction(Type t, String id, int p, TextureCoords c) { public abstract void onClicked(ILMPlayer self, ILMPlayer other); public String getDisplayName() { - return FTBLibMod.proxy.translate("player_action." + getID()); + return ServerUtilitiesLibraryMod.proxy.translate("player_action." + getID()); } public void addMouseOverText(List l) {} public void render(int ax, int ay, double z) { - FTBLibClient.setTexture(icon); + ServerUtilitiesLibraryClient.setTexture(icon); GuiLM.drawTexturedRectD(ax, ay, z, 16, 16, icon.minU, icon.minV, icon.maxU, icon.maxV); } diff --git a/src/main/java/ftb/lib/api/ServerTickCallback.java b/src/main/java/serverutils/lib/api/ServerTickCallback.java similarity index 94% rename from src/main/java/ftb/lib/api/ServerTickCallback.java rename to src/main/java/serverutils/lib/api/ServerTickCallback.java index d32ed20a..4577ea74 100644 --- a/src/main/java/ftb/lib/api/ServerTickCallback.java +++ b/src/main/java/serverutils/lib/api/ServerTickCallback.java @@ -1,4 +1,4 @@ -package ftb.lib.api; +package serverutils.lib.api; public abstract class ServerTickCallback { diff --git a/src/main/java/serverutils/lib/api/ServerUtilitiesLibLang.java b/src/main/java/serverutils/lib/api/ServerUtilitiesLibLang.java new file mode 100644 index 00000000..d8acaf9d --- /dev/null +++ b/src/main/java/serverutils/lib/api/ServerUtilitiesLibLang.java @@ -0,0 +1,39 @@ +package serverutils.lib.api; + +public class ServerUtilitiesLibLang { + + public static final LangKey button_settings = new LangKey("serverlib.button.settings"); + public static final LangKey button_back = new LangKey("serverlib.button.back"); + public static final LangKey button_up = new LangKey("serverlib.button.up"); + public static final LangKey button_down = new LangKey("serverlib.button.down"); + public static final LangKey button_prev = new LangKey("serverlib.button.prev"); + public static final LangKey button_next = new LangKey("serverlib.button.next"); + public static final LangKey button_cancel = new LangKey("serverlib.button.cancel"); + public static final LangKey button_accept = new LangKey("serverlib.button.accept"); + public static final LangKey button_add = new LangKey("serverlib.button.add"); + public static final LangKey button_remove = new LangKey("serverlib.button.remove"); + public static final LangKey button_close = new LangKey("serverlib.button.close"); + public static final LangKey button_save = new LangKey("serverlib.button.save"); + public static final LangKey button_refresh = new LangKey("serverlib.button.refresh"); + public static final LangKey button_edit = new LangKey("serverlib.button.edit"); + public static final LangKey button_info = new LangKey("serverlib.button.info"); + + public static final LangKey client_config = new LangKey("client_config"); + public static final LangKey feature_disabled = new LangKey("serverlib.feature_disabled"); + public static final LangKey invalid_subcmd = new LangKey("serverlib.invalid_subcmd"); + public static final LangKey missing_args = new LangKey("serverlib.missing_args"); + public static final LangKey delete_item = new LangKey("serverlib.delete_item"); + + public static final LangKey label_server_forced = new LangKey("serverlib.label.server_forced"); + public static final LangKey label_true = new LangKey("serverlib.label.true"); + public static final LangKey label_false = new LangKey("serverlib.label.false"); + public static final LangKey label_enabled = new LangKey("serverlib.label.enabled"); + public static final LangKey label_disabled = new LangKey("serverlib.label.disabled"); + public static final LangKey label_on = new LangKey("serverlib.label.on"); + public static final LangKey label_off = new LangKey("serverlib.label.off"); + public static final LangKey label_online = new LangKey("serverlib.label.online"); + public static final LangKey label_offline = new LangKey("serverlib.label.offline"); + public static final LangKey label_whitelist = new LangKey("serverlib.label.whitelist"); + public static final LangKey label_blacklist = new LangKey("serverlib.label.blacklist"); + +} diff --git a/src/main/java/ftb/lib/api/block/BlockLM.java b/src/main/java/serverutils/lib/api/block/BlockLM.java similarity index 98% rename from src/main/java/ftb/lib/api/block/BlockLM.java rename to src/main/java/serverutils/lib/api/block/BlockLM.java index e475ea3f..27b55b78 100644 --- a/src/main/java/ftb/lib/api/block/BlockLM.java +++ b/src/main/java/serverutils/lib/api/block/BlockLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.block; +package serverutils.lib.api.block; import java.util.List; @@ -16,8 +16,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.LMMod; -import ftb.lib.api.tile.TileLM; +import serverutils.lib.LMMod; +import serverutils.lib.api.tile.TileLM; public abstract class BlockLM extends Block implements IBlockLM { diff --git a/src/main/java/ftb/lib/api/block/IBlockLM.java b/src/main/java/serverutils/lib/api/block/IBlockLM.java similarity index 83% rename from src/main/java/ftb/lib/api/block/IBlockLM.java rename to src/main/java/serverutils/lib/api/block/IBlockLM.java index 60ec6ac5..306c0046 100644 --- a/src/main/java/ftb/lib/api/block/IBlockLM.java +++ b/src/main/java/serverutils/lib/api/block/IBlockLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.block; +package serverutils.lib.api.block; import java.util.List; @@ -7,7 +7,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.item.IItemLM; +import serverutils.lib.api.item.IItemLM; public interface IBlockLM extends IItemLM { diff --git a/src/main/java/ftb/lib/api/block/ItemBlockLM.java b/src/main/java/serverutils/lib/api/block/ItemBlockLM.java similarity index 95% rename from src/main/java/ftb/lib/api/block/ItemBlockLM.java rename to src/main/java/serverutils/lib/api/block/ItemBlockLM.java index 86ec6c9f..ff52d553 100644 --- a/src/main/java/ftb/lib/api/block/ItemBlockLM.java +++ b/src/main/java/serverutils/lib/api/block/ItemBlockLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.block; +package serverutils.lib.api.block; import java.util.List; diff --git a/src/main/java/ftb/lib/api/client/GlStateManager.java b/src/main/java/serverutils/lib/api/client/GlStateManager.java similarity index 98% rename from src/main/java/ftb/lib/api/client/GlStateManager.java rename to src/main/java/serverutils/lib/api/client/GlStateManager.java index f3ce048a..9b8c3597 100644 --- a/src/main/java/ftb/lib/api/client/GlStateManager.java +++ b/src/main/java/serverutils/lib/api/client/GlStateManager.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client; +package serverutils.lib.api.client; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; diff --git a/src/main/java/ftb/lib/api/client/LMFrustrumUtils.java b/src/main/java/serverutils/lib/api/client/LMFrustrumUtils.java similarity index 86% rename from src/main/java/ftb/lib/api/client/LMFrustrumUtils.java rename to src/main/java/serverutils/lib/api/client/LMFrustrumUtils.java index 295a6887..c970a2ee 100644 --- a/src/main/java/ftb/lib/api/client/LMFrustrumUtils.java +++ b/src/main/java/serverutils/lib/api/client/LMFrustrumUtils.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client; +package serverutils.lib.api.client; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.culling.Frustrum; @@ -24,15 +24,16 @@ public class LMFrustrumUtils { */ public static void update() { - Minecraft mc = FTBLibClient.mc; - isFirstPerson = FTBLibClient.mc.gameSettings.thirdPersonView == 0; + Minecraft mc = ServerUtilitiesLibraryClient.mc; + isFirstPerson = ServerUtilitiesLibraryClient.mc.gameSettings.thirdPersonView == 0; playerX = RenderManager.instance.viewerPosX; playerY = RenderManager.instance.viewerPosY; playerZ = RenderManager.instance.viewerPosZ; renderX = RenderManager.instance.renderPosX; renderY = RenderManager.instance.renderPosY; renderZ = RenderManager.instance.renderPosZ; - playerPosHash = Math.abs(LMUtils.longHashCode(FTBLibClient.getDim(), playerX, playerY, playerZ) + 1); + playerPosHash = Math + .abs(LMUtils.longHashCode(ServerUtilitiesLibraryClient.getDim(), playerX, playerY, playerZ) + 1); frustum.setPosition(playerX, playerY, playerZ); } diff --git a/src/main/java/ftb/lib/api/client/FTBLibClient.java b/src/main/java/serverutils/lib/api/client/ServerUtilitiesLibraryClient.java similarity index 88% rename from src/main/java/ftb/lib/api/client/FTBLibClient.java rename to src/main/java/serverutils/lib/api/client/ServerUtilitiesLibraryClient.java index 5950f720..5a541cdc 100644 --- a/src/main/java/ftb/lib/api/client/FTBLibClient.java +++ b/src/main/java/serverutils/lib/api/client/ServerUtilitiesLibraryClient.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client; +package serverutils.lib.api.client; import java.nio.ByteBuffer; import java.util.HashMap; @@ -30,17 +30,17 @@ import cpw.mods.fml.client.registry.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.TempLMPlayerFromEntity; -import ftb.lib.TextureCoords; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.gui.IClientActionGui; -import ftb.lib.api.gui.callback.ClientTickCallback; -import ftb.lib.mod.client.FTBLibRenderHandler; import latmod.lib.LMColorUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.TempLMPlayerFromEntity; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.gui.IClientActionGui; +import serverutils.lib.api.gui.callback.ClientTickCallback; +import serverutils.lib.mod.client.ServerUtilitiesLibraryRenderHandler; @SideOnly(Side.CLIENT) -public class FTBLibClient { +public class ServerUtilitiesLibraryClient { public static final Minecraft mc = FMLClientHandler.instance().getClient(); private static final HashMap cachedSkins = new HashMap<>(); @@ -75,7 +75,8 @@ public static void addTileRenderer(Class c, TileEntitySpec } public static ILMPlayer getClientLMPlayer() { - ILMPlayer p = (FTBLib.ftbu == null) ? null : FTBLib.ftbu.getLMPlayer(mc.thePlayer); + ILMPlayer p = (ServerUtilitiesLib.serverUtilitiesIntegration == null) ? null + : ServerUtilitiesLib.serverUtilitiesIntegration.getLMPlayer(mc.thePlayer); return (p == null) ? new TempLMPlayerFromEntity(Side.CLIENT, mc.thePlayer) : p; } @@ -83,8 +84,9 @@ public static boolean isIngame() { return mc.theWorld != null && mc.thePlayer != null && mc.thePlayer.worldObj != null; } - public static boolean isIngameWithFTBU() { - return isIngame() && FTBLib.ftbu != null && FTBLib.ftbu.hasClientWorld(); + public static boolean isIngameWithServerUtilities() { + return isIngame() && ServerUtilitiesLib.serverUtilitiesIntegration != null + && ServerUtilitiesLib.serverUtilitiesIntegration.hasClientWorld(); } public static int getDim() { @@ -215,7 +217,7 @@ public static boolean canRenderGui() { } public static void addClientTickCallback(ClientTickCallback e) { - FTBLibRenderHandler.callbacks.add(e); + ServerUtilitiesLibraryRenderHandler.callbacks.add(e); } public static void renderItem(World w, ItemStack is) { @@ -244,8 +246,8 @@ public static void renderGuiItem(ItemStack is, RenderItem itemRender, FontRender GlStateManager.color(1F, 1F, 1F, 1F); FontRenderer f = is.getItem().getFontRenderer(is); if (f == null) f = font; - itemRender.renderItemAndEffectIntoGUI(f, FTBLibClient.mc.getTextureManager(), is, x, y); - itemRender.renderItemOverlayIntoGUI(f, FTBLibClient.mc.getTextureManager(), is, x, y, null); + itemRender.renderItemAndEffectIntoGUI(f, ServerUtilitiesLibraryClient.mc.getTextureManager(), is, x, y); + itemRender.renderItemOverlayIntoGUI(f, ServerUtilitiesLibraryClient.mc.getTextureManager(), is, x, y, null); GlStateManager.popMatrix(); GlStateManager.popAttrib(); } diff --git a/src/main/java/ftb/lib/api/client/model/CubeRenderer.java b/src/main/java/serverutils/lib/api/client/model/CubeRenderer.java similarity index 98% rename from src/main/java/ftb/lib/api/client/model/CubeRenderer.java rename to src/main/java/serverutils/lib/api/client/model/CubeRenderer.java index 89c1fab9..e23da668 100644 --- a/src/main/java/ftb/lib/api/client/model/CubeRenderer.java +++ b/src/main/java/serverutils/lib/api/client/model/CubeRenderer.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client.model; +package serverutils.lib.api.client.model; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.AxisAlignedBB; diff --git a/src/main/java/ftb/lib/api/client/model/Face.java b/src/main/java/serverutils/lib/api/client/model/Face.java similarity index 98% rename from src/main/java/ftb/lib/api/client/model/Face.java rename to src/main/java/serverutils/lib/api/client/model/Face.java index 05dc3ea2..b274c264 100644 --- a/src/main/java/ftb/lib/api/client/model/Face.java +++ b/src/main/java/serverutils/lib/api/client/model/Face.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client.model; +package serverutils.lib.api.client.model; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/ftb/lib/api/client/model/Group.java b/src/main/java/serverutils/lib/api/client/model/Group.java similarity index 97% rename from src/main/java/ftb/lib/api/client/model/Group.java rename to src/main/java/serverutils/lib/api/client/model/Group.java index 77511daf..3d6b8487 100644 --- a/src/main/java/ftb/lib/api/client/model/Group.java +++ b/src/main/java/serverutils/lib/api/client/model/Group.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client.model; +package serverutils.lib.api.client.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.GlStateManager; +import serverutils.lib.api.client.GlStateManager; /** * Made by LatvianModder diff --git a/src/main/java/ftb/lib/api/client/model/OBJModel.java b/src/main/java/serverutils/lib/api/client/model/OBJModel.java similarity index 97% rename from src/main/java/ftb/lib/api/client/model/OBJModel.java rename to src/main/java/serverutils/lib/api/client/model/OBJModel.java index 9ad6a81a..d4bd8d54 100644 --- a/src/main/java/ftb/lib/api/client/model/OBJModel.java +++ b/src/main/java/serverutils/lib/api/client/model/OBJModel.java @@ -1,4 +1,4 @@ -package ftb.lib.api.client.model; +package serverutils.lib.api.client.model; import java.io.BufferedReader; import java.io.InputStream; @@ -13,8 +13,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.api.client.GlStateManager; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.client.GlStateManager; /** * Made by LatvianModder @@ -41,7 +41,7 @@ protected OBJModel() { public static OBJModel load(ResourceLocation rl) { try { - return OBJModel.load(OBJModel.class.getResourceAsStream(FTBLib.getPath(rl))); + return OBJModel.load(OBJModel.class.getResourceAsStream(ServerUtilitiesLib.getPath(rl))); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/ftb/lib/api/cmd/CommandLM.java b/src/main/java/serverutils/lib/api/cmd/CommandLM.java similarity index 82% rename from src/main/java/ftb/lib/api/cmd/CommandLM.java rename to src/main/java/serverutils/lib/api/cmd/CommandLM.java index 4cb0241a..159c2a7f 100644 --- a/src/main/java/ftb/lib/api/cmd/CommandLM.java +++ b/src/main/java/serverutils/lib/api/cmd/CommandLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import java.util.ArrayList; import java.util.Arrays; @@ -9,11 +9,10 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.FTBLib; import latmod.lib.LMListUtils; +import serverutils.lib.ServerUtilitiesLib; -public abstract class CommandLM extends CommandBase // CommandFTBU CommandSubLM -{ +public abstract class CommandLM extends CommandBase { public final String commandName; public final CommandLevel level; @@ -28,9 +27,9 @@ public int getRequiredPermissionLevel() { } public boolean canCommandSenderUseCommand(ICommandSender ics) { - if (FTBLib.getEffectiveSide().isClient()) return true; - return level != CommandLevel.NONE - && (level == CommandLevel.ALL || !FTBLib.isDedicatedServer() || super.canCommandSenderUseCommand(ics)); + if (ServerUtilitiesLib.getEffectiveSide().isClient()) return true; + return level != CommandLevel.NONE && (level == CommandLevel.ALL || !ServerUtilitiesLib.isDedicatedServer() + || super.canCommandSenderUseCommand(ics)); } public final String getCommandName() { @@ -45,7 +44,7 @@ public final void processCommand(ICommandSender ics, String[] args) throws Comma if (!level.isEnabled()) throw new FeatureDisabledException(); if (args == null) args = new String[0]; IChatComponent s = onCommand(ics, args); - if (s != null) FTBLib.printChat(ics, s); + if (s != null) ServerUtilitiesLib.printChat(ics, s); onPostCommand(ics, args); } @@ -92,9 +91,10 @@ public static boolean isArg(String[] args, int i, String... s) { public String[] getTabStrings(ICommandSender ics, String args[], int i) throws CommandException { Boolean b = getUsername(args, i); if (b == null) return new String[0]; - if (FTBLib.ftbu != null) return FTBLib.ftbu.getPlayerNames(b); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + return ServerUtilitiesLib.serverUtilitiesIntegration.getPlayerNames(b); ArrayList l = new ArrayList<>(); - for (EntityPlayerMP ep : FTBLib.getAllOnlinePlayers(null)) l.add(ep.getGameProfile().getName()); + for (EntityPlayerMP ep : ServerUtilitiesLib.getAllOnlinePlayers(null)) l.add(ep.getGameProfile().getName()); return LMListUtils.toStringArray(l); } @@ -113,14 +113,14 @@ public static void checkArgsStrong(String[] args, int i) throws CommandException public static List findPlayers(ICommandSender ics, String arg) throws CommandException { EntityPlayerMP player = null; - if (arg.equals("@a")) return FTBLib.getAllOnlinePlayers(null); + if (arg.equals("@a")) return ServerUtilitiesLib.getAllOnlinePlayers(null); else if (arg.equals("@r")) { - List l = FTBLib.getAllOnlinePlayers(null); + List l = ServerUtilitiesLib.getAllOnlinePlayers(null); if (!l.isEmpty()) player = l.get(ics.getEntityWorld().rand.nextInt(l.size())); } else if (arg.equals("@p")) { if (ics instanceof EntityPlayerMP) return Collections.singletonList((EntityPlayerMP) ics); - List l = FTBLib.getAllOnlinePlayers(null); + List l = ServerUtilitiesLib.getAllOnlinePlayers(null); if (l.size() < 2) return l; EntityPlayerMP closest = null; diff --git a/src/main/java/ftb/lib/api/cmd/CommandLevel.java b/src/main/java/serverutils/lib/api/cmd/CommandLevel.java similarity index 84% rename from src/main/java/ftb/lib/api/cmd/CommandLevel.java rename to src/main/java/serverutils/lib/api/cmd/CommandLevel.java index 02ddc5be..c012351f 100644 --- a/src/main/java/ftb/lib/api/cmd/CommandLevel.java +++ b/src/main/java/serverutils/lib/api/cmd/CommandLevel.java @@ -1,10 +1,10 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; -import ftb.lib.FTBLib; +import serverutils.lib.ServerUtilitiesLib; public enum CommandLevel { @@ -41,7 +41,7 @@ public boolean hasLevel(ICommandSender s) { else if (this == ALL) return true; else { if (s instanceof MinecraftServer) return true; - else if (s instanceof EntityPlayerMP) return FTBLib.isOP(((EntityPlayerMP) s).getGameProfile()); + else if (s instanceof EntityPlayerMP) return ServerUtilitiesLib.isOP(((EntityPlayerMP) s).getGameProfile()); else return true; } } diff --git a/src/main/java/ftb/lib/api/cmd/CommandSubLM.java b/src/main/java/serverutils/lib/api/cmd/CommandSubLM.java similarity index 98% rename from src/main/java/ftb/lib/api/cmd/CommandSubLM.java rename to src/main/java/serverutils/lib/api/cmd/CommandSubLM.java index 8c6e6d10..de15eead 100644 --- a/src/main/java/ftb/lib/api/cmd/CommandSubLM.java +++ b/src/main/java/serverutils/lib/api/cmd/CommandSubLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import java.util.Arrays; import java.util.HashMap; diff --git a/src/main/java/ftb/lib/api/cmd/FeatureDisabledException.java b/src/main/java/serverutils/lib/api/cmd/FeatureDisabledException.java similarity index 57% rename from src/main/java/ftb/lib/api/cmd/FeatureDisabledException.java rename to src/main/java/serverutils/lib/api/cmd/FeatureDisabledException.java index a337918d..933d4cc1 100644 --- a/src/main/java/ftb/lib/api/cmd/FeatureDisabledException.java +++ b/src/main/java/serverutils/lib/api/cmd/FeatureDisabledException.java @@ -1,14 +1,14 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import net.minecraft.command.CommandException; -import ftb.lib.api.FTBLibLang; +import serverutils.lib.api.ServerUtilitiesLibLang; public class FeatureDisabledException extends CommandException { private static final long serialVersionUID = 1L; public FeatureDisabledException() { - super(FTBLibLang.feature_disabled.getID(), new Object[0]); + super(ServerUtilitiesLibLang.feature_disabled.getID(), new Object[0]); } } diff --git a/src/main/java/ftb/lib/api/cmd/ICustomCommandInfo.java b/src/main/java/serverutils/lib/api/cmd/ICustomCommandInfo.java similarity index 89% rename from src/main/java/ftb/lib/api/cmd/ICustomCommandInfo.java rename to src/main/java/serverutils/lib/api/cmd/ICustomCommandInfo.java index 4d65ff51..076e7b64 100644 --- a/src/main/java/ftb/lib/api/cmd/ICustomCommandInfo.java +++ b/src/main/java/serverutils/lib/api/cmd/ICustomCommandInfo.java @@ -1,4 +1,4 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import java.util.List; diff --git a/src/main/java/ftb/lib/api/cmd/InvalidSubCommandException.java b/src/main/java/serverutils/lib/api/cmd/InvalidSubCommandException.java similarity index 65% rename from src/main/java/ftb/lib/api/cmd/InvalidSubCommandException.java rename to src/main/java/serverutils/lib/api/cmd/InvalidSubCommandException.java index 58c0f6aa..eb2aadb9 100644 --- a/src/main/java/ftb/lib/api/cmd/InvalidSubCommandException.java +++ b/src/main/java/serverutils/lib/api/cmd/InvalidSubCommandException.java @@ -1,8 +1,8 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import net.minecraft.command.CommandException; -import ftb.lib.api.FTBLibLang; +import serverutils.lib.api.ServerUtilitiesLibLang; /** * Created by LatvianModder on 23.02.2016. @@ -12,6 +12,6 @@ public class InvalidSubCommandException extends CommandException { private static final long serialVersionUID = 1L; public InvalidSubCommandException(String s) { - super(FTBLibLang.invalid_subcmd.getID(), s); + super(ServerUtilitiesLibLang.invalid_subcmd.getID(), s); } } diff --git a/src/main/java/ftb/lib/api/cmd/MissingArgsException.java b/src/main/java/serverutils/lib/api/cmd/MissingArgsException.java similarity index 56% rename from src/main/java/ftb/lib/api/cmd/MissingArgsException.java rename to src/main/java/serverutils/lib/api/cmd/MissingArgsException.java index 094a5caf..d86a1ba3 100644 --- a/src/main/java/ftb/lib/api/cmd/MissingArgsException.java +++ b/src/main/java/serverutils/lib/api/cmd/MissingArgsException.java @@ -1,14 +1,14 @@ -package ftb.lib.api.cmd; +package serverutils.lib.api.cmd; import net.minecraft.command.CommandException; -import ftb.lib.api.FTBLibLang; +import serverutils.lib.api.ServerUtilitiesLibLang; public class MissingArgsException extends CommandException { private static final long serialVersionUID = 1L; public MissingArgsException() { - super(FTBLibLang.missing_args.getID(), new Object[0]); + super(ServerUtilitiesLibLang.missing_args.getID(), new Object[0]); } } diff --git a/src/main/java/ftb/lib/api/config/ClientConfigRegistry.java b/src/main/java/serverutils/lib/api/config/ClientConfigRegistry.java similarity index 86% rename from src/main/java/ftb/lib/api/config/ClientConfigRegistry.java rename to src/main/java/serverutils/lib/api/config/ClientConfigRegistry.java index 4a01092a..65cbf75e 100644 --- a/src/main/java/ftb/lib/api/config/ClientConfigRegistry.java +++ b/src/main/java/serverutils/lib/api/config/ClientConfigRegistry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.io.File; @@ -6,7 +6,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; +import serverutils.lib.ServerUtilitiesLib; @SideOnly(Side.CLIENT) public final class ClientConfigRegistry { @@ -26,7 +26,7 @@ public String getEntryTitle(ConfigEntry e) { public ConfigGroup getConfigGroup() { if (file.getFile() == null) { - file.setFile(new File(FTBLib.folderLocal, "client/config.json")); + file.setFile(new File(ServerUtilitiesLib.folderLocal, "client/config.json")); file.load(); } diff --git a/src/main/java/ftb/lib/api/config/ConfigEntry.java b/src/main/java/serverutils/lib/api/config/ConfigEntry.java similarity index 98% rename from src/main/java/ftb/lib/api/config/ConfigEntry.java rename to src/main/java/serverutils/lib/api/config/ConfigEntry.java index 13d5c370..481de48c 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntry.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.Collections; import java.util.List; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryBool.java b/src/main/java/serverutils/lib/api/config/ConfigEntryBool.java similarity index 95% rename from src/main/java/ftb/lib/api/config/ConfigEntryBool.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryBool.java index 27f608a0..6d17d08d 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryBool.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryBool.java @@ -1,11 +1,11 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import net.minecraft.nbt.NBTTagCompound; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import ftb.lib.api.IClickable; +import serverutils.lib.api.IClickable; public class ConfigEntryBool extends ConfigEntry implements IClickable { diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryColor.java b/src/main/java/serverutils/lib/api/config/ConfigEntryColor.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryColor.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryColor.java index de8bb5ea..da397e05 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryColor.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryColor.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryCustom.java b/src/main/java/serverutils/lib/api/config/ConfigEntryCustom.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryCustom.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryCustom.java index d2f7d5fb..d45c7e41 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryCustom.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryCustom.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.ArrayList; import java.util.List; @@ -9,8 +9,8 @@ import com.google.gson.JsonElement; import com.google.gson.JsonNull; -import ftb.lib.api.IClickable; import latmod.lib.IntList; +import serverutils.lib.api.IClickable; public class ConfigEntryCustom extends ConfigEntry implements IClickable { diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryDouble.java b/src/main/java/serverutils/lib/api/config/ConfigEntryDouble.java similarity index 98% rename from src/main/java/ftb/lib/api/config/ConfigEntryDouble.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryDouble.java index 0180f244..2a20a99a 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryDouble.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryDouble.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryEnum.java b/src/main/java/serverutils/lib/api/config/ConfigEntryEnum.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryEnum.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryEnum.java index 5ee32aec..458defa2 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryEnum.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryEnum.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.LinkedHashMap; @@ -7,7 +7,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import ftb.lib.api.IClickable; +import serverutils.lib.api.IClickable; public class ConfigEntryEnum> extends ConfigEntry implements IClickable // EnumTypeAdapterFactory { diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryEnumExtended.java b/src/main/java/serverutils/lib/api/config/ConfigEntryEnumExtended.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryEnumExtended.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryEnumExtended.java index fcae4748..8e9e20a6 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryEnumExtended.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryEnumExtended.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import ftb.lib.api.IClickable; +import serverutils.lib.api.IClickable; public final class ConfigEntryEnumExtended extends ConfigEntry implements IClickable { diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryInt.java b/src/main/java/serverutils/lib/api/config/ConfigEntryInt.java similarity index 98% rename from src/main/java/ftb/lib/api/config/ConfigEntryInt.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryInt.java index 1799d53a..704a5f44 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryInt.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryInt.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryIntList.java b/src/main/java/serverutils/lib/api/config/ConfigEntryIntList.java similarity index 98% rename from src/main/java/ftb/lib/api/config/ConfigEntryIntList.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryIntList.java index 7dfcae7d..b9a7bdac 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryIntList.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryIntList.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryString.java b/src/main/java/serverutils/lib/api/config/ConfigEntryString.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryString.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryString.java index 6348b6f3..02f3f7e0 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryString.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryString.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryStringList.java b/src/main/java/serverutils/lib/api/config/ConfigEntryStringList.java similarity index 98% rename from src/main/java/ftb/lib/api/config/ConfigEntryStringList.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryStringList.java index a85f0ce3..e7d21c8f 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryStringList.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryStringList.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ftb/lib/api/config/ConfigEntryType.java b/src/main/java/serverutils/lib/api/config/ConfigEntryType.java similarity index 97% rename from src/main/java/ftb/lib/api/config/ConfigEntryType.java rename to src/main/java/serverutils/lib/api/config/ConfigEntryType.java index e23f4f1d..63cb7e17 100644 --- a/src/main/java/ftb/lib/api/config/ConfigEntryType.java +++ b/src/main/java/serverutils/lib/api/config/ConfigEntryType.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import latmod.lib.IntList; import latmod.lib.LMColor; diff --git a/src/main/java/ftb/lib/api/config/ConfigFile.java b/src/main/java/serverutils/lib/api/config/ConfigFile.java similarity index 96% rename from src/main/java/ftb/lib/api/config/ConfigFile.java rename to src/main/java/serverutils/lib/api/config/ConfigFile.java index 32890143..f62ce43d 100644 --- a/src/main/java/ftb/lib/api/config/ConfigFile.java +++ b/src/main/java/serverutils/lib/api/config/ConfigFile.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.io.File; diff --git a/src/main/java/ftb/lib/api/config/ConfigGroup.java b/src/main/java/serverutils/lib/api/config/ConfigGroup.java similarity index 99% rename from src/main/java/ftb/lib/api/config/ConfigGroup.java rename to src/main/java/serverutils/lib/api/config/ConfigGroup.java index 0f62a28e..850a61f6 100644 --- a/src/main/java/ftb/lib/api/config/ConfigGroup.java +++ b/src/main/java/serverutils/lib/api/config/ConfigGroup.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.lang.reflect.Field; import java.util.ArrayList; @@ -12,11 +12,11 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import ftb.lib.LMNBTUtils; import latmod.lib.LMStringUtils; import latmod.lib.LMUtils; import latmod.lib.annotations.AnnotationHelper; import latmod.lib.annotations.Flags; +import serverutils.lib.LMNBTUtils; public class ConfigGroup extends ConfigEntry { diff --git a/src/main/java/ftb/lib/api/config/ConfigRegistry.java b/src/main/java/serverutils/lib/api/config/ConfigRegistry.java similarity index 79% rename from src/main/java/ftb/lib/api/config/ConfigRegistry.java rename to src/main/java/serverutils/lib/api/config/ConfigRegistry.java index 832c2f4e..a6a93ec3 100644 --- a/src/main/java/ftb/lib/api/config/ConfigRegistry.java +++ b/src/main/java/serverutils/lib/api/config/ConfigRegistry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; import java.io.File; import java.util.HashMap; @@ -8,11 +8,11 @@ import com.google.gson.JsonElement; -import ftb.lib.FTBLib; -import ftb.lib.LMAccessToken; -import ftb.lib.mod.net.MessageEditConfig; import latmod.lib.LMJsonUtils; import latmod.lib.LMUtils; +import serverutils.lib.LMAccessToken; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.mod.net.MessageEditConfig; public class ConfigRegistry { @@ -32,8 +32,8 @@ public static void add(ConfigFile f) { public static void reload() { for (ConfigFile f : map.values()) f.load(); - FTBLib.dev_logger.info("Loading override configs"); - JsonElement overridesE = LMJsonUtils.fromJson(new File(FTBLib.folderModpack, "overrides.json")); + ServerUtilitiesLib.dev_logger.info("Loading override configs"); + JsonElement overridesE = LMJsonUtils.fromJson(new File(ServerUtilitiesLib.folderModpack, "overrides.json")); if (overridesE.isJsonObject()) { for (Map.Entry e : overridesE.getAsJsonObject().entrySet()) { @@ -43,9 +43,9 @@ public static void reload() { int result; ConfigFile f = map.get(ol.getID()); if (f != null && (result = f.loadFromGroup(ol, false)) > 0) { - FTBLib.dev_logger.info("Config '" + e.getKey() + "' overriden: " + result); + ServerUtilitiesLib.dev_logger.info("Config '" + e.getKey() + "' overriden: " + result); f.save(); - } else FTBLib.dev_logger.info("Didnt load anything from " + e.getKey()); + } else ServerUtilitiesLib.dev_logger.info("Didnt load anything from " + e.getKey()); } } diff --git a/src/main/java/ftb/lib/api/config/IConfigProvider.java b/src/main/java/serverutils/lib/api/config/IConfigProvider.java similarity index 84% rename from src/main/java/ftb/lib/api/config/IConfigProvider.java rename to src/main/java/serverutils/lib/api/config/IConfigProvider.java index ee63e7eb..0f6f5318 100644 --- a/src/main/java/ftb/lib/api/config/IConfigProvider.java +++ b/src/main/java/serverutils/lib/api/config/IConfigProvider.java @@ -1,4 +1,4 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; // @SideOnly(Side.CLIENT) public interface IConfigProvider { diff --git a/src/main/java/ftb/lib/api/config/ServerConfigProvider.java b/src/main/java/serverutils/lib/api/config/ServerConfigProvider.java similarity index 88% rename from src/main/java/ftb/lib/api/config/ServerConfigProvider.java rename to src/main/java/serverutils/lib/api/config/ServerConfigProvider.java index dea9aaea..5cdd0c09 100644 --- a/src/main/java/ftb/lib/api/config/ServerConfigProvider.java +++ b/src/main/java/serverutils/lib/api/config/ServerConfigProvider.java @@ -1,6 +1,6 @@ -package ftb.lib.api.config; +package serverutils.lib.api.config; -import ftb.lib.mod.net.MessageEditConfigResponse; +import serverutils.lib.mod.net.MessageEditConfigResponse; public final class ServerConfigProvider implements IConfigProvider { diff --git a/src/main/java/ftb/lib/api/friends/FriendStatus.java b/src/main/java/serverutils/lib/api/friends/FriendStatus.java similarity index 96% rename from src/main/java/ftb/lib/api/friends/FriendStatus.java rename to src/main/java/serverutils/lib/api/friends/FriendStatus.java index a3314293..96d131e2 100644 --- a/src/main/java/ftb/lib/api/friends/FriendStatus.java +++ b/src/main/java/serverutils/lib/api/friends/FriendStatus.java @@ -1,4 +1,4 @@ -package ftb.lib.api.friends; +package serverutils.lib.api.friends; /** * Created by LatvianModder on 15.01.2016. diff --git a/src/main/java/ftb/lib/api/friends/ILMPlayer.java b/src/main/java/serverutils/lib/api/friends/ILMPlayer.java similarity index 92% rename from src/main/java/ftb/lib/api/friends/ILMPlayer.java rename to src/main/java/serverutils/lib/api/friends/ILMPlayer.java index 501aa409..9fea42ea 100644 --- a/src/main/java/ftb/lib/api/friends/ILMPlayer.java +++ b/src/main/java/serverutils/lib/api/friends/ILMPlayer.java @@ -1,4 +1,4 @@ -package ftb.lib.api.friends; +package serverutils.lib.api.friends; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/ftb/lib/api/friends/LMPNameComparator.java b/src/main/java/serverutils/lib/api/friends/LMPNameComparator.java similarity index 89% rename from src/main/java/ftb/lib/api/friends/LMPNameComparator.java rename to src/main/java/serverutils/lib/api/friends/LMPNameComparator.java index f9400986..f79e05fa 100644 --- a/src/main/java/ftb/lib/api/friends/LMPNameComparator.java +++ b/src/main/java/serverutils/lib/api/friends/LMPNameComparator.java @@ -1,4 +1,4 @@ -package ftb.lib.api.friends; +package serverutils.lib.api.friends; import java.util.Comparator; diff --git a/src/main/java/ftb/lib/api/friends/LMPStatusComparator.java b/src/main/java/serverutils/lib/api/friends/LMPStatusComparator.java similarity index 96% rename from src/main/java/ftb/lib/api/friends/LMPStatusComparator.java rename to src/main/java/serverutils/lib/api/friends/LMPStatusComparator.java index 8b76a850..99b47c18 100644 --- a/src/main/java/ftb/lib/api/friends/LMPStatusComparator.java +++ b/src/main/java/serverutils/lib/api/friends/LMPStatusComparator.java @@ -1,4 +1,4 @@ -package ftb.lib.api.friends; +package serverutils.lib.api.friends; import java.util.Comparator; diff --git a/src/main/java/ftb/lib/api/gui/ContainerEmpty.java b/src/main/java/serverutils/lib/api/gui/ContainerEmpty.java similarity index 96% rename from src/main/java/ftb/lib/api/gui/ContainerEmpty.java rename to src/main/java/serverutils/lib/api/gui/ContainerEmpty.java index 8b81abf0..315c5970 100644 --- a/src/main/java/ftb/lib/api/gui/ContainerEmpty.java +++ b/src/main/java/serverutils/lib/api/gui/ContainerEmpty.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; diff --git a/src/main/java/ftb/lib/api/gui/ContainerLM.java b/src/main/java/serverutils/lib/api/gui/ContainerLM.java similarity index 99% rename from src/main/java/ftb/lib/api/gui/ContainerLM.java rename to src/main/java/serverutils/lib/api/gui/ContainerLM.java index a522962e..422fc0a1 100644 --- a/src/main/java/ftb/lib/api/gui/ContainerLM.java +++ b/src/main/java/serverutils/lib/api/gui/ContainerLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.*; diff --git a/src/main/java/ftb/lib/api/gui/GuiContainerLM.java b/src/main/java/serverutils/lib/api/gui/GuiContainerLM.java similarity index 89% rename from src/main/java/ftb/lib/api/gui/GuiContainerLM.java rename to src/main/java/serverutils/lib/api/gui/GuiContainerLM.java index f6ac0fa2..dbb7621f 100644 --- a/src/main/java/ftb/lib/api/gui/GuiContainerLM.java +++ b/src/main/java/serverutils/lib/api/gui/GuiContainerLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.ArrayList; import java.util.List; @@ -10,9 +10,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.widgets.PanelLM; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.widgets.PanelLM; /** * Created by LatvianModder on 30.01.2016. @@ -34,9 +34,12 @@ public GuiContainerLM(ContainerLM c, ResourceLocation tex) { texture = tex; container = c; - mc = FTBLibClient.mc; + mc = ServerUtilitiesLibraryClient.mc; - ScaledResolution scr = new ScaledResolution(mc, FTBLibClient.mc.displayWidth, FTBLibClient.mc.displayHeight); + ScaledResolution scr = new ScaledResolution( + mc, + ServerUtilitiesLibraryClient.mc.displayWidth, + ServerUtilitiesLibraryClient.mc.displayHeight); mainPanel = new PanelLM(this, 0, 0, scr.getScaledWidth(), scr.getScaledHeight()) { @@ -99,7 +102,7 @@ public FontRenderer getFontRenderer() { } public final void close(GuiScreen g) { - FTBLibClient.openGui(g); + ServerUtilitiesLibraryClient.openGui(g); } protected final void drawGuiContainerBackgroundLayer(float f, int mx, int my) {} @@ -137,7 +140,7 @@ public void drawBackground() { GlStateManager.color(1F, 1F, 1F, 1F); if (texture != null) { - FTBLibClient.setTexture(texture); + ServerUtilitiesLibraryClient.setTexture(texture); drawTexturedModalRectD(mainPanel.posX, mainPanel.posY, 0D, 0D, mainPanel.width, mainPanel.height); } } diff --git a/src/main/java/ftb/lib/api/gui/GuiIcons.java b/src/main/java/serverutils/lib/api/gui/GuiIcons.java similarity index 96% rename from src/main/java/ftb/lib/api/gui/GuiIcons.java rename to src/main/java/serverutils/lib/api/gui/GuiIcons.java index f7265184..ac2218af 100644 --- a/src/main/java/ftb/lib/api/gui/GuiIcons.java +++ b/src/main/java/serverutils/lib/api/gui/GuiIcons.java @@ -1,11 +1,11 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.HashMap; import java.util.Map; import net.minecraft.util.ResourceLocation; -import ftb.lib.TextureCoords; +import serverutils.lib.TextureCoords; public class GuiIcons { @@ -13,7 +13,7 @@ public class GuiIcons { private static final TextureCoords getIcon(String s) { TextureCoords t = new TextureCoords( - new ResourceLocation("ftbl", "textures/icons/" + s + ".png"), + new ResourceLocation("serverlib", "textures/icons/" + s + ".png"), 0, 0, 16, diff --git a/src/main/java/ftb/lib/api/gui/GuiLM.java b/src/main/java/serverutils/lib/api/gui/GuiLM.java similarity index 88% rename from src/main/java/ftb/lib/api/gui/GuiLM.java rename to src/main/java/serverutils/lib/api/gui/GuiLM.java index 8e324c5c..329dd926 100644 --- a/src/main/java/ftb/lib/api/gui/GuiLM.java +++ b/src/main/java/serverutils/lib/api/gui/GuiLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.ArrayList; import java.util.List; @@ -14,10 +14,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.widgets.PanelLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.widgets.PanelLM; @SideOnly(Side.CLIENT) public abstract class GuiLM extends GuiScreen implements IGuiLM { @@ -37,11 +37,14 @@ public abstract class GuiLM extends GuiScreen implements IGuiLM { public GuiLM(GuiScreen parent, ResourceLocation tex) { parentScreen = parent; texture = tex; - mc = FTBLibClient.mc; + mc = ServerUtilitiesLibraryClient.mc; if (parent != null) mc.thePlayer.closeScreen(); - ScaledResolution scr = new ScaledResolution(mc, FTBLibClient.mc.displayWidth, FTBLibClient.mc.displayHeight); + ScaledResolution scr = new ScaledResolution( + mc, + ServerUtilitiesLibraryClient.mc.displayWidth, + ServerUtilitiesLibraryClient.mc.displayHeight); mainPanel = new PanelLM(this, 0, 0, scr.getScaledWidth(), scr.getScaledHeight()) { @@ -88,7 +91,7 @@ public FontRenderer getFontRenderer() { } public final void close(GuiScreen g) { - FTBLibClient.openGui((g == null) ? parentScreen : g); + ServerUtilitiesLibraryClient.openGui((g == null) ? parentScreen : g); } public final void initGui() { @@ -130,7 +133,7 @@ public void drawBackground() { GlStateManager.color(1F, 1F, 1F, 1F); if (texture != null) { - FTBLibClient.setTexture(texture); + ServerUtilitiesLibraryClient.setTexture(texture); drawTexturedModalRect(mainPanel.posX, mainPanel.posY, 0, 0, mainPanel.width, mainPanel.height); } } @@ -220,7 +223,7 @@ public void playSoundFX(ResourceLocation s, float pitch) { } public static void drawPlayerHead(String username, double x, double y, double w, double h, double z) { - FTBLibClient.setTexture(FTBLibClient.getSkinTexture(username)); + ServerUtilitiesLibraryClient.setTexture(ServerUtilitiesLibraryClient.getSkinTexture(username)); drawTexturedRectD(x, y, z, w, h, 0.125D, 0.25D, 0.25D, 0.5D); drawTexturedRectD(x, y, z, w, h, 0.625D, 0.25D, 0.75D, 0.5D); } @@ -235,17 +238,17 @@ public static void drawBlankRect(double x, double y, double z, double w, double public static void drawItem(IGuiLM gui, ItemStack is, int x, int y) { if (is == null) return; - FTBLibClient.setTexture(TextureMap.locationItemsTexture); + ServerUtilitiesLibraryClient.setTexture(TextureMap.locationItemsTexture); gui.setZLevel(200F); itemRender.zLevel = 200F; - FTBLibClient.renderGuiItem(is, itemRender, gui.getFontRenderer(), x, y); + ServerUtilitiesLibraryClient.renderGuiItem(is, itemRender, gui.getFontRenderer(), x, y); gui.setZLevel(0F); itemRender.zLevel = 0F; } public static void render(TextureCoords tc, double x, double y, double z, double w, double h) { if (tc == null || !tc.isValid()) return; - FTBLibClient.setTexture(tc.texture); + ServerUtilitiesLibraryClient.setTexture(tc.texture); GuiLM.drawTexturedRectD(x, y, z, w, h, tc.minU, tc.minV, tc.maxU, tc.maxV); } diff --git a/src/main/java/ftb/lib/api/gui/GuiScreenRegistry.java b/src/main/java/serverutils/lib/api/gui/GuiScreenRegistry.java similarity index 96% rename from src/main/java/ftb/lib/api/gui/GuiScreenRegistry.java rename to src/main/java/serverutils/lib/api/gui/GuiScreenRegistry.java index 191f1bf4..41f8e648 100644 --- a/src/main/java/ftb/lib/api/gui/GuiScreenRegistry.java +++ b/src/main/java/serverutils/lib/api/gui/GuiScreenRegistry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.HashMap; diff --git a/src/main/java/ftb/lib/api/gui/IClientActionGui.java b/src/main/java/serverutils/lib/api/gui/IClientActionGui.java similarity index 74% rename from src/main/java/ftb/lib/api/gui/IClientActionGui.java rename to src/main/java/serverutils/lib/api/gui/IClientActionGui.java index a506710e..6f528321 100644 --- a/src/main/java/ftb/lib/api/gui/IClientActionGui.java +++ b/src/main/java/serverutils/lib/api/gui/IClientActionGui.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; // @SideOnly(Side.CLIENT) public interface IClientActionGui { diff --git a/src/main/java/ftb/lib/api/gui/IGuiLM.java b/src/main/java/serverutils/lib/api/gui/IGuiLM.java similarity index 85% rename from src/main/java/ftb/lib/api/gui/IGuiLM.java rename to src/main/java/serverutils/lib/api/gui/IGuiLM.java index 3d0fe4d3..79a5d06e 100644 --- a/src/main/java/ftb/lib/api/gui/IGuiLM.java +++ b/src/main/java/serverutils/lib/api/gui/IGuiLM.java @@ -1,10 +1,10 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import net.minecraft.client.gui.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.gui.widgets.PanelLM; +import serverutils.lib.api.gui.widgets.PanelLM; /** * Created by LatvianModder on 18.01.2016. diff --git a/src/main/java/ftb/lib/api/gui/LMGuiHandler.java b/src/main/java/serverutils/lib/api/gui/LMGuiHandler.java similarity index 75% rename from src/main/java/ftb/lib/api/gui/LMGuiHandler.java rename to src/main/java/serverutils/lib/api/gui/LMGuiHandler.java index 1db84b39..5700086c 100644 --- a/src/main/java/ftb/lib/api/gui/LMGuiHandler.java +++ b/src/main/java/serverutils/lib/api/gui/LMGuiHandler.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.*; @@ -8,9 +8,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.mod.FTBLibMod; -import ftb.lib.mod.net.MessageOpenGui; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.lib.mod.net.MessageOpenGui; public abstract class LMGuiHandler { @@ -38,7 +38,7 @@ else if (ep instanceof EntityPlayerMP) { epM.openContainer.windowId = epM.currentWindowId; epM.openContainer.addCraftingToCrafters(epM); new MessageOpenGui(ID, id, data, epM.currentWindowId).sendTo(epM); - } else if (!FTBLib.getEffectiveSide().isServer()) - FTBLibMod.proxy.openClientGui((ep == null) ? FTBLibMod.proxy.getClientPlayer() : ep, ID, id, data); + } else if (!ServerUtilitiesLib.getEffectiveSide().isServer()) ServerUtilitiesLibraryMod.proxy + .openClientGui((ep == null) ? ServerUtilitiesLibraryMod.proxy.getClientPlayer() : ep, ID, id, data); } } diff --git a/src/main/java/ftb/lib/api/gui/LMGuiHandlerRegistry.java b/src/main/java/serverutils/lib/api/gui/LMGuiHandlerRegistry.java similarity index 91% rename from src/main/java/ftb/lib/api/gui/LMGuiHandlerRegistry.java rename to src/main/java/serverutils/lib/api/gui/LMGuiHandlerRegistry.java index 7f26ea7c..8ed88ab2 100644 --- a/src/main/java/ftb/lib/api/gui/LMGuiHandlerRegistry.java +++ b/src/main/java/serverutils/lib/api/gui/LMGuiHandlerRegistry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.HashMap; diff --git a/src/main/java/ftb/lib/api/gui/LMGuis.java b/src/main/java/serverutils/lib/api/gui/LMGuis.java similarity index 61% rename from src/main/java/ftb/lib/api/gui/LMGuis.java rename to src/main/java/serverutils/lib/api/gui/LMGuis.java index fb60f9b5..23080530 100644 --- a/src/main/java/ftb/lib/api/gui/LMGuis.java +++ b/src/main/java/serverutils/lib/api/gui/LMGuis.java @@ -1,21 +1,21 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.gui.callback.IColorCallback; -import ftb.lib.api.gui.callback.IFieldCallback; -import ftb.lib.mod.client.gui.GuiSelectColor; -import ftb.lib.mod.client.gui.GuiSelectField; import latmod.lib.Converter; import latmod.lib.LMColor; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.callback.IColorCallback; +import serverutils.lib.api.gui.callback.IFieldCallback; +import serverutils.lib.mod.client.gui.GuiSelectColor; +import serverutils.lib.mod.client.gui.GuiSelectField; public class LMGuis { public static void displayColorSelector(IColorCallback cb, LMColor col, Object id, boolean instant) { - FTBLibClient.openGui(new GuiSelectColor(cb, col, id, instant)); + ServerUtilitiesLibraryClient.openGui(new GuiSelectColor(cb, col, id, instant)); } public static void displayFieldSelector(Object id, FieldType typ, Object d, IFieldCallback c) { - FTBLibClient.openGui(new GuiSelectField(id, typ, String.valueOf(d), c)); + ServerUtilitiesLibraryClient.openGui(new GuiSelectField(id, typ, String.valueOf(d), c)); } public enum FieldType { diff --git a/src/main/java/ftb/lib/api/gui/MouseLM.java b/src/main/java/serverutils/lib/api/gui/MouseLM.java similarity index 96% rename from src/main/java/ftb/lib/api/gui/MouseLM.java rename to src/main/java/serverutils/lib/api/gui/MouseLM.java index bd0c6d93..d26d52c6 100644 --- a/src/main/java/ftb/lib/api/gui/MouseLM.java +++ b/src/main/java/serverutils/lib/api/gui/MouseLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import org.lwjgl.input.Mouse; diff --git a/src/main/java/ftb/lib/api/gui/PlayerActionRegistry.java b/src/main/java/serverutils/lib/api/gui/PlayerActionRegistry.java similarity index 87% rename from src/main/java/ftb/lib/api/gui/PlayerActionRegistry.java rename to src/main/java/serverutils/lib/api/gui/PlayerActionRegistry.java index 1a08c16e..022b9692 100644 --- a/src/main/java/ftb/lib/api/gui/PlayerActionRegistry.java +++ b/src/main/java/serverutils/lib/api/gui/PlayerActionRegistry.java @@ -1,14 +1,14 @@ -package ftb.lib.api.gui; +package serverutils.lib.api.gui; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.config.ConfigEntryBool; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.friends.ILMPlayer; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.config.ConfigEntryBool; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.friends.ILMPlayer; /** * Created by LatvianModder on 15.01.2016. diff --git a/src/main/java/ftb/lib/api/gui/callback/ClientTickCallback.java b/src/main/java/serverutils/lib/api/gui/callback/ClientTickCallback.java similarity index 68% rename from src/main/java/ftb/lib/api/gui/callback/ClientTickCallback.java rename to src/main/java/serverutils/lib/api/gui/callback/ClientTickCallback.java index d5f0de30..1b81b885 100644 --- a/src/main/java/ftb/lib/api/gui/callback/ClientTickCallback.java +++ b/src/main/java/serverutils/lib/api/gui/callback/ClientTickCallback.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.callback; +package serverutils.lib.api.gui.callback; public abstract interface ClientTickCallback { diff --git a/src/main/java/ftb/lib/api/gui/callback/ColorSelected.java b/src/main/java/serverutils/lib/api/gui/callback/ColorSelected.java similarity index 88% rename from src/main/java/ftb/lib/api/gui/callback/ColorSelected.java rename to src/main/java/serverutils/lib/api/gui/callback/ColorSelected.java index c693f218..02ce991e 100644 --- a/src/main/java/ftb/lib/api/gui/callback/ColorSelected.java +++ b/src/main/java/serverutils/lib/api/gui/callback/ColorSelected.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.callback; +package serverutils.lib.api.gui.callback; import latmod.lib.LMColor; diff --git a/src/main/java/ftb/lib/api/gui/callback/FieldSelected.java b/src/main/java/serverutils/lib/api/gui/callback/FieldSelected.java similarity index 91% rename from src/main/java/ftb/lib/api/gui/callback/FieldSelected.java rename to src/main/java/serverutils/lib/api/gui/callback/FieldSelected.java index e1f1eaf0..eb4d8702 100644 --- a/src/main/java/ftb/lib/api/gui/callback/FieldSelected.java +++ b/src/main/java/serverutils/lib/api/gui/callback/FieldSelected.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.callback; +package serverutils.lib.api.gui.callback; public class FieldSelected { diff --git a/src/main/java/ftb/lib/api/gui/callback/IColorCallback.java b/src/main/java/serverutils/lib/api/gui/callback/IColorCallback.java similarity index 65% rename from src/main/java/ftb/lib/api/gui/callback/IColorCallback.java rename to src/main/java/serverutils/lib/api/gui/callback/IColorCallback.java index e144f48a..c00b0401 100644 --- a/src/main/java/ftb/lib/api/gui/callback/IColorCallback.java +++ b/src/main/java/serverutils/lib/api/gui/callback/IColorCallback.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.callback; +package serverutils.lib.api.gui.callback; public interface IColorCallback { diff --git a/src/main/java/ftb/lib/api/gui/callback/IFieldCallback.java b/src/main/java/serverutils/lib/api/gui/callback/IFieldCallback.java similarity index 65% rename from src/main/java/ftb/lib/api/gui/callback/IFieldCallback.java rename to src/main/java/serverutils/lib/api/gui/callback/IFieldCallback.java index 3ca8e73c..5ec4ef22 100644 --- a/src/main/java/ftb/lib/api/gui/callback/IFieldCallback.java +++ b/src/main/java/serverutils/lib/api/gui/callback/IFieldCallback.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.callback; +package serverutils.lib.api.gui.callback; public interface IFieldCallback { diff --git a/src/main/java/ftb/lib/api/gui/widgets/ButtonLM.java b/src/main/java/serverutils/lib/api/gui/widgets/ButtonLM.java similarity index 89% rename from src/main/java/ftb/lib/api/gui/widgets/ButtonLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/ButtonLM.java index 6f3c80a4..5a331927 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/ButtonLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/ButtonLM.java @@ -1,10 +1,10 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.gui.IGuiLM; import latmod.lib.LMUtils; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public abstract class ButtonLM extends WidgetLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/ButtonPopupMenu.java b/src/main/java/serverutils/lib/api/gui/widgets/ButtonPopupMenu.java similarity index 92% rename from src/main/java/ftb/lib/api/gui/widgets/ButtonPopupMenu.java rename to src/main/java/serverutils/lib/api/gui/widgets/ButtonPopupMenu.java index 85a1f995..b50c1ed1 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/ButtonPopupMenu.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/ButtonPopupMenu.java @@ -1,12 +1,12 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; @SideOnly(Side.CLIENT) public class ButtonPopupMenu extends ButtonLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/ButtonSimpleLM.java b/src/main/java/serverutils/lib/api/gui/widgets/ButtonSimpleLM.java similarity index 74% rename from src/main/java/ftb/lib/api/gui/widgets/ButtonSimpleLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/ButtonSimpleLM.java index d90b31fb..b6f5189a 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/ButtonSimpleLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/ButtonSimpleLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.List; @@ -6,10 +6,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.IGuiLM; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public abstract class ButtonSimpleLM extends ButtonLM { @@ -27,7 +27,7 @@ public void addMouseOverText(List l) {} public void renderWidget() { int ax = getAX(); int ay = getAY(); - FTBLibClient.setGLColor(mouseOver(ax, ay) ? colorButtonOver : colorButton); + ServerUtilitiesLibraryClient.setGLColor(mouseOver(ax, ay) ? colorButtonOver : colorButton); GuiLM.drawBlankRect(ax, ay, gui.getZLevel(), width, height); GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawCenteredString( diff --git a/src/main/java/ftb/lib/api/gui/widgets/ItemButtonLM.java b/src/main/java/serverutils/lib/api/gui/widgets/ItemButtonLM.java similarity index 82% rename from src/main/java/ftb/lib/api/gui/widgets/ItemButtonLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/ItemButtonLM.java index 4d28bf99..a5811bf2 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/ItemButtonLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/ItemButtonLM.java @@ -1,12 +1,12 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.IGuiLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public abstract class ItemButtonLM extends ButtonLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/PanelLM.java b/src/main/java/serverutils/lib/api/gui/widgets/PanelLM.java similarity index 95% rename from src/main/java/ftb/lib/api/gui/widgets/PanelLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/PanelLM.java index 08035c7d..9160b6a3 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/PanelLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/PanelLM.java @@ -1,11 +1,11 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.ArrayList; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.gui.IGuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public abstract class PanelLM extends WidgetLM // GuiLM diff --git a/src/main/java/ftb/lib/api/gui/widgets/PanelPopupMenu.java b/src/main/java/serverutils/lib/api/gui/widgets/PanelPopupMenu.java similarity index 94% rename from src/main/java/ftb/lib/api/gui/widgets/PanelPopupMenu.java rename to src/main/java/serverutils/lib/api/gui/widgets/PanelPopupMenu.java index d9925c5e..43fcce4f 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/PanelPopupMenu.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/PanelPopupMenu.java @@ -1,10 +1,10 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.ArrayList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.GuiLM; @SideOnly(Side.CLIENT) public abstract class PanelPopupMenu extends PanelLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/SliderLM.java b/src/main/java/serverutils/lib/api/gui/widgets/SliderLM.java similarity index 93% rename from src/main/java/ftb/lib/api/gui/widgets/SliderLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/SliderLM.java index fa884732..2fbcbdeb 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/SliderLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/SliderLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.List; @@ -6,10 +6,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.IGuiLM; import latmod.lib.MathHelperLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public class SliderLM extends WidgetLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/TextBoxLM.java b/src/main/java/serverutils/lib/api/gui/widgets/TextBoxLM.java similarity index 97% rename from src/main/java/ftb/lib/api/gui/widgets/TextBoxLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/TextBoxLM.java index e6cf9e1b..9bf6fe93 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/TextBoxLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/TextBoxLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; @@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.gui.IGuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public class TextBoxLM extends WidgetLM { diff --git a/src/main/java/ftb/lib/api/gui/widgets/WidgetLM.java b/src/main/java/serverutils/lib/api/gui/widgets/WidgetLM.java similarity index 90% rename from src/main/java/ftb/lib/api/gui/widgets/WidgetLM.java rename to src/main/java/serverutils/lib/api/gui/widgets/WidgetLM.java index f304135f..299f90cf 100644 --- a/src/main/java/ftb/lib/api/gui/widgets/WidgetLM.java +++ b/src/main/java/serverutils/lib/api/gui/widgets/WidgetLM.java @@ -1,12 +1,12 @@ -package ftb.lib.api.gui.widgets; +package serverutils.lib.api.gui.widgets; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.IGuiLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.IGuiLM; @SideOnly(Side.CLIENT) public class WidgetLM { diff --git a/src/main/java/ftb/lib/api/item/BasicInventory.java b/src/main/java/serverutils/lib/api/item/BasicInventory.java similarity index 97% rename from src/main/java/ftb/lib/api/item/BasicInventory.java rename to src/main/java/serverutils/lib/api/item/BasicInventory.java index 4bad0c5b..e42f03a1 100644 --- a/src/main/java/ftb/lib/api/item/BasicInventory.java +++ b/src/main/java/serverutils/lib/api/item/BasicInventory.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; diff --git a/src/main/java/ftb/lib/api/item/IClientActionItem.java b/src/main/java/serverutils/lib/api/item/IClientActionItem.java similarity index 88% rename from src/main/java/ftb/lib/api/item/IClientActionItem.java rename to src/main/java/serverutils/lib/api/item/IClientActionItem.java index 81361cd5..04fef7f2 100644 --- a/src/main/java/ftb/lib/api/item/IClientActionItem.java +++ b/src/main/java/serverutils/lib/api/item/IClientActionItem.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/src/main/java/ftb/lib/api/item/IItemLM.java b/src/main/java/serverutils/lib/api/item/IItemLM.java similarity index 82% rename from src/main/java/ftb/lib/api/item/IItemLM.java rename to src/main/java/serverutils/lib/api/item/IItemLM.java index 066c2101..7d44f207 100644 --- a/src/main/java/ftb/lib/api/item/IItemLM.java +++ b/src/main/java/serverutils/lib/api/item/IItemLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import net.minecraft.item.Item; diff --git a/src/main/java/ftb/lib/api/item/ItemDisplay.java b/src/main/java/serverutils/lib/api/item/ItemDisplay.java similarity index 95% rename from src/main/java/ftb/lib/api/item/ItemDisplay.java rename to src/main/java/serverutils/lib/api/item/ItemDisplay.java index caa5577e..f52be7fb 100644 --- a/src/main/java/ftb/lib/api/item/ItemDisplay.java +++ b/src/main/java/serverutils/lib/api/item/ItemDisplay.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.ArrayList; import java.util.List; @@ -9,7 +9,7 @@ import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.Constants; -import ftb.lib.LMNBTUtils; +import serverutils.lib.LMNBTUtils; public class ItemDisplay { diff --git a/src/main/java/ftb/lib/api/item/ItemLM.java b/src/main/java/serverutils/lib/api/item/ItemLM.java similarity index 95% rename from src/main/java/ftb/lib/api/item/ItemLM.java rename to src/main/java/serverutils/lib/api/item/ItemLM.java index de04fd41..0fd9ce30 100644 --- a/src/main/java/ftb/lib/api/item/ItemLM.java +++ b/src/main/java/serverutils/lib/api/item/ItemLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.List; @@ -9,7 +9,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.LMMod; +import serverutils.lib.LMMod; public abstract class ItemLM extends Item implements IItemLM { diff --git a/src/main/java/ftb/lib/api/item/ItemMaterialsLM.java b/src/main/java/serverutils/lib/api/item/ItemMaterialsLM.java similarity index 98% rename from src/main/java/ftb/lib/api/item/ItemMaterialsLM.java rename to src/main/java/serverutils/lib/api/item/ItemMaterialsLM.java index fe20408d..ee8e32c5 100644 --- a/src/main/java/ftb/lib/api/item/ItemMaterialsLM.java +++ b/src/main/java/serverutils/lib/api/item/ItemMaterialsLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/ftb/lib/api/item/ItemStackSerializer.java b/src/main/java/serverutils/lib/api/item/ItemStackSerializer.java similarity index 98% rename from src/main/java/ftb/lib/api/item/ItemStackSerializer.java rename to src/main/java/serverutils/lib/api/item/ItemStackSerializer.java index d93fce8e..c2f779bb 100644 --- a/src/main/java/ftb/lib/api/item/ItemStackSerializer.java +++ b/src/main/java/serverutils/lib/api/item/ItemStackSerializer.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import net.minecraft.item.ItemStack; diff --git a/src/main/java/ftb/lib/api/item/LMInvUtils.java b/src/main/java/serverutils/lib/api/item/LMInvUtils.java similarity index 99% rename from src/main/java/ftb/lib/api/item/LMInvUtils.java rename to src/main/java/serverutils/lib/api/item/LMInvUtils.java index 0c6dfa9d..793d006a 100644 --- a/src/main/java/ftb/lib/api/item/LMInvUtils.java +++ b/src/main/java/serverutils/lib/api/item/LMInvUtils.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.Arrays; import java.util.HashMap; diff --git a/src/main/java/ftb/lib/api/item/MaterialItem.java b/src/main/java/serverutils/lib/api/item/MaterialItem.java similarity index 97% rename from src/main/java/ftb/lib/api/item/MaterialItem.java rename to src/main/java/serverutils/lib/api/item/MaterialItem.java index 001071ee..a51dee10 100644 --- a/src/main/java/ftb/lib/api/item/MaterialItem.java +++ b/src/main/java/serverutils/lib/api/item/MaterialItem.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.List; diff --git a/src/main/java/ftb/lib/api/item/ODItems.java b/src/main/java/serverutils/lib/api/item/ODItems.java similarity index 99% rename from src/main/java/ftb/lib/api/item/ODItems.java rename to src/main/java/serverutils/lib/api/item/ODItems.java index ee0b7f3c..f6a199c1 100644 --- a/src/main/java/ftb/lib/api/item/ODItems.java +++ b/src/main/java/serverutils/lib/api/item/ODItems.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ftb/lib/api/item/SlotLM.java b/src/main/java/serverutils/lib/api/item/SlotLM.java similarity index 93% rename from src/main/java/ftb/lib/api/item/SlotLM.java rename to src/main/java/serverutils/lib/api/item/SlotLM.java index d9c7ed1f..695105ab 100644 --- a/src/main/java/ftb/lib/api/item/SlotLM.java +++ b/src/main/java/serverutils/lib/api/item/SlotLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.*; diff --git a/src/main/java/ftb/lib/api/item/StringIDInvLoader.java b/src/main/java/serverutils/lib/api/item/StringIDInvLoader.java similarity index 99% rename from src/main/java/ftb/lib/api/item/StringIDInvLoader.java rename to src/main/java/serverutils/lib/api/item/StringIDInvLoader.java index 084baf69..1b8f6413 100644 --- a/src/main/java/ftb/lib/api/item/StringIDInvLoader.java +++ b/src/main/java/serverutils/lib/api/item/StringIDInvLoader.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; import java.util.AbstractMap; import java.util.Arrays; diff --git a/src/main/java/ftb/lib/api/item/Tool.java b/src/main/java/serverutils/lib/api/item/Tool.java similarity index 93% rename from src/main/java/ftb/lib/api/item/Tool.java rename to src/main/java/serverutils/lib/api/item/Tool.java index a76c1562..7ba09ecb 100644 --- a/src/main/java/ftb/lib/api/item/Tool.java +++ b/src/main/java/serverutils/lib/api/item/Tool.java @@ -1,4 +1,4 @@ -package ftb.lib.api.item; +package serverutils.lib.api.item; public class Tool { diff --git a/src/main/java/ftb/lib/api/net/LMNetworkWrapper.java b/src/main/java/serverutils/lib/api/net/LMNetworkWrapper.java similarity index 99% rename from src/main/java/ftb/lib/api/net/LMNetworkWrapper.java rename to src/main/java/serverutils/lib/api/net/LMNetworkWrapper.java index ad27d814..a2b101cf 100644 --- a/src/main/java/ftb/lib/api/net/LMNetworkWrapper.java +++ b/src/main/java/serverutils/lib/api/net/LMNetworkWrapper.java @@ -1,4 +1,4 @@ -package ftb.lib.api.net; +package serverutils.lib.api.net; import java.util.EnumMap; diff --git a/src/main/java/ftb/lib/api/net/MessageLM.java b/src/main/java/serverutils/lib/api/net/MessageLM.java similarity index 86% rename from src/main/java/ftb/lib/api/net/MessageLM.java rename to src/main/java/serverutils/lib/api/net/MessageLM.java index 743515f0..28513010 100644 --- a/src/main/java/ftb/lib/api/net/MessageLM.java +++ b/src/main/java/serverutils/lib/api/net/MessageLM.java @@ -1,13 +1,13 @@ -package ftb.lib.api.net; +package serverutils.lib.api.net; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.LMNBTUtils; import io.netty.buffer.ByteBuf; import latmod.lib.ByteCount; import latmod.lib.ByteIOStream; +import serverutils.lib.LMNBTUtils; public abstract class MessageLM implements IMessage, IMessageHandler { @@ -69,13 +69,15 @@ public final IMessage onMessage(MessageLM m, MessageContext ctx) { } public final void sendTo(EntityPlayerMP ep) { - // if(FTBLibFinals.DEV) FTBLib.logger.info("[S] Message sent: " + getClass().getName()); + // if(ServerUtilitiesLibraryFinals.DEV) ServerUtilitiesLibrary.logger.info("[S] Message sent: " + + // getClass().getName()); if (ep != null) getWrapper().sendTo(this, ep); else getWrapper().sendToAll(this); } public final void sendToServer() { - // if(FTBLibFinals.DEV) FTBLib.logger.info("[C] Message sent: " + getClass().getName()); + // if(ServerUtilitiesLibraryFinals.DEV) ServerUtilitiesLibrary.logger.info("[C] Message sent: " + + // getClass().getName()); getWrapper().sendToServer(this); } } diff --git a/src/main/java/ftb/lib/api/notification/ClickAction.java b/src/main/java/serverutils/lib/api/notification/ClickAction.java similarity index 97% rename from src/main/java/ftb/lib/api/notification/ClickAction.java rename to src/main/java/serverutils/lib/api/notification/ClickAction.java index 0141f8be..3048a7c5 100644 --- a/src/main/java/ftb/lib/api/notification/ClickAction.java +++ b/src/main/java/serverutils/lib/api/notification/ClickAction.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import net.minecraft.event.ClickEvent; import net.minecraft.util.IJsonSerializable; diff --git a/src/main/java/ftb/lib/api/notification/ClickActionRegistry.java b/src/main/java/serverutils/lib/api/notification/ClickActionRegistry.java similarity index 94% rename from src/main/java/ftb/lib/api/notification/ClickActionRegistry.java rename to src/main/java/serverutils/lib/api/notification/ClickActionRegistry.java index 820df19e..9fefb3b2 100644 --- a/src/main/java/ftb/lib/api/notification/ClickActionRegistry.java +++ b/src/main/java/serverutils/lib/api/notification/ClickActionRegistry.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import java.util.HashMap; diff --git a/src/main/java/ftb/lib/api/notification/ClickActionType.java b/src/main/java/serverutils/lib/api/notification/ClickActionType.java similarity index 72% rename from src/main/java/ftb/lib/api/notification/ClickActionType.java rename to src/main/java/serverutils/lib/api/notification/ClickActionType.java index 42cf0a3c..779ff22f 100644 --- a/src/main/java/ftb/lib/api/notification/ClickActionType.java +++ b/src/main/java/serverutils/lib/api/notification/ClickActionType.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import java.io.File; import java.net.URI; @@ -9,11 +9,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.gui.GuiScreenRegistry; -import ftb.lib.mod.FTBLibMod; import latmod.lib.LMUtils; import latmod.lib.util.FinalIDObject; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiScreenRegistry; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public abstract class ClickActionType extends FinalIDObject { @@ -25,7 +25,7 @@ public ClickActionType(String s) { public abstract void onClicked(JsonElement data); public String getDisplayName() { - return FTBLibMod.proxy.translate("click_action." + getID()); + return ServerUtilitiesLibraryMod.proxy.translate("click_action." + getID()); } // Static // @@ -34,7 +34,7 @@ public String getDisplayName() { @SideOnly(Side.CLIENT) public void onClicked(JsonElement data) { - FTBLibClient.execClientCommand("/" + data.getAsString()); + ServerUtilitiesLibraryClient.execClientCommand("/" + data.getAsString()); } }; @@ -42,7 +42,7 @@ public void onClicked(JsonElement data) { @SideOnly(Side.CLIENT) public void onClicked(JsonElement data) { - FTBLibClient.openGui(new GuiChat(data.getAsString())); + ServerUtilitiesLibraryClient.openGui(new GuiChat(data.getAsString())); } }; @@ -74,8 +74,8 @@ public void onClicked(JsonElement data) { @SideOnly(Side.CLIENT) public void onClicked(JsonElement data) { - GuiScreen gui = GuiScreenRegistry.openGui(FTBLibClient.mc.thePlayer, data.getAsString()); - if (gui != null) FTBLibClient.openGui(gui); + GuiScreen gui = GuiScreenRegistry.openGui(ServerUtilitiesLibraryClient.mc.thePlayer, data.getAsString()); + if (gui != null) ServerUtilitiesLibraryClient.openGui(gui); } }; } diff --git a/src/main/java/ftb/lib/api/notification/ClientNotifications.java b/src/main/java/serverutils/lib/api/notification/ClientNotifications.java similarity index 82% rename from src/main/java/ftb/lib/api/notification/ClientNotifications.java rename to src/main/java/serverutils/lib/api/notification/ClientNotifications.java index 62c0d880..b9db8328 100644 --- a/src/main/java/ftb/lib/api/notification/ClientNotifications.java +++ b/src/main/java/serverutils/lib/api/notification/ClientNotifications.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import java.util.ArrayList; import java.util.List; @@ -8,11 +8,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; import latmod.lib.LMUtils; import latmod.lib.util.FinalIDObject; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiLM; @SideOnly(Side.CLIENT) public class ClientNotifications { @@ -61,8 +61,8 @@ private Temp(Notification n) { title = notification.title.getFormattedText(); desc = (notification.desc == null) ? null : notification.desc.getFormattedText(); width = 20 + Math.max( - FTBLibClient.mc.fontRenderer.getStringWidth(title), - FTBLibClient.mc.fontRenderer.getStringWidth(desc)); + ServerUtilitiesLibraryClient.mc.fontRenderer.getStringWidth(title), + ServerUtilitiesLibraryClient.mc.fontRenderer.getStringWidth(desc)); if (notification.item != null) width += 20; } @@ -91,18 +91,18 @@ public boolean render() { GlStateManager.disableDepth(); GlStateManager.pushMatrix(); GlStateManager.depthMask(false); - GlStateManager.translate(FTBLibClient.displayW - width, -d1 * 36D, 0F); + GlStateManager.translate(ServerUtilitiesLibraryClient.displayW - width, -d1 * 36D, 0F); GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); - FTBLibClient.setGLColor(notification.color, 230); - GuiLM.drawBlankRect(0D, 0D, 0D, FTBLibClient.displayW, 32D); + ServerUtilitiesLibraryClient.setGLColor(notification.color, 230); + GuiLM.drawBlankRect(0D, 0D, 0D, ServerUtilitiesLibraryClient.displayW, 32D); GlStateManager.enableTexture2D(); GlStateManager.color(1F, 1F, 1F, 1F); int w = notification.item == null ? 10 : 30; - FontRenderer font = FTBLibClient.mc.fontRenderer; + FontRenderer font = ServerUtilitiesLibraryClient.mc.fontRenderer; if (desc == null) { font.drawString(title, w, 12, 0xFFFFFFFF); @@ -112,7 +112,8 @@ public boolean render() { } if (notification.item != null) { - // FTBLibClient.renderGuiItem(notification.item, FTBLibClient.mc.getRenderItem(), font, 8, 8); + // ServerUtilitiesLibraryClient.renderGuiItem(notification.item, + // ServerUtilitiesLibraryClient.mc.getRenderItem(), font, 8, 8); } GlStateManager.depthMask(true); diff --git a/src/main/java/ftb/lib/api/notification/MouseAction.java b/src/main/java/serverutils/lib/api/notification/MouseAction.java similarity index 95% rename from src/main/java/ftb/lib/api/notification/MouseAction.java rename to src/main/java/serverutils/lib/api/notification/MouseAction.java index 0139fefc..106df22b 100644 --- a/src/main/java/ftb/lib/api/notification/MouseAction.java +++ b/src/main/java/serverutils/lib/api/notification/MouseAction.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import java.util.ArrayList; import java.util.List; @@ -9,7 +9,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import ftb.lib.JsonHelper; +import serverutils.lib.JsonHelper; public class MouseAction implements IJsonSerializable { diff --git a/src/main/java/ftb/lib/api/notification/Notification.java b/src/main/java/serverutils/lib/api/notification/Notification.java similarity index 95% rename from src/main/java/ftb/lib/api/notification/Notification.java rename to src/main/java/serverutils/lib/api/notification/Notification.java index b6689077..d2cea944 100644 --- a/src/main/java/ftb/lib/api/notification/Notification.java +++ b/src/main/java/serverutils/lib/api/notification/Notification.java @@ -1,4 +1,4 @@ -package ftb.lib.api.notification; +package serverutils.lib.api.notification; import net.minecraft.item.ItemStack; import net.minecraft.util.*; @@ -7,10 +7,10 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import ftb.lib.JsonHelper; -import ftb.lib.api.item.ItemStackSerializer; import latmod.lib.LMColorUtils; import latmod.lib.util.FinalIDObject; +import serverutils.lib.JsonHelper; +import serverutils.lib.api.item.ItemStackSerializer; public final class Notification extends FinalIDObject implements IJsonSerializable { diff --git a/src/main/java/ftb/lib/api/recipes/CustomRecipes.java b/src/main/java/serverutils/lib/api/recipes/CustomRecipes.java similarity index 95% rename from src/main/java/ftb/lib/api/recipes/CustomRecipes.java rename to src/main/java/serverutils/lib/api/recipes/CustomRecipes.java index 29bdde92..25491c51 100644 --- a/src/main/java/ftb/lib/api/recipes/CustomRecipes.java +++ b/src/main/java/serverutils/lib/api/recipes/CustomRecipes.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/ftb/lib/api/recipes/IStackArray.java b/src/main/java/serverutils/lib/api/recipes/IStackArray.java similarity index 80% rename from src/main/java/ftb/lib/api/recipes/IStackArray.java rename to src/main/java/serverutils/lib/api/recipes/IStackArray.java index ba87fad5..a8fda2d9 100644 --- a/src/main/java/ftb/lib/api/recipes/IStackArray.java +++ b/src/main/java/serverutils/lib/api/recipes/IStackArray.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import net.minecraft.item.ItemStack; diff --git a/src/main/java/ftb/lib/api/recipes/LMRecipes.java b/src/main/java/serverutils/lib/api/recipes/LMRecipes.java similarity index 98% rename from src/main/java/ftb/lib/api/recipes/LMRecipes.java rename to src/main/java/serverutils/lib/api/recipes/LMRecipes.java index 6406e783..fe49fb1f 100644 --- a/src/main/java/ftb/lib/api/recipes/LMRecipes.java +++ b/src/main/java/serverutils/lib/api/recipes/LMRecipes.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import java.util.ArrayList; diff --git a/src/main/java/ftb/lib/api/recipes/ShapedStackArray.java b/src/main/java/serverutils/lib/api/recipes/ShapedStackArray.java similarity index 94% rename from src/main/java/ftb/lib/api/recipes/ShapedStackArray.java rename to src/main/java/serverutils/lib/api/recipes/ShapedStackArray.java index de97bebb..dfb1e29a 100644 --- a/src/main/java/ftb/lib/api/recipes/ShapedStackArray.java +++ b/src/main/java/serverutils/lib/api/recipes/ShapedStackArray.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import net.minecraft.item.ItemStack; diff --git a/src/main/java/ftb/lib/api/recipes/ShapelessStackArray.java b/src/main/java/serverutils/lib/api/recipes/ShapelessStackArray.java similarity index 95% rename from src/main/java/ftb/lib/api/recipes/ShapelessStackArray.java rename to src/main/java/serverutils/lib/api/recipes/ShapelessStackArray.java index f136bb89..303f6fd2 100644 --- a/src/main/java/ftb/lib/api/recipes/ShapelessStackArray.java +++ b/src/main/java/serverutils/lib/api/recipes/ShapelessStackArray.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/ftb/lib/api/recipes/StackArray.java b/src/main/java/serverutils/lib/api/recipes/StackArray.java similarity index 96% rename from src/main/java/ftb/lib/api/recipes/StackArray.java rename to src/main/java/serverutils/lib/api/recipes/StackArray.java index 85cb981f..62c2c0e7 100644 --- a/src/main/java/ftb/lib/api/recipes/StackArray.java +++ b/src/main/java/serverutils/lib/api/recipes/StackArray.java @@ -1,4 +1,4 @@ -package ftb.lib.api.recipes; +package serverutils.lib.api.recipes; import java.util.ArrayList; import java.util.Arrays; @@ -10,9 +10,9 @@ import net.minecraft.item.*; import net.minecraftforge.fluids.*; -import ftb.lib.api.item.LMInvUtils; -import ftb.lib.api.item.MaterialItem; -import ftb.lib.api.item.ODItems; +import serverutils.lib.api.item.LMInvUtils; +import serverutils.lib.api.item.MaterialItem; +import serverutils.lib.api.item.ODItems; public class StackArray implements IStackArray { diff --git a/src/main/java/ftb/lib/api/tile/IClientActionTile.java b/src/main/java/serverutils/lib/api/tile/IClientActionTile.java similarity index 86% rename from src/main/java/ftb/lib/api/tile/IClientActionTile.java rename to src/main/java/serverutils/lib/api/tile/IClientActionTile.java index 6f46b9cb..05b6d76e 100644 --- a/src/main/java/ftb/lib/api/tile/IClientActionTile.java +++ b/src/main/java/serverutils/lib/api/tile/IClientActionTile.java @@ -1,4 +1,4 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/ftb/lib/api/tile/IGuiTile.java b/src/main/java/serverutils/lib/api/tile/IGuiTile.java similarity index 92% rename from src/main/java/ftb/lib/api/tile/IGuiTile.java rename to src/main/java/serverutils/lib/api/tile/IGuiTile.java index 8a011d8e..11619bd9 100644 --- a/src/main/java/ftb/lib/api/tile/IGuiTile.java +++ b/src/main/java/serverutils/lib/api/tile/IGuiTile.java @@ -1,4 +1,4 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/ftb/lib/api/tile/ISecureTile.java b/src/main/java/serverutils/lib/api/tile/ISecureTile.java similarity index 86% rename from src/main/java/ftb/lib/api/tile/ISecureTile.java rename to src/main/java/serverutils/lib/api/tile/ISecureTile.java index 9cb84e13..8a46954b 100644 --- a/src/main/java/ftb/lib/api/tile/ISecureTile.java +++ b/src/main/java/serverutils/lib/api/tile/ISecureTile.java @@ -1,4 +1,4 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/ftb/lib/api/tile/IWailaTile.java b/src/main/java/serverutils/lib/api/tile/IWailaTile.java similarity index 87% rename from src/main/java/ftb/lib/api/tile/IWailaTile.java rename to src/main/java/serverutils/lib/api/tile/IWailaTile.java index 6451e8a8..6f538331 100644 --- a/src/main/java/ftb/lib/api/tile/IWailaTile.java +++ b/src/main/java/serverutils/lib/api/tile/IWailaTile.java @@ -1,10 +1,10 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import java.util.List; import net.minecraft.item.ItemStack; -import ftb.lib.api.waila.WailaDataAccessor; +import serverutils.lib.api.waila.WailaDataAccessor; public interface IWailaTile { diff --git a/src/main/java/ftb/lib/api/tile/InvMode.java b/src/main/java/serverutils/lib/api/tile/InvMode.java similarity index 84% rename from src/main/java/ftb/lib/api/tile/InvMode.java rename to src/main/java/serverutils/lib/api/tile/InvMode.java index 2bf9be1a..723d7420 100644 --- a/src/main/java/ftb/lib/api/tile/InvMode.java +++ b/src/main/java/serverutils/lib/api/tile/InvMode.java @@ -1,6 +1,6 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; -import ftb.lib.api.LangKey; +import serverutils.lib.api.LangKey; public enum InvMode { @@ -10,7 +10,7 @@ public enum InvMode { DISABLED("disabled"); public static final InvMode[] VALUES = values(); - public static final String enumLangKey = "ftbl.invmode"; + public static final String enumLangKey = "serverlib.invmode"; public final int ID; public final LangKey lang; diff --git a/src/main/java/ftb/lib/api/tile/RedstoneMode.java b/src/main/java/serverutils/lib/api/tile/RedstoneMode.java similarity index 84% rename from src/main/java/ftb/lib/api/tile/RedstoneMode.java rename to src/main/java/serverutils/lib/api/tile/RedstoneMode.java index bba9ab57..521666e1 100644 --- a/src/main/java/ftb/lib/api/tile/RedstoneMode.java +++ b/src/main/java/serverutils/lib/api/tile/RedstoneMode.java @@ -1,6 +1,6 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; -import ftb.lib.api.LangKey; +import serverutils.lib.api.LangKey; public enum RedstoneMode { @@ -9,7 +9,7 @@ public enum RedstoneMode { ACTIVE_LOW("low"); public static final RedstoneMode[] VALUES = values(); - public static final String enumLangKey = "ftbl.redstonemode"; + public static final String enumLangKey = "serverlib.redstonemode"; public final int ID; public final LangKey lang; diff --git a/src/main/java/ftb/lib/api/tile/Tank.java b/src/main/java/serverutils/lib/api/tile/Tank.java similarity index 98% rename from src/main/java/ftb/lib/api/tile/Tank.java rename to src/main/java/serverutils/lib/api/tile/Tank.java index f85feedf..117d0b84 100644 --- a/src/main/java/ftb/lib/api/tile/Tank.java +++ b/src/main/java/serverutils/lib/api/tile/Tank.java @@ -1,4 +1,4 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/ftb/lib/api/tile/TileInvLM.java b/src/main/java/serverutils/lib/api/tile/TileInvLM.java similarity index 96% rename from src/main/java/ftb/lib/api/tile/TileInvLM.java rename to src/main/java/serverutils/lib/api/tile/TileInvLM.java index 145f5740..bffee112 100644 --- a/src/main/java/ftb/lib/api/tile/TileInvLM.java +++ b/src/main/java/serverutils/lib/api/tile/TileInvLM.java @@ -1,12 +1,12 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import ftb.lib.api.item.LMInvUtils; import latmod.lib.MathHelperLM; +import serverutils.lib.api.item.LMInvUtils; public class TileInvLM extends TileLM implements IInventory { diff --git a/src/main/java/ftb/lib/api/tile/TileLM.java b/src/main/java/serverutils/lib/api/tile/TileLM.java similarity index 95% rename from src/main/java/ftb/lib/api/tile/TileLM.java rename to src/main/java/serverutils/lib/api/tile/TileLM.java index c8d064ec..e9508c1e 100644 --- a/src/main/java/ftb/lib/api/tile/TileLM.java +++ b/src/main/java/serverutils/lib/api/tile/TileLM.java @@ -1,4 +1,4 @@ -package ftb.lib.api.tile; +package serverutils.lib.api.tile; import net.minecraft.block.Block; import net.minecraft.entity.player.*; @@ -9,11 +9,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; -import ftb.lib.FTBLib; -import ftb.lib.LMSecurity; -import ftb.lib.api.block.BlockLM; -import ftb.lib.mod.net.MessageClientTileAction; import latmod.lib.LMUtils; +import serverutils.lib.LMSecurity; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.block.BlockLM; +import serverutils.lib.mod.net.MessageClientTileAction; public class TileLM extends TileEntity implements IClientActionTile { @@ -196,7 +196,7 @@ public void onClientAction(EntityPlayerMP ep, String action, NBTTagCompound data if (action.equals(ACTION_BUTTON_PRESSED)) { handleButton(data.getString("ID"), data.getByte("MB"), data.getCompoundTag("D"), ep); markDirty(); - } else if (action.equals(ACTION_OPEN_GUI)) FTBLib.openGui(ep, (IGuiTile) this, data); + } else if (action.equals(ACTION_OPEN_GUI)) ServerUtilitiesLib.openGui(ep, (IGuiTile) this, data); else if (action.equals(ACTION_CUSTOM_NAME)) { setName(data.getString("Name")); markDirty(); diff --git a/src/main/java/ftb/lib/api/waila/BasicWailaHandler.java b/src/main/java/serverutils/lib/api/waila/BasicWailaHandler.java similarity index 95% rename from src/main/java/ftb/lib/api/waila/BasicWailaHandler.java rename to src/main/java/serverutils/lib/api/waila/BasicWailaHandler.java index 494506f4..d93d5ba4 100644 --- a/src/main/java/ftb/lib/api/waila/BasicWailaHandler.java +++ b/src/main/java/serverutils/lib/api/waila/BasicWailaHandler.java @@ -1,4 +1,4 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; import java.util.List; diff --git a/src/main/java/ftb/lib/api/waila/EventRegisterWaila.java b/src/main/java/serverutils/lib/api/waila/EventRegisterWaila.java similarity index 92% rename from src/main/java/ftb/lib/api/waila/EventRegisterWaila.java rename to src/main/java/serverutils/lib/api/waila/EventRegisterWaila.java index c6676075..54c05310 100644 --- a/src/main/java/ftb/lib/api/waila/EventRegisterWaila.java +++ b/src/main/java/serverutils/lib/api/waila/EventRegisterWaila.java @@ -1,12 +1,12 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; import java.util.ArrayList; import cpw.mods.fml.common.Optional; -import ftb.lib.OtherMods; -import ftb.lib.api.EventLM; -import ftb.lib.api.tile.IWailaTile; import mcp.mobius.waila.api.IWailaRegistrar; +import serverutils.lib.OtherMods; +import serverutils.lib.api.EventLM; +import serverutils.lib.api.tile.IWailaTile; public class EventRegisterWaila extends EventLM { diff --git a/src/main/java/ftb/lib/api/waila/WailaDataAccessor.java b/src/main/java/serverutils/lib/api/waila/WailaDataAccessor.java similarity index 92% rename from src/main/java/ftb/lib/api/waila/WailaDataAccessor.java rename to src/main/java/serverutils/lib/api/waila/WailaDataAccessor.java index dd8b9de2..8e2cb931 100644 --- a/src/main/java/ftb/lib/api/waila/WailaDataAccessor.java +++ b/src/main/java/serverutils/lib/api/waila/WailaDataAccessor.java @@ -1,4 +1,4 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/ftb/lib/api/waila/WailaDataProvider.java b/src/main/java/serverutils/lib/api/waila/WailaDataProvider.java similarity index 98% rename from src/main/java/ftb/lib/api/waila/WailaDataProvider.java rename to src/main/java/serverutils/lib/api/waila/WailaDataProvider.java index 17145984..7cf7fe16 100644 --- a/src/main/java/ftb/lib/api/waila/WailaDataProvider.java +++ b/src/main/java/serverutils/lib/api/waila/WailaDataProvider.java @@ -1,4 +1,4 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; import java.util.List; diff --git a/src/main/java/ftb/lib/api/waila/WailaLMTile.java b/src/main/java/serverutils/lib/api/waila/WailaLMTile.java similarity index 94% rename from src/main/java/ftb/lib/api/waila/WailaLMTile.java rename to src/main/java/serverutils/lib/api/waila/WailaLMTile.java index 6cf3f8f2..e1b5d213 100644 --- a/src/main/java/ftb/lib/api/waila/WailaLMTile.java +++ b/src/main/java/serverutils/lib/api/waila/WailaLMTile.java @@ -1,10 +1,10 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; import java.util.List; import net.minecraft.item.ItemStack; -import ftb.lib.api.tile.IWailaTile; +import serverutils.lib.api.tile.IWailaTile; public class WailaLMTile extends BasicWailaHandler { diff --git a/src/main/java/ftb/lib/api/waila/WailaType.java b/src/main/java/serverutils/lib/api/waila/WailaType.java similarity index 78% rename from src/main/java/ftb/lib/api/waila/WailaType.java rename to src/main/java/serverutils/lib/api/waila/WailaType.java index 1700bc2a..1ea864a0 100644 --- a/src/main/java/ftb/lib/api/waila/WailaType.java +++ b/src/main/java/serverutils/lib/api/waila/WailaType.java @@ -1,6 +1,6 @@ -package ftb.lib.api.waila; +package serverutils.lib.api.waila; -import ftb.lib.api.tile.IWailaTile; +import serverutils.lib.api.tile.IWailaTile; public enum WailaType { diff --git a/src/main/java/ftb/lib/mod/FTBUIntegration.java b/src/main/java/serverutils/lib/mod/ServerUtilitiesIntegration.java similarity index 54% rename from src/main/java/ftb/lib/mod/FTBUIntegration.java rename to src/main/java/serverutils/lib/mod/ServerUtilitiesIntegration.java index d5072d7f..7572dca0 100644 --- a/src/main/java/ftb/lib/mod/FTBUIntegration.java +++ b/src/main/java/serverutils/lib/mod/ServerUtilitiesIntegration.java @@ -1,26 +1,25 @@ -package ftb.lib.mod; +package serverutils.lib.mod; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.*; -import ftb.lib.api.EventFTBReload; -import ftb.lib.api.EventFTBWorldClient; -import ftb.lib.api.EventFTBWorldServer; -import ftb.lib.api.friends.ILMPlayer; import latmod.lib.ByteIOStream; import latmod.lib.util.Phase; +import serverutils.lib.api.EventServerUtilitiesReload; +import serverutils.lib.api.EventServerUtilitiesWorldClient; +import serverutils.lib.api.EventServerUtilitiesWorldServer; +import serverutils.lib.api.friends.ILMPlayer; -public interface FTBUIntegration // FTBLIntegration -{ +public interface ServerUtilitiesIntegration { - void onReloaded(EventFTBReload e); + void onReloaded(EventServerUtilitiesReload e); - void onFTBWorldServer(EventFTBWorldServer e); + void onServerUtilitiesWorldServer(EventServerUtilitiesWorldServer e); - void onFTBWorldClient(EventFTBWorldClient e); + void onServerUtilitiesWorldClient(EventServerUtilitiesWorldClient e); - void onFTBWorldServerClosed(); + void onServerUtilitiesWorldServerClosed(); void onServerTick(World w); diff --git a/src/main/java/ftb/lib/mod/FTBLibEventHandler.java b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibEventHandler.java similarity index 57% rename from src/main/java/ftb/lib/mod/FTBLibEventHandler.java rename to src/main/java/serverutils/lib/mod/ServerUtilitiesLibEventHandler.java index 2639d305..703f70f3 100644 --- a/src/main/java/ftb/lib/mod/FTBLibEventHandler.java +++ b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibEventHandler.java @@ -1,4 +1,4 @@ -package ftb.lib.mod; +package serverutils.lib.mod; import java.util.ArrayList; import java.util.List; @@ -11,14 +11,14 @@ import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.api.ServerTickCallback; -import ftb.lib.mod.net.MessageReload; -import ftb.lib.mod.net.MessageSendWorldID; import latmod.lib.util.Phase; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.ServerTickCallback; +import serverutils.lib.mod.net.MessageReload; +import serverutils.lib.mod.net.MessageSendWorldID; -public class FTBLibEventHandler { +public class ServerUtilitiesLibEventHandler { public static final List callbacks = new ArrayList<>(); public static final List pendingCallbacks = new ArrayList<>(); @@ -26,7 +26,7 @@ public class FTBLibEventHandler { @SubscribeEvent public void onWorldLoaded(WorldEvent.Load e) { if (e.world.provider.dimensionId == 0 && !e.world.isRemote) { - FTBLib.reload(FTBLib.getServer(), false, false); + ServerUtilitiesLib.reload(ServerUtilitiesLib.getServer(), false, false); } } @@ -34,15 +34,17 @@ public void onWorldLoaded(WorldEvent.Load e) { public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent e) { if (e.player instanceof EntityPlayerMP) { /* - * //FIXME: This is a workaround if(!loaded) { FTBLib.reload(FTBLib.getServer(), false, false); loaded = - * true; } + * //FIXME: This is a workaround if(!loaded) { + * ServerUtilitiesLibrary.reload(ServerUtilitiesLibrary.getServer(), false, false); loaded = true; } */ final EntityPlayerMP ep = (EntityPlayerMP) e.player; - if (FTBLib.ftbu != null) FTBLib.ftbu.onPlayerJoined(ep, Phase.PRE); - new MessageSendWorldID(FTBWorld.server, ep).sendTo(ep); - if (FTBLib.ftbu != null) FTBLib.ftbu.onPlayerJoined(ep, Phase.POST); - new MessageReload(FTBWorld.server, 1).sendTo(ep); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onPlayerJoined(ep, Phase.PRE); + new MessageSendWorldID(ServerUtilsWorld.server, ep).sendTo(ep); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onPlayerJoined(ep, Phase.POST); + new MessageReload(ServerUtilsWorld.server, 1).sendTo(ep); } } @@ -63,12 +65,14 @@ public void onWorldTick(TickEvent.WorldTickEvent e) { } } - if (FTBLib.ftbu != null) FTBLib.ftbu.onServerTick(e.world); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onServerTick(e.world); } } @SubscribeEvent public void onRightClick(PlayerInteractEvent e) { - if (FTBLib.ftbu != null) FTBLib.ftbu.onRightClick(e); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onRightClick(e); } } diff --git a/src/main/java/serverutils/lib/mod/ServerUtilitiesLibFinals.java b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibFinals.java new file mode 100644 index 00000000..a71e27b0 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibFinals.java @@ -0,0 +1,11 @@ +package serverutils.lib.mod; + +import serverutils.utils.mod.ServerUtilitiesFinals; + +public class ServerUtilitiesLibFinals { + + public static final String MOD_ID = "ServerUtilitiesLibrary"; + public static final String MOD_NAME = "ServerUtilitiesLibrary"; + public static final String MOD_VERSION = ServerUtilitiesFinals.MOD_VERSION; + public static final String MOD_DEP = "required-after:Forge@[10.13.4.1558,);after:Baubles;after:NotEnoughItems;after:Waila;after:MineTweaker3"; +} diff --git a/src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryMod.java b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryMod.java new file mode 100644 index 00000000..f984f025 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryMod.java @@ -0,0 +1,141 @@ +package serverutils.lib.mod; + +import java.io.File; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.*; +import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.relauncher.Side; +import latmod.lib.util.OS; +import serverutils.lib.EventBusHelper; +import serverutils.lib.JsonHelper; +import serverutils.lib.LMAccessToken; +import serverutils.lib.LMMod; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.EventServerUtilitiesWorldServer; +import serverutils.lib.api.GameModes; +import serverutils.lib.api.config.ConfigRegistry; +import serverutils.lib.api.item.ODItems; +import serverutils.lib.mod.cmd.CmdEditConfig; +import serverutils.lib.mod.cmd.CmdHelpOverride; +import serverutils.lib.mod.cmd.CmdListOverride; +import serverutils.lib.mod.cmd.CmdMode; +import serverutils.lib.mod.cmd.CmdNotify; +import serverutils.lib.mod.cmd.CmdReload; +import serverutils.lib.mod.cmd.CmdSetItemName; +import serverutils.lib.mod.cmd.CmdTrashCan; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmd; +import serverutils.lib.mod.config.ServerUtilitiesLibraryConfig; +import serverutils.lib.mod.net.ServerUtilitiesLibraryLibNetHandler; + +@Mod( + modid = ServerUtilitiesLibFinals.MOD_ID, + name = ServerUtilitiesLibFinals.MOD_NAME, + version = ServerUtilitiesLibFinals.MOD_VERSION, + dependencies = ServerUtilitiesLibFinals.MOD_DEP, + acceptedMinecraftVersions = "1.7.10") +public class ServerUtilitiesLibraryMod { + + @Mod.Instance(ServerUtilitiesLibFinals.MOD_ID) + public static ServerUtilitiesLibraryMod inst; + + @SidedProxy( + serverSide = "serverutils.lib.mod.ServerUtilitiesLibraryModCommon", + clientSide = "serverutils.lib.mod.client.ServerUtilitiesLibraryModClient") + public static ServerUtilitiesLibraryModCommon proxy; + + public static final Logger logger = LogManager.getLogger("ServerUtilsLibrary"); + + public static LMMod mod; + + @Mod.EventHandler + public void onPreInit(FMLPreInitializationEvent e) { + if (ServerUtilitiesLib.DEV_ENV) logger.info("Loading ServerUtilitiesLibrary, DevEnv"); + else logger.info("Loading ServerUtilitiesLibrary, v" + ServerUtilitiesLibFinals.MOD_VERSION); + + logger.info("OS: " + OS.current + ", 64bit: " + OS.is64); + + mod = LMMod.create(ServerUtilitiesLibFinals.MOD_ID); + + ServerUtilitiesLib.init(e.getModConfigurationDirectory()); + JsonHelper.init(); + ServerUtilitiesLibraryLibNetHandler.init(); + ODItems.preInit(); + + ServerUtilitiesLibraryConfig.load(); + EventBusHelper.register(new ServerUtilitiesLibEventHandler()); + proxy.preInit(); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent e) { + FMLInterModComms + .sendMessage("Waila", "register", "serverutils.lib.api.waila.EventRegisterWaila.registerHandlers"); + } + + @Mod.EventHandler + public void onPostInit(FMLPostInitializationEvent e) { + ODItems.postInit(); + proxy.postInit(); + GameModes.reload(); + ConfigRegistry.reload(); + } + + @Mod.EventHandler + public void onServerStarting(FMLServerStartingEvent e) { + if (ServerUtilitiesLibConfigCmd.override_list.getAsBoolean()) + ServerUtilitiesLib.addCommand(e, new CmdListOverride()); + if (ServerUtilitiesLibConfigCmd.override_help.getAsBoolean()) + ServerUtilitiesLib.addCommand(e, new CmdHelpOverride()); + ServerUtilitiesLib.addCommand(e, new CmdEditConfig()); + ServerUtilitiesLib.addCommand(e, new CmdMode()); + ServerUtilitiesLib.addCommand(e, new CmdReload()); + ServerUtilitiesLib.addCommand(e, new CmdNotify()); + ServerUtilitiesLib.addCommand(e, new CmdSetItemName()); + ServerUtilitiesLib.addCommand(e, new CmdTrashCan()); + } + + @Mod.EventHandler + public void onServerAboutToStart(FMLServerAboutToStartEvent e) { + ServerUtilitiesLib.folderWorld = new File( + FMLCommonHandler.instance().getSavesDirectory(), + e.getServer().getFolderName()); + ConfigRegistry.reload(); + + GameModes.reload(); + ServerUtilsWorld.server = new ServerUtilsWorld(Side.SERVER); + EventServerUtilitiesWorldServer event = new EventServerUtilitiesWorldServer( + ServerUtilsWorld.server, + e.getServer()); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onServerUtilitiesWorldServer(event); + event.post(); + } + + @Mod.EventHandler + public void onServerStarted(FMLServerStartedEvent e) { + ServerUtilitiesLib.reload(ServerUtilitiesLib.getServer(), false, false); + } + + @Mod.EventHandler + public void onServerShutDown(FMLServerStoppedEvent e) { + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onServerUtilitiesWorldServerClosed(); + ServerUtilsWorld.server = null; + ServerUtilitiesLib.folderWorld = null; + LMAccessToken.clear(); + ConfigRegistry.clearTemp(); + // ServerUtilitiesLibraryEventHandler.loaded = false; + } + + @NetworkCheckHandler + public boolean checkNetwork(Map m, Side side) { + String s = m.get(ServerUtilitiesLibFinals.MOD_ID); + return s == null || s.equals(ServerUtilitiesLibFinals.MOD_VERSION); + } +} diff --git a/src/main/java/ftb/lib/mod/FTBLibModCommon.java b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryModCommon.java similarity index 92% rename from src/main/java/ftb/lib/mod/FTBLibModCommon.java rename to src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryModCommon.java index 4b2b9e92..2d23f25e 100644 --- a/src/main/java/ftb/lib/mod/FTBLibModCommon.java +++ b/src/main/java/serverutils/lib/mod/ServerUtilitiesLibraryModCommon.java @@ -1,4 +1,4 @@ -package ftb.lib.mod; +package serverutils.lib.mod; import java.util.UUID; @@ -7,10 +7,9 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import ftb.lib.api.tile.IGuiTile; +import serverutils.lib.api.tile.IGuiTile; -public class FTBLibModCommon // FTBLibModClient -{ +public class ServerUtilitiesLibraryModCommon { public void preInit() {} diff --git a/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryClientEventHandler.java b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryClientEventHandler.java new file mode 100644 index 00000000..2a4ed1c1 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryClientEventHandler.java @@ -0,0 +1,87 @@ +package serverutils.lib.mod.client; + +import java.util.List; + +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.client.event.*; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.network.FMLNetworkEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.EventServerUtilitiesWorldClient; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.item.LMInvUtils; +import serverutils.lib.api.item.ODItems; + +@SideOnly(Side.CLIENT) +public class ServerUtilitiesLibraryClientEventHandler { + + public static final ServerUtilitiesLibraryClientEventHandler instance = new ServerUtilitiesLibraryClientEventHandler(); + + @SubscribeEvent + public void onConnected(FMLNetworkEvent.ClientConnectedToServerEvent e) { + ServerData sd = ServerUtilitiesLibraryClient.mc.func_147104_D(); + EventServerUtilitiesWorldClient event = new EventServerUtilitiesWorldClient(null); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onServerUtilitiesWorldClient(event); + ServerUtilsWorld.client = null; + event.post(); + } + + @SubscribeEvent + public void onDisconnected(FMLNetworkEvent.ClientDisconnectionFromServerEvent e) { + EventServerUtilitiesWorldClient event = new EventServerUtilitiesWorldClient(null); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onServerUtilitiesWorldClient(event); + event.post(); + ServerUtilsWorld.client = null; + } + + @SubscribeEvent + public void onTooltip(ItemTooltipEvent e) { + if (e.itemStack == null || e.itemStack.getItem() == null) return; + + if (ServerUtilitiesLibraryModClient.item_reg_names.getAsBoolean()) { + e.toolTip.add(LMInvUtils.getRegName(e.itemStack).toString()); + } + + if (ServerUtilitiesLibraryModClient.item_ore_names.getAsBoolean()) { + List ores = ODItems.getOreNames(e.itemStack); + + if (ores != null && !ores.isEmpty()) { + e.toolTip.add("Ore Dictionary names:"); + for (String or : ores) e.toolTip.add("> " + or); + } + } + + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onTooltip(e); + } + + @SubscribeEvent + public void onDrawDebugText(RenderGameOverlayEvent.Text e) { + if (!ServerUtilitiesLibraryClient.mc.gameSettings.showDebugInfo) { + if (ServerUtilitiesLib.DEV_ENV) { + e.left.add( + "[MC " + EnumChatFormatting.GOLD + Loader.MC_VERSION + EnumChatFormatting.WHITE + " DevEnv]"); + } + } else { + // if(DevConsole.enabled()) e.left.add("r: " + + // MathHelperMC.get2DRotation(ServerUtilitiesLibraryClient.mc.thePlayer)); + } + } + + @SubscribeEvent + public void preTexturesLoaded(TextureStitchEvent.Pre e) { + if (e.map.getTextureType() == 0) { + ServerUtilitiesLibraryClient.blockNullIcon = e.map.registerIcon("serverlib:empty_block"); + ServerUtilitiesLibraryClient.clearCachedData(); + } + } +} diff --git a/src/main/java/ftb/lib/mod/client/FTBLibGuiHandler.java b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryGuiHandler.java similarity index 59% rename from src/main/java/ftb/lib/mod/client/FTBLibGuiHandler.java rename to src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryGuiHandler.java index f25f9684..9a48d1fa 100644 --- a/src/main/java/ftb/lib/mod/client/FTBLibGuiHandler.java +++ b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryGuiHandler.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client; +package serverutils.lib.mod.client; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; @@ -7,19 +7,20 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.gui.ContainerEmpty; -import ftb.lib.api.gui.LMGuiHandler; -import ftb.lib.api.item.ItemDisplay; -import ftb.lib.mod.client.gui.GuiDisplayItem; +import serverutils.lib.api.gui.ContainerEmpty; +import serverutils.lib.api.gui.LMGuiHandler; +import serverutils.lib.api.item.ItemDisplay; +import serverutils.lib.mod.client.gui.GuiDisplayItem; -public class FTBLibGuiHandler extends LMGuiHandler { +public class ServerUtilitiesLibraryGuiHandler extends LMGuiHandler { - public static final FTBLibGuiHandler instance = new FTBLibGuiHandler("FTBL"); + public static final ServerUtilitiesLibraryGuiHandler instance = new ServerUtilitiesLibraryGuiHandler( + "ServerUtilitiesLibrary"); public static final int DISPLAY_ITEM = 1; public static final int SECURITY = 2; - public FTBLibGuiHandler(String s) { + public ServerUtilitiesLibraryGuiHandler(String s) { super(s); } diff --git a/src/main/java/ftb/lib/mod/client/FTBLibModClient.java b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryModClient.java similarity index 67% rename from src/main/java/ftb/lib/mod/client/FTBLibModClient.java rename to src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryModClient.java index 0918befc..ed2a175d 100644 --- a/src/main/java/ftb/lib/mod/client/FTBLibModClient.java +++ b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryModClient.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client; +package serverutils.lib.mod.client; import java.util.UUID; @@ -16,25 +16,25 @@ import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.EnumScreen; -import ftb.lib.EventBusHelper; -import ftb.lib.FTBLib; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.config.ClientConfigRegistry; -import ftb.lib.api.config.ConfigEntryBool; -import ftb.lib.api.config.ConfigEntryEnum; -import ftb.lib.api.config.ConfigEntryString; -import ftb.lib.api.gui.LMGuiHandler; -import ftb.lib.api.gui.LMGuiHandlerRegistry; -import ftb.lib.api.gui.PlayerActionRegistry; -import ftb.lib.api.tile.IGuiTile; -import ftb.lib.mod.FTBLibModCommon; -import ftb.lib.mod.cmd.CmdReloadClient; import latmod.lib.LMColorUtils; import latmod.lib.LMUtils; +import serverutils.lib.EnumScreen; +import serverutils.lib.EventBusHelper; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.config.ClientConfigRegistry; +import serverutils.lib.api.config.ConfigEntryBool; +import serverutils.lib.api.config.ConfigEntryEnum; +import serverutils.lib.api.config.ConfigEntryString; +import serverutils.lib.api.gui.LMGuiHandler; +import serverutils.lib.api.gui.LMGuiHandlerRegistry; +import serverutils.lib.api.gui.PlayerActionRegistry; +import serverutils.lib.api.tile.IGuiTile; +import serverutils.lib.mod.ServerUtilitiesLibraryModCommon; +import serverutils.lib.mod.cmd.CmdReloadClient; @SideOnly(Side.CLIENT) -public class FTBLibModClient extends FTBLibModCommon { +public class ServerUtilitiesLibraryModClient extends ServerUtilitiesLibraryModCommon { public static final ConfigEntryBool item_ore_names = new ConfigEntryBool("item_ore_names", false); public static final ConfigEntryBool item_reg_names = new ConfigEntryBool("item_reg_names", false); @@ -49,20 +49,20 @@ public class FTBLibModClient extends FTBLibModCommon { "reload_client"); public void preInit() { - EventBusHelper.register(FTBLibClientEventHandler.instance); - EventBusHelper.register(FTBLibRenderHandler.instance); - LMGuiHandlerRegistry.add(FTBLibGuiHandler.instance); + EventBusHelper.register(ServerUtilitiesLibraryClientEventHandler.instance); + EventBusHelper.register(ServerUtilitiesLibraryRenderHandler.instance); + LMGuiHandlerRegistry.add(ServerUtilitiesLibraryGuiHandler.instance); // For Dev reasons, see DevConsole - FTBLib.userIsLatvianModder = FTBLibClient.mc.getSession().func_148256_e().getId() + ServerUtilitiesLib.userIsLatvianModder = ServerUtilitiesLibraryClient.mc.getSession().func_148256_e().getId() .equals(LMUtils.fromString("5afb9a5b207d480e887967bc848f9a8f")); - ClientConfigRegistry.addGroup("ftbl", FTBLibModClient.class); + ClientConfigRegistry.addGroup("serverlib", ServerUtilitiesLibraryModClient.class); ClientConfigRegistry.add(PlayerActionRegistry.configGroup); ClientCommandHandler.instance.registerCommand(new CmdReloadClient()); - FTBLibActions.init(); + ServerUtilitiessLibraryActions.init(); } public void postInit() { @@ -86,7 +86,7 @@ public boolean isTabDown() { } public boolean inGameHasFocus() { - return FTBLibClient.mc.inGameHasFocus; + return ServerUtilitiesLibraryClient.mc.inGameHasFocus; } public EntityPlayer getClientPlayer() { @@ -94,7 +94,7 @@ public EntityPlayer getClientPlayer() { } public EntityPlayer getClientPlayer(UUID id) { - return FTBLibClient.getPlayerSP(id); + return ServerUtilitiesLibraryClient.getPlayerSP(id); } public World getClientWorld() { @@ -104,7 +104,7 @@ public World getClientWorld() { public double getReachDist(EntityPlayer ep) { if (ep == null) return 0D; else if (ep instanceof EntityPlayerMP) return super.getReachDist(ep); - PlayerControllerMP c = FTBLibClient.mc.playerController; + PlayerControllerMP c = ServerUtilitiesLibraryClient.mc.playerController; return (c == null) ? 0D : c.getBlockReachDistance(); } @@ -119,7 +119,7 @@ public void spawnDust(World w, double x, double y, double z, int col) { fx.setRBGColorF(red, green, blue); fx.setAlphaF(alpha); - FTBLibClient.mc.effectRenderer.addEffect(fx); + ServerUtilitiesLibraryClient.mc.effectRenderer.addEffect(fx); } public boolean openClientGui(EntityPlayer ep, String mod, int id, NBTTagCompound data) { @@ -129,7 +129,7 @@ public boolean openClientGui(EntityPlayer ep, String mod, int id, NBTTagCompound GuiScreen g = h.getGui(ep, id, data); if (g != null) { - FTBLibClient.openGui(g); + ServerUtilitiesLibraryClient.openGui(g); return true; } } @@ -140,7 +140,7 @@ public boolean openClientGui(EntityPlayer ep, String mod, int id, NBTTagCompound public void openClientTileGui(EntityPlayer ep, IGuiTile t, NBTTagCompound data) { if (ep != null && t != null) { GuiScreen g = t.getGui(ep, data); - if (g != null) FTBLibClient.openGui(g); + if (g != null) ServerUtilitiesLibraryClient.openGui(g); } } } diff --git a/src/main/java/ftb/lib/mod/client/FTBLibRenderHandler.java b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryRenderHandler.java similarity index 51% rename from src/main/java/ftb/lib/mod/client/FTBLibRenderHandler.java rename to src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryRenderHandler.java index 2b72d149..59ffd776 100644 --- a/src/main/java/ftb/lib/mod/client/FTBLibRenderHandler.java +++ b/src/main/java/serverutils/lib/mod/client/ServerUtilitiesLibraryRenderHandler.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client; +package serverutils.lib.mod.client; import java.util.ArrayList; import java.util.List; @@ -10,17 +10,17 @@ import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.client.LMFrustrumUtils; -import ftb.lib.api.gui.callback.ClientTickCallback; -import ftb.lib.api.notification.ClientNotifications; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.LMFrustrumUtils; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.callback.ClientTickCallback; +import serverutils.lib.api.notification.ClientNotifications; @SideOnly(Side.CLIENT) -public class FTBLibRenderHandler { +public class ServerUtilitiesLibraryRenderHandler { - public static final FTBLibRenderHandler instance = new FTBLibRenderHandler(); + public static final ServerUtilitiesLibraryRenderHandler instance = new ServerUtilitiesLibraryRenderHandler(); public static final List callbacks = new ArrayList<>(); @SubscribeEvent(priority = EventPriority.LOW) @@ -30,14 +30,14 @@ public void renderTick(TickEvent.RenderTickEvent e) { if (e.phase == TickEvent.Phase.START) { ScaledResolution sr = new ScaledResolution( - FTBLibClient.mc, - FTBLibClient.mc.displayWidth, - FTBLibClient.mc.displayHeight); - FTBLibClient.displayW = sr.getScaledWidth(); - FTBLibClient.displayH = sr.getScaledHeight(); + ServerUtilitiesLibraryClient.mc, + ServerUtilitiesLibraryClient.mc.displayWidth, + ServerUtilitiesLibraryClient.mc.displayHeight); + ServerUtilitiesLibraryClient.displayW = sr.getScaledWidth(); + ServerUtilitiesLibraryClient.displayH = sr.getScaledHeight(); } - if (e.phase == TickEvent.Phase.END && FTBLibClient.isIngame()) ClientNotifications.renderTemp(); + if (e.phase == TickEvent.Phase.END && ServerUtilitiesLibraryClient.isIngame()) ClientNotifications.renderTemp(); GlStateManager.popMatrix(); GlStateManager.popAttrib(); @@ -54,6 +54,7 @@ public void clientTick(TickEvent.ClientTickEvent e) { @SubscribeEvent public void renderWorld(RenderWorldLastEvent e) { LMFrustrumUtils.update(); - if (FTBLib.ftbu != null) FTBLib.ftbu.renderWorld(e.partialTicks); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.renderWorld(e.partialTicks); } } diff --git a/src/main/java/ftb/lib/mod/client/FTBLibActions.java b/src/main/java/serverutils/lib/mod/client/ServerUtilitiessLibraryActions.java similarity index 75% rename from src/main/java/ftb/lib/mod/client/FTBLibActions.java rename to src/main/java/serverutils/lib/mod/client/ServerUtilitiessLibraryActions.java index 19c0c24c..3c52edfb 100644 --- a/src/main/java/ftb/lib/mod/client/FTBLibActions.java +++ b/src/main/java/serverutils/lib/mod/client/ServerUtilitiessLibraryActions.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client; +package serverutils.lib.mod.client; import java.util.ArrayList; import java.util.Collections; @@ -17,27 +17,27 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.EventBusHelper; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.config.ClientConfigRegistry; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.gui.GuiIcons; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.GuiScreenRegistry; -import ftb.lib.api.gui.PlayerActionRegistry; -import ftb.lib.api.notification.ClientNotifications; -import ftb.lib.mod.FTBLibMod; -import ftb.lib.mod.client.gui.GuiEditConfig; -import ftb.lib.mod.client.gui.GuiNotifications; -import ftb.lib.mod.config.FTBLibConfigCompat; +import serverutils.lib.EventBusHelper; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.config.ClientConfigRegistry; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.gui.GuiIcons; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.GuiScreenRegistry; +import serverutils.lib.api.gui.PlayerActionRegistry; +import serverutils.lib.api.notification.ClientNotifications; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.lib.mod.client.gui.GuiEditConfig; +import serverutils.lib.mod.client.gui.GuiNotifications; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCompat; @SideOnly(Side.CLIENT) -public class FTBLibActions { +public class ServerUtilitiessLibraryActions { public static void init() { - EventBusHelper.register(new FTBLibActions()); + EventBusHelper.register(new ServerUtilitiessLibraryActions()); PlayerActionRegistry.add(notifications); PlayerActionRegistry.add(settings); @@ -45,30 +45,32 @@ public static void init() { GuiScreenRegistry.register("notifications", new GuiScreenRegistry.Entry() { public GuiScreen openGui(EntityPlayer ep) { - return new GuiNotifications(FTBLibClient.mc.currentScreen); + return new GuiNotifications(ServerUtilitiesLibraryClient.mc.currentScreen); } }); GuiScreenRegistry.register("client_config", new GuiScreenRegistry.Entry() { public GuiScreen openGui(EntityPlayer ep) { - return new GuiEditConfig(FTBLibClient.mc.currentScreen, ClientConfigRegistry.provider()); + return new GuiEditConfig( + ServerUtilitiesLibraryClient.mc.currentScreen, + ClientConfigRegistry.provider()); } }); } public static final PlayerAction notifications = new PlayerAction( PlayerAction.Type.SELF, - "ftbl.notifications", + "serverlib.notifications", 1000, GuiIcons.chat) { public void onClicked(ILMPlayer self, ILMPlayer other) { - FTBLibClient.openGui(new GuiNotifications(FTBLibClient.mc.currentScreen)); + ServerUtilitiesLibraryClient.openGui(new GuiNotifications(ServerUtilitiesLibraryClient.mc.currentScreen)); } public String getDisplayName() { - return FTBLibMod.proxy.translate(FTBLibModClient.notifications.getFullID()); + return ServerUtilitiesLibraryMod.proxy.translate(ServerUtilitiesLibraryModClient.notifications.getFullID()); } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { @@ -77,33 +79,34 @@ public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { public void postRender(int ax, int ay, double z) { String n = String.valueOf(ClientNotifications.Perm.list.size()); - int nw = FTBLibClient.mc.fontRenderer.getStringWidth(n); + int nw = ServerUtilitiesLibraryClient.mc.fontRenderer.getStringWidth(n); int width = 16; GlStateManager.color(1F, 0.13F, 0.13F, 0.66F); GuiLM.drawBlankRect(ax + width - nw, ay - 4, z, nw + 1, 9); GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.mc.fontRenderer.drawString(n, ax + width - nw + 1, ay - 3, 0xFFFFFFFF); + ServerUtilitiesLibraryClient.mc.fontRenderer.drawString(n, ax + width - nw + 1, ay - 3, 0xFFFFFFFF); } }; public static final PlayerAction settings = new PlayerAction( PlayerAction.Type.SELF, - "ftbl.settings", + "serverlib.settings", -1000, GuiIcons.settings) { public void onClicked(ILMPlayer self, ILMPlayer other) { - FTBLibClient.openGui(new GuiEditConfig(FTBLibClient.mc.currentScreen, ClientConfigRegistry.provider())); + ServerUtilitiesLibraryClient.openGui( + new GuiEditConfig(ServerUtilitiesLibraryClient.mc.currentScreen, ClientConfigRegistry.provider())); } }; @SuppressWarnings("unchecked") @SubscribeEvent public void guiInitEvent(final GuiScreenEvent.InitGuiEvent.Post e) { - if (!FTBLibClient.isIngame()) return; + if (!ServerUtilitiesLibraryClient.isIngame()) return; if (e.gui instanceof InventoryEffectRenderer) { - ILMPlayer p = FTBLibClient.getClientLMPlayer(); + ILMPlayer p = ServerUtilitiesLibraryClient.getClientLMPlayer(); List buttons = PlayerActionRegistry .getPlayerActions(PlayerAction.Type.SELF, p, p, false, false); @@ -124,7 +127,7 @@ public void guiInitEvent(final GuiScreenEvent.InitGuiEvent.Post e) { buttonY = 6; } boolean hasPotions = !e.gui.mc.thePlayer.getActivePotionEffects().isEmpty() - && !FTBLibConfigCompat.compat_statusEffectHUD.getAsBoolean(); + && !ServerUtilitiesLibConfigCompat.compat_statusEffectHUD.getAsBoolean(); if (hasPotions) { buttonX -= 64; @@ -168,7 +171,7 @@ public void guiInitEvent(final GuiScreenEvent.InitGuiEvent.Post e) { public void guiActionEvent(GuiScreenEvent.ActionPerformedEvent.Post e) { if (e.button instanceof ButtonInvLM) { PlayerAction b = ((ButtonInvLM) e.button).action; - ILMPlayer p = FTBLibClient.getClientLMPlayer(); + ILMPlayer p = ServerUtilitiesLibraryClient.getClientLMPlayer(); b.onClicked(p, p); } } @@ -225,7 +228,7 @@ public void drawButton(Minecraft mc, int mx, int my) { double my1 = my - 12D; String s = b.action.getDisplayName(); - int tw = FTBLibClient.mc.fontRenderer.getStringWidth(s); + int tw = ServerUtilitiesLibraryClient.mc.fontRenderer.getStringWidth(s); mx1 -= tw + 8; my1 += 4; @@ -240,7 +243,7 @@ public void drawButton(Minecraft mc, int mx, int my) { GlStateManager.color(0.13F, 0.13F, 0.13F, 1F); GuiLM.drawBlankRect(-3, -2, zLevel, tw + 6, 12); GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.mc.fontRenderer.drawString(s, 0, 0, 0xFFFFFFFF); + ServerUtilitiesLibraryClient.mc.fontRenderer.drawString(s, 0, 0, 0xFFFFFFFF); GlStateManager.popMatrix(); } } diff --git a/src/main/java/ftb/lib/mod/client/gui/ButtonNotification.java b/src/main/java/serverutils/lib/mod/client/gui/ButtonNotification.java similarity index 78% rename from src/main/java/ftb/lib/mod/client/gui/ButtonNotification.java rename to src/main/java/serverutils/lib/mod/client/gui/ButtonNotification.java index a21aa556..e2ce5d16 100644 --- a/src/main/java/ftb/lib/mod/client/gui/ButtonNotification.java +++ b/src/main/java/serverutils/lib/mod/client/gui/ButtonNotification.java @@ -1,16 +1,16 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.List; import net.minecraft.item.ItemStack; -import ftb.lib.api.FTBLibLang; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiIcons; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.lib.api.notification.ClientNotifications; +import serverutils.lib.api.ServerUtilitiesLibLang; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiIcons; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.api.notification.ClientNotifications; public class ButtonNotification extends ButtonLM { @@ -41,7 +41,7 @@ public void renderWidget() { GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.setGLColor(notification.notification.color, mouseOver(ax, ay) ? 255 : 185); + ServerUtilitiesLibraryClient.setGLColor(notification.notification.color, mouseOver(ax, ay) ? 255 : 185); GuiLM.drawBlankRect(ax, ay, gui.getZLevel(), parentPanel.width, height); GlStateManager.color(1F, 1F, 1F, 1F); @@ -60,7 +60,7 @@ public void renderWidget() { } public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); if (gui.mouse().x < getAX() + width - 16) notification.onClicked(); ClientNotifications.Perm.remove(notification); @@ -72,7 +72,7 @@ public void onButtonPressed(int b) { public void addMouseOverText(List l) { int ax = getAX(); if (mouseOver(ax, getAY()) && gui.mouse().x >= ax + width - 16) { - l.add(FTBLibLang.button_close.format()); + l.add(ServerUtilitiesLibLang.button_close.format()); return; } diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiDisplayItem.java b/src/main/java/serverutils/lib/mod/client/gui/GuiDisplayItem.java similarity index 89% rename from src/main/java/ftb/lib/mod/client/gui/GuiDisplayItem.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiDisplayItem.java index febee898..7868b505 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiDisplayItem.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiDisplayItem.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.List; @@ -8,14 +8,14 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.item.ItemDisplay; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.item.ItemDisplay; @SideOnly(Side.CLIENT) public class GuiDisplayItem extends GuiLM { - public static final ResourceLocation texture = new ResourceLocation("ftbl", "textures/gui/displayitem.png"); + public static final ResourceLocation texture = new ResourceLocation("serverlib", "textures/gui/displayitem.png"); public ItemDisplay itemDisplay; diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiEditConfig.java b/src/main/java/serverutils/lib/mod/client/gui/GuiEditConfig.java similarity index 87% rename from src/main/java/ftb/lib/mod/client/gui/GuiEditConfig.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiEditConfig.java index 3697d29c..dde97c3c 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiEditConfig.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiEditConfig.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.ArrayList; import java.util.List; @@ -8,31 +8,31 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.IClickable; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.config.ConfigEntry; -import ftb.lib.api.config.ConfigEntryColor; -import ftb.lib.api.config.ConfigEntryDouble; -import ftb.lib.api.config.ConfigEntryInt; -import ftb.lib.api.config.ConfigEntryString; -import ftb.lib.api.config.ConfigEntryType; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.IConfigProvider; -import ftb.lib.api.gui.GuiIcons; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.IClientActionGui; -import ftb.lib.api.gui.LMGuis; -import ftb.lib.api.gui.callback.ColorSelected; -import ftb.lib.api.gui.callback.FieldSelected; -import ftb.lib.api.gui.callback.IColorCallback; -import ftb.lib.api.gui.callback.IFieldCallback; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.lib.api.gui.widgets.PanelLM; -import ftb.lib.api.gui.widgets.SliderLM; import latmod.lib.LMColorUtils; import latmod.lib.LMJsonUtils; import latmod.lib.annotations.Flags; +import serverutils.lib.api.IClickable; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.config.ConfigEntry; +import serverutils.lib.api.config.ConfigEntryColor; +import serverutils.lib.api.config.ConfigEntryDouble; +import serverutils.lib.api.config.ConfigEntryInt; +import serverutils.lib.api.config.ConfigEntryString; +import serverutils.lib.api.config.ConfigEntryType; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.IConfigProvider; +import serverutils.lib.api.gui.GuiIcons; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.IClientActionGui; +import serverutils.lib.api.gui.LMGuis; +import serverutils.lib.api.gui.callback.ColorSelected; +import serverutils.lib.api.gui.callback.FieldSelected; +import serverutils.lib.api.gui.callback.IColorCallback; +import serverutils.lib.api.gui.callback.IFieldCallback; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.api.gui.widgets.PanelLM; +import serverutils.lib.api.gui.widgets.SliderLM; @SideOnly(Side.CLIENT) public class GuiEditConfig extends GuiLM implements IClientActionGui { @@ -78,7 +78,7 @@ private void addCE(ButtonConfigEntry e) { buttonClose = new ButtonLM(this, 0, 2, 16, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); shouldClose = true; close(null); } @@ -87,7 +87,7 @@ public void onButtonPressed(int b) { buttonExpandAll = new ButtonLM(this, 2, 2, 16, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); for (ButtonConfigEntry e : configEntryButtons) expandAll(e); gui.refreshWidgets(); } @@ -103,7 +103,7 @@ private void expandAll(ButtonConfigEntry e) { buttonCollapseAll = new ButtonLM(this, 20, 2, 16, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); for (ButtonConfigEntry e : configEntryButtons) collapseAll(e); gui.refreshWidgets(); } @@ -283,7 +283,7 @@ public void renderWidget() { public void onButtonPressed(int b) { if (gui.mouse().y < 20) return; - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); if (entry.getFlag(Flags.CANT_EDIT)) return; @@ -304,7 +304,7 @@ public void onColorSelected(ColorSelected c) { gui.onChanged(); } - if (c.closeGui) FTBLibClient.openGui(gui); + if (c.closeGui) ServerUtilitiesLibraryClient.openGui(gui); } }, ((ConfigEntryColor) entry).value, 0, false); } else if (type == ConfigEntryType.INT) { @@ -320,7 +320,7 @@ public void onFieldSelected(FieldSelected c) { gui.onChanged(); } - if (c.closeGui) FTBLibClient.openGui(gui); + if (c.closeGui) ServerUtilitiesLibraryClient.openGui(gui); } }); } else if (type == ConfigEntryType.DOUBLE) { @@ -336,7 +336,7 @@ public void onFieldSelected(FieldSelected c) { gui.onChanged(); } - if (c.closeGui) FTBLibClient.openGui(gui); + if (c.closeGui) ServerUtilitiesLibraryClient.openGui(gui); } }); } else if (type == ConfigEntryType.STRING) { @@ -352,7 +352,7 @@ public void onFieldSelected(FieldSelected c) { gui.onChanged(); } - if (c.closeGui) FTBLibClient.openGui(gui); + if (c.closeGui) ServerUtilitiesLibraryClient.openGui(gui); } }); } else if (type == ConfigEntryType.CUSTOM || type == ConfigEntryType.INT_ARRAY @@ -369,7 +369,7 @@ public void onFieldSelected(FieldSelected c) { gui.onChanged(); } - if (c.closeGui) FTBLibClient.openGui(gui); + if (c.closeGui) ServerUtilitiesLibraryClient.openGui(gui); } }); } @@ -381,7 +381,7 @@ public void addMouseOverText(List l) { if (info != null && info.length > 0) { for (String s : info) { - l.addAll(FTBLibClient.mc.fontRenderer.listFormattedStringToWidth(s, 230)); + l.addAll(ServerUtilitiesLibraryClient.mc.fontRenderer.listFormattedStringToWidth(s, 230)); } } } diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiNotifications.java b/src/main/java/serverutils/lib/mod/client/gui/GuiNotifications.java similarity index 84% rename from src/main/java/ftb/lib/mod/client/gui/GuiNotifications.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiNotifications.java index f1efe27c..ab21450a 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiNotifications.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiNotifications.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.ArrayList; import java.util.Collections; @@ -8,11 +8,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.notification.ClientNotifications; -import ftb.lib.mod.client.FTBLibModClient; import latmod.lib.MathHelperLM; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.notification.ClientNotifications; +import serverutils.lib.mod.client.ServerUtilitiesLibraryModClient; @SideOnly(Side.CLIENT) public class GuiNotifications extends GuiLM { @@ -55,7 +55,7 @@ public void drawBackground() { super.drawBackground(); fontRendererObj.drawString( - I18n.format(FTBLibModClient.notifications.getFullID()), + I18n.format(ServerUtilitiesLibraryModClient.notifications.getFullID()), mainPanel.posX + 4, mainPanel.posY - 11, 0xFFFFFFFF); diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiPlayerActions.java b/src/main/java/serverutils/lib/mod/client/gui/GuiPlayerActions.java similarity index 83% rename from src/main/java/ftb/lib/mod/client/gui/GuiPlayerActions.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiPlayerActions.java index c0ee0a70..c9d68271 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiPlayerActions.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiPlayerActions.java @@ -1,16 +1,16 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.lib.api.gui.widgets.WidgetLM; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.api.gui.widgets.WidgetLM; @SideOnly(Side.CLIENT) public class GuiPlayerActions extends GuiLM { @@ -59,7 +59,7 @@ public ButtonPlayerActionSmall(GuiPlayerActions g, PlayerAction a) { } public void onButtonPressed(int b) { - FTBLibClient.mc.thePlayer.closeScreen(); + ServerUtilitiesLibraryClient.mc.thePlayer.closeScreen(); action.onClicked(gui.self, gui.other); } diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiSelectColor.java b/src/main/java/serverutils/lib/mod/client/gui/GuiSelectColor.java similarity index 90% rename from src/main/java/ftb/lib/mod/client/gui/GuiSelectColor.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiSelectColor.java index 83707b19..8e8085c8 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiSelectColor.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiSelectColor.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import java.util.List; @@ -10,25 +10,27 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.EnumMCColor; -import ftb.lib.TextureCoords; -import ftb.lib.api.FTBLibLang; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.callback.ColorSelected; -import ftb.lib.api.gui.callback.IColorCallback; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.lib.api.gui.widgets.SliderLM; -import ftb.lib.api.gui.widgets.WidgetLM; import latmod.lib.LMColor; import latmod.lib.MathHelperLM; +import serverutils.lib.EnumMCColor; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.ServerUtilitiesLibLang; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.callback.ColorSelected; +import serverutils.lib.api.gui.callback.IColorCallback; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.api.gui.widgets.SliderLM; +import serverutils.lib.api.gui.widgets.WidgetLM; @SideOnly(Side.CLIENT) public class GuiSelectColor extends GuiLM { - public static final ResourceLocation tex = new ResourceLocation("ftbl", "textures/gui/colselector.png"); - public static final ResourceLocation tex_wheel = new ResourceLocation("ftbl", "textures/gui/colselector_wheel.png"); + public static final ResourceLocation tex = new ResourceLocation("serverlib", "textures/gui/colselector.png"); + public static final ResourceLocation tex_wheel = new ResourceLocation( + "serverlib", + "textures/gui/colselector_wheel.png"); public static final TextureCoords col_tex = new TextureCoords(tex, 145, 10, 29, 16); public static final TextureCoords cursor_tex = new TextureCoords(tex, 145, 36, 8, 8); @@ -67,7 +69,7 @@ public void onButtonPressed(int b) { } public void addMouseOverText(List s) { - s.add(FTBLibLang.button_cancel.format()); + s.add(ServerUtilitiesLibLang.button_cancel.format()); s.add(initCol.toString()); } }; @@ -79,7 +81,7 @@ public void onButtonPressed(int b) { } public void addMouseOverText(List s) { - s.add(FTBLibLang.button_accept.format()); + s.add(ServerUtilitiesLibLang.button_accept.format()); s.add(currentColor.toString()); } }; @@ -195,13 +197,13 @@ public void drawBackground() { super.drawBackground(); - FTBLibClient.setGLColor(initCol.color(), 255); + ServerUtilitiesLibraryClient.setGLColor(initCol.color(), 255); colorInit.render(col_tex); - FTBLibClient.setGLColor(currentColor.color(), 255); + ServerUtilitiesLibraryClient.setGLColor(currentColor.color(), 255); colorCurrent.render(col_tex); GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.setTexture(tex); + ServerUtilitiesLibraryClient.setTexture(tex); GlStateManager.color(1F, 1F, 1F, 1F); GlStateManager.shadeModel(GL11.GL_SMOOTH); @@ -267,7 +269,7 @@ public void renderSlider(WidgetLM widget, LMColor colLeft, LMColor colRight) { } public void closeGui(boolean set) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); callback.onColorSelected(new ColorSelected(colorID, set, set ? currentColor : initCol, true)); } @@ -312,7 +314,7 @@ public void renderWidget() { GlStateManager.enableBlend(); GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.setTexture(tex_wheel); + ServerUtilitiesLibraryClient.setTexture(tex_wheel); GuiLM.drawTexturedRectD(ax, ay, gui.zLevel, width, height, 0D, 0D, 1D, 1D); if (cursorPosX >= 0D && cursorPosY >= 0D) { diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiSelectField.java b/src/main/java/serverutils/lib/mod/client/gui/GuiSelectField.java similarity index 78% rename from src/main/java/ftb/lib/mod/client/gui/GuiSelectField.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiSelectField.java index 9328aa47..b813bd30 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiSelectField.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiSelectField.java @@ -1,16 +1,16 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.FTBLibLang; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.LMGuis; -import ftb.lib.api.gui.callback.FieldSelected; -import ftb.lib.api.gui.callback.IFieldCallback; -import ftb.lib.api.gui.widgets.ButtonSimpleLM; -import ftb.lib.api.gui.widgets.TextBoxLM; +import serverutils.lib.api.ServerUtilitiesLibLang; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.LMGuis; +import serverutils.lib.api.gui.callback.FieldSelected; +import serverutils.lib.api.gui.callback.IFieldCallback; +import serverutils.lib.api.gui.widgets.ButtonSimpleLM; +import serverutils.lib.api.gui.widgets.TextBoxLM; @SideOnly(Side.CLIENT) public class GuiSelectField extends GuiLM { @@ -38,22 +38,22 @@ public GuiSelectField(Object id, LMGuis.FieldType typ, String d, IFieldCallback buttonCancel = new ButtonSimpleLM(this, 2, mainPanel.height - 18, bsize, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); callback.onFieldSelected(new FieldSelected(ID, false, def, true)); } }; - buttonCancel.title = FTBLibLang.button_cancel.format(); + buttonCancel.title = ServerUtilitiesLibLang.button_cancel.format(); buttonAccept = new ButtonSimpleLM(this, mainPanel.width - bsize - 2, mainPanel.height - 18, bsize, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); if (textBox.isValid()) callback.onFieldSelected(new FieldSelected(ID, true, textBox.getText(), true)); } }; - buttonAccept.title = FTBLibLang.button_accept.format(); + buttonAccept.title = ServerUtilitiesLibLang.button_accept.format(); textBox = new TextBoxLM(this, 2, 2, mainPanel.width - 4, 18) { diff --git a/src/main/java/ftb/lib/mod/client/gui/GuiViewImage.java b/src/main/java/serverutils/lib/mod/client/gui/GuiViewImage.java similarity index 81% rename from src/main/java/ftb/lib/mod/client/gui/GuiViewImage.java rename to src/main/java/serverutils/lib/mod/client/gui/GuiViewImage.java index 43b6867f..127b2897 100644 --- a/src/main/java/ftb/lib/mod/client/gui/GuiViewImage.java +++ b/src/main/java/serverutils/lib/mod/client/gui/GuiViewImage.java @@ -1,13 +1,13 @@ -package ftb.lib.mod.client.gui; +package serverutils.lib.mod.client.gui; import net.minecraft.client.gui.GuiScreen; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.widgets.ButtonLM; @SideOnly(Side.CLIENT) public class GuiViewImage extends GuiLM { @@ -42,7 +42,7 @@ public void drawBackground() { super.drawBackground(); if (texCoords != null && texCoords.isValid()) { - FTBLibClient.setTexture(texCoords.texture); + ServerUtilitiesLibraryClient.setTexture(texCoords.texture); double w = texCoords.width; double h = texCoords.height; diff --git a/src/main/java/ftb/lib/mod/cmd/CmdEditConfig.java b/src/main/java/serverutils/lib/mod/cmd/CmdEditConfig.java similarity index 77% rename from src/main/java/ftb/lib/mod/cmd/CmdEditConfig.java rename to src/main/java/serverutils/lib/mod/cmd/CmdEditConfig.java index 62674220..dbdede08 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdEditConfig.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdEditConfig.java @@ -1,28 +1,28 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.FTBLib; -import ftb.lib.LMAccessToken; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.api.config.ConfigEntry; -import ftb.lib.api.config.ConfigFile; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.ConfigRegistry; -import ftb.lib.mod.FTBLibMod; -import ftb.lib.mod.config.FTBLibConfigCmdNames; -import ftb.lib.mod.net.MessageEditConfig; import latmod.lib.LMJsonUtils; import latmod.lib.LMListUtils; import latmod.lib.LMStringUtils; +import serverutils.lib.LMAccessToken; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.api.config.ConfigEntry; +import serverutils.lib.api.config.ConfigFile; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.ConfigRegistry; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmdNames; +import serverutils.lib.mod.net.MessageEditConfig; public class CmdEditConfig extends CommandLM { public CmdEditConfig() { - super(FTBLibConfigCmdNames.edit_config.getAsString(), CommandLevel.OP); + super(ServerUtilitiesLibConfigCmdNames.edit_config.getAsString(), CommandLevel.OP); } public String getCommandUsage(ICommandSender ics) { @@ -73,12 +73,12 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman if (args.length >= 4) { String json = LMStringUtils.unsplitSpaceUntilEnd(3, args); - FTBLibMod.logger.info("Setting " + args[0] + " " + args[1] + " " + args[2] + " to " + json); + ServerUtilitiesLibraryMod.logger.info("Setting " + args[0] + " " + args[1] + " " + args[2] + " to " + json); try { entry.func_152753_a(LMJsonUtils.fromJson(json)); file.save(); - FTBLib.reload(ics, true, false); + ServerUtilitiesLib.reload(ics, true, false); return new ChatComponentText(args[2] + " set to " + entry.getAsString()); } catch (Exception ex) { ChatComponentText error = new ChatComponentText(ex.toString()); diff --git a/src/main/java/ftb/lib/mod/cmd/CmdHelpOverride.java b/src/main/java/serverutils/lib/mod/cmd/CmdHelpOverride.java similarity index 95% rename from src/main/java/ftb/lib/mod/cmd/CmdHelpOverride.java rename to src/main/java/serverutils/lib/mod/cmd/CmdHelpOverride.java index 194f92f3..ef6270ca 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdHelpOverride.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdHelpOverride.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import java.util.Collections; import java.util.List; diff --git a/src/main/java/ftb/lib/mod/cmd/CmdListOverride.java b/src/main/java/serverutils/lib/mod/cmd/CmdListOverride.java similarity index 55% rename from src/main/java/ftb/lib/mod/cmd/CmdListOverride.java rename to src/main/java/serverutils/lib/mod/cmd/CmdListOverride.java index 2e4b04ac..132c3c79 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdListOverride.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdListOverride.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import java.util.List; @@ -6,10 +6,10 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.FTBLib; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; import latmod.lib.LMUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; public class CmdListOverride extends CommandLM { @@ -22,16 +22,16 @@ public String getCommandUsage(ICommandSender ics) { } public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { - List players = FTBLib.getAllOnlinePlayers(null); + List players = ServerUtilitiesLib.getAllOnlinePlayers(null); boolean printUUID = args.length > 0 && args[0].equals("uuid"); - FTBLib.printChat(ics, "Players currently online: [ " + players.size() + " ]"); + ServerUtilitiesLib.printChat(ics, "Players currently online: [ " + players.size() + " ]"); for (int i = 0; i < players.size(); i++) { EntityPlayerMP ep = players.get(i); - if (printUUID) - FTBLib.printChat(ics, ep.getCommandSenderName() + " :: " + LMUtils.fromUUID(ep.getUniqueID())); - else FTBLib.printChat(ics, ep.getCommandSenderName()); + if (printUUID) ServerUtilitiesLib + .printChat(ics, ep.getCommandSenderName() + " :: " + LMUtils.fromUUID(ep.getUniqueID())); + else ServerUtilitiesLib.printChat(ics, ep.getCommandSenderName()); } return null; diff --git a/src/main/java/ftb/lib/mod/cmd/CmdMode.java b/src/main/java/serverutils/lib/mod/cmd/CmdMode.java similarity index 68% rename from src/main/java/ftb/lib/mod/cmd/CmdMode.java rename to src/main/java/serverutils/lib/mod/cmd/CmdMode.java index b67d772e..51154834 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdMode.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdMode.java @@ -1,21 +1,21 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.FTBLib; -import ftb.lib.FTBWorld; -import ftb.lib.api.GameModes; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.api.cmd.CommandSubLM; -import ftb.lib.mod.FTBLibMod; import latmod.lib.LMListUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.GameModes; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.api.cmd.CommandSubLM; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public class CmdMode extends CommandSubLM { public CmdMode() { - super("ftb_mode", CommandLevel.OP); + super("server_mode", CommandLevel.OP); add(new CmdSet("set")); add(new CmdGet("get")); add(new CmdList("list")); @@ -41,18 +41,18 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman IChatComponent c; - int i = FTBWorld.server.setMode(args[0]); + int i = ServerUtilsWorld.server.setMode(args[0]); if (i == 1) { - c = FTBLibMod.mod.chatComponent("gamemode.not_found"); + c = ServerUtilitiesLibraryMod.mod.chatComponent("gamemode.not_found"); c.getChatStyle().setColor(EnumChatFormatting.RED); } else if (i == 2) { - c = FTBLibMod.mod.chatComponent("gamemode.already_set"); + c = ServerUtilitiesLibraryMod.mod.chatComponent("gamemode.already_set"); c.getChatStyle().setColor(EnumChatFormatting.RED); } else { - c = FTBLibMod.mod.chatComponent("gamemode.loaded", args[0]); + c = ServerUtilitiesLibraryMod.mod.chatComponent("gamemode.loaded", args[0]); c.getChatStyle().setColor(EnumChatFormatting.GREEN); - FTBLib.reload(ics, true, true); + ServerUtilitiesLib.reload(ics, true, true); } return c; @@ -66,7 +66,8 @@ public CmdGet(String s) { } public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { - IChatComponent c = FTBLibMod.mod.chatComponent("gamemode.current", FTBWorld.server.getMode()); + IChatComponent c = ServerUtilitiesLibraryMod.mod + .chatComponent("gamemode.current", ServerUtilsWorld.server.getMode()); c.getChatStyle().setColor(EnumChatFormatting.AQUA); return c; } @@ -79,7 +80,7 @@ public CmdList(String s) { } public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { - IChatComponent c = FTBLibMod.mod.chatComponent( + IChatComponent c = ServerUtilitiesLibraryMod.mod.chatComponent( "gamemode.list", joinNiceStringFromCollection(GameModes.getGameModes().modes.keySet())); c.getChatStyle().setColor(EnumChatFormatting.AQUA); diff --git a/src/main/java/ftb/lib/mod/cmd/CmdNotify.java b/src/main/java/serverutils/lib/mod/cmd/CmdNotify.java similarity index 82% rename from src/main/java/ftb/lib/mod/cmd/CmdNotify.java rename to src/main/java/serverutils/lib/mod/cmd/CmdNotify.java index c80662de..4aa3d961 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdNotify.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdNotify.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import java.util.List; @@ -10,21 +10,21 @@ import com.google.gson.JsonPrimitive; -import ftb.lib.FTBLib; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.api.cmd.ICustomCommandInfo; -import ftb.lib.api.notification.ClickAction; -import ftb.lib.api.notification.ClickActionType; -import ftb.lib.api.notification.MouseAction; -import ftb.lib.api.notification.Notification; import latmod.lib.LMJsonUtils; import latmod.lib.LMStringUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.api.cmd.ICustomCommandInfo; +import serverutils.lib.api.notification.ClickAction; +import serverutils.lib.api.notification.ClickActionType; +import serverutils.lib.api.notification.MouseAction; +import serverutils.lib.api.notification.Notification; public class CmdNotify extends CommandLM implements ICustomCommandInfo { public CmdNotify() { - super("ftb_notify", CommandLevel.OP); + super("server_notify", CommandLevel.OP); } public String getCommandUsage(ICommandSender ics) { @@ -49,7 +49,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman Notification n = Notification.deserialize(LMJsonUtils.fromJson(s)); if (n != null) { - for (EntityPlayerMP ep : findPlayers(ics, args[0])) FTBLib.notifyPlayer(ep, n); + for (EntityPlayerMP ep : findPlayers(ics, args[0])) ServerUtilitiesLib.notifyPlayer(ep, n); return null; } } catch (Exception e) { diff --git a/src/main/java/serverutils/lib/mod/cmd/CmdReload.java b/src/main/java/serverutils/lib/mod/cmd/CmdReload.java new file mode 100644 index 00000000..e973cd05 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/cmd/CmdReload.java @@ -0,0 +1,21 @@ +package serverutils.lib.mod.cmd; + +import net.minecraft.command.ICommandSender; +import net.minecraft.util.IChatComponent; + +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmdNames; + +public class CmdReload extends CommandLM { + + public CmdReload() { + super(ServerUtilitiesLibConfigCmdNames.reload.getAsString(), CommandLevel.OP); + } + + public IChatComponent onCommand(ICommandSender ics, String[] args) { + ServerUtilitiesLib.reload(ics, true, args.length > 0 && args[0].equalsIgnoreCase("client")); + return null; + } +} diff --git a/src/main/java/ftb/lib/mod/cmd/CmdReloadClient.java b/src/main/java/serverutils/lib/mod/cmd/CmdReloadClient.java similarity index 56% rename from src/main/java/ftb/lib/mod/cmd/CmdReloadClient.java rename to src/main/java/serverutils/lib/mod/cmd/CmdReloadClient.java index c8079431..5c4927a0 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdReloadClient.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdReloadClient.java @@ -1,20 +1,20 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import net.minecraft.command.ICommandSender; import net.minecraft.util.IChatComponent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.mod.client.FTBLibModClient; -import ftb.lib.mod.net.MessageReload; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.mod.client.ServerUtilitiesLibraryModClient; +import serverutils.lib.mod.net.MessageReload; @SideOnly(Side.CLIENT) public class CmdReloadClient extends CommandLM { public CmdReloadClient() { - super(FTBLibModClient.reload_client_cmd.getAsString(), CommandLevel.OP); + super(ServerUtilitiesLibraryModClient.reload_client_cmd.getAsString(), CommandLevel.OP); } public IChatComponent onCommand(ICommandSender ics, String[] args) { diff --git a/src/main/java/ftb/lib/mod/cmd/CmdSetItemName.java b/src/main/java/serverutils/lib/mod/cmd/CmdSetItemName.java similarity index 70% rename from src/main/java/ftb/lib/mod/cmd/CmdSetItemName.java rename to src/main/java/serverutils/lib/mod/cmd/CmdSetItemName.java index fae9c985..5f17feba 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdSetItemName.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdSetItemName.java @@ -1,18 +1,20 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.mod.config.FTBLibConfigCmd; -import ftb.lib.mod.config.FTBLibConfigCmdNames; import latmod.lib.LMStringUtils; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmd; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmdNames; public class CmdSetItemName extends CommandLM { public CmdSetItemName() { - super(FTBLibConfigCmdNames.set_item_name.getAsString(), FTBLibConfigCmd.level_set_item_name.get()); + super( + ServerUtilitiesLibConfigCmdNames.set_item_name.getAsString(), + ServerUtilitiesLibConfigCmd.level_set_item_name.get()); } public String getCommandUsage(ICommandSender ics) { diff --git a/src/main/java/ftb/lib/mod/cmd/CmdTrashCan.java b/src/main/java/serverutils/lib/mod/cmd/CmdTrashCan.java similarity index 61% rename from src/main/java/ftb/lib/mod/cmd/CmdTrashCan.java rename to src/main/java/serverutils/lib/mod/cmd/CmdTrashCan.java index c8b365a9..faa2e00a 100644 --- a/src/main/java/ftb/lib/mod/cmd/CmdTrashCan.java +++ b/src/main/java/serverutils/lib/mod/cmd/CmdTrashCan.java @@ -1,18 +1,20 @@ -package ftb.lib.mod.cmd; +package serverutils.lib.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.CommandLM; -import ftb.lib.api.item.BasicInventory; -import ftb.lib.mod.config.FTBLibConfigCmd; -import ftb.lib.mod.config.FTBLibConfigCmdNames; +import serverutils.lib.api.cmd.CommandLM; +import serverutils.lib.api.item.BasicInventory; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmd; +import serverutils.lib.mod.config.ServerUtilitiesLibConfigCmdNames; public class CmdTrashCan extends CommandLM { public CmdTrashCan() { - super(FTBLibConfigCmdNames.trash_can.getAsString(), FTBLibConfigCmd.level_trash_can.get()); + super( + ServerUtilitiesLibConfigCmdNames.trash_can.getAsString(), + ServerUtilitiesLibConfigCmd.level_trash_can.get()); } public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { diff --git a/src/main/java/ftb/lib/mod/config/FTBLibConfigCmd.java b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmd.java similarity index 76% rename from src/main/java/ftb/lib/mod/config/FTBLibConfigCmd.java rename to src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmd.java index 4773cc7d..282c1ae6 100644 --- a/src/main/java/ftb/lib/mod/config/FTBLibConfigCmd.java +++ b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmd.java @@ -1,11 +1,11 @@ -package ftb.lib.mod.config; +package serverutils.lib.mod.config; -import ftb.lib.api.cmd.CommandLevel; -import ftb.lib.api.config.ConfigEntryBool; -import ftb.lib.api.config.ConfigEntryEnum; import latmod.lib.annotations.Info; +import serverutils.lib.api.cmd.CommandLevel; +import serverutils.lib.api.config.ConfigEntryBool; +import serverutils.lib.api.config.ConfigEntryEnum; -public class FTBLibConfigCmd { +public class ServerUtilitiesLibConfigCmd { @Info("A new layout for /list command") public static final ConfigEntryBool override_list = new ConfigEntryBool("override_list", true); diff --git a/src/main/java/ftb/lib/mod/config/FTBLibConfigCmdNames.java b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmdNames.java similarity index 77% rename from src/main/java/ftb/lib/mod/config/FTBLibConfigCmdNames.java rename to src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmdNames.java index 68a5dfec..9f287014 100644 --- a/src/main/java/ftb/lib/mod/config/FTBLibConfigCmdNames.java +++ b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCmdNames.java @@ -1,11 +1,11 @@ -package ftb.lib.mod.config; +package serverutils.lib.mod.config; -import ftb.lib.api.config.ConfigEntryString; +import serverutils.lib.api.config.ConfigEntryString; /** * Created by LatvianModder on 20.02.2016. */ -public class FTBLibConfigCmdNames { +public class ServerUtilitiesLibConfigCmdNames { public static final ConfigEntryString reload = new ConfigEntryString("reload", "reload"); public static final ConfigEntryString edit_config = new ConfigEntryString("edit_config", "edit_config"); diff --git a/src/main/java/ftb/lib/mod/config/FTBLibConfigCompat.java b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCompat.java similarity index 65% rename from src/main/java/ftb/lib/mod/config/FTBLibConfigCompat.java rename to src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCompat.java index d2bdf3ee..6345a7f9 100644 --- a/src/main/java/ftb/lib/mod/config/FTBLibConfigCompat.java +++ b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibConfigCompat.java @@ -1,9 +1,9 @@ -package ftb.lib.mod.config; +package serverutils.lib.mod.config; -import ftb.lib.api.config.ConfigEntryBool; import latmod.lib.annotations.Info; +import serverutils.lib.api.config.ConfigEntryBool; -public class FTBLibConfigCompat { +public class ServerUtilitiesLibConfigCompat { @Info("When true: inventory buttons do not shift when potion effect(s) are active") public static final ConfigEntryBool compat_statusEffectHUD = new ConfigEntryBool("compat_statusEffectHUD", false); diff --git a/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibraryConfig.java b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibraryConfig.java new file mode 100644 index 00000000..43cc01a3 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/config/ServerUtilitiesLibraryConfig.java @@ -0,0 +1,26 @@ +package serverutils.lib.mod.config; + +import java.io.File; + +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.config.ConfigFile; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.ConfigRegistry; + +public class ServerUtilitiesLibraryConfig { + + public static final ConfigFile configFile = new ConfigFile("serverutilslib"); + + public static void load() { + // TODO: Backwards Compat? + configFile.setFile(new File(ServerUtilitiesLib.folderLocal, "serverutilslib.json")); + configFile.setDisplayName("ServerUtilitiesLibrary"); + configFile.add(new ConfigGroup("compat").addAll(ServerUtilitiesLibConfigCompat.class, null, false), false); + configFile.add(new ConfigGroup("commands").addAll(ServerUtilitiesLibConfigCmd.class, null, false), false); + configFile.add( + new ConfigGroup("command_names").addAll(ServerUtilitiesLibConfigCmdNames.class, null, false), + false); + ConfigRegistry.add(configFile); + configFile.load(); + } +} diff --git a/src/main/java/ftb/lib/mod/net/MessageClientItemAction.java b/src/main/java/serverutils/lib/mod/net/MessageClientItemAction.java similarity index 83% rename from src/main/java/ftb/lib/mod/net/MessageClientItemAction.java rename to src/main/java/serverutils/lib/mod/net/MessageClientItemAction.java index 5adf8fd2..8a03cc18 100644 --- a/src/main/java/ftb/lib/mod/net/MessageClientItemAction.java +++ b/src/main/java/serverutils/lib/mod/net/MessageClientItemAction.java @@ -1,14 +1,14 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.api.item.IClientActionItem; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; import latmod.lib.ByteCount; +import serverutils.lib.api.item.IClientActionItem; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; public class MessageClientItemAction extends MessageLM { @@ -23,7 +23,7 @@ public MessageClientItemAction(String s, NBTTagCompound tag) { } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET_GUI; + return ServerUtilitiesLibraryLibNetHandler.NET_GUI; } public IMessage onMessage(MessageContext ctx) { diff --git a/src/main/java/ftb/lib/mod/net/MessageClientTileAction.java b/src/main/java/serverutils/lib/mod/net/MessageClientTileAction.java similarity index 82% rename from src/main/java/ftb/lib/mod/net/MessageClientTileAction.java rename to src/main/java/serverutils/lib/mod/net/MessageClientTileAction.java index 15def3c3..4e5ce205 100644 --- a/src/main/java/ftb/lib/mod/net/MessageClientTileAction.java +++ b/src/main/java/serverutils/lib/mod/net/MessageClientTileAction.java @@ -1,14 +1,14 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.api.tile.IClientActionTile; import latmod.lib.ByteCount; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.api.tile.IClientActionTile; public class MessageClientTileAction extends MessageLM { @@ -26,7 +26,7 @@ public MessageClientTileAction(TileEntity t, String s, NBTTagCompound tag) { } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET_GUI; + return ServerUtilitiesLibraryLibNetHandler.NET_GUI; } public IMessage onMessage(MessageContext ctx) { diff --git a/src/main/java/ftb/lib/mod/net/MessageEditConfig.java b/src/main/java/serverutils/lib/mod/net/MessageEditConfig.java similarity index 52% rename from src/main/java/ftb/lib/mod/net/MessageEditConfig.java rename to src/main/java/serverutils/lib/mod/net/MessageEditConfig.java index 72320b5a..5f3f7a00 100644 --- a/src/main/java/ftb/lib/mod/net/MessageEditConfig.java +++ b/src/main/java/serverutils/lib/mod/net/MessageEditConfig.java @@ -1,18 +1,18 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.FTBLib; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.ServerConfigProvider; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.mod.client.gui.GuiEditConfig; import latmod.lib.ByteCount; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.ServerConfigProvider; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.mod.client.gui.GuiEditConfig; public class MessageEditConfig extends MessageLM // MessageEditConfigResponse { @@ -31,11 +31,12 @@ public MessageEditConfig(long t, boolean reload, ConfigGroup group) { group.writeToNBT(tag, true); writeTag(tag); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("TX Send: " + group.getSerializableElement()); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("TX Send: " + group.getSerializableElement()); } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET; + return ServerUtilitiesLibraryLibNetHandler.NET; } @SideOnly(Side.CLIENT) @@ -47,10 +48,13 @@ public IMessage onMessage(MessageContext ctx) { ConfigGroup group = new ConfigGroup(id); group.readFromNBT(readTag(), true); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("RX Send: " + group.getSerializableElement()); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("RX Send: " + group.getSerializableElement()); - FTBLibClient.openGui( - new GuiEditConfig(FTBLibClient.mc.currentScreen, new ServerConfigProvider(token, reload, group))); + ServerUtilitiesLibraryClient.openGui( + new GuiEditConfig( + ServerUtilitiesLibraryClient.mc.currentScreen, + new ServerConfigProvider(token, reload, group))); return null; } } diff --git a/src/main/java/ftb/lib/mod/net/MessageEditConfigResponse.java b/src/main/java/serverutils/lib/mod/net/MessageEditConfigResponse.java similarity index 63% rename from src/main/java/ftb/lib/mod/net/MessageEditConfigResponse.java rename to src/main/java/serverutils/lib/mod/net/MessageEditConfigResponse.java index f2784728..a22a7915 100644 --- a/src/main/java/ftb/lib/mod/net/MessageEditConfigResponse.java +++ b/src/main/java/serverutils/lib/mod/net/MessageEditConfigResponse.java @@ -1,17 +1,17 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.FTBLib; -import ftb.lib.LMAccessToken; -import ftb.lib.api.config.ConfigFile; -import ftb.lib.api.config.ConfigGroup; -import ftb.lib.api.config.ConfigRegistry; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; import latmod.lib.ByteCount; +import serverutils.lib.LMAccessToken; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.config.ConfigFile; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.ConfigRegistry; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; public class MessageEditConfigResponse extends MessageLM // MessageEditConfig { @@ -31,11 +31,12 @@ public MessageEditConfigResponse(long adminToken, boolean reload, ConfigGroup gr io.writeBoolean(reload); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("Response TX: " + group.getSerializableElement()); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("Response TX: " + group.getSerializableElement()); } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET; + return ServerUtilitiesLibraryLibNetHandler.NET; } public IMessage onMessage(MessageContext ctx) { @@ -52,10 +53,11 @@ public IMessage onMessage(MessageContext ctx) { if (file.loadFromGroup(group, true) > 0) { file.save(); - if (io.readBoolean()) FTBLib.reload(ep, true, false); + if (io.readBoolean()) ServerUtilitiesLib.reload(ep, true, false); } - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("Response RX: " + file.getSerializableElement()); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("Response RX: " + file.getSerializableElement()); return null; } diff --git a/src/main/java/serverutils/lib/mod/net/MessageNotifyPlayer.java b/src/main/java/serverutils/lib/mod/net/MessageNotifyPlayer.java new file mode 100644 index 00000000..7e45e23c --- /dev/null +++ b/src/main/java/serverutils/lib/mod/net/MessageNotifyPlayer.java @@ -0,0 +1,45 @@ +package serverutils.lib.mod.net; + +import cpw.mods.fml.common.network.simpleimpl.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import latmod.lib.ByteCount; +import latmod.lib.json.JsonElementIO; +import serverutils.lib.EnumScreen; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.api.notification.ClientNotifications; +import serverutils.lib.api.notification.Notification; +import serverutils.lib.mod.client.ServerUtilitiesLibraryModClient; + +public class MessageNotifyPlayer extends MessageLM { + + public MessageNotifyPlayer() { + super(ByteCount.SHORT); + } + + public MessageNotifyPlayer(Notification n) { + this(); + JsonElementIO.write(io, n.getSerializableElement()); + } + + public LMNetworkWrapper getWrapper() { + return ServerUtilitiesLibraryLibNetHandler.NET_GUI; + } + + @SideOnly(Side.CLIENT) + public IMessage onMessage(MessageContext ctx) { + if (ServerUtilitiesLibraryModClient.notifications.get() != EnumScreen.OFF) { + Notification n = Notification.deserialize(JsonElementIO.read(io)); + + if (ServerUtilitiesLibraryModClient.notifications.get() == EnumScreen.SCREEN) ClientNotifications.add(n); + else { + ServerUtilitiesLibraryClient.mc.thePlayer.addChatMessage(n.title); + if (n.desc != null) ServerUtilitiesLibraryClient.mc.thePlayer.addChatMessage(n.desc); + } + } + + return null; + } +} diff --git a/src/main/java/ftb/lib/mod/net/MessageOpenGui.java b/src/main/java/serverutils/lib/mod/net/MessageOpenGui.java similarity index 58% rename from src/main/java/ftb/lib/mod/net/MessageOpenGui.java rename to src/main/java/serverutils/lib/mod/net/MessageOpenGui.java index 8cafedb1..6f843af8 100644 --- a/src/main/java/ftb/lib/mod/net/MessageOpenGui.java +++ b/src/main/java/serverutils/lib/mod/net/MessageOpenGui.java @@ -1,17 +1,17 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.gui.LMGuiHandler; -import ftb.lib.api.gui.LMGuiHandlerRegistry; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.mod.FTBLibMod; import latmod.lib.ByteCount; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.LMGuiHandler; +import serverutils.lib.api.gui.LMGuiHandlerRegistry; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; public class MessageOpenGui extends MessageLM { @@ -28,7 +28,7 @@ public MessageOpenGui(String mod, int id, NBTTagCompound tag, int wid) { } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET_GUI; + return ServerUtilitiesLibraryLibNetHandler.NET_GUI; } @SideOnly(Side.CLIENT) @@ -39,8 +39,9 @@ public IMessage onMessage(MessageContext ctx) { int windowID = io.readUnsignedByte(); LMGuiHandler h = LMGuiHandlerRegistry.get(modID); - if (h != null && FTBLibMod.proxy.openClientGui(FTBLibClient.mc.thePlayer, modID, guiID, data)) - FTBLibClient.mc.thePlayer.openContainer.windowId = windowID; + if (h != null && ServerUtilitiesLibraryMod.proxy + .openClientGui(ServerUtilitiesLibraryClient.mc.thePlayer, modID, guiID, data)) + ServerUtilitiesLibraryClient.mc.thePlayer.openContainer.windowId = windowID; return null; } } diff --git a/src/main/java/ftb/lib/mod/net/MessageOpenGuiTile.java b/src/main/java/serverutils/lib/mod/net/MessageOpenGuiTile.java similarity index 61% rename from src/main/java/ftb/lib/mod/net/MessageOpenGuiTile.java rename to src/main/java/serverutils/lib/mod/net/MessageOpenGuiTile.java index b863c0ea..ed597559 100644 --- a/src/main/java/ftb/lib/mod/net/MessageOpenGuiTile.java +++ b/src/main/java/serverutils/lib/mod/net/MessageOpenGuiTile.java @@ -1,4 +1,4 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import net.minecraft.client.gui.GuiScreen; import net.minecraft.nbt.NBTTagCompound; @@ -7,11 +7,11 @@ import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.lib.api.net.MessageLM; -import ftb.lib.api.tile.IGuiTile; import latmod.lib.ByteCount; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.api.tile.IGuiTile; public class MessageOpenGuiTile extends MessageLM { @@ -29,7 +29,7 @@ public MessageOpenGuiTile(TileEntity t, NBTTagCompound tag, int wid) { } public LMNetworkWrapper getWrapper() { - return FTBLibNetHandler.NET_GUI; + return ServerUtilitiesLibraryLibNetHandler.NET_GUI; } @SideOnly(Side.CLIENT) @@ -38,14 +38,14 @@ public IMessage onMessage(MessageContext ctx) { int y = io.readInt(); int z = io.readInt(); - TileEntity te = FTBLibClient.mc.theWorld.getTileEntity(x, y, z); + TileEntity te = ServerUtilitiesLibraryClient.mc.theWorld.getTileEntity(x, y, z); if (te != null && !te.isInvalid() && te instanceof IGuiTile) { - GuiScreen gui = ((IGuiTile) te).getGui(FTBLibClient.mc.thePlayer, readTag()); + GuiScreen gui = ((IGuiTile) te).getGui(ServerUtilitiesLibraryClient.mc.thePlayer, readTag()); if (gui != null) { - FTBLibClient.openGui(gui); - FTBLibClient.mc.thePlayer.openContainer.windowId = io.readUnsignedByte(); + ServerUtilitiesLibraryClient.openGui(gui); + ServerUtilitiesLibraryClient.mc.thePlayer.openContainer.windowId = io.readUnsignedByte(); } } diff --git a/src/main/java/serverutils/lib/mod/net/MessageReload.java b/src/main/java/serverutils/lib/mod/net/MessageReload.java new file mode 100644 index 00000000..917d6215 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/net/MessageReload.java @@ -0,0 +1,110 @@ +package serverutils.lib.mod.net; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.*; + +import cpw.mods.fml.common.network.simpleimpl.*; +import latmod.lib.ByteCount; +import latmod.lib.ByteIOStream; +import latmod.lib.LMUtils; +import serverutils.lib.LMNBTUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.EventServerUtilitiesReload; +import serverutils.lib.api.GameModes; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.lib.api.config.ConfigRegistry; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; +import serverutils.lib.api.notification.ClientNotifications; +import serverutils.lib.api.notification.Notification; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.lib.mod.client.ServerUtilitiesLibraryModClient; + +public class MessageReload extends MessageLM { + + public MessageReload() { + super(ByteCount.INT); + } + + public MessageReload(ServerUtilsWorld w, int reloadClient) { + this(); + io.writeByte(reloadClient); + + if (reloadClient > 0) { + w.writeReloadData(io); + writeSyncedConfig(io); + } + } + + public LMNetworkWrapper getWrapper() { + return ServerUtilitiesLibraryLibNetHandler.NET; + } + + public IMessage onMessage(MessageContext ctx) { + if (ServerUtilitiesLib.DEV_ENV) { + ServerUtilitiesLib.dev_logger.info("--------< RELOADING >----------"); + } + + byte reload = io.readByte(); + + if (reload == 0) { + Notification n = new Notification( + "reload_client_config", + ServerUtilitiesLibraryMod.mod.chatComponent("reload_client_config"), + 7000); + n.title.getChatStyle().setColor(EnumChatFormatting.WHITE); + n.desc = new ChatComponentText("/" + ServerUtilitiesLibraryModClient.reload_client_cmd.getAsString()); + n.setColor(0xFF333333); + ClientNotifications.add(n); + return null; + } + + long ms = LMUtils.millis(); + ServerUtilsWorld.client.readReloadData(io); + readSyncedConfig(io); + + if (reload > 0) { + reloadClient(ms, reload > 1); + } + + return null; + } + + public static void reloadClient(long ms, boolean printMessage) { + if (ms == 0L) ms = LMUtils.millis(); + GameModes.reload(); + EntityPlayer ep = ServerUtilitiesLibraryMod.proxy.getClientPlayer(); + EventServerUtilitiesReload event = new EventServerUtilitiesReload(ServerUtilsWorld.client, ep, true); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.onReloaded(event); + event.post(); + + if (printMessage) { + ServerUtilitiesLib.printChat( + ep, + ServerUtilitiesLibraryMod.mod.chatComponent("reloaded_client", ((LMUtils.millis() - ms) + "ms"))); + } + + ServerUtilitiesLibraryMod.logger.info("Current Mode: " + ServerUtilsWorld.client.getMode()); + } + + static void writeSyncedConfig(ByteIOStream out) { + NBTTagCompound tag = new NBTTagCompound(); + ConfigRegistry.synced.writeToNBT(tag, false); + LMNBTUtils.writeTag(out, tag); + + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("Synced config TX: " + ConfigRegistry.synced.getSerializableElement()); + } + + static void readSyncedConfig(ByteIOStream in) { + NBTTagCompound tag = LMNBTUtils.readTag(in); + ConfigGroup synced = new ConfigGroup(ConfigRegistry.synced.getID()); + synced.readFromNBT(tag, false); + ConfigRegistry.synced.loadFromGroup(synced, true); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("Synced config RX: " + synced.getSerializableElement()); + } +} diff --git a/src/main/java/serverutils/lib/mod/net/MessageSendWorldID.java b/src/main/java/serverutils/lib/mod/net/MessageSendWorldID.java new file mode 100644 index 00000000..bf7294c8 --- /dev/null +++ b/src/main/java/serverutils/lib/mod/net/MessageSendWorldID.java @@ -0,0 +1,46 @@ +package serverutils.lib.mod.net; + +import net.minecraft.entity.player.EntityPlayerMP; + +import cpw.mods.fml.common.network.simpleimpl.*; +import cpw.mods.fml.relauncher.Side; +import latmod.lib.ByteCount; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.ServerUtilsWorld; +import serverutils.lib.api.EventServerUtilitiesWorldClient; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.MessageLM; + +public class MessageSendWorldID extends MessageLM { + + public MessageSendWorldID() { + super(ByteCount.INT); + } + + public MessageSendWorldID(ServerUtilsWorld w, EntityPlayerMP ep) { + this(); + MessageReload.writeSyncedConfig(io); + io.writeBoolean(ServerUtilitiesLib.serverUtilitiesIntegration != null); + w.writeReloadData(io); + if (ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.writeWorldData(io, ep); + } + + public LMNetworkWrapper getWrapper() { + return ServerUtilitiesLibraryLibNetHandler.NET; + } + + public IMessage onMessage(MessageContext ctx) { + MessageReload.readSyncedConfig(io); + boolean hasServerUtilities = io.readBoolean(); + + boolean first = ServerUtilsWorld.client == null; + if (first) ServerUtilsWorld.client = new ServerUtilsWorld(Side.CLIENT); + ServerUtilsWorld.client.readReloadData(io); + new EventServerUtilitiesWorldClient(ServerUtilsWorld.client).post(); + if (first && hasServerUtilities && ServerUtilitiesLib.serverUtilitiesIntegration != null) + ServerUtilitiesLib.serverUtilitiesIntegration.readWorldData(io); + + return null; + } +} diff --git a/src/main/java/ftb/lib/mod/net/FTBLibNetHandler.java b/src/main/java/serverutils/lib/mod/net/ServerUtilitiesLibraryLibNetHandler.java similarity index 85% rename from src/main/java/ftb/lib/mod/net/FTBLibNetHandler.java rename to src/main/java/serverutils/lib/mod/net/ServerUtilitiesLibraryLibNetHandler.java index 995641f5..00ef858f 100644 --- a/src/main/java/ftb/lib/mod/net/FTBLibNetHandler.java +++ b/src/main/java/serverutils/lib/mod/net/ServerUtilitiesLibraryLibNetHandler.java @@ -1,12 +1,12 @@ -package ftb.lib.mod.net; +package serverutils.lib.mod.net; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.LMNetworkWrapper; -public class FTBLibNetHandler { +public class ServerUtilitiesLibraryLibNetHandler { - static final LMNetworkWrapper NET = LMNetworkWrapper.newWrapper("FTBL"); - static final LMNetworkWrapper NET_GUI = LMNetworkWrapper.newWrapper("FTBLG"); + static final LMNetworkWrapper NET = LMNetworkWrapper.newWrapper("SVRUL"); + static final LMNetworkWrapper NET_GUI = LMNetworkWrapper.newWrapper("SVRULG"); public static void init() { NET.register(MessageSendWorldID.class, 1, Side.CLIENT); diff --git a/src/main/java/ftb/utils/api/EventLMPlayer.java b/src/main/java/serverutils/utils/api/EventLMPlayer.java similarity index 61% rename from src/main/java/ftb/utils/api/EventLMPlayer.java rename to src/main/java/serverutils/utils/api/EventLMPlayer.java index d828db26..8b1aa1f9 100644 --- a/src/main/java/ftb/utils/api/EventLMPlayer.java +++ b/src/main/java/serverutils/utils/api/EventLMPlayer.java @@ -1,8 +1,8 @@ -package ftb.utils.api; +package serverutils.utils.api; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.EventLM; -import ftb.utils.world.LMPlayer; +import serverutils.lib.api.EventLM; +import serverutils.utils.world.LMPlayer; public abstract class EventLMPlayer extends EventLM { diff --git a/src/main/java/ftb/utils/api/EventLMPlayerClient.java b/src/main/java/serverutils/utils/api/EventLMPlayerClient.java similarity index 95% rename from src/main/java/ftb/utils/api/EventLMPlayerClient.java rename to src/main/java/serverutils/utils/api/EventLMPlayerClient.java index 18d701f8..478100c6 100644 --- a/src/main/java/ftb/utils/api/EventLMPlayerClient.java +++ b/src/main/java/serverutils/utils/api/EventLMPlayerClient.java @@ -1,9 +1,9 @@ -package ftb.utils.api; +package serverutils.utils.api; import java.util.List; import cpw.mods.fml.relauncher.Side; -import ftb.utils.world.*; +import serverutils.utils.world.*; public abstract class EventLMPlayerClient extends EventLMPlayer { diff --git a/src/main/java/ftb/utils/api/EventLMPlayerServer.java b/src/main/java/serverutils/utils/api/EventLMPlayerServer.java similarity index 96% rename from src/main/java/ftb/utils/api/EventLMPlayerServer.java rename to src/main/java/serverutils/utils/api/EventLMPlayerServer.java index 264a3b7d..dacda2b2 100644 --- a/src/main/java/ftb/utils/api/EventLMPlayerServer.java +++ b/src/main/java/serverutils/utils/api/EventLMPlayerServer.java @@ -1,4 +1,4 @@ -package ftb.utils.api; +package serverutils.utils.api; import java.util.List; @@ -6,7 +6,7 @@ import net.minecraft.util.IChatComponent; import cpw.mods.fml.relauncher.Side; -import ftb.utils.world.*; +import serverutils.utils.world.*; public abstract class EventLMPlayerServer extends EventLMPlayer // LMPlayerClientEvent { diff --git a/src/main/java/ftb/utils/api/EventLMWorldClient.java b/src/main/java/serverutils/utils/api/EventLMWorldClient.java similarity index 67% rename from src/main/java/ftb/utils/api/EventLMWorldClient.java rename to src/main/java/serverutils/utils/api/EventLMWorldClient.java index b8a59531..931ff9e7 100644 --- a/src/main/java/ftb/utils/api/EventLMWorldClient.java +++ b/src/main/java/serverutils/utils/api/EventLMWorldClient.java @@ -1,7 +1,7 @@ -package ftb.utils.api; +package serverutils.utils.api; -import ftb.lib.api.EventLM; -import ftb.utils.world.LMWorldClient; +import serverutils.lib.api.EventLM; +import serverutils.utils.world.LMWorldClient; public class EventLMWorldClient extends EventLM { diff --git a/src/main/java/ftb/utils/api/EventLMWorldServer.java b/src/main/java/serverutils/utils/api/EventLMWorldServer.java similarity index 82% rename from src/main/java/ftb/utils/api/EventLMWorldServer.java rename to src/main/java/serverutils/utils/api/EventLMWorldServer.java index 013eefd6..af7be4dd 100644 --- a/src/main/java/ftb/utils/api/EventLMWorldServer.java +++ b/src/main/java/serverutils/utils/api/EventLMWorldServer.java @@ -1,8 +1,8 @@ -package ftb.utils.api; +package serverutils.utils.api; -import ftb.lib.api.EventLM; -import ftb.utils.world.LMWorldServer; import latmod.lib.util.Phase; +import serverutils.lib.api.EventLM; +import serverutils.utils.world.LMWorldServer; public class EventLMWorldServer extends EventLM { diff --git a/src/main/java/ftb/utils/api/FriendsAPI.java b/src/main/java/serverutils/utils/api/FriendsAPI.java similarity index 96% rename from src/main/java/ftb/utils/api/FriendsAPI.java rename to src/main/java/serverutils/utils/api/FriendsAPI.java index 0af4a2d6..bdc1f4c9 100644 --- a/src/main/java/ftb/utils/api/FriendsAPI.java +++ b/src/main/java/serverutils/utils/api/FriendsAPI.java @@ -1,9 +1,9 @@ -package ftb.utils.api; +package serverutils.utils.api; import java.util.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.world.*; +import serverutils.utils.world.*; /** * Created by LatvianModder on 23.03.2016.
diff --git a/src/main/java/ftb/utils/api/guide/ClientGuideFile.java b/src/main/java/serverutils/utils/api/guide/ClientGuideFile.java similarity index 73% rename from src/main/java/ftb/utils/api/guide/ClientGuideFile.java rename to src/main/java/serverutils/utils/api/guide/ClientGuideFile.java index e57957bf..f0490943 100644 --- a/src/main/java/ftb/utils/api/guide/ClientGuideFile.java +++ b/src/main/java/serverutils/utils/api/guide/ClientGuideFile.java @@ -1,15 +1,15 @@ -package ftb.utils.api.guide; +package serverutils.utils.api.guide; import java.io.File; import java.util.Arrays; import net.minecraft.util.ChatComponentTranslation; -import ftb.lib.FTBLib; -import ftb.lib.api.*; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.client.gui.guide.GuiGuide; import latmod.lib.LMFileUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.client.gui.guide.GuiGuide; public class ClientGuideFile extends GuidePage { @@ -17,11 +17,12 @@ public class ClientGuideFile extends GuidePage { public ClientGuideFile(String id) { super(id); - setTitle(new ChatComponentTranslation("player_action.ftbu.guide")); + setTitle(new ChatComponentTranslation("player_action.serverutils.guide")); } - public void reload(EventFTBReload e) { - if (FTBLib.DEV_ENV) FTBU.logger.info("Guide reloaded @ " + e.world.side + " as " + e.world.getMode()); + public void reload(EventServerUtilitiesReload e) { + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilities.logger.info("Guide reloaded @ " + e.world.side + " as " + e.world.getMode()); clear(); @@ -53,7 +54,7 @@ public void reload(EventFTBReload e) { } } - new EventFTBUClientGuide(this).post(); + new ServerUtilitiesClientGuide(this).post(); cleanup(); GuiGuide.clientGuideGui = null; diff --git a/src/main/java/serverutils/utils/api/guide/EventServerUtilitiesServerGuide.java b/src/main/java/serverutils/utils/api/guide/EventServerUtilitiesServerGuide.java new file mode 100644 index 00000000..8dd30f13 --- /dev/null +++ b/src/main/java/serverutils/utils/api/guide/EventServerUtilitiesServerGuide.java @@ -0,0 +1,17 @@ +package serverutils.utils.api.guide; + +import serverutils.lib.api.EventLM; +import serverutils.utils.world.LMPlayerServer; + +public class EventServerUtilitiesServerGuide extends EventLM { + + public final ServerGuideFile file; + public final LMPlayerServer player; + public final boolean isOP; + + public EventServerUtilitiesServerGuide(ServerGuideFile f, LMPlayerServer p) { + file = f; + player = p; + isOP = p.isOP(); + } +} diff --git a/src/main/java/ftb/utils/api/guide/GuidePage.java b/src/main/java/serverutils/utils/api/guide/GuidePage.java similarity index 96% rename from src/main/java/ftb/utils/api/guide/GuidePage.java rename to src/main/java/serverutils/utils/api/guide/GuidePage.java index 46457bb3..d69e9bea 100644 --- a/src/main/java/ftb/utils/api/guide/GuidePage.java +++ b/src/main/java/serverutils/utils/api/guide/GuidePage.java @@ -1,4 +1,4 @@ -package ftb.utils.api.guide; +package serverutils.utils.api.guide; import java.io.File; import java.util.*; @@ -10,13 +10,13 @@ import com.google.gson.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.JsonHelper; -import ftb.lib.api.gui.IClientActionGui; -import ftb.utils.api.guide.lines.*; -import ftb.utils.mod.client.gui.guide.*; -import ftb.utils.net.MessageDisplayGuide; import latmod.lib.*; import latmod.lib.util.FinalIDObject; +import serverutils.lib.JsonHelper; +import serverutils.lib.api.gui.IClientActionGui; +import serverutils.utils.api.guide.lines.*; +import serverutils.utils.mod.client.gui.guide.*; +import serverutils.utils.net.MessageDisplayGuide; public class GuidePage extends FinalIDObject implements IJsonSerializable, IClientActionGui // GuideFile { diff --git a/src/main/java/ftb/utils/api/guide/ServerGuideFile.java b/src/main/java/serverutils/utils/api/guide/ServerGuideFile.java similarity index 72% rename from src/main/java/ftb/utils/api/guide/ServerGuideFile.java rename to src/main/java/serverutils/utils/api/guide/ServerGuideFile.java index 2f243967..d35a9347 100644 --- a/src/main/java/ftb/utils/api/guide/ServerGuideFile.java +++ b/src/main/java/serverutils/utils/api/guide/ServerGuideFile.java @@ -1,4 +1,4 @@ -package ftb.utils.api.guide; +package serverutils.utils.api.guide; import java.io.File; import java.util.*; @@ -8,27 +8,27 @@ import com.google.gson.JsonPrimitive; -import ftb.lib.*; -import ftb.lib.api.cmd.ICustomCommandInfo; -import ftb.lib.api.notification.*; -import ftb.utils.api.guide.lines.GuideExtendedTextLine; -import ftb.utils.mod.*; -import ftb.utils.mod.config.*; -import ftb.utils.world.*; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.lib.api.cmd.ICustomCommandInfo; +import serverutils.lib.api.notification.*; +import serverutils.utils.api.guide.lines.GuideExtendedTextLine; +import serverutils.utils.mod.*; +import serverutils.utils.mod.config.*; +import serverutils.utils.world.*; public class ServerGuideFile extends GuidePage { public static class CachedInfo { public static final GuidePage main = new GuidePage("server_info") - .setTitle(new ChatComponentTranslation("player_action.ftbu.server_info")); + .setTitle(new ChatComponentTranslation("player_action.serverutils.server_info")); public static GuidePage categoryServer; public static void reload() { main.clear(); - File file = new File(FTBLib.folderLocal, "guide/"); + File file = new File(ServerUtilitiesLib.folderLocal, "guide/"); if (file.exists() && file.isDirectory()) { File[] f = file.listFiles(); if (f != null && f.length > 0) { @@ -37,7 +37,7 @@ public static void reload() { } } - file = new File(FTBLib.folderLocal, "guide_cover.txt"); + file = new File(ServerUtilitiesLib.folderLocal, "guide_cover.txt"); if (file.exists() && file.isFile()) { try { String text = LMFileUtils.loadAsText(file); @@ -60,10 +60,10 @@ public ServerGuideFile(LMPlayerServer pself) { setTitle(CachedInfo.main.getTitleComponent()); if ((self = pself) == null) return; - boolean isDedi = FTBLib.getServer().isDedicatedServer(); + boolean isDedi = ServerUtilitiesLib.getServer().isDedicatedServer(); - if (!FTBUConfigLogin.motd.components.isEmpty()) { - for (IChatComponent c : FTBUConfigLogin.motd.components) { + if (!ServerUtilitiesConfigLogin.motd.components.isEmpty()) { + for (IChatComponent c : ServerUtilitiesConfigLogin.motd.components) { println(c); } @@ -72,7 +72,7 @@ public ServerGuideFile(LMPlayerServer pself) { copyFrom(CachedInfo.main); - categoryTops = getSub("tops").setTitle(FTBU.mod.chatComponent("top.title")); + categoryTops = getSub("tops").setTitle(ServerUtilities.mod.chatComponent("top.title")); players = LMWorldServer.inst.getServerPlayers(); @@ -80,40 +80,40 @@ public ServerGuideFile(LMPlayerServer pself) { p.refreshStats(); } - if (FTBUConfigGeneral.restart_timer.getAsDouble() > 0D) println( - FTBU.mod.chatComponent( + if (ServerUtilitiesConfigGeneral.restart_timer.getAsDouble() > 0D) println( + ServerUtilities.mod.chatComponent( "cmd.timer_restart", - LMStringUtils.getTimeString(FTBUTicks.restartMillis - LMUtils.millis()))); + LMStringUtils.getTimeString(ServerUtilsTicks.restartMillis - LMUtils.millis()))); - if (FTBUConfigBackups.enabled.getAsBoolean()) println( - FTBU.mod.chatComponent( + if (ServerUtilitiesConfigBackups.enabled.getAsBoolean()) println( + ServerUtilities.mod.chatComponent( "cmd.timer_backup", LMStringUtils.getTimeString(Backups.nextBackup - LMUtils.millis()))); - if (FTBUConfigGeneral.server_info_difficulty.getAsBoolean()) println( - FTBU.mod.chatComponent( + if (ServerUtilitiesConfigGeneral.server_info_difficulty.getAsBoolean()) println( + ServerUtilities.mod.chatComponent( "cmd.world_difficulty", LMStringUtils.firstUppercase( pself.getPlayer().worldObj.difficultySetting.toString().toLowerCase()))); - if (FTBUConfigGeneral.server_info_mode.getAsBoolean()) println( - FTBU.mod.chatComponent( - "cmd.ftb_gamemode", - LMStringUtils.firstUppercase(FTBWorld.server.getMode().toString().toLowerCase()))); + if (ServerUtilitiesConfigGeneral.server_info_mode.getAsBoolean()) println( + ServerUtilities.mod.chatComponent( + "cmd.serveru_gamemode", + LMStringUtils.firstUppercase(ServerUtilsWorld.server.getMode().toString().toLowerCase()))); - if (FTBUConfigTops.first_joined.getAsBoolean()) addTop(Top.first_joined); - if (FTBUConfigTops.deaths.getAsBoolean()) addTop(Top.deaths); - if (FTBUConfigTops.deaths_ph.getAsBoolean()) addTop(Top.deaths_ph); - if (FTBUConfigTops.last_seen.getAsBoolean()) addTop(Top.last_seen); - if (FTBUConfigTops.time_played.getAsBoolean()) addTop(Top.time_played); + if (ServerUtilitiesConfigTops.first_joined.getAsBoolean()) addTop(Top.first_joined); + if (ServerUtilitiesConfigTops.deaths.getAsBoolean()) addTop(Top.deaths); + if (ServerUtilitiesConfigTops.deaths_ph.getAsBoolean()) addTop(Top.deaths_ph); + if (ServerUtilitiesConfigTops.last_seen.getAsBoolean()) addTop(Top.last_seen); + if (ServerUtilitiesConfigTops.time_played.getAsBoolean()) addTop(Top.time_played); - new EventFTBUServerGuide(this, self).post(); + new EventServerUtilitiesServerGuide(this, self).post(); GuidePage page = getSub("commands").setTitle(new ChatComponentText("Commands")); // LANG page.clear(); try { - for (ICommand c : FTBLib.getAllCommands(self.getPlayer())) { + for (ICommand c : ServerUtilitiesLib.getAllCommands(self.getPlayer())) { try { GuidePage cat = new GuidePage('/' + c.getCommandName()); @@ -152,7 +152,7 @@ public ServerGuideFile(LMPlayerServer pself) { cc.getChatStyle().setColor(EnumChatFormatting.DARK_RED); page.getSub('/' + c.getCommandName()).setTitle(cc).printlnText("Errored"); - if (FTBLib.DEV_ENV) ex1.printStackTrace(); + if (ServerUtilitiesLib.DEV_ENV) ex1.printStackTrace(); } } } catch (Exception ex) { @@ -204,7 +204,7 @@ public void addTop(Top t) { IChatComponent c = new ChatComponentText(sb.toString()); if (p == self) c.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); else if (j < 3) c.getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE); - if (data instanceof IChatComponent) c.appendSibling(FTBLib.getChatComponent(data)); + if (data instanceof IChatComponent) c.appendSibling(ServerUtilitiesLib.getChatComponent(data)); thisTop.println(c); } } diff --git a/src/main/java/serverutils/utils/api/guide/ServerUtilitiesClientGuide.java b/src/main/java/serverutils/utils/api/guide/ServerUtilitiesClientGuide.java new file mode 100644 index 00000000..032adb6b --- /dev/null +++ b/src/main/java/serverutils/utils/api/guide/ServerUtilitiesClientGuide.java @@ -0,0 +1,12 @@ +package serverutils.utils.api.guide; + +import serverutils.lib.api.EventLM; + +public class ServerUtilitiesClientGuide extends EventLM { + + public final ClientGuideFile file; + + public ServerUtilitiesClientGuide(ClientGuideFile f) { + file = f; + } +} diff --git a/src/main/java/ftb/utils/api/guide/Top.java b/src/main/java/serverutils/utils/api/guide/Top.java similarity index 86% rename from src/main/java/ftb/utils/api/guide/Top.java rename to src/main/java/serverutils/utils/api/guide/Top.java index f4f63179..8ee95cb4 100644 --- a/src/main/java/ftb/utils/api/guide/Top.java +++ b/src/main/java/serverutils/utils/api/guide/Top.java @@ -1,13 +1,13 @@ -package ftb.utils.api.guide; +package serverutils.utils.api.guide; import java.util.Comparator; import net.minecraft.util.IChatComponent; -import ftb.lib.mod.FTBLibMod; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; import latmod.lib.*; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public abstract class Top implements Comparator { @@ -16,7 +16,7 @@ public abstract class Top implements Comparator { public Top(String s) { ID = s; - title = FTBU.mod.chatComponent("top." + s); + title = ServerUtilities.mod.chatComponent("top." + s); } public abstract Object getData(LMPlayerServer p); @@ -63,7 +63,7 @@ public int compare(LMPlayerServer o1, LMPlayerServer o2) { } public Object getData(LMPlayerServer p) { - if (p.isOnline()) return FTBLibMod.mod.chatComponent("label.online"); + if (p.isOnline()) return ServerUtilitiesLibraryMod.mod.chatComponent("label.online"); return LMStringUtils.getTimeString(LMUtils.millis() - p.stats.lastSeen); } }; diff --git a/src/main/java/ftb/utils/api/guide/lines/GuideExtendedTextLine.java b/src/main/java/serverutils/utils/api/guide/lines/GuideExtendedTextLine.java similarity index 90% rename from src/main/java/ftb/utils/api/guide/lines/GuideExtendedTextLine.java rename to src/main/java/serverutils/utils/api/guide/lines/GuideExtendedTextLine.java index 347de0a7..c5eb6ea3 100644 --- a/src/main/java/ftb/utils/api/guide/lines/GuideExtendedTextLine.java +++ b/src/main/java/serverutils/utils/api/guide/lines/GuideExtendedTextLine.java @@ -1,4 +1,4 @@ -package ftb.utils.api.guide.lines; +package serverutils.utils.api.guide.lines; import java.util.*; @@ -8,11 +8,11 @@ import com.google.gson.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.JsonHelper; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.notification.ClickAction; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.gui.guide.*; +import serverutils.lib.JsonHelper; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.notification.ClickAction; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.gui.guide.*; /** * Created by LatvianModder on 20.03.2016. @@ -61,7 +61,7 @@ public boolean hasClickAction() { @SideOnly(Side.CLIENT) public void onClicked() { if (clickAction != null) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); clickAction.onClicked(); } } diff --git a/src/main/java/ftb/utils/api/guide/lines/GuideImageLine.java b/src/main/java/serverutils/utils/api/guide/lines/GuideImageLine.java similarity index 82% rename from src/main/java/ftb/utils/api/guide/lines/GuideImageLine.java rename to src/main/java/serverutils/utils/api/guide/lines/GuideImageLine.java index f50b0e62..e773e9aa 100644 --- a/src/main/java/ftb/utils/api/guide/lines/GuideImageLine.java +++ b/src/main/java/serverutils/utils/api/guide/lines/GuideImageLine.java @@ -1,4 +1,4 @@ -package ftb.utils.api.guide.lines; +package serverutils.utils.api.guide.lines; import java.awt.image.BufferedImage; import java.io.File; @@ -11,11 +11,11 @@ import com.google.gson.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.gui.guide.*; import latmod.lib.LMUtils; +import serverutils.lib.*; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.gui.guide.*; /** * Created by LatvianModder on 23.03.2016. @@ -39,11 +39,12 @@ public TextureCoords getImage() { texture = TextureCoords.nullTexture; try { - File file = new File(FTBLib.folderModpack, "images/" + imageURL); - if (FTBLib.DEV_ENV) FTBLib.dev_logger.info("Loading Guide image: " + file.getAbsolutePath()); + File file = new File(ServerUtilitiesLib.folderModpack, "images/" + imageURL); + if (ServerUtilitiesLib.DEV_ENV) + ServerUtilitiesLib.dev_logger.info("Loading Guide image: " + file.getAbsolutePath()); BufferedImage img = ImageIO.read(file); - ResourceLocation tex = FTBLibClient.mc.getTextureManager() - .getDynamicTextureLocation("ftbu_guide/" + imageURL, new DynamicTexture(img)); + ResourceLocation tex = ServerUtilitiesLibraryClient.mc.getTextureManager() + .getDynamicTextureLocation("serverutils_guide/" + imageURL, new DynamicTexture(img)); texture = new TextureCoords(tex, 0D, 0D, img.getWidth(), img.getHeight(), img.getWidth(), img.getHeight()); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/ftb/utils/api/guide/lines/GuideTextLine.java b/src/main/java/serverutils/utils/api/guide/lines/GuideTextLine.java similarity index 90% rename from src/main/java/ftb/utils/api/guide/lines/GuideTextLine.java rename to src/main/java/serverutils/utils/api/guide/lines/GuideTextLine.java index 4287c8b6..ab445283 100644 --- a/src/main/java/ftb/utils/api/guide/lines/GuideTextLine.java +++ b/src/main/java/serverutils/utils/api/guide/lines/GuideTextLine.java @@ -1,12 +1,12 @@ -package ftb.utils.api.guide.lines; +package serverutils.utils.api.guide.lines; import net.minecraft.util.*; import com.google.gson.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.gui.guide.*; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.gui.guide.*; /** * Created by LatvianModder on 20.03.2016. diff --git a/src/main/java/ftb/utils/badges/Badge.java b/src/main/java/serverutils/utils/badges/Badge.java similarity index 77% rename from src/main/java/ftb/utils/badges/Badge.java rename to src/main/java/serverutils/utils/badges/Badge.java index 4cbe3e9b..ce493c21 100644 --- a/src/main/java/ftb/utils/badges/Badge.java +++ b/src/main/java/serverutils/utils/badges/Badge.java @@ -1,4 +1,4 @@ -package ftb.utils.badges; +package serverutils.utils.badges; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -7,13 +7,13 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.*; -import ftb.lib.api.gui.GuiLM; import latmod.lib.util.FinalIDObject; +import serverutils.lib.api.client.*; +import serverutils.lib.api.gui.GuiLM; public class Badge extends FinalIDObject { - public static final ResourceLocation defTex = new ResourceLocation("ftbu", "textures/failed_badge.png"); + public static final ResourceLocation defTex = new ResourceLocation("serverutils", "textures/failed_badge.png"); public static final Badge emptyBadge = new Badge("-", null); // -- // @@ -35,8 +35,8 @@ public ResourceLocation getTexture() { if (imageURL == null) return null; if (textureURL == null) { - textureURL = new ResourceLocation("ftbu", "textures/badges/" + getID()); - FTBLibClient.getDownloadImage(textureURL, imageURL, defTex, null); + textureURL = new ResourceLocation("serverutils", "textures/badges/" + getID()); + ServerUtilitiesLibraryClient.getDownloadImage(textureURL, imageURL, defTex, null); } return textureURL; @@ -53,8 +53,8 @@ public void onPlayerRender(EntityPlayer ep) { GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - FTBLibClient.setTexture(texture); - FTBLibClient.pushMaxBrightness(); + ServerUtilitiesLibraryClient.setTexture(texture); + ServerUtilitiesLibraryClient.pushMaxBrightness(); GlStateManager.pushMatrix(); if (ep.isSneaking()) GlStateManager.rotate(25F, 1F, 0F, 0F); @@ -68,7 +68,7 @@ public void onPlayerRender(EntityPlayer ep) { GlStateManager.color(1F, 1F, 1F, 1F); GuiLM.drawTexturedRectD(0D, 0D, 0D, 0.2D, 0.2D, 0D, 0D, 1D, 1D); - FTBLibClient.popMaxBrightness(); + ServerUtilitiesLibraryClient.popMaxBrightness(); GlStateManager.popMatrix(); } } diff --git a/src/main/java/ftb/utils/badges/BadgeRenderer.java b/src/main/java/serverutils/utils/badges/BadgeRenderer.java similarity index 70% rename from src/main/java/ftb/utils/badges/BadgeRenderer.java rename to src/main/java/serverutils/utils/badges/BadgeRenderer.java index bd16a6c8..4717a171 100644 --- a/src/main/java/ftb/utils/badges/BadgeRenderer.java +++ b/src/main/java/serverutils/utils/badges/BadgeRenderer.java @@ -1,12 +1,12 @@ -package ftb.utils.badges; +package serverutils.utils.badges; import net.minecraftforge.client.event.RenderPlayerEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.utils.mod.client.FTBUClient; -import ftb.utils.world.*; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.utils.mod.client.ServerUtilitiesClient; +import serverutils.utils.world.*; @SideOnly(Side.CLIENT) public class BadgeRenderer { @@ -15,7 +15,8 @@ public class BadgeRenderer { @SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Specials.Post e) { - if (FTBLibClient.isIngameWithFTBU() && FTBUClient.render_badges.getAsBoolean() + if (ServerUtilitiesLibraryClient.isIngameWithServerUtilities() + && ServerUtilitiesClient.render_badges.getAsBoolean() && !e.entityPlayer.isInvisible()) { Badge b = ClientBadges.getClientBadge(e.entityPlayer.getGameProfile().getId()); diff --git a/src/main/java/ftb/utils/badges/ClientBadges.java b/src/main/java/serverutils/utils/badges/ClientBadges.java similarity index 93% rename from src/main/java/ftb/utils/badges/ClientBadges.java rename to src/main/java/serverutils/utils/badges/ClientBadges.java index c7356953..e966f43f 100644 --- a/src/main/java/ftb/utils/badges/ClientBadges.java +++ b/src/main/java/serverutils/utils/badges/ClientBadges.java @@ -1,8 +1,8 @@ -package ftb.utils.badges; +package serverutils.utils.badges; import java.util.*; -import ftb.utils.net.MessageRequestBadge; +import serverutils.utils.net.MessageRequestBadge; /** * Created by LatvianModder on 07.01.2016. diff --git a/src/main/java/ftb/utils/badges/ServerBadges.java b/src/main/java/serverutils/utils/badges/ServerBadges.java similarity index 88% rename from src/main/java/ftb/utils/badges/ServerBadges.java rename to src/main/java/serverutils/utils/badges/ServerBadges.java index 42ec5367..5665009f 100644 --- a/src/main/java/ftb/utils/badges/ServerBadges.java +++ b/src/main/java/serverutils/utils/badges/ServerBadges.java @@ -1,4 +1,4 @@ -package ftb.utils.badges; +package serverutils.utils.badges; import java.io.File; import java.util.*; @@ -7,13 +7,13 @@ import com.google.gson.*; -import ftb.lib.FTBLib; -import ftb.utils.mod.FTBU; -import ftb.utils.net.MessageUpdateBadges; -import ftb.utils.world.*; import latmod.lib.*; import latmod.lib.net.*; import latmod.lib.util.Phase; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.net.MessageUpdateBadges; +import serverutils.utils.world.*; public class ServerBadges { @@ -51,7 +51,7 @@ public void run() { } try { - File file = LMFileUtils.newFile(new File(FTBLib.folderLocal, "badges.json")); + File file = LMFileUtils.newFile(new File(ServerUtilitiesLib.folderLocal, "badges.json")); local = LMJsonUtils.fromJson(file); if (local.isJsonNull()) { @@ -70,7 +70,8 @@ public void run() { loadBadges(global, Phase.POST); loadBadges(local, Phase.POST); - FTBU.logger.info("Loaded " + map.size() + " badges in " + (LMUtils.millis() - msStarted) + " ms!"); + ServerUtilities.logger + .info("Loaded " + map.size() + " badges in " + (LMUtils.millis() - msStarted) + " ms!"); isDone = true; } } diff --git a/src/main/java/serverutils/utils/mod/ServerUtilities.java b/src/main/java/serverutils/utils/mod/ServerUtilities.java new file mode 100644 index 00000000..725dce8e --- /dev/null +++ b/src/main/java/serverutils/utils/mod/ServerUtilities.java @@ -0,0 +1,100 @@ +package serverutils.utils.mod; + +import java.util.Map; + +import net.minecraft.entity.player.EntityPlayerMP; + +import org.apache.logging.log4j.*; + +import cpw.mods.fml.common.*; +import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.relauncher.Side; +import serverutils.lib.*; +import serverutils.utils.mod.cmd.*; +import serverutils.utils.mod.cmd.admin.CmdAdmin; +import serverutils.utils.mod.config.*; +import serverutils.utils.mod.handlers.*; +import serverutils.utils.net.ServerUtilitiesNetHandler; +import serverutils.utils.world.Backups; + +@Mod( + modid = ServerUtilitiesFinals.MOD_ID, + version = ServerUtilitiesFinals.MOD_VERSION, + name = ServerUtilitiesFinals.MOD_NAME, + dependencies = ServerUtilitiesFinals.MOD_DEP, + acceptedMinecraftVersions = "1.7.10") +public class ServerUtilities { + + @Mod.Instance(ServerUtilitiesFinals.MOD_ID) + public static ServerUtilities inst; + + @SidedProxy( + clientSide = "serverutils.utils.mod.client.ServerUtilitiesClient", + serverSide = "serverutils.utils.mod.ServerUtilitiesCommon") + public static ServerUtilitiesCommon proxy; + + @SidedProxy( + clientSide = "serverutils.utils.mod.handlers.serverlib.ServerUtilitiesLibraryIntegrationClient", + serverSide = "serverutils.utils.mod.handlers.serverlib.ServerUtilitiesLibraryIntegration") + public static serverutils.utils.mod.handlers.serverlib.ServerUtilitiesLibraryIntegration serverutillib_int; + + public static LMMod mod; + + public static Logger logger; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent e) { + mod = LMMod.create(ServerUtilitiesFinals.MOD_ID); + ServerUtilitiesLib.serverUtilitiesIntegration = serverutillib_int; + logger = LogManager.getLogger(ServerUtilitiesFinals.MOD_ID); + + ServerUtilitiesConfig.load(); + + EventBusHelper.register(new ServerUtilitiesPlayerEventHandler()); + EventBusHelper.register(new ServerUtiltiesWorldEventHandler()); + EventBusHelper.register(new ServerUtilitiesChatEventHandler()); + ServerUtilitiesChunkEventHandler.instance.init(); + + ServerUtilitiesNetHandler.init(); + Backups.init(); + proxy.preInit(); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent e) { + proxy.postInit(); + } + + @Mod.EventHandler + public void registerCommands(FMLServerStartingEvent e) { + ServerUtilitiesLib.addCommand(e, new CmdAdmin()); + ServerUtilitiesLib.addCommand(e, new CmdLMPlayerSettings()); + + if (ServerUtilitiesConfigCmd.back.getAsBoolean()) ServerUtilitiesLib.addCommand(e, new CmdBack()); + if (ServerUtilitiesConfigCmd.spawn.getAsBoolean()) ServerUtilitiesLib.addCommand(e, new CmdSpawn()); + if (ServerUtilitiesConfigCmd.tplast.getAsBoolean()) ServerUtilitiesLib.addCommand(e, new CmdTplast()); + if (ServerUtilitiesConfigCmd.warp.getAsBoolean()) ServerUtilitiesLib.addCommand(e, new CmdWarp()); + + if (ServerUtilitiesConfigCmd.home.getAsBoolean()) { + ServerUtilitiesLib.addCommand(e, new CmdSetHome()); + ServerUtilitiesLib.addCommand(e, new CmdHome()); + ServerUtilitiesLib.addCommand(e, new CmdDelHome()); + } + } + + @Mod.EventHandler + public void serverStopping(FMLServerStoppingEvent e) { + if (ServerUtilitiesLib.hasOnlinePlayers()) { + for (EntityPlayerMP ep : ServerUtilitiesLib.getAllOnlinePlayers(null)) { + ServerUtilitiesPlayerEventHandler.playerLoggedOut(ep); + } + } + } + + @NetworkCheckHandler + public boolean checkNetwork(Map m, Side side) { + String s = m.get(ServerUtilitiesFinals.MOD_ID); + return s == null || s.equals(ServerUtilitiesFinals.MOD_VERSION); + } +} diff --git a/src/main/java/ftb/utils/mod/FTBUCommon.java b/src/main/java/serverutils/utils/mod/ServerUtilitiesCommon.java similarity index 55% rename from src/main/java/ftb/utils/mod/FTBUCommon.java rename to src/main/java/serverutils/utils/mod/ServerUtilitiesCommon.java index fd8bc24a..1437df63 100644 --- a/src/main/java/ftb/utils/mod/FTBUCommon.java +++ b/src/main/java/serverutils/utils/mod/ServerUtilitiesCommon.java @@ -1,9 +1,8 @@ -package ftb.utils.mod; +package serverutils.utils.mod; -import ftb.utils.world.LMWorld; +import serverutils.utils.world.LMWorld; -public class FTBUCommon // FTBUClient -{ +public class ServerUtilitiesCommon { public void preInit() {} diff --git a/src/main/java/serverutils/utils/mod/ServerUtilitiesFinals.java b/src/main/java/serverutils/utils/mod/ServerUtilitiesFinals.java new file mode 100644 index 00000000..28f9acbf --- /dev/null +++ b/src/main/java/serverutils/utils/mod/ServerUtilitiesFinals.java @@ -0,0 +1,9 @@ +package serverutils.utils.mod; + +public class ServerUtilitiesFinals { + + public static final String MOD_ID = "ServerUtilities"; + public static final String MOD_VERSION = "GRADLETOKEN_VERSION"; + public static final String MOD_NAME = "ServerUtilities"; + public static final String MOD_DEP = "required-after:ServerUtilitiesLibrary;after:Baubles;after:Waila"; +} diff --git a/src/main/java/ftb/utils/mod/FTBUGuiHandler.java b/src/main/java/serverutils/utils/mod/ServerUtilsGuiHandler.java similarity index 63% rename from src/main/java/ftb/utils/mod/FTBUGuiHandler.java rename to src/main/java/serverutils/utils/mod/ServerUtilsGuiHandler.java index 66865526..801227eb 100644 --- a/src/main/java/ftb/utils/mod/FTBUGuiHandler.java +++ b/src/main/java/serverutils/utils/mod/ServerUtilsGuiHandler.java @@ -1,4 +1,4 @@ -package ftb.utils.mod; +package serverutils.utils.mod; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; @@ -6,20 +6,20 @@ import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.gui.*; -import ftb.utils.mod.client.gui.claims.GuiClaimChunks; -import ftb.utils.mod.client.gui.friends.GuideFriendsGUI; -import ftb.utils.mod.client.gui.guide.GuiGuide; +import serverutils.lib.api.gui.*; +import serverutils.utils.mod.client.gui.claims.GuiClaimChunks; +import serverutils.utils.mod.client.gui.friends.GuideFriendsGUI; +import serverutils.utils.mod.client.gui.guide.GuiGuide; -public class FTBUGuiHandler extends LMGuiHandler { +public class ServerUtilsGuiHandler extends LMGuiHandler { - public static final FTBUGuiHandler instance = new FTBUGuiHandler(FTBUFinals.MOD_ID); + public static final ServerUtilsGuiHandler instance = new ServerUtilsGuiHandler(ServerUtilitiesFinals.MOD_ID); public static final int FRIENDS = 1; public static final int SECURITY = 2; public static final int ADMIN_CLAIMS = 3; - public FTBUGuiHandler(String s) { + public ServerUtilsGuiHandler(String s) { super(s); } diff --git a/src/main/java/ftb/utils/mod/FTBUTicks.java b/src/main/java/serverutils/utils/mod/ServerUtilsTicks.java similarity index 64% rename from src/main/java/ftb/utils/mod/FTBUTicks.java rename to src/main/java/serverutils/utils/mod/ServerUtilsTicks.java index af925fd2..d7c3c3da 100644 --- a/src/main/java/ftb/utils/mod/FTBUTicks.java +++ b/src/main/java/serverutils/utils/mod/ServerUtilsTicks.java @@ -1,16 +1,16 @@ -package ftb.utils.mod; +package serverutils.utils.mod; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.utils.badges.ServerBadges; -import ftb.utils.mod.cmd.admin.CmdRestart; -import ftb.utils.mod.config.*; -import ftb.utils.mod.handlers.FTBUChunkEventHandler; -import ftb.utils.world.Backups; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.utils.badges.ServerBadges; +import serverutils.utils.mod.cmd.admin.CmdRestart; +import serverutils.utils.mod.config.*; +import serverutils.utils.mod.handlers.ServerUtilitiesChunkEventHandler; +import serverutils.utils.world.Backups; -public class FTBUTicks { +public class ServerUtilsTicks { public static long nextChunkloaderUpdate = 0L; @@ -20,11 +20,12 @@ public class FTBUTicks { public static void serverStarted() { startMillis = LMUtils.millis(); - Backups.nextBackup = startMillis + FTBUConfigBackups.backupMillis(); + Backups.nextBackup = startMillis + ServerUtilitiesConfigBackups.backupMillis(); - if (FTBUConfigGeneral.restart_timer.getAsDouble() > 0D) { - restartMillis = startMillis + (long) (FTBUConfigGeneral.restart_timer.getAsDouble() * 3600D * 1000D); - FTBU.logger.info("Server restart in " + LMStringUtils.getTimeString(restartMillis)); + if (ServerUtilitiesConfigGeneral.restart_timer.getAsDouble() > 0D) { + restartMillis = startMillis + + (long) (ServerUtilitiesConfigGeneral.restart_timer.getAsDouble() * 3600D * 1000D); + ServerUtilities.logger.info("Server restart in " + LMStringUtils.getTimeString(restartMillis)); } nextChunkloaderUpdate = startMillis + 10000L; @@ -53,21 +54,21 @@ public static void update() { || secondsLeft == 300 || secondsLeft == 600 || secondsLeft == 1800) { - IChatComponent c = FTBU.mod.chatComponent("server_restart", msg); + IChatComponent c = ServerUtilities.mod.chatComponent("server_restart", msg); c.getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE); - FTBLib.printChat(BroadcastSender.inst, c); + ServerUtilitiesLib.printChat(BroadcastSender.inst, c); } } } } if (Backups.nextBackup > 0L && Backups.nextBackup <= now) { - Backups.run(FTBLib.getServer()); + Backups.run(ServerUtilitiesLib.getServer()); } if (nextChunkloaderUpdate < now) { nextChunkloaderUpdate = now + 30000L; - FTBUChunkEventHandler.instance.markDirty(null); + ServerUtilitiesChunkEventHandler.instance.markDirty(null); } if (Backups.thread != null && Backups.thread.isDone) { diff --git a/src/main/java/ftb/utils/mod/client/FTBUActions.java b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesActions.java similarity index 69% rename from src/main/java/ftb/utils/mod/client/FTBUActions.java rename to src/main/java/serverutils/utils/mod/client/ServerUtilitiesActions.java index 76762cfb..c0f32855 100644 --- a/src/main/java/ftb/utils/mod/client/FTBUActions.java +++ b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesActions.java @@ -1,21 +1,21 @@ -package ftb.utils.mod.client; +package serverutils.utils.mod.client; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import cpw.mods.fml.relauncher.*; -import ftb.lib.*; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.gui.*; -import ftb.utils.mod.client.gui.claims.GuiClaimChunks; -import ftb.utils.mod.client.gui.friends.GuideFriendsGUI; -import ftb.utils.mod.client.gui.guide.GuiGuide; -import ftb.utils.net.ClientAction; - -public class FTBUActions { +import serverutils.lib.*; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.gui.*; +import serverutils.utils.mod.client.gui.claims.GuiClaimChunks; +import serverutils.utils.mod.client.gui.friends.GuideFriendsGUI; +import serverutils.utils.mod.client.gui.guide.GuiGuide; +import serverutils.utils.net.ClientAction; + +public class ServerUtilitiesActions { @SideOnly(Side.CLIENT) public static void init() { @@ -28,7 +28,7 @@ public static void init() { PlayerActionRegistry.add(friend_remove); PlayerActionRegistry.add(friend_deny); - if (FTBLib.DEV_ENV) { + if (ServerUtilitiesLib.DEV_ENV) { PlayerActionRegistry.add(mail); PlayerActionRegistry.add(trade); } @@ -64,7 +64,7 @@ public GuiScreen openGui(EntityPlayer ep) { /* * GuiScreenRegistry.register("trade", new GuiScreenRegistry.Entry() { public GuiScreen openGui(EntityPlayer ep) - * { return FTBLibClient.mc.currentScreen; } }); + * { return ServerUtilitiesLibraryClient.mc.currentScreen; } }); */ } @@ -72,16 +72,16 @@ public GuiScreen openGui(EntityPlayer ep) { public static final PlayerAction friends_gui = new PlayerAction( PlayerAction.Type.SELF, - "ftbu.friends_gui", + "serverutils.friends_gui", 950, - TextureCoords.getSquareIcon(new ResourceLocation("ftbu", "textures/gui/friendsbutton.png"), 256)) { + TextureCoords.getSquareIcon(new ResourceLocation("serverutils", "textures/gui/friendsbutton.png"), 256)) { public void onClicked(ILMPlayer self, ILMPlayer other) { - FTBLibClient.openGui(new GuiGuide(null, new GuideFriendsGUI())); + ServerUtilitiesLibraryClient.openGui(new GuiGuide(null, new GuideFriendsGUI())); } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU(); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities(); } public String getDisplayName() { @@ -89,15 +89,19 @@ public String getDisplayName() { } }; - public static final PlayerAction guide = new PlayerAction(PlayerAction.Type.SELF, "ftbu.guide", 0, GuiIcons.book) { + public static final PlayerAction guide = new PlayerAction( + PlayerAction.Type.SELF, + "serverutils.guide", + 0, + GuiIcons.book) { public void onClicked(ILMPlayer self, ILMPlayer other) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); GuiGuide.openClientGui(true); } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU(); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities(); } public Boolean configDefault() { @@ -107,7 +111,7 @@ public Boolean configDefault() { public static final PlayerAction info = new PlayerAction( PlayerAction.Type.SELF, - "ftbu.server_info", + "serverutils.server_info", 0, GuiIcons.book_red) { @@ -116,7 +120,7 @@ public void onClicked(ILMPlayer self, ILMPlayer other) { } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU(); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities(); } public Boolean configDefault() { @@ -126,16 +130,16 @@ public Boolean configDefault() { public static final PlayerAction claims = new PlayerAction( PlayerAction.Type.SELF, - "ftbu.claimed_chunks", + "serverutils.claimed_chunks", 0, GuiIcons.map) { public void onClicked(ILMPlayer self, ILMPlayer other) { - FTBLibClient.openGui(new GuiClaimChunks(0L)); + ServerUtilitiesLibraryClient.openGui(new GuiClaimChunks(0L)); } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU(); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities(); } public Boolean configDefault() { @@ -145,14 +149,14 @@ public Boolean configDefault() { public static final PlayerAction trade = new PlayerAction( PlayerAction.Type.SELF, - "ftbu.trade", + "serverutils.trade", 0, GuiIcons.money_bag) { public void onClicked(ILMPlayer owner, ILMPlayer player) {} public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLib.DEV_ENV; + return ServerUtilitiesLib.DEV_ENV; } public Boolean configDefault() { @@ -164,7 +168,7 @@ public Boolean configDefault() { public static final PlayerAction friend_add = new PlayerAction( PlayerAction.Type.OTHER, - "ftbu.add_friend", + "serverutils.add_friend", 1, GuiIcons.add) { @@ -173,13 +177,13 @@ public void onClicked(ILMPlayer self, ILMPlayer other) { } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU() && !self.isFriendRaw(other); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities() && !self.isFriendRaw(other); } }; public static final PlayerAction friend_remove = new PlayerAction( PlayerAction.Type.OTHER, - "ftbu.rem_friend", + "serverutils.rem_friend", -1, GuiIcons.remove) { @@ -188,13 +192,13 @@ public void onClicked(ILMPlayer self, ILMPlayer other) { } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU() && self.isFriendRaw(other); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities() && self.isFriendRaw(other); } }; public static final PlayerAction friend_deny = new PlayerAction( PlayerAction.Type.OTHER, - "ftbu.deny_friend", + "serverutils.deny_friend", -1, GuiIcons.remove) { @@ -203,20 +207,21 @@ public void onClicked(ILMPlayer self, ILMPlayer other) { } public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLibClient.isIngameWithFTBU() && !self.isFriendRaw(other) && other.isFriendRaw(self); + return ServerUtilitiesLibraryClient.isIngameWithServerUtilities() && !self.isFriendRaw(other) + && other.isFriendRaw(self); } }; public static final PlayerAction mail = new PlayerAction( PlayerAction.Type.OTHER, - "ftbu.mail", + "serverutils.mail", 0, GuiIcons.feather) { public void onClicked(ILMPlayer self, ILMPlayer other) {} public boolean isVisibleFor(ILMPlayer self, ILMPlayer other) { - return FTBLib.DEV_ENV; + return ServerUtilitiesLib.DEV_ENV; } }; } diff --git a/src/main/java/ftb/utils/mod/client/FTBUClickAction.java b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesClickAction.java similarity index 80% rename from src/main/java/ftb/utils/mod/client/FTBUClickAction.java rename to src/main/java/serverutils/utils/mod/client/ServerUtilitiesClickAction.java index 00f5e032..93fc021a 100644 --- a/src/main/java/ftb/utils/mod/client/FTBUClickAction.java +++ b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesClickAction.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.client; +package serverutils.utils.mod.client; import com.google.gson.JsonElement; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.notification.*; -import ftb.utils.net.ClientAction; +import serverutils.lib.api.notification.*; +import serverutils.utils.net.ClientAction; -public class FTBUClickAction { +public class ServerUtilitiesClickAction { public static void init() { ClickActionRegistry.add(FRIEND_ADD); diff --git a/src/main/java/serverutils/utils/mod/client/ServerUtilitiesClient.java b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesClient.java new file mode 100644 index 00000000..2b35aa3f --- /dev/null +++ b/src/main/java/serverutils/utils/mod/client/ServerUtilitiesClient.java @@ -0,0 +1,40 @@ +package serverutils.utils.mod.client; + +import net.minecraftforge.client.ClientCommandHandler; + +import cpw.mods.fml.relauncher.*; +import serverutils.lib.EventBusHelper; +import serverutils.lib.api.config.*; +import serverutils.lib.api.gui.LMGuiHandlerRegistry; +import serverutils.utils.badges.BadgeRenderer; +import serverutils.utils.mod.*; +import serverutils.utils.mod.client.gui.guide.ClientSettings; +import serverutils.utils.mod.cmd.CmdMath; +import serverutils.utils.world.*; + +@SideOnly(Side.CLIENT) +public class ServerUtilitiesClient extends ServerUtilitiesCommon { + + public static final ConfigEntryBool render_badges = new ConfigEntryBool("render_badges", true); + + public static final ConfigEntryBool sort_friends_az = new ConfigEntryBool("sort_friends_az", false); + public static final ConfigEntryBool loaded_chunks_space_key = new ConfigEntryBool("loaded_chunks_space_key", false); + + public void preInit() { + ClientConfigRegistry.addGroup("serverutils", ServerUtilitiesClient.class); + ClientConfigRegistry.addGroup("serverutils_guide", ClientSettings.class); + ClientCommandHandler.instance.registerCommand(new CmdMath()); + ServerUtilitiesActions.init(); + } + + public void postInit() { + LMGuiHandlerRegistry.add(ServerUtilsGuiHandler.instance); + ServerUtilitiesClickAction.init(); + + EventBusHelper.register(BadgeRenderer.instance); + } + + public LMWorld getClientWorldLM() { + return LMWorldClient.inst; + } +} diff --git a/src/main/java/ftb/utils/mod/client/gui/claims/ClaimedAreasClient.java b/src/main/java/serverutils/utils/mod/client/gui/claims/ClaimedAreasClient.java similarity index 92% rename from src/main/java/ftb/utils/mod/client/gui/claims/ClaimedAreasClient.java rename to src/main/java/serverutils/utils/mod/client/gui/claims/ClaimedAreasClient.java index 72b17362..1759b8f6 100644 --- a/src/main/java/ftb/utils/mod/client/gui/claims/ClaimedAreasClient.java +++ b/src/main/java/serverutils/utils/mod/client/gui/claims/ClaimedAreasClient.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.client.gui.claims; +package serverutils.utils.mod.client.gui.claims; import java.util.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.world.*; -import ftb.utils.world.claims.*; import latmod.lib.Bits; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.*; @SideOnly(Side.CLIENT) public class ClaimedAreasClient { diff --git a/src/main/java/ftb/utils/mod/client/gui/claims/GuiClaimChunks.java b/src/main/java/serverutils/utils/mod/client/gui/claims/GuiClaimChunks.java similarity index 80% rename from src/main/java/ftb/utils/mod/client/gui/claims/GuiClaimChunks.java rename to src/main/java/serverutils/utils/mod/client/gui/claims/GuiClaimChunks.java index 7a6c2f07..97e6a094 100644 --- a/src/main/java/ftb/utils/mod/client/gui/claims/GuiClaimChunks.java +++ b/src/main/java/serverutils/utils/mod/client/gui/claims/GuiClaimChunks.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.client.gui.claims; +package serverutils.utils.mod.client.gui.claims; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -16,23 +16,23 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ftb.lib.TextureCoords; -import ftb.lib.api.FTBLibLang; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiIcons; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.lib.api.gui.widgets.PanelLM; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.client.FTBUClient; -import ftb.utils.net.ClientAction; -import ftb.utils.net.MessageAreaRequest; -import ftb.utils.net.MessageClaimChunk; -import ftb.utils.world.LMPlayerClientSelf; -import ftb.utils.world.LMWorldClient; -import ftb.utils.world.claims.ChunkType; import latmod.lib.MathHelperLM; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.ServerUtilitiesLibLang; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.GuiIcons; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.lib.api.gui.widgets.PanelLM; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.client.ServerUtilitiesClient; +import serverutils.utils.net.ClientAction; +import serverutils.utils.net.MessageAreaRequest; +import serverutils.utils.net.MessageClaimChunk; +import serverutils.utils.world.LMPlayerClientSelf; +import serverutils.utils.world.LMWorldClient; +import serverutils.utils.world.claims.ChunkType; @SideOnly(Side.CLIENT) public class GuiClaimChunks extends GuiLM implements GuiYesNoCallback // implements IClientActionGui @@ -41,8 +41,12 @@ public class GuiClaimChunks extends GuiLM implements GuiYesNoCallback // impleme public static final int tiles_tex = 16; public static final int tiles_gui = 15; public static final double UV = (double) tiles_gui / (double) tiles_tex; - public static final ResourceLocation tex_area = new ResourceLocation("ftbu", "textures/map/minimap_area.png"); - public static final ResourceLocation tex_map_entity = new ResourceLocation("ftbu", "textures/map/entity.png"); + public static final ResourceLocation tex_area = new ResourceLocation( + "serverutils", + "textures/map/minimap_area.png"); + public static final ResourceLocation tex_map_entity = new ResourceLocation( + "serverutils", + "textures/map/entity.png"); public static final TextureCoords[][][][] tex_area_coords = new TextureCoords[2][2][2][2]; private static final TextureCoords getAreaCoords(int i) { @@ -88,12 +92,12 @@ public GuiClaimChunks(long token) { playerLM = LMWorldClient.inst.clientPlayer; startX = MathHelperLM.chunk(mc.thePlayer.posX) - (int) (tiles_gui * 0.5D); startY = MathHelperLM.chunk(mc.thePlayer.posZ) - (int) (tiles_gui * 0.5D); - currentDim = FTBLibClient.getDim(); + currentDim = ServerUtilitiesLibraryClient.getDim(); buttonClose = new ButtonLM(this, 0, 0, 16, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); gui.close(null); } }; @@ -105,29 +109,30 @@ public void onButtonPressed(int b) { thread.start(); new MessageAreaRequest(startX, startY, tiles_gui, tiles_gui).sendToServer(); ClientAction.REQUEST_SELF_UPDATE.send(0); - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); } }; - buttonRefresh.title = FTBLibLang.button_refresh.format(); + buttonRefresh.title = ServerUtilitiesLibLang.button_refresh.format(); buttonUnclaimAll = new ButtonLM(this, 0, 32, 16, 16) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); - String s = isShiftKeyDown() ? FTBU.mod.translate("button.claims_unclaim_all_q") - : FTBU.mod.translate( + ServerUtilitiesLibraryClient.playClickSound(); + String s = isShiftKeyDown() ? ServerUtilities.mod.translate("button.claims_unclaim_all_q") + : ServerUtilities.mod.translate( "button.claims_unclaim_all_dim_q", - FTBLibClient.mc.theWorld.provider.getDimensionName()); - FTBLibClient.openGui(new GuiYesNo(GuiClaimChunks.this, s, "", isShiftKeyDown() ? 1 : 0)); + ServerUtilitiesLibraryClient.mc.theWorld.provider.getDimensionName()); + ServerUtilitiesLibraryClient + .openGui(new GuiYesNo(GuiClaimChunks.this, s, "", isShiftKeyDown() ? 1 : 0)); } public void addMouseOverText(List l) { - if (isShiftKeyDown()) l.add(FTBU.mod.translate("button.claims_unclaim_all")); + if (isShiftKeyDown()) l.add(ServerUtilities.mod.translate("button.claims_unclaim_all")); else l.add( - FTBU.mod.translate( + ServerUtilities.mod.translate( "button.claims_unclaim_all_dim", - FTBLibClient.mc.theWorld.provider.getDimensionName())); + ServerUtilitiesLibraryClient.mc.theWorld.provider.getDimensionName())); } }; @@ -167,7 +172,8 @@ public void addWidgets() { } public void drawBackground() { - if (currentDim != FTBLibClient.getDim() || !FTBLibClient.isIngameWithFTBU()) { + if (currentDim != ServerUtilitiesLibraryClient.getDim() + || !ServerUtilitiesLibraryClient.isIngameWithServerUtilities()) { mc.thePlayer.closeScreen(); return; } @@ -230,10 +236,11 @@ public void drawBackground() { } public void drawText(List l) { - String s = FTBU.mod + String s = ServerUtilities.mod .translate("label.cchunks_count", (playerLM.claimedChunks + " / " + playerLM.maxClaimedChunks)); fontRendererObj.drawString(s, width - fontRendererObj.getStringWidth(s) - 4, height - 12, 0xFFFFFFFF); - s = FTBU.mod.translate("label.lchunks_count", (playerLM.loadedChunks + " / " + playerLM.maxLoadedChunks)); + s = ServerUtilities.mod + .translate("label.lchunks_count", (playerLM.loadedChunks + " / " + playerLM.maxLoadedChunks)); fontRendererObj.drawString(s, width - fontRendererObj.getStringWidth(s) - 4, height - 24, 0xFFFFFFFF); super.drawText(l); @@ -247,7 +254,7 @@ private ChunkType getType(int cx, int cy) { @SuppressWarnings("unchecked") public void renderMinimap() { - FTBLibClient.setTexture(tex_area); + ServerUtilitiesLibraryClient.setTexture(tex_area); for (int y = 0; y < tiles_gui; y++) for (int x = 0; x < tiles_gui; x++) { int cx = x + startX; @@ -262,7 +269,7 @@ public void renderMinimap() { TextureCoords tc = tex_area_coords[a ? 1 : 0][b ? 1 : 0][c ? 1 : 0][d ? 1 : 0]; - FTBLibClient.setGLColor(type.getAreaColor(playerLM), 255); + ServerUtilitiesLibraryClient.setGLColor(type.getAreaColor(playerLM), 255); GuiLM.drawTexturedRectD( mainPanel.posX + x * 16, mainPanel.posY + y * 16, @@ -276,9 +283,9 @@ public void renderMinimap() { } } - if (!FTBLibClient.mc.theWorld.playerEntities.isEmpty()) { + if (!ServerUtilitiesLibraryClient.mc.theWorld.playerEntities.isEmpty()) { ArrayList list = new ArrayList<>(); - list.addAll(FTBLibClient.mc.theWorld.playerEntities); + list.addAll(ServerUtilitiesLibraryClient.mc.theWorld.playerEntities); for (int i = 0; i < list.size(); i++) { EntityPlayer ep = list.get(i); @@ -296,7 +303,7 @@ public void renderMinimap() { // GlStateManager.rotate((int)((ep.rotationYaw + 180F) / (180F / 8F)) * (180F / 8F), 0F, 0F, // 1F); GlStateManager.rotate(ep.rotationYaw + 180F, 0F, 0F, 1F); - FTBLibClient.setTexture(tex_map_entity); + ServerUtilitiesLibraryClient.setTexture(tex_map_entity); GlStateManager.color(1F, 1F, 1F, ep.isSneaking() ? 0.4F : 0.7F); GuiLM.drawTexturedRectD(-8, -8, zLevel, 16, 16, 0D, 0D, 1D, 1D); GlStateManager.popMatrix(); @@ -322,7 +329,7 @@ public void confirmClicked(boolean set, int id) { new MessageAreaRequest(startX, startY, tiles_gui, tiles_gui).sendToServer(); } - FTBLibClient.openGui(this); + ServerUtilitiesLibraryClient.openGui(this); refreshWidgets(); } @@ -343,7 +350,8 @@ public MapButton(GuiClaimChunks g, int x, int y, int i) { public void onButtonPressed(int b) { if (gui.panelButtons.mouseOver()) return; if (gui.adminToken != 0L && b == 0) return; - boolean ctrl = FTBUClient.loaded_chunks_space_key.getAsBoolean() ? Keyboard.isKeyDown(Keyboard.KEY_SPACE) + boolean ctrl = ServerUtilitiesClient.loaded_chunks_space_key.getAsBoolean() + ? Keyboard.isKeyDown(Keyboard.KEY_SPACE) : isCtrlKeyDown(); new MessageClaimChunk( gui.currentDim, @@ -352,7 +360,7 @@ public void onButtonPressed(int b) { chunkY, (b == 0) ? (ctrl ? MessageClaimChunk.ID_CLAIM_AND_LOAD : MessageClaimChunk.ID_CLAIM) : (ctrl ? MessageClaimChunk.ID_UNLOAD : MessageClaimChunk.ID_UNCLAIM)).sendToServer(); - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); } public void addMouseOverText(List l) { diff --git a/src/main/java/ftb/utils/mod/client/gui/claims/ThreadReloadArea.java b/src/main/java/serverutils/utils/mod/client/gui/claims/ThreadReloadArea.java similarity index 96% rename from src/main/java/ftb/utils/mod/client/gui/claims/ThreadReloadArea.java rename to src/main/java/serverutils/utils/mod/client/gui/claims/ThreadReloadArea.java index 23283e72..4d94a4f6 100644 --- a/src/main/java/ftb/utils/mod/client/gui/claims/ThreadReloadArea.java +++ b/src/main/java/serverutils/utils/mod/client/gui/claims/ThreadReloadArea.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.client.gui.claims; +package serverutils.utils.mod.client.gui.claims; import java.nio.ByteBuffer; import java.util.Arrays; @@ -10,8 +10,8 @@ import net.minecraft.world.chunk.Chunk; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.FTBLibClient; import latmod.lib.*; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; @SideOnly(Side.CLIENT) public class ThreadReloadArea extends Thread { @@ -59,7 +59,7 @@ public void run() { } } - ByteBuffer buffer = FTBLibClient.toByteBuffer(pixels.pixels, false); + ByteBuffer buffer = ServerUtilitiesLibraryClient.toByteBuffer(pixels.pixels, false); GuiClaimChunks.pixelBuffer = buffer; } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUI.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUI.java similarity index 75% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUI.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUI.java index 1624ccc2..7eef88d1 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUI.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUI.java @@ -1,15 +1,15 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import java.util.*; import net.minecraft.util.ChatComponentText; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.friends.*; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.FTBUClient; -import ftb.utils.world.*; import latmod.lib.LMColor; +import serverutils.lib.api.friends.*; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.ServerUtilitiesClient; +import serverutils.utils.world.*; /** * Created by LatvianModder on 23.03.2016. @@ -26,7 +26,8 @@ public GuideFriendsGUI() { tempPlayerList.remove(LMWorldClient.inst.clientPlayer); - if (FTBUClient.sort_friends_az.getAsBoolean()) Collections.sort(tempPlayerList, LMPNameComparator.instance); + if (ServerUtilitiesClient.sort_friends_az.getAsBoolean()) + Collections.sort(tempPlayerList, LMPNameComparator.instance); else Collections.sort(tempPlayerList, new LMPStatusComparator(LMWorldClient.inst.clientPlayer)); addSub(new GuideFriendsGUISelfPage()); diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUIPage.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUIPage.java similarity index 89% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUIPage.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUIPage.java index 3e129644..b026626f 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUIPage.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUIPage.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.*; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.gui.guide.*; -import ftb.utils.net.ClientAction; -import ftb.utils.world.*; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.*; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.gui.guide.*; +import serverutils.utils.net.ClientAction; +import serverutils.utils.world.*; /** * Created by LatvianModder on 24.03.2016. diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java similarity index 78% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java index 576bb146..36b25cac 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuideFriendsGUISelfPage.java @@ -1,18 +1,18 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import net.minecraft.util.*; import com.google.gson.JsonPrimitive; import cpw.mods.fml.relauncher.*; -import ftb.lib.PrivacyLevel; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.gui.PlayerActionRegistry; -import ftb.lib.api.notification.*; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.api.guide.lines.GuideExtendedTextLine; -import ftb.utils.mod.FTBU; -import ftb.utils.world.*; +import serverutils.lib.PrivacyLevel; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.gui.PlayerActionRegistry; +import serverutils.lib.api.notification.*; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.api.guide.lines.GuideExtendedTextLine; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.*; /** * Created by LatvianModder on 24.03.2016. @@ -37,7 +37,7 @@ public void onClientDataChanged() { text.add(new GuidePlayerActionLine(this, playerLM, a)); } - GuidePage page = getSub("info").setTitle(new ChatComponentTranslation("ftbl.button.info")); + GuidePage page = getSub("info").setTitle(new ChatComponentTranslation("serverlib.button.info")); page.text.add(new GuidePlayerViewLine(this, playerLM)); @@ -66,7 +66,8 @@ public void onClientDataChanged() { : EnumChatFormatting.RED)); GuideExtendedTextLine line = new GuideExtendedTextLine( this, - FTBU.mod.chatComponent("player_setting.security_level").appendText(": ").appendSibling(text1)); + ServerUtilities.mod.chatComponent("player_setting.security_level").appendText(": ") + .appendSibling(text1)); line.setClickAction( new ClickAction( ClickActionType.CMD, @@ -79,14 +80,14 @@ private void booleanCommand(String s, boolean current) { text1.getChatStyle().setColor(current ? EnumChatFormatting.GREEN : EnumChatFormatting.RED); GuideExtendedTextLine line = new GuideExtendedTextLine( this, - FTBU.mod.chatComponent("player_setting." + s).appendText(": ").appendSibling(text1)); + ServerUtilities.mod.chatComponent("player_setting." + s).appendText(": ").appendSibling(text1)); line.setClickAction( new ClickAction(ClickActionType.CMD, new JsonPrimitive("lmplayer_settings " + s + " toggle"))); text.add(line); } }; - page.setTitle(new ChatComponentTranslation("ftbl.button.settings")); + page.setTitle(new ChatComponentTranslation("serverlib.button.settings")); page.onClientDataChanged(); addSub(page); } diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerActionLine.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerActionLine.java similarity index 81% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerActionLine.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerActionLine.java index 65c37c41..e353a9ce 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerActionLine.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerActionLine.java @@ -1,15 +1,15 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import java.util.List; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.PlayerAction; -import ftb.lib.api.client.*; -import ftb.lib.api.gui.GuiLM; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.api.guide.lines.GuideTextLine; -import ftb.utils.mod.client.gui.guide.*; -import ftb.utils.world.*; +import serverutils.lib.api.PlayerAction; +import serverutils.lib.api.client.*; +import serverutils.lib.api.gui.GuiLM; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.api.guide.lines.GuideTextLine; +import serverutils.utils.mod.client.gui.guide.*; +import serverutils.utils.world.*; /** * Created by LatvianModder on 23.03.2016. @@ -43,7 +43,7 @@ public ButtonGuidePlayerAction(GuiGuide g, GuidePlayerActionLine w) { public void addMouseOverText(List l) {} public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); action.onClicked(LMWorldClient.inst.clientPlayer, playerLM); } diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java similarity index 86% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java index d29099d7..eae279df 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerInventoryLine.java @@ -1,16 +1,16 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.api.guide.lines.GuideTextLine; -import ftb.utils.mod.client.gui.guide.*; -import ftb.utils.world.LMPlayerClient; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.api.guide.lines.GuideTextLine; +import serverutils.utils.mod.client.gui.guide.*; +import serverutils.utils.world.LMPlayerClient; /** * Created by LatvianModder on 23.03.2016. diff --git a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerViewLine.java b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerViewLine.java similarity index 91% rename from src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerViewLine.java rename to src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerViewLine.java index b8ab67ac..60697e8e 100644 --- a/src/main/java/ftb/utils/mod/client/gui/friends/GuidePlayerViewLine.java +++ b/src/main/java/serverutils/utils/mod/client/gui/friends/GuidePlayerViewLine.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.client.gui.friends; +package serverutils.utils.mod.client.gui.friends; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; @@ -9,11 +9,11 @@ import org.lwjgl.input.Mouse; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.*; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.api.guide.lines.GuideTextLine; -import ftb.utils.mod.client.gui.guide.*; -import ftb.utils.world.LMPlayerClient; +import serverutils.lib.api.client.*; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.api.guide.lines.GuideTextLine; +import serverutils.utils.mod.client.gui.guide.*; +import serverutils.utils.world.LMPlayerClient; /** * Created by LatvianModder on 23.03.2016. @@ -78,7 +78,7 @@ public void renderWidget() { pheight = pheight / 2; - FTBLibClient.setTexture(player.getLocationSkin()); + ServerUtilitiesLibraryClient.setTexture(player.getLocationSkin()); GlStateManager.translate(0F, 0F, 100F); GuiInventory.func_147046_a( playerX, diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java similarity index 88% rename from src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java index bd62648e..0e1cfb11 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideExtendedTextLine.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; import java.util.*; import net.minecraft.util.IChatComponent; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.utils.api.guide.lines.GuideExtendedTextLine; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; +import serverutils.utils.api.guide.lines.GuideExtendedTextLine; /** * Created by LatvianModder on 04.03.2016. diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideImage.java b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideImage.java similarity index 77% rename from src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideImage.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideImage.java index 662dfab7..82842668 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideImage.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideImage.java @@ -1,10 +1,10 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; import cpw.mods.fml.relauncher.*; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.*; -import ftb.lib.api.gui.GuiLM; -import ftb.utils.api.guide.lines.GuideImageLine; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.*; +import serverutils.lib.api.gui.GuiLM; +import serverutils.utils.api.guide.lines.GuideImageLine; /** * Created by LatvianModder on 04.03.2016. @@ -36,7 +36,7 @@ public void renderWidget() { if (texture != null) { GlStateManager.color(1F, 1F, 1F, 1F); - FTBLibClient.setTexture(texture.texture); + ServerUtilitiesLibraryClient.setTexture(texture.texture); GuiLM.render(texture, ax, ay, gui.getZLevel(), texture.width, texture.height); } } diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuidePage.java b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuidePage.java similarity index 82% rename from src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuidePage.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuidePage.java index 63cc111a..64a8ed78 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuidePage.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuidePage.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; import java.util.List; import net.minecraft.util.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.utils.api.guide.GuidePage; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.utils.api.guide.GuidePage; /** * Created by LatvianModder on 04.03.2016. @@ -25,14 +25,14 @@ public ButtonGuidePage(GuiGuide g, GuidePage p) { } public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); if (page.childPages.isEmpty()) { guiGuide.selectedPage = page; guiGuide.sliderText.value = 0F; guiGuide.panelText.posY = 10; guiGuide.panelText.refreshWidgets(); - } else FTBLibClient.openGui(new GuiGuide(guiGuide, page)); + } else ServerUtilitiesLibraryClient.openGui(new GuiGuide(guiGuide, page)); } public void updateTitle() { diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideTextLine.java b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideTextLine.java similarity index 87% rename from src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideTextLine.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideTextLine.java index 9906ea42..ea082fae 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/ButtonGuideTextLine.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/ButtonGuideTextLine.java @@ -1,14 +1,14 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; import java.util.List; import net.minecraft.util.IChatComponent; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.GlStateManager; -import ftb.lib.api.gui.GuiLM; -import ftb.lib.api.gui.widgets.ButtonLM; -import ftb.utils.api.guide.lines.GuideTextLine; +import serverutils.lib.api.client.GlStateManager; +import serverutils.lib.api.gui.GuiLM; +import serverutils.lib.api.gui.widgets.ButtonLM; +import serverutils.utils.api.guide.lines.GuideTextLine; /** * Created by LatvianModder on 04.03.2016. diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/ClientSettings.java b/src/main/java/serverutils/utils/mod/client/gui/guide/ClientSettings.java similarity index 87% rename from src/main/java/ftb/utils/mod/client/gui/guide/ClientSettings.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/ClientSettings.java index bca912c9..eb27fa21 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/ClientSettings.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/ClientSettings.java @@ -1,8 +1,8 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; -import ftb.lib.api.config.*; import latmod.lib.LMColor; import latmod.lib.annotations.NumberBounds; +import serverutils.lib.api.config.*; /** * Created by LatvianModder on 22.03.2016. diff --git a/src/main/java/ftb/utils/mod/client/gui/guide/GuiGuide.java b/src/main/java/serverutils/utils/mod/client/gui/guide/GuiGuide.java similarity index 92% rename from src/main/java/ftb/utils/mod/client/gui/guide/GuiGuide.java rename to src/main/java/serverutils/utils/mod/client/gui/guide/GuiGuide.java index b1892b16..6d713570 100644 --- a/src/main/java/ftb/utils/mod/client/gui/guide/GuiGuide.java +++ b/src/main/java/serverutils/utils/mod/client/gui/guide/GuiGuide.java @@ -1,18 +1,18 @@ -package ftb.utils.mod.client.gui.guide; +package serverutils.utils.mod.client.gui.guide; import net.minecraft.util.ResourceLocation; -import ftb.lib.TextureCoords; -import ftb.lib.api.client.*; -import ftb.lib.api.gui.*; -import ftb.lib.api.gui.widgets.*; -import ftb.utils.api.guide.*; -import ftb.utils.api.guide.lines.GuideTextLine; import latmod.lib.LMColor; +import serverutils.lib.TextureCoords; +import serverutils.lib.api.client.*; +import serverutils.lib.api.gui.*; +import serverutils.lib.api.gui.widgets.*; +import serverutils.utils.api.guide.*; +import serverutils.utils.api.guide.lines.GuideTextLine; public class GuiGuide extends GuiLM implements IClientActionGui { - public static final ResourceLocation tex = new ResourceLocation("ftbu", "textures/gui/guide.png"); + public static final ResourceLocation tex = new ResourceLocation("serverutils", "textures/gui/guide.png"); public static final TextureCoords tex_slider = new TextureCoords(tex, 0, 30, 12, 18, 64, 64); public static final TextureCoords tex_back = new TextureCoords(tex, 13, 30, 14, 11, 64, 64); public static final TextureCoords tex_close = new TextureCoords(tex, 13, 41, 14, 11, 64, 64); @@ -46,7 +46,7 @@ public class GuiGuide extends GuiLM implements IClientActionGui { public static GuiGuide openClientGui(boolean open) { if (clientGuideGui == null) clientGuideGui = new GuiGuide(null, ClientGuideFile.instance); - if (open) FTBLibClient.openGui(clientGuideGui); + if (open) ServerUtilitiesLibraryClient.openGui(clientGuideGui); return clientGuideGui; } @@ -86,7 +86,7 @@ public boolean isEnabled() { buttonBack = new ButtonLM(this, 0, 0, tex_back.widthI(), tex_back.heightI()) { public void onButtonPressed(int b) { - FTBLibClient.playClickSound(); + ServerUtilitiesLibraryClient.playClickSound(); if (selectedPage == page || page.getUnformattedText().isEmpty()) { if (parentGui == null) mc.thePlayer.closeScreen(); @@ -94,7 +94,7 @@ public void onButtonPressed(int b) { parentGui.selectedPage = parentGui.page; parentGui.sliderText.value = 0F; parentGui.panelText.posY = 10; - FTBLibClient.openGui(parentGui); + ServerUtilitiesLibraryClient.openGui(parentGui); } } else { selectedPage = page; @@ -227,7 +227,7 @@ public void drawBackground() { super.drawBackground(); - FTBLibClient.setTexture(texture); + ServerUtilitiesLibraryClient.setTexture(texture); GlStateManager.color(1F, 1F, 1F, 1F); @@ -257,7 +257,7 @@ public void drawBackground() { sliderPages.renderSlider(tex_slider); sliderText.renderSlider(tex_slider); - FTBLibClient.setGLColor(colorText, 255); + ServerUtilitiesLibraryClient.setGLColor(colorText, 255); buttonBack.render((parentGui == null) ? tex_close : tex_back); GlStateManager.color(1F, 1F, 1F, 1F); @@ -281,7 +281,7 @@ private void renderBorders(int px, int py, int w, int h) { } private void renderFilling(int px, int py, int w, int h, int a) { - FTBLibClient.setGLColor(colorBackground, a); + ServerUtilitiesLibraryClient.setGLColor(colorBackground, a); drawBlankRect(px + 4, py + 4, zLevel, w - 8, h - 8); } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdBack.java b/src/main/java/serverutils/utils/mod/cmd/CmdBack.java similarity index 65% rename from src/main/java/ftb/utils/mod/cmd/CmdBack.java rename to src/main/java/serverutils/utils/mod/cmd/CmdBack.java index 4d166d75..27e22764 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdBack.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdBack.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.LMDimUtils; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.LMDimUtils; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdBack extends CommandLM { @@ -18,7 +18,7 @@ public CmdBack() { public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { EntityPlayerMP ep = getCommandSenderAsPlayer(ics); LMPlayerServer p = LMPlayerServer.get(ep); - if (p.lastDeath == null) return error(FTBU.mod.chatComponent("cmd.no_dp")); + if (p.lastDeath == null) return error(ServerUtilities.mod.chatComponent("cmd.no_dp")); LMDimUtils.teleportPlayer(ep, p.lastDeath); p.lastDeath = null; diff --git a/src/main/java/ftb/utils/mod/cmd/CmdDelHome.java b/src/main/java/serverutils/utils/mod/cmd/CmdDelHome.java similarity index 65% rename from src/main/java/ftb/utils/mod/cmd/CmdDelHome.java rename to src/main/java/serverutils/utils/mod/cmd/CmdDelHome.java index a3aecc6f..0f2d47f5 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdDelHome.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdDelHome.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdDelHome extends CommandLM { @@ -26,7 +26,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman LMPlayerServer p = LMPlayerServer.get(ics); checkArgs(args, 1); - if (p.homes.set(args[0], null)) return FTBU.mod.chatComponent("cmd.home_del", args[0]); - return error(FTBU.mod.chatComponent("cmd.home_not_set", args[0])); + if (p.homes.set(args[0], null)) return ServerUtilities.mod.chatComponent("cmd.home_del", args[0]); + return error(ServerUtilities.mod.chatComponent("cmd.home_not_set", args[0])); } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdHome.java b/src/main/java/serverutils/utils/mod/cmd/CmdHome.java similarity index 74% rename from src/main/java/ftb/utils/mod/cmd/CmdHome.java rename to src/main/java/serverutils/utils/mod/cmd/CmdHome.java index 97c0fcb1..3eaa4080 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdHome.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdHome.java @@ -1,14 +1,14 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; import latmod.lib.LMStringUtils; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdHome extends CommandLM { @@ -39,12 +39,12 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman BlockDimPos pos = p.homes.get(args[0]); - if (pos == null) return error(FTBU.mod.chatComponent("cmd.home_not_set", args[0])); + if (pos == null) return error(ServerUtilities.mod.chatComponent("cmd.home_not_set", args[0])); if (ep.dimension != pos.dim && !p.getRank().config.cross_dim_homes.getAsBoolean()) - return error(FTBU.mod.chatComponent("cmd.home_cross_dim")); + return error(ServerUtilities.mod.chatComponent("cmd.home_cross_dim")); LMDimUtils.teleportPlayer(ep, pos); - return FTBU.mod.chatComponent("cmd.warp_tp", args[0]); + return ServerUtilities.mod.chatComponent("cmd.warp_tp", args[0]); } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdLMPlayerSettings.java b/src/main/java/serverutils/utils/mod/cmd/CmdLMPlayerSettings.java similarity index 87% rename from src/main/java/ftb/utils/mod/cmd/CmdLMPlayerSettings.java rename to src/main/java/serverutils/utils/mod/cmd/CmdLMPlayerSettings.java index 04d6d356..169188f4 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdLMPlayerSettings.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdLMPlayerSettings.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.util.IChatComponent; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.*; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.*; /** * Created by LatvianModder on 14.01.2016. @@ -41,7 +41,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman boolean b = args[0].equals("toggle") ? !p.getSettings().get(flag) : parseBoolean(ics, args[0]); p.getSettings().set(flag, b); p.sendUpdate(); - if (!args[0].equals("toggle")) FTBLib.printChat(ics, commandName + " set to " + b); + if (!args[0].equals("toggle")) ServerUtilitiesLib.printChat(ics, commandName + " set to " + b); return null; } } @@ -70,7 +70,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman PrivacyLevel l = PrivacyLevel.get(args[0]); if (l != null) { p.getSettings().blocks = l; - FTBLib.printChat(ics, commandName + " set to " + l.name().toLowerCase()); + ServerUtilitiesLib.printChat(ics, commandName + " set to " + l.name().toLowerCase()); } return null; @@ -94,7 +94,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman boolean b = args[0].equals("toggle") ? !p.renderBadge : parseBoolean(ics, args[0]); p.renderBadge = b; p.sendUpdate(); - if (!args[0].equals("toggle")) FTBLib.printChat(ics, commandName + " set to " + b); + if (!args[0].equals("toggle")) ServerUtilitiesLib.printChat(ics, commandName + " set to " + b); return null; } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdMath.java b/src/main/java/serverutils/utils/mod/cmd/CmdMath.java similarity index 94% rename from src/main/java/ftb/utils/mod/cmd/CmdMath.java rename to src/main/java/serverutils/utils/mod/cmd/CmdMath.java index 891374ef..6894a514 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdMath.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdMath.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import javax.script.*; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.api.cmd.*; import latmod.lib.LMStringUtils; +import serverutils.lib.api.cmd.*; public class CmdMath extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/CmdSetHome.java b/src/main/java/serverutils/utils/mod/cmd/CmdSetHome.java similarity index 71% rename from src/main/java/ftb/utils/mod/cmd/CmdSetHome.java rename to src/main/java/serverutils/utils/mod/cmd/CmdSetHome.java index 1e5e2e7d..0e48b11d 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdSetHome.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdSetHome.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdSetHome extends CommandLM { @@ -31,10 +31,11 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman int maxHomes = p.getRank().config.max_homes.getAsInt(); if (maxHomes <= 0 || p.homes.size() >= maxHomes) { - if (maxHomes == 0 || p.homes.get(args[0]) == null) return error(FTBU.mod.chatComponent("cmd.home_limit")); + if (maxHomes == 0 || p.homes.get(args[0]) == null) + return error(ServerUtilities.mod.chatComponent("cmd.home_limit")); } p.homes.set(args[0], p.getPos()); - return FTBU.mod.chatComponent("cmd.home_set", args[0]); + return ServerUtilities.mod.chatComponent("cmd.home_set", args[0]); } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdSpawn.java b/src/main/java/serverutils/utils/mod/cmd/CmdSpawn.java similarity index 77% rename from src/main/java/ftb/utils/mod/cmd/CmdSpawn.java rename to src/main/java/serverutils/utils/mod/cmd/CmdSpawn.java index 5468c732..0288c473 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdSpawn.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdSpawn.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; import net.minecraft.world.World; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; public class CmdSpawn extends CommandLM { @@ -23,6 +23,6 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman while (w.getBlock(spawnpoint.posX, spawnpoint.posY, spawnpoint.posZ).isOpaqueCube()) spawnpoint.posY += 2; LMDimUtils.teleportPlayer(ep, new BlockDimPos(spawnpoint, 0)); - return FTBU.mod.chatComponent("cmd.spawn_tp"); + return ServerUtilities.mod.chatComponent("cmd.spawn_tp"); } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdTplast.java b/src/main/java/serverutils/utils/mod/cmd/CmdTplast.java similarity index 84% rename from src/main/java/ftb/utils/mod/cmd/CmdTplast.java rename to src/main/java/serverutils/utils/mod/cmd/CmdTplast.java index 5580737d..1dddd184 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdTplast.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdTplast.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdTplast extends CommandLM { @@ -49,6 +49,6 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman BlockDimPos p = to.getPos(); if (p == null) return error(new ChatComponentText("No last position!")); LMDimUtils.teleportPlayer(who, p); - return FTBU.mod.chatComponent("cmd.warp_tp", to.getProfile().getName()); + return ServerUtilities.mod.chatComponent("cmd.warp_tp", to.getProfile().getName()); } } diff --git a/src/main/java/ftb/utils/mod/cmd/CmdWarp.java b/src/main/java/serverutils/utils/mod/cmd/CmdWarp.java similarity index 71% rename from src/main/java/ftb/utils/mod/cmd/CmdWarp.java rename to src/main/java/serverutils/utils/mod/cmd/CmdWarp.java index 8ac06619..317530f9 100644 --- a/src/main/java/ftb/utils/mod/cmd/CmdWarp.java +++ b/src/main/java/serverutils/utils/mod/cmd/CmdWarp.java @@ -1,15 +1,15 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; -import ftb.utils.world.LMWorldServer; import latmod.lib.LMStringUtils; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; +import serverutils.utils.world.LMWorldServer; public class CmdWarp extends CommandLM { @@ -37,10 +37,10 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman EntityPlayerMP ep = getCommandSenderAsPlayer(ics); LMPlayerServer playerServer = LMPlayerServer.get(ep); BlockDimPos p = LMWorldServer.inst.warps.get(args[0]); - if (p == null) return error(FTBU.mod.chatComponent("cmd.warp_not_set", args[0])); + if (p == null) return error(ServerUtilities.mod.chatComponent("cmd.warp_not_set", args[0])); if (p.dim != ep.dimension && !playerServer.getRank().config.cross_dim_warp.getAsBoolean()) - return error(FTBU.mod.chatComponent("cmd.warp_not_same_dim", args[0])); + return error(ServerUtilities.mod.chatComponent("cmd.warp_not_same_dim", args[0])); LMDimUtils.teleportPlayer(ep, p); - return FTBU.mod.chatComponent("cmd.warp_tp", args[0]); + return ServerUtilities.mod.chatComponent("cmd.warp_tp", args[0]); } } diff --git a/src/main/java/ftb/utils/mod/cmd/InvSeeInventory.java b/src/main/java/serverutils/utils/mod/cmd/InvSeeInventory.java similarity index 95% rename from src/main/java/ftb/utils/mod/cmd/InvSeeInventory.java rename to src/main/java/serverutils/utils/mod/cmd/InvSeeInventory.java index a9698945..dbb72123 100644 --- a/src/main/java/ftb/utils/mod/cmd/InvSeeInventory.java +++ b/src/main/java/serverutils/utils/mod/cmd/InvSeeInventory.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd; +package serverutils.utils.mod.cmd; import net.minecraft.entity.player.*; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import ftb.lib.BaublesHelper; -import ftb.lib.api.item.LMInvUtils; +import serverutils.lib.BaublesHelper; +import serverutils.lib.api.item.LMInvUtils; public class InvSeeInventory implements IInventory { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdAdmin.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdAdmin.java similarity index 72% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdAdmin.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdAdmin.java index 670ffd54..5e70cad4 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdAdmin.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdAdmin.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.config.FTBUConfigCmd; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.config.ServerUtilitiesConfigCmd; public class CmdAdmin extends CommandSubLM { public CmdAdmin() { - super(FTBUConfigCmd.name_admin.getAsString(), CommandLevel.OP); + super(ServerUtilitiesConfigCmd.name_admin.getAsString(), CommandLevel.OP); // add(new CmdPlayerLM()); add(new CmdRestart()); add(new CmdInvsee()); diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdAdminHome.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdAdminHome.java similarity index 68% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdAdminHome.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdAdminHome.java index 5852b01c..6b3ab2e6 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdAdminHome.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdAdminHome.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMPlayerServer; import latmod.lib.LMStringUtils; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMPlayerServer; public class CmdAdminHome extends CommandSubLM { @@ -38,15 +38,15 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman checkArgs(args, 3); BlockDimPos pos = p.homes.get(args[2]); - if (pos == null) return error(FTBU.mod.chatComponent("cmd.home_not_set", args[2])); + if (pos == null) return error(ServerUtilities.mod.chatComponent("cmd.home_not_set", args[2])); if (args[1].equals("tp")) { LMDimUtils.teleportPlayer(getCommandSenderAsPlayer(ics), pos); - return FTBU.mod.chatComponent("cmd.warp_tp", args[2]); + return ServerUtilities.mod.chatComponent("cmd.warp_tp", args[2]); } else if (args[1].equals("remove")) { - if (p.homes.set(args[2], null)) return FTBU.mod.chatComponent("cmd.home_del", args[2]); + if (p.homes.set(args[2], null)) return ServerUtilities.mod.chatComponent("cmd.home_del", args[2]); } - return error(FTBU.mod.chatComponent("invalid_subcmd", args[2])); + return error(ServerUtilities.mod.chatComponent("invalid_subcmd", args[2])); } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdBackup.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdBackup.java similarity index 64% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdBackup.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdBackup.java index 7418e432..fed7c90e 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdBackup.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdBackup.java @@ -1,14 +1,14 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.IChatComponent; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.config.FTBUConfigBackups; -import ftb.utils.world.Backups; import latmod.lib.LMFileUtils; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.config.ServerUtilitiesConfigBackups; +import serverutils.utils.world.Backups; public class CmdBackup extends CommandSubLM { @@ -28,12 +28,12 @@ public CmdBackupStart(String s) { public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { boolean b = Backups.run(ics); if (b) { - FTBLib.printChat( + ServerUtilitiesLib.printChat( BroadcastSender.inst, - FTBU.mod.chatComponent("cmd.backup_manual_launch", ics.getCommandSenderName())); - if (!FTBUConfigBackups.use_separate_thread.getAsBoolean()) Backups.postBackup(); + ServerUtilities.mod.chatComponent("cmd.backup_manual_launch", ics.getCommandSenderName())); + if (!ServerUtilitiesConfigBackups.use_separate_thread.getAsBoolean()) Backups.postBackup(); } - return b ? null : error(FTBU.mod.chatComponent("cmd.backup_already_running")); + return b ? null : error(ServerUtilities.mod.chatComponent("cmd.backup_already_running")); } } @@ -47,10 +47,10 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman if (Backups.thread != null) { Backups.thread.interrupt(); Backups.thread = null; - return FTBU.mod.chatComponent("cmd.backup_stop"); + return ServerUtilities.mod.chatComponent("cmd.backup_stop"); } - return error(FTBU.mod.chatComponent("cmd.backup_not_running")); + return error(ServerUtilities.mod.chatComponent("cmd.backup_not_running")); } } @@ -63,7 +63,7 @@ public CmdBackupGetSize(String s) { public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { String sizeW = LMFileUtils.getSizeS(ics.getEntityWorld().getSaveHandler().getWorldDirectory()); String sizeT = LMFileUtils.getSizeS(Backups.backupsFolder); - return FTBU.mod.chatComponent("cmd.backup_size", sizeW, sizeT); + return ServerUtilities.mod.chatComponent("cmd.backup_size", sizeW, sizeT); } } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdDelWarp.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdDelWarp.java similarity index 62% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdDelWarp.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdDelWarp.java index 04e58ee1..e5ab89ce 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdDelWarp.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdDelWarp.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMWorldServer; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMWorldServer; public class CmdDelWarp extends CommandLM { @@ -24,7 +24,8 @@ public String[] getTabStrings(ICommandSender ics, String args[], int i) throws C public IChatComponent onCommand(ICommandSender ics, String[] args) throws CommandException { checkArgs(args, 1); - if (LMWorldServer.inst.warps.set(args[0], null)) return FTBU.mod.chatComponent("cmd.warp_del", args[0]); - return error(FTBU.mod.chatComponent("cmd.warp_not_set", args[0])); + if (LMWorldServer.inst.warps.set(args[0], null)) + return ServerUtilities.mod.chatComponent("cmd.warp_del", args[0]); + return error(ServerUtilities.mod.chatComponent("cmd.warp_not_set", args[0])); } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdInvsee.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdInvsee.java similarity index 86% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdInvsee.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdInvsee.java index 59610adf..155df426 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdInvsee.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdInvsee.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.cmd.InvSeeInventory; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.cmd.InvSeeInventory; public class CmdInvsee extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdInvseeEnderchest.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdInvseeEnderchest.java similarity index 91% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdInvseeEnderchest.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdInvseeEnderchest.java index d69a04a4..add82fcd 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdInvseeEnderchest.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdInvseeEnderchest.java @@ -1,10 +1,10 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.IChatComponent; -import ftb.lib.api.cmd.*; +import serverutils.lib.api.cmd.*; public class CmdInvseeEnderchest extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdListFriends.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdListFriends.java similarity index 85% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdListFriends.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdListFriends.java index 495bf24d..8092814c 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdListFriends.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdListFriends.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.LMPlayerServer; import latmod.lib.LMListUtils; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.LMPlayerServer; public class CmdListFriends extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdPlayerLM.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdPlayerLM.java similarity index 83% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdPlayerLM.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdPlayerLM.java index b84ef861..d89a8f3e 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdPlayerLM.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdPlayerLM.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import java.io.File; import java.util.UUID; @@ -10,18 +10,18 @@ import com.mojang.authlib.GameProfile; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.lib.api.item.StringIDInvLoader; -import ftb.utils.world.*; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.lib.api.item.StringIDInvLoader; +import serverutils.utils.world.*; public class CmdPlayerLM extends CommandSubLM { public CmdPlayerLM() { super("player_lm", CommandLevel.OP); - if (FTBLib.DEV_ENV) add(new CmdAddFake("add_fake")); + if (ServerUtilitiesLib.DEV_ENV) add(new CmdAddFake("add_fake")); add(new CmdDelete("delete")); add(new CmdLoadInv("load_inv")); add(new CmdSaveInv("save_inv")); @@ -107,15 +107,16 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman EntityPlayerMP ep = p.getPlayer(); String filename = ep.getCommandSenderName(); if (args.length == 2) filename = "custom/" + args[1]; - NBTTagCompound tag = LMNBTUtils - .readMap(new File(FTBLib.folderLocal, "ftbu/playerinvs/" + filename + ".dat")); + // TODO: Backwards Compatibility? + NBTTagCompound tag = LMNBTUtils.readMap( + new File(ServerUtilitiesLib.folderLocal, "serverutils/playerinvs/" + filename + ".dat")); StringIDInvLoader.readInvFromNBT(ep.inventory, tag, "Inventory"); - if (FTBLib.isModInstalled(OtherMods.BAUBLES)) + if (ServerUtilitiesLib.isModInstalled(OtherMods.BAUBLES)) StringIDInvLoader.readInvFromNBT(BaublesHelper.getBaubles(ep), tag, "Baubles"); } catch (Exception e) { - if (FTBLib.DEV_ENV) e.printStackTrace(); + if (ServerUtilitiesLib.DEV_ENV) e.printStackTrace(); return error(new ChatComponentText("Failed to load inventory!")); } @@ -147,16 +148,20 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman NBTTagCompound tag = new NBTTagCompound(); StringIDInvLoader.writeInvToNBT(ep.inventory, tag, "Inventory"); - if (FTBLib.isModInstalled(OtherMods.BAUBLES)) + if (ServerUtilitiesLib.isModInstalled(OtherMods.BAUBLES)) StringIDInvLoader.writeInvToNBT(BaublesHelper.getBaubles(ep), tag, "Baubles"); String filename = ep.getCommandSenderName(); if (args.length == 2) filename = "custom/" + args[1]; + // TODO: Backwards Compatibility? LMNBTUtils.writeMap( - LMFileUtils.newFile(new File(FTBLib.folderLocal, "ftbu/playerinvs/" + filename + ".dat")), + LMFileUtils.newFile( + new File( + ServerUtilitiesLib.folderLocal, + "serverutils/playerinvs/" + filename + ".dat")), tag); } catch (Exception e) { - if (FTBLib.DEV_ENV) e.printStackTrace(); + if (ServerUtilitiesLib.DEV_ENV) e.printStackTrace(); return error(new ChatComponentText("Failed to save inventory!")); } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdResetPos.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdResetPos.java similarity index 83% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdResetPos.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdResetPos.java index 8fdefb0c..a3021c19 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdResetPos.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdResetPos.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import java.io.File; @@ -7,9 +7,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.*; -import ftb.lib.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.LMPlayerServer; // FIXME: UNFINISHED public class CmdResetPos extends CommandLM { @@ -37,14 +37,14 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman y = func_110665_a(ics, ep.posY, args[2], -30000000, 30000000); z = func_110665_a(ics, ep.posZ, args[3], -30000000, 30000000); } else { - ChunkCoordinates c = FTBLib.getServerWorld().getSpawnPoint(); + ChunkCoordinates c = ServerUtilitiesLib.getServerWorld().getSpawnPoint(); x = c.posX + 0.5D; y = c.posY + 0.5D; z = c.posZ + 0.5D; } File file = new File( - FTBLib.getServerWorld().getSaveHandler().getWorldDirectory(), + ServerUtilitiesLib.getServerWorld().getSaveHandler().getWorldDirectory(), "playerdata/" + p.getProfile().getId() + ".dat"); if (!file.exists()) { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdRestart.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdRestart.java similarity index 61% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdRestart.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdRestart.java index 0cbc3788..bc46ba0c 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdRestart.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdRestart.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import java.io.File; import net.minecraft.command.*; import net.minecraft.util.IChatComponent; -import ftb.lib.FTBLib; -import ftb.lib.api.cmd.*; import latmod.lib.LMFileUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.cmd.*; public class CmdRestart extends CommandLM { @@ -21,7 +21,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman } public static void restart() { - LMFileUtils.newFile(new File(FTBLib.folderMinecraft, "autostart.stamp")); - FTBLib.getServer().initiateShutdown(); + LMFileUtils.newFile(new File(ServerUtilitiesLib.folderMinecraft, "autostart.stamp")); + ServerUtilitiesLib.getServer().initiateShutdown(); } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdServerInfo.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdServerInfo.java similarity index 95% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdServerInfo.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdServerInfo.java index 9b3265d1..3ab134b5 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdServerInfo.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdServerInfo.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import java.util.*; @@ -12,9 +12,9 @@ import com.google.common.collect.ImmutableSetMultimap; -import ftb.lib.api.cmd.*; -import ftb.utils.api.guide.GuidePage; import latmod.lib.IntList; +import serverutils.lib.api.cmd.*; +import serverutils.utils.api.guide.GuidePage; public class CmdServerInfo extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdSetWarp.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdSetWarp.java similarity index 76% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdSetWarp.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdSetWarp.java index a6c4379f..6845e1c3 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdSetWarp.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdSetWarp.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.BlockDimPos; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBU; -import ftb.utils.world.LMWorldServer; +import serverutils.lib.BlockDimPos; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.LMWorldServer; public class CmdSetWarp extends CommandLM { @@ -32,6 +32,6 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman } else c = ep.getPlayerCoordinates(); LMWorldServer.inst.warps.set(args[0], new BlockDimPos(c, ep.dimension)); - return FTBU.mod.chatComponent("cmd.warp_set", args[0]); + return ServerUtilities.mod.chatComponent("cmd.warp_set", args[0]); } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaim.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaim.java similarity index 69% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaim.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaim.java index 3c13588f..768a7a96 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaim.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaim.java @@ -1,13 +1,13 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IChatComponent; -import ftb.lib.LMAccessToken; -import ftb.lib.api.cmd.*; -import ftb.utils.mod.FTBUGuiHandler; +import serverutils.lib.LMAccessToken; +import serverutils.lib.api.cmd.*; +import serverutils.utils.mod.ServerUtilsGuiHandler; public class CmdUnclaim extends CommandLM { @@ -19,7 +19,7 @@ public IChatComponent onCommand(ICommandSender ics, String[] args) throws Comman EntityPlayerMP ep = getCommandSenderAsPlayer(ics); NBTTagCompound data = new NBTTagCompound(); data.setLong("T", LMAccessToken.generate(ep)); - FTBUGuiHandler.instance.openGui(ep, FTBUGuiHandler.ADMIN_CLAIMS, data); + ServerUtilsGuiHandler.instance.openGui(ep, ServerUtilsGuiHandler.ADMIN_CLAIMS, data); return null; } } diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaimAll.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaimAll.java similarity index 89% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaimAll.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaimAll.java index f424b037..e26e1111 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnclaimAll.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnclaimAll.java @@ -1,10 +1,10 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.*; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.*; public class CmdUnclaimAll extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnloadAll.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnloadAll.java similarity index 87% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdUnloadAll.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdUnloadAll.java index 306f3942..7019ef21 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdUnloadAll.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdUnloadAll.java @@ -1,11 +1,11 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.util.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.*; -import ftb.utils.world.claims.ClaimedChunk; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.ClaimedChunk; public class CmdUnloadAll extends CommandLM { diff --git a/src/main/java/ftb/utils/mod/cmd/admin/CmdWorldBorder.java b/src/main/java/serverutils/utils/mod/cmd/admin/CmdWorldBorder.java similarity index 96% rename from src/main/java/ftb/utils/mod/cmd/admin/CmdWorldBorder.java rename to src/main/java/serverutils/utils/mod/cmd/admin/CmdWorldBorder.java index 66246415..f732ba4c 100644 --- a/src/main/java/ftb/utils/mod/cmd/admin/CmdWorldBorder.java +++ b/src/main/java/serverutils/utils/mod/cmd/admin/CmdWorldBorder.java @@ -1,12 +1,12 @@ -package ftb.utils.mod.cmd.admin; +package serverutils.utils.mod.cmd.admin; import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.*; -import ftb.lib.api.cmd.*; -import ftb.utils.world.LMWorldServer; import latmod.lib.MathHelperLM; +import serverutils.lib.api.cmd.*; +import serverutils.utils.world.LMWorldServer; public class CmdWorldBorder extends CommandSubLM { diff --git a/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfig.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfig.java new file mode 100644 index 00000000..b4a57f8e --- /dev/null +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfig.java @@ -0,0 +1,27 @@ +package serverutils.utils.mod.config; + +import java.io.File; + +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.config.*; +import serverutils.utils.world.ranks.Ranks; + +public class ServerUtilitiesConfig { + + public static final ConfigFile configFile = new ConfigFile("serverutils"); + + public static void load() { + configFile.setFile(new File(ServerUtilitiesLib.folderLocal, "serverutils/config.json")); + configFile.setDisplayName("ServerUtilities"); + configFile.addGroup("backups", ServerUtilitiesConfigBackups.class); + configFile.addGroup("commands", ServerUtilitiesConfigCmd.class); + configFile.addGroup("general", ServerUtilitiesConfigGeneral.class); + configFile.addGroup("login", ServerUtilitiesConfigLogin.class); + configFile.addGroup("tops", ServerUtilitiesConfigTops.class); + configFile.addGroup("chunkloading", ServerUtilitiesConfigChunkloading.class); + Ranks.load(configFile); + + ConfigRegistry.add(configFile); + configFile.load(); + } +} diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigBackups.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigBackups.java similarity index 93% rename from src/main/java/ftb/utils/mod/config/FTBUConfigBackups.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigBackups.java index a169b891..6d69d18e 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigBackups.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigBackups.java @@ -1,9 +1,9 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; -import ftb.lib.api.config.*; import latmod.lib.annotations.*; +import serverutils.lib.api.config.*; -public class FTBUConfigBackups { +public class ServerUtilitiesConfigBackups { public static final ConfigEntryBool enabled = new ConfigEntryBool("enabled", true); diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigChunkloading.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigChunkloading.java similarity index 82% rename from src/main/java/ftb/utils/mod/config/FTBUConfigChunkloading.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigChunkloading.java index 9e56b255..f4dc4999 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigChunkloading.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigChunkloading.java @@ -1,9 +1,9 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; -import ftb.lib.api.config.*; import latmod.lib.annotations.*; +import serverutils.lib.api.config.*; -public class FTBUConfigChunkloading { +public class ServerUtilitiesConfigChunkloading { @Flags(Flags.SYNC) @Info("Enables chunkloading") diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigCmd.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigCmd.java similarity index 81% rename from src/main/java/ftb/utils/mod/config/FTBUConfigCmd.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigCmd.java index cf47bf79..de96b3d3 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigCmd.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigCmd.java @@ -1,8 +1,8 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; -import ftb.lib.api.config.*; +import serverutils.lib.api.config.*; -public class FTBUConfigCmd { +public class ServerUtilitiesConfigCmd { public static final ConfigEntryString name_admin = new ConfigEntryString("name_admin", "admin"); public static final ConfigEntryBool back = new ConfigEntryBool("back", true); diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigGeneral.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigGeneral.java similarity index 95% rename from src/main/java/ftb/utils/mod/config/FTBUConfigGeneral.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigGeneral.java index d2b9095c..64a7a119 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigGeneral.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigGeneral.java @@ -1,14 +1,14 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; import java.util.*; import net.minecraft.entity.*; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.config.*; import latmod.lib.annotations.*; +import serverutils.lib.api.config.*; -public class FTBUConfigGeneral { +public class ServerUtilitiesConfigGeneral { @NumberBounds(min = 0D, max = 720D) @Info({ "Server will automatically shut down after X hours", "0 - Disabled", "0.5 - 30 minutes", "1 - 1 Hour", diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigLogin.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigLogin.java similarity index 92% rename from src/main/java/ftb/utils/mod/config/FTBUConfigLogin.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigLogin.java index e3a1a611..ba1365d5 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigLogin.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigLogin.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; import java.util.*; @@ -8,12 +8,12 @@ import com.google.gson.*; -import ftb.lib.JsonHelper; -import ftb.lib.api.config.ConfigEntryCustom; -import ftb.lib.api.item.ItemStackSerializer; import latmod.lib.annotations.Info; +import serverutils.lib.JsonHelper; +import serverutils.lib.api.config.ConfigEntryCustom; +import serverutils.lib.api.item.ItemStackSerializer; -public class FTBUConfigLogin { +public class ServerUtilitiesConfigLogin { @Info("Message of the day. This will be displayed when player joins the server") public static final ConfigEntryChatComponentList motd = new ConfigEntryChatComponentList("motd"); diff --git a/src/main/java/ftb/utils/mod/config/FTBUConfigTops.java b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigTops.java similarity index 77% rename from src/main/java/ftb/utils/mod/config/FTBUConfigTops.java rename to src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigTops.java index 46a7d7b7..d46b2ac9 100644 --- a/src/main/java/ftb/utils/mod/config/FTBUConfigTops.java +++ b/src/main/java/serverutils/utils/mod/config/ServerUtilitiesConfigTops.java @@ -1,8 +1,8 @@ -package ftb.utils.mod.config; +package serverutils.utils.mod.config; -import ftb.lib.api.config.ConfigEntryBool; +import serverutils.lib.api.config.ConfigEntryBool; -public class FTBUConfigTops // Top +public class ServerUtilitiesConfigTops // Top { public static final ConfigEntryBool first_joined = new ConfigEntryBool("first_joined", true); diff --git a/src/main/java/ftb/utils/mod/handlers/FTBUChatEventHandler.java b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChatEventHandler.java similarity index 79% rename from src/main/java/ftb/utils/mod/handlers/FTBUChatEventHandler.java rename to src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChatEventHandler.java index 4c5a8898..32917577 100644 --- a/src/main/java/ftb/utils/mod/handlers/FTBUChatEventHandler.java +++ b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChatEventHandler.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers; +package serverutils.utils.mod.handlers; import java.util.ArrayList; @@ -6,17 +6,17 @@ import net.minecraft.util.*; import cpw.mods.fml.common.eventhandler.*; -import ftb.lib.FTBLib; -import ftb.lib.api.ServerTickCallback; -import ftb.utils.world.*; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.ServerTickCallback; +import serverutils.utils.world.*; -public class FTBUChatEventHandler { +public class ServerUtilitiesChatEventHandler { private static final String[] LINK_PREFIXES = { "http://", "https://" }; @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChatEvent(net.minecraftforge.event.ServerChatEvent e) { - String[] msg = FTBLib.removeFormatting(e.message).split(" "); // https://github.com/LatvianModder + String[] msg = ServerUtilitiesLib.removeFormatting(e.message).split(" "); // https://github.com/LatvianModder ArrayList links = new ArrayList<>(); @@ -41,11 +41,12 @@ public void onChatEvent(net.minecraftforge.event.ServerChatEvent e) { line.getChatStyle().setColor(EnumChatFormatting.GOLD); - FTBLib.addCallback(new ServerTickCallback() { + ServerUtilitiesLib.addCallback(new ServerTickCallback() { public void onCallback() { for (LMPlayer p : LMWorldServer.inst.getAllOnlinePlayers()) { - if (p.getSettings().get(PersonalSettings.CHAT_LINKS)) FTBLib.printChat(p.getPlayer(), line); + if (p.getSettings().get(PersonalSettings.CHAT_LINKS)) + ServerUtilitiesLib.printChat(p.getPlayer(), line); } } }); diff --git a/src/main/java/ftb/utils/mod/handlers/FTBUChunkEventHandler.java b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChunkEventHandler.java similarity index 78% rename from src/main/java/ftb/utils/mod/handlers/FTBUChunkEventHandler.java rename to src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChunkEventHandler.java index faf3aa55..fbd89f92 100644 --- a/src/main/java/ftb/utils/mod/handlers/FTBUChunkEventHandler.java +++ b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesChunkEventHandler.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers; +package serverutils.utils.mod.handlers; import java.util.*; @@ -7,28 +7,29 @@ import com.google.common.collect.MapMaker; -import ftb.lib.*; -import ftb.utils.mod.*; -import ftb.utils.mod.config.FTBUConfigChunkloading; -import ftb.utils.world.*; -import ftb.utils.world.claims.ClaimedChunk; +import serverutils.lib.*; +import serverutils.utils.mod.*; +import serverutils.utils.mod.config.ServerUtilitiesConfigChunkloading; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.ClaimedChunk; -public class FTBUChunkEventHandler +public class ServerUtilitiesChunkEventHandler implements ForgeChunkManager.LoadingCallback, ForgeChunkManager.OrderedLoadingCallback { - public static final FTBUChunkEventHandler instance = new FTBUChunkEventHandler(); + public static final ServerUtilitiesChunkEventHandler instance = new ServerUtilitiesChunkEventHandler(); private final Map> table = new MapMaker().weakKeys().makeMap(); private static final String PLAYER_ID_TAG = "PID"; public void init() { - if (!ForgeChunkManager.getConfig().hasCategory(FTBUFinals.MOD_ID)) { - ForgeChunkManager.getConfig().get(FTBUFinals.MOD_ID, "maximumTicketCount", 2000).setMinValue(0); - ForgeChunkManager.getConfig().get(FTBUFinals.MOD_ID, "maximumChunksPerTicket", 30000).setMinValue(0); + if (!ForgeChunkManager.getConfig().hasCategory(ServerUtilitiesFinals.MOD_ID)) { + ForgeChunkManager.getConfig().get(ServerUtilitiesFinals.MOD_ID, "maximumTicketCount", 2000).setMinValue(0); + ForgeChunkManager.getConfig().get(ServerUtilitiesFinals.MOD_ID, "maximumChunksPerTicket", 30000) + .setMinValue(0); ForgeChunkManager.getConfig().save(); } EventBusHelper.register(this); - ForgeChunkManager.setForcedChunkLoadingCallback(FTBU.inst, this); + ForgeChunkManager.setForcedChunkLoadingCallback(ServerUtilities.inst, this); } private ForgeChunkManager.Ticket request(World w, LMPlayerServer player) { @@ -40,7 +41,7 @@ private ForgeChunkManager.Ticket request(World w, LMPlayerServer player) { ForgeChunkManager.Ticket t = (map == null) ? null : map.get(playerID); if (t == null) { - t = ForgeChunkManager.requestTicket(FTBU.inst, w, ForgeChunkManager.Type.NORMAL); + t = ForgeChunkManager.requestTicket(ServerUtilities.inst, w, ForgeChunkManager.Type.NORMAL); if (t == null) return null; else { t.getModData().setInteger(PLAYER_ID_TAG, playerID); @@ -61,7 +62,7 @@ public List ticketsLoaded(List tickets1 = new ArrayList<>(); - if (tickets.isEmpty() || !FTBUConfigChunkloading.enabled.getAsBoolean()) return tickets1; + if (tickets.isEmpty() || !ServerUtilitiesConfigChunkloading.enabled.getAsBoolean()) return tickets1; Map map = new HashMap<>(); for (ForgeChunkManager.Ticket t : tickets) { @@ -98,7 +99,7 @@ public void ticketsLoaded(List tickets, World world) { } public void markDirty(World w) { - if (LMWorldServer.inst == null || FTBLib.getServerWorld() == null) return; + if (LMWorldServer.inst == null || ServerUtilitiesLib.getServerWorld() == null) return; if (w != null) markDirty0(w); if (!table.isEmpty()) { @@ -114,8 +115,8 @@ private void markDirty0(World w) { Map chunksMap = LMWorldServer.inst.claimedChunks.chunks.get(w.provider.dimensionId); - double max = FTBUConfigChunkloading.enabled.getAsBoolean() - ? FTBUConfigChunkloading.max_player_offline_hours.getAsDouble() + double max = ServerUtilitiesConfigChunkloading.enabled.getAsBoolean() + ? ServerUtilitiesConfigChunkloading.max_player_offline_hours.getAsDouble() : -2D; if (chunksMap != null) for (ClaimedChunk c : chunksMap.values()) { @@ -161,7 +162,8 @@ else if (max > 0D) { } } - // FTBLib.dev_logger.info("Total: " + total + ", Loaded: " + totalLoaded + "/" + markedLoaded + ", DLoaded: " + + // ServerUtilitiesLibrary.dev_logger.info("Total: " + total + ", Loaded: " + totalLoaded + "/" + markedLoaded + + // ", DLoaded: " + // loaded + ", DUnloaded: " + unloaded); } diff --git a/src/main/java/ftb/utils/mod/handlers/FTBUPlayerEventHandler.java b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesPlayerEventHandler.java similarity index 82% rename from src/main/java/ftb/utils/mod/handlers/FTBUPlayerEventHandler.java rename to src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesPlayerEventHandler.java index 2b4e56aa..7b0ecd26 100644 --- a/src/main/java/ftb/utils/mod/handlers/FTBUPlayerEventHandler.java +++ b/src/main/java/serverutils/utils/mod/handlers/ServerUtilitiesPlayerEventHandler.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers; +package serverutils.utils.mod.handlers; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.IMob; @@ -11,18 +11,18 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; -import ftb.lib.*; -import ftb.lib.api.notification.Notification; -import ftb.utils.api.EventLMPlayerServer; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.config.FTBUConfigGeneral; -import ftb.utils.net.*; -import ftb.utils.world.*; -import ftb.utils.world.claims.*; import latmod.lib.MathHelperLM; import latmod.lib.util.Pos2I; +import serverutils.lib.*; +import serverutils.lib.api.notification.Notification; +import serverutils.utils.api.EventLMPlayerServer; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.config.ServerUtilitiesConfigGeneral; +import serverutils.utils.net.*; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.*; -public class FTBUPlayerEventHandler { +public class ServerUtilitiesPlayerEventHandler { @SubscribeEvent public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent e) { @@ -43,7 +43,7 @@ public static void playerLoggedOut(EntityPlayerMP ep) { p.setPlayer(null); // Backups.shouldRun = true; - FTBUChunkEventHandler.instance.markDirty(null); + ServerUtilitiesChunkEventHandler.instance.markDirty(null); } @SubscribeEvent @@ -58,14 +58,14 @@ public void onChunkChanged(EntityEvent.EnteringChunk e) { if (LMWorldServer.inst.settings.getWB(ep.dimension).isOutsideD(ep.posX, ep.posZ)) { ep.motionX = ep.motionY = ep.motionZ = 0D; - IChatComponent warning = FTBU.mod.chatComponent(ChunkType.WORLD_BORDER.lang + ".warning"); + IChatComponent warning = ServerUtilities.mod.chatComponent(ChunkType.WORLD_BORDER.lang + ".warning"); warning.getChatStyle().setColor(EnumChatFormatting.WHITE); Notification n = new Notification("world_border", warning, 3000); n.color = ChunkType.WORLD_BORDER.getAreaColor(player); - FTBLib.notifyPlayer(ep, n); + ServerUtilitiesLib.notifyPlayer(ep, n); if (LMWorldServer.inst.settings.getWB(player.lastPos.dim).isOutsideD(player.lastPos.x, player.lastPos.z)) { - FTBLib.printChat(ep, FTBU.mod.chatComponent("cmd.spawn_tp")); + ServerUtilitiesLib.printChat(ep, ServerUtilities.mod.chatComponent("cmd.spawn_tp")); World w = LMDimUtils.getWorld(0); Pos2I pos = LMWorldServer.inst.settings.getWB(0).pos; int posY = w.getTopSolidOrLiquidBlock(pos.x, pos.y); @@ -84,7 +84,7 @@ public void onChunkChanged(EntityEvent.EnteringChunk e) { if (type.isClaimed()) msg = new ChatComponentText(String.valueOf(LMWorldServer.inst.getPlayer(currentChunkType))); - else msg = FTBU.mod.chatComponent(type.lang); + else msg = ServerUtilities.mod.chatComponent(type.lang); msg.getChatStyle().setColor(EnumChatFormatting.WHITE); msg.getChatStyle().setBold(true); @@ -92,7 +92,7 @@ public void onChunkChanged(EntityEvent.EnteringChunk e) { Notification n = new Notification("chunk_changed", msg, 3000); n.setColor(type.getAreaColor(player)); - FTBLib.notifyPlayer(ep, n); + ServerUtilitiesLib.notifyPlayer(ep, n); } } @@ -124,7 +124,7 @@ else if (entity instanceof EntityPlayerMP && LMWorldServer.inst.getPlayer(entity int cx = MathHelperLM.chunk(e.entity.posX); int cz = MathHelperLM.chunk(e.entity.posZ); - if ((FTBUConfigGeneral.safe_spawn.getAsBoolean() && ClaimedChunks.isInSpawn(dim, cx, cz))) + if ((ServerUtilitiesConfigGeneral.safe_spawn.getAsBoolean() && ClaimedChunks.isInSpawn(dim, cx, cz))) e.setCanceled(true); /* * else { ClaimedChunk c = Claims.get(dim, cx, cz); if(c != null && c.claims.settings.isSafe()) diff --git a/src/main/java/ftb/utils/mod/handlers/FTBUWorldEventHandler.java b/src/main/java/serverutils/utils/mod/handlers/ServerUtiltiesWorldEventHandler.java similarity index 83% rename from src/main/java/ftb/utils/mod/handlers/FTBUWorldEventHandler.java rename to src/main/java/serverutils/utils/mod/handlers/ServerUtiltiesWorldEventHandler.java index d80822b6..85d3f633 100644 --- a/src/main/java/ftb/utils/mod/handlers/FTBUWorldEventHandler.java +++ b/src/main/java/serverutils/utils/mod/handlers/ServerUtiltiesWorldEventHandler.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers; +package serverutils.utils.mod.handlers; import java.io.File; import java.nio.file.Files; @@ -15,21 +15,20 @@ import com.google.gson.JsonObject; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import ftb.lib.LMNBTUtils; -import ftb.utils.api.EventLMWorldServer; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.config.FTBUConfigGeneral; -import ftb.utils.world.*; -import ftb.utils.world.claims.ClaimedChunks; import latmod.lib.*; import latmod.lib.util.Phase; +import serverutils.lib.LMNBTUtils; +import serverutils.utils.api.EventLMWorldServer; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.config.ServerUtilitiesConfigGeneral; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.ClaimedChunks; -public class FTBUWorldEventHandler // FTBLIntegration -{ +public class ServerUtiltiesWorldEventHandler { @SubscribeEvent public void worldLoaded(net.minecraftforge.event.world.WorldEvent.Load e) { - if (e.world instanceof WorldServer) FTBUChunkEventHandler.instance.markDirty(e.world); + if (e.world instanceof WorldServer) ServerUtilitiesChunkEventHandler.instance.markDirty(e.world); // Move /world/latmod/LMPlayers.txt to /world/LatMod/LMPlayers.txt try { @@ -37,7 +36,7 @@ public void worldLoaded(net.minecraftforge.event.world.WorldEvent.Load e) { Path oldFile = worldPath.resolve("latmod").resolve("LMPlayers.txt"); Path newFile = worldPath.resolve("LatMod").resolve("LMPlayers.txt"); if (oldFile.toFile().exists() && !newFile.toFile().exists()) { - FTBU.logger.info("Attempting to move " + oldFile + " to " + newFile); + ServerUtilities.logger.info("Attempting to move " + oldFile + " to " + newFile); Files.move(oldFile, newFile); } } catch (Exception ex) { @@ -102,9 +101,10 @@ public void onMobSpawned(net.minecraftforge.event.entity.EntityJoinWorldEvent e) private boolean isEntityAllowed(Entity e) { if (e instanceof EntityPlayer) return true; - if (FTBUConfigGeneral.isEntityBanned(e.getClass())) return false; + if (ServerUtilitiesConfigGeneral.isEntityBanned(e.getClass())) return false; - if (FTBUConfigGeneral.safe_spawn.getAsBoolean() && ClaimedChunks.isInSpawnD(e.dimension, e.posX, e.posZ)) { + if (ServerUtilitiesConfigGeneral.safe_spawn.getAsBoolean() + && ClaimedChunks.isInSpawnD(e.dimension, e.posX, e.posZ)) { if (e instanceof IMob) return false; else if (e instanceof EntityChicken && e.riddenByEntity != null) return false; } diff --git a/src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegration.java b/src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegration.java similarity index 73% rename from src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegration.java rename to src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegration.java index d6b24c44..aac7b44e 100644 --- a/src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegration.java +++ b/src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegration.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers.ftbl; +package serverutils.utils.mod.handlers.serverlib; import java.io.File; @@ -12,31 +12,30 @@ import com.google.gson.JsonElement; -import ftb.lib.*; -import ftb.lib.api.*; -import ftb.lib.api.friends.ILMPlayer; -import ftb.lib.api.item.LMInvUtils; -import ftb.lib.mod.FTBUIntegration; -import ftb.utils.api.*; -import ftb.utils.api.guide.ServerGuideFile; -import ftb.utils.badges.ServerBadges; -import ftb.utils.mod.FTBUTicks; -import ftb.utils.mod.config.*; -import ftb.utils.mod.handlers.FTBUChunkEventHandler; -import ftb.utils.net.*; -import ftb.utils.world.*; -import ftb.utils.world.claims.ClaimedChunks; -import ftb.utils.world.ranks.Ranks; import latmod.lib.*; import latmod.lib.util.Phase; - -public class FTBLIntegration implements FTBUIntegration // FTBLIntegrationClient -{ +import serverutils.lib.*; +import serverutils.lib.api.*; +import serverutils.lib.api.friends.ILMPlayer; +import serverutils.lib.api.item.LMInvUtils; +import serverutils.lib.mod.ServerUtilitiesIntegration; +import serverutils.utils.api.*; +import serverutils.utils.api.guide.ServerGuideFile; +import serverutils.utils.badges.ServerBadges; +import serverutils.utils.mod.ServerUtilsTicks; +import serverutils.utils.mod.config.*; +import serverutils.utils.mod.handlers.ServerUtilitiesChunkEventHandler; +import serverutils.utils.net.*; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.ClaimedChunks; +import serverutils.utils.world.ranks.Ranks; + +public class ServerUtilitiesLibraryIntegration implements ServerUtilitiesIntegration { private static boolean first_login, send_all; - public void onReloaded(EventFTBReload e) { - FTBUConfigGeneral.onReloaded(e.world.side); + public void onReloaded(EventServerUtilitiesReload e) { + ServerUtilitiesConfigGeneral.onReloaded(e.world.side); if (e.world.side.isServer()) { if (LMWorldServer.inst == null) return; @@ -47,12 +46,12 @@ public void onReloaded(EventFTBReload e) { Ranks.reload(); ServerBadges.reload(); - FTBUChunkEventHandler.instance.markDirty(null); + ServerUtilitiesChunkEventHandler.instance.markDirty(null); } } - public final void onFTBWorldServer(EventFTBWorldServer e) { - File latmodFolder = new File(FTBLib.folderWorld, "LatMod/"); + public final void onServerUtilitiesWorldServer(EventServerUtilitiesWorldServer e) { + File latmodFolder = new File(ServerUtilitiesLib.folderWorld, "LatMod/"); LMWorldServer.inst = new LMWorldServer(latmodFolder); @@ -81,19 +80,19 @@ public final void onFTBWorldServer(EventFTBWorldServer e) { new EventLMWorldServer.Loaded(LMWorldServer.inst, Phase.POST).post(); - FTBUTicks.serverStarted(); + ServerUtilsTicks.serverStarted(); } - public void onFTBWorldClient(EventFTBWorldClient e) {} + public void onServerUtilitiesWorldClient(EventServerUtilitiesWorldClient e) {} - public final void onFTBWorldServerClosed() { + public final void onServerUtilitiesWorldServerClosed() { LMWorldServer.inst.close(); LMWorldServer.inst = null; } public final void onServerTick(World w) { if (w.provider.dimensionId == 0) { - FTBUTicks.update(); + ServerUtilsTicks.update(); } } @@ -119,18 +118,18 @@ public final void onPlayerJoined(EntityPlayerMP ep, Phase phase) { new EventLMPlayerServer.LoggedIn(p, ep, first_login).post(); new MessageLMPlayerLoggedIn(p, first_login, true).sendTo(send_all ? null : ep); - for (EntityPlayerMP ep1 : FTBLib.getAllOnlinePlayers(ep)) + for (EntityPlayerMP ep1 : ServerUtilitiesLib.getAllOnlinePlayers(ep)) new MessageLMPlayerLoggedIn(p, first_login, false).sendTo(ep1); if (first_login) { - for (ItemStack is : FTBUConfigLogin.starting_items.items) { + for (ItemStack is : ServerUtilitiesConfigLogin.starting_items.items) { LMInvUtils.giveItem(ep, is); } } // new MessageLMPlayerInfo(p.playerID).sendTo(null); - for (IChatComponent c : FTBUConfigLogin.motd.components) { + for (IChatComponent c : ServerUtilitiesConfigLogin.motd.components) { ep.addChatMessage(c); } @@ -140,7 +139,7 @@ public final void onPlayerJoined(EntityPlayerMP ep, Phase phase) { new MessageAreaUpdate(p, p.getPos(), 3, 3).sendTo(ep); ServerBadges.sendToPlayer(ep); - FTBUChunkEventHandler.instance.markDirty(null); + ServerUtilitiesChunkEventHandler.instance.markDirty(null); } } diff --git a/src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegrationClient.java b/src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegrationClient.java similarity index 73% rename from src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegrationClient.java rename to src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegrationClient.java index 2219a390..79cb972a 100644 --- a/src/main/java/ftb/utils/mod/handlers/ftbl/FTBLIntegrationClient.java +++ b/src/main/java/serverutils/utils/mod/handlers/serverlib/ServerUtilitiesLibraryIntegrationClient.java @@ -1,4 +1,4 @@ -package ftb.utils.mod.handlers.ftbl; +package serverutils.utils.mod.handlers.serverlib; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; @@ -8,38 +8,38 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.*; -import ftb.lib.api.client.*; -import ftb.lib.api.client.model.CubeRenderer; -import ftb.lib.api.notification.ClientNotifications; -import ftb.lib.mod.FTBLibMod; -import ftb.utils.api.EventLMWorldClient; -import ftb.utils.api.guide.ClientGuideFile; -import ftb.utils.badges.ClientBadges; -import ftb.utils.mod.client.gui.claims.ClaimedAreasClient; -import ftb.utils.world.LMWorldClient; -import ftb.utils.world.claims.WorldBorder; import latmod.lib.*; +import serverutils.lib.api.*; +import serverutils.lib.api.client.*; +import serverutils.lib.api.client.model.CubeRenderer; +import serverutils.lib.api.notification.ClientNotifications; +import serverutils.lib.mod.ServerUtilitiesLibraryMod; +import serverutils.utils.api.EventLMWorldClient; +import serverutils.utils.api.guide.ClientGuideFile; +import serverutils.utils.badges.ClientBadges; +import serverutils.utils.mod.client.gui.claims.ClaimedAreasClient; +import serverutils.utils.world.LMWorldClient; +import serverutils.utils.world.claims.WorldBorder; @SideOnly(Side.CLIENT) -public class FTBLIntegrationClient extends FTBLIntegration { +public class ServerUtilitiesLibraryIntegrationClient extends ServerUtilitiesLibraryIntegration { public static final ResourceLocation world_border_tex = new ResourceLocation( - "ftbu", + "serverutils", "textures/map/world_border.png"); private static final CubeRenderer worldBorderRenderer = new CubeRenderer(); - public void onReloaded(EventFTBReload e) { + public void onReloaded(EventServerUtilitiesReload e) { super.onReloaded(e); if (e.world.side.isClient()) { - FTBLibClient.clearCachedData(); + ServerUtilitiesLibraryClient.clearCachedData(); ClientBadges.clearPlayerBadges(); ClientGuideFile.instance.reload(e); } } - public void onFTBWorldClient(EventFTBWorldClient e) { + public void onServerUtilitiesWorldClient(EventServerUtilitiesWorldClient e) { ClientNotifications.init(); ClaimedAreasClient.clear(); @@ -52,7 +52,7 @@ public void onFTBWorldClient(EventFTBWorldClient e) { public void readWorldData(ByteIOStream io) { LMWorldClient.inst = new LMWorldClient(io.readInt()); LMWorldClient.inst.readDataFromNet(io, true); - FTBLibMod.logger.info("Joined the server with PlayerID " + LMWorldClient.inst.clientPlayerID); + ServerUtilitiesLibraryMod.logger.info("Joined the server with PlayerID " + LMWorldClient.inst.clientPlayerID); new EventLMWorldClient(LMWorldClient.inst, false).post(); } @@ -62,9 +62,11 @@ public boolean hasClientWorld() { } public void renderWorld(float pt) { - if (!FTBLibClient.isIngameWithFTBU() || !LMWorldClient.inst.settings.border_enabled.getAsBoolean()) return; + if (!ServerUtilitiesLibraryClient.isIngameWithServerUtilities() + || !LMWorldClient.inst.settings.border_enabled.getAsBoolean()) + return; - WorldBorder wb = LMWorldClient.inst.settings.getWB(FTBLibClient.getDim()); + WorldBorder wb = LMWorldClient.inst.settings.getWB(ServerUtilitiesLibraryClient.getDim()); int s = wb.getSize(); if (s <= 0) return; @@ -88,8 +90,8 @@ public void renderWorld(float pt) { GlStateManager.depthMask(false); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.enableTexture2D(); - FTBLibClient.pushMaxBrightness(); - FTBLibClient.setTexture(world_border_tex); + ServerUtilitiesLibraryClient.pushMaxBrightness(); + ServerUtilitiesLibraryClient.setTexture(world_border_tex); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); @@ -130,7 +132,7 @@ public void renderWorld(float pt) { GlStateManager.popMatrix(); GlStateManager.shadeModel(GL11.GL_FLAT); - FTBLibClient.popMaxBrightness(); + ServerUtilitiesLibraryClient.popMaxBrightness(); GlStateManager.depthMask(true); GlStateManager.popAttrib(); } diff --git a/src/main/java/ftb/utils/net/ClientAction.java b/src/main/java/serverutils/utils/net/ClientAction.java similarity index 97% rename from src/main/java/ftb/utils/net/ClientAction.java rename to src/main/java/serverutils/utils/net/ClientAction.java index ec62ba38..66cc24eb 100644 --- a/src/main/java/ftb/utils/net/ClientAction.java +++ b/src/main/java/serverutils/utils/net/ClientAction.java @@ -1,9 +1,9 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.HashMap; -import ftb.utils.api.guide.ServerGuideFile; -import ftb.utils.world.*; +import serverutils.utils.api.guide.ServerGuideFile; +import serverutils.utils.world.*; public abstract class ClientAction { diff --git a/src/main/java/ftb/utils/net/MessageAreaRequest.java b/src/main/java/serverutils/utils/net/MessageAreaRequest.java similarity index 78% rename from src/main/java/ftb/utils/net/MessageAreaRequest.java rename to src/main/java/serverutils/utils/net/MessageAreaRequest.java index 5983b7cd..91d3e123 100644 --- a/src/main/java/ftb/utils/net/MessageAreaRequest.java +++ b/src/main/java/serverutils/utils/net/MessageAreaRequest.java @@ -1,13 +1,13 @@ -package ftb.utils.net; +package serverutils.utils.net; import net.minecraft.entity.player.EntityPlayerMP; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.world.LMWorldServer; import latmod.lib.*; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.world.LMWorldServer; -public class MessageAreaRequest extends MessageFTBU { +public class MessageAreaRequest extends MessageServerUtilities { public MessageAreaRequest() { super(ByteCount.BYTE); @@ -22,7 +22,7 @@ public MessageAreaRequest(int x, int y, int w, int h) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_WORLD; + return ServerUtilitiesNetHandler.NET_WORLD; } public IMessage onMessage(MessageContext ctx) { diff --git a/src/main/java/ftb/utils/net/MessageAreaUpdate.java b/src/main/java/serverutils/utils/net/MessageAreaUpdate.java similarity index 81% rename from src/main/java/ftb/utils/net/MessageAreaUpdate.java rename to src/main/java/serverutils/utils/net/MessageAreaUpdate.java index 661de31e..62a20d9a 100644 --- a/src/main/java/ftb/utils/net/MessageAreaUpdate.java +++ b/src/main/java/serverutils/utils/net/MessageAreaUpdate.java @@ -1,15 +1,15 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.BlockDimPos; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.mod.client.gui.claims.ClaimedAreasClient; -import ftb.utils.world.*; -import ftb.utils.world.claims.ChunkType; import latmod.lib.*; +import serverutils.lib.BlockDimPos; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.mod.client.gui.claims.ClaimedAreasClient; +import serverutils.utils.world.*; +import serverutils.utils.world.claims.ChunkType; -public class MessageAreaUpdate extends MessageFTBU { +public class MessageAreaUpdate extends MessageServerUtilities { public MessageAreaUpdate() { super(ByteCount.INT); @@ -40,7 +40,7 @@ public MessageAreaUpdate(LMPlayerServer p, BlockDimPos pos, int sx, int sz) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_WORLD; + return ServerUtilitiesNetHandler.NET_WORLD; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ftb/utils/net/MessageClaimChunk.java b/src/main/java/serverutils/utils/net/MessageClaimChunk.java similarity index 85% rename from src/main/java/ftb/utils/net/MessageClaimChunk.java rename to src/main/java/serverutils/utils/net/MessageClaimChunk.java index ea045d9b..b40289be 100644 --- a/src/main/java/ftb/utils/net/MessageClaimChunk.java +++ b/src/main/java/serverutils/utils/net/MessageClaimChunk.java @@ -1,15 +1,15 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import ftb.lib.LMAccessToken; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.world.LMPlayerServer; -import ftb.utils.world.LMWorldServer; -import ftb.utils.world.claims.ClaimedChunk; import latmod.lib.ByteCount; +import serverutils.lib.LMAccessToken; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.world.LMPlayerServer; +import serverutils.utils.world.LMWorldServer; +import serverutils.utils.world.claims.ClaimedChunk; -public class MessageClaimChunk extends MessageFTBU { +public class MessageClaimChunk extends MessageServerUtilities { public static final int ID_CLAIM = 0; public static final int ID_UNCLAIM = 1; @@ -32,7 +32,7 @@ public MessageClaimChunk(int d, long t, int x, int z, int c) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_WORLD; + return ServerUtilitiesNetHandler.NET_WORLD; } public IMessage onMessage(MessageContext ctx) { diff --git a/src/main/java/ftb/utils/net/MessageClientAction.java b/src/main/java/serverutils/utils/net/MessageClientAction.java similarity index 83% rename from src/main/java/ftb/utils/net/MessageClientAction.java rename to src/main/java/serverutils/utils/net/MessageClientAction.java index a197e215..dd160581 100644 --- a/src/main/java/ftb/utils/net/MessageClientAction.java +++ b/src/main/java/serverutils/utils/net/MessageClientAction.java @@ -1,10 +1,10 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.utils.world.*; -public class MessageClientAction extends MessageFTBU { +public class MessageClientAction extends MessageServerUtilities { public MessageClientAction() { super(ByteCount.BYTE); diff --git a/src/main/java/ftb/utils/net/MessageDisplayGuide.java b/src/main/java/serverutils/utils/net/MessageDisplayGuide.java similarity index 61% rename from src/main/java/ftb/utils/net/MessageDisplayGuide.java rename to src/main/java/serverutils/utils/net/MessageDisplayGuide.java index a5b62c09..baa9a410 100644 --- a/src/main/java/ftb/utils/net/MessageDisplayGuide.java +++ b/src/main/java/serverutils/utils/net/MessageDisplayGuide.java @@ -1,15 +1,15 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.api.guide.GuidePage; -import ftb.utils.mod.client.gui.guide.GuiGuide; import latmod.lib.ByteCount; import latmod.lib.json.JsonElementIO; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.api.guide.GuidePage; +import serverutils.utils.mod.client.gui.guide.GuiGuide; -public class MessageDisplayGuide extends MessageFTBU { +public class MessageDisplayGuide extends MessageServerUtilities { public MessageDisplayGuide() { super(ByteCount.INT); @@ -23,14 +23,14 @@ public MessageDisplayGuide(GuidePage file) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_INFO; + return ServerUtilitiesNetHandler.NET_INFO; } @SideOnly(Side.CLIENT) public IMessage onMessage(MessageContext ctx) { GuidePage file = new GuidePage(io.readUTF()); file.func_152753_a(JsonElementIO.read(io)); - FTBLibClient.openGui(new GuiGuide(null, file)); + ServerUtilitiesLibraryClient.openGui(new GuiGuide(null, file)); return null; } } diff --git a/src/main/java/ftb/utils/net/MessageLMPlayerDied.java b/src/main/java/serverutils/utils/net/MessageLMPlayerDied.java similarity index 74% rename from src/main/java/ftb/utils/net/MessageLMPlayerDied.java rename to src/main/java/serverutils/utils/net/MessageLMPlayerDied.java index 345d311e..2ccd7123 100644 --- a/src/main/java/ftb/utils/net/MessageLMPlayerDied.java +++ b/src/main/java/serverutils/utils/net/MessageLMPlayerDied.java @@ -1,12 +1,12 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.api.EventLMPlayerClient; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.utils.api.EventLMPlayerClient; +import serverutils.utils.world.*; -public class MessageLMPlayerDied extends MessageFTBU { +public class MessageLMPlayerDied extends MessageServerUtilities { public MessageLMPlayerDied() { super(ByteCount.BYTE); diff --git a/src/main/java/ftb/utils/net/MessageLMPlayerInfo.java b/src/main/java/serverutils/utils/net/MessageLMPlayerInfo.java similarity index 80% rename from src/main/java/ftb/utils/net/MessageLMPlayerInfo.java rename to src/main/java/serverutils/utils/net/MessageLMPlayerInfo.java index ab356d3a..bdbda105 100644 --- a/src/main/java/ftb/utils/net/MessageLMPlayerInfo.java +++ b/src/main/java/serverutils/utils/net/MessageLMPlayerInfo.java @@ -1,4 +1,4 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.*; @@ -7,13 +7,13 @@ import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.lib.api.item.LMInvUtils; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.world.*; import latmod.lib.*; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.lib.api.item.LMInvUtils; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.world.*; -public class MessageLMPlayerInfo extends MessageFTBU { +public class MessageLMPlayerInfo extends MessageServerUtilities { public MessageLMPlayerInfo() { super(ByteCount.INT); @@ -42,7 +42,7 @@ public MessageLMPlayerInfo(LMPlayerServer owner, int playerID) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_INFO; + return ServerUtilitiesNetHandler.NET_INFO; } @SideOnly(Side.CLIENT) @@ -61,7 +61,7 @@ public IMessage onMessage(MessageContext ctx) { p.friends.clear(); p.friends.addAll(io.readIntArray(ByteCount.SHORT)); - FTBLibClient.onGuiClientAction(); + ServerUtilitiesLibraryClient.onGuiClientAction(); return null; } } diff --git a/src/main/java/ftb/utils/net/MessageLMPlayerLoggedIn.java b/src/main/java/serverutils/utils/net/MessageLMPlayerLoggedIn.java similarity index 87% rename from src/main/java/ftb/utils/net/MessageLMPlayerLoggedIn.java rename to src/main/java/serverutils/utils/net/MessageLMPlayerLoggedIn.java index b5c4b468..daa03fc9 100644 --- a/src/main/java/ftb/utils/net/MessageLMPlayerLoggedIn.java +++ b/src/main/java/serverutils/utils/net/MessageLMPlayerLoggedIn.java @@ -1,4 +1,4 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.UUID; @@ -6,11 +6,11 @@ import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.api.EventLMPlayerClient; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.utils.api.EventLMPlayerClient; +import serverutils.utils.world.*; -public class MessageLMPlayerLoggedIn extends MessageFTBU { +public class MessageLMPlayerLoggedIn extends MessageServerUtilities { public MessageLMPlayerLoggedIn() { super(ByteCount.INT); diff --git a/src/main/java/ftb/utils/net/MessageLMPlayerLoggedOut.java b/src/main/java/serverutils/utils/net/MessageLMPlayerLoggedOut.java similarity index 76% rename from src/main/java/ftb/utils/net/MessageLMPlayerLoggedOut.java rename to src/main/java/serverutils/utils/net/MessageLMPlayerLoggedOut.java index 2f6e6c57..e167cdde 100644 --- a/src/main/java/ftb/utils/net/MessageLMPlayerLoggedOut.java +++ b/src/main/java/serverutils/utils/net/MessageLMPlayerLoggedOut.java @@ -1,12 +1,12 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.api.EventLMPlayerClient; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.utils.api.EventLMPlayerClient; +import serverutils.utils.world.*; -public class MessageLMPlayerLoggedOut extends MessageFTBU { +public class MessageLMPlayerLoggedOut extends MessageServerUtilities { public MessageLMPlayerLoggedOut() { super(ByteCount.BYTE); diff --git a/src/main/java/ftb/utils/net/MessageLMPlayerUpdate.java b/src/main/java/serverutils/utils/net/MessageLMPlayerUpdate.java similarity index 69% rename from src/main/java/ftb/utils/net/MessageLMPlayerUpdate.java rename to src/main/java/serverutils/utils/net/MessageLMPlayerUpdate.java index 65c503bb..14f9c494 100644 --- a/src/main/java/ftb/utils/net/MessageLMPlayerUpdate.java +++ b/src/main/java/serverutils/utils/net/MessageLMPlayerUpdate.java @@ -1,13 +1,13 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.utils.api.EventLMPlayerClient; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.utils.api.EventLMPlayerClient; +import serverutils.utils.world.*; -public class MessageLMPlayerUpdate extends MessageFTBU { +public class MessageLMPlayerUpdate extends MessageServerUtilities { public MessageLMPlayerUpdate() { super(ByteCount.INT); @@ -26,7 +26,7 @@ public IMessage onMessage(MessageContext ctx) { boolean self = io.readBoolean(); p.readFromNet(io, self); new EventLMPlayerClient.DataChanged(p).post(); - FTBLibClient.onGuiClientAction(); + ServerUtilitiesLibraryClient.onGuiClientAction(); return null; } } diff --git a/src/main/java/ftb/utils/net/MessageLMWorldUpdate.java b/src/main/java/serverutils/utils/net/MessageLMWorldUpdate.java similarity index 78% rename from src/main/java/ftb/utils/net/MessageLMWorldUpdate.java rename to src/main/java/serverutils/utils/net/MessageLMWorldUpdate.java index 3b40fe2c..400e441d 100644 --- a/src/main/java/ftb/utils/net/MessageLMWorldUpdate.java +++ b/src/main/java/serverutils/utils/net/MessageLMWorldUpdate.java @@ -1,11 +1,11 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.utils.world.*; import latmod.lib.ByteCount; +import serverutils.utils.world.*; -public class MessageLMWorldUpdate extends MessageFTBU { +public class MessageLMWorldUpdate extends MessageServerUtilities { public MessageLMWorldUpdate() { super(ByteCount.INT); diff --git a/src/main/java/ftb/utils/net/MessageRequestBadge.java b/src/main/java/serverutils/utils/net/MessageRequestBadge.java similarity index 70% rename from src/main/java/ftb/utils/net/MessageRequestBadge.java rename to src/main/java/serverutils/utils/net/MessageRequestBadge.java index 1aa2800a..53118024 100644 --- a/src/main/java/ftb/utils/net/MessageRequestBadge.java +++ b/src/main/java/serverutils/utils/net/MessageRequestBadge.java @@ -1,13 +1,13 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.UUID; import cpw.mods.fml.common.network.simpleimpl.*; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.badges.*; import latmod.lib.ByteCount; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.badges.*; -public class MessageRequestBadge extends MessageFTBU { +public class MessageRequestBadge extends MessageServerUtilities { public MessageRequestBadge() { super(ByteCount.BYTE); @@ -19,7 +19,7 @@ public MessageRequestBadge(UUID id) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_INFO; + return ServerUtilitiesNetHandler.NET_INFO; } public IMessage onMessage(MessageContext ctx) { diff --git a/src/main/java/ftb/utils/net/MessageSendBadge.java b/src/main/java/serverutils/utils/net/MessageSendBadge.java similarity index 72% rename from src/main/java/ftb/utils/net/MessageSendBadge.java rename to src/main/java/serverutils/utils/net/MessageSendBadge.java index a82c9ae7..8486e359 100644 --- a/src/main/java/ftb/utils/net/MessageSendBadge.java +++ b/src/main/java/serverutils/utils/net/MessageSendBadge.java @@ -1,14 +1,14 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.UUID; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.badges.ClientBadges; import latmod.lib.ByteCount; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.badges.ClientBadges; -public class MessageSendBadge extends MessageFTBU { +public class MessageSendBadge extends MessageServerUtilities { public MessageSendBadge() { super(ByteCount.BYTE); @@ -21,7 +21,7 @@ public MessageSendBadge(UUID player, String id) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_INFO; + return ServerUtilitiesNetHandler.NET_INFO; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/serverutils/utils/net/MessageServerUtilities.java b/src/main/java/serverutils/utils/net/MessageServerUtilities.java new file mode 100644 index 00000000..2924e6a5 --- /dev/null +++ b/src/main/java/serverutils/utils/net/MessageServerUtilities.java @@ -0,0 +1,15 @@ +package serverutils.utils.net; + +import latmod.lib.ByteCount; +import serverutils.lib.api.net.*; + +abstract class MessageServerUtilities extends MessageLM { + + public MessageServerUtilities(ByteCount t) { + super(t); + } + + public LMNetworkWrapper getWrapper() { + return ServerUtilitiesNetHandler.NET; + } +} diff --git a/src/main/java/ftb/utils/net/MessageUpdateBadges.java b/src/main/java/serverutils/utils/net/MessageUpdateBadges.java similarity index 80% rename from src/main/java/ftb/utils/net/MessageUpdateBadges.java rename to src/main/java/serverutils/utils/net/MessageUpdateBadges.java index ab9916ea..afe8960f 100644 --- a/src/main/java/ftb/utils/net/MessageUpdateBadges.java +++ b/src/main/java/serverutils/utils/net/MessageUpdateBadges.java @@ -1,14 +1,14 @@ -package ftb.utils.net; +package serverutils.utils.net; import java.util.Collection; import cpw.mods.fml.common.network.simpleimpl.*; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.net.LMNetworkWrapper; -import ftb.utils.badges.*; import latmod.lib.ByteCount; +import serverutils.lib.api.net.LMNetworkWrapper; +import serverutils.utils.badges.*; -public class MessageUpdateBadges extends MessageFTBU { +public class MessageUpdateBadges extends MessageServerUtilities { public MessageUpdateBadges() { super(ByteCount.INT); @@ -27,7 +27,7 @@ public MessageUpdateBadges(Collection badges) { } public LMNetworkWrapper getWrapper() { - return FTBUNetHandler.NET_INFO; + return ServerUtilitiesNetHandler.NET_INFO; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ftb/utils/net/FTBUNetHandler.java b/src/main/java/serverutils/utils/net/ServerUtilitiesNetHandler.java similarity index 89% rename from src/main/java/ftb/utils/net/FTBUNetHandler.java rename to src/main/java/serverutils/utils/net/ServerUtilitiesNetHandler.java index 2bd406e3..d27db0ca 100644 --- a/src/main/java/ftb/utils/net/FTBUNetHandler.java +++ b/src/main/java/serverutils/utils/net/ServerUtilitiesNetHandler.java @@ -1,13 +1,13 @@ -package ftb.utils.net; +package serverutils.utils.net; import cpw.mods.fml.relauncher.Side; -import ftb.lib.api.net.LMNetworkWrapper; +import serverutils.lib.api.net.LMNetworkWrapper; -public class FTBUNetHandler { +public class ServerUtilitiesNetHandler { - static final LMNetworkWrapper NET = LMNetworkWrapper.newWrapper("FTBU"); - static final LMNetworkWrapper NET_INFO = LMNetworkWrapper.newWrapper("FTBUI"); - static final LMNetworkWrapper NET_WORLD = LMNetworkWrapper.newWrapper("FTBUW"); + static final LMNetworkWrapper NET = LMNetworkWrapper.newWrapper("SVRU"); + static final LMNetworkWrapper NET_INFO = LMNetworkWrapper.newWrapper("SVRUI"); + static final LMNetworkWrapper NET_WORLD = LMNetworkWrapper.newWrapper("SVRUW"); public static void init() { // NET.register(MessageLMWorldJoined.class, 1, Side.CLIENT); diff --git a/src/main/java/ftb/utils/world/Backups.java b/src/main/java/serverutils/utils/world/Backups.java similarity index 56% rename from src/main/java/ftb/utils/world/Backups.java rename to src/main/java/serverutils/utils/world/Backups.java index 50d2ed0a..bda69394 100644 --- a/src/main/java/ftb/utils/world/Backups.java +++ b/src/main/java/serverutils/utils/world/Backups.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.io.File; import java.util.Arrays; @@ -11,14 +11,14 @@ import org.apache.logging.log4j.*; -import ftb.lib.*; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.config.FTBUConfigBackups; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.config.ServerUtilitiesConfigBackups; public class Backups { - public static final Logger logger = LogManager.getLogger("FTBU Backups"); + public static final Logger logger = LogManager.getLogger("ServerUtilities Backups"); public static File backupsFolder; public static long nextBackup = -1L; @@ -26,8 +26,9 @@ public class Backups { public static boolean hadPlayer = false; public static void init() { - backupsFolder = FTBUConfigBackups.folder.getAsString().isEmpty() ? new File(FTBLib.folderMinecraft, "/backups/") - : new File(FTBUConfigBackups.folder.getAsString()); + backupsFolder = ServerUtilitiesConfigBackups.folder.getAsString().isEmpty() + ? new File(ServerUtilitiesLib.folderMinecraft, "/backups/") + : new File(ServerUtilitiesConfigBackups.folder.getAsString()); if (!backupsFolder.exists()) backupsFolder.mkdirs(); thread = null; clearOldBackups(); @@ -38,32 +39,32 @@ public static boolean run(ICommandSender ics) { if (thread != null) return false; boolean auto = !(ics instanceof EntityPlayerMP); - if (auto && !FTBUConfigBackups.enabled.getAsBoolean()) return false; + if (auto && !ServerUtilitiesConfigBackups.enabled.getAsBoolean()) return false; - World w = FTBLib.getServerWorld(); + World w = ServerUtilitiesLib.getServerWorld(); if (w == null) return false; - nextBackup = LMUtils.millis() + FTBUConfigBackups.backupMillis(); + nextBackup = LMUtils.millis() + ServerUtilitiesConfigBackups.backupMillis(); - if (auto && FTBUConfigBackups.need_online_players.getAsBoolean()) { - if (!FTBLib.hasOnlinePlayers() && !hadPlayer) return true; + if (auto && ServerUtilitiesConfigBackups.need_online_players.getAsBoolean()) { + if (!ServerUtilitiesLib.hasOnlinePlayers() && !hadPlayer) return true; hadPlayer = false; } - IChatComponent c = FTBU.mod.chatComponent("cmd.backup_start", ics.getCommandSenderName()); + IChatComponent c = ServerUtilities.mod.chatComponent("cmd.backup_start", ics.getCommandSenderName()); c.getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE); BroadcastSender.inst.addChatMessage(c); try { - new CommandSaveOff().processCommand(FTBLib.getServer(), new String[0]); - new CommandSaveAll().processCommand(FTBLib.getServer(), new String[0]); + new CommandSaveOff().processCommand(ServerUtilitiesLib.getServer(), new String[0]); + new CommandSaveAll().processCommand(ServerUtilitiesLib.getServer(), new String[0]); } catch (Exception ex) { ex.printStackTrace(); } File wd = w.getSaveHandler().getWorldDirectory(); - if (FTBUConfigBackups.use_separate_thread.getAsBoolean()) { + if (ServerUtilitiesConfigBackups.use_separate_thread.getAsBoolean()) { thread = new ThreadBackup(wd); thread.start(); } else { @@ -76,10 +77,10 @@ public static boolean run(ICommandSender ics) { public static void clearOldBackups() { String[] s = backupsFolder.list(); - if (s.length > FTBUConfigBackups.backups_to_keep.getAsInt()) { + if (s.length > ServerUtilitiesConfigBackups.backups_to_keep.getAsInt()) { Arrays.sort(s); - int j = s.length - FTBUConfigBackups.backups_to_keep.getAsInt(); + int j = s.length - ServerUtilitiesConfigBackups.backups_to_keep.getAsInt(); logger.info("Deleting " + j + " old backups"); for (int i = 0; i < j; i++) { @@ -94,7 +95,7 @@ public static void clearOldBackups() { public static void postBackup() { try { - new CommandSaveOn().processCommand(FTBLib.getServer(), new String[0]); + new CommandSaveOn().processCommand(ServerUtilitiesLib.getServer(), new String[0]); } catch (Exception ex) { ex.printStackTrace(); } diff --git a/src/main/java/ftb/utils/world/LMFakeServerPlayer.java b/src/main/java/serverutils/utils/world/LMFakeServerPlayer.java similarity index 94% rename from src/main/java/ftb/utils/world/LMFakeServerPlayer.java rename to src/main/java/serverutils/utils/world/LMFakeServerPlayer.java index dc28d97c..67374ddd 100644 --- a/src/main/java/ftb/utils/world/LMFakeServerPlayer.java +++ b/src/main/java/serverutils/utils/world/LMFakeServerPlayer.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.List; @@ -6,7 +6,7 @@ import net.minecraft.util.IChatComponent; import net.minecraftforge.common.util.FakePlayer; -import ftb.utils.world.ranks.*; +import serverutils.utils.world.ranks.*; public class LMFakeServerPlayer extends LMPlayerServer { diff --git a/src/main/java/ftb/utils/world/LMPlayer.java b/src/main/java/serverutils/utils/world/LMPlayer.java similarity index 97% rename from src/main/java/ftb/utils/world/LMPlayer.java rename to src/main/java/serverutils/utils/world/LMPlayer.java index 25f432bc..7a821c47 100644 --- a/src/main/java/ftb/utils/world/LMPlayer.java +++ b/src/main/java/serverutils/utils/world/LMPlayer.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -8,8 +8,8 @@ import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.*; -import ftb.lib.api.friends.ILMPlayer; import latmod.lib.*; +import serverutils.lib.api.friends.ILMPlayer; public abstract class LMPlayer implements ILMPlayer, Comparable // LMPlayerServer // LMPlayerClient { diff --git a/src/main/java/ftb/utils/world/LMPlayerClient.java b/src/main/java/serverutils/utils/world/LMPlayerClient.java similarity index 85% rename from src/main/java/ftb/utils/world/LMPlayerClient.java rename to src/main/java/serverutils/utils/world/LMPlayerClient.java index dfb31e01..44022155 100644 --- a/src/main/java/ftb/utils/world/LMPlayerClient.java +++ b/src/main/java/serverutils/utils/world/LMPlayerClient.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -8,10 +8,10 @@ import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.*; -import ftb.lib.LMNBTUtils; -import ftb.lib.api.client.FTBLibClient; -import ftb.utils.api.EventLMPlayerClient; import latmod.lib.*; +import serverutils.lib.LMNBTUtils; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.utils.api.EventLMPlayerClient; @SideOnly(Side.CLIENT) public class LMPlayerClient extends LMPlayer // LMPlayerServer // LMPlayerClientSelf @@ -29,7 +29,7 @@ public LMPlayerClient(LMWorldClient w, int i, GameProfile gp) { } public ResourceLocation getSkin() { - return FTBLibClient.getSkinTexture(getProfile().getName()); + return ServerUtilitiesLibraryClient.getSkinTexture(getProfile().getName()); } public LMWorld getWorld() { @@ -57,7 +57,7 @@ public LMPlayerClientSelf toPlayerSPSelf() { } public EntityPlayerSP getPlayer() { - return isOnline() ? FTBLibClient.getPlayerSP(getProfile().getId()) : null; + return isOnline() ? ServerUtilitiesLibraryClient.getPlayerSP(getProfile().getId()) : null; } public void receiveInfo(List info) { diff --git a/src/main/java/ftb/utils/world/LMPlayerClientSelf.java b/src/main/java/serverutils/utils/world/LMPlayerClientSelf.java similarity index 94% rename from src/main/java/ftb/utils/world/LMPlayerClientSelf.java rename to src/main/java/serverutils/utils/world/LMPlayerClientSelf.java index 4a0bcd75..23dff29c 100644 --- a/src/main/java/ftb/utils/world/LMPlayerClientSelf.java +++ b/src/main/java/serverutils/utils/world/LMPlayerClientSelf.java @@ -1,9 +1,9 @@ -package ftb.utils.world; +package serverutils.utils.world; import com.mojang.authlib.GameProfile; -import ftb.lib.LMNBTUtils; import latmod.lib.ByteIOStream; +import serverutils.lib.LMNBTUtils; public class LMPlayerClientSelf extends LMPlayerClient { diff --git a/src/main/java/ftb/utils/world/LMPlayerServer.java b/src/main/java/serverutils/utils/world/LMPlayerServer.java similarity index 88% rename from src/main/java/ftb/utils/world/LMPlayerServer.java rename to src/main/java/serverutils/utils/world/LMPlayerServer.java index 587e67a9..2ee751b1 100644 --- a/src/main/java/ftb/utils/world/LMPlayerServer.java +++ b/src/main/java/serverutils/utils/world/LMPlayerServer.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -12,17 +12,17 @@ import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.*; -import ftb.lib.*; -import ftb.lib.api.item.StringIDInvLoader; -import ftb.lib.api.notification.*; -import ftb.utils.api.EventLMPlayerServer; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.client.FTBUClickAction; -import ftb.utils.mod.handlers.FTBUChunkEventHandler; -import ftb.utils.net.*; -import ftb.utils.world.claims.*; -import ftb.utils.world.ranks.*; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.lib.api.item.StringIDInvLoader; +import serverutils.lib.api.notification.*; +import serverutils.utils.api.EventLMPlayerServer; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.client.ServerUtilitiesClickAction; +import serverutils.utils.mod.handlers.ServerUtilitiesChunkEventHandler; +import serverutils.utils.net.*; +import serverutils.utils.world.claims.*; +import serverutils.utils.world.ranks.*; public class LMPlayerServer extends LMPlayer // LMPlayerClient { @@ -100,13 +100,13 @@ public void sendUpdate() { new MessageLMPlayerUpdate(this, true).sendTo(getPlayer()); } - for (EntityPlayerMP ep : FTBLib.getAllOnlinePlayers(getPlayer())) { + for (EntityPlayerMP ep : ServerUtilitiesLib.getAllOnlinePlayers(getPlayer())) { new MessageLMPlayerUpdate(this, false).sendTo(ep); } } public boolean isOP() { - return FTBLib.isOP(getProfile()); + return ServerUtilitiesLib.isOP(getProfile()); } public BlockDimPos getPos() { @@ -126,11 +126,11 @@ public void getInfo(LMPlayerServer owner, List info) { boolean raw2 = owner.isFriendRaw(this); if (raw1 && raw2) { - IChatComponent c = FTBU.mod.chatComponent("label.friend"); + IChatComponent c = ServerUtilities.mod.chatComponent("label.friend"); c.getChatStyle().setColor(EnumChatFormatting.GREEN); info.add(c); } else if (raw1 || raw2) { - IChatComponent c = FTBU.mod.chatComponent("label.pfriend"); + IChatComponent c = ServerUtilities.mod.chatComponent("label.pfriend"); c.getChatStyle().setColor(raw1 ? EnumChatFormatting.GOLD : EnumChatFormatting.BLUE); info.add(c); } @@ -269,19 +269,19 @@ public void checkNewFriends() { } if (requests.size() > 0) { - IChatComponent cc = FTBU.mod.chatComponent("label.new_friends"); + IChatComponent cc = ServerUtilities.mod.chatComponent("label.new_friends"); cc.getChatStyle().setColor(EnumChatFormatting.GREEN); Notification n = new Notification("new_friend_requests", cc, 6000); - n.setDesc(FTBU.mod.chatComponent("label.new_friends_click")); + n.setDesc(ServerUtilities.mod.chatComponent("label.new_friends_click")); MouseAction mouse = new MouseAction(); - mouse.click = new ClickAction(FTBUClickAction.FRIEND_ADD_ALL, null); + mouse.click = new ClickAction(ServerUtilitiesClickAction.FRIEND_ADD_ALL, null); Collections.sort(requests, null); for (String s : requests) mouse.hover.add(new ChatComponentText(s)); n.setMouseAction(mouse); - FTBLib.notifyPlayer(getPlayer(), n); + ServerUtilitiesLib.notifyPlayer(getPlayer(), n); } } } @@ -356,7 +356,7 @@ public void setLoaded(int dim, int cx, int cz, boolean flag) { } chunk.isChunkloaded = flag; - FTBUChunkEventHandler.instance.markDirty(LMDimUtils.getWorld(dim)); + ServerUtilitiesChunkEventHandler.instance.markDirty(LMDimUtils.getWorld(dim)); if (getPlayer() != null) new MessageAreaUpdate(this, cx, cz, dim, 1, 1).sendTo(getPlayer()); sendUpdate(); @@ -369,7 +369,7 @@ public boolean allowInteractSecure() { public StatisticsFile getStatFile(boolean force) { if (isOnline()) return getPlayer().func_147099_x(); - return force ? FTBLib.getServer().getConfigurationManager() - .func_152602_a(new FakePlayer(FTBLib.getServerWorld(), getProfile())) : null; + return force ? ServerUtilitiesLib.getServer().getConfigurationManager() + .func_152602_a(new FakePlayer(ServerUtilitiesLib.getServerWorld(), getProfile())) : null; } } diff --git a/src/main/java/ftb/utils/world/LMPlayerStats.java b/src/main/java/serverutils/utils/world/LMPlayerStats.java similarity index 82% rename from src/main/java/ftb/utils/world/LMPlayerStats.java rename to src/main/java/serverutils/utils/world/LMPlayerStats.java index 38ff6cb9..5c152fb1 100644 --- a/src/main/java/ftb/utils/world/LMPlayerStats.java +++ b/src/main/java/serverutils/utils/world/LMPlayerStats.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.List; @@ -6,8 +6,8 @@ import net.minecraft.stats.*; import net.minecraft.util.*; -import ftb.utils.mod.FTBU; import latmod.lib.*; +import serverutils.utils.mod.ServerUtilities; public class LMPlayerStats { @@ -31,10 +31,10 @@ public void refresh(LMPlayerServer player, boolean force) { public void getInfo(LMPlayerServer owner, List info, long ms) { if (lastSeen > 0L && !owner.isOnline()) - info.add(FTBU.mod.chatComponent("label.last_seen", LMStringUtils.getTimeString(ms - lastSeen))); + info.add(ServerUtilities.mod.chatComponent("label.last_seen", LMStringUtils.getTimeString(ms - lastSeen))); if (firstJoined > 0L) - info.add(FTBU.mod.chatComponent("label.joined", LMStringUtils.getTimeString(ms - firstJoined))); - if (deaths > 0) info.add(FTBU.mod.chatComponent("label.deaths", String.valueOf(deaths))); + info.add(ServerUtilities.mod.chatComponent("label.joined", LMStringUtils.getTimeString(ms - firstJoined))); + if (deaths > 0) info.add(ServerUtilities.mod.chatComponent("label.deaths", String.valueOf(deaths))); if (timePlayed > 0L) info.add( new ChatComponentTranslation("stat.playOneMinute") .appendSibling(new ChatComponentText(": " + LMStringUtils.getTimeString(timePlayed)))); diff --git a/src/main/java/ftb/utils/world/LMWorld.java b/src/main/java/serverutils/utils/world/LMWorld.java similarity index 88% rename from src/main/java/ftb/utils/world/LMWorld.java rename to src/main/java/serverutils/utils/world/LMWorld.java index 6c0c6193..d41f6ca3 100644 --- a/src/main/java/ftb/utils/world/LMWorld.java +++ b/src/main/java/serverutils/utils/world/LMWorld.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -7,22 +7,21 @@ import net.minecraftforge.common.util.FakePlayer; import cpw.mods.fml.relauncher.*; -import ftb.lib.FTBLib; -import ftb.lib.api.config.ConfigGroup; -import ftb.utils.mod.FTBU; -import ftb.utils.world.claims.LMWorldSettings; import latmod.lib.LMUtils; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.claims.LMWorldSettings; -public abstract class LMWorld // FTBWorld -{ +public abstract class LMWorld { public static LMWorld getWorld(Side s) { if (s.isServer()) return LMWorldServer.inst; - return FTBU.proxy.getClientWorldLM(); + return ServerUtilities.proxy.getClientWorldLM(); } public static LMWorld getWorld() { - return getWorld(FTBLib.getEffectiveSide()); + return getWorld(ServerUtilitiesLib.getEffectiveSide()); } public final Side side; diff --git a/src/main/java/ftb/utils/world/LMWorldClient.java b/src/main/java/serverutils/utils/world/LMWorldClient.java similarity index 83% rename from src/main/java/ftb/utils/world/LMWorldClient.java rename to src/main/java/serverutils/utils/world/LMWorldClient.java index e8c519d1..a659ed8f 100644 --- a/src/main/java/ftb/utils/world/LMWorldClient.java +++ b/src/main/java/serverutils/utils/world/LMWorldClient.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -7,10 +7,10 @@ import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.*; -import ftb.lib.*; -import ftb.lib.api.client.FTBLibClient; -import ftb.utils.api.EventLMPlayerClient; import latmod.lib.*; +import serverutils.lib.*; +import serverutils.lib.api.client.ServerUtilitiesLibraryClient; +import serverutils.utils.api.EventLMPlayerClient; @SideOnly(Side.CLIENT) public class LMWorldClient extends LMWorld // LMWorldServer @@ -33,7 +33,7 @@ public LMWorldClient(int i) { } public World getMCWorld() { - return FTBLibClient.mc.theWorld; + return ServerUtilitiesLibraryClient.mc.theWorld; } public LMWorldClient getClientWorld() { @@ -49,7 +49,7 @@ public void readDataFromNet(ByteIOStream io, boolean first) { if (first) { playerMap.clear(); - GameProfile gp = FTBLibClient.mc.getSession().func_148256_e(); + GameProfile gp = ServerUtilitiesLibraryClient.mc.getSession().func_148256_e(); clientPlayer = new LMPlayerClientSelf(this, clientPlayerID, gp); int psize = io.readInt(); @@ -63,7 +63,7 @@ public void readDataFromNet(ByteIOStream io, boolean first) { else playerMap.put(id, new LMPlayerClient(this, id, new GameProfile(uuid, name))); } - FTBLib.dev_logger.info("Client player ID: " + clientPlayerID); + ServerUtilitiesLib.dev_logger.info("Client player ID: " + clientPlayerID); int[] onlinePlayers = io.readIntArray(ByteCount.INT); diff --git a/src/main/java/ftb/utils/world/LMWorldServer.java b/src/main/java/serverutils/utils/world/LMWorldServer.java similarity index 92% rename from src/main/java/ftb/utils/world/LMWorldServer.java rename to src/main/java/serverutils/utils/world/LMWorldServer.java index c78640f4..991401d3 100644 --- a/src/main/java/ftb/utils/world/LMWorldServer.java +++ b/src/main/java/serverutils/utils/world/LMWorldServer.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.io.File; import java.util.*; @@ -12,14 +12,14 @@ import com.mojang.authlib.GameProfile; import cpw.mods.fml.relauncher.Side; -import ftb.lib.*; -import ftb.lib.api.config.ConfigGroup; -import ftb.utils.api.EventLMPlayerServer; -import ftb.utils.mod.handlers.FTBUChunkEventHandler; -import ftb.utils.net.MessageLMWorldUpdate; -import ftb.utils.world.claims.ClaimedChunks; import latmod.lib.*; import latmod.lib.util.Phase; +import serverutils.lib.*; +import serverutils.lib.api.config.ConfigGroup; +import serverutils.utils.api.EventLMPlayerServer; +import serverutils.utils.mod.handlers.ServerUtilitiesChunkEventHandler; +import serverutils.utils.net.MessageLMWorldUpdate; +import serverutils.utils.world.claims.ClaimedChunks; public class LMWorldServer extends LMWorld // LMWorldClient { @@ -46,7 +46,7 @@ public LMWorldServer(File f) { } public World getMCWorld() { - return FTBLib.getServerWorld(); + return ServerUtilitiesLib.getServerWorld(); } public LMWorldServer getServerWorld() { @@ -56,7 +56,7 @@ public LMWorldServer getServerWorld() { public void close() { playerMap.clear(); claimedChunks.chunks.clear(); - FTBUChunkEventHandler.instance.clear(); + ServerUtilitiesChunkEventHandler.instance.clear(); } public LMPlayerServer getPlayer(Object o) { diff --git a/src/main/java/ftb/utils/world/PersonalSettings.java b/src/main/java/serverutils/utils/world/PersonalSettings.java similarity index 95% rename from src/main/java/ftb/utils/world/PersonalSettings.java rename to src/main/java/serverutils/utils/world/PersonalSettings.java index 07351b92..26e11fbc 100644 --- a/src/main/java/ftb/utils/world/PersonalSettings.java +++ b/src/main/java/serverutils/utils/world/PersonalSettings.java @@ -1,9 +1,9 @@ -package ftb.utils.world; +package serverutils.utils.world; import net.minecraft.nbt.NBTTagCompound; -import ftb.lib.PrivacyLevel; import latmod.lib.*; +import serverutils.lib.PrivacyLevel; public class PersonalSettings { diff --git a/src/main/java/ftb/utils/world/ThreadBackup.java b/src/main/java/serverutils/utils/world/ThreadBackup.java similarity index 88% rename from src/main/java/ftb/utils/world/ThreadBackup.java rename to src/main/java/serverutils/utils/world/ThreadBackup.java index 5f3cdca1..dbe24d7f 100644 --- a/src/main/java/ftb/utils/world/ThreadBackup.java +++ b/src/main/java/serverutils/utils/world/ThreadBackup.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.io.*; import java.util.List; @@ -6,10 +6,10 @@ import net.minecraft.util.*; -import ftb.lib.BroadcastSender; -import ftb.utils.mod.FTBU; -import ftb.utils.mod.config.FTBUConfigBackups; import latmod.lib.*; +import serverutils.lib.BroadcastSender; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.mod.config.ServerUtilitiesConfigBackups; public class ThreadBackup extends Thread { @@ -45,7 +45,7 @@ public static void doBackup(File src) { Backups.logger.info("Backing up " + files.size() + " files..."); - if (FTBUConfigBackups.compression_level.getAsInt() > 0) { + if (ServerUtilitiesConfigBackups.compression_level.getAsInt() > 0) { out.append("backup.zip"); dstFile = LMFileUtils.newFile(new File(Backups.backupsFolder, out.toString())); @@ -53,7 +53,7 @@ public static void doBackup(File src) { ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(dstFile)); // zos.setLevel(9); - zos.setLevel(FTBUConfigBackups.compression_level.getAsInt()); + zos.setLevel(ServerUtilitiesConfigBackups.compression_level.getAsInt()); long logMillis = LMUtils.millis() + 5000L; @@ -136,23 +136,23 @@ public static void doBackup(File src) { Backups.clearOldBackups(); - if (FTBUConfigBackups.display_file_size.getAsBoolean()) { + if (ServerUtilitiesConfigBackups.display_file_size.getAsBoolean()) { String sizeB = LMFileUtils.getSizeS(dstFile); String sizeT = LMFileUtils.getSizeS(Backups.backupsFolder); - IChatComponent c = FTBU.mod.chatComponent( + IChatComponent c = ServerUtilities.mod.chatComponent( "cmd.backup_end_2", getDoneTime(time.millis), (sizeB.equals(sizeT) ? sizeB : (sizeB + " | " + sizeT))); c.getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE); BroadcastSender.inst.addChatMessage(c); } else { - IChatComponent c = FTBU.mod.chatComponent("cmd.backup_end_1", getDoneTime(time.millis)); + IChatComponent c = ServerUtilities.mod.chatComponent("cmd.backup_end_1", getDoneTime(time.millis)); c.getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE); BroadcastSender.inst.addChatMessage(c); } } catch (Exception e) { - IChatComponent c = FTBU.mod.chatComponent("cmd.backup_fail", LMUtils.classpath(e.getClass())); + IChatComponent c = ServerUtilities.mod.chatComponent("cmd.backup_fail", LMUtils.classpath(e.getClass())); c.getChatStyle().setColor(EnumChatFormatting.DARK_RED); BroadcastSender.inst.addChatMessage(c); diff --git a/src/main/java/ftb/utils/world/Warps.java b/src/main/java/serverutils/utils/world/Warps.java similarity index 97% rename from src/main/java/ftb/utils/world/Warps.java rename to src/main/java/serverutils/utils/world/Warps.java index 1fd1ffd5..94094b4c 100644 --- a/src/main/java/ftb/utils/world/Warps.java +++ b/src/main/java/serverutils/utils/world/Warps.java @@ -1,4 +1,4 @@ -package ftb.utils.world; +package serverutils.utils.world; import java.util.*; @@ -6,8 +6,8 @@ import com.google.gson.*; -import ftb.lib.*; import latmod.lib.LMJsonUtils; +import serverutils.lib.*; public class Warps { diff --git a/src/main/java/ftb/utils/world/claims/ChunkType.java b/src/main/java/serverutils/utils/world/claims/ChunkType.java similarity index 93% rename from src/main/java/ftb/utils/world/claims/ChunkType.java rename to src/main/java/serverutils/utils/world/claims/ChunkType.java index 2704fb61..35a4f070 100644 --- a/src/main/java/ftb/utils/world/claims/ChunkType.java +++ b/src/main/java/serverutils/utils/world/claims/ChunkType.java @@ -1,10 +1,10 @@ -package ftb.utils.world.claims; +package serverutils.utils.world.claims; import net.minecraft.util.EnumChatFormatting; -import ftb.lib.LMSecurity; -import ftb.utils.mod.FTBU; -import ftb.utils.world.*; +import serverutils.lib.LMSecurity; +import serverutils.utils.mod.ServerUtilities; +import serverutils.utils.world.*; public class ChunkType { @@ -86,7 +86,7 @@ public boolean drawGrid() { } public String getIDS() { - return FTBU.mod.translate(lang); + return ServerUtilities.mod.translate(lang); } public int hashCode() { diff --git a/src/main/java/ftb/utils/world/claims/ClaimedChunk.java b/src/main/java/serverutils/utils/world/claims/ClaimedChunk.java similarity index 96% rename from src/main/java/ftb/utils/world/claims/ClaimedChunk.java rename to src/main/java/serverutils/utils/world/claims/ClaimedChunk.java index 4be99f01..800635db 100644 --- a/src/main/java/ftb/utils/world/claims/ClaimedChunk.java +++ b/src/main/java/serverutils/utils/world/claims/ClaimedChunk.java @@ -1,11 +1,11 @@ -package ftb.utils.world.claims; +package serverutils.utils.world.claims; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.ChunkCoordIntPair; import cpw.mods.fml.relauncher.*; -import ftb.utils.world.*; import latmod.lib.*; +import serverutils.utils.world.*; public final class ClaimedChunk { diff --git a/src/main/java/ftb/utils/world/claims/ClaimedChunks.java b/src/main/java/serverutils/utils/world/claims/ClaimedChunks.java similarity index 94% rename from src/main/java/ftb/utils/world/claims/ClaimedChunks.java rename to src/main/java/serverutils/utils/world/claims/ClaimedChunks.java index a5bc7b6c..84c34d2b 100644 --- a/src/main/java/ftb/utils/world/claims/ClaimedChunks.java +++ b/src/main/java/serverutils/utils/world/claims/ClaimedChunks.java @@ -1,4 +1,4 @@ -package ftb.utils.world.claims; +package serverutils.utils.world.claims; import java.util.*; @@ -9,12 +9,12 @@ import com.google.gson.*; -import ftb.lib.*; -import ftb.lib.api.item.LMInvUtils; -import ftb.utils.mod.config.FTBUConfigGeneral; -import ftb.utils.world.*; import latmod.lib.*; import latmod.lib.util.EnumEnabled; +import serverutils.lib.*; +import serverutils.lib.api.item.LMInvUtils; +import serverutils.utils.mod.config.ServerUtilitiesConfigGeneral; +import serverutils.utils.world.*; public class ClaimedChunks { @@ -188,9 +188,10 @@ public static ChunkType getChunkTypeFromI(int i) { } public static boolean isInSpawn(int dim, int cx, int cz) { - if (dim != 0 || (!FTBLib.isDedicatedServer() && !FTBUConfigGeneral.spawn_area_in_sp.getAsBoolean())) + if (dim != 0 || (!ServerUtilitiesLib.isDedicatedServer() + && !ServerUtilitiesConfigGeneral.spawn_area_in_sp.getAsBoolean())) return false; - int radius = FTBLib.getServer().getSpawnProtectionSize(); + int radius = ServerUtilitiesLib.getServer().getSpawnProtectionSize(); if (radius <= 0) return false; BlockDimPos c = LMDimUtils.getSpawnPoint(0); int minX = MathHelperLM.chunk(c.x + 0.5D - radius); @@ -205,7 +206,7 @@ public static boolean isInSpawnD(int dim, double x, double z) { } public boolean allowExplosion(int dim, int cx, int cz) { - if (dim == 0 && FTBUConfigGeneral.safe_spawn.getAsBoolean() && isInSpawn(dim, cx, cz)) return false; + if (dim == 0 && ServerUtilitiesConfigGeneral.safe_spawn.getAsBoolean() && isInSpawn(dim, cx, cz)) return false; else if (LMWorldServer.inst.settings.getWB(dim).isOutside(cx, cz)) return false; else { ClaimedChunk c = getChunk(dim, cx, cz); diff --git a/src/main/java/ftb/utils/world/claims/LMWorldSettings.java b/src/main/java/serverutils/utils/world/claims/LMWorldSettings.java similarity index 96% rename from src/main/java/ftb/utils/world/claims/LMWorldSettings.java rename to src/main/java/serverutils/utils/world/claims/LMWorldSettings.java index 63303a46..c61e476d 100644 --- a/src/main/java/ftb/utils/world/claims/LMWorldSettings.java +++ b/src/main/java/serverutils/utils/world/claims/LMWorldSettings.java @@ -1,12 +1,12 @@ -package ftb.utils.world.claims; +package serverutils.utils.world.claims; import java.util.HashMap; import com.google.gson.*; -import ftb.lib.api.config.ConfigEntryBool; -import ftb.utils.world.LMWorld; import latmod.lib.ByteIOStream; +import serverutils.lib.api.config.ConfigEntryBool; +import serverutils.utils.world.LMWorld; public class LMWorldSettings { diff --git a/src/main/java/ftb/utils/world/claims/WorldBorder.java b/src/main/java/serverutils/utils/world/claims/WorldBorder.java similarity index 96% rename from src/main/java/ftb/utils/world/claims/WorldBorder.java rename to src/main/java/serverutils/utils/world/claims/WorldBorder.java index 1a5446ea..e1895bc6 100644 --- a/src/main/java/ftb/utils/world/claims/WorldBorder.java +++ b/src/main/java/serverutils/utils/world/claims/WorldBorder.java @@ -1,10 +1,10 @@ -package ftb.utils.world.claims; +package serverutils.utils.world.claims; import com.google.gson.*; -import ftb.lib.LMDimUtils; import latmod.lib.MathHelperLM; import latmod.lib.util.Pos2I; +import serverutils.lib.LMDimUtils; public class WorldBorder { diff --git a/src/main/java/ftb/utils/world/ranks/Rank.java b/src/main/java/serverutils/utils/world/ranks/Rank.java similarity index 89% rename from src/main/java/ftb/utils/world/ranks/Rank.java rename to src/main/java/serverutils/utils/world/ranks/Rank.java index 184f3503..eecb4d41 100644 --- a/src/main/java/ftb/utils/world/ranks/Rank.java +++ b/src/main/java/serverutils/utils/world/ranks/Rank.java @@ -1,18 +1,18 @@ -package ftb.utils.world.ranks; +package serverutils.utils.world.ranks; import net.minecraft.util.EnumChatFormatting; -import ftb.lib.FTBLib; -import ftb.lib.api.config.*; import latmod.lib.IntList; import latmod.lib.util.FinalIDObject; +import serverutils.lib.ServerUtilitiesLib; +import serverutils.lib.api.config.*; public class Rank extends FinalIDObject { public final ConfigEntryString parent = new ConfigEntryString("parent", "-"); public final ConfigEntryEnum color = new ConfigEntryEnum<>( "color", - FTBLib.chatColors, + ServerUtilitiesLib.chatColors, EnumChatFormatting.WHITE, false); public final ConfigEntryString prefix = new ConfigEntryString("prefix", ""); diff --git a/src/main/java/ftb/utils/world/ranks/RankConfig.java b/src/main/java/serverutils/utils/world/ranks/RankConfig.java similarity index 96% rename from src/main/java/ftb/utils/world/ranks/RankConfig.java rename to src/main/java/serverutils/utils/world/ranks/RankConfig.java index 0538fd48..143bf354 100644 --- a/src/main/java/ftb/utils/world/ranks/RankConfig.java +++ b/src/main/java/serverutils/utils/world/ranks/RankConfig.java @@ -1,12 +1,12 @@ -package ftb.utils.world.ranks; +package serverutils.utils.world.ranks; import java.util.Collections; -import ftb.lib.PrivacyLevel; -import ftb.lib.api.config.*; import latmod.lib.IntList; import latmod.lib.annotations.*; import latmod.lib.util.EnumEnabled; +import serverutils.lib.PrivacyLevel; +import serverutils.lib.api.config.*; public class RankConfig { diff --git a/src/main/java/ftb/utils/world/ranks/Ranks.java b/src/main/java/serverutils/utils/world/ranks/Ranks.java similarity index 85% rename from src/main/java/ftb/utils/world/ranks/Ranks.java rename to src/main/java/serverutils/utils/world/ranks/Ranks.java index f7d81c90..38f364a6 100644 --- a/src/main/java/ftb/utils/world/ranks/Ranks.java +++ b/src/main/java/serverutils/utils/world/ranks/Ranks.java @@ -1,11 +1,11 @@ -package ftb.utils.world.ranks; +package serverutils.utils.world.ranks; import java.util.*; import net.minecraft.util.EnumChatFormatting; -import ftb.lib.api.config.*; -import ftb.utils.world.LMPlayerServer; +import serverutils.lib.api.config.*; +import serverutils.utils.world.LMPlayerServer; public class Ranks { @@ -21,7 +21,7 @@ public class Ranks { private static final HashMap playerMap = new HashMap<>(); public static Rank getRankFor(LMPlayerServer p) { - boolean enabled = false; // FTBUConfigGeneral.ranks_enabled.get(); + boolean enabled = false; if (enabled) { if (p == null || p.isFake()) return defaultRank; @@ -35,8 +35,8 @@ public static Rank getRankFor(LMPlayerServer p) { public static void load(ConfigFile file) { /* - * file = new ConfigFile("ranks", new File(FTBLib.folderLocal, "ftbu/ranks.json")); file.add(default_rank); - * file.add(ranks_group); + * file = new ConfigFile("ranks", new File(ServerUtilitiesLibrary.folderLocal, "serverutils/ranks.json")); + * file.add(default_rank); file.add(ranks_group); */ Ranks.ADMIN.setDefaults(); diff --git a/src/main/resources/assets/ftbl/lang/de_DE.lang b/src/main/resources/assets/ftbl/lang/de_DE.lang deleted file mode 100644 index 4166d608..00000000 --- a/src/main/resources/assets/ftbl/lang/de_DE.lang +++ /dev/null @@ -1,85 +0,0 @@ -ftbl:gamemode.loaded=Spielmodus geändert zu '%s'! -ftbl:gamemode.not_found=Spielmodus existiert nicht! -ftbl:gamemode.already_set=Spielmodus bereits geladen! -ftbl:gamemode.current=Aktiver Spielmodus: %s -ftbl:gamemode.list=Verfügbare Spielmodi: %s -ftbl:worldID=WorldID: %s -ftbl:reloadedServer=FTBLib neu geladen (Server) -ftbl:reloadedClient=FTBLib neu geladen (Client) -ftbl:missing_args=Fehlende Argumente! -ftbl:feature_disabled=Dieses Feature ist deaktiviert! -ftbl:invalid_subcmd=Invalider Sub-Befehl: '%s'! -ftbl:owner=Besitzer: %s -ftbl:delete_item=Willst du '%s' löschen? -ftbl:label.server_forced=Server overrides to '%s' - -#Buttons -ftbl:button.settings=Einstellungen -ftbl:button.back=Zurück -ftbl:button.up=Hoch -ftbl:button.down=Runter -ftbl:button.prev=Vorherige -ftbl:button.next=Nächste -ftbl:button.cancel=Abbrechen -ftbl:button.accept=Akzeptieren -ftbl:button.remove=Entfernen -ftbl:button.add=Hinzufügen -ftbl:button.close=Schließen -ftbl:button.save=Speichern -ftbl:button.refresh=Neu laden -ftbl:button.other=Andere -ftbl:button.edit=Editieren - -ftbl:label.true=True -ftbl:label.false=False -ftbl:label.enabled=Aktiviert -ftbl:label.disabled=Deaktiviert -ftbl:label.on=An -ftbl:label.off=Aus -ftbl:label.online=Online -ftbl:label.offline=Offline - -#Colors -ftbl:color.black=Schwarz -ftbl:color.red=Rot -ftbl:color.green=Grün -ftbl:color.brown=Braun -ftbl:color.blue=Blau -ftbl:color.purple=Lila -ftbl:color.cyan=Cyan -ftbl:color.lightgray=Hell Grau -ftbl:color.gray=Dunkel Grau -ftbl:color.pink=Pink -ftbl:color.lime=Lime -ftbl:color.yellow=Gelb -ftbl:color.lightblue=Hell Blau -ftbl:color.magenta=Magenta -ftbl:color.orange=Orange -ftbl:color.white=Weiß - -#Sides -ftbl:side.down=Unten -ftbl:side.up=Oben -ftbl:side.north=Norden -ftbl:side.south=Süden -ftbl:side.west=Westen -ftbl:side.east=Osten - -ftbl:dside.bottom=Unten -ftbl:dside.top=Oben -ftbl:dside.back=Hinten -ftbl:dside.front=Vorne -ftbl:dside.left=Links -ftbl:dside.right=Rechts - -#Config -client_config=Client Config -client_config.ftbl=FTBLib -client_config.ftbl.item_ore_names=Item OreDict Names -client_config.ftbl.item_reg_names=Item Registry Names -client_config.ftbl.debug_info=Debug Info -client_config.ftbl.notifications=Benachrichtigungen - -client_config.sidebar_buttons=Seitenleiste Buttons -client_config.sidebar_buttons.settings=Client Einstellungen -client_config.sidebar_buttons.notifications=Benachrichtigungen diff --git a/src/main/resources/assets/ftbl/lang/en_US.lang b/src/main/resources/assets/ftbl/lang/en_US.lang deleted file mode 100644 index 7d63b895..00000000 --- a/src/main/resources/assets/ftbl/lang/en_US.lang +++ /dev/null @@ -1,139 +0,0 @@ -ftbl.gamemode.loaded=Gamemode set to '%s'! -ftbl.gamemode.not_found=Gamemode does not exist! -ftbl.gamemode.already_set=Gamemode already set! -ftbl.gamemode.current=Current gamemode: %s -ftbl.gamemode.list=Available gamemodes: %s -ftbl.worldID=WorldID: %s -ftbl.reloaded_server=FTBLib: Server reloaded in %s -ftbl.reloaded_client=FTBLib: Client reloaded in %s -ftbl.missing_args=Missing Arguments! -ftbl.feature_disabled=This feature is disabled! -ftbl.invalid_subcmd=Invalid subcommand: '%s'! -ftbl.owner=Owner: %s -ftbl.delete_item=Do you want to delete '%s'? -ftbl.label.server_forced=Server overrides to '%s' -ftbl.reload_client_config=Server Reloaded. You can - -ftbl.button.shortcut.action=Action -ftbl.button.shortcut.data=Action Data -ftbl.button.shortcut.key=Key -ftbl.button.shortcut.icon=Icon -ftbl.button.shortcut.title=Title -ftbl.button.shortcut.priority=Priority -ftbl.button.shortcut.add_key=Add Key Shortcut -ftbl.button.shortcut.add_button=Add Button Shortcut - -#Buttons -ftbl.button.settings=Settings -ftbl.button.back=Back -ftbl.button.up=Up -ftbl.button.down=Down -ftbl.button.prev=Previous -ftbl.button.next=Next -ftbl.button.cancel=Cancel -ftbl.button.accept=Accept -ftbl.button.remove=Remove -ftbl.button.add=Add -ftbl.button.close=Close -ftbl.button.save=Save -ftbl.button.refresh=Refresh -ftbl.button.other=Other -ftbl.button.edit=Edit -ftbl.button.info=Info - -ftbl.label.true=True -ftbl.label.false=False -ftbl.label.enabled=Enabled -ftbl.label.disabled=Disabled -ftbl.label.on=On -ftbl.label.off=Off -ftbl.label.online=Online -ftbl.label.offline=Offline -ftbl.label.whitelist=Whitelist -ftbl.label.blacklist=Blacklist - -#Colors -ftbl.color.black=Black -ftbl.color.red=Red -ftbl.color.green=Green -ftbl.color.brown=Brown -ftbl.color.blue=Blue -ftbl.color.purple=Purple -ftbl.color.cyan=Cyan -ftbl.color.lightgray=Light Gray -ftbl.color.gray=Dark Gray -ftbl.color.pink=Pink -ftbl.color.lime=Lime -ftbl.color.yellow=Yellow -ftbl.color.lightblue=Light Blue -ftbl.color.magenta=Magenta -ftbl.color.orange=Orange -ftbl.color.white=White - -#Sides -ftbl.side.down=Down -ftbl.side.up=Up -ftbl.side.north=North -ftbl.side.south=South -ftbl.side.west=West -ftbl.side.east=East - -ftbl.dside.bottom=Bottom -ftbl.dside.top=Top -ftbl.dside.back=Back -ftbl.dside.front=Front -ftbl.dside.left=Left -ftbl.dside.right=Right - -#ClientConfig -client_config=Client Config -client_config.ftbl=FTBLib -client_config.ftbl.item_ore_names=Item OreDict Names -client_config.ftbl.item_reg_names=Item Registry Names -client_config.ftbl.debug_info=Debug Info -client_config.ftbl.notifications=Notifications -client_config.ftbl.reload_client_cmd=Client Reloading Command -client_config.ftbl.action_buttons_on_top=Action Buttons On Top -client_config.ftbl.player_options_shortcut=Player Options Shortcut -client_config.ftbl.key_bindings=Key Bindings -client_config.ftbl.edit_shortcuts=Edit Shortcuts -client_config.ftbl.light_value_texture=Light Value Texture - -client_config.sidebar_buttons=Sidebar Buttons - -#PlayerActions -player_action.ftbl.settings=Client Settings -player_action.ftbl.notifications=Notifications -player_action.ftbl.toggle_gamemode=Toggle Gamemode -player_action.ftbl.toggle_rain=Toggle Rain -player_action.ftbl.toggle_day=Set time to Day -player_action.ftbl.toggle_night=Set time to Night -player_action.ftbl.toggle_chunk_bounds=Toggle Chunk Bounds -player_action.ftbl.toggle_light_values=Toggle Light Values - -#Security Mode -ftbl.security=Security -ftbl.security.public=Public -ftbl.security.private=Private -ftbl.security.friends=Friends -ftbl.security.group=Group - -#Redstone Mode -ftbl.redstonemode=Redstone Mode -ftbl.redstonemode.disabled=Disabled -ftbl.redstonemode.high=Active High -ftbl.redstonemode.low=Active Low - -#Inventory Mode -ftbl.invmode=Automation -ftbl.invmode.enabled=Enabled -ftbl.invmode.onlyin=Insert Only -ftbl.invmode.onlyout=Extract Only -ftbl.invmode.disabled=Disabled - -#Click Actions -click_action.cmd=Command -click_action.show_cmd=Show Command -click_action.url=Open URL -click_action.file=Open File -click_action.gui=Open Gui \ No newline at end of file diff --git a/src/main/resources/assets/ftbl/lang/zh_CN.lang b/src/main/resources/assets/ftbl/lang/zh_CN.lang deleted file mode 100644 index ccb7ec46..00000000 --- a/src/main/resources/assets/ftbl/lang/zh_CN.lang +++ /dev/null @@ -1,118 +0,0 @@ -#Traslated by xuyu_staryG(gxy17886) From InfinityStudio -ftbl:gamemode.loaded=游戏模式设置为'%s'! -ftbl:gamemode.not_found=游戏模式不存在! -ftbl:gamemode.already_set=游戏模式已设置! -ftbl:gamemode.current=当前游戏模式: %s -ftbl:gamemode.list=可用游戏模式: %s -ftbl:worldID=世界ID: %s -ftbl:reloadedServer=FTBLib:服务器重新载入在%s -ftbl:reloadedClient=FTBLib:客户端重新载入在%s -ftbl:missing_args=缺少参数! -ftbl:feature_disabled=此功能被禁用! -ftbl:invalid_subcmd=无效的子命令: '%s'! -ftbl:owner=所有者: %s -ftbl:delete_item=你确定要删除'%s'? -ftbl:label.server_forced=服务器覆盖'%s' -ftbl:reload_client_config=你可以重新载入服务器. - -#Buttons -ftbl:button.settings=设置 -ftbl:button.back=后退 -ftbl:button.up=上 -ftbl:button.down=下 -ftbl:button.prev=上一步 -ftbl:button.next=下一步 -ftbl:button.cancel=取消 -ftbl:button.accept=接受 -ftbl:button.remove=删除 -ftbl:button.add=添加 -ftbl:button.close=关闭 -ftbl:button.save=保存 -ftbl:button.refresh=刷新 -ftbl:button.other=其他 -ftbl:button.edit=编辑 - -ftbl:label.true=True -ftbl:label.false=False -ftbl:label.enabled=启用 -ftbl:label.disabled=禁用 -ftbl:label.on=开 -ftbl:label.off=关 -ftbl:label.online=在线 -ftbl:label.offline=离线 -ftbl:label.whitelist=白名单 -ftbl:label.blacklist=黑名单 - -#Colors -ftbl:color.black=黑色 -ftbl:color.red=红色 -ftbl:color.green=绿色 -ftbl:color.brown=棕色 -ftbl:color.blue=蓝色 -ftbl:color.purple=紫色 -ftbl:color.cyan=青色 -ftbl:color.lightgray=浅灰色 -ftbl:color.gray=深灰色 -ftbl:color.pink=粉色 -ftbl:color.lime=黄绿色 -ftbl:color.yellow=黄色 -ftbl:color.lightblue=浅蓝色 -ftbl:color.magenta=品红色 -ftbl:color.orange=橙色 -ftbl:color.white=白色 - -#Sides -ftbl:side.down=下 -ftbl:side.up=上 -ftbl:side.north=北 -ftbl:side.south=南 -ftbl:side.west=西 -ftbl:side.east=东 - -ftbl:dside.bottom=底部 -ftbl:dside.top=顶部 -ftbl:dside.back=后面 -ftbl:dside.front=前面 -ftbl:dside.left=左侧 -ftbl:dside.right=右侧 - -#ClientConfig -client_config=客户端配置 -client_config.ftbl=FTBLib -client_config.ftbl.item_ore_names=物品矿物词典名字 -client_config.ftbl.item_reg_names=物品注册名称 -client_config.ftbl.debug_info=调试信息 -client_config.ftbl.notifications=通知 -client_config.ftbl.reload_client_cmd=客户端重新载入命令 -client_config.ftbl.action_buttons_on_top=动作按钮在顶部 -client_config.ftbl.player_options_shortcut=玩家快捷选项 - -client_config.sidebar_buttons=侧边栏按钮 - -#PlayerActions -player_action.ftbl.settings=客户端设置 -player_action.ftbl.notifications=通知 -player_action.ftbl.toggle_gamemode=切换游戏模式 -player_action.ftbl.toggle_rain=切换雨雪 -player_action.ftbl.toggle_day=设置时间为白天 -player_action.ftbl.toggle_night=设置时间为晚上 - -#Security Mode -ftbl:security=安全 -ftbl:security.public=公共 -ftbl:security.private=私人 -ftbl:security.friends=仅限朋友 -ftbl:security.group=仅限同组 - -#Redstone Mode -ftbl:redstonemode=红石模式 -ftbl:redstonemode.disabled=禁用 -ftbl:redstonemode.high=高态有效 -ftbl:redstonemode.low=低态有效 - -#Inventory Mode -ftbl:invmode=自动化 -ftbl:invmode.enabled=启用 -ftbl:invmode.onlyin=只有输入 -ftbl:invmode.onlyout=只有输出 -ftbl:invmode.disabled=禁用 diff --git a/src/main/resources/assets/ftbu/lang/de_DE.lang b/src/main/resources/assets/ftbu/lang/de_DE.lang deleted file mode 100644 index be6793bd..00000000 --- a/src/main/resources/assets/ftbu/lang/de_DE.lang +++ /dev/null @@ -1,103 +0,0 @@ -#Buttons -ftbu:button.add_friend=Zu Freunden hinzufügen -ftbu:button.rem_friend=Von Freunden entfernen -ftbu:button.deny_friend=Freundschafftsanfrage ablehnen -ftbu:button.guide=Guide -ftbu:button.claimed_chunks=Beanspruchte Chunks -ftbu:button.mail=Nachrichten -ftbu:button.trade=Handel -ftbu:button.notes=Notizen -ftbu:button.server_info=Server Info -ftbu:label.friend=Freund -ftbu:label.pfriend=Ausstehende Freundschaftsanfragen -ftbu:label.joined=Beigetreten vor %s -ftbu:label.last_seen=Zuletzt gesehen %s -ftbu:label.deaths=Tode: %s -ftbu:button.explosions=Explosionen -ftbu:button.block_security=Block Sicherheit -ftbu:label.cchunks_count=Beanspruchte Chunks: %s -ftbu:label.lchunks_count=Geladene Chunks: %s - -#ClientConfig -client_config.sidebar_buttons.guide=Guide -client_config.sidebar_buttons.info=Server Info -client_config.sidebar_buttons.claims=Beanspruchte Chunks - -client_config.ftbu=FTBUtilities -client_config.ftbu.render_badges=Zeige Abzeichen -client_config.ftbu.render_my_badge=Zeige meine Abzeichen -client_config.ftbu.options_button=Optionen Button -client_config.ftbu.chat_links=Chat Links -client_config.ftbu.player_options_shortcut=Spieler Optionen Shortcut -client_config.ftbu.sort_friends_az=Sortiere Freunde A-Z - -claims_config=Beanspruchte Chunks Config -claims_config.explosions=Explosionen -claims_config.security_level=Block Sicherheits Level -claims_config.fake_players=Erlaube Fake Players - -#Misc -ftbu:label.new_friends=Neue Freundschaftsanfrage! -ftbu:label.new_friends_click=Klicke um alle Anfragen anzunehmen -ftbu:server_restart=Server wird in %s neustarten - -ftbu:cmd.warp_set=Warp '%s' gesetzt! -ftbu:cmd.warp_del=Warp '%s' gelöscht! -ftbu:cmd.warp_not_set=Unbekannter Warp: '%s'! -ftbu:cmd.warp_tp=Teleportiert zu '%s'! - -ftbu:cmd.home_set=Zuhause '%s' gesetzt! -ftbu:cmd.home_del=Zuhause '%s' gelöscht! -ftbu:cmd.home_not_set=Unbekanntes Zuhause: '%s'! -ftbu:cmd.home_cross_dim=Du kannst dich nicht in eine andere Dimension teleportieren! -ftbu:cmd.home_limit=Du kannst keine weiteren Zuhause setzen! - -ftbu:cmd.no_dp=Du kannst nur einmal zurück gehen! -ftbu:cmd.timer_backup=Nächste Sicherung: %s -ftbu:cmd.timer_restart=Nächster Neustart: %s -ftbu:cmd.rules=[Klicke hier um die Regeln zu öffnen] -ftbu:cmd.spawn_tp=Zum Spawn teleportiert - -ftbu:button.claims_unclaim_all=Gebe alle Chunks frei -ftbu:button.claims_unclaim_all_dim=Gebe alle Chunks in %s frei -ftbu:button.claims_unclaim_all_q=Alle beanspruchten Chunks freigeben? -ftbu:button.claims_unclaim_all_dim_q=Alle beanspruchten Chunks in %s freigeben? -ftbu:label.claims_invalid_dim=Du kannst keine Chunks in dieser Dimension beanspruchen - -ftbu:top.title=Server Rangliste -ftbu:top.first_joined=Zuerst Gesehen -ftbu:top.last_seen=Zuletzt Gesehen -ftbu:top.time_played=Spielzeit -ftbu:top.deaths=Tode -ftbu:top.deaths_ph=Tode per Stunde - -#Security Mode -ftbu:security=Sicherheit -ftbu:security.public=Öffentlich -ftbu:security.private=Privat -ftbu:security.friends=Freunde -ftbu:security.group=Gruppe -ftbu:security.whitelist=Whitelist -ftbu:security.blacklist=Blacklist - -#Redstone Mode -ftbu:redstonemode=Redstone Modus -ftbu:redstonemode.disabled=Deaktviert -ftbu:redstonemode.high=Aktiv Hoch -ftbu:redstonemode.low=Aktiv Niedrig - -#Inventory Mode -ftbu:invmode=Automatisierung -ftbu:invmode.enabled=Aktiviert -ftbu:invmode.onlyin=Nur Insertion -ftbu:invmode.onlyout=Nur Extraktion -ftbu:invmode.disabled=Deaktviert - -#Chunktypes -ftbu:chunktype.unloaded=Chunk nicht geladen -ftbu:chunktype.spawn=Spawn Bereich -ftbu:chunktype.world_border=Welt Begrenzung -ftbu:chunktype.world_border.warning=Du hast die Welt Begrenzung erreicht! -ftbu:chunktype.wilderness=Wildnis -ftbu:chunktype.claimed=Beanspruchter Bereich -ftbu:chunktype.chunkloaded=Geladener Chunk diff --git a/src/main/resources/assets/ftbu/lang/en_US.lang b/src/main/resources/assets/ftbu/lang/en_US.lang deleted file mode 100644 index 9310810a..00000000 --- a/src/main/resources/assets/ftbu/lang/en_US.lang +++ /dev/null @@ -1,97 +0,0 @@ -#Buttons -ftbu.label.friend=Friend -ftbu.label.pfriend=Pending Friend -ftbu.label.joined=Joined %s ago -ftbu.label.last_seen=Last seen %s ago -ftbu.label.deaths=Deaths: %s -ftbu.button.block_security=Block Security -ftbu.label.cchunks_count=Claimed Chunks: %s -ftbu.label.lchunks_count=Loaded Chunks: %s - -#ClientConfig -client_config.ftbu=FTB Utilities -client_config.ftbu.render_badges=Show Badges -client_config.ftbu.sort_friends_az=Sort Friends A-Z -client_config.ftbu.loaded_chunks_space_key=Use Space key for Loaded Chunks - -client_config.ftbu_guide=FTB Utilities: Guide -client_config.ftbu_guide.unicode=Use Unicode -client_config.ftbu_guide.text_color=Text Color -client_config.ftbu_guide.bg_color=Background Color -client_config.ftbu_guide.transparency=Transparency - -ftbu.player_setting.chat_links=Chat Links -ftbu.player_setting.render_badge=Show My Badge -ftbu.player_setting.explosions=Claimed Chunk Explosions -ftbu.player_setting.security_level=Claimed Chunk Security Level -ftbu.player_setting.fake_players=Claimed Chunk Fake Players - -#PlayerActions -player_action.ftbu.guide=Guide -player_action.ftbu.server_info=Server Info -player_action.ftbu.claimed_chunks=Claimed Chunks -player_action.ftbu.trade=Trade -player_action.ftbu.notes=Notes -player_action.ftbu.add_friend=Add as Friend -player_action.ftbu.rem_friend=Remove from Friends -player_action.ftbu.deny_friend=Deny Friend Request -player_action.ftbu.mail=Mail - -#Misc -ftbu.label.new_friends=New friend requests! -ftbu.label.new_friends_click=Click to accept all requests -ftbu.server_restart=Server will restart in %s -ftbu.commands=Commands -ftbu.my_permissions=My Permissions - -ftbu.cmd.warp_set=Warp '%s' set! -ftbu.cmd.warp_del=Warp '%s' deleted! -ftbu.cmd.warp_not_set=Unknown Warp: '%s'! -ftbu.cmd.warp_tp=Teleported to '%s'! -ftbu.cmd.warp_not_same_dim=You can't teleport to another dimension! - -ftbu.cmd.home_set=Home '%s' set! -ftbu.cmd.home_del=Home '%s' deleted! -ftbu.cmd.home_not_set=Unknown Home: '%s'! -ftbu.cmd.home_cross_dim=You can't teleport to another dimension! -ftbu.cmd.home_limit=You can't set any more home locations! - -ftbu.cmd.no_dp=You can only go back once! -ftbu.cmd.timer_backup=Next backup: %s -ftbu.cmd.timer_restart=Next restart: %s -ftbu.cmd.rules=[Click here to view the rules] -ftbu.cmd.spawn_tp=Teleported to spawn -ftbu.cmd.ftb_gamemode=Game mode: %s -ftbu.cmd.world_difficulty=Difficulty: %s - -ftbu.cmd.backup_start=Server Backup started! -ftbu.cmd.backup_stop=Server Backup stopped! -ftbu.cmd.backup_end_1=Server backup done in %s! -ftbu.cmd.backup_end_2=Server backup done in %s! (%s) -ftbu.cmd.backup_fail=Failed to save world! (%s) -ftbu.cmd.backup_manual_launch=%s launched a manual backup! -ftbu.cmd.backup_already_running=Backup in progress! -ftbu.cmd.backup_not_running=Backup is not running! -ftbu.cmd.backup_size=Current world size: %s, total backups folder size: %s - -ftbu.button.claims_unclaim_all=Unclaim all chunks -ftbu.button.claims_unclaim_all_dim=Unclaim all chunks in %s -ftbu.button.claims_unclaim_all_q=Unclaim all chunks? -ftbu.button.claims_unclaim_all_dim_q=Unclaim all chunks in %s? -ftbu.label.claims_invalid_dim=Can't claim chunks in this dimension - -ftbu.top.title=Server Tops -ftbu.top.first_joined=First Seen -ftbu.top.last_seen=Last Seen -ftbu.top.time_played=Time Played -ftbu.top.deaths=Deaths -ftbu.top.deaths_ph=Deaths per hour - -#Chunktypes -ftbu.chunktype.unloaded=Chunk not loaded -ftbu.chunktype.spawn=Spawn Area -ftbu.chunktype.world_border=World Border -ftbu.chunktype.world_border.warning=You have reached the world border! -ftbu.chunktype.wilderness=Wilderness -ftbu.chunktype.claimed=Claimed Area -ftbu.chunktype.chunkloaded=Chunkloaded \ No newline at end of file diff --git a/src/main/resources/assets/ftbu/lang/fr_FR.lang b/src/main/resources/assets/ftbu/lang/fr_FR.lang deleted file mode 100644 index dfc65ec8..00000000 --- a/src/main/resources/assets/ftbu/lang/fr_FR.lang +++ /dev/null @@ -1,125 +0,0 @@ -#Buttons -ftbu:button.settings=Options -ftbu:button.back=Arrière -ftbu:button.up=Haut -ftbu:button.down=Bas -ftbu:button.prev=Précédent -ftbu:button.next=Suivant -ftbu:button.enabled=Activé -ftbu:button.disabled=Désactivé -ftbu:button.cancel=Annuler -ftbu:button.accept=Accepter -ftbu:button.remove=Supprimer -ftbu:button.add=Ajouter -ftbu:button.close=Fermer -ftbu:button.save=Enregistrer -ftbu:button.refresh=Raffraichir - -#FriendsGUI -ftbu:button.addFriend=Ajouter comme ami -ftbu:button.remFriend=Supprimer des amis -ftbu:button.deny_friend=Refuser la demande d'ami -ftbu:label.online=En ligne -ftbu:label.friend=Ami -ftbu:label.pfriend=Amis en attente -ftbu:label.joined=Rejoint %s -ftbu:label.last_seen=Dernier vu %s -ftbu:label.deaths=Morts: %s - -#ClientConfig -ftbu:client_config=Configuration du client -config.value.enabled=Activé -config.value.disabled=Désactivé -config.value.true=Vrai -config.value.false=Faux -config.value.left=Gauche -config.value.right=Droite -config.value.top=Haut -config.value.bottom=Bas -config.value.edit=Modifier -config.property.enabled=Actif - -config.group.ftbu=FTBUtilities -config.property.player_decorators=Décorateurs de joueurs -config.property.item_ore_names=Noms d'OreDict d'éléments -config.property.item_reg_names=Noms d'enregistrement d'éléments -config.property.debug_info=Info de déboggue -config.property.options_button=Bouton d'options -config.property.chat_links=Liens de tchat -config.property.chunk_messages=Messages de parcelles -config.value.cm_notify=Notification -config.value.cm_screen=Écran -config.value.cm_chat=Tchat - -#Misc -commands.lmmissingargs=Arguments manquants ! -commands.lmdisabled=Cette fonctionalité est désactivée ! -ftbu:owner=Propriétaire : %s -ftbu:deleteitem=Voulez-vous supprimer '%s' ? -ftbu:button.claimed_chunks=Parcelles bloquées -ftbu:button.mail=Courrier -ftbu:button.trade=Commerce -ftbu:button.notes=Notes - -#Security Mode -ftbu:security=Securité -ftbu:security.public=Public -ftbu:security.private=Privé -ftbu:security.friends=Amis -ftbu:security.group=Groupes -ftbu:security.whitelist=Liste blanche -ftbu:security.blacklist=Liste noire - -#Redstone Mode -ftbu:redstonemode=Mode Redstone -ftbu:redstonemode.disabled=Désactivé -ftbu:redstonemode.high=Très actif -ftbu:redstonemode.low=Peu actif - -#Inventory Mode -ftbu:invmode=Automatisation -ftbu:invmode.enabled=Activé -ftbu:invmode.onlyin=Insertion seule -ftbu:invmode.onlyout=Extraction seule -ftbu:invmode.disabled=Désactivé - -#Colors -ftbu:color.black=Noir -ftbu:color.red=Rouge -ftbu:color.green=Vert -ftbu:color.brown=Marron -ftbu:color.blue=Bleu -ftbu:color.purple=Violet -ftbu:color.cyan=Cyan -ftbu:color.silver=Gris clair -ftbu:color.gray=Gris -ftbu:color.pink=Rose -ftbu:color.lime=Vert clair -ftbu:color.yellow=Jaune -ftbu:color.light_blue=Bleu clair -ftbu:color.magenta=Magenta -ftbu:color.orange=Orange -ftbu:color.white=Blanc - -#Chunktypes -ftbu:chunktype.spawn=Zone d'apparition -ftbu:chunktype.world_border=Bordure du monde -ftbu:chunktype.world_border.warning=Vous avez atteint la bordure du monde ! -ftbu:chunktype.wilderness=Etendue sauvage -ftbu:chunktype.claimed=Zone revendiquée -ftbu:chunktype.unloaded=Parcelles non chargées - -#Sides -ftbu:side.down=Bas -ftbu:side.up=Haut -ftbu:side.north=Nord -ftbu:side.south=Sud -ftbu:side.west=Ouest -ftbu:side.east=Est - -ftbu:dside.bottom=Bas -ftbu:dside.top=Haut -ftbu:dside.back=Arrière -ftbu:dside.front=Avant -ftbu:dside.left=Gauche -ftbu:dside.right=Droite diff --git a/src/main/resources/assets/ftbu/lang/ru_RU.lang b/src/main/resources/assets/ftbu/lang/ru_RU.lang deleted file mode 100644 index 84b00041..00000000 --- a/src/main/resources/assets/ftbu/lang/ru_RU.lang +++ /dev/null @@ -1,95 +0,0 @@ -#Buttons -ftbu.label.friend=Друг -ftbu.label.pfriend=Заявка отправлена -ftbu.label.joined=Присоединился %s назад -ftbu.label.last_seen=Был виден последний раз %s назад -ftbu.label.deaths=Смертей: %s -ftbu.button.block_security=Безопасность блока -ftbu.label.cchunks_count=Заприваченные чанки: %s -ftbu.label.lchunks_count=Загруженные чанки: %s - -#ClientConfig -client_config.ftbu=FTB Utilities -client_config.ftbu.render_badges=Показывать значки -client_config.ftbu.sort_friends_az=Сортировать друзей A-Z -client_config.ftbu.loaded_chunks_space_key=Используйте Пробел для загруженных чанков - -client_config.ftbu_guide=FTB Utilities: руководство -client_config.ftbu_guide.unicode=Использовать Unicode -client_config.ftbu_guide.text_color=Цвет текста -client_config.ftbu_guide.bg_color=Цвет фона -client_config.ftbu_guide.transparency=Прозрачность - -ftbu.player_setting.chat_links=Ссылки в чате -ftbu.player_setting.render_badge=Показывать мой значок -ftbu.player_setting.explosions=Взрывы в заприваченных чанках -ftbu.player_setting.security_level=Уровень безопасности в заприваченных чанках -ftbu.player_setting.fake_players=Разрешить действия Fake Player в заприваченных чанках - -#PlayerActions -player_action.ftbu.guide=Руководство -player_action.ftbu.server_info=Информация о сервере -player_action.ftbu.claimed_chunks=Заприваченные чанки -player_action.ftbu.trade=Обмен -player_action.ftbu.notes=Записки -player_action.ftbu.add_friend=Добавить друга -player_action.ftbu.rem_friend=Удалить из друзей -player_action.ftbu.deny_friend=Отклонить запрос -player_action.ftbu.mail=Почта - -#Misc -ftbu.label.new_friends=Новые заявки в друзья! -ftbu.label.new_friends_click=Принять все заявки в друзья -ftbu.server_restart=Сервер перезапустится через %s -ftbu.commands=Комманды -ftbu.my_permissions=Мои разрешения - -ftbu.cmd.warp_set=Варп '%s' установлен! -ftbu.cmd.warp_del=Варп '%s' удалён! -ftbu.cmd.warp_not_set=Неизвестный варп: '%s'! -ftbu.cmd.warp_tp=Телепортирован к '%s'! - -ftbu.cmd.home_set=Дом '%s' установлен! -ftbu.cmd.home_del=Дом '%s' удалён! -ftbu.cmd.home_not_set=Неизвестный дом: '%s'! -ftbu.cmd.home_cross_dim=Вы не можете телепортироваться между измерениями! -ftbu.cmd.home_limit=Вы не можете устанавливать больше домов! - -ftbu.cmd.no_dp=Вы можете вернуться только один раз! -ftbu.cmd.timer_backup=Следующий Backup: %s -ftbu.cmd.timer_restart=Следующий рестарт: %s -ftbu.cmd.spawn_tp=Телепортирован на спавн -ftbu.cmd.ftb_gamemode=Режим игры: %s -ftbu.cmd.world_difficulty=Сложность: %s - -ftbu.cmd.backup_start=Резервное копирование сервера началось! -ftbu.cmd.backup_stop=Резервное копирование сервера завершено! -ftbu.cmd.backup_end_1=Резервное копирование сервера заняло %s! -ftbu.cmd.backup_end_2=Резервное копирование сервера заняло %s! (%s) -ftbu.cmd.backup_fail=Не удалось сохранить мир! (%s) -ftbu.cmd.backup_manual_launch=%s запустил резервное копирование! -ftbu.cmd.backup_already_running=Резервное копирование уже проводится! -ftbu.cmd.backup_not_running=Резервное копирование не запущено! -ftbu.cmd.backup_size=Текущий размер мира: %s, общий размер резервных копий: %s - -ftbu.button.claims_unclaim_all=Расприватить все чанки -ftbu.button.claims_unclaim_all_dim=Расприватить все чанки в %s -ftbu.button.claims_unclaim_all_q=Расприватить все чанки? -ftbu.button.claims_unclaim_all_dim_q=Расприватить все чанки в %s? -ftbu.label.claims_invalid_dim=Приватить чанки в этом измерении запрещено - -ftbu.top.title=Топы сервера -ftbu.top.first_joined=Первый вход -ftbu.top.last_seen=Последний вход -ftbu.top.time_played=Общее время сыграно -ftbu.top.deaths=Смертей -ftbu.top.deaths_ph=Смертей в час - -#Chunktypes -ftbu.chunktype.unloaded=Чанк не загружен -ftbu.chunktype.spawn=Зона спавна -ftbu.chunktype.world_border=Граница мира -ftbu.chunktype.world_border.warning=Вы достигли границы мира! -ftbu.chunktype.wilderness=Дикая местность -ftbu.chunktype.claimed=Заприваченная зона -ftbu.chunktype.chunkloaded=Загруженная зона \ No newline at end of file diff --git a/src/main/resources/assets/ftbu/lang/zh_CN.lang b/src/main/resources/assets/ftbu/lang/zh_CN.lang deleted file mode 100644 index e7d2e22d..00000000 --- a/src/main/resources/assets/ftbu/lang/zh_CN.lang +++ /dev/null @@ -1,108 +0,0 @@ -#Originally Traslated by xuyu_staryG(gxy17886) From InfinityStudio -#Edited by Cyrus-Vance from KoiRealm - -#Buttons -ftbu.label.friend=好友 -ftbu.label.pfriend=待定的好友 -ftbu.label.joined=%s前加入 -ftbu.label.last_seen=最后露面在%s前 -ftbu.label.deaths=死亡次数: %s -ftbu.button.explosions=爆炸 -ftbu.button.block_security=方块安全 -ftbu.label.cchunks_count=认领区块: %s -ftbu.label.lchunks_count=载入区块: %s - -#ClientConfig -client_config.ftbu=FTBUtilities -client_config.ftbu.render_badges=显示徽章 -client_config.ftbu.render_my_badge=展示我的徽章 -client_config.ftbu.options_button=选项按钮 -client_config.ftbu.chat_links=聊天链接 -client_config.ftbu.sort_friends_az=按A-Z首字母顺序分类好友 -client_config.ftbu.loaded_chunks_space_key=使用空格键加载区块 -client_config.ftbu.guide_unicode=在指南中使用Unicode编码 - -claims_config=认领区块配置 -claims_config.explosions=爆炸 -claims_config.security_level=方块安全等级 -claims_config.fake_players=允许假玩家 - -#PlayerActions -player_action.ftbu.guide=指南 -player_action.ftbu.server_info=服务器信息 -player_action.ftbu.claimed_chunks=认领区块 -player_action.ftbu.trade=交易 -player_action.ftbu.notes=注释 -player_action.ftbu.add_friend=加为好友 -player_action.ftbu.rem_friend=从好友中移除 -player_action.ftbu.deny_friend=拒绝好友的请求 -player_action.ftbu.mail=邮件 - -#Misc -ftbu.label.new_friends=一个新好友申请! -ftbu.label.new_friends_click=点击接受所有申请 -ftbu.server_restart=服务器将会在%s后重启 - -ftbu.cmd.warp_set=传送点'%s'已设置! -ftbu.cmd.warp_del=传送点'%s'已删除! -ftbu.cmd.warp_not_set=未知传送点: '%s'! -ftbu.cmd.warp_tp=传送到'%s'! -ftbu.cmd.warp_not_same_dim=你不能传送到另一个世界! - -ftbu.cmd.home_set=家'%s'已设置! -ftbu.cmd.home_del=家'%s'已删除! -ftbu.cmd.home_not_set=未知的家: '%s'! -ftbu.cmd.home_cross_dim=你不能回到另一个世界的家! -ftbu.cmd.home_limit=你不能设置更多家的位置! - -ftbu.cmd.no_dp=你只能回去一次! -ftbu.cmd.timer_backup=下一次备份: %s -ftbu.cmd.timer_restart=下一次重启: %s -ftbu.cmd.rules=[点击这里打开规则] -ftbu.cmd.spawn_tp=传送到出生点 - -ftbu.button.claims_unclaim_all=解除所有认领区块 -ftbu.button.claims_unclaim_all_dim=在%s解除所有认领区块 -ftbu.button.claims_unclaim_all_q=是否解除所有认领区块? -ftbu.button.claims_unclaim_all_dim_q=是否在%s解除所有认领区块? -ftbu.label.claims_invalid_dim=在这个维度不能解除认领区块 - -ftbu.top.title=服务器排名 -ftbu.top.first_joined=上线时间 -ftbu.top.last_seen=离线时间 -ftbu.top.time_played=游戏时间 -ftbu.top.deaths=死亡 -ftbu.top.deaths_ph=每小时死亡 - -#Chunktypes -ftbu.chunktype.unloaded=区块未载入 -ftbu.chunktype.spawn=出生区域 -ftbu.chunktype.world_border=世界边界 -ftbu.chunktype.world_border.warning=你已经到达了世界的边界! -ftbu.chunktype.wilderness=野外地区 -ftbu.chunktype.claimed=认领区域 -ftbu.chunktype.chunkloaded=区块加载 - -client_config.ftbu_guide=FTB Utilities: 指南 -client_config.ftbu_guide.unicode=使用Unicode编码 -client_config.ftbu_guide.text_color=文本颜色 -client_config.ftbu_guide.bg_color=背景颜色 -client_config.ftbu_guide.transparency=透明度 -ftbu.player_setting.chat_links=聊天链接 -ftbu.player_setting.render_badge=显示徽章 -ftbu.player_setting.explosions=认领区块发生爆炸 -ftbu.player_setting.security_level=认领区块安全等级 -ftbu.player_setting.fake_players=认领区块允许假玩家 -ftbu.commands=命令 -ftbu.my_permissions=我的权限 -ftbu.cmd.ftb_gamemode=游戏模式: %s -ftbu.cmd.world_difficulty=难度: %s -ftbu.cmd.backup_start=服务器备份已开始! -ftbu.cmd.backup_stop=服务器备份已停止! -ftbu.cmd.backup_end_1=服务器备份完成,用时%s! -ftbu.cmd.backup_end_2=服务器备份完成,用时%s! (%s) -ftbu.cmd.backup_fail=保存世界存档时失败! (%s) -ftbu.cmd.backup_manual_launch=%s 执行了手动备份! -ftbu.cmd.backup_already_running=正在备份中…… -ftbu.cmd.backup_not_running=备份进程未运行! -ftbu.cmd.backup_size=当前世界大小: %s,备份文件夹总大小: %s diff --git a/src/main/resources/assets/serverlib/lang/de_DE.lang b/src/main/resources/assets/serverlib/lang/de_DE.lang new file mode 100644 index 00000000..b1e39c16 --- /dev/null +++ b/src/main/resources/assets/serverlib/lang/de_DE.lang @@ -0,0 +1,85 @@ +serverlib:gamemode.loaded=Spielmodus geändert zu '%s'! +serverlib:gamemode.not_found=Spielmodus existiert nicht! +serverlib:gamemode.already_set=Spielmodus bereits geladen! +serverlib:gamemode.current=Aktiver Spielmodus: %s +serverlib:gamemode.list=Verfügbare Spielmodi: %s +serverlib:worldID=WorldID: %s +serverlib:reloadedServer=ServerUtilitiesLibrary neu geladen (Server) +serverlib:reloadedClient=ServerUtilitiesLibrary neu geladen (Client) +serverlib:missing_args=Fehlende Argumente! +serverlib:feature_disabled=Dieses Feature ist deaktiviert! +serverlib:invalid_subcmd=Invalider Sub-Befehl: '%s'! +serverlib:owner=Besitzer: %s +serverlib:delete_item=Willst du '%s' löschen? +serverlib:label.server_forced=Server overrides to '%s' + +#Buttons +serverlib:button.settings=Einstellungen +serverlib:button.back=Zurück +serverlib:button.up=Hoch +serverlib:button.down=Runter +serverlib:button.prev=Vorherige +serverlib:button.next=Nächste +serverlib:button.cancel=Abbrechen +serverlib:button.accept=Akzeptieren +serverlib:button.remove=Entfernen +serverlib:button.add=Hinzufügen +serverlib:button.close=Schließen +serverlib:button.save=Speichern +serverlib:button.refresh=Neu laden +serverlib:button.other=Andere +serverlib:button.edit=Editieren + +serverlib:label.true=True +serverlib:label.false=False +serverlib:label.enabled=Aktiviert +serverlib:label.disabled=Deaktiviert +serverlib:label.on=An +serverlib:label.off=Aus +serverlib:label.online=Online +serverlib:label.offline=Offline + +#Colors +serverlib:color.black=Schwarz +serverlib:color.red=Rot +serverlib:color.green=Grün +serverlib:color.brown=Braun +serverlib:color.blue=Blau +serverlib:color.purple=Lila +serverlib:color.cyan=Cyan +serverlib:color.lightgray=Hell Grau +serverlib:color.gray=Dunkel Grau +serverlib:color.pink=Pink +serverlib:color.lime=Lime +serverlib:color.yellow=Gelb +serverlib:color.lightblue=Hell Blau +serverlib:color.magenta=Magenta +serverlib:color.orange=Orange +serverlib:color.white=Weiß + +#Sides +serverlib:side.down=Unten +serverlib:side.up=Oben +serverlib:side.north=Norden +serverlib:side.south=Süden +serverlib:side.west=Westen +serverlib:side.east=Osten + +serverlib:dside.bottom=Unten +serverlib:dside.top=Oben +serverlib:dside.back=Hinten +serverlib:dside.front=Vorne +serverlib:dside.left=Links +serverlib:dside.right=Rechts + +#Config +client_config=Client Config +client_config.serverlib=ServerUtilitiesLibrary +client_config.serverlib.item_ore_names=Item OreDict Names +client_config.serverlib.item_reg_names=Item Registry Names +client_config.serverlib.debug_info=Debug Info +client_config.serverlib.notifications=Benachrichtigungen + +client_config.sidebar_buttons=Seitenleiste Buttons +client_config.sidebar_buttons.settings=Client Einstellungen +client_config.sidebar_buttons.notifications=Benachrichtigungen diff --git a/src/main/resources/assets/serverlib/lang/en_US.lang b/src/main/resources/assets/serverlib/lang/en_US.lang new file mode 100644 index 00000000..22bd963e --- /dev/null +++ b/src/main/resources/assets/serverlib/lang/en_US.lang @@ -0,0 +1,139 @@ +serverlib.gamemode.loaded=Gamemode set to '%s'! +serverlib.gamemode.not_found=Gamemode does not exist! +serverlib.gamemode.already_set=Gamemode already set! +serverlib.gamemode.current=Current gamemode: %s +serverlib.gamemode.list=Available gamemodes: %s +serverlib.worldID=WorldID: %s +serverlib.reloaded_server=ServerUtilitiesLibrary: Server reloaded in %s +serverlib.reloaded_client=ServerUtilitiesLibrary: Client reloaded in %s +serverlib.missing_args=Missing Arguments! +serverlib.feature_disabled=This feature is disabled! +serverlib.invalid_subcmd=Invalid subcommand: '%s'! +serverlib.owner=Owner: %s +serverlib.delete_item=Do you want to delete '%s'? +serverlib.label.server_forced=Server overrides to '%s' +serverlib.reload_client_config=Server Reloaded. You can + +serverlib.button.shortcut.action=Action +serverlib.button.shortcut.data=Action Data +serverlib.button.shortcut.key=Key +serverlib.button.shortcut.icon=Icon +serverlib.button.shortcut.title=Title +serverlib.button.shortcut.priority=Priority +serverlib.button.shortcut.add_key=Add Key Shortcut +serverlib.button.shortcut.add_button=Add Button Shortcut + +#Buttons +serverlib.button.settings=Settings +serverlib.button.back=Back +serverlib.button.up=Up +serverlib.button.down=Down +serverlib.button.prev=Previous +serverlib.button.next=Next +serverlib.button.cancel=Cancel +serverlib.button.accept=Accept +serverlib.button.remove=Remove +serverlib.button.add=Add +serverlib.button.close=Close +serverlib.button.save=Save +serverlib.button.refresh=Refresh +serverlib.button.other=Other +serverlib.button.edit=Edit +serverlib.button.info=Info + +serverlib.label.true=True +serverlib.label.false=False +serverlib.label.enabled=Enabled +serverlib.label.disabled=Disabled +serverlib.label.on=On +serverlib.label.off=Off +serverlib.label.online=Online +serverlib.label.offline=Offline +serverlib.label.whitelist=Whitelist +serverlib.label.blacklist=Blacklist + +#Colors +serverlib.color.black=Black +serverlib.color.red=Red +serverlib.color.green=Green +serverlib.color.brown=Brown +serverlib.color.blue=Blue +serverlib.color.purple=Purple +serverlib.color.cyan=Cyan +serverlib.color.lightgray=Light Gray +serverlib.color.gray=Dark Gray +serverlib.color.pink=Pink +serverlib.color.lime=Lime +serverlib.color.yellow=Yellow +serverlib.color.lightblue=Light Blue +serverlib.color.magenta=Magenta +serverlib.color.orange=Orange +serverlib.color.white=White + +#Sides +serverlib.side.down=Down +serverlib.side.up=Up +serverlib.side.north=North +serverlib.side.south=South +serverlib.side.west=West +serverlib.side.east=East + +serverlib.dside.bottom=Bottom +serverlib.dside.top=Top +serverlib.dside.back=Back +serverlib.dside.front=Front +serverlib.dside.left=Left +serverlib.dside.right=Right + +#ClientConfig +client_config=Client Config +client_config.serverlib=ServerUtilitiesLibrary +client_config.serverlib.item_ore_names=Item OreDict Names +client_config.serverlib.item_reg_names=Item Registry Names +client_config.serverlib.debug_info=Debug Info +client_config.serverlib.notifications=Notifications +client_config.serverlib.reload_client_cmd=Client Reloading Command +client_config.serverlib.action_buttons_on_top=Action Buttons On Top +client_config.serverlib.player_options_shortcut=Player Options Shortcut +client_config.serverlib.key_bindings=Key Bindings +client_config.serverlib.edit_shortcuts=Edit Shortcuts +client_config.serverlib.light_value_texture=Light Value Texture + +client_config.sidebar_buttons=Sidebar Buttons + +#PlayerActions +player_action.serverlib.settings=Client Settings +player_action.serverlib.notifications=Notifications +player_action.serverlib.toggle_gamemode=Toggle Gamemode +player_action.serverlib.toggle_rain=Toggle Rain +player_action.serverlib.toggle_day=Set time to Day +player_action.serverlib.toggle_night=Set time to Night +player_action.serverlib.toggle_chunk_bounds=Toggle Chunk Bounds +player_action.serverlib.toggle_light_values=Toggle Light Values + +#Security Mode +serverlib.security=Security +serverlib.security.public=Public +serverlib.security.private=Private +serverlib.security.friends=Friends +serverlib.security.group=Group + +#Redstone Mode +serverlib.redstonemode=Redstone Mode +serverlib.redstonemode.disabled=Disabled +serverlib.redstonemode.high=Active High +serverlib.redstonemode.low=Active Low + +#Inventory Mode +serverlib.invmode=Automation +serverlib.invmode.enabled=Enabled +serverlib.invmode.onlyin=Insert Only +serverlib.invmode.onlyout=Extract Only +serverlib.invmode.disabled=Disabled + +#Click Actions +click_action.cmd=Command +click_action.show_cmd=Show Command +click_action.url=Open URL +click_action.file=Open File +click_action.gui=Open Gui diff --git a/src/main/resources/assets/serverlib/lang/zh_CN.lang b/src/main/resources/assets/serverlib/lang/zh_CN.lang new file mode 100644 index 00000000..14dc38e7 --- /dev/null +++ b/src/main/resources/assets/serverlib/lang/zh_CN.lang @@ -0,0 +1,118 @@ +#Traslated by xuyu_staryG(gxy17886) From InfinityStudio +serverlib:gamemode.loaded=游戏模式设置为'%s'! +serverlib:gamemode.not_found=游戏模式不存在! +serverlib:gamemode.already_set=游戏模式已设置! +serverlib:gamemode.current=当前游戏模式: %s +serverlib:gamemode.list=可用游戏模式: %s +serverlib:worldID=世界ID: %s +serverlib:reloadedServer=ServerUtilitiesLibrary:服务器重新载入在%s +serverlib:reloadedClient=ServerUtilitiesLibrary:客户端重新载入在%s +serverlib:missing_args=缺少参数! +serverlib:feature_disabled=此功能被禁用! +serverlib:invalid_subcmd=无效的子命令: '%s'! +serverlib:owner=所有者: %s +serverlib:delete_item=你确定要删除'%s'? +serverlib:label.server_forced=服务器覆盖'%s' +serverlib:reload_client_config=你可以重新载入服务器. + +#Buttons +serverlib:button.settings=设置 +serverlib:button.back=后退 +serverlib:button.up=上 +serverlib:button.down=下 +serverlib:button.prev=上一步 +serverlib:button.next=下一步 +serverlib:button.cancel=取消 +serverlib:button.accept=接受 +serverlib:button.remove=删除 +serverlib:button.add=添加 +serverlib:button.close=关闭 +serverlib:button.save=保存 +serverlib:button.refresh=刷新 +serverlib:button.other=其他 +serverlib:button.edit=编辑 + +serverlib:label.true=True +serverlib:label.false=False +serverlib:label.enabled=启用 +serverlib:label.disabled=禁用 +serverlib:label.on=开 +serverlib:label.off=关 +serverlib:label.online=在线 +serverlib:label.offline=离线 +serverlib:label.whitelist=白名单 +serverlib:label.blacklist=黑名单 + +#Colors +serverlib:color.black=黑色 +serverlib:color.red=红色 +serverlib:color.green=绿色 +serverlib:color.brown=棕色 +serverlib:color.blue=蓝色 +serverlib:color.purple=紫色 +serverlib:color.cyan=青色 +serverlib:color.lightgray=浅灰色 +serverlib:color.gray=深灰色 +serverlib:color.pink=粉色 +serverlib:color.lime=黄绿色 +serverlib:color.yellow=黄色 +serverlib:color.lightblue=浅蓝色 +serverlib:color.magenta=品红色 +serverlib:color.orange=橙色 +serverlib:color.white=白色 + +#Sides +serverlib:side.down=下 +serverlib:side.up=上 +serverlib:side.north=北 +serverlib:side.south=南 +serverlib:side.west=西 +serverlib:side.east=东 + +serverlib:dside.bottom=底部 +serverlib:dside.top=顶部 +serverlib:dside.back=后面 +serverlib:dside.front=前面 +serverlib:dside.left=左侧 +serverlib:dside.right=右侧 + +#ClientConfig +client_config=客户端配置 +client_config.serverlib=ServerUtilitiesLibrary +client_config.serverlib.item_ore_names=物品矿物词典名字 +client_config.serverlib.item_reg_names=物品注册名称 +client_config.serverlib.debug_info=调试信息 +client_config.serverlib.notifications=通知 +client_config.serverlib.reload_client_cmd=客户端重新载入命令 +client_config.serverlib.action_buttons_on_top=动作按钮在顶部 +client_config.serverlib.player_options_shortcut=玩家快捷选项 + +client_config.sidebar_buttons=侧边栏按钮 + +#PlayerActions +player_action.serverlib.settings=客户端设置 +player_action.serverlib.notifications=通知 +player_action.serverlib.toggle_gamemode=切换游戏模式 +player_action.serverlib.toggle_rain=切换雨雪 +player_action.serverlib.toggle_day=设置时间为白天 +player_action.serverlib.toggle_night=设置时间为晚上 + +#Security Mode +serverlib:security=安全 +serverlib:security.public=公共 +serverlib:security.private=私人 +serverlib:security.friends=仅限朋友 +serverlib:security.group=仅限同组 + +#Redstone Mode +serverlib:redstonemode=红石模式 +serverlib:redstonemode.disabled=禁用 +serverlib:redstonemode.high=高态有效 +serverlib:redstonemode.low=低态有效 + +#Inventory Mode +serverlib:invmode=自动化 +serverlib:invmode.enabled=启用 +serverlib:invmode.onlyin=只有输入 +serverlib:invmode.onlyout=只有输出 +serverlib:invmode.disabled=禁用 diff --git a/src/main/resources/assets/ftbl/textures/blocks/empty_block.png b/src/main/resources/assets/serverlib/textures/blocks/empty_block.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/blocks/empty_block.png rename to src/main/resources/assets/serverlib/textures/blocks/empty_block.png diff --git a/src/main/resources/assets/ftbl/textures/gui/buttonBG.png b/src/main/resources/assets/serverlib/textures/gui/buttonBG.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/gui/buttonBG.png rename to src/main/resources/assets/serverlib/textures/gui/buttonBG.png diff --git a/src/main/resources/assets/ftbl/textures/gui/colselector.png b/src/main/resources/assets/serverlib/textures/gui/colselector.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/gui/colselector.png rename to src/main/resources/assets/serverlib/textures/gui/colselector.png diff --git a/src/main/resources/assets/ftbl/textures/gui/colselector_wheel.png b/src/main/resources/assets/serverlib/textures/gui/colselector_wheel.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/gui/colselector_wheel.png rename to src/main/resources/assets/serverlib/textures/gui/colselector_wheel.png diff --git a/src/main/resources/assets/ftbl/textures/gui/displayitem.png b/src/main/resources/assets/serverlib/textures/gui/displayitem.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/gui/displayitem.png rename to src/main/resources/assets/serverlib/textures/gui/displayitem.png diff --git a/src/main/resources/assets/ftbl/textures/icons/accept.png b/src/main/resources/assets/serverlib/textures/icons/accept.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/accept.png rename to src/main/resources/assets/serverlib/textures/icons/accept.png diff --git a/src/main/resources/assets/ftbl/textures/icons/accept_gray.png b/src/main/resources/assets/serverlib/textures/icons/accept_gray.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/accept_gray.png rename to src/main/resources/assets/serverlib/textures/icons/accept_gray.png diff --git a/src/main/resources/assets/ftbl/textures/icons/add.png b/src/main/resources/assets/serverlib/textures/icons/add.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/add.png rename to src/main/resources/assets/serverlib/textures/icons/add.png diff --git a/src/main/resources/assets/ftbl/textures/icons/add_gray.png b/src/main/resources/assets/serverlib/textures/icons/add_gray.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/add_gray.png rename to src/main/resources/assets/serverlib/textures/icons/add_gray.png diff --git a/src/main/resources/assets/ftbl/textures/icons/art.png b/src/main/resources/assets/serverlib/textures/icons/art.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/art.png rename to src/main/resources/assets/serverlib/textures/icons/art.png diff --git a/src/main/resources/assets/ftbl/textures/icons/back.png b/src/main/resources/assets/serverlib/textures/icons/back.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/back.png rename to src/main/resources/assets/serverlib/textures/icons/back.png diff --git a/src/main/resources/assets/ftbl/textures/icons/beacon.png b/src/main/resources/assets/serverlib/textures/icons/beacon.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/beacon.png rename to src/main/resources/assets/serverlib/textures/icons/beacon.png diff --git a/src/main/resources/assets/ftbl/textures/icons/bed.png b/src/main/resources/assets/serverlib/textures/icons/bed.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/bed.png rename to src/main/resources/assets/serverlib/textures/icons/bed.png diff --git a/src/main/resources/assets/ftbl/textures/icons/bell.png b/src/main/resources/assets/serverlib/textures/icons/bell.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/bell.png rename to src/main/resources/assets/serverlib/textures/icons/bell.png diff --git a/src/main/resources/assets/ftbl/textures/icons/bin.png b/src/main/resources/assets/serverlib/textures/icons/bin.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/bin.png rename to src/main/resources/assets/serverlib/textures/icons/bin.png diff --git a/src/main/resources/assets/ftbl/textures/icons/blank.png b/src/main/resources/assets/serverlib/textures/icons/blank.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/blank.png rename to src/main/resources/assets/serverlib/textures/icons/blank.png diff --git a/src/main/resources/assets/ftbl/textures/icons/blank_blue.png b/src/main/resources/assets/serverlib/textures/icons/blank_blue.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/blank_blue.png rename to src/main/resources/assets/serverlib/textures/icons/blank_blue.png diff --git a/src/main/resources/assets/ftbl/textures/icons/book.png b/src/main/resources/assets/serverlib/textures/icons/book.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/book.png rename to src/main/resources/assets/serverlib/textures/icons/book.png diff --git a/src/main/resources/assets/ftbl/textures/icons/book_red.png b/src/main/resources/assets/serverlib/textures/icons/book_red.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/book_red.png rename to src/main/resources/assets/serverlib/textures/icons/book_red.png diff --git a/src/main/resources/assets/ftbl/textures/icons/bug.png b/src/main/resources/assets/serverlib/textures/icons/bug.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/bug.png rename to src/main/resources/assets/serverlib/textures/icons/bug.png diff --git a/src/main/resources/assets/ftbl/textures/icons/camera.png b/src/main/resources/assets/serverlib/textures/icons/camera.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/camera.png rename to src/main/resources/assets/serverlib/textures/icons/camera.png diff --git a/src/main/resources/assets/ftbl/textures/icons/cancel.png b/src/main/resources/assets/serverlib/textures/icons/cancel.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/cancel.png rename to src/main/resources/assets/serverlib/textures/icons/cancel.png diff --git a/src/main/resources/assets/ftbl/textures/icons/chat.png b/src/main/resources/assets/serverlib/textures/icons/chat.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/chat.png rename to src/main/resources/assets/serverlib/textures/icons/chat.png diff --git a/src/main/resources/assets/ftbl/textures/icons/check.png b/src/main/resources/assets/serverlib/textures/icons/check.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/check.png rename to src/main/resources/assets/serverlib/textures/icons/check.png diff --git a/src/main/resources/assets/ftbl/textures/icons/close.png b/src/main/resources/assets/serverlib/textures/icons/close.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/close.png rename to src/main/resources/assets/serverlib/textures/icons/close.png diff --git a/src/main/resources/assets/ftbl/textures/icons/color_blank.png b/src/main/resources/assets/serverlib/textures/icons/color_blank.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/color_blank.png rename to src/main/resources/assets/serverlib/textures/icons/color_blank.png diff --git a/src/main/resources/assets/ftbl/textures/icons/color_hsb.png b/src/main/resources/assets/serverlib/textures/icons/color_hsb.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/color_hsb.png rename to src/main/resources/assets/serverlib/textures/icons/color_hsb.png diff --git a/src/main/resources/assets/ftbl/textures/icons/color_rgb.png b/src/main/resources/assets/serverlib/textures/icons/color_rgb.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/color_rgb.png rename to src/main/resources/assets/serverlib/textures/icons/color_rgb.png diff --git a/src/main/resources/assets/ftbl/textures/icons/compass.png b/src/main/resources/assets/serverlib/textures/icons/compass.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/compass.png rename to src/main/resources/assets/serverlib/textures/icons/compass.png diff --git a/src/main/resources/assets/ftbl/textures/icons/controller.png b/src/main/resources/assets/serverlib/textures/icons/controller.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/controller.png rename to src/main/resources/assets/serverlib/textures/icons/controller.png diff --git a/src/main/resources/assets/ftbl/textures/icons/diamond.png b/src/main/resources/assets/serverlib/textures/icons/diamond.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/diamond.png rename to src/main/resources/assets/serverlib/textures/icons/diamond.png diff --git a/src/main/resources/assets/ftbl/textures/icons/dice.png b/src/main/resources/assets/serverlib/textures/icons/dice.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/dice.png rename to src/main/resources/assets/serverlib/textures/icons/dice.png diff --git a/src/main/resources/assets/ftbl/textures/icons/down.png b/src/main/resources/assets/serverlib/textures/icons/down.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/down.png rename to src/main/resources/assets/serverlib/textures/icons/down.png diff --git a/src/main/resources/assets/ftbl/textures/icons/feather.png b/src/main/resources/assets/serverlib/textures/icons/feather.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/feather.png rename to src/main/resources/assets/serverlib/textures/icons/feather.png diff --git a/src/main/resources/assets/ftbl/textures/icons/friends.png b/src/main/resources/assets/serverlib/textures/icons/friends.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/friends.png rename to src/main/resources/assets/serverlib/textures/icons/friends.png diff --git a/src/main/resources/assets/ftbl/textures/icons/globe.png b/src/main/resources/assets/serverlib/textures/icons/globe.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/globe.png rename to src/main/resources/assets/serverlib/textures/icons/globe.png diff --git a/src/main/resources/assets/ftbl/textures/icons/info.png b/src/main/resources/assets/serverlib/textures/icons/info.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/info.png rename to src/main/resources/assets/serverlib/textures/icons/info.png diff --git a/src/main/resources/assets/ftbl/textures/icons/info_gray.png b/src/main/resources/assets/serverlib/textures/icons/info_gray.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/info_gray.png rename to src/main/resources/assets/serverlib/textures/icons/info_gray.png diff --git a/src/main/resources/assets/ftbl/textures/icons/inv_in.png b/src/main/resources/assets/serverlib/textures/icons/inv_in.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/inv_in.png rename to src/main/resources/assets/serverlib/textures/icons/inv_in.png diff --git a/src/main/resources/assets/ftbl/textures/icons/inv_io.png b/src/main/resources/assets/serverlib/textures/icons/inv_io.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/inv_io.png rename to src/main/resources/assets/serverlib/textures/icons/inv_io.png diff --git a/src/main/resources/assets/ftbl/textures/icons/inv_none.png b/src/main/resources/assets/serverlib/textures/icons/inv_none.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/inv_none.png rename to src/main/resources/assets/serverlib/textures/icons/inv_none.png diff --git a/src/main/resources/assets/ftbl/textures/icons/inv_out.png b/src/main/resources/assets/serverlib/textures/icons/inv_out.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/inv_out.png rename to src/main/resources/assets/serverlib/textures/icons/inv_out.png diff --git a/src/main/resources/assets/ftbl/textures/icons/jacket.png b/src/main/resources/assets/serverlib/textures/icons/jacket.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/jacket.png rename to src/main/resources/assets/serverlib/textures/icons/jacket.png diff --git a/src/main/resources/assets/ftbl/textures/icons/left.png b/src/main/resources/assets/serverlib/textures/icons/left.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/left.png rename to src/main/resources/assets/serverlib/textures/icons/left.png diff --git a/src/main/resources/assets/ftbl/textures/icons/map.png b/src/main/resources/assets/serverlib/textures/icons/map.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/map.png rename to src/main/resources/assets/serverlib/textures/icons/map.png diff --git a/src/main/resources/assets/ftbl/textures/icons/marker.png b/src/main/resources/assets/serverlib/textures/icons/marker.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/marker.png rename to src/main/resources/assets/serverlib/textures/icons/marker.png diff --git a/src/main/resources/assets/ftbl/textures/icons/money.png b/src/main/resources/assets/serverlib/textures/icons/money.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/money.png rename to src/main/resources/assets/serverlib/textures/icons/money.png diff --git a/src/main/resources/assets/ftbl/textures/icons/money_bag.png b/src/main/resources/assets/serverlib/textures/icons/money_bag.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/money_bag.png rename to src/main/resources/assets/serverlib/textures/icons/money_bag.png diff --git a/src/main/resources/assets/ftbl/textures/icons/notes.png b/src/main/resources/assets/serverlib/textures/icons/notes.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/notes.png rename to src/main/resources/assets/serverlib/textures/icons/notes.png diff --git a/src/main/resources/assets/ftbl/textures/icons/offline.png b/src/main/resources/assets/serverlib/textures/icons/offline.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/offline.png rename to src/main/resources/assets/serverlib/textures/icons/offline.png diff --git a/src/main/resources/assets/ftbl/textures/icons/online.png b/src/main/resources/assets/serverlib/textures/icons/online.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/online.png rename to src/main/resources/assets/serverlib/textures/icons/online.png diff --git a/src/main/resources/assets/ftbl/textures/icons/online_red.png b/src/main/resources/assets/serverlib/textures/icons/online_red.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/online_red.png rename to src/main/resources/assets/serverlib/textures/icons/online_red.png diff --git a/src/main/resources/assets/ftbl/textures/icons/player.png b/src/main/resources/assets/serverlib/textures/icons/player.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/player.png rename to src/main/resources/assets/serverlib/textures/icons/player.png diff --git a/src/main/resources/assets/ftbl/textures/icons/player_gray.png b/src/main/resources/assets/serverlib/textures/icons/player_gray.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/player_gray.png rename to src/main/resources/assets/serverlib/textures/icons/player_gray.png diff --git a/src/main/resources/assets/ftbl/textures/icons/refresh.png b/src/main/resources/assets/serverlib/textures/icons/refresh.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/refresh.png rename to src/main/resources/assets/serverlib/textures/icons/refresh.png diff --git a/src/main/resources/assets/ftbl/textures/icons/remove.png b/src/main/resources/assets/serverlib/textures/icons/remove.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/remove.png rename to src/main/resources/assets/serverlib/textures/icons/remove.png diff --git a/src/main/resources/assets/ftbl/textures/icons/remove_gray.png b/src/main/resources/assets/serverlib/textures/icons/remove_gray.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/remove_gray.png rename to src/main/resources/assets/serverlib/textures/icons/remove_gray.png diff --git a/src/main/resources/assets/ftbl/textures/icons/right.png b/src/main/resources/assets/serverlib/textures/icons/right.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/right.png rename to src/main/resources/assets/serverlib/textures/icons/right.png diff --git a/src/main/resources/assets/ftbl/textures/icons/rs_high.png b/src/main/resources/assets/serverlib/textures/icons/rs_high.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/rs_high.png rename to src/main/resources/assets/serverlib/textures/icons/rs_high.png diff --git a/src/main/resources/assets/ftbl/textures/icons/rs_low.png b/src/main/resources/assets/serverlib/textures/icons/rs_low.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/rs_low.png rename to src/main/resources/assets/serverlib/textures/icons/rs_low.png diff --git a/src/main/resources/assets/ftbl/textures/icons/rs_none.png b/src/main/resources/assets/serverlib/textures/icons/rs_none.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/rs_none.png rename to src/main/resources/assets/serverlib/textures/icons/rs_none.png diff --git a/src/main/resources/assets/ftbl/textures/icons/rs_pulse.png b/src/main/resources/assets/serverlib/textures/icons/rs_pulse.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/rs_pulse.png rename to src/main/resources/assets/serverlib/textures/icons/rs_pulse.png diff --git a/src/main/resources/assets/ftbl/textures/icons/security_friends.png b/src/main/resources/assets/serverlib/textures/icons/security_friends.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/security_friends.png rename to src/main/resources/assets/serverlib/textures/icons/security_friends.png diff --git a/src/main/resources/assets/ftbl/textures/icons/security_group.png b/src/main/resources/assets/serverlib/textures/icons/security_group.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/security_group.png rename to src/main/resources/assets/serverlib/textures/icons/security_group.png diff --git a/src/main/resources/assets/ftbl/textures/icons/security_private.png b/src/main/resources/assets/serverlib/textures/icons/security_private.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/security_private.png rename to src/main/resources/assets/serverlib/textures/icons/security_private.png diff --git a/src/main/resources/assets/ftbl/textures/icons/security_public.png b/src/main/resources/assets/serverlib/textures/icons/security_public.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/security_public.png rename to src/main/resources/assets/serverlib/textures/icons/security_public.png diff --git a/src/main/resources/assets/ftbl/textures/icons/settings.png b/src/main/resources/assets/serverlib/textures/icons/settings.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/settings.png rename to src/main/resources/assets/serverlib/textures/icons/settings.png diff --git a/src/main/resources/assets/ftbl/textures/icons/shield.png b/src/main/resources/assets/serverlib/textures/icons/shield.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/shield.png rename to src/main/resources/assets/serverlib/textures/icons/shield.png diff --git a/src/main/resources/assets/ftbl/textures/icons/sort_az.png b/src/main/resources/assets/serverlib/textures/icons/sort_az.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/sort_az.png rename to src/main/resources/assets/serverlib/textures/icons/sort_az.png diff --git a/src/main/resources/assets/ftbl/textures/icons/star.png b/src/main/resources/assets/serverlib/textures/icons/star.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/star.png rename to src/main/resources/assets/serverlib/textures/icons/star.png diff --git a/src/main/resources/assets/ftbl/textures/icons/time.png b/src/main/resources/assets/serverlib/textures/icons/time.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/time.png rename to src/main/resources/assets/serverlib/textures/icons/time.png diff --git a/src/main/resources/assets/ftbl/textures/icons/toggle_day.png b/src/main/resources/assets/serverlib/textures/icons/toggle_day.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/toggle_day.png rename to src/main/resources/assets/serverlib/textures/icons/toggle_day.png diff --git a/src/main/resources/assets/ftbl/textures/icons/toggle_gamemode.png b/src/main/resources/assets/serverlib/textures/icons/toggle_gamemode.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/toggle_gamemode.png rename to src/main/resources/assets/serverlib/textures/icons/toggle_gamemode.png diff --git a/src/main/resources/assets/ftbl/textures/icons/toggle_night.png b/src/main/resources/assets/serverlib/textures/icons/toggle_night.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/toggle_night.png rename to src/main/resources/assets/serverlib/textures/icons/toggle_night.png diff --git a/src/main/resources/assets/ftbl/textures/icons/toggle_rain.png b/src/main/resources/assets/serverlib/textures/icons/toggle_rain.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/toggle_rain.png rename to src/main/resources/assets/serverlib/textures/icons/toggle_rain.png diff --git a/src/main/resources/assets/ftbl/textures/icons/up.png b/src/main/resources/assets/serverlib/textures/icons/up.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/icons/up.png rename to src/main/resources/assets/serverlib/textures/icons/up.png diff --git a/src/main/resources/assets/ftbl/textures/items/unknown.png b/src/main/resources/assets/serverlib/textures/items/unknown.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/items/unknown.png rename to src/main/resources/assets/serverlib/textures/items/unknown.png diff --git a/src/main/resources/assets/ftbl/textures/logo.png b/src/main/resources/assets/serverlib/textures/logo.png similarity index 100% rename from src/main/resources/assets/ftbl/textures/logo.png rename to src/main/resources/assets/serverlib/textures/logo.png diff --git a/src/main/resources/assets/serverutils/lang/de_DE.lang b/src/main/resources/assets/serverutils/lang/de_DE.lang new file mode 100644 index 00000000..5fde3e23 --- /dev/null +++ b/src/main/resources/assets/serverutils/lang/de_DE.lang @@ -0,0 +1,103 @@ +#Buttons +serverutils:button.add_friend=Zu Freunden hinzufügen +serverutils:button.rem_friend=Von Freunden entfernen +serverutils:button.deny_friend=Freundschafftsanfrage ablehnen +serverutils:button.guide=Guide +serverutils:button.claimed_chunks=Beanspruchte Chunks +serverutils:button.mail=Nachrichten +serverutils:button.trade=Handel +serverutils:button.notes=Notizen +serverutils:button.server_info=Server Info +serverutils:label.friend=Freund +serverutils:label.pfriend=Ausstehende Freundschaftsanfragen +serverutils:label.joined=Beigetreten vor %s +serverutils:label.last_seen=Zuletzt gesehen %s +serverutils:label.deaths=Tode: %s +serverutils:button.explosions=Explosionen +serverutils:button.block_security=Block Sicherheit +serverutils:label.cchunks_count=Beanspruchte Chunks: %s +serverutils:label.lchunks_count=Geladene Chunks: %s + +#ClientConfig +client_config.sidebar_buttons.guide=Guide +client_config.sidebar_buttons.info=Server Info +client_config.sidebar_buttons.claims=Beanspruchte Chunks + +client_config.serverutils=ServerUtilities +client_config.serverutils.render_badges=Zeige Abzeichen +client_config.serverutils.render_my_badge=Zeige meine Abzeichen +client_config.serverutils.options_button=Optionen Button +client_config.serverutils.chat_links=Chat Links +client_config.serverutils.player_options_shortcut=Spieler Optionen Shortcut +client_config.serverutils.sort_friends_az=Sortiere Freunde A-Z + +claims_config=Beanspruchte Chunks Config +claims_config.explosions=Explosionen +claims_config.security_level=Block Sicherheits Level +claims_config.fake_players=Erlaube Fake Players + +#Misc +serverutils:label.new_friends=Neue Freundschaftsanfrage! +serverutils:label.new_friends_click=Klicke um alle Anfragen anzunehmen +serverutils:server_restart=Server wird in %s neustarten + +serverutils:cmd.warp_set=Warp '%s' gesetzt! +serverutils:cmd.warp_del=Warp '%s' gelöscht! +serverutils:cmd.warp_not_set=Unbekannter Warp: '%s'! +serverutils:cmd.warp_tp=Teleportiert zu '%s'! + +serverutils:cmd.home_set=Zuhause '%s' gesetzt! +serverutils:cmd.home_del=Zuhause '%s' gelöscht! +serverutils:cmd.home_not_set=Unbekanntes Zuhause: '%s'! +serverutils:cmd.home_cross_dim=Du kannst dich nicht in eine andere Dimension teleportieren! +serverutils:cmd.home_limit=Du kannst keine weiteren Zuhause setzen! + +serverutils:cmd.no_dp=Du kannst nur einmal zurück gehen! +serverutils:cmd.timer_backup=Nächste Sicherung: %s +serverutils:cmd.timer_restart=Nächster Neustart: %s +serverutils:cmd.rules=[Klicke hier um die Regeln zu öffnen] +serverutils:cmd.spawn_tp=Zum Spawn teleportiert + +serverutils:button.claims_unclaim_all=Gebe alle Chunks frei +serverutils:button.claims_unclaim_all_dim=Gebe alle Chunks in %s frei +serverutils:button.claims_unclaim_all_q=Alle beanspruchten Chunks freigeben? +serverutils:button.claims_unclaim_all_dim_q=Alle beanspruchten Chunks in %s freigeben? +serverutils:label.claims_invalid_dim=Du kannst keine Chunks in dieser Dimension beanspruchen + +serverutils:top.title=Server Rangliste +serverutils:top.first_joined=Zuerst Gesehen +serverutils:top.last_seen=Zuletzt Gesehen +serverutils:top.time_played=Spielzeit +serverutils:top.deaths=Tode +serverutils:top.deaths_ph=Tode per Stunde + +#Security Mode +serverutils:security=Sicherheit +serverutils:security.public=Öffentlich +serverutils:security.private=Privat +serverutils:security.friends=Freunde +serverutils:security.group=Gruppe +serverutils:security.whitelist=Whitelist +serverutils:security.blacklist=Blacklist + +#Redstone Mode +serverutils:redstonemode=Redstone Modus +serverutils:redstonemode.disabled=Deaktviert +serverutils:redstonemode.high=Aktiv Hoch +serverutils:redstonemode.low=Aktiv Niedrig + +#Inventory Mode +serverutils:invmode=Automatisierung +serverutils:invmode.enabled=Aktiviert +serverutils:invmode.onlyin=Nur Insertion +serverutils:invmode.onlyout=Nur Extraktion +serverutils:invmode.disabled=Deaktviert + +#Chunktypes +serverutils:chunktype.unloaded=Chunk nicht geladen +serverutils:chunktype.spawn=Spawn Bereich +serverutils:chunktype.world_border=Welt Begrenzung +serverutils:chunktype.world_border.warning=Du hast die Welt Begrenzung erreicht! +serverutils:chunktype.wilderness=Wildnis +serverutils:chunktype.claimed=Beanspruchter Bereich +serverutils:chunktype.chunkloaded=Geladener Chunk diff --git a/src/main/resources/assets/serverutils/lang/en_US.lang b/src/main/resources/assets/serverutils/lang/en_US.lang new file mode 100644 index 00000000..6eaf9c53 --- /dev/null +++ b/src/main/resources/assets/serverutils/lang/en_US.lang @@ -0,0 +1,97 @@ +#Buttons +serverutils.label.friend=Friend +serverutils.label.pfriend=Pending Friend +serverutils.label.joined=Joined %s ago +serverutils.label.last_seen=Last seen %s ago +serverutils.label.deaths=Deaths: %s +serverutils.button.block_security=Block Security +serverutils.label.cchunks_count=Claimed Chunks: %s +serverutils.label.lchunks_count=Loaded Chunks: %s + +#ClientConfig +client_config.serverutils=Server Utilities +client_config.serverutils.render_badges=Show Badges +client_config.serverutils.sort_friends_az=Sort Friends A-Z +client_config.serverutils.loaded_chunks_space_key=Use Space key for Loaded Chunks + +client_config.serverutils_guide=Server Utilities: Guide +client_config.serverutils_guide.unicode=Use Unicode +client_config.serverutils_guide.text_color=Text Color +client_config.serverutils_guide.bg_color=Background Color +client_config.serverutils_guide.transparency=Transparency + +serverutils.player_setting.chat_links=Chat Links +serverutils.player_setting.render_badge=Show My Badge +serverutils.player_setting.explosions=Claimed Chunk Explosions +serverutils.player_setting.security_level=Claimed Chunk Security Level +serverutils.player_setting.fake_players=Claimed Chunk Fake Players + +#PlayerActions +player_action.serverutils.guide=Guide +player_action.serverutils.server_info=Server Info +player_action.serverutils.claimed_chunks=Claimed Chunks +player_action.serverutils.trade=Trade +player_action.serverutils.notes=Notes +player_action.serverutils.add_friend=Add as Friend +player_action.serverutils.rem_friend=Remove from Friends +player_action.serverutils.deny_friend=Deny Friend Request +player_action.serverutils.mail=Mail + +#Misc +serverutils.label.new_friends=New friend requests! +serverutils.label.new_friends_click=Click to accept all requests +serverutils.server_restart=Server will restart in %s +serverutils.commands=Commands +serverutils.my_permissions=My Permissions + +serverutils.cmd.warp_set=Warp '%s' set! +serverutils.cmd.warp_del=Warp '%s' deleted! +serverutils.cmd.warp_not_set=Unknown Warp: '%s'! +serverutils.cmd.warp_tp=Teleported to '%s'! +serverutils.cmd.warp_not_same_dim=You can't teleport to another dimension! + +serverutils.cmd.home_set=Home '%s' set! +serverutils.cmd.home_del=Home '%s' deleted! +serverutils.cmd.home_not_set=Unknown Home: '%s'! +serverutils.cmd.home_cross_dim=You can't teleport to another dimension! +serverutils.cmd.home_limit=You can't set any more home locations! + +serverutils.cmd.no_dp=You can only go back once! +serverutils.cmd.timer_backup=Next backup: %s +serverutils.cmd.timer_restart=Next restart: %s +serverutils.cmd.rules=[Click here to view the rules] +serverutils.cmd.spawn_tp=Teleported to spawn +serverutils.cmd.serveru_gamemode=Game mode: %s +serverutils.cmd.world_difficulty=Difficulty: %s + +serverutils.cmd.backup_start=Server Backup started! +serverutils.cmd.backup_stop=Server Backup stopped! +serverutils.cmd.backup_end_1=Server backup done in %s! +serverutils.cmd.backup_end_2=Server backup done in %s! (%s) +serverutils.cmd.backup_fail=Failed to save world! (%s) +serverutils.cmd.backup_manual_launch=%s launched a manual backup! +serverutils.cmd.backup_already_running=Backup in progress! +serverutils.cmd.backup_not_running=Backup is not running! +serverutils.cmd.backup_size=Current world size: %s, total backups folder size: %s + +serverutils.button.claims_unclaim_all=Unclaim all chunks +serverutils.button.claims_unclaim_all_dim=Unclaim all chunks in %s +serverutils.button.claims_unclaim_all_q=Unclaim all chunks? +serverutils.button.claims_unclaim_all_dim_q=Unclaim all chunks in %s? +serverutils.label.claims_invalid_dim=Can't claim chunks in this dimension + +serverutils.top.title=Server Tops +serverutils.top.first_joined=First Seen +serverutils.top.last_seen=Last Seen +serverutils.top.time_played=Time Played +serverutils.top.deaths=Deaths +serverutils.top.deaths_ph=Deaths per hour + +#Chunktypes +serverutils.chunktype.unloaded=Chunk not loaded +serverutils.chunktype.spawn=Spawn Area +serverutils.chunktype.world_border=World Border +serverutils.chunktype.world_border.warning=You have reached the world border! +serverutils.chunktype.wilderness=Wilderness +serverutils.chunktype.claimed=Claimed Area +serverutils.chunktype.chunkloaded=Chunkloaded diff --git a/src/main/resources/assets/serverutils/lang/fr_FR.lang b/src/main/resources/assets/serverutils/lang/fr_FR.lang new file mode 100644 index 00000000..8daf82a6 --- /dev/null +++ b/src/main/resources/assets/serverutils/lang/fr_FR.lang @@ -0,0 +1,125 @@ +#Buttons +serverutils:button.settings=Options +serverutils:button.back=Arrière +serverutils:button.up=Haut +serverutils:button.down=Bas +serverutils:button.prev=Précédent +serverutils:button.next=Suivant +serverutils:button.enabled=Activé +serverutils:button.disabled=Désactivé +serverutils:button.cancel=Annuler +serverutils:button.accept=Accepter +serverutils:button.remove=Supprimer +serverutils:button.add=Ajouter +serverutils:button.close=Fermer +serverutils:button.save=Enregistrer +serverutils:button.refresh=Raffraichir + +#FriendsGUI +serverutils:button.addFriend=Ajouter comme ami +serverutils:button.remFriend=Supprimer des amis +serverutils:button.deny_friend=Refuser la demande d'ami +serverutils:label.online=En ligne +serverutils:label.friend=Ami +serverutils:label.pfriend=Amis en attente +serverutils:label.joined=Rejoint %s +serverutils:label.last_seen=Dernier vu %s +serverutils:label.deaths=Morts: %s + +#ClientConfig +serverutils:client_config=Configuration du client +config.value.enabled=Activé +config.value.disabled=Désactivé +config.value.true=Vrai +config.value.false=Faux +config.value.left=Gauche +config.value.right=Droite +config.value.top=Haut +config.value.bottom=Bas +config.value.edit=Modifier +config.property.enabled=Actif + +config.group.serverutils=ServerUtilities +config.property.player_decorators=Décorateurs de joueurs +config.property.item_ore_names=Noms d'OreDict d'éléments +config.property.item_reg_names=Noms d'enregistrement d'éléments +config.property.debug_info=Info de déboggue +config.property.options_button=Bouton d'options +config.property.chat_links=Liens de tchat +config.property.chunk_messages=Messages de parcelles +config.value.cm_notify=Notification +config.value.cm_screen=Écran +config.value.cm_chat=Tchat + +#Misc +commands.lmmissingargs=Arguments manquants ! +commands.lmdisabled=Cette fonctionalité est désactivée ! +serverutils:owner=Propriétaire : %s +serverutils:deleteitem=Voulez-vous supprimer '%s' ? +serverutils:button.claimed_chunks=Parcelles bloquées +serverutils:button.mail=Courrier +serverutils:button.trade=Commerce +serverutils:button.notes=Notes + +#Security Mode +serverutils:security=Securité +serverutils:security.public=Public +serverutils:security.private=Privé +serverutils:security.friends=Amis +serverutils:security.group=Groupes +serverutils:security.whitelist=Liste blanche +serverutils:security.blacklist=Liste noire + +#Redstone Mode +serverutils:redstonemode=Mode Redstone +serverutils:redstonemode.disabled=Désactivé +serverutils:redstonemode.high=Très actif +serverutils:redstonemode.low=Peu actif + +#Inventory Mode +serverutils:invmode=Automatisation +serverutils:invmode.enabled=Activé +serverutils:invmode.onlyin=Insertion seule +serverutils:invmode.onlyout=Extraction seule +serverutils:invmode.disabled=Désactivé + +#Colors +serverutils:color.black=Noir +serverutils:color.red=Rouge +serverutils:color.green=Vert +serverutils:color.brown=Marron +serverutils:color.blue=Bleu +serverutils:color.purple=Violet +serverutils:color.cyan=Cyan +serverutils:color.silver=Gris clair +serverutils:color.gray=Gris +serverutils:color.pink=Rose +serverutils:color.lime=Vert clair +serverutils:color.yellow=Jaune +serverutils:color.light_blue=Bleu clair +serverutils:color.magenta=Magenta +serverutils:color.orange=Orange +serverutils:color.white=Blanc + +#Chunktypes +serverutils:chunktype.spawn=Zone d'apparition +serverutils:chunktype.world_border=Bordure du monde +serverutils:chunktype.world_border.warning=Vous avez atteint la bordure du monde ! +serverutils:chunktype.wilderness=Etendue sauvage +serverutils:chunktype.claimed=Zone revendiquée +serverutils:chunktype.unloaded=Parcelles non chargées + +#Sides +serverutils:side.down=Bas +serverutils:side.up=Haut +serverutils:side.north=Nord +serverutils:side.south=Sud +serverutils:side.west=Ouest +serverutils:side.east=Est + +serverutils:dside.bottom=Bas +serverutils:dside.top=Haut +serverutils:dside.back=Arrière +serverutils:dside.front=Avant +serverutils:dside.left=Gauche +serverutils:dside.right=Droite diff --git a/src/main/resources/assets/serverutils/lang/ru_RU.lang b/src/main/resources/assets/serverutils/lang/ru_RU.lang new file mode 100644 index 00000000..58172825 --- /dev/null +++ b/src/main/resources/assets/serverutils/lang/ru_RU.lang @@ -0,0 +1,95 @@ +#Buttons +serverutils.label.friend=Друг +serverutils.label.pfriend=Заявка отправлена +serverutils.label.joined=Присоединился %s назад +serverutils.label.last_seen=Был виден последний раз %s назад +serverutils.label.deaths=Смертей: %s +serverutils.button.block_security=Безопасность блока +serverutils.label.cchunks_count=Заприваченные чанки: %s +serverutils.label.lchunks_count=Загруженные чанки: %s + +#ClientConfig +client_config.serverutils=Server Utilities +client_config.serverutils.render_badges=Показывать значки +client_config.serverutils.sort_friends_az=Сортировать друзей A-Z +client_config.serverutils.loaded_chunks_space_key=Используйте Пробел для загруженных чанков + +client_config.serverutils_guide=Server Utilities: руководство +client_config.serverutils_guide.unicode=Использовать Unicode +client_config.serverutils_guide.text_color=Цвет текста +client_config.serverutils_guide.bg_color=Цвет фона +client_config.serverutils_guide.transparency=Прозрачность + +serverutils.player_setting.chat_links=Ссылки в чате +serverutils.player_setting.render_badge=Показывать мой значок +serverutils.player_setting.explosions=Взрывы в заприваченных чанках +serverutils.player_setting.security_level=Уровень безопасности в заприваченных чанках +serverutils.player_setting.fake_players=Разрешить действия Fake Player в заприваченных чанках + +#PlayerActions +player_action.serverutils.guide=Руководство +player_action.serverutils.server_info=Информация о сервере +player_action.serverutils.claimed_chunks=Заприваченные чанки +player_action.serverutils.trade=Обмен +player_action.serverutils.notes=Записки +player_action.serverutils.add_friend=Добавить друга +player_action.serverutils.rem_friend=Удалить из друзей +player_action.serverutils.deny_friend=Отклонить запрос +player_action.serverutils.mail=Почта + +#Misc +serverutils.label.new_friends=Новые заявки в друзья! +serverutils.label.new_friends_click=Принять все заявки в друзья +serverutils.server_restart=Сервер перезапустится через %s +serverutils.commands=Комманды +serverutils.my_permissions=Мои разрешения + +serverutils.cmd.warp_set=Варп '%s' установлен! +serverutils.cmd.warp_del=Варп '%s' удалён! +serverutils.cmd.warp_not_set=Неизвестный варп: '%s'! +serverutils.cmd.warp_tp=Телепортирован к '%s'! + +serverutils.cmd.home_set=Дом '%s' установлен! +serverutils.cmd.home_del=Дом '%s' удалён! +serverutils.cmd.home_not_set=Неизвестный дом: '%s'! +serverutils.cmd.home_cross_dim=Вы не можете телепортироваться между измерениями! +serverutils.cmd.home_limit=Вы не можете устанавливать больше домов! + +serverutils.cmd.no_dp=Вы можете вернуться только один раз! +serverutils.cmd.timer_backup=Следующий Backup: %s +serverutils.cmd.timer_restart=Следующий рестарт: %s +serverutils.cmd.spawn_tp=Телепортирован на спавн +serverutils.cmd.serveru_gamemode=Режим игры: %s +serverutils.cmd.world_difficulty=Сложность: %s + +serverutils.cmd.backup_start=Резервное копирование сервера началось! +serverutils.cmd.backup_stop=Резервное копирование сервера завершено! +serverutils.cmd.backup_end_1=Резервное копирование сервера заняло %s! +serverutils.cmd.backup_end_2=Резервное копирование сервера заняло %s! (%s) +serverutils.cmd.backup_fail=Не удалось сохранить мир! (%s) +serverutils.cmd.backup_manual_launch=%s запустил резервное копирование! +serverutils.cmd.backup_already_running=Резервное копирование уже проводится! +serverutils.cmd.backup_not_running=Резервное копирование не запущено! +serverutils.cmd.backup_size=Текущий размер мира: %s, общий размер резервных копий: %s + +serverutils.button.claims_unclaim_all=Расприватить все чанки +serverutils.button.claims_unclaim_all_dim=Расприватить все чанки в %s +serverutils.button.claims_unclaim_all_q=Расприватить все чанки? +serverutils.button.claims_unclaim_all_dim_q=Расприватить все чанки в %s? +serverutils.label.claims_invalid_dim=Приватить чанки в этом измерении запрещено + +serverutils.top.title=Топы сервера +serverutils.top.first_joined=Первый вход +serverutils.top.last_seen=Последний вход +serverutils.top.time_played=Общее время сыграно +serverutils.top.deaths=Смертей +serverutils.top.deaths_ph=Смертей в час + +#Chunktypes +serverutils.chunktype.unloaded=Чанк не загружен +serverutils.chunktype.spawn=Зона спавна +serverutils.chunktype.world_border=Граница мира +serverutils.chunktype.world_border.warning=Вы достигли границы мира! +serverutils.chunktype.wilderness=Дикая местность +serverutils.chunktype.claimed=Заприваченная зона +serverutils.chunktype.chunkloaded=Загруженная зона diff --git a/src/main/resources/assets/serverutils/lang/zh_CN.lang b/src/main/resources/assets/serverutils/lang/zh_CN.lang new file mode 100644 index 00000000..36ee1f97 --- /dev/null +++ b/src/main/resources/assets/serverutils/lang/zh_CN.lang @@ -0,0 +1,108 @@ +#Originally Traslated by xuyu_staryG(gxy17886) From InfinityStudio +#Edited by Cyrus-Vance from KoiRealm + +#Buttons +serverutils.label.friend=好友 +serverutils.label.pfriend=待定的好友 +serverutils.label.joined=%s前加入 +serverutils.label.last_seen=最后露面在%s前 +serverutils.label.deaths=死亡次数: %s +serverutils.button.explosions=爆炸 +serverutils.button.block_security=方块安全 +serverutils.label.cchunks_count=认领区块: %s +serverutils.label.lchunks_count=载入区块: %s + +#ClientConfig +client_config.serverutils=ServerUtilities +client_config.serverutils.render_badges=显示徽章 +client_config.serverutils.render_my_badge=展示我的徽章 +client_config.serverutils.options_button=选项按钮 +client_config.serverutils.chat_links=聊天链接 +client_config.serverutils.sort_friends_az=按A-Z首字母顺序分类好友 +client_config.serverutils.loaded_chunks_space_key=使用空格键加载区块 +client_config.serverutils.guide_unicode=在指南中使用Unicode编码 + +claims_config=认领区块配置 +claims_config.explosions=爆炸 +claims_config.security_level=方块安全等级 +claims_config.fake_players=允许假玩家 + +#PlayerActions +player_action.serverutils.guide=指南 +player_action.serverutils.server_info=服务器信息 +player_action.serverutils.claimed_chunks=认领区块 +player_action.serverutils.trade=交易 +player_action.serverutils.notes=注释 +player_action.serverutils.add_friend=加为好友 +player_action.serverutils.rem_friend=从好友中移除 +player_action.serverutils.deny_friend=拒绝好友的请求 +player_action.serverutils.mail=邮件 + +#Misc +serverutils.label.new_friends=一个新好友申请! +serverutils.label.new_friends_click=点击接受所有申请 +serverutils.server_restart=服务器将会在%s后重启 + +serverutils.cmd.warp_set=传送点'%s'已设置! +serverutils.cmd.warp_del=传送点'%s'已删除! +serverutils.cmd.warp_not_set=未知传送点: '%s'! +serverutils.cmd.warp_tp=传送到'%s'! +serverutils.cmd.warp_not_same_dim=你不能传送到另一个世界! + +serverutils.cmd.home_set=家'%s'已设置! +serverutils.cmd.home_del=家'%s'已删除! +serverutils.cmd.home_not_set=未知的家: '%s'! +serverutils.cmd.home_cross_dim=你不能回到另一个世界的家! +serverutils.cmd.home_limit=你不能设置更多家的位置! + +serverutils.cmd.no_dp=你只能回去一次! +serverutils.cmd.timer_backup=下一次备份: %s +serverutils.cmd.timer_restart=下一次重启: %s +serverutils.cmd.rules=[点击这里打开规则] +serverutils.cmd.spawn_tp=传送到出生点 + +serverutils.button.claims_unclaim_all=解除所有认领区块 +serverutils.button.claims_unclaim_all_dim=在%s解除所有认领区块 +serverutils.button.claims_unclaim_all_q=是否解除所有认领区块? +serverutils.button.claims_unclaim_all_dim_q=是否在%s解除所有认领区块? +serverutils.label.claims_invalid_dim=在这个维度不能解除认领区块 + +serverutils.top.title=服务器排名 +serverutils.top.first_joined=上线时间 +serverutils.top.last_seen=离线时间 +serverutils.top.time_played=游戏时间 +serverutils.top.deaths=死亡 +serverutils.top.deaths_ph=每小时死亡 + +#Chunktypes +serverutils.chunktype.unloaded=区块未载入 +serverutils.chunktype.spawn=出生区域 +serverutils.chunktype.world_border=世界边界 +serverutils.chunktype.world_border.warning=你已经到达了世界的边界! +serverutils.chunktype.wilderness=野外地区 +serverutils.chunktype.claimed=认领区域 +serverutils.chunktype.chunkloaded=区块加载 + +client_config.serverutils_guide=Server Utilities: 指南 +client_config.serverutils_guide.unicode=使用Unicode编码 +client_config.serverutils_guide.text_color=文本颜色 +client_config.serverutils_guide.bg_color=背景颜色 +client_config.serverutils_guide.transparency=透明度 +serverutils.player_setting.chat_links=聊天链接 +serverutils.player_setting.render_badge=显示徽章 +serverutils.player_setting.explosions=认领区块发生爆炸 +serverutils.player_setting.security_level=认领区块安全等级 +serverutils.player_setting.fake_players=认领区块允许假玩家 +serverutils.commands=命令 +serverutils.my_permissions=我的权限 +serverutils.cmd.serveru_gamemode=游戏模式: %s +serverutils.cmd.world_difficulty=难度: %s +serverutils.cmd.backup_start=服务器备份已开始! +serverutils.cmd.backup_stop=服务器备份已停止! +serverutils.cmd.backup_end_1=服务器备份完成,用时%s! +serverutils.cmd.backup_end_2=服务器备份完成,用时%s! (%s) +serverutils.cmd.backup_fail=保存世界存档时失败! (%s) +serverutils.cmd.backup_manual_launch=%s 执行了手动备份! +serverutils.cmd.backup_already_running=正在备份中…… +serverutils.cmd.backup_not_running=备份进程未运行! +serverutils.cmd.backup_size=当前世界大小: %s,备份文件夹总大小: %s diff --git a/src/main/resources/assets/ftbu/textures/failed_badge.png b/src/main/resources/assets/serverutils/textures/failed_badge.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/failed_badge.png rename to src/main/resources/assets/serverutils/textures/failed_badge.png diff --git a/src/main/resources/assets/ftbu/textures/gui/friendsbutton.png b/src/main/resources/assets/serverutils/textures/gui/friendsbutton.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/gui/friendsbutton.png rename to src/main/resources/assets/serverutils/textures/gui/friendsbutton.png diff --git a/src/main/resources/assets/ftbu/textures/gui/guide.png b/src/main/resources/assets/serverutils/textures/gui/guide.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/gui/guide.png rename to src/main/resources/assets/serverutils/textures/gui/guide.png diff --git a/src/main/resources/assets/ftbu/textures/logo.png b/src/main/resources/assets/serverutils/textures/logo.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/logo.png rename to src/main/resources/assets/serverutils/textures/logo.png diff --git a/src/main/resources/assets/ftbu/textures/map/entity.png b/src/main/resources/assets/serverutils/textures/map/entity.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/map/entity.png rename to src/main/resources/assets/serverutils/textures/map/entity.png diff --git a/src/main/resources/assets/ftbu/textures/map/entity.png.mcmeta b/src/main/resources/assets/serverutils/textures/map/entity.png.mcmeta similarity index 100% rename from src/main/resources/assets/ftbu/textures/map/entity.png.mcmeta rename to src/main/resources/assets/serverutils/textures/map/entity.png.mcmeta diff --git a/src/main/resources/assets/ftbu/textures/map/marker.png b/src/main/resources/assets/serverutils/textures/map/marker.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/map/marker.png rename to src/main/resources/assets/serverutils/textures/map/marker.png diff --git a/src/main/resources/assets/ftbu/textures/map/minimap_area.png b/src/main/resources/assets/serverutils/textures/map/minimap_area.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/map/minimap_area.png rename to src/main/resources/assets/serverutils/textures/map/minimap_area.png diff --git a/src/main/resources/assets/ftbu/textures/map/world_border.png b/src/main/resources/assets/serverutils/textures/map/world_border.png similarity index 100% rename from src/main/resources/assets/ftbu/textures/map/world_border.png rename to src/main/resources/assets/serverutils/textures/map/world_border.png diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 22dc7777..32a6a1eb 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,19 +2,21 @@ "modListVersion": 2, "modList": [ { - "modid": "FTBL", - "name": "FTBLib", - "description": "The libraries for FTB mods", + "modid": "ServerUtilitiesLibrary", + "name": "ServerUtilitiesLibrary", + "description": "The libraries for ServerUtilities", "version": "${modVersion}", "mcversion": "${minecraftVersion}", "url": "https://feed-the-beast.com", "updateUrl": "", "authorList": [ "LatvianModder", - "Jared" + "Jared", + "mitchej123", + "GTNH Team" ], "credits": "GTNH", - "logoFile": "assets/ftbl/textures/logo.png", + "logoFile": "assets/serverlib/textures/logo.png", "screenshots": [], "parent": "", "requiredMods": [ @@ -31,25 +33,27 @@ "useDependencyInformation": true }, { - "modid": "FTBU", - "name": "FTBUtilities", - "description": "FTB Utilities - GTNH", + "modid": "ServerUtilities", + "name": "ServerUtilities", + "description": "Server Utilities", "version": "${modVersion}", "mcversion": "${minecraftVersion}", "url": "https://feed-the-beast.com", "updateUrl": "", "authorList": [ - "LatvianModder" + "LatvianModder", + "mitchej123", + "GTNH Team" ], "credits": "GTNH", - "logoFile": "assets/ftbu/textures/logo.png", + "logoFile": "assets/serverutils/textures/logo.png", "screenshots": [], "parent": "", "requiredMods": [ - "FTBL" + "ServerUtilitiesLibrary" ], "dependencies": [ - "FTBL", + "ServerUtilitiesLibrary", "Baubles", "Waila" ],