Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.

This commit is contained in:
RainWarrior committed 2016-03-24 22:22:20 +03:00
1 parent 7e4d7077a5
commit a9d23f5e78
133 files changed
+489 -623

No files matched your search

@@ -7,7 +7,7 @@ import net.minecraft.entity.item.EntityItem;
* Event that is fired when an EntityItem's age has reached its maximum
* lifespan. Canceling this event will prevent the EntityItem from being
* flagged as dead, thus staying it's removal from the world. If canceled
* it will add more time to the entitie's life equal to extraLife.
* it will add more time to the entities life equal to extraLife.
*/
@Cancelable
public class ItemExpireEvent extends ItemEvent
@@ -25,12 +25,15 @@ import net.minecraft.entity.EntityLivingBase;
@Cancelable
public class LivingAttackEvent extends LivingEvent
{
public final DamageSource source;
public final float ammount;
public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float ammount)
private final DamageSource source;
private final float amount;
public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float amount)
{
super(entity);
this.source = source;
this.ammount = ammount;
this.amount = amount;
}
public DamageSource getSource() { return source; }
public float getAmount() { return amount; }
}
@@ -1,9 +1,8 @@
package net.minecraftforge.event.entity.living;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
public abstract class LivingEntityUseItemEvent extends LivingEvent
{
@@ -25,13 +25,18 @@ import net.minecraft.entity.EntityLivingBase;
@Cancelable
public class LivingHurtEvent extends LivingEvent
{
public final DamageSource source;
public float ammount;
public LivingHurtEvent(EntityLivingBase entity, DamageSource source, float ammount)
private final DamageSource source;
private float amount;
public LivingHurtEvent(EntityLivingBase entity, DamageSource source, float amount)
{
super(entity);
this.source = source;
this.ammount = ammount;
this.amount = amount;
}
public DamageSource getSource() { return source; }
public float getAmount() { return amount; }
public void setAmount(float amount) { this.amount = amount; }
}
@@ -38,6 +38,7 @@ public class ArrowLooseEvent extends PlayerEvent
}
public ItemStack getBow() { return this.bow; }
public World getWorld() { return this.world; }
public boolean hasAmmo() { return this.hasAmmo; }
public int getCharge() { return this.charge; }
public void setCharge(int charge) { this.charge = charge; }
@@ -31,6 +31,7 @@ public class ArrowNockEvent extends PlayerEvent
}
public ItemStack getBow() { return this.bow; }
public World getWorld() { return this.world; }
public EnumHand getHand() { return this.hand; }
public boolean hasAmmo() { return this.hasAmmo; }
public ActionResult<ItemStack> getAction()
@@ -18,7 +18,7 @@ public class BonemealEvent extends PlayerEvent
* You can also set the result to ALLOW to mark the event as processed
* and use up a bonemeal from the stack but do no further processing.
*
* setResult(ALLOW) is the same as the old setHandeled()
* setResult(ALLOW) is the same as the old setHandled()
*/
public final World world;
@@ -18,7 +18,7 @@ public class FillBucketEvent extends PlayerEvent
* If you set the result to 'ALLOW', it means that you have processed
* the event and wants the basic functionality of adding the new
* ItemStack to your inventory and reducing the stack size to process.
* setResult(ALLOW) is the same as the old setHandeled();
* setResult(ALLOW) is the same as the old setHandled();
*/
private final ItemStack current;
@@ -27,7 +27,7 @@ import net.minecraft.util.EnumHand;
public class PlayerDestroyItemEvent extends PlayerEvent
{
private final ItemStack original;
private final EnumHand hand; // May be null if this player destroies the item by any use besides holding it.
private final EnumHand hand; // May be null if this player destroys the item by any use besides holding it.
public PlayerDestroyItemEvent(EntityPlayer player, ItemStack original, EnumHand hand)
{
super(player);
@@ -9,13 +9,18 @@ import net.minecraft.entity.player.EntityPlayer;
*/
public class PlayerFlyableFallEvent extends PlayerEvent
{
public float distance;
public float multipler;
private float distance;
private float multiplier;
public PlayerFlyableFallEvent(EntityPlayer player, float distance, float multiplier)
{
super(player);
this.distance = distance;
this.multipler = multiplier;
this.multiplier = multiplier;
}
public float getDistance() { return distance;}
public void setDistance(float distance) { this.distance = distance; }
public float getMultiplier() { return multiplier; }
public void setMultiplier(float multiplier) { this.multiplier = multiplier; }
}
@@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
* <br>
* This event is fired via the {@link ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, BlockPos, EnumFacing)}.
* <br>
* {@link #action} contains the Action the player performed durin this interaction. <br>
* {@link #action} contains the Action the player performed during this interaction. <br>
* {@link #pos} contains the coordinate of where this event occurred.<br>
* {@link #face} contains the face of the block that was interacted with. May be null if unknown. <br>
* {@link #world} contains the world in which this event is occurring. <br>
@@ -9,29 +9,35 @@ import net.minecraft.entity.player.EntityPlayer;
*/
public class PlayerWakeUpEvent extends PlayerEvent
{
private final boolean wakeImmediately;
private final boolean updateWorld;
private final boolean setSpawn;
public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediately, boolean updateWorld, boolean setSpawn)
{
super(player);
this.wakeImmediately = wakeImmediately;
this.updateWorld = updateWorld;
this.setSpawn = setSpawn;
}
/**
* Used for the 'wake up animation'.
* This is false if the player is considered 'sleepy' and the overlay should slowly fade away.
*/
public final boolean wakeImmediatly;
public boolean wakeImmediately() { return wakeImmediately; }
/**
* Indicates if the server should be notified of sleeping changes.
* This will only be false if the server is considered 'up to date' already, because, for example, it initiated the call.
*/
public final boolean updateWorld;
public boolean updateWorld() { return updateWorld; }
/**
* Indicates if the player's sleep was considered successful.
* In vanilla, this is used to determine if the spawn chunk is to be set to the bed's position.
*/
public final boolean setSpawn;
public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn)
{
super(player);
this.wakeImmediatly = wakeImmediatly;
this.updateWorld = updateWorld;
this.setSpawn = setSpawn;
}
public boolean shouldSetSpawn() { return setSpawn; }
}
@@ -18,7 +18,7 @@ public class UseHoeEvent extends PlayerEvent
* You can also set the result to ALLOW to mark the event as processed
* and damage the hoe.
*
* setResult(ALLOW) is the same as the old setHandeled();
* setResult(ALLOW) is the same as the old setHandled();
*/
public final ItemStack current;