mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-16 13:17:10 +00:00
Remove ILogger facade
Just use global Log4j logger on the ComputerCraft class.
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
package dan200.computercraft.shared.computer.apis;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.lua.ILuaTask;
|
||||
import dan200.computercraft.api.lua.LuaException;
|
||||
import dan200.computercraft.core.apis.ILuaAPI;
|
||||
import dan200.computercraft.core.logger.Logger;
|
||||
import dan200.computercraft.shared.computer.blocks.TileCommandComputer;
|
||||
import dan200.computercraft.shared.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -99,7 +99,7 @@ public class CommandAPI implements ILuaAPI
|
||||
}
|
||||
catch( Throwable t )
|
||||
{
|
||||
Logger.error( "Error running command.", t );
|
||||
ComputerCraft.log.error( "Error running command.", t );
|
||||
return new Object[]{ false, createOutput( "Java Exception Thrown: " + t.toString() ) };
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class CommandAPI implements ILuaAPI
|
||||
catch( Throwable t )
|
||||
{
|
||||
// Ignore buggy command
|
||||
Logger.error( "Error running command.", t );
|
||||
ComputerCraft.log.error( "Error running command.", t );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package dan200.computercraft.shared.network;
|
||||
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.core.logger.Logger;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
|
||||
@@ -25,7 +24,7 @@ public class PacketHandler
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Logger.error( "Error handling packet", e );
|
||||
ComputerCraft.log.error( "Error handling packet", e );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +39,7 @@ public class PacketHandler
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Logger.error( "Error handling packet", e );
|
||||
ComputerCraft.log.error( "Error handling packet", e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ package dan200.computercraft.shared.proxy;
|
||||
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.api.turtle.ITurtleUpgrade;
|
||||
import dan200.computercraft.core.logger.Logger;
|
||||
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
||||
import dan200.computercraft.shared.computer.items.ComputerItemFactory;
|
||||
import dan200.computercraft.shared.turtle.blocks.BlockTurtle;
|
||||
@@ -84,7 +83,9 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
||||
int id = upgrade.getLegacyUpgradeID();
|
||||
if( id >= 0 && id < 64 )
|
||||
{
|
||||
throw Logger.loggedError( "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. Legacy UpgradeID '" + id + "' is reserved by ComputerCraft" );
|
||||
String message = "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. Legacy UpgradeID '" + id + "' is reserved by ComputerCraft";
|
||||
ComputerCraft.log.error( message );
|
||||
throw new RuntimeException( message );
|
||||
}
|
||||
|
||||
// Register
|
||||
@@ -118,7 +119,7 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
Logger.error("Error checking stackability of items", e);
|
||||
ComputerCraft.log.error("Error checking stackability of items", e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -255,13 +256,17 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
||||
{
|
||||
if( legacyID >= Short.MAX_VALUE )
|
||||
{
|
||||
throw Logger.loggedError( "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + legacyID + "' is out of range" );
|
||||
String message = "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + legacyID + "' is out of range";
|
||||
ComputerCraft.log.error( message );
|
||||
throw new RuntimeException( message );
|
||||
}
|
||||
|
||||
ITurtleUpgrade existing = m_legacyTurtleUpgrades.get( legacyID );
|
||||
if( existing != null )
|
||||
{
|
||||
throw Logger.loggedError( "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + legacyID + "' is already registered by '" + existing.getUnlocalisedAdjective() + " Turtle'" );
|
||||
String message = "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + legacyID + "' is already registered by '" + existing.getUnlocalisedAdjective() + " Turtle'";
|
||||
ComputerCraft.log.error( message );
|
||||
throw new RuntimeException( message );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +274,9 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
||||
ITurtleUpgrade existing = m_turtleUpgrades.get( id );
|
||||
if( existing != null )
|
||||
{
|
||||
throw Logger.loggedError( "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + id + "' is already registered by '" + existing.getUnlocalisedAdjective() + " Turtle'" );
|
||||
String message = "Error registering '" + upgrade.getUnlocalisedAdjective() + " Turtle'. UpgradeID '" + id + "' is already registered by '" + existing.getUnlocalisedAdjective() + " Turtle'";
|
||||
ComputerCraft.log.error( message );
|
||||
throw new RuntimeException( message );
|
||||
}
|
||||
|
||||
// Register
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package dan200.computercraft.shared.util;
|
||||
|
||||
import dan200.computercraft.core.logger.Logger;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class IDAssigner
|
||||
}
|
||||
catch( NumberFormatException e )
|
||||
{
|
||||
Logger.error( "Unexpected file '" + content + "' in '" + location.getAbsolutePath() + "'", e );
|
||||
ComputerCraft.log.error( "Unexpected file '" + content + "' in '" + location.getAbsolutePath() + "'", e );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class IDAssigner
|
||||
}
|
||||
catch( IOException e )
|
||||
{
|
||||
Logger.error( "Cannot open ID file '" + lastidFile + "'", e );
|
||||
ComputerCraft.log.error( "Cannot open ID file '" + lastidFile + "'", e );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class IDAssigner
|
||||
}
|
||||
catch( NumberFormatException e )
|
||||
{
|
||||
Logger.error( "Cannot parse ID file '" + lastidFile + "', perhaps it is corrupt?", e );
|
||||
ComputerCraft.log.error( "Cannot parse ID file '" + lastidFile + "', perhaps it is corrupt?", e );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class IDAssigner
|
||||
}
|
||||
catch( IOException e )
|
||||
{
|
||||
Logger.error( "An error occured while trying to create the computer folder. Please check you have relevant permissions.", e );
|
||||
ComputerCraft.log.error( "An error occured while trying to create the computer folder. Please check you have relevant permissions.", e );
|
||||
}
|
||||
|
||||
return id;
|
||||
|
||||
Reference in New Issue
Block a user