Minor language adjustments

This commit is contained in:
Marcel Konrad
2018-06-28 02:12:40 +02:00
parent 42ef784a4f
commit a38bff54be

View File

@@ -1,171 +1,171 @@
package exopandora.worldhandler; package exopandora.worldhandler;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import exopandora.worldhandler.builder.ICommandBuilder; import exopandora.worldhandler.builder.ICommandBuilder;
import exopandora.worldhandler.builder.ICommandBuilderSyntax; import exopandora.worldhandler.builder.ICommandBuilderSyntax;
import exopandora.worldhandler.command.CommandWH; import exopandora.worldhandler.command.CommandWH;
import exopandora.worldhandler.command.CommandWorldHandler; import exopandora.worldhandler.command.CommandWorldHandler;
import exopandora.worldhandler.config.ConfigButcher; import exopandora.worldhandler.config.ConfigButcher;
import exopandora.worldhandler.config.ConfigSettings; import exopandora.worldhandler.config.ConfigSettings;
import exopandora.worldhandler.config.ConfigSkin; import exopandora.worldhandler.config.ConfigSkin;
import exopandora.worldhandler.config.ConfigSliders; import exopandora.worldhandler.config.ConfigSliders;
import exopandora.worldhandler.event.EventListener; import exopandora.worldhandler.event.EventListener;
import exopandora.worldhandler.gui.category.Category; import exopandora.worldhandler.gui.category.Category;
import exopandora.worldhandler.gui.content.Content; import exopandora.worldhandler.gui.content.Content;
import exopandora.worldhandler.helper.BlockHelper; import exopandora.worldhandler.helper.BlockHelper;
import exopandora.worldhandler.proxy.CommonProxy; import exopandora.worldhandler.proxy.CommonProxy;
import exopandora.worldhandler.util.UtilKeyBinding; import exopandora.worldhandler.util.UtilKeyBinding;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import net.minecraft.command.ICommand; import net.minecraft.command.ICommand;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.ProgressManager; import net.minecraftforge.fml.common.ProgressManager;
import net.minecraftforge.fml.common.ProgressManager.ProgressBar; import net.minecraftforge.fml.common.ProgressManager.ProgressBar;
import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent; import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent;
import net.minecraftforge.fml.common.event.FMLModDisabledEvent; import net.minecraftforge.fml.common.event.FMLModDisabledEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[$compatible,)", version = "$version", canBeDeactivated = true, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = "$update_url", clientSideOnly = true, certificateFingerprint = "$certificate") @Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[$compatible,)", version = "$version", canBeDeactivated = true, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = "$update_url", clientSideOnly = true, certificateFingerprint = "$certificate")
public class WorldHandler public class WorldHandler
{ {
@Instance(Main.MODID) @Instance(Main.MODID)
private static WorldHandler INSTANCE; private static WorldHandler INSTANCE;
public static KeyBinding KEY_WORLD_HANDLER = new KeyBinding(Main.NAME, Keyboard.KEY_V, "key.categories.misc"); public static KeyBinding KEY_WORLD_HANDLER = new KeyBinding(Main.NAME, Keyboard.KEY_V, "key.categories.misc");
public static KeyBinding KEY_WORLD_HANDLER_POS1 = new KeyBinding(Main.NAME + " Pos1", Keyboard.KEY_O, "key.categories.misc"); public static KeyBinding KEY_WORLD_HANDLER_POS1 = new KeyBinding(Main.NAME + " Pos1", Keyboard.KEY_O, "key.categories.misc");
public static KeyBinding KEY_WORLD_HANDLER_POS2 = new KeyBinding(Main.NAME + " Pos2", Keyboard.KEY_P, "key.categories.misc"); public static KeyBinding KEY_WORLD_HANDLER_POS2 = new KeyBinding(Main.NAME + " Pos2", Keyboard.KEY_P, "key.categories.misc");
public static final ICommand COMMAND_WORLD_HANDLER = new CommandWorldHandler(); public static final ICommand COMMAND_WORLD_HANDLER = new CommandWorldHandler();
public static final ICommand COMMAND_WH = new CommandWH(); public static final ICommand COMMAND_WH = new CommandWH();
public static Configuration CONFIG; public static Configuration CONFIG;
public static Logger LOGGER; public static Logger LOGGER;
public static String USERNAME = null; public static String USERNAME = null;
@SidedProxy(clientSide = "exopandora.worldhandler.proxy.ClientProxy", serverSide = "exopandora.worldhandler.proxy.CommonProxy") @SidedProxy(clientSide = "exopandora.worldhandler.proxy.ClientProxy", serverSide = "exopandora.worldhandler.proxy.CommonProxy")
private static CommonProxy PROXY; private static CommonProxy PROXY;
private EventListener eventListener = new EventListener(); private EventListener eventListener = new EventListener();
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
LOGGER = event.getModLog(); LOGGER = event.getModLog();
LOGGER.info("Pre-Initialisation"); LOGGER.info("Pre-Initialization");
LOGGER.info("First Release on March 28 2013 - 02:29 PM CET by Exopandora"); LOGGER.info("First Release on March 28 2013 - 02:29 PM CET by Exopandora");
LOGGER.info("Latest Version: $url"); LOGGER.info("Latest Version: $url");
CONFIG = new Configuration(event.getSuggestedConfigurationFile()); CONFIG = new Configuration(event.getSuggestedConfigurationFile());
} }
@EventHandler @EventHandler
public void init(FMLInitializationEvent event) public void init(FMLInitializationEvent event)
{ {
LOGGER.info("Initialisation"); LOGGER.info("Initialization");
USERNAME = Minecraft.getMinecraft().getSession().getUsername(); USERNAME = Minecraft.getMinecraft().getSession().getUsername();
MinecraftForge.EVENT_BUS.register(this.eventListener); MinecraftForge.EVENT_BUS.register(this.eventListener);
ClientRegistry.registerKeyBinding(KEY_WORLD_HANDLER); ClientRegistry.registerKeyBinding(KEY_WORLD_HANDLER);
UtilKeyBinding.updatePosKeys(); UtilKeyBinding.updatePosKeys();
} }
@EventHandler @EventHandler
public void postInit(FMLPostInitializationEvent event) public void postInit(FMLPostInitializationEvent event)
{ {
LOGGER.info("Post-Initialisation"); LOGGER.info("Post-Initialization");
} }
@EventHandler @EventHandler
public void loadComplete(FMLLoadCompleteEvent event) public void loadComplete(FMLLoadCompleteEvent event)
{ {
LOGGER.info("Load-Complete"); LOGGER.info("Load-Complete");
ProgressBar bar = ProgressManager.push(Main.NAME, 2); ProgressBar bar = ProgressManager.push(Main.NAME, 2);
bar.step("Loading Configuration Files"); bar.step("Loading Configuration Files");
ConfigSettings.load(CONFIG); ConfigSettings.load(CONFIG);
ConfigSkin.load(CONFIG); ConfigSkin.load(CONFIG);
ConfigSliders.load(CONFIG); ConfigSliders.load(CONFIG);
ConfigButcher.load(CONFIG); ConfigButcher.load(CONFIG);
bar.step("Initializing User Interface"); bar.step("Initializing User Interface");
Content.registerContents(); Content.registerContents();
Category.registerCategories(); Category.registerCategories();
ProgressManager.pop(bar); ProgressManager.pop(bar);
} }
@EventHandler @EventHandler
public void serverLoad(FMLServerStartingEvent event) public void serverLoad(FMLServerStartingEvent event)
{ {
event.registerServerCommand(COMMAND_WORLD_HANDLER); event.registerServerCommand(COMMAND_WORLD_HANDLER);
event.registerServerCommand(COMMAND_WH); event.registerServerCommand(COMMAND_WH);
} }
@EventHandler @EventHandler
public void disable(FMLModDisabledEvent event) public void disable(FMLModDisabledEvent event)
{ {
MinecraftForge.EVENT_BUS.register(this.eventListener); MinecraftForge.EVENT_BUS.register(this.eventListener);
Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.removeElement(Minecraft.getMinecraft().gameSettings.keyBindings, KEY_WORLD_HANDLER); Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.removeElement(Minecraft.getMinecraft().gameSettings.keyBindings, KEY_WORLD_HANDLER);
if(UtilKeyBinding.arePosKeysRegistered() && ConfigSettings.arePosShortcutsEnabled()) if(UtilKeyBinding.arePosKeysRegistered() && ConfigSettings.arePosShortcutsEnabled())
{ {
UtilKeyBinding.removePosKeys(); UtilKeyBinding.removePosKeys();
} }
} }
public static void updateConfig() public static void updateConfig()
{ {
ConfigSettings.load(CONFIG); ConfigSettings.load(CONFIG);
ConfigSkin.load(CONFIG); ConfigSkin.load(CONFIG);
ConfigButcher.load(CONFIG); ConfigButcher.load(CONFIG);
ConfigSliders.load(CONFIG); ConfigSliders.load(CONFIG);
UtilKeyBinding.updatePosKeys(); UtilKeyBinding.updatePosKeys();
} }
public static void sendCommand(ICommandBuilder builder) public static void sendCommand(ICommandBuilder builder)
{ {
sendCommand(builder, false); sendCommand(builder, false);
} }
public static void sendCommand(ICommandBuilder builder, boolean special) public static void sendCommand(ICommandBuilder builder, boolean special)
{ {
if(builder != null) if(builder != null)
{ {
String command; String command;
if(builder instanceof ICommandBuilderSyntax) if(builder instanceof ICommandBuilderSyntax)
{ {
command = ((ICommandBuilderSyntax) builder).toActualCommand(); command = ((ICommandBuilderSyntax) builder).toActualCommand();
} }
else else
{ {
command = builder.toCommand(); command = builder.toCommand();
} }
LOGGER.info("Command: " + command); LOGGER.info("Command: " + command);
if(builder.needsCommandBlock() || special) if(builder.needsCommandBlock() || special)
{ {
BlockHelper.setCommandBlockNearPlayer(command); BlockHelper.setCommandBlockNearPlayer(command);
} }
else else
{ {
Minecraft.getMinecraft().player.sendChatMessage(command); Minecraft.getMinecraft().player.sendChatMessage(command);
} }
} }
} }
} }