diff --git a/ant/build_examplemod.xml b/ant/build_examplemod.xml index ddfc46d..47af1a4 100644 --- a/ant/build_examplemod.xml +++ b/ant/build_examplemod.xml @@ -17,7 +17,7 @@ - + diff --git a/ant/buildnumber.txt b/ant/buildnumber.txt index 70769e9..30b5e70 100644 --- a/ant/buildnumber.txt +++ b/ant/buildnumber.txt @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Aug 24 15:42:45 PDT 2014 -build.number=27 +#Tue Jan 27 20:13:20 PST 2015 +build.number=30 diff --git a/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class b/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class index ebc45f9..52ba543 100644 Binary files a/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class and b/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class differ diff --git a/bin/com/kyzeragon/mobcountmod/MobCounter.class b/bin/com/kyzeragon/mobcountmod/MobCounter.class index f743ee9..8505f4f 100644 Binary files a/bin/com/kyzeragon/mobcountmod/MobCounter.class and b/bin/com/kyzeragon/mobcountmod/MobCounter.class differ diff --git a/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java b/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java index 0194118..1af15e6 100644 --- a/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java +++ b/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java @@ -29,7 +29,7 @@ public class LiteModMobCounter implements Tickable private boolean showChildCounts = false; private MobCounterConfigScreen configScreen = new MobCounterConfigScreen(); - private MobCounter counter = new MobCounter(); + private MobCounter counter = new MobCounter(staff); private static KeyBinding counterKeyBinding; private static KeyBinding hostileKeyBinding; private static KeyBinding optionsKeyBinding; @@ -37,7 +37,7 @@ public class LiteModMobCounter implements Tickable private int counterVisible = 0; // 0 - not visible, 1 - compact, 2 - expanded private int hostileVisible = 0; - private int playSoundCount = 100; + private int playSoundCount = 100; // counts down so sound plays once per sec public LiteModMobCounter() {} @@ -52,7 +52,7 @@ public String getName() @Override public String getVersion() { - return "1.0.0"; + return "1.0.2"; } @Override @@ -80,6 +80,27 @@ public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, bool { configScreen.updateScreen(); } + + if (inGame) + { + int totalCount = 0; + for (int i = 0; i < 8; i++) + { + totalCount += this.counter.countEntity(i + 8, true); + } + if (totalCount > 149) + { + if (this.playSoundCount == 0) + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1.0F, 1.0F); + else + { + if (this.playSoundCount > 99) + this.playSoundCount = -1; + } + this.playSoundCount++; + } + } + if (inGame && minecraft.currentScreen == null && Minecraft.isGuiEnabled()) { if (this.useOptions && LiteModMobCounter.optionsKeyBinding.isPressed()) @@ -184,14 +205,6 @@ else if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) if (totalCount > 149) // if 150+ mobs, display in red and play sound. { color = 0xAA0000; - if (this.playSoundCount == 0) - Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1.0F, 1.0F); - else - { - if (this.playSoundCount > 99) - this.playSoundCount = -1; - } - this.playSoundCount++; } else this.playSoundCount = 100; diff --git a/java/com/kyzeragon/mobcountmod/MobCounter.java b/java/com/kyzeragon/mobcountmod/MobCounter.java index e671bae..57a5cd0 100644 --- a/java/com/kyzeragon/mobcountmod/MobCounter.java +++ b/java/com/kyzeragon/mobcountmod/MobCounter.java @@ -20,13 +20,16 @@ public class MobCounter { private int hRadius; //radius for hostiles private AxisAlignedBB hostileBB; - public MobCounter() + public MobCounter(boolean isStaff) { this.radius = 16; - this.hRadius = 16; + if (isStaff) + this.hRadius = 25; + else + this.hRadius = 16; + this.boundingBox = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0); this.hostileBB = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0); - } public int countEntity(int num, boolean adult)