Created
July 29, 2011 08:00
-
-
Save SpaceManiac/1113415 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public WorldMap a(ItemStack itemstack, World world) { | |
WorldMap worldmap = (WorldMap) world.a(WorldMap.class, "map_" + itemstack.getData()); | |
if (worldmap == null) { | |
itemstack.b(world.b("map")); | |
String s = "map_" + itemstack.getData(); | |
worldmap = new WorldMap(s); | |
worldmap.b = world.q().c(); | |
worldmap.c = world.q().e(); | |
worldmap.e = 3; | |
worldmap.map = (byte) world.worldProvider.dimension; | |
worldmap.a(); | |
world.a(s, (WorldMapBase) worldmap); | |
// Insert event here | |
} | |
return worldmap; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CraftBukkit start | |
for (i = 0; i < render.cursors.size(); ++i) { | |
MapCursor cursor = render.cursors.get(i); | |
if (!cursor.isVisible()) continue; | |
byte value = (byte) (((cursor.getType() == 0 || cursor.getDirection() < 8 ? cursor.getDirection() : cursor.getDirection() - 1) & 15) * 16); | |
abyte[i * 3 + 1] = (byte) (value | (value < 0 ? 16 - cursor.getType() : cursor.getType())); | |
abyte[i * 3 + 2] = (byte) cursor.getX(); | |
abyte[i * 3 + 3] = (byte) cursor.getY(); | |
} | |
// CraftBukkit end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment