* Updated Log class

- Removed useless files from jar
* Fixed bug with OCInterface
This commit is contained in:
Nicolas BARBOTIN 2018-02-10 23:35:52 +01:00
parent 84b4a5122f
commit 533d35c960
3 changed files with 16 additions and 7 deletions

View File

@ -36,6 +36,12 @@ minecraft {
dependencies { dependencies {
} }
jar {
exclude 'org/**'
exclude 'net/montoyo/mcef/**'
exclude 'assets/mcef/**'
}
processResources { processResources {
// this will ensure that this task is redone when the versions change. // this will ensure that this task is redone when the versions change.
inputs.property "version", project.version inputs.property "version", project.version

View File

@ -33,6 +33,7 @@ import net.minecraft.world.World;
import net.montoyo.wd.WebDisplays; import net.montoyo.wd.WebDisplays;
import net.montoyo.wd.core.DefaultPeripheral; import net.montoyo.wd.core.DefaultPeripheral;
import net.montoyo.wd.entity.TileEntityKeyboard; import net.montoyo.wd.entity.TileEntityKeyboard;
import net.montoyo.wd.entity.TileEntityOCInterface;
import net.montoyo.wd.entity.TileEntityPeripheralBase; import net.montoyo.wd.entity.TileEntityPeripheralBase;
import net.montoyo.wd.entity.TileEntityServer; import net.montoyo.wd.entity.TileEntityServer;
import net.montoyo.wd.item.ItemLinker; import net.montoyo.wd.item.ItemLinker;
@ -205,6 +206,8 @@ public class BlockPeripheral extends WDBlockContainer {
if(te instanceof TileEntityServer) if(te instanceof TileEntityServer)
((TileEntityServer) te).setOwner((EntityPlayer) placer); ((TileEntityServer) te).setOwner((EntityPlayer) placer);
else if(te instanceof TileEntityOCInterface)
((TileEntityOCInterface) te).setOwner((EntityPlayer) placer);
} }
} }

View File

@ -4,33 +4,33 @@
package net.montoyo.wd.utilities; package net.montoyo.wd.utilities;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
public abstract class Log { public abstract class Log {
public static void info(String what, Object ... data) { public static void info(String what, Object ... data) {
FMLLog.log("WebDisplays", Level.INFO, what, data); LogManager.getLogger("WebDisplays").log(Level.INFO, String.format(what, data));
} }
public static void warning(String what, Object ... data) { public static void warning(String what, Object ... data) {
FMLLog.log("WebDisplays", Level.WARN, what, data); LogManager.getLogger("WebDisplays").log(Level.WARN, String.format(what, data));
} }
public static void error(String what, Object ... data) { public static void error(String what, Object ... data) {
FMLLog.log("WebDisplays", Level.ERROR, what, data); LogManager.getLogger("WebDisplays").log(Level.ERROR, String.format(what, data));
} }
public static void infoEx(String what, Throwable e, Object ... data) { public static void infoEx(String what, Throwable e, Object ... data) {
FMLLog.log("WebDisplays", Level.INFO, e, what, data); LogManager.getLogger("WebDisplays").log(Level.INFO, String.format(what, data), e);
} }
public static void warningEx(String what, Throwable e, Object ... data) { public static void warningEx(String what, Throwable e, Object ... data) {
FMLLog.log("WebDisplays", Level.WARN, e, what, data); LogManager.getLogger("WebDisplays").log(Level.WARN, String.format(what, data), e);
} }
public static void errorEx(String what, Throwable e, Object ... data) { public static void errorEx(String what, Throwable e, Object ... data) {
FMLLog.log("WebDisplays", Level.ERROR, e, what, data); LogManager.getLogger("WebDisplays").log(Level.ERROR, String.format(what, data), e);
} }
} }