Skip to content

Commit

Permalink
Added guardians
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyzderp committed Oct 25, 2015
1 parent ed0fc7e commit 3701e92
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions ant/build_examplemod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<!-- The file is well commented and you should have a read through this script before making -->
<!-- changes to ensure that you know how it works. -->

<project name="mobcounter_staff" basedir="." default="main">
<project name="mobcounter" basedir="." default="main">

<!-- The version of your mod, can be any string as long as it's valid as part of a file name -->
<!-- and should match the version string returned by your mod. -->
<property name="version" value="1.2.0" />
<property name="version" value="1.2.5" />

<!-- The Minecraft version the mod is for, appended to the output file name for reference -->
<property name="mcversion" value="1.8" />
Expand Down
4 changes: 2 additions & 2 deletions ant/buildnumber.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Thu Oct 22 05:31:30 PDT 2015
build.number=49
#Sun Oct 25 03:41:53 PDT 2015
build.number=52
33 changes: 16 additions & 17 deletions java/io/github/kyzderp/mobcountmod/LiteModMobCounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class LiteModMobCounter implements Tickable, OutboundChatFilter

private String[] passives = {"Chickens: ", "Pigs: ", "Sheep: ", "Cows: ", "Horses: ", "Mooshrooms: ", "Rabbits: ", "Wolves: "};
private String[] hostiles = {"Zombies: ", "CaveSpiders: ", "Skeletons: ", "Spiders: ",
"Creepers: ", "Witches: ", "Pigmen: ", "Slimes: "};
"Creepers: ", "Witches: ", "Pigmen: ", "Slimes: ", "Guardians: "};


public LiteModMobCounter() {}
Expand All @@ -70,7 +70,7 @@ else if (this.staff)
}

@Override
public String getVersion() { return "1.2.0"; }
public String getVersion() { return "1.2.5"; }

@Override
public void init(File configPath)
Expand Down Expand Up @@ -343,14 +343,14 @@ private void displayPassiveCompact()
{
FontRenderer fontRender = Minecraft.getMinecraft().fontRendererObj;
this.counter.updateBB();
fontRender.drawStringWithShadow("Radius: " + this.counter.getRadius(), 0, 0, 0xFFAA00);
fontRender.drawStringWithShadow("Radius: " + this.counter.getRadius(), 5, 0, 0xFFAA00);
if (staff)
{
fontRender.drawStringWithShadow("Players: " + this.counter.countEntity(16), 60, 0, 0xFFFFFF);
fontRender.drawStringWithShadow("Players: " + this.counter.countEntity(20), 65, 0, 0xFFFFFF);
int color = 0xFFFFFF;
int count = this.counter.countEntity(18);
if (count > 16) color = 0xAA0000;
fontRender.drawStringWithShadow("Snowmen: " + count, 0, 50, color);
fontRender.drawStringWithShadow("Snowmen: " + count, 5, 50, color);
}
String toDisplay;

Expand All @@ -360,7 +360,7 @@ private void displayPassiveCompact()
int count = this.counter.countEntity(i);
toDisplay = "" + count;
if (count > 16) color = 0xAA0000;
fontRender.drawStringWithShadow(this.passives[i] + toDisplay, 0, i * 10 + 10, color);
fontRender.drawStringWithShadow(this.passives[i] + toDisplay, 5, i * 10 + 10, color);
color = 0xFFFFFF;
}
}
Expand All @@ -376,10 +376,9 @@ private void displayPassiveExpanded()
int color = 0xFFFFFF;
int count = this.counter.countEntity(i);
String toDisplay = "" + count;
int x = 70;

if (count > 16) color = 0xAA0000;
fontRender.drawStringWithShadow(this.passives[i] + toDisplay, x, i * 10 - 30, color);
fontRender.drawStringWithShadow(this.passives[i] + toDisplay, 75, i * 10 - 30, color);
color = 0xFFFFFF;
}

Expand All @@ -388,7 +387,7 @@ private void displayPassiveExpanded()
int color = 0xFFFFFF;
int count = this.counter.countEntity(17);
if (count > 16) color = 0xAA0000;
fontRender.drawStringWithShadow("Golems: " + count, 70, 50, color);
fontRender.drawStringWithShadow("Golems: " + count, 75, 50, color);
}
}

Expand All @@ -406,27 +405,27 @@ private void displayHostile()

if (this.counter.getXP5())
{
fontRender.drawStringWithShadow("ShockerzXP5", 0, offset, 0xFFAA00);
fontRender.drawStringWithShadow("ShockerzXP5", 5, offset, 0xFFAA00);
}
else
{
this.counter.updateHostileBB();
fontRender.drawStringWithShadow("Radius: " + this.counter.getHRadius(), 0, offset, 0xFFAA00);
fontRender.drawStringWithShadow("Radius: " + this.counter.getHRadius(), 5, offset, 0xFFAA00);
}

int totalCount = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i < 5; i++)
{
int count = this.counter.countEntity(i + 8);
totalCount += count;
fontRender.drawStringWithShadow(this.hostiles[i] + count, 0, i * 10 + 10 + offset, 0xFFFFFF);
fontRender.drawStringWithShadow(this.hostiles[i] + count, 5, i * 10 + 10 + offset, 0xFFFFFF);
}
for (int i = 4; i < 8; i++)
for (int i = 5; i < 9; i++)
{
int count = this.counter.countEntity(i + 8);
totalCount += count;
if (this.hostileVisible > 1)
fontRender.drawStringWithShadow(this.hostiles[i] + count, 90, i * 10 - 30 + offset, 0xFFFFFF);
fontRender.drawStringWithShadow(this.hostiles[i] + count, 95, i * 10 - 40 + offset, 0xFFFFFF);
}
int color = 0xFFFFFF;
if (totalCount > 149) // if 150+ mobs, display in red.
Expand All @@ -435,9 +434,9 @@ private void displayHostile()
this.playSoundCount = 100;

if (this.counter.getXP5())
fontRender.drawStringWithShadow("Total: " + totalCount, 70, offset, color);
fontRender.drawStringWithShadow("Total: " + totalCount, 75, offset, color);
else
fontRender.drawStringWithShadow("Total: " + totalCount, 60, offset, color);
fontRender.drawStringWithShadow("Total: " + totalCount, 65, offset, color);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion java/io/github/kyzderp/mobcountmod/MobCounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ public int countEntity(int num)
case 13: return minecraft.theWorld.getEntitiesWithinAABB(EntityWitch.class, hostileBB).size();
case 14: return minecraft.theWorld.getEntitiesWithinAABB(EntityPigZombie.class, hostileBB).size();
case 15: return minecraft.theWorld.getEntitiesWithinAABB(EntitySlime.class, hostileBB).size();
case 16: return minecraft.theWorld.getEntitiesWithinAABB(EntityGuardian.class, hostileBB).size();

case 16: return minecraft.theWorld.getEntitiesWithinAABB(EntityPlayer.class, boundingBox).size() - 1;
case 17: return minecraft.theWorld.getEntitiesWithinAABB(EntityIronGolem.class, boundingBox).size();
case 18: return minecraft.theWorld.getEntitiesWithinAABB(EntitySnowman.class, boundingBox).size();
case 20: return minecraft.theWorld.getEntitiesWithinAABB(EntityPlayer.class, boundingBox).size() - 1;

}
return 0;
}
Expand Down

0 comments on commit 3701e92

Please sign in to comment.