BlockLogging?

Discussion in 'Plugin Development' started by xxCoderForLifexx, Dec 26, 2012.

Thread Status:
Not open for further replies.
  1. I don't really know where to start with is besides
    Code:java
    1. onBlockPlace and onBlockBreak Events

    Does anyone know how to do it?
     
  2. Offline

    MP5K

    hello xxCoderForLifexx,
    use the BlockPlayerEvent to log placed block in a config a db or something else and the BlockBreakEvent to log breaked blocks.
    btw: use the EventPriority Monitor to get the final event state

    if you need any help fell free to pm me ;3
     
  3. Wow thanks this helps me understand it a lot more :D
     
  4. Offline

    kingBS11

    Make your plugin generate a config file first. Then onBlockPlace(BlockPlaceEvent Event) have it log the block into the config file :D
    If you need some help just msg me.
     
  5. Offline

    MP5K

    be more specific if you need a more specific answer...
     
  6. Offline

    fireblast709

    Don't use a config for logging. Just create yourself a Logger object and add a FileHandler
     
  7. Offline

    Chlorek

    While doing things like this the best way of storing data is some database, SQLite for example.
     
    zachoooo likes this.
  8. Offline

    zachoooo

    Learning how to use MySQL can be a bit difficult for people who are new to them or don't understand how to use them, but they are definitely worth learning in cases like these where you will be logging very large amounts of data.
     
  9. Offline

    Chlorek

    Zachoooo, you're right. However using SQLite/MySQL with some class like this one is really simple and efficient! I am using it myself in about 20 projects and works perfect. If you need any help feel free to ask xxCoderForLifexx.
     
  10. Offline

    zachoooo

    Most noobs to sql don't even understand query structure, but that would definitely make the actually coding much easier :)
     
  11. I have no idea how to use SQl Anyway
    Chlorek
     
  12. Offline

    zachoooo

    But you can learn! Its better to learn the right way to do things than be trying to find less efficient work arounds am I right?
     
    Chlorek likes this.
  13. Offline

    Chlorek

    All these SQL are like... like talking with database. You just say what to do, these queries are simple. Using SQLite gives you warranty that saved data won't be fuc... broken (there is always some possibility but... almost impossible). As begin I think you should know a bit about SQLite, it is easy, MySQL too, but SQLite is easier. Well, both are similar.
     
  14. Offline

    fireblast709

    Don't fall back to SQL unless you really, really need it. xxCoderForLifexx What is the reason of the logging?
     
Thread Status:
Not open for further replies.

Share This Page