-
Notifications
You must be signed in to change notification settings - Fork 25
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
Event system with some basic events #45
Conversation
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.
Good start. Had some notes about the events you've created.
}); | ||
|
||
@FunctionalInterface | ||
public interface TardisEntry { |
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.
When this event is fired, we already have an interior dimension registered or created. It would be beneficial for the event to contain the TARDISLevelOperator as they can already fetch the rest of this information from the relevant managers.
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.
Fair enough! Will do so
public interface Land { | ||
void onLand(TardisLevelOperator tardisLevelOperator, LevelAccessor level, BlockPos pos); | ||
} | ||
|
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.
No OnTardisExit?
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.
This is code for the Landing Event? Unless you just used this line to ask why there was no Tardis exit event - and in that case, it's just because I only did 3 events to demonstrate the system
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.
Imagine this was on onEnterTardis
@@ -239,6 +244,9 @@ public void beginFlight() { | |||
} | |||
|
|||
public void endFlight() { | |||
TardisNavLocation lastKnown = operator.getControlManager().getTargetLocation(); | |||
TardisEvents.LAND.invoker().onLand(operator, lastKnown.level, lastKnown.position); |
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.
The TARDIS cannot end a flight until it hasn't met the criteria in line 250. This will act as if the TARDIS is confirmed to be landing.
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.
I will move the invoker
common/src/main/java/whocraft/tardis_refined/api/event/TardisEvents.java
Show resolved
Hide resolved
import whocraft.tardis_refined.client.TardisClientData; | ||
import whocraft.tardis_refined.common.capability.TardisLevelOperator; | ||
import whocraft.tardis_refined.common.dimension.DelayedTeleportData; | ||
import whocraft.tardis_refined.common.dimension.fabric.DimensionHandlerImpl; | ||
import whocraft.tardis_refined.common.tardis.IExteriorShell; |
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.
Clean up imports
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.
Will do!
@@ -0,0 +1,43 @@ | |||
package whocraft.tardis_refined.api.event; |
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.
This class could benefit from documentation, clarifying what each event means.
This adds a event system for other mods APIs
It comes with 3 basic events, Take off, land and Tardis entry