Added Javadoc comments for Forge Event documentation.

This commit is contained in:
Alex 2014-07-06 16:07:49 -04:00
parent 0705670f1d
commit c410a2d9fc
38 changed files with 933 additions and 26 deletions

View File

@ -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). <br>
* <br>
* {@link #command} contains the instance of ICommand which is representative of the currently executing command.<br>
* {@link #sender} contains the instance of ICommandSender for the given command sender.<br>
* {@link #parameters} contains the arguments passed for the command execution.<br>
* {@link #exception} begins null, but can be populated with an exception to be thrown within the command.<br>
* <br>
* This event is {@link Cancelable}. <br>
* If the event is canceled, the execution of the command does not occur.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
@Cancelable
public class CommandEvent extends Event
{

View File

@ -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. <br>
* 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)<br>
* <br>
* {@link #username} contains the username of the player sending the chat message.<br>
* {@link #message} contains the message being sent.<br>
* {@link #player} the instance of EntityPlayerMP for the player sending the chat message.<br>
* {@link #component} contains the instance of ChatComponentTranslation for the sent message.<br>
* <br>
* This event is {@link Cancelable}. <br>
* If this event is canceled, the chat message is never distributed to all clients.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class ServerChatEvent extends Event
{

View File

@ -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.
* <br>
* The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.<br>
* <br>
* {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public class PotionBrewedEvent extends Event
{
/**

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #entity} contains the entity that caused this event to occur.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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. <br>
* This event is fired within the constructor of the Entity.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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. <br>
* This event is fired whenever vanilla Minecraft determines that an entity<br>
* cannot update in World#updateEntityWithOptionalForce(net.minecraft.entity.Entity, boolean) <br>
* <br>
* {@link CanUpdate#canUpdate} contains the boolean value of whether this entity can update.<br>
* If the modder decides that this Entity can be updated, they may change canUpdate to true, <br>
* and the entity with then be updated.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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. <br>
* This event is fired whenever vanilla Minecraft determines that an entity <br>
* is entering a chunk in Chunk#addEntity(net.minecraft.entity.Entity) <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class EnteringChunk extends EntityEvent
{
public int newChunkX;

View File

@ -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. <br>
* 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). <br>
* <br>
* {@link #world} contains the world in which the entity is to join.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity is not added to the world.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class EntityJoinWorldEvent extends EntityEvent
{

View File

@ -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.<br>
* This event is fired whenever an EntityLightningBolt is updated to strike an Entity in
* EntityLightningBolt#onUpdate() via {@link ForgeEventFactory#onEntityStruckByLightning(Entity, EntityLightningBolt)}.<br>
* <br>
* {@link #lightning} contains the instance of EntityLightningBolt attempting to strike an entity.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity is not struck by the lightening.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
@Cancelable
public class EntityStruckByLightningEvent extends EntityEvent
{

View File

@ -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<br>
* 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).<br>
* <br>
* {@link #name} contains the name of the sound to be played at the Entity.<br>
* {@link #volume} contains the volume at which the sound is to be played.<br>
* {@link #pitch} contains the pitch at which the sound is to be played.<br>
* Changing the {@link #name} field will cause the sound of this name to be played instead of the originally intended sound.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the sound is not played.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
@Cancelable
public class PlaySoundAtEntityEvent extends EntityEvent
{

View File

@ -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. <br>
* This event is fired whenever an Entity is attacked in
* EntityLivingBase#attackEntityFrom(DamageSource, float) and
* EntityPlayer#attackEntityFrom(DamageSource, float). <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingAttack(EntityLivingBase, DamageSource, float)}.<br>
* <br>
* {@link #source} contains the DamageSource of the attack. <br>
* {@link #amount} contains the amount of damage dealt to the entity. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not take attack damage.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
*<br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class LivingAttackEvent extends LivingEvent
{

View File

@ -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. <br>
* This event is fired whenever an Entity dies in
* EntityLivingBase#onDeath(DamageSource),
* EntityPlayer#onDeath(DamageSource), and
* EntityPlayerMP#onDeath(DamageSource). <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingDeath(EntityLivingBase, DamageSource)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused the entity to die. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not die.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* 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;
}
}

View File

@ -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.<br>
* This event is fired whenever an Entity dies and drops items in
* EntityLivingBase#onDeath(DamageSource).<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingDrops(EntityLivingBase, DamageSource, ArrayList<EntityItem>, int, boolean, int)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused the drop to occur.<br>
* {@link #drops} contains the ArrayList of EntityItems that will be dropped.<br>
* {@link #lootingLevel} contains the amount of loot that will be dropped.<br>
* {@link #recentlyHit} determines whether the Entity doing the drop has recently been damaged.<br>
* {@link #specialDropValue} contains the special drop value for this even.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not drop anything.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class LivingDropsEvent extends LivingEvent
{

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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. <br>
* This event is fired whenever an Entity is updated in
* EntityLivingBase#onUpdate(). <br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingUpdate(EntityLivingBase)}.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not update.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* 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.<br>
* This event is fired whenever an Entity jumps in
* EntityLivingBase#jump(), EntityMagmaCube#jump(),
* and EntityHorse#jump().<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingJump(EntityLivingBase)}.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public static class LivingJumpEvent extends LivingEvent
{
public LivingJumpEvent(EntityLivingBase e){ super(e); }

View File

@ -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.<br>
* This event is fired whenever an Entity is set to fall in
* EntityLivingBase#fall(float).<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingFall(EntityLivingBase, float)}.<br>
* <br>
* {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F.
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity does not fall.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class LivingFallEvent extends LivingEvent
{

View File

@ -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. <br>
* This event is fired whenever an Entity is hurt in
* EntityLivingBase#damageEntity(DamageSource, float) and
* EntityPlayer#damageEntity(DamageSource, float).<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingHurt(EntityLivingBase, DamageSource, float)}.<br>
* <br>
* {@link #source} contains the DamageSource that caused this Entity to be hurt. <br>
* {@link #amount} contains the amount of damage dealt to the Entity that was hurt. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity is not hurt.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class LivingHurtEvent extends LivingEvent
{

View File

@ -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.<br>
* This event is fired whenever an Entity sets a target to attack in
* EntityLiving#setAttackTarget(EntityLivingBase) and
* EntityLivingBase#setRevengeTarget(EntityLivingBase).<br>
* <br>
* This event is fired via the {@link ForgeHooks#onLivingSetAttackTarget(EntityLivingBase, EntityLivingBase)}.<br>
* <br>
* {@link #target} contains the newly targeted Entity.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public class LivingSetAttackTargetEvent extends LivingEvent
{

View File

@ -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. <br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the world in which this living Entity is being spawned.<br>
* {@link #x} contains the x-coordinate this entity is being spawned at.<br>
* {@link #y} contains the y-coordinate this entity is being spawned at.<br>
* {@link #z} contains the z-coordinate this entity is being spawned at.<br>
* <br>
* 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.<br>
* This event is fired whenever an Entity is spawned in a mob spawner in<br>
* SpawnerAnimals#findChunksForSpawning(WorldServer, boolean, boolean, boolean).<br>
* <br>
* This event is fired via the {@link ForgeHooks#doSpecialSpawn(EntityLiving, World, float, float, float)}.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the Entity is not spawned.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public static class SpecialSpawn extends LivingSpawnEvent
{

View File

@ -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 {
/**

View File

@ -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;

View File

@ -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. <br>
* If a method utilizes this {@link Event} as its parameter, the method will <br>
* receive every child event of this class.<br>
* <br>
* {@link #minecart} contains the minecart entity involved with this event.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public class MinecartEvent extends EntityEvent
{
public final EntityMinecart minecart;

View File

@ -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. <br>
* This event is fired whenever a player interacts with a minecart in
* EntityMinecartContainer#interactFirst(EntityPlayer),
* EntityMinecartEmpty#interactFirst(EntityPlayer)
* EntityMinecartFurnace#interactFirst(EntityPlayer)
* EntityMinecartHopper#interactFirst(EntityPlayer).<br>
* <br>
* {@link #player} contains the EntityPlayer that is involved with this minecart interaction.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not interact with the minecart.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class MinecartInteractEvent extends MinecartEvent
{

View File

@ -2,6 +2,21 @@ package net.minecraftforge.event.entity.minecart;
import net.minecraft.entity.item.EntityMinecart;
/**
* MinecartUpdateEvent is fired when a minecart is updated.<br>
* This event is fired whenever a minecart is updated in
* EntityMinecart#onUpdate().<br>
* <br>
* {@link #x} contains the x-coordinate of the minecart Entity.<br>
* {@link #y} contains the y-coordinate of the minecart Entity.<br>
* {@link #z} contains the z-coordinate of the minecart Entity.<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public class MinecartUpdateEvent extends MinecartEvent
{
public final float x;

View File

@ -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.<br>
* This event is fired whenever a player stops using a bow in
* ItemBow#onPlayerStoppedUsing(ItemStack, World, EntityPlayer, int).<br>
* <br>
* {@link #bow} contains the ItemBow ItemStack that was used in this event.<br>
* {@link #charge} contains the value for how much the player had charged before stopping the shot.<br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not stop using the bow.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class ArrowLooseEvent extends PlayerEvent
{

View File

@ -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.<br>
* This event is fired whenever a player begins using a bow in
* ItemBow#onItemRightClick(ItemStack, World, EntityPlayer).<br>
* <br>
* {@link #result} contains the resulting ItemStack due to the use of the bow. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not begin using the bow.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class ArrowNockEvent extends PlayerEvent
{

View File

@ -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.<br>
* This event is fired whenever a player attacks an Entity in
* EntityPlayer#attackTargetEntityWithCurrentItem(Entity).<br>
* <br>
* {@link #target} contains the Entity that was damaged by the player. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not attack the Entity.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class AttackEntityEvent extends PlayerEvent
{

View File

@ -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.<br>
* This event is fired whenever a player interacts with an Entity in
* EntityPlayer#interactWith(Entity).<br>
* <br>
* {@link #target} contains the Entity the player interacted with. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not interact with the Entity.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class EntityInteractEvent extends PlayerEvent
{

View File

@ -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.<br>
* 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).<br>
* <br>
* {@link #original} contains the original ItemStack before the item was destroyed. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public class PlayerDestroyItemEvent extends PlayerEvent
{
public final ItemStack original;

View File

@ -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. <br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* 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.<br>
* This event is fired whenever a player attempts to harvest a block in
* EntityPlayer#canHarvestBlock(Block).<br>
* <br>
* This event is fired via the {@link ForgeEventFactory#doPlayerHarvestCheck(EntityPlayer, Block, boolean)}.<br>
* <br>
* {@link #block} contains the Block that is being checked for harvesting. <br>
* {@link #success} contains the boolean value for whether the Block will be successfully harvested. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* 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.<br>
* This event is fired whenever a player attempts to harvest a block in
* EntityPlayer#canHarvestBlock(Block).<br>
* <br>
* This event is fired via the {@link ForgeEventFactory#getBreakSpeed(EntityPlayer, Block, int, float, int, int, int)}.<br>
* <br>
* {@link #block} contains the block being broken. <br>
* {@link #metadata} contains the metadata of the block being broken. <br>
* {@link #originalSpeed} contains the original speed at which the player broke the block. <br>
* {@link #newSpeed} contains the newSpeed at which the player will break the block. <br>
* {@link #x} contains the x-coordinate at which this event is occurring. <br>
* {@link #y} contains the y-coordinate at which this event is occurring. <br>
* {@link #z} contains the z-coordinate at which this event is occurring. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If it is canceled, the player is unable to break the block.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* 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.<br>
* This event is fired whenever a player's name is retrieved in
* EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().<br>
* <br>
* This event is fired via the {@link ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String)}.<br>
* <br>
* {@link #username} contains the username of the player.
* {@link #displayname} contains the display name of the player.
* <br>
* This event is not {@link Cancelable}.
* <br>
* This event does not have a result. {@link HasResult}
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public static class NameFormat extends PlayerEvent
{
public final String username;

View File

@ -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.
* <br>
* 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). <br>
* <br>
* This event is fired via the {@link ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, int, int, int, int)}.
* <br>
* {@link #action} contains the Action the player performed durin this interaction. <br>
* {@link #x} contains the x-coordinate of where this event occurred. <br>
* {@link #y} contains the y-coordinate of where this event occurred. <br>
* {@link #z} contains the z-coordinate of where this event occurred. <br>
* {@link #face} contains the face of the block that was interacted with. <br>
* {@link #world} contains the world in which this event is occurring. <br>
* <br>
* This event is {@link Cancelable}.<br>
* If this event is canceled, the player does not interact.<br>
* <br>
* This event does not have a result. {@link HasResult}<br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
@Cancelable
public class PlayerInteractEvent extends PlayerEvent
{

View File

@ -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.
* <br>
* This event is fired whenever a player sleeps in a bed in
* EntityPlayer#sleepInBedAt(int, int, int).<br>
* <br>
* {@link #result} contains whether the player is able to sleep. <br>
* <br>
* This event is not {@link Cancelable}.
* <br>
* This event does not have a result. {@link HasResult}
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/
public class PlayerSleepInBedEvent extends PlayerEvent
{
public EnumStatus result = null;

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* 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.<br>
* This event is fired whenever a BiomeDecorator is created in
* DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).<br>
* <br>
* {@link #originalBiomeDecorator} contains the original BiomeDecorator that would be used in vanilla.
* {@link #newBiomeDecorator} contains the new BiomeDecoration to be used by Minecraft.
* <br>
* This event is not {@link Cancelable}.
* <br>
* This event does not have a result. {@link HasResult}
* <br>
* 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. <br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
**/
public static class BiomeColor extends BiomeEvent
{
public final int originalColor;

View File

@ -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.
* <br>
* This event is fired whenever a BiomeDecorator is created in
* DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).<br>
* <br>
* {@link #world} contains the world that is being decorated. <br>
* {@link #rand} contains an instane of Random to be used. <br>
* {@link #chunkX} contains the x-coordinate of the Chunk being decorated. <br>
* {@link #chunkZ} contains the z-coordinate of the Chunk being decorated. <br>
* <br>
* This event is not {@link Cancelable}.
* <br>
* This event does not have a result. {@link HasResult}
* <br>
* 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)

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the world this event is occurring in.<br>
* {@link #rand} contains an instance of random that can be used in this event.<br>
* {@link #worldX} contains the x-coordinate of the block position currently being populated with ores.<br>
* {@link #worldZ} contains the z-coordinate of the block position currently being populated with ores.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#ORE_GEN_BUS}.<br>
**/
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.<br>
* This event is fired just before ore generation in
* BiomeDecorator#generateOres().<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.<br>
**/
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.<br>
* This event is fired just after ore generation in
* BiomeDecorator#generateOres().<br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.<br>
**/
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.<br>
* This event is fired just after ore generation in
* BiomeDecorator#generateOres().<br>
* <br>
* {@link #type} contains the enum value for the Ore attempting to be generated.<br>
* {@link #generator} contains the WorldGenerator generating this ore. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event has a result. {@link HasResult} <br>
* This result determines whether the ore is allowed to be generated.<br>
* <br>
* This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.<br>
**/
@HasResult
public static class GenerateMinable extends OreGenEvent
{

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the world this event is occurring in.<br>
* {@link #rand} contains an instance of random that can be used in this event.<br>
* {@link #chunkX} contains the x-coordinate of the chunk currently being populated with a terrain feature.<br>
* {@link #chunkZ} contains the z-coordinate of the chunk currently being populated with ores.<br>
* {@link #hasVillageGenerated} contains the boolean value stating if the chunk already has a village spawned in it.<br>
* <br>
* 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}.<br>
**/
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.<br>
* 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). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* 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). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* 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). <br>
* <br>
* {@link #type} contains the enum value for the terrain feature being generated. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event has a result. {@link HasResult} <br>
* This result determines if the chunk is populated with the terrain feature. <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
@HasResult
public static class Populate extends PopulateChunkEvent
{

View File

@ -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.<br>
* This event is fired during sapling growth in
* BlockSapling#func_149878_d(World, int, int, int, Random).<br>
* <br>
* {@link #x} contains the x-coordinate of the growing sapling. <br>
* {@link #y} contains the y-coordinate of the growing sapling. <br>
* {@link #z} contains the z-coordinate of the growing sapling. <br>
* {@link #rand} contains an instance of Random for use. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event has a result. {@link HasResult} <br>
* This result determines if the sapling is allowed to grow. <br>
* <br>
* This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.<br>
**/
@HasResult
public class SaplingGrowTreeEvent extends WorldEvent
{

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #worldType} contains the WorldType of the world this event is occurring in.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.<br>
**/
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.<br>
* This event is fired during biome generation in
* GenLayer#initializeAllBiomeGenerators(long, WorldType). <br>
* <br>
* {@link #originalSize} the original size of the Biome. <br>
* {@link #newSize} the new size of the biome. Initially set to the {@link #originalSize}. <br>
* If {@link #newSize} is set to a new value, that value will be used for the Biome size. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.<br>
**/
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.<br>
* This event is fired just during biome generator initialization in
* WorldChunkManager#WorldChunkManager(long, WorldType). <br>
* <br>
* {@link #seed} the seed of the world. <br>
* {@link #originalBiomeGens} the array of GenLayers original intended for this Biome generation. <br>
* {@link #newBiomeGens} the array of GenLayers that will now be used for this Biome generation. <br>
* If {@link #newBiomeGens} is set to a new value, that value will be used for the Biome generator. <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.<br>
**/
public static class InitBiomeGens extends WorldTypeEvent
{
public final long seed;

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #data} contains the NBTTagCompound containing the chunk data for this event.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired during chunk loading in
* ChunkIOProvider#callStage2(QueuedChunk, Chunk). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired during chunk saving in
* AnvilChunkLoader#saveChunk(World, Chunk). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class Save extends ChunkDataEvent
{
public Save(Chunk chunk, NBTTagCompound data)

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #chunk} contains the Chunk this event is affecting.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired during chunk loading in <br>
* ChunkProviderClient#loadChunk(int, int), <br>
* Chunk.onChunkLoad(). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired during chunk unloading in <br>
* Chunk.onChunkUnload(). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class Unload extends ChunkEvent
{
public Unload(Chunk chunk)

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #chunk} contains the ChunkCoordIntPair of the Chunk this event is affecting.<br>
* {@link #player} contains the EntityPlayer that is involved with this chunk being watched. <br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired when a chunk is added to the watched chunks of an EntityPlayer in
* EntityPlayerMP#onUpdate(). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* This event is fired when a chunk is removed from the watched chunks of an EntityPlayer in
* PlayerInstance#removePlayer(EntityPlayerMP). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class UnWatch extends ChunkWatchEvent
{
public UnWatch(ChunkCoordIntPair chunkLocation, EntityPlayerMP player) { super(chunkLocation, player); }

View File

@ -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.<br>
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the World this event is occuring in.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
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.<br>
* 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). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class Load extends WorldEvent
{
public Load(World world) { super(world); }
}
/**
* WorldEvent.Unload is fired when Minecraft unloads a world.<br>
* This event is fired when a world is unloaded in
* Minecraft#loadWorld(WorldClient, String),
* MinecraftServer#deleteWorldAndStopServer(),
* MinecraftServer#stopServer(),
* DimensionManager#unloadWorlds(Hashtable<Integer, long[]>),
* ForgeInternalHandler#onDimensionUnload(Unload). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class Unload extends WorldEvent
{
public Unload(World world) { super(world); }
}
/**
* WorldEvent.Save is fired when Minecraft saves a world.<br>
* This event is fired when a world is saved in
* WorldServer#saveAllChunks(boolean, IProgressUpdate),
* ForgeInternalHandler#onDimensionSave(Save). <br>
* <br>
* This event is not {@link Cancelable}.<br>
* <br>
* This event does not have a result. {@link HasResult} <br>
* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/
public static class Save extends WorldEvent
{
public Save(World world) { super(world); }