Includes boxes for the max spawn area, and lines for activation status.
- Nether Fortresses; red boxes bound each individual area where Blaze, Wither Skeletons & normal Skeletons will spawn. Time for a beacon methinks!
- Witch Huts; blue boxes reveal everywhere only witches spawn. Witch farm anyone?
- Desert Temples; orange boxes envelop the pyramid and towers. Go grab some loot but beware TNT boobie traps!
-- Jungle Temples; green boxes surround the temple. Indianna Jones would've love these!
+- Jungle Temples; dark green boxes surround the temple. Indianna Jones would've love these!
- Ocean Monuments; cyan boxes indicate where guardians spawn. New sea lantern and prismarine block types FTW.
- End Cities; magenta boxes show the rooms, corridors and air ships in the End. Time to fall with style!
- Strongholds; yellow boxes show each room in the stronghold. Does anyone make anything with silverfish spawners?
- Woodland Mansions; brown boxes show each room in the woodland mansion. Here's Johnny!
- Mine Shafts; light gray boxes illustrate each of the mine shafts. Cobwebs... grrr!
- Villages; multicoloured spheres encircle the village, with boxes marking if and where iron golems will spawn. You should see the iron titan... CRAZY!
-- Slime chunks; bright green boxes highlight where slimes will spawn, with a dynamic box that rises to where the players feet are to help find them from the surface. Bouncy... bouncy...
+- Slime chunks; dark green boxes highlight where slimes will spawn, with a dynamic box that rises to where the players feet are to help find them from the surface. Bouncy... bouncy...
- World Spawn & spawn chunks; red boxes outline the world spawn and the spawn chunks (active & lazy).
- Igloos (*); white boxes show where igloos are. Maybe you can convert the zombie villager back?
- Shipwrecks (*); cyan boxes are like a lighthouse those wary sailors wish they'd had. Time to find some buried treasure?
- Ocean ruins (*); cyan boxes show the different ocean ruin structures. Watch out for those pesky drowns tho!
- Buried treasure (*); cyan boxes highlight where the heart of the sea can be found. Conduit anyone?
+- Mob Spawners; bright green boxes show where mob spawners are, where mobs will be spawned, and red/orange/green lines help the player see if a spawner is nearby and activated.
(*) Due to how Minecraft generates these structures they will initially float above where they should be, however upon re-logging they should drop down to the correct height. Unfortunately (or fortunately?) buried treasure will always appear at y-90 (unless Mojang change something that is!)
Shipwrecks | Client | Process/Render Shipwrecks | drawShipwrecks | true/false | true
Ocean Ruins | Client | Process/Render Ocean Ruins | drawOceanRuins | true/false | true
Buried Treasure | Client | Process/Render Buried Treasure | drawBuriedTreasure | true/false | true
+Mob Spawner | Client | Process/Render Mob Spawners | drawMobSpawners | true/false | true
+Mob Spawner Spawn Area | Client | Render where mobs will be spawned | renderMobSpawnerSpawnArea | true/false | true
+Mob Spawner Activation Lines | Client | Render red/orange/green lines to show nearby spawners and if they are active | renderMobSpawnerActivationLines | true/false | true
Villages | Both | Process/Render Villages | drawVillages | true/false | true
Village spheres | Client | Render Villages as spheres instead of cuboids | renderVillageAsSphere | true/false | true
Village Iron Golem Spawn Area | Client | Render Iron Golem Spawn Area within valid Villages | drawIronGolemSpawnArea | true/false | true
package com.irtimaled.bbor.client;
import com.irtimaled.bbor.common.BoundingBoxCache;
-import com.irtimaled.bbor.common.models.BoundingBox;
-import com.irtimaled.bbor.common.models.BoundingBoxSlimeChunk;
-import com.irtimaled.bbor.common.models.BoundingBoxWorldSpawn;
-import com.irtimaled.bbor.common.models.WorldData;
+import com.irtimaled.bbor.common.models.*;
import com.irtimaled.bbor.config.ConfigManager;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.BlockPos;
boundingBoxes.addAll(entry.getValue());
}
-
return boundingBoxes;
}
ChunkPos chunk = new ChunkPos(chunkX, chunkZ);
BlockPos minBlockPos = new BlockPos(chunk.getXStart(), 1, chunk.getZStart());
BlockPos maxBlockPos = new BlockPos(chunk.getXEnd(), 38, chunk.getZEnd());
- slimeChunks.add(BoundingBoxSlimeChunk.from(minBlockPos, maxBlockPos, Color.GREEN));
+ slimeChunks.add(BoundingBoxSlimeChunk.from(minBlockPos, maxBlockPos, Colors.DARK_GREEN));
}
}
return slimeChunks;
boundingBoxRendererMap.put(BoundingBoxSlimeChunk.class, new SlimeChunkRenderer());
boundingBoxRendererMap.put(BoundingBoxWorldSpawn.class, new WorldSpawnRenderer());
boundingBoxRendererMap.put(BoundingBoxStructure.class, new StructureRenderer());
+ boundingBoxRendererMap.put(BoundingBoxMobSpawner.class, new MobSpawnerRenderer());
}
public void render(DimensionType dimensionType, Boolean outerBoxesOnly) {
--- /dev/null
+package com.irtimaled.bbor.client.renderers;
+
+import com.irtimaled.bbor.client.PlayerData;
+import com.irtimaled.bbor.common.models.BoundingBoxMobSpawner;
+import com.irtimaled.bbor.common.models.Colors;
+import com.irtimaled.bbor.config.ConfigManager;
+import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.util.math.BlockPos;
+
+import java.awt.*;
+
+public class MobSpawnerRenderer extends Renderer<BoundingBoxMobSpawner>
+{
+ @Override
+ public void render(BoundingBoxMobSpawner boundingBox) {
+ BlockPos center = boundingBox.getCenter();
+ Color color = boundingBox.getColor();
+ OffsetPoint centerPoint = new OffsetPoint(center)
+ .add(0.5, 0.5, 0.5);
+ double radius = boundingBox.getRadius();
+ if (ConfigManager.renderMobSpawnerSpawnArea.getBoolean()) {
+ renderBoundingBox(boundingBox);
+ } else {
+ renderCuboid(new AxisAlignedBB(center, center).expand(1, 1, 1), color, fill());
+ }
+
+ if (!ConfigManager.renderMobSpawnerActivationLines.getBoolean()) return;
+
+ OffsetPoint playerPos = new OffsetPoint(PlayerData.getX(), PlayerData.getY(), PlayerData.getZ());
+ double distance = centerPoint.getDistance(playerPos);
+ if (distance <= (radius * 1.25)) {
+ if (distance > radius) {
+ color = Colors.DARK_ORANGE;
+ }
+ if (distance > radius * 1.125) {
+ color = Color.RED;
+ }
+
+ renderLine(centerPoint, playerPos.add(0, 0.1, 0), color);
+ }
+ }
+}
--- /dev/null
+package com.irtimaled.bbor.client.renderers;
+
+import com.irtimaled.bbor.client.PlayerData;
+import net.minecraft.util.math.BlockPos;
+
+public class OffsetPoint {
+ private final double x;
+ private final double y;
+ private final double z;
+
+ OffsetPoint(double x, double y, double z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ OffsetPoint(BlockPos blockPos) {
+ this.x = blockPos.getX();
+ this.y = blockPos.getY();
+ this.z = blockPos.getZ();
+ }
+
+ double getX() {
+ return x - PlayerData.getX();
+ }
+
+ double getY() {
+ return y - PlayerData.getY();
+ }
+
+ double getZ() {
+ return z - PlayerData.getZ();
+ }
+
+ public OffsetPoint add(double x, double y, double z) {
+ return new OffsetPoint(this.x + x, this.y + y, this.z + z);
+ }
+
+ public double getDistance(OffsetPoint point) {
+ double dx = this.x - point.x;
+ double dy = this.y - point.y;
+ double dz = this.z - point.z;
+ return Math.sqrt(dx * dx + dy * dy + dz * dz);
+ }
+}
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.util.math.BlockPos;
import org.lwjgl.opengl.GL11;
import java.awt.*;
+import java.util.HashSet;
+import java.util.Set;
public abstract class Renderer<T extends BoundingBox> {
public abstract void render(T boundingBox);
renderCuboid(aaBB, color, fill);
}
+ void renderLine(OffsetPoint point1, OffsetPoint point2, Color color) {
+ int colorR = color.getRed();
+ int colorG = color.getGreen();
+ int colorB = color.getBlue();
+
+ Tessellator tessellator = Tessellator.getInstance();
+ BufferBuilder worldRenderer = tessellator.getBuffer();
+ worldRenderer.begin(GL11.GL_LINES, worldRenderer.getVertexFormat());
+ worldRenderer.pos(point1.getX(), point1.getY(), point1.getZ()).color(colorR, colorG, colorB, 255).endVertex();
+ worldRenderer.pos(point2.getX(), point2.getY(), point2.getZ()).color(colorR, colorG, colorB, 255).endVertex();
+ tessellator.draw();
+ }
+
void renderCuboid(AxisAlignedBB aaBB, Color color, boolean fill) {
aaBB = offsetAxisAlignedBB(aaBB);
if (fill) {
package com.irtimaled.bbor.client.renderers;
-import com.irtimaled.bbor.client.PlayerData;
import com.irtimaled.bbor.common.models.BoundingBoxVillage;
import com.irtimaled.bbor.config.ConfigManager;
import net.minecraft.client.renderer.BufferBuilder;
tessellator.draw();
}
- private class OffsetPoint {
- private final double x;
- private final double y;
- private final double z;
-
- OffsetPoint(double x, double y, double z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- OffsetPoint(BlockPos blockPos) {
- this.x = blockPos.getX();
- this.y = blockPos.getY();
- this.z = blockPos.getZ();
- }
-
- double getX() {
- return x - PlayerData.getX();
- }
-
- double getY() {
- return y - PlayerData.getY();
- }
-
- double getZ() {
- return z - PlayerData.getZ();
- }
-
- public OffsetPoint add(double x, double y, double z) {
- return new OffsetPoint(this.x + x, this.y + y, this.z + z);
- }
- }
-
private Set<OffsetPoint> buildPoints(OffsetPoint center, double radius) {
Set<OffsetPoint> points = new HashSet<>(1200);
import com.irtimaled.bbor.Logger;
import com.irtimaled.bbor.common.models.BoundingBox;
+import com.irtimaled.bbor.common.models.BoundingBoxMobSpawner;
import com.irtimaled.bbor.common.models.BoundingBoxStructure;
import com.irtimaled.bbor.config.ConfigManager;
import com.irtimaled.bbor.config.Setting;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.math.MutableBoundingBox;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.feature.structure.StructureStart;
import java.awt.*;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
addStructures(ConfigManager.drawEndCities, StructureType.EndCity, structureMap);
addStructures(ConfigManager.drawPillagerOutposts, StructureType.PillagerOutpost, structureMap);
}
+ if(ConfigManager.drawMobSpawners.getBoolean()) {
+ Collection<TileEntity> tileEntities = chunk.getTileEntityMap().values();
+ for (TileEntity tileEntity : tileEntities) {
+ if (tileEntity instanceof TileEntityMobSpawner) {
+ addBoundingBox(BoundingBoxMobSpawner.from((TileEntityMobSpawner) tileEntity));
+ }
+ }
+ }
}
}
package com.irtimaled.bbor.common;
+import com.irtimaled.bbor.common.models.Colors;
+
import java.awt.*;
public class StructureType {
- public final static StructureType JungleTemple = new StructureType(Color.GREEN, "Jungle_Pyramid");
+ public final static StructureType JungleTemple = new StructureType(Colors.DARK_GREEN, "Jungle_Pyramid");
public final static StructureType DesertTemple = new StructureType(Color.ORANGE, "Desert_Pyramid");
public final static StructureType WitchHut = new StructureType(Color.BLUE, "Swamp_Hut");
public final static StructureType OceanMonument = new StructureType(Color.CYAN, "Monument");
--- /dev/null
+package com.irtimaled.bbor.common.models;
+
+import net.minecraft.tileentity.TileEntityMobSpawner;
+import net.minecraft.util.math.BlockPos;
+
+import java.awt.*;
+
+public class BoundingBoxMobSpawner extends BoundingBox {
+ private final BlockPos center;
+ private final Integer radius;
+
+ private BoundingBoxMobSpawner(BlockPos center, Integer radius, Color color, BlockPos minBlockPos, BlockPos maxBlockPos) {
+ super(minBlockPos, maxBlockPos, color);
+ this.center = center;
+ this.radius = radius;
+ }
+
+ public static BoundingBoxMobSpawner from(BlockPos center, Integer radius, Color color) {
+ BlockPos minBlockPos = new BlockPos(center.getX() - 5,
+ center.getY() - 1,
+ center.getZ() - 5);
+ BlockPos maxBlockPos = new BlockPos(center.getX() + 5,
+ center.getY() + 2,
+ center.getZ() + 5);
+ return new BoundingBoxMobSpawner(center, radius, color, minBlockPos, maxBlockPos);
+ }
+
+ public static BoundingBoxMobSpawner from(TileEntityMobSpawner mobSpawner) {
+ BlockPos center = mobSpawner.getPos();
+ return from(center, 16, Color.GREEN);
+ }
+
+ @Override
+ public String toString() {
+ return "(" + center.toString() + "; " + radius.toString() + ")";
+ }
+
+ public Integer getRadius() {
+ return radius;
+ }
+
+ public BlockPos getCenter() {
+ return center;
+ }
+}
--- /dev/null
+package com.irtimaled.bbor.common.models;
+
+import java.awt.*;
+
+public class Colors {
+ public final static Color DARK_ORANGE = new Color(255, 127, 0);
+ public final static Color DARK_GREEN = new Color(0, 96, 0);
+}
public static Setting drawOceanRuins;
public static Setting drawBuriedTreasure;
public static Setting drawIgloos;
+ public static Setting drawMobSpawners;
+ public static Setting renderMobSpawnerSpawnArea;
+ public static Setting renderMobSpawnerActivationLines;
public static void loadConfig(File mcConfigDir) {
configDir = mcConfigDir;
drawShipwrecks = SetupBooleanProperty(config, "features", "drawShipwrecks", true, "If set to true shipwrecks will be drawn. (default: true)");
drawOceanRuins = SetupBooleanProperty(config, "features", "drawOceanRuins", true, "If set to true ocean ruins will be drawn. (default: true)");
drawBuriedTreasure = SetupBooleanProperty(config, "features", "drawBuriedTreasures", true, "If set to true buried treasure will be drawn. (default: true)");
+ drawMobSpawners = SetupBooleanProperty(config, "features", "drawMobSpawners", true, "If set to true mob spawners will be drawn. (default: true}");
+ renderMobSpawnerSpawnArea = SetupBooleanProperty(config, "features", "renderMobSpawnerSpawnArea", true, "If set to true a box to show the maximum possible spawn area (10x10x4) for a spawner will be drawn (default: true)");
+ renderMobSpawnerActivationLines = SetupBooleanProperty(config, "features", "renderMobSpawnerActivationLines", true, "If set to true a red/orange/green line will be drawn to show if the spawner is active (default: true)");
config.save();
}