forked from iChun/Morph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some Morph events for cancellation by other mods.
- Loading branch information
Showing
5 changed files
with
61 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package morph.api; | ||
|
||
import cpw.mods.fml.common.eventhandler.Cancelable; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
|
||
@Cancelable | ||
public class MorphAcquiredEvent extends PlayerEvent | ||
{ | ||
public final EntityLivingBase acquiredMorph; | ||
|
||
public MorphAcquiredEvent(EntityPlayer player, EntityLivingBase acquired) | ||
{ | ||
super(player); | ||
acquiredMorph = acquired; | ||
} | ||
} |
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,23 @@ | ||
package morph.api; | ||
|
||
import cpw.mods.fml.common.eventhandler.Cancelable; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
|
||
@Cancelable | ||
public class MorphEvent extends PlayerEvent | ||
{ | ||
//Can be null | ||
public final EntityLivingBase prevMorph; | ||
|
||
//Will never be null | ||
public final EntityLivingBase morph; | ||
|
||
public MorphEvent(EntityPlayer player, EntityLivingBase prevMorph, EntityLivingBase morph) | ||
{ | ||
super(player); | ||
this.prevMorph = prevMorph; | ||
this.morph = morph; | ||
} | ||
} |
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