Is anyone else having a problem with EnumSkyBlock.BLOCK in 1.2.3-R0.1? My plugin TorchLight+ appears to have stopped working, though it worked fine in 1.1-R4... Here's a snippet of code: Code:java public static void lightUp(int x, int y, int z, CraftWorld world, Player player) { int radius = 5; resetLight(x, y, z, world); for (int i = -radius; i <= radius; i++) { for (int j = -radius; j <= radius; j++) { for (int k = -radius; k <= radius; k++) { int oldLevel = world.getHandle().getLightLevel(x + i, y + j, z + k); int newLevel = 15 - (Math.abs(i) + Math.abs(j) + Math.abs(k)); if (newLevel > oldLevel) { world.getHandle().a(EnumSkyBlock.BLOCK, x + i, y + j, z + k, newLevel); } } } } }
Nope, I have code in ChessCraft which uses EnumSkyBlock, and it's still working in 1.2.3-R0.1. See forceLightLevel() in https://github.com/desht/ChessCraft.../java/me/desht/chesscraft/regions/Cuboid.java What you're doing looks OK - what isn't working, exactly? Exceptions, or just no light appearing?
No light appears whatsoever. I threw a line above EnumSkyBlock that outputs to the console, so it does reach that part of the code... but nothing happens. Nope, in fact I'm testing on a Superflat map. Couldn't be closer to bedrock lol.
Out of interest you could try this dev build of ChessCraft on your 1.2.3-R0.1 server: http://dl.dropbox.com/u/12467600/ChessCraft-dev.jar Since I know it works on my dev server, if it works on your server, it points to something in your code. If it doesn't, it points to something about your server or world setup. With the plugin loaded, do /chess create board b1 (in an isolated spot - blocks will be overwritten!) and see if the lighting over the board remains (roughly) at full brightness regardless of time of day or blocks covering the board.
Nope, my working (development) version of ChessCraft is built against and running on 1.2.3-R0.1. (I started a private conversation with HappyPikachu about the board creation error he's getting)
I'm pretty sure (but haven't confirmed 100%) that this is happening because lighting data is now sent along with map chunk data in packet 51: see http://wiki.vg/Protocol#Map_Chunks_.280x33.29 In other words, just using the World.a() method with EnumSkyBlock alone isn't enough any more; any affected chunks also need to be resent to any nearby players. I do this for ChessCraft in https://github.com/desht/ChessCraft.../java/me/desht/chesscraft/regions/Cuboid.java (see sendClientChanges() and queueChunks()). I don't send packets directly, but instead update the chunkCoordIntPairQueue field of any nearby EntityPlayer objects - this lets the server send the packets in its own time instead of all at once, which would be asking for lag. I also take care not to queue up chunks that are already in the player's queue. (Thanks @bergerkiller for showing me this concept ) I was only resending map chunks in ChessCraft pre-1.2 because I'm doing block and lighting changes at the same time - which probably explains why ChessCraft mysteriously continued to work in 1.2 and TorchLight+ didn't!
Looks like @desht has the fix, so I'm marking this as 'Solved'. Big thanks to him - I'll be updating my plugin asap! Also, thanks @NuclearW for steering this in the right direction!