Checking if a block was placed by the world generator or something/someone

Discussion in 'Plugin Development' started by BlueCactus, Jan 27, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    BlueCactus

    How could I go about checking this? Right now my NPCs would likely cause mass destruction on a populated server because they'll destroy everything.
     
  2. Offline

    hammale

    hmmm the only thing i can think of would be to store the location of each and every player placed block which is VERY unrealistic :D as for ur problem, just set the NPC's to only destroy naturaly generated blocks (grass, dirt, stone, sand, sandstone, ice, gravel, all ores). If someone builds there house out of sandstone and grass, well its time to upgrade :p
     
  3. Offline

    BlueCactus

    I can't do that because the NPCs are supposed to get blocks and progress up the normal tech tree, starting with wood and going up. That would result in a large number of blocks in people's stuff being targeted.
     
  4. Offline

    Tj3

    The only way is to store all the player modifications to the world. Highly impractical unless you have an extremely massive and fast hard-drive to store all of this data. An alternative would be making them obey some sort of regions, and providing players with a way to 'protect' their houses from NPCs by defining a player-region the NPCs won't bother.
     
  5. Offline

    darkmage0252

    Maybe you could make all blocks placed by players have a specific damage value but it would cause problems with some blocks like wool.
     
  6. Offline

    Aetherspawn

    I thought there was a function that returned if a block was placed by a player or not... (it's used by Endermen?)

    Edit: Turns out there isn't. Plugins that claim to do this use LogBlock integration.
     
  7. Offline

    ItsHarry

    Only 2 solution I can think of:
    1. Log every block a player places.
    2. Somehow use the generator to get all the blocks which are placed by the generator. Then check if the block broken was placed by the generator or later placed by a player
     
  8. Offline

    Sir Savary

    You could hook into the LogBlock API, that might help you.
     
Thread Status:
Not open for further replies.

Share This Page