-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend: Migrate some events to be GenericSkyHanniEvent (#2753)
- Loading branch information
Showing
41 changed files
with
161 additions
and
147 deletions.
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
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
5 changes: 2 additions & 3 deletions
5
src/main/java/at/hannibal2/skyhanni/events/CheckRenderEntityEvent.kt
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package at.hannibal2.skyhanni.events | ||
|
||
import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent | ||
import net.minecraft.client.renderer.culling.ICamera | ||
import net.minecraft.entity.Entity | ||
import net.minecraftforge.fml.common.eventhandler.Cancelable | ||
|
||
@Cancelable | ||
data class CheckRenderEntityEvent<T : Entity>( | ||
val entity: T, | ||
val camera: ICamera, | ||
val camX: Double, | ||
val camY: Double, | ||
val camZ: Double, | ||
) : LorenzEvent() | ||
) : GenericSkyHanniEvent<T>(entity.javaClass) |
7 changes: 4 additions & 3 deletions
7
src/main/java/at/hannibal2/skyhanni/events/DataWatcherUpdatedEvent.kt
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package at.hannibal2.skyhanni.events | ||
|
||
import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent | ||
import net.minecraft.entity.DataWatcher | ||
import net.minecraft.entity.Entity | ||
|
||
data class DataWatcherUpdatedEvent( | ||
val entity: Entity, | ||
data class DataWatcherUpdatedEvent<T : Entity>( | ||
val entity: T, | ||
val updatedEntries: List<DataWatcher.WatchableObject>, | ||
) : LorenzEvent() | ||
) : GenericSkyHanniEvent<T>(entity.javaClass) |
7 changes: 4 additions & 3 deletions
7
src/main/java/at/hannibal2/skyhanni/events/EntityCustomNameUpdateEvent.kt
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package at.hannibal2.skyhanni.events | ||
|
||
import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent | ||
import net.minecraft.entity.Entity | ||
|
||
data class EntityCustomNameUpdateEvent( | ||
data class EntityCustomNameUpdateEvent<T : Entity>( | ||
val entity: T, | ||
val newName: String?, | ||
val entity: Entity, | ||
) : LorenzEvent() | ||
) : GenericSkyHanniEvent<T>(entity.javaClass) |
7 changes: 4 additions & 3 deletions
7
src/main/java/at/hannibal2/skyhanni/events/EntityEquipmentChangeEvent.kt
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
10 changes: 7 additions & 3 deletions
10
src/main/java/at/hannibal2/skyhanni/events/EntityMoveEvent.kt
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package at.hannibal2.skyhanni.events | ||
|
||
import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent | ||
import at.hannibal2.skyhanni.utils.LorenzVec | ||
import net.minecraft.client.Minecraft | ||
import net.minecraft.entity.Entity | ||
|
||
class EntityMoveEvent( | ||
val entity: Entity, | ||
class EntityMoveEvent<T : Entity>( | ||
val entity: T, | ||
val oldLocation: LorenzVec, | ||
val newLocation: LorenzVec, | ||
val distance: Double, | ||
) : LorenzEvent() | ||
) : GenericSkyHanniEvent<T>(entity.javaClass) { | ||
val isLocalPlayer by lazy { entity == Minecraft.getMinecraft().thePlayer } | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/at/hannibal2/skyhanni/events/entity/EntityDisplayNameEvent.kt
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package at.hannibal2.skyhanni.events.entity | ||
|
||
import at.hannibal2.skyhanni.events.LorenzEvent | ||
import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent | ||
import net.minecraft.entity.Entity | ||
import net.minecraft.util.ChatComponentText | ||
|
||
class EntityDisplayNameEvent(val entity: Entity, var chatComponent: ChatComponentText) : LorenzEvent() | ||
class EntityDisplayNameEvent<T : Entity>(val entity: T, var chatComponent: ChatComponentText) : GenericSkyHanniEvent<T>(entity.javaClass) |
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
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
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.