Created
May 4, 2018 21:02
-
-
Save Zerthick/f70f56d8791faab3061d698dcded3b55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Listener(order = Order.LATE) | |
public void onBlockPlace(ChangeBlockEvent.Place event, @Getter("getCause") Cause cause) { | |
Object root = cause.root(); | |
// Growing player-placed trees naturally | |
if (root instanceof LocatableBlock) { | |
event.getTransactions().forEach(trans -> trans.getOriginal().getLocation() | |
.ifPresent(loc -> loc.getExtent().setCreator(loc.getBlockPosition(), null))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment