-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add methods for CreakingHeart #12095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Doc94
wants to merge
28
commits into
PaperMC:main
Choose a base branch
from
Doc94:feature/creaking-heart-methods
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
4612a03
add methods for CreakingHeart
Doc94 118322a
missing behaviour for make the creaking protect the block
Doc94 e6c49d6
fix typo in precondition
Doc94 f4da53b
add CreakingHeart#spreadResin()
Doc94 b0208e3
add methods for max distance of Creaking attached
Doc94 b140241
handle spawn with the limits of distance for avoid bucle of spawn-dea…
Doc94 0fdd0d6
remove new line in final
Doc94 3b3e4ea
fix CreakingHeart#spawnCreaking() annotation
Doc94 0e41c51
update logic for spawn creaking protector in creaking heart
Doc94 668816f
Revert "update logic for spawn creaking protector in creaking heart"
Doc94 c720b5c
use correct tag definition and only save if value its not default van…
Doc94 970fe67
add apinote to CreakingHeart#spreadResin() for events being called
Doc94 274c9db
[ci skip] rename api method for removal distance
Doc94 15856eb
Rename methods for Creaking remove distance
Doc94 3e7ebfb
Fix 1.21.5 renames
Doc94 5207493
Better check for null level in spawnCreaking
Doc94 667a741
Allow 0 for the CreakingRemovalDistance
Doc94 c7250e4
Use requirePlaced
Doc94 a317f6d
Reduce added methods in NMS patches
Doc94 ab301a2
Add fallback distanceCreakingTooFar when tag is missing
Doc94 179a9a0
CreakingHeartBlockEntity.java.patch fix for renames
Doc94 75c07d9
Merge branch 'main' of github.com:PaperMC/Paper into feature/creaking…
Doc94 d7064ca
Fix spreadResin method signature
Doc94 4c7dcbb
Remove the reason why this was stuck in first place
Doc94 2480369
Handle changes since last update
Doc94 d469eb5
Merge branch 'main' of github.com:PaperMC/Paper into feature/creaking…
Doc94 a7c8d23
Cleanup for CraftCreakingHeart
Doc94 1ba6628
minor tweaks
Warriorrrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
paper-api/src/main/java/org/bukkit/block/CreakingHeart.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,46 @@ | ||
| package org.bukkit.block; | ||
|
|
||
| import org.bukkit.Location; | ||
| import org.bukkit.entity.Creaking; | ||
| import org.jspecify.annotations.NullMarked; | ||
| import org.jspecify.annotations.Nullable; | ||
|
|
||
| /** | ||
| * Represents a captured state of a creaking heart. | ||
| */ | ||
| @NullMarked | ||
| public interface CreakingHeart extends TileState { | ||
|
|
||
| /** | ||
| * Gets the creaking protecting this creaking heart. | ||
| * | ||
| * @return the creaking or null if this creaking heart doesn't have a protector. | ||
| */ | ||
| @Nullable Creaking getCreaking(); | ||
|
|
||
| /** | ||
| * Sets the creaking protecting this creaking heart. | ||
| * | ||
| * @param creaking the creaking or null for make this creaking heart don't have protector | ||
| * @throws IllegalArgumentException if the creaking passed it's in another world | ||
| * @throws IllegalStateException if this block state is not placed | ||
| */ | ||
| void setCreaking(@Nullable Creaking creaking); | ||
|
|
||
| /** | ||
| * Attempts to spawn a creaking to protect this creaking heart. | ||
| * | ||
| * @return the {@link Creaking} for protect the creaking heart or null if fails | ||
| * @throws IllegalStateException if this block state is not placed | ||
| */ | ||
| @Nullable Creaking spawnCreaking(); | ||
|
|
||
| /** | ||
| * Attempts to spread resin to adjacent blocks. | ||
| * | ||
| * @apiNote This method triggers events related to a block being modified | ||
| * @return the location of spread resin or null if it cannot spread | ||
|
Doc94 marked this conversation as resolved.
|
||
| * @throws IllegalStateException if this block state is not placed | ||
| */ | ||
| @Nullable Location spreadResin(); | ||
| } | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.