From c410a2d9fcc0fb27b77b0462a3a61e4ecb9d8ac0 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 6 Jul 2014 16:07:49 -0400 Subject: [PATCH] Added Javadoc comments for Forge Event documentation. --- .../minecraftforge/event/CommandEvent.java | 17 +++++ .../minecraftforge/event/ServerChatEvent.java | 17 +++++ .../event/brewing/PotionBrewedEvent.java | 13 ++++ .../event/entity/EntityEvent.java | 47 +++++++++++++- .../event/entity/EntityJoinWorldEvent.java | 14 +++++ .../entity/EntityStruckByLightningEvent.java | 14 +++++ .../event/entity/PlaySoundAtEntityEvent.java | 18 ++++++ .../entity/living/LivingAttackEvent.java | 18 ++++++ .../event/entity/living/LivingDeathEvent.java | 19 +++++- .../event/entity/living/LivingDropsEvent.java | 21 ++++++- .../event/entity/living/LivingEvent.java | 37 ++++++++++- .../event/entity/living/LivingFallEvent.java | 16 +++++ .../event/entity/living/LivingHurtEvent.java | 18 ++++++ .../living/LivingSetAttackTargetEvent.java | 16 +++++ .../event/entity/living/LivingSpawnEvent.java | 27 ++++++++ .../event/entity/living/ZombieEvent.java | 33 +++++++++- .../minecart/MinecartCollisionEvent.java | 13 ++++ .../event/entity/minecart/MinecartEvent.java | 9 +++ .../minecart/MinecartInteractEvent.java | 17 +++++ .../entity/minecart/MinecartUpdateEvent.java | 15 +++++ .../event/entity/player/ArrowLooseEvent.java | 15 +++++ .../event/entity/player/ArrowNockEvent.java | 14 +++++ .../entity/player/AttackEntityEvent.java | 14 +++++ .../entity/player/EntityInteractEvent.java | 15 +++++ .../entity/player/PlayerDestroyItemEvent.java | 19 ++++++ .../event/entity/player/PlayerEvent.java | 62 +++++++++++++++++++ .../entity/player/PlayerInteractEvent.java | 25 ++++++++ .../entity/player/PlayerSleepInBedEvent.java | 14 +++++ .../event/terraingen/BiomeEvent.java | 29 +++++++++ .../event/terraingen/DecorateBiomeEvent.java | 24 ++++++- .../event/terraingen/OreGenEvent.java | 54 ++++++++++++++-- .../event/terraingen/PopulateChunkEvent.java | 61 ++++++++++++++++-- .../terraingen/SaplingGrowTreeEvent.java | 21 +++++-- .../event/terraingen/WorldTypeEvent.java | 40 ++++++++++++ .../event/world/ChunkDataEvent.java | 33 +++++++++- .../event/world/ChunkEvent.java | 34 +++++++++- .../event/world/ChunkWatchEvent.java | 32 ++++++++++ .../event/world/WorldEvent.java | 54 +++++++++++++++- 38 files changed, 933 insertions(+), 26 deletions(-) diff --git a/src/main/java/net/minecraftforge/event/CommandEvent.java b/src/main/java/net/minecraftforge/event/CommandEvent.java index 9559a38b1..daaab6a02 100644 --- a/src/main/java/net/minecraftforge/event/CommandEvent.java +++ b/src/main/java/net/minecraftforge/event/CommandEvent.java @@ -5,6 +5,23 @@ import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; +/** + * CommandEvent is fired whenever a command is scheduled to be executed. + * This event is fired during the invocation of CommandHandler#executeCommand(ICommandSender, String) + * and ClientCommandHandler#executeCommand(ICommandSender, String).
+ *
+ * {@link #command} contains the instance of ICommand which is representative of the currently executing command.
+ * {@link #sender} contains the instance of ICommandSender for the given command sender.
+ * {@link #parameters} contains the arguments passed for the command execution.
+ * {@link #exception} begins null, but can be populated with an exception to be thrown within the command.
+ *
+ * This event is {@link Cancelable}.
+ * If the event is canceled, the execution of the command does not occur.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ @Cancelable public class CommandEvent extends Event { diff --git a/src/main/java/net/minecraftforge/event/ServerChatEvent.java b/src/main/java/net/minecraftforge/event/ServerChatEvent.java index 2444ee3d7..e1a112dfa 100644 --- a/src/main/java/net/minecraftforge/event/ServerChatEvent.java +++ b/src/main/java/net/minecraftforge/event/ServerChatEvent.java @@ -5,6 +5,23 @@ import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.ChatComponentTranslation; +/** + * ServerChatEvent is fired whenever a C01PacketChatMessage is processed.
+ * This event is fired via {@link ForgeHooks#onServerChatEvent(net.minecraft.network.NetHandlerPlayServer, String, ChatComponentTranslation)}, + * which is executed by the NetHandlerPlayServer#processChatMessage(net.minecraft.network.play.client.C01PacketChatMessage)
+ *
+ * {@link #username} contains the username of the player sending the chat message.
+ * {@link #message} contains the message being sent.
+ * {@link #player} the instance of EntityPlayerMP for the player sending the chat message.
+ * {@link #component} contains the instance of ChatComponentTranslation for the sent message.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the chat message is never distributed to all clients.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class ServerChatEvent extends Event { diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java index 1864a220b..4af282589 100644 --- a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java +++ b/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java @@ -3,6 +3,19 @@ package net.minecraftforge.event.brewing; import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.item.ItemStack; +/** + * PotionBrewedEvent is fired when a potion is brewed in the brewing stand. + *
+ * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
+ *
+ * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class PotionBrewedEvent extends Event { /** diff --git a/src/main/java/net/minecraftforge/event/entity/EntityEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityEvent.java index 3a6ac4335..740821b1e 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityEvent.java @@ -3,6 +3,15 @@ package net.minecraftforge.event.entity; import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.Entity; +/** + * EntityEvent is fired when an event involving any Entity occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #entity} contains the entity that caused this event to occur.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class EntityEvent extends Event { public final Entity entity; @@ -11,7 +20,17 @@ public class EntityEvent extends Event { this.entity = entity; } - + + /** + * EntityConstructing is fired when an Entity is being created.
+ * This event is fired within the constructor of the Entity.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class EntityConstructing extends EntityEvent { public EntityConstructing(Entity entity) @@ -20,6 +39,19 @@ public class EntityEvent extends Event } } + /** + * CanUpdate is fired when an Entity is being created.
+ * This event is fired whenever vanilla Minecraft determines that an entity
+ * cannot update in World#updateEntityWithOptionalForce(net.minecraft.entity.Entity, boolean)
+ *
+ * {@link CanUpdate#canUpdate} contains the boolean value of whether this entity can update.
+ * If the modder decides that this Entity can be updated, they may change canUpdate to true,
+ * and the entity with then be updated.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class CanUpdate extends EntityEvent { public boolean canUpdate = false; @@ -28,7 +60,18 @@ public class EntityEvent extends Event super(entity); } } - + + /** + * EnteringChunk is fired when an Entity enters a chunk.
+ * This event is fired whenever vanilla Minecraft determines that an entity
+ * is entering a chunk in Chunk#addEntity(net.minecraft.entity.Entity)
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult} + *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class EnteringChunk extends EntityEvent { public int newChunkX; diff --git a/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java index 7a317a6b7..cab6a57a0 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java @@ -4,6 +4,20 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.Entity; import net.minecraft.world.World; +/** + * EntityJoinWorldEvent is fired when an Entity joins the world.
+ * This event is fired whenever an Entity is added to the world in + * World#addLoadedEntities(java.util.List), World#joinEntityInSurroundings(Entity), and World#spawnEntityInWorld(Entity).
+ *
+ * {@link #world} contains the world in which the entity is to join.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity is not added to the world.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class EntityJoinWorldEvent extends EntityEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java index f6898c6bf..c8b412b8e 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java @@ -4,6 +4,20 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.Entity; import net.minecraft.entity.effect.EntityLightningBolt; +/** + * EntityStruckByLightningEvent is fired when an Entity is about to be struck by lightening.
+ * This event is fired whenever an EntityLightningBolt is updated to strike an Entity in + * EntityLightningBolt#onUpdate() via {@link ForgeEventFactory#onEntityStruckByLightning(Entity, EntityLightningBolt)}.
+ *
+ * {@link #lightning} contains the instance of EntityLightningBolt attempting to strike an entity.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity is not struck by the lightening.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ @Cancelable public class EntityStruckByLightningEvent extends EntityEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java b/src/main/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java index 8e0ce19db..a7408eed1 100644 --- a/src/main/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java @@ -3,6 +3,24 @@ package net.minecraftforge.event.entity; import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.Entity; +/** + * PlaySoundAtEntityEvent is fired a sound is to be played at an Entity
+ * This event is fired whenever a sound is set to be played at an Entity such as in + * EntityPlayerSP#playSound(String, float, float), World#playSoundAtEntity(Entity, String, float, float), + * and World#playerSoundToNearExcept(EntityPlayer, String, float, float).
+ *
+ * {@link #name} contains the name of the sound to be played at the Entity.
+ * {@link #volume} contains the volume at which the sound is to be played.
+ * {@link #pitch} contains the pitch at which the sound is to be played.
+ * Changing the {@link #name} field will cause the sound of this name to be played instead of the originally intended sound.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the sound is not played.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ @Cancelable public class PlaySoundAtEntityEvent extends EntityEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java index ad4537178..9221ceb6c 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java @@ -4,6 +4,24 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.util.DamageSource; import net.minecraft.entity.EntityLivingBase; +/** + * LivingAttackEvent is fired when a living Entity is attacked.
+ * This event is fired whenever an Entity is attacked in + * EntityLivingBase#attackEntityFrom(DamageSource, float) and + * EntityPlayer#attackEntityFrom(DamageSource, float).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingAttack(EntityLivingBase, DamageSource, float)}.
+ *
+ * {@link #source} contains the DamageSource of the attack.
+ * {@link #amount} contains the amount of damage dealt to the entity.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity does not take attack damage.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class LivingAttackEvent extends LivingEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java index 4adb0330f..a7f58658f 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java @@ -4,6 +4,24 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.util.DamageSource; import net.minecraft.entity.EntityLivingBase; +/** + * LivingDeathEvent is fired when an Entity dies.
+ * This event is fired whenever an Entity dies in + * EntityLivingBase#onDeath(DamageSource), + * EntityPlayer#onDeath(DamageSource), and + * EntityPlayerMP#onDeath(DamageSource).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingDeath(EntityLivingBase, DamageSource)}.
+ *
+ * {@link #source} contains the DamageSource that caused the entity to die.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity does not die.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class LivingDeathEvent extends LivingEvent { @@ -13,5 +31,4 @@ public class LivingDeathEvent extends LivingEvent super(entity); this.source = source; } - } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java index 9ad66eb84..b72ecc1ad 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java @@ -3,11 +3,30 @@ package net.minecraftforge.event.entity.living; import java.util.ArrayList; import cpw.mods.fml.common.eventhandler.Cancelable; - import net.minecraft.util.DamageSource; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.EntityLivingBase; +/** + * LivingDropsEvent is fired when an Entity's death causes dropped items to appear.
+ * This event is fired whenever an Entity dies and drops items in + * EntityLivingBase#onDeath(DamageSource).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingDrops(EntityLivingBase, DamageSource, ArrayList, int, boolean, int)}.
+ *
+ * {@link #source} contains the DamageSource that caused the drop to occur.
+ * {@link #drops} contains the ArrayList of EntityItems that will be dropped.
+ * {@link #lootingLevel} contains the amount of loot that will be dropped.
+ * {@link #recentlyHit} determines whether the Entity doing the drop has recently been damaged.
+ * {@link #specialDropValue} contains the special drop value for this even.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity does not drop anything.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class LivingDropsEvent extends LivingEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java index 056ba57fb..086c841a1 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java @@ -4,6 +4,13 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.event.entity.EntityEvent; +/** + * LivingEvent is fired whenever an event involving Living entities occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class LivingEvent extends EntityEvent { public final EntityLivingBase entityLiving; @@ -13,12 +20,40 @@ public class LivingEvent extends EntityEvent entityLiving = entity; } + /** + * LivingUpdateEvent is fired when an Entity is updated.
+ * This event is fired whenever an Entity is updated in + * EntityLivingBase#onUpdate().
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingUpdate(EntityLivingBase)}.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity does not update.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public static class LivingUpdateEvent extends LivingEvent { public LivingUpdateEvent(EntityLivingBase e){ super(e); } } - + + /** + * LivingJumpEvent is fired when an Entity jumps.
+ * This event is fired whenever an Entity jumps in + * EntityLivingBase#jump(), EntityMagmaCube#jump(), + * and EntityHorse#jump().
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingJump(EntityLivingBase)}.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public static class LivingJumpEvent extends LivingEvent { public LivingJumpEvent(EntityLivingBase e){ super(e); } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java index b4d03b9dc..4364720ac 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java @@ -3,6 +3,22 @@ package net.minecraftforge.event.entity.living; import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.EntityLivingBase; +/** + * LivingFallEvent is fired when an Entity is set to be falling.
+ * This event is fired whenever an Entity is set to fall in + * EntityLivingBase#fall(float).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingFall(EntityLivingBase, float)}.
+ *
+ * {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F. + *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity does not fall.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class LivingFallEvent extends LivingEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java index d7850483a..8fffe682a 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java @@ -4,6 +4,24 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.util.DamageSource; import net.minecraft.entity.EntityLivingBase; +/** + * LivingHurtEvent is fired when an Entity is set to be hurt.
+ * This event is fired whenever an Entity is hurt in + * EntityLivingBase#damageEntity(DamageSource, float) and + * EntityPlayer#damageEntity(DamageSource, float).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingHurt(EntityLivingBase, DamageSource, float)}.
+ *
+ * {@link #source} contains the DamageSource that caused this Entity to be hurt.
+ * {@link #amount} contains the amount of damage dealt to the Entity that was hurt.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity is not hurt.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class LivingHurtEvent extends LivingEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java index efff5ec2f..ec73c406e 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java @@ -2,6 +2,22 @@ package net.minecraftforge.event.entity.living; import net.minecraft.entity.EntityLivingBase; +/** + * LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.
+ * This event is fired whenever an Entity sets a target to attack in + * EntityLiving#setAttackTarget(EntityLivingBase) and + * EntityLivingBase#setRevengeTarget(EntityLivingBase).
+ *
+ * This event is fired via the {@link ForgeHooks#onLivingSetAttackTarget(EntityLivingBase, EntityLivingBase)}.
+ *
+ * {@link #target} contains the newly targeted Entity.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class LivingSetAttackTargetEvent extends LivingEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java index 818a14173..56c9c3656 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java @@ -1,9 +1,22 @@ package net.minecraftforge.event.entity.living; import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.entity.EntityLiving; import net.minecraft.world.World; +/** + * LivingSpawnEvent is fired whenever a living Entity is spawned.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #world} contains the world in which this living Entity is being spawned.
+ * {@link #x} contains the x-coordinate this entity is being spawned at.
+ * {@link #y} contains the y-coordinate this entity is being spawned at.
+ * {@link #z} contains the z-coordinate this entity is being spawned at.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class LivingSpawnEvent extends LivingEvent { public final World world; @@ -38,6 +51,20 @@ public class LivingSpawnEvent extends LivingEvent } } + /** + * SpecialSpawn is fired when an Entity is to be spawned from a mob spawner.
+ * This event is fired whenever an Entity is spawned in a mob spawner in
+ * SpawnerAnimals#findChunksForSpawning(WorldServer, boolean, boolean, boolean).
+ *
+ * This event is fired via the {@link ForgeHooks#doSpecialSpawn(EntityLiving, World, float, float, float)}.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the Entity is not spawned.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public static class SpecialSpawn extends LivingSpawnEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java b/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java index bc9238615..7dffe1df3 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java @@ -1,10 +1,18 @@ package net.minecraftforge.event.entity.living; +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.world.World; import net.minecraftforge.event.entity.EntityEvent; +/** + * ZombieEvent is fired whenever a zombie is spawned for aid. + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class. + * + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class ZombieEvent extends EntityEvent { public ZombieEvent(EntityZombie entity) @@ -16,7 +24,30 @@ public class ZombieEvent extends EntityEvent { { return (EntityZombie) entity; } - + + /** + * SummonAidEvent is fired when a Zombie Entity is summoned. + * This event is fired whenever a Zombie Entity is summoned in + * EntityZombie#attackEntityFrom(DamageSource, float). + * + * This event is fired via the {@link ForgeHooks#fireZombieSummonAid(EntityZombie, World, int, int, int, EntityLivingBase, double)}. + * + * {@link #customSummonedAid} remains null, but can be populated with a custom EntityZombie which will be spawned. + * {@link #world} contains the world that this summoning is occurring in. + * {@link #x} contains the x-coordinate at which this summoning event is occurring. + * {@link #y} contains the y-coordinate at which this summoning event is occurring. + * {@link #z} contains the z-coordinate at which this summoning event is occurring. + * {@link #attacker} contains the living Entity that attacked and caused this event to fire. + * {@link #summonChance} contains the likelihood that a Zombie would successfully be summoned. + * + * This event is not {@link Cancelable}. + * + * This event has a result. {@link HasResult} + * {@link Result#ALLOW} Zombie is summoned. + * {@link Result#DENY} Zombie is not summoned. + * + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @HasResult public static class SummonAidEvent extends ZombieEvent { /** diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java index a3b086714..76e7cbfb5 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java @@ -3,6 +3,19 @@ package net.minecraftforge.event.entity.minecart; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityMinecart; +/** + * MinecartCollisionEvent is fired when a minecart collides with an Entity. + * This event is fired whenever a minecraft collides in + * EntityMinecart#applyEntityCollision(Entity). + * + * {@link #collider} contains the Entity the Minecart collided with. + * + * This event is not {@link Cancelable}. + * + * This event does not have a result. {@link HasResult} + * + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class MinecartCollisionEvent extends MinecartEvent { public final Entity collider; diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java index bf0af6b79..7d445fcde 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java @@ -3,6 +3,15 @@ package net.minecraftforge.event.entity.minecart; import net.minecraft.entity.item.EntityMinecart; import net.minecraftforge.event.entity.EntityEvent; +/** + * MinecartEvent is fired whenever an event involving minecart entities occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will
+ * receive every child event of this class.
+ *
+ * {@link #minecart} contains the minecart entity involved with this event.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class MinecartEvent extends EntityEvent { public final EntityMinecart minecart; diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java index 8d31e3f2d..d03ebc31a 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java @@ -4,6 +4,23 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.entity.player.EntityPlayer; +/** + * MinecartInteractEvent is fired when a player interacts with a minecart.
+ * This event is fired whenever a player interacts with a minecart in + * EntityMinecartContainer#interactFirst(EntityPlayer), + * EntityMinecartEmpty#interactFirst(EntityPlayer) + * EntityMinecartFurnace#interactFirst(EntityPlayer) + * EntityMinecartHopper#interactFirst(EntityPlayer).
+ *
+ * {@link #player} contains the EntityPlayer that is involved with this minecart interaction.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not interact with the minecart.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class MinecartInteractEvent extends MinecartEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java index f7cbf518c..1ecef40e1 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java @@ -2,6 +2,21 @@ package net.minecraftforge.event.entity.minecart; import net.minecraft.entity.item.EntityMinecart; +/** + * MinecartUpdateEvent is fired when a minecart is updated.
+ * This event is fired whenever a minecart is updated in + * EntityMinecart#onUpdate().
+ *
+ * {@link #x} contains the x-coordinate of the minecart Entity.
+ * {@link #y} contains the y-coordinate of the minecart Entity.
+ * {@link #z} contains the z-coordinate of the minecart Entity.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class MinecartUpdateEvent extends MinecartEvent { public final float x; diff --git a/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java index 3dee68af0..427452bdb 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java @@ -4,6 +4,21 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +/** + * ArrowLooseEvent is fired when a player stops using a bow.
+ * This event is fired whenever a player stops using a bow in + * ItemBow#onPlayerStoppedUsing(ItemStack, World, EntityPlayer, int).
+ *
+ * {@link #bow} contains the ItemBow ItemStack that was used in this event.
+ * {@link #charge} contains the value for how much the player had charged before stopping the shot.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not stop using the bow.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class ArrowLooseEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java index 771d7423f..5f01cb31d 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java @@ -4,6 +4,20 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +/** + * ArrowNockEvent is fired when a player begins using a bow.
+ * This event is fired whenever a player begins using a bow in + * ItemBow#onItemRightClick(ItemStack, World, EntityPlayer).
+ *
+ * {@link #result} contains the resulting ItemStack due to the use of the bow.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not begin using the bow.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class ArrowNockEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java b/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java index f49171103..ff4ac7c0b 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java @@ -4,6 +4,20 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +/** + * AttackEntityEvent is fired when a player attacks an Entity.
+ * This event is fired whenever a player attacks an Entity in + * EntityPlayer#attackTargetEntityWithCurrentItem(Entity).
+ *
+ * {@link #target} contains the Entity that was damaged by the player.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not attack the Entity.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class AttackEntityEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java b/src/main/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java index 0c750f9c5..d1635a33c 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java @@ -1,9 +1,24 @@ package net.minecraftforge.event.entity.player; import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +/** + * EntityInteractEvent is fired when a player interacts with an Entity.
+ * This event is fired whenever a player interacts with an Entity in + * EntityPlayer#interactWith(Entity).
+ *
+ * {@link #target} contains the Entity the player interacted with.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not interact with the Entity.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class EntityInteractEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java index 471fafbe4..3477d36cb 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java @@ -1,8 +1,27 @@ package net.minecraftforge.event.entity.player; +import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +/** + * PlayerDestroyItemEvent is fired when a player destroys an item.
+ * This event is fired whenever a player destroys an item in + * PlayerControllerMP#onPlayerRightClick(EntityPlayer, World, ItemStack, int, int, int, int, Vec3), + * PlayerControllerMP#sendUseItem(EntityPlayer, World, ItemStack), + * EntityPlayer#destroyCurrentEquippedItem(), + * SlotCrafting#onPickupFromSlot(EntityPlayer, ItemStack), + * ItemInWorldManager#tryUseItem(EntityPlayer, World, ItemStack), + * and ItemInWorldManager#activateBlockOrUseItem(EntityPlayer, World, ItemStack, int, int, int, int, float, float, float).
+ *
+ * {@link #original} contains the original ItemStack before the item was destroyed.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class PlayerDestroyItemEvent extends PlayerEvent { public final ItemStack original; diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java index fbbc8556a..e282fb5b7 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java @@ -1,12 +1,20 @@ package net.minecraftforge.event.entity.player; import java.io.File; + import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.living.LivingEvent; +/** + * PlayerEvent is fired whenever an event involving Living entities occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class PlayerEvent extends LivingEvent { public final EntityPlayer entityPlayer; @@ -16,6 +24,22 @@ public class PlayerEvent extends LivingEvent entityPlayer = player; } + /** + * HarvestCheck is fired when a player attempts to harvest a block.
+ * This event is fired whenever a player attempts to harvest a block in + * EntityPlayer#canHarvestBlock(Block).
+ *
+ * This event is fired via the {@link ForgeEventFactory#doPlayerHarvestCheck(EntityPlayer, Block, boolean)}.
+ *
+ * {@link #block} contains the Block that is being checked for harvesting.
+ * {@link #success} contains the boolean value for whether the Block will be successfully harvested.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public static class HarvestCheck extends PlayerEvent { public final Block block; @@ -29,6 +53,28 @@ public class PlayerEvent extends LivingEvent } } + /** + * BreakSpeed is fired when a player attempts to harvest a block.
+ * This event is fired whenever a player attempts to harvest a block in + * EntityPlayer#canHarvestBlock(Block).
+ *
+ * This event is fired via the {@link ForgeEventFactory#getBreakSpeed(EntityPlayer, Block, int, float, int, int, int)}.
+ *
+ * {@link #block} contains the block being broken.
+ * {@link #metadata} contains the metadata of the block being broken.
+ * {@link #originalSpeed} contains the original speed at which the player broke the block.
+ * {@link #newSpeed} contains the newSpeed at which the player will break the block.
+ * {@link #x} contains the x-coordinate at which this event is occurring.
+ * {@link #y} contains the y-coordinate at which this event is occurring.
+ * {@link #z} contains the z-coordinate at which this event is occurring.
+ *
+ * This event is {@link Cancelable}.
+ * If it is canceled, the player is unable to break the block.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public static class BreakSpeed extends PlayerEvent { @@ -59,6 +105,22 @@ public class PlayerEvent extends LivingEvent } } + /** + * NameFormat is fired when a player's display name is retrieved.
+ * This event is fired whenever a player's name is retrieved in + * EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().
+ *
+ * This event is fired via the {@link ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String)}.
+ *
+ * {@link #username} contains the username of the player. + * {@link #displayname} contains the display name of the player. + *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult} + *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public static class NameFormat extends PlayerEvent { public final String username; diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java index 41ac206d6..1a369c2d2 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java @@ -6,6 +6,31 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.eventhandler.Cancelable; +/** + * PlayerInteractEvent is fired when a player interacts in some way. + *
+ * This event is fired whenever a player interacts in + * Minecraft#func_147121_ag(), + * NetHandlerPlayServer#processPlayerBlockPlacement(C08PacketPlayerBlockPlacement), + * ItemInWorldManager#activateBlockOrUseItem(EntityPlayer, World, ItemStack, int, int, int, int, float, float, float), + * ItemInWorldManager#onBlockClicked(int, int, int, int).
+ *
+ * This event is fired via the {@link ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, int, int, int, int)}. + *
+ * {@link #action} contains the Action the player performed durin this interaction.
+ * {@link #x} contains the x-coordinate of where this event occurred.
+ * {@link #y} contains the y-coordinate of where this event occurred.
+ * {@link #z} contains the z-coordinate of where this event occurred.
+ * {@link #face} contains the face of the block that was interacted with.
+ * {@link #world} contains the world in which this event is occurring.
+ *
+ * This event is {@link Cancelable}.
+ * If this event is canceled, the player does not interact.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ @Cancelable public class PlayerInteractEvent extends PlayerEvent { diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java index abd29ea7e..59b29d797 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java @@ -3,6 +3,20 @@ package net.minecraftforge.event.entity.player; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer.EnumStatus; +/** + * PlayerSleepInBedEvent is fired when a player sleeps in a bed. + *
+ * This event is fired whenever a player sleeps in a bed in + * EntityPlayer#sleepInBedAt(int, int, int).
+ *
+ * {@link #result} contains whether the player is able to sleep.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult} + *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ public class PlayerSleepInBedEvent extends PlayerEvent { public EnumStatus result = null; diff --git a/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java index 6b8d5cc7e..8dbd86ee1 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java @@ -1,10 +1,18 @@ package net.minecraftforge.event.terraingen; import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.block.Block; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; +/** + * BiomeEvent is fired whenever an event involving biomes occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ public class BiomeEvent extends Event { public final BiomeGenBase biome; @@ -14,6 +22,20 @@ public class BiomeEvent extends Event this.biome = biome; } + /** + * CreateDecorator is fired when a BiomeDecorator is created.
+ * This event is fired whenever a BiomeDecorator is created in + * DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).
+ *
+ * {@link #originalBiomeDecorator} contains the original BiomeDecorator that would be used in vanilla. + * {@link #newBiomeDecorator} contains the new BiomeDecoration to be used by Minecraft. + *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult} + *
+ * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ public static class CreateDecorator extends BiomeEvent { public final BiomeDecorator originalBiomeDecorator; @@ -27,6 +49,13 @@ public class BiomeEvent extends Event } } + /** + * BiomeColor is fired whenever an event involving biome colors occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ public static class BiomeColor extends BiomeEvent { public final int originalColor; diff --git a/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java index 9d9e2894c..ad8af5e52 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java @@ -3,9 +3,25 @@ package net.minecraftforge.event.terraingen; import java.util.Random; import cpw.mods.fml.common.eventhandler.Event; - +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.world.World; +/**DecorateBiomeEvent is fired when a BiomeDecorator is created. + *
+ * This event is fired whenever a BiomeDecorator is created in + * DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).
+ *
+ * {@link #world} contains the world that is being decorated.
+ * {@link #rand} contains an instane of Random to be used.
+ * {@link #chunkX} contains the x-coordinate of the Chunk being decorated.
+ * {@link #chunkZ} contains the z-coordinate of the Chunk being decorated.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult} + *
+ * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ public class DecorateBiomeEvent extends Event { public final World world; @@ -21,6 +37,9 @@ public class DecorateBiomeEvent extends Event this.chunkZ = worldZ; } + /** + * This event is fired before a chunk is decorated with a biome feature. + */ public static class Pre extends DecorateBiomeEvent { public Pre(World world, Random rand, int worldX, int worldZ) @@ -29,6 +48,9 @@ public class DecorateBiomeEvent extends Event } } + /** + * This event is fired after a chunk is decorated with a biome feature. + */ public static class Post extends DecorateBiomeEvent { public Post(World world, Random rand, int worldX, int worldZ) diff --git a/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java b/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java index 422bbc4a0..004e4ab2c 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java @@ -3,10 +3,22 @@ package net.minecraftforge.event.terraingen; import java.util.Random; import cpw.mods.fml.common.eventhandler.Event; - +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; +/** + * OreGenEvent is fired when an event involving ore generation occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #world} contains the world this event is occurring in.
+ * {@link #rand} contains an instance of random that can be used in this event.
+ * {@link #worldX} contains the x-coordinate of the block position currently being populated with ores.
+ * {@link #worldZ} contains the z-coordinate of the block position currently being populated with ores.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#ORE_GEN_BUS}.
+ **/ public class OreGenEvent extends Event { public final World world; @@ -22,6 +34,17 @@ public class OreGenEvent extends Event this.worldZ = worldZ; } + /** + * OreGenEvent.Pre is fired just before a chunk is populated with ores.
+ * This event is fired just before ore generation in + * BiomeDecorator#generateOres().
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
+ **/ public static class Pre extends OreGenEvent { public Pre(World world, Random rand, int worldX, int worldZ) @@ -30,6 +53,17 @@ public class OreGenEvent extends Event } } + /** + * OreGenEvent.Post is fired just after a chunk is populated with ores.
+ * This event is fired just after ore generation in + * BiomeDecorator#generateOres().
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
+ **/ public static class Post extends OreGenEvent { public Post(World world, Random rand, int worldX, int worldZ) @@ -39,10 +73,20 @@ public class OreGenEvent extends Event } /** - * This event is fired when an ore is generated in a chunk. - * - * You can set the result to DENY to prevent the default ore generation. - */ + * GenerateMinable is fired when a mineable block is generated in a chunk.
+ * This event is fired just after ore generation in + * BiomeDecorator#generateOres().
+ *
+ * {@link #type} contains the enum value for the Ore attempting to be generated.
+ * {@link #generator} contains the WorldGenerator generating this ore.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event has a result. {@link HasResult}
+ * This result determines whether the ore is allowed to be generated.
+ *
+ * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
+ **/ @HasResult public static class GenerateMinable extends OreGenEvent { diff --git a/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java b/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java index f72844b2b..4e5572261 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java @@ -2,9 +2,24 @@ package net.minecraftforge.event.terraingen; import java.util.Random; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +/** + * PopulateChunkEvent is fired when an event involving chunk terrain feature population occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #world} contains the world this event is occurring in.
+ * {@link #rand} contains an instance of random that can be used in this event.
+ * {@link #chunkX} contains the x-coordinate of the chunk currently being populated with a terrain feature.
+ * {@link #chunkZ} contains the z-coordinate of the chunk currently being populated with ores.
+ * {@link #hasVillageGenerated} contains the boolean value stating if the chunk already has a village spawned in it.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}, except {@link Populate}, which fires on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
+ **/ public class PopulateChunkEvent extends ChunkProviderEvent { public final World world; @@ -23,6 +38,19 @@ public class PopulateChunkEvent extends ChunkProviderEvent this.hasVillageGenerated = hasVillageGenerated; } + /** + * PopulateChunkEvent.Pre is fired just before a chunk is populated a terrain feature.
+ * This event is fired just before terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Pre extends PopulateChunkEvent { public Pre(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) @@ -31,6 +59,19 @@ public class PopulateChunkEvent extends ChunkProviderEvent } } + /** + * PopulateChunkEvent.Post is fired just after a chunk is populated with a terrain feature.
+ * This event is fired just after terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Post extends PopulateChunkEvent { public Post(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) @@ -40,11 +81,21 @@ public class PopulateChunkEvent extends ChunkProviderEvent } /** - * This event is fired when a chunk is populated with a terrain feature. - * - * You can set the result to DENY to prevent the default generation - * of a terrain feature. - */ + * PopulateChunkEvent.Populate is fired when a chunk is populated with a terrain feature.
+ * This event is fired during terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
+ *
+ * {@link #type} contains the enum value for the terrain feature being generated.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event has a result. {@link HasResult}
+ * This result determines if the chunk is populated with the terrain feature.
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ @HasResult public static class Populate extends PopulateChunkEvent { diff --git a/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java index b054981c1..a11a650e3 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java @@ -3,15 +3,26 @@ package net.minecraftforge.event.terraingen; import java.util.Random; import cpw.mods.fml.common.eventhandler.Event.HasResult; - import net.minecraft.world.World; import net.minecraftforge.event.world.WorldEvent; /** - * This event is fired when a sapling grows a tree. - * - * You can set the result to DENY to prevent the default tree growth. - */ + * SaplingGrowTreeEvent is fired when a spling grows into a tree.
+ * This event is fired during sapling growth in + * BlockSapling#func_149878_d(World, int, int, int, Random).
+ *
+ * {@link #x} contains the x-coordinate of the growing sapling.
+ * {@link #y} contains the y-coordinate of the growing sapling.
+ * {@link #z} contains the z-coordinate of the growing sapling.
+ * {@link #rand} contains an instance of Random for use.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event has a result. {@link HasResult}
+ * This result determines if the sapling is allowed to grow.
+ *
+ * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
+ **/ @HasResult public class SaplingGrowTreeEvent extends WorldEvent { diff --git a/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java index 3c22fd62c..6badfc203 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java @@ -4,6 +4,15 @@ import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.WorldType; +/** + * WorldTypeEvent is fired when an event involving the world occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #worldType} contains the WorldType of the world this event is occurring in.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
+ **/ public class WorldTypeEvent extends Event { public final WorldType worldType; @@ -13,6 +22,21 @@ public class WorldTypeEvent extends Event this.worldType = worldType; } + /** + * BiomeSize is fired when vanilla Minecraft attempts to generate biomes.
+ * This event is fired during biome generation in + * GenLayer#initializeAllBiomeGenerators(long, WorldType).
+ *
+ * {@link #originalSize} the original size of the Biome.
+ * {@link #newSize} the new size of the biome. Initially set to the {@link #originalSize}.
+ * If {@link #newSize} is set to a new value, that value will be used for the Biome size.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
+ **/ public static class BiomeSize extends WorldTypeEvent { public final byte originalSize; @@ -26,6 +50,22 @@ public class WorldTypeEvent extends Event } } + /** + * InitBiomeGens is fired when vanilla Minecraft attempts to initialize the biome generators.
+ * This event is fired just during biome generator initialization in + * WorldChunkManager#WorldChunkManager(long, WorldType).
+ *
+ * {@link #seed} the seed of the world.
+ * {@link #originalBiomeGens} the array of GenLayers original intended for this Biome generation.
+ * {@link #newBiomeGens} the array of GenLayers that will now be used for this Biome generation.
+ * If {@link #newBiomeGens} is set to a new value, that value will be used for the Biome generator.
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
+ **/ public static class InitBiomeGens extends WorldTypeEvent { public final long seed; diff --git a/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java b/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java index 21550a685..d9bc6588a 100644 --- a/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java +++ b/src/main/java/net/minecraftforge/event/world/ChunkDataEvent.java @@ -3,6 +3,15 @@ package net.minecraftforge.event.world; import net.minecraft.world.chunk.Chunk; import net.minecraft.nbt.NBTTagCompound; +/** + * ChunkDataEvent is fired when an event involving chunk data occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #data} contains the NBTTagCompound containing the chunk data for this event.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class ChunkDataEvent extends ChunkEvent { private final NBTTagCompound data; @@ -18,6 +27,17 @@ public class ChunkDataEvent extends ChunkEvent return data; } + /** + * ChunkDataEvent.Load is fired when vanilla Minecraft attempts to load Chunk data.
+ * This event is fired during chunk loading in + * ChunkIOProvider#callStage2(QueuedChunk, Chunk).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Load extends ChunkDataEvent { public Load(Chunk chunk, NBTTagCompound data) @@ -25,7 +45,18 @@ public class ChunkDataEvent extends ChunkEvent super(chunk, data); } } - + + /** + * ChunkDataEvent.Save is fired when vanilla Minecraft attempts to save Chunk data.
+ * This event is fired during chunk saving in + * AnvilChunkLoader#saveChunk(World, Chunk).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Save extends ChunkDataEvent { public Save(Chunk chunk, NBTTagCompound data) diff --git a/src/main/java/net/minecraftforge/event/world/ChunkEvent.java b/src/main/java/net/minecraftforge/event/world/ChunkEvent.java index 64251830f..1309eba6f 100644 --- a/src/main/java/net/minecraftforge/event/world/ChunkEvent.java +++ b/src/main/java/net/minecraftforge/event/world/ChunkEvent.java @@ -2,6 +2,15 @@ package net.minecraftforge.event.world; import net.minecraft.world.chunk.Chunk; +/** + * ChunkEvent is fired when an event involving a chunk occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #chunk} contains the Chunk this event is affecting.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class ChunkEvent extends WorldEvent { private final Chunk chunk; @@ -17,6 +26,18 @@ public class ChunkEvent extends WorldEvent return chunk; } + /** + * ChunkEvent.Load is fired when vanilla Minecraft attempts to load a Chunk into the world.
+ * This event is fired during chunk loading in
+ * ChunkProviderClient#loadChunk(int, int),
+ * Chunk.onChunkLoad().
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Load extends ChunkEvent { public Load(Chunk chunk) @@ -24,7 +45,18 @@ public class ChunkEvent extends WorldEvent super(chunk); } } - + + /** + * ChunkEvent.Unload is fired when vanilla Minecraft attempts to unload a Chunk from the world.
+ * This event is fired during chunk unloading in
+ * Chunk.onChunkUnload().
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Unload extends ChunkEvent { public Unload(Chunk chunk) diff --git a/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java b/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java index 6f156bdac..438493b9e 100644 --- a/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java +++ b/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java @@ -4,6 +4,16 @@ import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.entity.player.EntityPlayerMP; +/** + * ChunkWatchEvent is fired when an event involving a chunk being watched occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #chunk} contains the ChunkCoordIntPair of the Chunk this event is affecting.
+ * {@link #player} contains the EntityPlayer that is involved with this chunk being watched.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class ChunkWatchEvent extends Event { public final ChunkCoordIntPair chunk; @@ -15,11 +25,33 @@ public class ChunkWatchEvent extends Event this.player = player; } + /** + * ChunkWatchEvent.Watch is fired when an EntityPlayer begins watching a chunk.
+ * This event is fired when a chunk is added to the watched chunks of an EntityPlayer in + * EntityPlayerMP#onUpdate().
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Watch extends ChunkWatchEvent { public Watch(ChunkCoordIntPair chunk, EntityPlayerMP player) { super(chunk, player); } } + /** + * ChunkWatchEvent.UnWatch is fired when an EntityPlayer stops watching a chunk.
+ * This event is fired when a chunk is removed from the watched chunks of an EntityPlayer in + * PlayerInstance#removePlayer(EntityPlayerMP).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class UnWatch extends ChunkWatchEvent { public UnWatch(ChunkCoordIntPair chunkLocation, EntityPlayerMP player) { super(chunkLocation, player); } diff --git a/src/main/java/net/minecraftforge/event/world/WorldEvent.java b/src/main/java/net/minecraftforge/event/world/WorldEvent.java index 9e9dae136..3a420338a 100644 --- a/src/main/java/net/minecraftforge/event/world/WorldEvent.java +++ b/src/main/java/net/minecraftforge/event/world/WorldEvent.java @@ -3,12 +3,21 @@ package net.minecraftforge.event.world; import java.util.ArrayList; import java.util.List; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +/** + * WorldEvent is fired when an event involving the world occurs.
+ * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
+ *
+ * {@link #world} contains the World this event is occuring in.
+ *
+ * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public class WorldEvent extends Event { public final World world; @@ -18,16 +27,57 @@ public class WorldEvent extends Event this.world = world; } + /** + * WorldEvent.Load is fired when Minecraft loads a world.
+ * This event is fired when a world is loaded in + * WorldClient#WorldClient(NetHandlerPlayClient, WorldSettings, int, EnumDifficulty, Profiler), + * MinecraftServer#loadAllWorlds(String, String, long, WorldType, String), + * DimensionManager#initDimension(int), + * and ForgeInternalHandler#onDimensionLoad(Load).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Load extends WorldEvent { public Load(World world) { super(world); } } + /** + * WorldEvent.Unload is fired when Minecraft unloads a world.
+ * This event is fired when a world is unloaded in + * Minecraft#loadWorld(WorldClient, String), + * MinecraftServer#deleteWorldAndStopServer(), + * MinecraftServer#stopServer(), + * DimensionManager#unloadWorlds(Hashtable), + * ForgeInternalHandler#onDimensionUnload(Unload).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Unload extends WorldEvent { public Unload(World world) { super(world); } } + /** + * WorldEvent.Save is fired when Minecraft saves a world.
+ * This event is fired when a world is saved in + * WorldServer#saveAllChunks(boolean, IProgressUpdate), + * ForgeInternalHandler#onDimensionSave(Save).
+ *
+ * This event is not {@link Cancelable}.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
+ **/ public static class Save extends WorldEvent { public Save(World world) { super(world); }