Inactive [SEC] AntiXRay v0.6.10 - protecting ore from XRay mod and transparent texturepacks [1000]

Discussion in 'Inactive/Unsupported Plugins' started by asdaarg, Apr 11, 2011.

  1. Offline



    Reporting Errors the follow things have to be mentioned:
    • CB Version and AXR version
    • Whether you started the AXR version with a fresh ore file or not (doing /axr off before upgrade)
    • If not, since what version you've been using the same ore file.
    • If you get any errors in console, check the debug.log for "Error"s and "Warning"s. and post those.

    Upcoming features for 0.7:
    - AXR Chest chest hiding feature developed by MrSelfDestrukt
    - New advanced visibility test (almost done, only need to test it now and decide whether its going to replace or be an alternative to the original light based test) Details here and here


    AntiXRay hides ores from players by turning them into stone until they have been exposed, thus making it impossible for any client side hacks to detect them, as their location is not sent to the client.

    Backup your world(s) I cannot guarantee that ore doesn't disappear from them due to this plugin. Even if you did not backup, there is a foolproof solution here. If you decide to uninstall, type /axr off, and not delete the ore data file before your ore is restored unless your intention is to strip your worlds from ore.

    If you upgrade from 0.5.21 it is recommended that you do /axr off first flush out errors from the ore file. If you do not have enough RAM, you can do this in steps using 0.6.9 but you need to set lenient=true in the config file to allow the file to be loaded
    NSCommand <-- Required
    Source and old versions

    - Specify what ores to hide(works with non ore blocks too as long as they don't use data values or extra data such as chests and signs (use some chest locking plugin for keeping your chests from xrayers)
    - Multi world support
    - Permissions support
    - Stores ore data in binary files (one per world) and only keeps data about loaded chunks in physical memory. It is on average 400 bytes per chunk in and guesstimatedly around 450 in physical memory, so it is reasonably small, but some people might play on huge worlds and want to conserve memory.
    - Saves data about chunks immediately on any changes (they are assumed to be by far sufficciently rare that any performance is won by buffering is neglible. As such it also prevents potential ore duplication on server crashes)
    - chunk and world statistics
    - ingame map of loaded chunks
    - background processes that does not freeze the server
    - dump ore statistics into file and compare them to see the changes in ore content.
    - lots of configuration options

    Ores will become visible under any of these circumstances:
    - A surrounding block is lit by torch and player is within the chunk or adjacent chunk and within 16 blocks to player on Y axis.
    - A surrounding block is lit by a third block broken falling or removed by explosion and player is within the chunk or adjacent chunk and within 16 blocks to player on Y axis (occurs once every 2 seconds, but configurable).
    - A surrounding block is broken or falls or removed by explosion
    - A surrounding block is changed by another plugin (can be cpu intensive if you worldedit a big area for instance - might do a workaround for this)

    Current Limitations:
    - Ores at light level above pitch black on chunk generation will not be hidden e.g. near lava or surface cave entrances.
    - Ores will not be found exploring caves in pitch black (who does that anyway?) These two limitations was to allow a light based visibility test that relies on a test already built into the server, thus avoiding extra performance overhead as well as headache of coding it myself. Despite these limitations, AntiXRay should make it far beyond pointless to search for ores using XRay or transparent textures.
    - Gravel and sand dropping on chunk generation may expose ore. This is assumed to be rare enough to have neglible effect.
    - The data file will not repack itself. The ratio between generated ore and mined ore is assumed to be very high, and the file size is considerably small but nonetheless, should you want to "repack" it, just turn axr off and on and the new file will be smaller excluding the gaps between chunk entries. But again, do some basic math and count the amount of ore blocks mined in total, multiply that by 2 bytes. After a month of mining 10000 ore blocks, you shaved 20k off that 3M file.
    - If you place a torch there is a tiny delay as seen in the video due to client side prediction and lag between the time the info of the ore to get back to the client from the server. This can seem unnatural so I might make a better vision test later that doesn't rely on light. However it would be more expensive in terms of cpu cycles.
    - If you have a slow server or a lot of players, you might want to remove coal from the config list. It speeds it up at least 200%. There are some optimizations I can do that I might add later that will speed up things further.


    /axr on - hides all unlit ore
    /axr off - reveals all hidden ore (and deletes the data file!)
    /axr on <world> - hides all unlit ore in specified world
    /axr off <world> - restores ore in specified world
    /axr worlds - world statistics
    /axr chunk - chunk statistics at chunk player is on
    /axr chunk <x> <z> - chunk statistics at specified chunk
    /axr map -shows map of loaded chunks in current world
    /axr map <world> -shows map of loaded chunks in specific world
    /axr map <zoom>
    /axr map <world> <zoom>
    /axr map <x> <z>
    /axr map <world> <x> <z>
    /axr map <zoom> <x> <z>
    /axr map <world> <zoom> <x> <z>
    /axr show
    /axr show <world>
    /axr hide
    /axr hide <world>
    /axr dump <world> <file>
    /axr diff <filein1> <filein2> <fileout>
    /axr gen <world> <x1> <z1> <x2> <z2> command for generating a rectangular area of chunks
    /axr gen copy <world1> <world2> command for generating all the chunks in world2 that are registered in world1
    /axr pack <world> - removes dead space in ore file (not that there is much from just mining but the axr chest will create significant amount of dead space.
    Auto-backup, that will backup your ore file on startup
    /axr backup <world> - backs up the ore file of the world if and only if the file passes the corruption test
    /axr test <world> - test the ore file and memory for errors for a specific world
    /axr test - test the ore file and memory for errors for all worlds
    /axr mirrorworld <world1> <world2> - creates a world world2 with the same seed as world1.
    These functions are not recommended for use unless you know what you're doing: (they can be destructive of tile entites)
    /axr chunk regen - regenerate chunk (to as it was when world was initially generated)
    /axr chunk regen <x> <z> - same but for specified chunk
    /axr chunk regen <x1> <z1> <x2> <z2> - same but for axis aligned rectangular area
    /axr chunk regen ore - only regenerate ores in chunk at player position
    /axr chunk regen ore <x> <z> - same but for specified chunk
    /axr chunk regen ore <x1> <z1> <x2> <z2> - same but for axis aligned rectangular area

    Note about regeneration: ores, trees, flowers and mushrooms are random each time and not tied to world seed (bukkit/mc issue)



    timerms - the time between light check by broken third block in milliseconds.
    maxdep - buffer size for number of ores that can occur in a chunk - don't change unless you have another plugin that adds tons of ore.
    maxheight - is the number of Y-levels in your map.
    ChunkFileBuffer - sets how much is buffered for new chunks to be stored until the index is rewritten (at the end of the file.)
    Materials - what ores you want to hide. (has to have same number of elements as maxys)
    maxys - the first Y level from bottom they cannot occur at. (has to have same number of elements as Materials)
    worlds - what worlds are loaded at startup (comma separated)
    autostart=all (normal) worlds are loaded at startup (unless CFGworlds is set)
    nounload = keeps all ore data in physical memory
    debug - turning on writes to a debug file keeping track of important info that may be needed to solve bugs or figure out why lag occurs
    fileindexdebug - turning on debug file needed as a quick check of the consistency of your ore file
    mapcol - the chatcode colour of each type of block in ascending order, shown in /axr map
    mapwidth - the width of the map shown in /axr map
    mapheight - the height of the map shown in /axr map
    schedulerload - 0-100 percentage of time going to execute any background process.
    schedulerstatustimer - time in millisecs between each status report of a background process
    filterorenotinstone - filters ore upon exposition that is not in stone (can be used to restore ore from a backupped ore file or ore file generated from a fresh world with same seed)
    autorepack - pack ore files automatically at startup - on by default
    autobackup - backup ore files automatically at startup(requires autorepack) - on by default
    maxfaces - specify max amount of exposed faces per chunk before error occurs
    lenient - ignore lindex errors when loading file (useful if you have them from before and want to filter them out)
    All CMD_... options are for redefining the commands so you can type something else.

    • Fixed Array index out of bounds in listindex accessing materials that has not been loaded yet.
    • Added /axr mirrorworld <world> <mirrorworld> command
    • Fixed NPE when trying to expose ores in world hole.
    • checking whether wrong file exist during repack.
    • fixed NPEs in some commands that can occur if you use it and the world is off.
    • fixed open file pointers during repack.
    • fixed NPE during repack when load fails.
    • fixed NPE when running test on all worlds and not all worlds are on
    • added various memory checks and chunk data entry overwrite checks
    • fixed NPE when trying to flush the debug file when debug file is turned off.
    • added lenient config option to ignore lindex errors when loading file (useful if you have them from before and want to filter them out)
    • added more information on error when loading from file
    • added config option maxfaces to specify max amount of exposed faces per chunk before error occurs
    • /axr off now gradually unregisters chunks - as a workaround to what appears to be a problem with chunks not getting fully removed from memory despite trying both unloadchunk calls through bukkit. This allows one to shut down the server and continue restoration after a restart if one does not have enough RAM
    • /axr pack <world> - removes dead space in ore file (not that there is much from just mining but the axr chest will create significant amount of dead space.
    • /axr backup <world> - backs up the ore file of the world if and only if the file passes the corruption test, also packs the new file.
    • /axr test <world> - test the ore file and memory for errors for a specific world
    • /axr test - test the ore file and memory for errors for all worlds
    • autorepack config option - pack ore files automatically at startup (if and only if the file passes the corruption test) - on by default
    • autobackup config option - backup ore files automatically at startup(if and only if the file passes the corruption test, and also requires autorepack) - on by default
    • new .ore extension for ore files (rename your old files)
    • removed glowing redstone ore from default ore list (never occurs naturally anyway)
    • fixed faulty scanning issue
    • fixed hopefully last exposed ore face index error
    • fixed false positive in memory check
    • debug.log flushed when error occurs (it is otherwise flushed once in a period of time)
    • more details in debug log when error occurs
    • removed lindex spam in debug log until lindex error occurs
    • Fixed /axr gen not triggering scan anymore
    • Fixed /axr gen not unloading chunks
    • Fixed (workaround) huge memory leak during /axr off /axr show /axr hide and /axr gen caused by bukkit's unloadchunk function
    • Additional file corruption checks that will make noise as soon as something goes wrong
    • Fixed another potential index derangement bug.
    • Fixed array out of bounds exception during previous fix
    • Fixed a couple of bugs offsetting exposed ore face indicies when mining adjacent block potentially causing array out of bounds exceptions at a later stage and the revealing of wrong ores when exposed to light.
    • Added debug logging of exposed ore face indices when found, as well as fault intolerant check that will warn you about any corruption of the indices after the event.
    • fixed half of ore not being hidden when a chunk is generated on load.
    • removed various unnecessary details to be logged in debug.log
    • fixed bug restoring ore, hiding and showing in wrong world
    • revert hack to set block material of a chunk to physical updates due to lacking javadocs to figure out what function to call
    • Switched to non physics updating block material setting hack
    • Updated to #733
    • Added detailed debug logging of background processes.
    • removed logging of filepointer
    • fixed failed scan after /axr gen unloading chunks that were originally not loaded, consequently also /axr gen causing server to freeze and timeouts on clients.
    • fixed /axr gen not unloading chunks that were originally not loaded
    • /axr gen and /axr gen copy now actually usable
    • ore in stone filter now also applies to /axr off and /axr show (not just when it is found by light detection)
    • added /axr gen command for generating a rectangular area of chunks
    • added /axr gen copy command for generating all chunks that are registered in another world
    • Configuration option CFGfilterorenotinstone implemented, that allows filtering of ores not in stone (can be useful in recovering lost ore from a world with the same seed)
    • fixed ore regen not working when axr is off in that world
    • removed physics lock spam
    • fixed more concurrency errors during background processes (hopefully for the last time)
    • fixed more concurrency errors during background processes
    • fixed concurrency errors during background processes
    • fixed debug off in config file causing unable to start (again! although different place now)
    • ore stats dump - listing all chunks ore counts into a text file
    • ore stats diff - showing difference between two ore stats dump files (these two tools are useful if you are worried that your ores might disappear)
    • show command - reveals the ore but does not unregister them or delete the file
    • hide command - hides again ore that was revealed with show.
    • show, hide and ore stat dump are background processes that does not freeze the server.
    • axr off is now a background process
    • load percentage of background processes can be configured
    • specify map zoom and center
    • Fixed file index debug listing not showing
    • file index debug listing can be turned off in config.txt (fileindexdebug)
    • area regeneration functions now tolerate any two coorner in rectangle in any order.
    • fixed debug off in config file causing unable to start
    • added axr map command for showing map of loaded chunks
    • fixed light expose unmapped material (probably why you got grass/smooth stones)
    • fixed light expose restored block being block at exposed face
    • fixed light expose no chunk location offset (why you got it at spawn)
    • fixed exposed face location wrong axis (probably floating blocks)
    • removed unnecessary cacheing of chunks at startup by not using chunks as keys for file index(probably solve memory problems for large worlds)
    • bypassing unnecessary cacheing of blocks using minecraft hackery.
    • revised scan algorithm, bypassing bukkit wrapcode resulting in at 5-10 times faster scanning.
    • fixed queries on unloaded sidechunks during scan resulting in loading and even generation of chunks that on top of it due to eventlock get ignored by onChunkLoad, thus leaving chunks of unhidden ore.
    • fixed light expose filling 0s after removed index
    • probably more bug fixes, can't remember them all
    • world statistics: type axr world - shows also what worlds are on/off
    • chunk statistics when axr is off no longer causes world to be registered without any chunks being loaded
    • axr on doesn't show NaN when there is nothing to hide
    • proper colouring
    • empty chunks are no longer ignored.
    • Fixed potential ore type shift bug
    • Moved listindex before file is loaded so debug info can be displayed even if it crashes while loading.
    • added rectangular area regen functions
    • Fixed silly nullpointer exceptions
    • Specify what worlds to turn on and off
    • Specify what worlds to load at startup
    • option to keep all ore data in memory
    • chunk statistics (useful for checking that your ore doesn't disappear or duplicate)
    • chunk regenertaion (restore a chunk to state at world generation)
    • chunk ore regenertaion (restore only ore)
    • Fixed some other bugs related to exposed-face-to-ore index
    • Index debug file working again (it was still expecting 0.1.5 files)
    • Added potential ore file corruption warnings to debug file output
    • Fixed bug locating exposed-face-to-ore index elements having no array bounds check.
    • Fixed bug exposed-face-to-ore index elements not being removed
    • Fixed bug exposed-face-to-ore index not being updated when ores are recovered and removed from hidden ore list (new bug in 0.2)
    • Fixed bug at y levels above 128-16 looking for ores above the map
    • Uses NSCommand now (it did right from the start but its now a separate plugin)
    • auto-creation of config files
    • defaults to ops only when permissions is not present
    • Light detection optimization based on a separate list of faces exposed to nonsolid materials (this might not work with all materials yet such as stairs and singlesteps, but its not like the world generator puts them in the caves anyway) resulting in at least 10 times faster execution of light checks. This should reduce all lag that's not due to scanning new chunks for ore.
    • Once again more detailed debug log
    • Fixed bug in ore restoring function causing large veins of ore to be generated out of nothing
    • More detailed debug log
    • Removed file corruption check that's hogging up some cpu cycles during file load and write events (the latter occured during scan event) - so this should speed up scan events.
    • pseudo error "load error 1" moved to debug log.
    • Added 1 tick delay of scan in onload event since it appears bukkit fires it before the chunk is populated with ore. This fixed the bug of ore appearing if you teleport or walk far away from initially scanned chunks.
    • removed physics event logging since it appears to always be neglible.
    • Added message at startup informing you about the waiting time of scanning all loaded chunks may take a while.
    • Fixed bug starting server without plugin data folder causing it unable to write debug file
    • Added more debug file details (when its scanning, loading from file, or just loading from memory when neither is shown)
    • Those who who don't hide coal, should experience faster chunk scanning now
    • Fixed bug due to player location being null for some weird reason
    • Added debug logging of time spent on the main time consuming procedures.
    • Fixed config file not loading properly
    • Removed wtfexception spam
    • Initial Release
    Donate (Not necessary but appreciated)
  2. Offline


    You've got the right version. Can I have a look at the debug.log (should shrink a lot when zipped) and .index.txt files?
  3. Offline


    Antixray is spewing out a few errors here and may be the cause of some lag, if it helps, I once tried to do /axr off but it kept crashing because I ran out of memory, so I had to cut it during the process. Here is my debug file

    Edit: the errors happen when I reload the plugins and the debug folder is getting bigger and bigger! AHHHH
  4. Offline


    Does your debug.log have any Lindex errors? If so look for the very first "Lindex error". Also look for the very first "Fatal Error" if there are such in server log. I'd like have a look at those places in particular.
  5. Offline


    Thats the old version of NbToolkit, use this one

    And unless its been fixed (not that I know of) You will need to be carefull and look at the instruction to limit Redstone ore as by default it puts way too much due to generating above it maximum height. Look for my posts.
  6. Offline



    Thanks for the heads up, when searching for stuff relating to Minecraft it seems that Google always likes to put up irrelevant information- plugins are particularly difficult to find.
  7. Offline


    Np. :) I still love google anyways! :)

    I used the method outlined to redo my ore instead of NbToolkit. Main things I had to do though was give java more memory and I upped the scheduler to higher priority on my test machine to get things done quicker.
  8. Offline


    Absolutely, the log is zipped and located here: (it's a monster, though, 843mb before zip, 128 after!)

    Also, here is another error I encountered (along with a few others) I imagine that's all in the debug but just in case it's not i'll post it. This only seems to happen when one specific player is mining, so I wonder about foul play a bit (my server allows no mods at all, save for the minimap and grass mods) For all I know this has nothing to do with that, though.

  9. Offline


    Thanks for the report. Stranglely enough there are no errors in it. Can you do a:
    cat server.log |grep -n -B 2 -A 5 asdaarg > asdaarg.log
    and let me have a look at asdaarg.log?

    I've implemented both of the ideas regarding line of sight visibility test and performance-wise it is quite good. I can run it 10 times as often as the light check and keep track on 25 chunks per player rather than 9 and it consumes 30-70µs per check. The main bottleneck is crossing chunk borders with an additional ~100-200µs, as it is the initial test that takes up most of the time, also about a third of the time is devoted to preparing the chunk. That might be reduced too but its a lot of work. Due to this feature that stores the last found solid material, performing repeated checks often doesn't add much cpu cycles which is really good for the ores to pop up as soon as possible. On the other hand there are issues with the line of sight crossing blocks near the ore. A face can be partially visible and its hard to know where the line should go, and currentlly I only have the line go from the center of the block which will cross blocks when you approach it from the side when its in a wall. If I do checks from the center of all exposed faces, it will add perhaps 50% more cpu cycles on avg, estimating how many faces are exposed on avg, and it still may fail if the face is obscured by another block in the foreground. Another idea I've been toying around with is to generate a bitmask of solid blocks and then shave off a layer from the cave walls. But that is a another big project. I've also thought about just temporarily doing this for blocks next to the ore (I'm already doing this with the ore itself without notifying clients), but it doesn't solve all problems. If anyone has ideas I'd like to hear them. This feature might be postponed to 0.7 and 0.6 will instead include a chest hiding feature MrSelfDestrukt has made, as well as the backup system including corruption checks.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  10. Offline


    I get this problem when i start the server:

    What can i do?
  11. Offline


    don't use tabs in yml
  12. Offline


    Thanks so much for your answer.

    I don't have any. Here is my world.yml

    This error appears when i put the antixray.jar in my plugins folder. =/
  13. Offline


    Try using permissions instead then.
  14. Offline


    With Permissions, It crashes me the other plugins and permissions too when i put AntiXray. Without it, the server goes fine. No matter. Thank so much for answering.
  15. Offline


    I'm not sure why a plugin would change the way a yml file was parsed but it does appear as though you have a tab at the end of lines 231, 232 and 237.

    Edit - I also noticed that this isn't the file that caused that error.
  16. Offline


    If it helps I will certainly do so, I will say that things seem to be working correctly as far as I can tell. It was just a few error reports that had originally caught my attention. Anyway, let me know if you do want a log, but I can't complain certainly at how things seem to be running! Keeps those nasty little x-rayers at bay :p
  17. Offline


    Yes, as I notice you use MacOSX you should be able to run this in a console:
    cat server.log |grep -n -B 2 -A 5 asdaarg > asdaarg.log
    it will find all instances of "asdaarg" in the server.log and copy the surrounding lines into another file called "asdaarg.log", that way you don't have to send the whole server.log.
  18. Offline


    Ugh, Your download server is down - This is the only good XRay plugin! -_-
  19. Offline


    Hi asdaarg,

    I have just read some of your posts regarding thoughts about hiding ore and stuff from xray-mods. This is a good approach, but may be hard to realize. Another approach may be to confuse Xray-mods by sending false information, so that a player with Xray mod may see everywhere ore and diamonds. This would anoy peoply using Xray Mods and reduce credibility of them.

    What do you think about it?
  20. Offline


    Its an alternative solution, rather funny, to have a huge amount of ore but most being fake. But it would consume more resources, since you require more than double of fakes, because it would still be profitable to go after the diamonds if you get them a third of the time.

    Update on upcoming features:

    Upcoming features for 0.6:
    - AXR Chest chest hiding feature developed by MrSelfDestrukt
    - Auto-backup, that will backup your ore file on startup
    - Corruption check that makes sure no corrupt file is packed or backed up
    - Backup on command
    - Autopack on startup that will remove dead space in ore files.
    - Pack on command

    Upcoming features for 0.7:
    - New advanced visibility test (almost done, only need to test it now and decide whether its going to replace or be an alternative to the original light based test) Details here and here

    The new visibility test is postponed as it needs more testing and needs tweaking. Needs ideas

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  21. Offline


    Hi, i´ve got a small server with usually around 10 people online at the same time.
    It only has about 1GB ram assigned.
    Before using AXR Plugin i had no problems, but now my ram seems to get loaded and loaded (when exploring) and never frees itself again. I tested this yesterday, we were 2 people on the server. Before i started the server took about 200MB ram and i teleportet (WE /jumpto) quite agressive. The ram was fully used after about 5 minutes. I then warped back to a town and the server crashed. Does AXR really need that much ram? I read it needs cpu. The strange thing is just that it doesnt seem to clear the ram, has someone experienced something similar?

    I´ve deactivated coal in the config

    And another question:
    Do i have to do /axr off before removing the plugin?
  22. Offline


    I made a little test run of 1500 blocks. The server starts at about 110M, then when you log in it quickly increase to 360M and then slowly increases.
    with AXR, NSCommand and no other plugins: 565M,
    with no plugins: was about 540M when I almost finished 1500 blocks, then jumped up to 575M before i hit the goal.
    I don't think its axr that's using up your memory, but you could do some tests on your own and post them.
    Yes you have to do /axr off before removing the plugin or the ore is lost.
  23. Offline


    Thanks for your quick response, i´ll do some further tests.
  24. Offline


    Is there a way I can reaload all of the ore in my world at once? I somehow deleted all of it.
  25. Offline


    Wow....not exactly plug and play I see
  26. Offline


    Read under description.
  27. Offline



    Hi asdaarg,

    at first, thank you for this great plugin.

    There is just one problem, I want to update, but cannot turn it off again due to the following reason.

    When you try to unload axr, it fills the ram up to more than my server provider gives to me,
    even on my home computer, I cap at 2 gig ram for java.
    I am sure you can work out a procedure that writes back the results in between, so that when the server crashes like it will always do on so much ram usage, it does not have to start from the beginning again, which makes the turning off IMPOSSIBLE.
    Even better would ofc be a method that does not use more than 500 MB of ram for axr .

    Thanks for the attention, and hoping for quick solution, of this well, serious issue,
  28. Offline


    Try starting with .21 and doing /axr off and then /axr on right at the start
  29. Offline


    Thanks for the quick reply.

    Well, thats what I did.
  30. Offline


    If you still can't do it in .21 then perhaps you have errors in your ore file that causes it to load large chunks of memory. How does your .index.txt file(s) look like?
  31. Offline


    erm, .. whats it supposed to look like?
    it has 2 mb

Share This Page