How to detect fluids etc.

Discussion in 'Plugin Development' started by TGF, Nov 8, 2012.

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

    TGF

    Hi, I need to detect placing fluids and it's easy!
    But the problem is to detect what become from for example water block(am I sure that theoretically water flow 8 block at every side?).

    I found something what could help me but it's very hard to read sth from it^^
    Here it is: https://github.com/LogBlock/LogBloc...ddiz/LogBlock/listeners/FluidFlowLogging.java

    (just a little)Part of my code:
    BlockFromToEvent (open)
    Code:
    @EventHandler
    public void fromto(BlockFromToEvent event){
        Block b = event.getBlock();
        int type = 0;
        Material typee = b.getType();
        int data = b.getData();
        int x = b.getX();
        int y = b.getY();
        int z = b.getZ();
        this.logger.info("BlockFromToEvent");
        this.logger.info(ChatColor.GREEN + "Id=" + type + "|X=" + x + "|Y=" + y +"|Z=" + z +"|DATA="+typee+":"+data);
        try {
            String query;
            sendQueryAlt(connection, query);
        } catch (Exception e) {
            this.logger.info("#Sendin Erro" + e);
        }
    }
     
  2. Offline

    fireblast709

    say a = block from and b = block to
    if a = air, torch, etc, b = water
    if a = lava, b = cobble/obsidian
    if a = solid block, sign, etc. b = a
     
    TGF likes this.
Thread Status:
Not open for further replies.

Share This Page