From 143d7d63dad0f306ecbd4bc9c3e8cc19191597fb Mon Sep 17 00:00:00 2001 From: LemADEC Date: Tue, 2 May 2017 19:32:44 +0200 Subject: [PATCH] Fixed console spam --- .../cr0s/warpdrive/block/TileEntityAbstractInterfaced.java | 6 +++--- src/main/java/cr0s/warpdrive/event/LivingHandler.java | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractInterfaced.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractInterfaced.java index 59816c83..6c6ac5dd 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractInterfaced.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractInterfaced.java @@ -218,15 +218,15 @@ public abstract class TileEntityAbstractInterfaced extends TileEntityAbstractBas // Return version public Object[] version() { - WarpDrive.logger.info("Version is " + WarpDrive.VERSION + " isDev " + WarpDrive.isDev); + if (WarpDriveConfig.LOGGING_LUA) { + WarpDrive.logger.info("Version is " + WarpDrive.VERSION + " isDev " + WarpDrive.isDev); + } String[] strings = WarpDrive.VERSION.split("-"); - WarpDrive.logger.info("strings size is " + strings.length); if (WarpDrive.isDev) { strings = strings[strings.length - 2].split("\\."); } else { strings = strings[strings.length - 1].split("\\."); } - WarpDrive.logger.info("strings size is now " + strings.length); ArrayList integers = new ArrayList<>(strings.length); for (String string : strings) { integers.add(Integer.parseInt(string)); diff --git a/src/main/java/cr0s/warpdrive/event/LivingHandler.java b/src/main/java/cr0s/warpdrive/event/LivingHandler.java index ef5778ae..bb7415d0 100644 --- a/src/main/java/cr0s/warpdrive/event/LivingHandler.java +++ b/src/main/java/cr0s/warpdrive/event/LivingHandler.java @@ -217,6 +217,8 @@ public class LivingHandler { // 5 blocks high is motionY = -0.844 // slime in the overworld falling from // 2.177279 blocks high is motionY -0.6517000126838683 + // spider in the overworld falling from + // 3.346 blocks high is motionY -0.717 // cancel in case of very low speed final EntityLivingBase entity = event.entityLiving; @@ -235,7 +237,9 @@ public class LivingHandler { return; } - WarpDrive.logger.warn(String.format("Entity fall damage at motionY %.3f from distance %.3f of %s", entity.motionY, distance, entity)); + if (WarpDrive.isDev) { + WarpDrive.logger.warn(String.format("Entity fall damage at motionY %.3f from distance %.3f of %s", entity.motionY, distance, entity)); + } // check for equipment with NOFALLDAMAGE tag for (int i = 1; i < 5; i++) {