Removed Localization Stuff.

Added Logging Option.
Logging of Exceptions is now done via AELogger
This commit is contained in:
AlgorithmX2
2014-02-07 14:37:22 -06:00
parent e18dac1437
commit b57804be06
49 changed files with 212 additions and 195 deletions
+10 -12
View File
@@ -1,8 +1,8 @@
package appeng.core;
import java.io.File;
import java.util.logging.Level;
import appeng.core.features.AEFeature;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.FMLRelaunchLog;
@@ -10,14 +10,16 @@ public class AELog
{
public static cpw.mods.fml.relauncher.FMLRelaunchLog instance = cpw.mods.fml.relauncher.FMLRelaunchLog.log;
public static net.minecraftforge.common.Configuration localizeation = new net.minecraftforge.common.Configuration( new File( "en_us.lang" ) );
private AELog() {
}
private static void log(Level level, String format, Object... data)
{
FMLRelaunchLog.log( "AE2:" + (Platform.isServer() ? "S" : "C"), level, format, data );
if ( Configuration.instance.isFeatureEnabled( AEFeature.Logging ) )
{
FMLRelaunchLog.log( "AE2:" + (Platform.isServer() ? "S" : "C"), level, format, data );
}
}
public static void severe(String format, Object... data)
@@ -40,16 +42,12 @@ public class AELog
log( Level.FINEST, "grinder: " + o );
}
public static void localization(String category, String unlocalizedName)
{
localizeation.get( category, unlocalizedName, unlocalizedName );
localizeation.save();
}
public static void error(Throwable e)
{
log( Level.SEVERE, "Error Occurred" );
e.printStackTrace();
if ( Configuration.instance.isFeatureEnabled( AEFeature.Logging ) )
{
severe( "Error: " + e.getMessage() );
e.printStackTrace();
}
}
}
-3
View File
@@ -5,7 +5,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
import appeng.api.util.AEItemDefinition;
import appeng.util.Platform;
public final class CreativeTab extends CreativeTabs
{
@@ -14,8 +13,6 @@ public final class CreativeTab extends CreativeTabs
public CreativeTab() {
super( "appliedenergistics2" );
if ( Platform.isClient() )
AELog.localization( "gui", "itemGroup." + getTabLabel() );
}
@Override
-3
View File
@@ -4,7 +4,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
import appeng.items.parts.ItemFacade;
import appeng.util.Platform;
public final class CreativeTabFacade extends CreativeTabs
{
@@ -13,8 +12,6 @@ public final class CreativeTabFacade extends CreativeTabs
public CreativeTabFacade() {
super( "appliedenergistics2.facades" );
if ( Platform.isClient() )
AELog.localization( "gui", "itemGroup." + getTabLabel() );
}
@Override
+11 -6
View File
@@ -228,13 +228,17 @@ public class Registration
blocks.blockWireless = addFeature( BlockWireless.class );
blocks.blockTinyTNT = addFeature( BlockTinyTNT.class );
// blocks.blockQuartzCrystalizer = addFeature( BlockQuartzCrystalizer.class );
// blocks.blockQuartzCrystalizer = addFeature(
// BlockQuartzCrystalizer.class );
// blocks.blockNetworkEmitter = addFeature( BlockNetworkEmitter.class );
// blocks.blockPatternProvider = addFeature( BlockPatternProvider.class );
// blocks.blockAssemblerFieldWall = addFeature( BlockContainmentWall.class );
// blocks.blockPatternProvider = addFeature( BlockPatternProvider.class
// );
// blocks.blockAssemblerFieldWall = addFeature(
// BlockContainmentWall.class );
// blocks.blockHeatVent = addFeature( BlockHeatVent.class );
// blocks.blockCraftingCPU = addFeature( BlockCraftingAccelerator.class );
// blocks.blockCraftingCPU = addFeature( BlockCraftingAccelerator.class
// );
blocks.blockQuantumRing = addFeature( BlockQuantumRing.class );
blocks.blockQuantumLink = addFeature( BlockQuantumLinkChamber.class );
@@ -258,7 +262,8 @@ public class Registration
blocks.blockSecurity = addFeature( BlockSecurity.class );
// items.itemEncodedAsemblerPattern = addFeature( ItemEncodedPattern.class );
// items.itemEncodedAsemblerPattern = addFeature(
// ItemEncodedPattern.class );
items.itemCellCreative = addFeature( ItemCreativeStorageCell.class );
@@ -387,7 +392,7 @@ public class Registration
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
}
}
+5 -5
View File
@@ -86,7 +86,7 @@ public class ApiPart implements IPartHelper
}
catch (Exception e)
{
e.printStackTrace();
AELog.error( e );
System.exit( 1 );
}
return clazz;
@@ -110,7 +110,7 @@ public class ApiPart implements IPartHelper
}
catch (Throwable e)
{
e.printStackTrace();
AELog.error( e );
}
return null;
@@ -160,7 +160,7 @@ public class ApiPart implements IPartHelper
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
AELog.error( e );
}
Class myCLass;
@@ -232,7 +232,7 @@ public class ApiPart implements IPartHelper
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
for (MethodNode mn : n.methods)
@@ -298,7 +298,7 @@ public class ApiPart implements IPartHelper
catch (Throwable t)
{
AELog.severe( "Layer: " + n.name + " Failed." );
t.printStackTrace();
AELog.error( t );
}
roots.put( fullPath, nclass );
+3 -3
View File
@@ -39,12 +39,12 @@ public enum AEFeature
DenseEnergyCells("HigherCapacity"), DenseCables("HigherCapacity"),
P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids(
"P2PTunnels"), Security("Security"),
P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids("P2PTunnels"), Security(
"Security"),
MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"),
DuplicateItems("Misc", false), Profiler("Services"), VersionChecker("Services"), Debug("Misc", false), Creative("Misc");
DuplicateItems("Misc", false), Profiler("Services"), VersionChecker("Services"), Debug("Misc", false), Creative("Misc"), Logging("Misc");
String Category;
boolean visible = true;
-3
View File
@@ -9,7 +9,6 @@ import net.minecraft.tileentity.TileEntity;
import appeng.api.util.AEItemDefinition;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.core.AELog;
import appeng.core.CommonHelper;
import appeng.core.Configuration;
import appeng.core.CreativeTab;
@@ -84,7 +83,6 @@ public class AEFeatureHandler implements AEItemDefinition
i.setCreativeTab( CreativeTab.instance );
GameRegistry.registerItem( i, "item." + name );
AELog.localization( "item", i.getUnlocalizedName() );
}
private void initBlock(Block b)
@@ -108,7 +106,6 @@ public class AEFeatureHandler implements AEItemDefinition
itemBlock = ((AEBaseBlock) b).getItemBlockClass();
GameRegistry.registerBlock( b, itemBlock, "tile." + name );
AELog.localization( "block", b.getUnlocalizedName() );
}
public EnumSet<AEFeature> getFeatures()
-2
View File
@@ -5,7 +5,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.util.AEItemDefinition;
import appeng.core.AELog;
public class DamagedItemDefinition implements AEItemDefinition
{
@@ -23,7 +22,6 @@ public class DamagedItemDefinition implements AEItemDefinition
{
baseItem = is.getItem();
damage = is.getItemDamage();
AELog.localization( "item", is.getUnlocalizedName() );
}
}
-2
View File
@@ -1,7 +1,6 @@
package appeng.core.localization;
import net.minecraft.util.StatCollector;
import appeng.core.AELog;
public enum ButtonToolTips
{
@@ -37,7 +36,6 @@ public enum ButtonToolTips
ButtonToolTips() {
root = "gui.tooltips.appliedenergistics2";
AELog.localization( "gui.tooltips", getUnlocalized() );
}
ButtonToolTips(String r) {
-2
View File
@@ -1,7 +1,6 @@
package appeng.core.localization;
import net.minecraft.util.StatCollector;
import appeng.core.AELog;
public enum GuiText
{
@@ -31,7 +30,6 @@ public enum GuiText
GuiText() {
root = "gui.appliedenergistics2";
AELog.localization( "gui", getUnlocalized() );
}
GuiText(String r) {
-5
View File
@@ -1,7 +1,6 @@
package appeng.core.localization;
import net.minecraft.util.ChatMessageComponent;
import appeng.core.AELog;
public enum PlayerMessages
{
@@ -9,10 +8,6 @@ public enum PlayerMessages
isNowLocked, isNowUnlocked, AmmoDepleted, CommunicationError, OutOfRange, DeviceNotPowered;
private PlayerMessages() {
AELog.localization( "chat", getName() );
}
String getName()
{
return "chat.appliedenergistics2." + toString();
+6 -5
View File
@@ -8,6 +8,7 @@ import java.lang.reflect.InvocationTargetException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import appeng.core.AELog;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
@@ -29,23 +30,23 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (InstantiationException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (IllegalAccessException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (InvocationTargetException e)
{
e.printStackTrace();
AELog.error( e );
}
}
+6 -5
View File
@@ -8,6 +8,7 @@ import java.lang.reflect.InvocationTargetException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import appeng.core.AELog;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
@@ -29,23 +30,23 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (InstantiationException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (IllegalAccessException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
AELog.error( e );
}
catch (InvocationTargetException e)
{
e.printStackTrace();
AELog.error( e );
}
}