From 533d35c960c0f587d93aa318fc4ecd8a5a6e7a32 Mon Sep 17 00:00:00 2001 From: Nicolas BARBOTIN Date: Sat, 10 Feb 2018 23:35:52 +0100 Subject: [PATCH] * Updated Log class - Removed useless files from jar * Fixed bug with OCInterface --- build.gradle | 6 ++++++ .../java/net/montoyo/wd/block/BlockPeripheral.java | 3 +++ src/main/java/net/montoyo/wd/utilities/Log.java | 14 +++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 1c8ad8d..8d79c7c 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,12 @@ minecraft { dependencies { } +jar { + exclude 'org/**' + exclude 'net/montoyo/mcef/**' + exclude 'assets/mcef/**' +} + processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version diff --git a/src/main/java/net/montoyo/wd/block/BlockPeripheral.java b/src/main/java/net/montoyo/wd/block/BlockPeripheral.java index e7abfae..239e9b4 100644 --- a/src/main/java/net/montoyo/wd/block/BlockPeripheral.java +++ b/src/main/java/net/montoyo/wd/block/BlockPeripheral.java @@ -33,6 +33,7 @@ import net.minecraft.world.World; import net.montoyo.wd.WebDisplays; import net.montoyo.wd.core.DefaultPeripheral; import net.montoyo.wd.entity.TileEntityKeyboard; +import net.montoyo.wd.entity.TileEntityOCInterface; import net.montoyo.wd.entity.TileEntityPeripheralBase; import net.montoyo.wd.entity.TileEntityServer; import net.montoyo.wd.item.ItemLinker; @@ -205,6 +206,8 @@ public class BlockPeripheral extends WDBlockContainer { if(te instanceof TileEntityServer) ((TileEntityServer) te).setOwner((EntityPlayer) placer); + else if(te instanceof TileEntityOCInterface) + ((TileEntityOCInterface) te).setOwner((EntityPlayer) placer); } } diff --git a/src/main/java/net/montoyo/wd/utilities/Log.java b/src/main/java/net/montoyo/wd/utilities/Log.java index 45442f6..82b56d6 100644 --- a/src/main/java/net/montoyo/wd/utilities/Log.java +++ b/src/main/java/net/montoyo/wd/utilities/Log.java @@ -4,33 +4,33 @@ package net.montoyo.wd.utilities; -import net.minecraftforge.fml.common.FMLLog; import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; public abstract class Log { 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) { - 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) { - 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) { - 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) { - 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) { - FMLLog.log("WebDisplays", Level.ERROR, e, what, data); + LogManager.getLogger("WebDisplays").log(Level.ERROR, String.format(what, data), e); } }