Add support for multiple world event markers
This commit is contained in:
parent
dc66a79ef7
commit
31efd50489
@ -128,15 +128,11 @@ public class ItemMapRenderer extends MapRenderer
|
||||
}
|
||||
else
|
||||
{
|
||||
// int chunkBX = blockX & 0xF;
|
||||
// int chunkBZ = blockZ & 0xF;
|
||||
// int chunkBX = blockX & 0xF;
|
||||
// int chunkBZ = blockZ & 0xF;
|
||||
|
||||
// Border
|
||||
if (
|
||||
_safezone.isInSafeZone(new Location(mapView.getWorld(), blockX - 1, STANDARD_Y, blockZ)) ||
|
||||
_safezone.isInSafeZone(new Location(mapView.getWorld(), blockX, STANDARD_Y, blockZ - 1)) ||
|
||||
_safezone.isInSafeZone(new Location(mapView.getWorld(), blockX + 16, STANDARD_Y, blockZ)) ||
|
||||
_safezone.isInSafeZone(new Location(mapView.getWorld(), blockX, STANDARD_Y, blockZ + 1)))
|
||||
if (_safezone.isInSafeZone(new Location(mapView.getWorld(), blockX - 1, STANDARD_Y, blockZ)) || _safezone.isInSafeZone(new Location(mapView.getWorld(), blockX, STANDARD_Y, blockZ - 1)) || _safezone.isInSafeZone(new Location(mapView.getWorld(), blockX + 16, STANDARD_Y, blockZ)) || _safezone.isInSafeZone(new Location(mapView.getWorld(), blockX, STANDARD_Y, blockZ + 1)))
|
||||
{
|
||||
Color cColor = MapPalette.getColor(color);
|
||||
double clans = colorAll ? 1 : 0.8;
|
||||
@ -157,7 +153,8 @@ public class ItemMapRenderer extends MapRenderer
|
||||
double clans = 0.065;
|
||||
|
||||
// Stripes
|
||||
//boolean checker = (mapX + (mapZ % 4)) % 4 == 0;
|
||||
// boolean checker = (mapX + (mapZ % 4))
|
||||
// % 4 == 0;
|
||||
double base = 1 - clans;
|
||||
|
||||
int r = (int) ((cColor.getRed() * base) + (areaColor.getRed() * clans));
|
||||
@ -194,16 +191,18 @@ public class ItemMapRenderer extends MapRenderer
|
||||
|
||||
for (WorldEvent event : _worldEvent.getActiveEvents())
|
||||
{
|
||||
if (!event.isInProgress())
|
||||
if (!event.isInProgress() || event.getEventLocations() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Location point = event.getCurrentLocation();
|
||||
for (Location point : event.getEventLocations())
|
||||
{
|
||||
double mapX = (point.getX() - info.getX()) / zoom;
|
||||
double mapZ = (point.getZ() - info.getZ()) / zoom;
|
||||
|
||||
// To make these appear at the edges of the map, just change it from
|
||||
// To make these appear at the edges of the map, just change it
|
||||
// from
|
||||
// 64 to something like 128 for double the map size
|
||||
if (mapX > -64 && mapX < 64 && mapZ > -64 && mapZ < 64)
|
||||
{
|
||||
@ -212,13 +211,14 @@ public class ItemMapRenderer extends MapRenderer
|
||||
|
||||
byte cursorType = 5; // http://i.imgur.com/wpH6PT8.png
|
||||
// Those are byte 5 and 6
|
||||
byte rotation = (byte) (int) ((point.getYaw() * 16D) / 360D);
|
||||
byte rotation = (byte) (int) (((point.getYaw() + 180) * 16D) / 360D);
|
||||
|
||||
MapCursor cursor = new MapCursor(b0, b1, rotation, cursorType, true);
|
||||
|
||||
cursors.addCursor(cursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SupplyDrop supplyDrop = _supply.getActive();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user