Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class RadarDetectionLogic {
- public AxisAlignedBB boundingBox;
- public abstract World getRadarWorld();
- public abstract int getRadarX();
- public abstract int getRadarY();
- public abstract int getRadarZ();
- public abstract int getRadarRange();
- // Radar Specs
- int RadarRange = 48;
- double RadarRangeHoriz;
- double RadarRangeVerti;
- int RadarRangeHorizintal;
- int RadarRangeVertical;
- // Radar Scan results
- boolean dangerous;
- int count;
- public void updateRadar(int range) {
- // TODO Auto-generated method stub
- boolean active;
- double x = this.getRadarX();
- double y = this.getRadarY();
- double z = this.getRadarZ();
- if (range > 0 && range >= 16) {
- // Let's make sure it can detect entities at least a chunk away.
- RadarRange = range;
- } else {
- RadarRange = 16;
- }
- this.RadarRangeHoriz = RadarRange*2;
- this.RadarRangeVerti = RadarRange;
- AxisAlignedBB tester = null;
- tester.setBounds(x-RadarRangeHoriz, y-RadarRangeVerti, z-RadarRangeHoriz, x+RadarRangeHoriz, y+RadarRangeVerti, z+RadarRangeHoriz);
- List list = this.getRadarWorld().getEntitiesWithinAABB(Entity.class, this.boundingBox);
- int count = list.size();
- if (count > 0) {
- dangerous = true;
- this.count = count;
- } else {
- dangerous = false;
- this.count = 0;
- }
- Minecraft.getMinecraft().thePlayer.sendChatMessage(x + " " + y + " " + z + ";range:" + range);
- }
- public boolean getDanger() {
- return dangerous;
- }
- public int getEntityCount() {
- return count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment