Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

New API #36

Closed
Closed

Description

@DeKleineKobini

How can I check if ID of task is same as the paste action I did wityh my plugin?

And how can I actually paste something? I only know how to do it with 2.x

Activity

  1. SBPrime commented on Jan 26, 2016

    @SBPrime
    Owner

    Check this: #9

  2. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    Thanks

  3. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    I found one thing I don't know to do:
    execute something when the pasting is done

  4. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    Got it working with

    bp.addListener(new IBlockPlacerListener(){
    
                @Override
                public void jobRemoved(IJobEntry job) {
                    if(!job.getName().equalsIgnoreCase("ETH paste map")) return;
                    if(gameHandler.getState() != GameState.MAP_RESETTING) return;
    
                    gameHandler.setState(GameHandler.GameState.MAP_INLOBBY);
                }
    
                @Override
                public void jobAdded(IJobEntry job) {
                    if(!job.getName().equalsIgnoreCase("ETH paste map")) return;
    
                    gameHandler.setState(GameState.MAP_RESETTING);
                }
            });
  5. SBPrime commented on Jan 26, 2016

    @SBPrime
    Owner

    You also need to add a job state change listener (from IJobEntry) and listen for job state done. The job is removed when all blocks are queued (stage 1 is done). All blocks are placed after the job is in state DONE.

  6. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    When do I need to add the job state change listener? on jobRemoved?

  7. SBPrime commented on Jan 26, 2016

    @SBPrime
    Owner

    Add listener on jobAdded and remove on job removed.

  8. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    So tomething like this:
    onjobadd: add state change listener
    Onjobremove: remove state change listener

  9. SBPrime commented on Jan 26, 2016

    @SBPrime
    Owner

    Yes exactly

  10. DeKleineKobini commented on Jan 26, 2016

    @DeKleineKobini
    Author

    Thank you for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions