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

2
api

@ -1 +1 @@
Subproject commit 162903d5dfa2817adda93e8bfb7f5a0dfa408a83
Subproject commit bba4f69b30c0b2ed7837a333d5b1802c35da5f79

View file

@ -119,7 +119,7 @@ public abstract class AEBaseGui extends GuiContainer
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -148,7 +148,7 @@ public abstract class AEBaseGui extends GuiContainer
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -198,7 +198,7 @@ public abstract class AEBaseGui extends GuiContainer
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -522,10 +522,10 @@ public abstract class AEBaseGui extends GuiContainer
tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() );
tessellator.addVertexWithUV( (double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f),
(double) ((float) (par4 + par6) * f1) );
tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel,
(double) ((float) (par3 + par5) * f), (double) ((float) (par4 + par6) * f1) );
tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel,
(double) ((float) (par3 + par5) * f), (double) ((float) (par4 + 0) * f1) );
tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + par5) * f),
(double) ((float) (par4 + par6) * f1) );
tessellator.addVertexWithUV( (double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + par5) * f),
(double) ((float) (par4 + 0) * f1) );
tessellator.addVertexWithUV( (double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * f),
(double) ((float) (par4 + 0) * f1) );
tessellator.setColorRGBA_F( 1.0f, 1.0f, 1.0f, 1.0f );
@ -554,7 +554,7 @@ public abstract class AEBaseGui extends GuiContainer
}
catch (Exception err)
{
err.printStackTrace();
AELog.error( err );
}
}
((AppEngSlot) s).isValid = isValid ? hasCalculatedValidness.Valid : hasCalculatedValidness.Invalid;

View file

@ -7,6 +7,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerChest;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.packets.PacketSwitchGuis;
@ -31,7 +32,7 @@ public class GuiChest extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -13,6 +13,7 @@ import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiProgressBar;
import appeng.client.gui.widgets.GuiProgressBar.Direction;
import appeng.container.implementations.ContainerCondenser;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.tile.misc.TileCondenser;
@ -46,7 +47,7 @@ public class GuiCondenser extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -7,6 +7,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerDrive;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.packets.PacketSwitchGuis;
@ -31,7 +32,7 @@ public class GuiDrive extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -14,6 +14,7 @@ import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.container.implementations.ContainerIOPort;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.tile.storage.TileIOPort;
@ -83,7 +84,7 @@ public class GuiIOPort extends GuiUpgradeable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

View file

@ -11,6 +11,7 @@ import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.container.implementations.ContainerLevelEmitter;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.parts.automation.PartLevelEmitter;
@ -115,7 +116,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -152,7 +153,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
else

View file

@ -11,6 +11,7 @@ import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.AEBaseContainer;
import appeng.container.implementations.ContainerPriority;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.packets.PacketSwitchGuis;
@ -97,7 +98,7 @@ public class GuiPriority extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -147,7 +148,7 @@ public class GuiPriority extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -156,8 +157,7 @@ public class GuiPriority extends AEBaseGui
{
if ( !this.checkHotbarKeys( key ) )
{
if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character ))
&& priority.textboxKeyTyped( character, key ) )
if ( (key == 211 || key == 205 || key == 203 || key == 14 || character == '-' || Character.isDigit( character )) && priority.textboxKeyTyped( character, key ) )
{
try
{
@ -180,7 +180,7 @@ public class GuiPriority extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
else

View file

@ -8,6 +8,7 @@ import appeng.api.config.SortOrder;
import appeng.api.storage.IStorageMonitorable;
import appeng.client.gui.widgets.GuiToggleButton;
import appeng.container.implementations.ContainerSecurity;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.packets.PacketValueConfig;
import cpw.mods.fml.common.network.PacketDispatcher;
@ -30,11 +31,11 @@ public class GuiSecurity extends GuiMEMonitorable
super.initGui();
int top = this.guiTop + this.ySize - 116;
buttonList.add( inject = new GuiToggleButton( this.guiLeft + 56 + 18 * 0, top, 11 * 16 + 0, 12 * 16 + 0, SecurityPermissions.INJECT
.getUnlocalizedName(), SecurityPermissions.INJECT.getUnlocalizedTip() ) );
buttonList.add( inject = new GuiToggleButton( this.guiLeft + 56 + 18 * 0, top, 11 * 16 + 0, 12 * 16 + 0, SecurityPermissions.INJECT.getUnlocalizedName(),
SecurityPermissions.INJECT.getUnlocalizedTip() ) );
buttonList.add( extract = new GuiToggleButton( this.guiLeft + 56 + 18 * 1, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT
.getUnlocalizedName(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) );
buttonList.add( extract = new GuiToggleButton( this.guiLeft + 56 + 18 * 1, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT.getUnlocalizedName(),
SecurityPermissions.EXTRACT.getUnlocalizedTip() ) );
buttonList.add( craft = new GuiToggleButton( this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2, SecurityPermissions.CRAFT.getUnlocalizedName(),
SecurityPermissions.CRAFT.getUnlocalizedTip() ) );
@ -42,8 +43,8 @@ public class GuiSecurity extends GuiMEMonitorable
buttonList.add( build = new GuiToggleButton( this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3, SecurityPermissions.BUILD.getUnlocalizedName(),
SecurityPermissions.BUILD.getUnlocalizedTip() ) );
buttonList.add( security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY
.getUnlocalizedName(), SecurityPermissions.SECURITY.getUnlocalizedTip() ) );
buttonList.add( security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY.getUnlocalizedName(),
SecurityPermissions.SECURITY.getUnlocalizedTip() ) );
}
protected void actionPerformed(net.minecraft.client.gui.GuiButton btn)
@ -71,7 +72,7 @@ public class GuiSecurity extends GuiMEMonitorable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

View file

@ -13,6 +13,7 @@ import appeng.api.config.Settings;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerStorageBus;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.packets.PacketConfigButton;
@ -77,7 +78,7 @@ public class GuiStorageBus extends GuiUpgradeable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
try
@ -90,7 +91,7 @@ public class GuiStorageBus extends GuiUpgradeable
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

View file

@ -15,6 +15,7 @@ import appeng.api.implementations.IUpgradeableHost;
import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.container.implementations.ContainerUpgradeable;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.parts.automation.PartImportBus;
@ -76,7 +77,7 @@ public class GuiUpgradeable extends AEBaseGui
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

View file

@ -8,6 +8,7 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import appeng.core.AELog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -161,7 +162,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
// meh
}
return false;

View file

@ -9,8 +9,8 @@ import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import appeng.block.AEBaseBlock;
import appeng.core.AELog;
import appeng.tile.AEBaseTile;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -61,9 +61,9 @@ public class TESRWrapper extends TileEntitySpecialRenderer
}
catch (Throwable t)
{
FMLLog.severe( "Hi, Looks like there was a crash while rendering something..." );
AELog.severe( "Hi, Looks like there was a crash while rendering something..." );
t.printStackTrace();
FMLLog.severe( "MC will now crash ( probobly )!" );
AELog.severe( "MC will now crash ( probobly )!" );
throw new RuntimeException( t );
}

View file

@ -19,6 +19,7 @@ import appeng.block.AEBaseBlock;
import appeng.block.misc.BlockCharger;
import appeng.client.render.BaseBlockRender;
import appeng.client.texture.ExtraTextures;
import appeng.core.AELog;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
@ -146,7 +147,7 @@ public class RenderBlockCharger extends BaseBlockRender
}
catch (Exception err)
{
err.printStackTrace();
AELog.error( err );
}
GL11.glPopMatrix();

View file

@ -15,6 +15,7 @@ import appeng.api.implementations.parts.IPartStorageMonitor;
import appeng.api.storage.data.IAEItemStack;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.core.AELog;
import appeng.tile.AEBaseTile;
public class RenderStorageMonitor extends BaseBlockRender
@ -25,8 +26,7 @@ public class RenderStorageMonitor extends BaseBlockRender
}
@Override
public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f,
RenderBlocks rinstance)
public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks rinstance)
{
IPartStorageMonitor monitor = (IPartStorageMonitor) tile;
IAEItemStack is = ((IAEItemStack) monitor.getDisplayed());
@ -50,8 +50,7 @@ public class RenderStorageMonitor extends BaseBlockRender
int k = sis.itemID;
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
if ( sis.getItemSpriteNumber() == 0 && block != null
&& RenderBlocks.renderItemIn3d( Block.blocksList[k].getRenderType() ) )
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( Block.blocksList[k].getRenderType() ) )
{
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
@ -72,7 +71,7 @@ public class RenderStorageMonitor extends BaseBlockRender
}
catch (Exception err)
{
err.printStackTrace();
AELog.error( err );
}
GL11.glPopMatrix();

View file

@ -23,6 +23,7 @@ import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.AEBaseContainer;
import appeng.core.AELog;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.util.Platform;
import appeng.util.item.ItemList;
@ -115,7 +116,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IMEMonito
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -156,7 +157,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IMEMonito
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

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();
}
}
}

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

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

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 );
}
}
}

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 );

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;

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()

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() );
}
}

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) {

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) {

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();

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 );
}
}

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 );
}
}

View file

@ -20,6 +20,7 @@ import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.RenderBlocksWorkaround;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.integration.abstraction.IBC;
import cpw.mods.fml.relauncher.Side;
@ -76,8 +77,7 @@ public class FacadePart implements IFacadePart
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds,
boolean renderStilt)
public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt)
{
if ( facade != null )
{
@ -244,7 +244,7 @@ public class FacadePart implements IFacadePart
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
@ -253,8 +253,8 @@ public class FacadePart implements IFacadePart
}
@SideOnly(Side.CLIENT)
private void renderSegmentBlockCurrentBounds(BusRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ,
double maxX, double maxY, double maxZ)
private void renderSegmentBlockCurrentBounds(BusRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ, double maxX,
double maxY, double maxZ)
{
double oldMinX = renderer.renderMinX;
double oldMinY = renderer.renderMinY;

View file

@ -32,6 +32,7 @@ import appeng.api.parts.SelectedPart;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import appeng.core.AELog;
import appeng.helpers.AEMultiTile;
import appeng.parts.BusCollisionHelper;
import appeng.parts.CableBusContainer;
@ -115,7 +116,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
@ -134,7 +135,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}

View file

@ -15,6 +15,7 @@ import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import appeng.block.AEBaseItemBlock;
import appeng.core.AELog;
import appeng.core.sync.packets.PacketMultiPart;
import appeng.integration.modules.helpers.FMPPacketEvent;
import codechicken.lib.packet.PacketCustom;
@ -121,7 +122,7 @@ public class FMPEvent
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
return true;

View file

@ -24,6 +24,7 @@ import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartItem;
import appeng.api.parts.PartItemStack;
import appeng.api.parts.SelectedPart;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.sync.packets.PacketPartPlacement;
import appeng.facade.IFacadeItem;
@ -120,7 +121,7 @@ public class PartPlacement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
return true;
@ -171,7 +172,7 @@ public class PartPlacement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
}
@ -204,7 +205,7 @@ public class PartPlacement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
return true;
@ -267,7 +268,7 @@ public class PartPlacement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
return true;
}
@ -296,8 +297,8 @@ public class PartPlacement
host = ((IFMP) AppEng.instance.getIntegration( "FMP" )).getOrCreateHost( tile );
if ( (blkID == 0 || Block.blocksList[blkID].isBlockReplaceable( world, te_x, te_y, te_z ) || host != null) && offset != ForgeDirection.UNKNOWN )
return place( held, te_x, te_y, te_z, side.getOpposite().ordinal(), player, world,
pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS : PlaceType.PLACE_ITEM, depth + 1 );
return place( held, te_x, te_y, te_z, side.getOpposite().ordinal(), player, world, pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS
: PlaceType.PLACE_ITEM, depth + 1 );
}
return false;
}
@ -330,7 +331,7 @@ public class PartPlacement
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
}
return true;

View file

@ -8,6 +8,7 @@ import java.util.concurrent.Callable;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent;
import appeng.api.networking.IGridNode;
import appeng.core.AELog;
import appeng.me.Grid;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
@ -129,7 +130,7 @@ public class TickHandler implements ITickHandler
}
catch (Exception e)
{
e.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -46,8 +46,7 @@ public class IntegrationNode
.addCustomCategoryComment(
"ModIntegration",
"Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." );
String Mode = Configuration.instance.get( "ModIntegration", displayName.replace( " ", "" ), "AUTO" )
.getString();
String Mode = Configuration.instance.get( "ModIntegration", displayName.replace( " ", "" ), "AUTO" ).getString();
if ( Mode.toUpperCase().equals( "ON" ) )
enabled = true;
@ -90,7 +89,7 @@ public class IntegrationNode
{
AELog.info( displayName + " - Integration Disabled" );
if ( !(exception instanceof ModNotInstalled) )
exception.printStackTrace();
AELog.error( exception );
}
else
{

View file

@ -113,7 +113,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
return null;
}
@ -145,7 +145,7 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
catch (Throwable t)
{
AELog.severe( "Failed to register " + layerInterface.getName() + " with FMP, some features may not work with MultiParts." );
t.printStackTrace();
AELog.error( t );
}
}

View file

@ -28,6 +28,7 @@ import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.core.AELog;
import appeng.core.CommonHelper;
import appeng.core.Configuration;
import appeng.core.features.AEFeature;
@ -130,9 +131,9 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
AxisAlignedBB bb = AxisAlignedBB
.getAABBPool()
.getAABB( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ),
Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ),
Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
.getAABB( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ),
Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) )
.expand( 16, 16, 16 );
Entity entity = null;
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
@ -182,14 +183,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
try
{
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, (new PacketMatterCannon( d0, d1, d2, (float) (f7 * d3),
(float) (f6 * d3), (float) (f8 * d3), (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( Srec ) + 1) ))
.getPacket() );
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, (new PacketMatterCannon( d0, d1, d2, (float) (f7 * d3), (float) (f6 * d3),
(float) (f8 * d3), (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( Srec ) + 1) )).getPacket() );
}
catch (Exception err)
{
err.printStackTrace();
AELog.error( err );
}
if ( pos != null )
@ -205,7 +205,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
EntityLivingBase el = (EntityLivingBase) pos.entityHit;
penitration -= dmg;
el.knockBack( p, 0, (double) f7 * d3, (double) f8 * d3 );
// el.knockBack( p, 0, vec3.xCoord, vec3.zCoord );
// el.knockBack( p, 0, vec3.xCoord,
// vec3.zCoord );
el.attackEntityFrom( dmgSrc, dmg );
if ( !el.isEntityAlive() )
hasDestroyedSomething = true;
@ -227,7 +228,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
else
{
int bid = w.getBlockId( pos.blockX, pos.blockY, pos.blockZ );
// int meta = w.getBlockMetadata( pos.blockX, pos.blockY, pos.blockZ );
// int meta = w.getBlockMetadata(
// pos.blockX, pos.blockY, pos.blockZ );
if ( bid > 0 )
{

View file

@ -13,6 +13,7 @@ import org.bouncycastle.util.encoders.Base64;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridStorage;
import appeng.core.AELog;
import appeng.core.WorldSettings;
public class GridStorage implements IGridStorage
@ -25,7 +26,8 @@ public class GridStorage implements IGridStorage
public boolean isDirty = false;
private Set<GridStorage> divlist = new HashSet();
final GridStorageSearch mySearchEntry; // keep myself in the list until I'm lost...
final GridStorageSearch mySearchEntry; // keep myself in the list until I'm
// lost...
/**
* for use with world settings
@ -90,7 +92,7 @@ public class GridStorage implements IGridStorage
}
catch (IOException e)
{
e.printStackTrace();
AELog.error( e );
}
return "";

View file

@ -9,7 +9,7 @@ import java.util.Set;
import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkEvent;
import appeng.api.networking.events.MENetworkEventSubscribe;
import cpw.mods.fml.common.FMLLog;
import appeng.core.AELog;
public class NetworkEventBus
{
@ -42,10 +42,10 @@ public class NetworkEventBus
}
catch (Throwable e1)
{
FMLLog.severe( "[AppEng] Network Event caused exception:" );
FMLLog.severe( "Offending Class: " + obj.getClass().getName() );
FMLLog.severe( "Offending Object: " + obj.toString() );
e1.printStackTrace();
AELog.severe( "[AppEng] Network Event caused exception:" );
AELog.severe( "Offending Class: " + obj.getClass().getName() );
AELog.severe( "Offending Object: " + obj.toString() );
AELog.error( e1 );
throw new RuntimeException( e1 );
}

View file

@ -4,6 +4,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.util.WorldCoord;
import appeng.core.AELog;
import appeng.util.Platform;
public abstract class MBCalculator
@ -126,7 +127,7 @@ public abstract class MBCalculator
}
catch (Throwable err)
{
err.printStackTrace();
AELog.error( err );
}
disconnect();

View file

@ -19,6 +19,7 @@ import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartHost;
import appeng.api.util.AECableType;
import appeng.core.AELog;
import appeng.helpers.TickHandler;
import appeng.me.GridAccessException;
import appeng.me.cache.helpers.Connections;
@ -188,7 +189,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
}
catch (GridAccessException e)
{
// e.printStackTrace();
// :P
}
}
@ -212,14 +213,14 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
}
catch (FailedConnection e)
{
e.printStackTrace();
AELog.error( e );
// :(
}
}
}
catch (GridAccessException e)
{
e.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -41,6 +41,7 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.client.texture.CableBusTextures;
import appeng.core.AELog;
import appeng.core.localization.PlayerMessages;
import appeng.me.GridAccessException;
import appeng.util.Platform;
@ -263,10 +264,11 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
doRenderItem( sis, this.tile );
}
catch (Exception err)
catch (Exception e)
{
err.printStackTrace();
AELog.error( e );
}
GL11.glPopMatrix();
GL11.glTranslatef( 0.0f, 0.14f, -0.24f );

View file

@ -178,8 +178,7 @@ public class Profiler implements Runnable
File d = new File( BaseB + "org-openide-util.jar" );
File e = new File( BaseB + "org-openide-util-lookup.jar" );
ClassLoader cl = URLClassLoader.newInstance( new URL[] { a.toURI().toURL(), b.toURI().toURL(), c.toURI().toURL(), d.toURI().toURL(),
e.toURI().toURL() } );
ClassLoader cl = URLClassLoader.newInstance( new URL[] { a.toURI().toURL(), b.toURI().toURL(), c.toURI().toURL(), d.toURI().toURL(), e.toURI().toURL() } );
ProfilingSettingsPresets = cl.loadClass( "org.netbeans.lib.profiler.common.ProfilingSettingsPresets" );
ProfilingSettings = cl.loadClass( "org.netbeans.lib.profiler.common.ProfilingSettings" );
@ -239,8 +238,8 @@ public class Profiler implements Runnable
Object CPUResultsSnapshot_Instance = createSnapshot.invoke( StackTraceSnapshotBuilder_Instance, System.currentTimeMillis() );
Object LoadedSnapshot_Instance = LoadedSnapshot_Constructor.newInstance( CPUResultsSnapshot_Instance,
createCPUPreset.invoke( ProfilingSettingsPresets ), null, null );
Object LoadedSnapshot_Instance = LoadedSnapshot_Constructor.newInstance( CPUResultsSnapshot_Instance, createCPUPreset.invoke( ProfilingSettingsPresets ), null,
null );
FileOutputStream bout = new FileOutputStream( new File( "ae-latest-profile.nps" ) );
DataOutputStream out = new DataOutputStream( bout );
@ -251,7 +250,7 @@ public class Profiler implements Runnable
catch (Throwable t)
{
AELog.severe( "Error while profiling" );
t.printStackTrace();
AELog.error( t );
profile = false;
return;
}

View file

@ -9,6 +9,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.minecraft.crash.CallableMinecraftVersion;
import appeng.core.AELog;
import appeng.core.Configuration;
public class VersionChecker implements Runnable
@ -44,8 +45,8 @@ public class VersionChecker implements Runnable
URL url = new URL( "http://ae-mod.info/releases/?latest" );
URLConnection yc = url.openConnection();
yc.setRequestProperty( "User-Agent", "AE2/" + Configuration.VERSION + " (Channel:" + Configuration.CHANNEL
+ ",Minecraft:" + ((new CallableMinecraftVersion( null )).minecraftVersion()) + ")" );
yc.setRequestProperty( "User-Agent", "AE2/" + Configuration.VERSION + " (Channel:" + Configuration.CHANNEL + ",Minecraft:"
+ ((new CallableMinecraftVersion( null )).minecraftVersion()) + ")" );
BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream() ) );
@ -77,7 +78,7 @@ public class VersionChecker implements Runnable
}
catch (InterruptedException e1)
{
e1.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -23,7 +23,6 @@ import appeng.api.movable.IMovableHandler;
import appeng.api.movable.IMovableRegistry;
import appeng.api.util.WorldCoord;
import appeng.core.AELog;
import cpw.mods.fml.common.FMLLog;
public class CachedPlane
{
@ -218,9 +217,9 @@ public class CachedPlane
{
wrld.loadedTileEntityList.remove( te );
}
catch (Exception _)
catch (Exception e)
{
_.printStackTrace();
AELog.error( e );
}
}
}
@ -331,9 +330,9 @@ public class CachedPlane
{
handler.moveTile( te, wrld, x + x_offset, y + y_offset, z + z_offset );
}
catch (Throwable _)
catch (Throwable e)
{
_.printStackTrace();
AELog.error( e );
// attempt recovery...
te.worldObj = wrld;
@ -357,9 +356,9 @@ public class CachedPlane
alernateDest.addTile( x, y, z, te, null, mr );
}
}
catch (Throwable _)
catch (Throwable e)
{
_.printStackTrace();
AELog.error( e );
}
}
@ -373,7 +372,7 @@ public class CachedPlane
Chunk c = myChunks[x][z];
for (Method m : c.getClass().getMethods())
{
FMLLog.severe( "Chunk." + m.getName() );
AELog.severe( "Chunk." + m.getName() );
}
c.resetRelightChecks();

View file

@ -153,7 +153,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
}
@ -187,14 +187,15 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
}
catch (Throwable t)
{
t.printStackTrace();
AELog.error( t );
}
return output;
}
/**
* By default all blocks can have orientation, this handles saving, and loading, as well as synchronization.
* By default all blocks can have orientation, this handles saving, and
* loading, as well as synchronization.
*
* @return
*/
@ -279,7 +280,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
}
/**
* returns the contents of the tile entity, into the world, defaults to dropping everything in the inventory.
* returns the contents of the tile entity, into the world, defaults to
* dropping everything in the inventory.
*
* @param w
* @param x
@ -314,7 +316,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
}
/**
* depending on the from, diffrent settings will be accepted, don't call this with null
* depending on the from, diffrent settings will be accepted, don't call
* this with null
*
* @param from
* @param compound

View file

@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import appeng.api.AEApi;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AELog;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import appeng.util.iterators.AEInvIterator;
@ -188,9 +189,9 @@ public class AppEngInternalAEInventory implements IInventory, Iterable<ItemStack
inv[x] = AEItemStack.loadItemStackFromNBT( c );
}
catch (Exception err)
catch (Exception e)
{
err.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -7,6 +7,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import appeng.api.storage.IMEInventory;
import appeng.core.AELog;
import appeng.me.storage.MEIInventoryWrapper;
import appeng.util.Platform;
import appeng.util.iterators.InvIterator;
@ -201,9 +202,9 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
inv[x] = ItemStack.loadItemStackFromNBT( c );
}
catch (Exception err)
catch (Exception e)
{
err.printStackTrace();
AELog.error( e );
}
}
}

View file

@ -69,7 +69,6 @@ import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IAETagCompound;
import appeng.api.storage.data.IItemList;
import appeng.api.util.AEItemDefinition;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.me.GridNode;
@ -363,8 +362,9 @@ public class Platform
}
/*
* Lots of sillyness to try and account for weird tag related junk, basically requires that two tags have at least
* something in their tags before it wasts its time comparing them.
* Lots of sillyness to try and account for weird tag related junk,
* basically requires that two tags have at least something in their tags
* before it wasts its time comparing them.
*/
public static boolean sameStackStags(ItemStack a, ItemStack b)
{
@ -397,9 +397,11 @@ public class Platform
}
/*
* recursive test for NBT Equality, this was faster then trying to compare / generate hashes, its also more reliable
* then the vanilla version which likes to fail when NBT Compound data changes order, it is pretty expensive
* performance wise, so try an use shared tag compounds as long as the system remains in AE.
* recursive test for NBT Equality, this was faster then trying to compare /
* generate hashes, its also more reliable then the vanilla version which
* likes to fail when NBT Compound data changes order, it is pretty
* expensive performance wise, so try an use shared tag compounds as long as
* the system remains in AE.
*/
public static boolean NBTEqualityTest(NBTBase A, NBTBase B)
{
@ -483,8 +485,8 @@ public class Platform
}
/*
* Orderless hash on NBT Data, used to work thought huge piles fast, but ignroes the order just in case MC decided
* to change it... WHICH IS BAD...
* Orderless hash on NBT Data, used to work thought huge piles fast, but
* ignroes the order just in case MC decided to change it... WHICH IS BAD...
*/
public static int NBTOrderlessHash(NBTBase A)
{
@ -546,7 +548,8 @@ public class Platform
}
/*
* The usual version of this returns an ItemStack, this version returns the recipe.
* The usual version of this returns an ItemStack, this version returns the
* recipe.
*/
public static IRecipe findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World)
{
@ -631,7 +634,8 @@ public class Platform
}
/*
* Creates / or loads previous NBT Data on items, used for editing items owned by AE.
* Creates / or loads previous NBT Data on items, used for editing items
* owned by AE.
*/
public static NBTTagCompound openNbtData(ItemStack i)
{
@ -646,7 +650,8 @@ public class Platform
}
/*
* Generates Item entiies in the world similar to how items are generally droped.
* Generates Item entiies in the world similar to how items are generally
* droped.
*/
public static void spawnDrops(World w, int x, int y, int z, List<ItemStack> drops)
{
@ -670,7 +675,8 @@ public class Platform
}
/*
* Utility function to get the full inventory for a Double Chest in the World.
* Utility function to get the full inventory for a Double Chest in the
* World.
*/
public static IInventory GetChestInv(Object te)
{
@ -1062,7 +1068,6 @@ public class Platform
@SideOnly(Side.CLIENT)
public static String gui_localize(String string)
{
AELog.localization( "gui", string );
return StatCollector.translateToLocal( string );
}
@ -1110,8 +1115,9 @@ public class Platform
}
/*
* if ( a.itemID != 0 && b.itemID != 0 && a.isItemStackDamageable() && ! a.getHasSubtypes() && a.itemID ==
* b.itemID ) { return (a.getItemDamage() > 0) == (b.getItemDamage() > 0); }
* if ( a.itemID != 0 && b.itemID != 0 && a.isItemStackDamageable() && !
* a.getHasSubtypes() && a.itemID == b.itemID ) { return
* (a.getItemDamage() > 0) == (b.getItemDamage() > 0); }
*/
// test damageable items..
@ -1156,17 +1162,21 @@ public class Platform
}
/*
* // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1 ) return OreID == getOreID( b );
* // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1
* ) return OreID == getOreID( b );
*
* if ( Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() && !isShared( a.getTagCompound() ) ) { a =
* Platform.getSharedItemStack( AEItemStack.create( a ) ); }
* if ( Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() &&
* !isShared( a.getTagCompound() ) ) { a = Platform.getSharedItemStack(
* AEItemStack.create( a ) ); }
*
* if ( b.hasTagCompound() && !isShared( b.getTagCompound() ) ) { b = Platform.getSharedItemStack(
* AEItemStack.create( b ) ); }
* if ( b.hasTagCompound() && !isShared( b.getTagCompound() ) ) { b =
* Platform.getSharedItemStack( AEItemStack.create( b ) ); }
*
* // test regular items with damage values and what not... if ( isShared( a.getTagCompound() ) && isShared(
* b.getTagCompound() ) && a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound)
* a.getTagCompound()).compareFuzzyWithRegistry( (AppEngSharedNBTTagCompound) b.getTagCompound() ); } }
* // test regular items with damage values and what not... if (
* isShared( a.getTagCompound() ) && isShared( b.getTagCompound() ) &&
* a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound)
* a.getTagCompound()).compareFuzzyWithRegistry(
* (AppEngSharedNBTTagCompound) b.getTagCompound() ); } }
*/
return a.isItemEqual( b );
@ -1223,8 +1233,7 @@ public class Platform
AxisAlignedBB bb = AxisAlignedBB
.getAABBPool()
.getAABB( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ),
Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) )
.expand( 16, 16, 16 );
Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
Entity entity = null;
double Closeest = 9999999.0D;
@ -1292,8 +1301,7 @@ public class Platform
return 0;
}
public static <StackType extends IAEStack> StackType poweredExtraction(IEnergySource energy, IMEInventory<StackType> cell, StackType request,
BaseActionSource src)
public static <StackType extends IAEStack> StackType poweredExtraction(IEnergySource energy, IMEInventory<StackType> cell, StackType request, BaseActionSource src)
{
StackType possible = cell.extractItems( (StackType) request.copy(), Actionable.SIMULATE, src );
@ -1402,8 +1410,7 @@ public class Platform
}
}
static public <T extends IAEStack<T>> void postListChanges(IItemList<T> before, IItemList<T> after, IMEMonitorHandlerReciever<T> meMonitorPassthu,
BaseActionSource source)
static public <T extends IAEStack<T>> void postListChanges(IItemList<T> before, IItemList<T> after, IMEMonitorHandlerReciever<T> meMonitorPassthu, BaseActionSource source)
{
for (T is : before)
is.setStackSize( -is.getStackSize() );