From 751414d80d5f06d6b8949f23a3da9769191e518e Mon Sep 17 00:00:00 2001 From: Kyzderp Date: Tue, 27 Jan 2015 20:15:24 -0800 Subject: [PATCH] added sounds while other screens are up --- ant/build_examplemod.xml | 2 +- ant/buildnumber.txt | 4 +- .../mobcountmod/LiteModMobCounter.class | Bin 6010 -> 6120 bytes .../kyzeragon/mobcountmod/MobCounter.class | Bin 4241 -> 4302 bytes .../mobcountmod/LiteModMobCounter.java | 35 ++++++++++++------ .../com/kyzeragon/mobcountmod/MobCounter.java | 9 +++-- 6 files changed, 33 insertions(+), 17 deletions(-) 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 ebc45f941547175a830287e6b218a287cca3f972..52ba543156db877e9313c36bf6ae01bec5f17b41 100644 GIT binary patch literal 6120 zcmb7I33wFc8Giqr-JRXd0Lz9&P=RPUl4!CJ+td=Rm1r}Azj>wRlH@S??|-VmY)UPaV;AGOwMZLPJ3J?!a$rtd#9IWUXjlP5F(^&S8Bz5n}v zvrl|{-&O#1VzLUKz+ewOA=V+pgzL+4lzhcE%(uYCa{AV^Az1&~4a9={-c{q{^z65kM#HJag9& z!hC^p0;s~losqAosYpunhH#KT*{BIZnG>m%t$MHLQG}}7jeLPH4&iHr{k+<_wRPOT z%n*}a>6$aGL=*AQP}Q#DFoDY5#Zm}O0@{j;Vf&2paaLMAd~F#nTs`i z6UQ-Td86Abkid0BP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;z7>~< z9ek(l!DZqw-(xS}a`7Ur5U=1$PYJH_L~ymI6xVp_ajj=DF7>R$^`2(j;4yHc$HGmX zOK`L2Ds+3U$8DZ&-0s*2 zgvXTE@woB^o>1P#lgd#%#p31Zf{8e6C+*kdwOcT0AZfFA6z?!G%ei;)o=n>8_469# z-=hVSNbobwpP{@;>uo?GZI%=srg<-|l68ARGzdi$z$XgDa$0yS{KAhrg_pemExl3r z*b9nXd{;ShhiOq~?nS=j{iGIowuyBjz@Ar8Mc9$26pLaJ z>CRcGapw*}vo#1nUdcyra_Kvm<-_Lin0{g*=mXcadIZ0lsc#Wa#ltqDXehzQY$r*i z1^ZEzpKDY8QCoBr^`6QRYGFTb%)-Id eJdsE6>g0EX7|AxwzqE@v3hAPRMjMq8qyGo>Nf^2S diff --git a/bin/com/kyzeragon/mobcountmod/MobCounter.class b/bin/com/kyzeragon/mobcountmod/MobCounter.class index f743ee95f25eddb8e2a9212be30299b30f448872..8505f4f0c48d7ee58227d9e2205696e793ea5414 100644 GIT binary patch literal 4302 zcma)9TW}P|6+JDjG+Jp`t#&~~5?}&0NDF9f91KP_jwEDD@k+=DP>_?D(e6k)Xm>`L z83}}+iA8Xnm-BKAaqKGpkV=scR{?&cDn*t5Qu#>bD_{9=Qu&RmQk6f4oSxptNLm?< z=$)S1-M3GlzV~$Vr~iHYM*s)$u7)~+`?F3lJ-2kpbd6cZP8Xf&tg~SIMJJaYb*2Yp z-E=iX1mfq7MI&7>?Ai2*>GNjR7ie^ioVDNyh!KI7X?D(8_UwRjQD9fbHvM$bvdye( z%=qaA-zud0FIrxI!J4(r+`vGefR;a5auCfs9($Mr1N8csWn2C+fk^jM&l$c3ot)W> zdbH|jL0q7|yXQ<40tp=rXq2_hI-+Q7MmxTwVXMH-drhvR1Dyh~S<@c~!%lS{51yWT z!C{CO1DPy`|5@p888ig~4Ysv4DG2-Vf^0p_l5&9)l zmN(%WGc%-mN?;S~*|||;zT~YX*s~$qxBMl6hVGH6o{?tsV4sE*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Yc@urN@W5!~x;W+`Uko7!J!C9|^m)jaLP)!ZJW@mO zUk@1%A^-G{bO`yYhnxr@w>{)BA_L^}9$2R)6J3#8IF-NQ4V?)O`OxfE=qq6;nTUl9 z%!P-11Lw9vU)>5ly%jo7Nb2VCjO1?&T!q#f@mcq`dZb&AMkS&Pj4IdB*Q>k-hUaKo zZ`*CG+(Pjx+Ac?hgufwh?UN68Mdk6eGC%;Ep#la)gkjN%y;#6LV*7EKW#Z2sy83*xq9KuIPi4GQdgE%Y>vs%mG0dXD=3Y$gPi#RG?XJPewRz7dBqPfjF?`tn!AM`&DCyc4-*3T*0DUH zs2M!Q-zQj>$Q#<@`wgT}Z~{NUPsvT-)lXwL5U|s#?EIee@Ao7-?Mj86-}6TsvO7a| zGh{bQb~9vm_73b`!!$X{1eWsH0#PZ9jI9jvfz9yot^lDy8)!c#yP#ry0TLNoE1Np)(C;8P7S!s}b77 zNF~}Zf?qJkgcm!^)_ofLuUEyMqGd)RH0k$^iq|~3)Vy|aj?CN&E?@`Cg<7iB0xvQy zX=evbU2Uk8wpl4FWTmFmwQZHss!C~6Da}_(OH`Ed(Hdu8DVIvEQK^emYMn}LP^n8) p>Y1jM`ej3LZ!5tS6``Tsnl~+>iN(f8z}WFiq?W({~z!h5AOf~ 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)