-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
[Feature] Sign rework api (part 1 of 2 for sign rework PR) #706
Open
DerToaster98
wants to merge
56
commits into
APDevTeam:main
Choose a base branch
from
TTE-DevTeam:sign-rework-api
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 23 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
a8a44db
sign rework - add API classes
DerToaster98 766cb8c
utility method to get Rotation by action
DerToaster98 2074d9d
necessary changes to SignTranslateEvent => use components (basically...)
DerToaster98 e4292f1
signListener implementations
DerToaster98 301b0bf
add instance for sign listener
DerToaster98 ff84ee8
add base signs (most basic signs that exist)
DerToaster98 7107633
forgot action import
DerToaster98 df4d4ef
fix getSignWrappers() method for sign => NPE
DerToaster98 f9e1ff6
corrections to BlockFace access
DerToaster98 b6bbdab
more fixes regarding getting the blockface of a sign...
DerToaster98 674c132
NPE prevention
DerToaster98 cb19e75
add TODO note
DerToaster98 bf4c7c9
remove spaces from suffix
DerToaster98 8422b22
Startup correction cherry picked
DerToaster98 221d0f2
correction => if the ident has trailing : => don't add them yourself …
DerToaster98 1e60c83
startup correction
DerToaster98 719a1ec
forgot the space
DerToaster98 956c8c5
crafttype is specified in second, not the third line
DerToaster98 8e1e7c7
typo
DerToaster98 4eda66f
fix information signs not updating
DerToaster98 d9afa5f
comment out debug logs
DerToaster98 19e2171
call update on the state, not on the block...
DerToaster98 6d8b47a
more elegant solution
DerToaster98 94ccf3c
add eventtype enum (to api classes)
DerToaster98 0a7fd09
refactor for eventtype enum (implementations (simple))
DerToaster98 a611a4f
supply eventType and use nullable for sign get access
DerToaster98 be724f9
just call it override
DerToaster98 8c0e50e
add registry base class, implement it, and use it
DerToaster98 8a2af8b
adjust comment
DerToaster98 0bfce90
adjust comment
DerToaster98 17b458e
remove old code
DerToaster98 4a6941a
remove 1.18 signListener
DerToaster98 000d987
fix build errors
DerToaster98 8349dd8
properly implement shouldCancel method (API + examples)
DerToaster98 e0f09d1
add override items and tools
DerToaster98 c68ff55
small tweaks regarding interactions
DerToaster98 e4ecbf9
NPE prevention
DerToaster98 6ab1baa
respect edits with dyecolors, wax, etc
DerToaster98 4a1f985
extract base elements from Cruise sign into a toggle sign
DerToaster98 b697375
update signs after detect
DerToaster98 b4f9032
cancel sign clicks on crafts in all cases
DerToaster98 35ea71e
only cancel when sign is empty
DerToaster98 9653b43
fix override param
DerToaster98 78d19f3
fix subcraft sign creation
DerToaster98 a4e21ec
Merge branch 'APDevTeam:main' into sign-rework-api
DerToaster98 889a5cf
Remote version specific SignListener implementations
DerToaster98 754f22e
adapt to refactoring
DerToaster98 ff1fd2f
use newer method
DerToaster98 ab2ebb7
fix compile errors and remove old code
DerToaster98 8c14dda
apply default text and implement processSignChange
DerToaster98 e864150
correct typo
DerToaster98 8f9ee61
return true
DerToaster98 c722fbb
call stuff for the other side, if that side is a movecraft sign
DerToaster98 ab7ae64
fix compile errors
DerToaster98 9d850ce
add getter for crafttype
DerToaster98 9d35183
check if player actually is the pilot of that craft
DerToaster98 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 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
Movecraft/src/main/java/net/countercraft/movecraft/listener/CraftTypeListener.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package net.countercraft.movecraft.listener; | ||
|
||
import net.countercraft.movecraft.craft.CraftManager; | ||
import net.countercraft.movecraft.events.TypesReloadedEvent; | ||
import net.countercraft.movecraft.sign.AbstractMovecraftSign; | ||
import net.countercraft.movecraft.sign.CraftPilotSign; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
public class CraftTypeListener implements Listener { | ||
|
||
@EventHandler | ||
public void onReload(TypesReloadedEvent event) { | ||
AbstractMovecraftSign.registerCraftPilotSigns(CraftManager.getInstance().getCraftTypes(), CraftPilotSign::new); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove commented out code, Git keeps it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will do that when i work on the fork again