Fix some formatting in CraftEventFactory

This commit is contained in:
md_5 2017-11-22 17:05:59 +11:00
parent bdb8822625
commit f46ccd7637

View File

@ -349,14 +349,14 @@ public class CraftEventFactory {
return event; return event;
} }
public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) { public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) {
ThrownPotion thrownPotion = (ThrownPotion) potion.getBukkitEntity(); ThrownPotion thrownPotion = (ThrownPotion) potion.getBukkitEntity();
AreaEffectCloud effectCloud = (AreaEffectCloud) cloud.getBukkitEntity(); AreaEffectCloud effectCloud = (AreaEffectCloud) cloud.getBukkitEntity();
LingeringPotionSplashEvent event = new LingeringPotionSplashEvent(thrownPotion, effectCloud); LingeringPotionSplashEvent event = new LingeringPotionSplashEvent(thrownPotion, effectCloud);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
return event; return event;
} }
/** /**
* BlockFadeEvent * BlockFadeEvent
@ -589,7 +589,7 @@ public class CraftEventFactory {
private static final Function<? super Double, Double> ZERO = Functions.constant(-0.0); private static final Function<? super Double, Double> ZERO = Functions.constant(-0.0);
public static EntityDamageEvent handleLivingEntityDamageEvent(Entity damagee, DamageSource source, double rawDamage, double hardHatModifier, double blockingModifier, double armorModifier, double resistanceModifier, double magicModifier, double absorptionModifier, Function<Double, Double> hardHat, Function<Double, Double> blocking, Function<Double, Double> armor, Function<Double, Double> resistance, Function<Double, Double> magic, Function<Double, Double> absorption) { public static EntityDamageEvent handleLivingEntityDamageEvent(Entity damagee, DamageSource source, double rawDamage, double hardHatModifier, double blockingModifier, double armorModifier, double resistanceModifier, double magicModifier, double absorptionModifier, Function<Double, Double> hardHat, Function<Double, Double> blocking, Function<Double, Double> armor, Function<Double, Double> resistance, Function<Double, Double> magic, Function<Double, Double> absorption) {
Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class); Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<DamageModifier, Function<? super Double, Double>>(DamageModifier.class); Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<DamageModifier, Function<? super Double, Double>>(DamageModifier.class);
modifiers.put(DamageModifier.BASE, rawDamage); modifiers.put(DamageModifier.BASE, rawDamage);
modifierFunctions.put(DamageModifier.BASE, ZERO); modifierFunctions.put(DamageModifier.BASE, ZERO);
@ -668,7 +668,7 @@ public class CraftEventFactory {
if (!event.isCancelled()) { if (!event.isCancelled()) {
state.update(true); state.update(true);
} }
return !event.isCancelled(); return !event.isCancelled();
} }
@ -856,18 +856,18 @@ public class CraftEventFactory {
org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity(); org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity();
IgniteCause cause; IgniteCause cause;
switch (bukkitIgniter.getType()) { switch (bukkitIgniter.getType()) {
case ENDER_CRYSTAL: case ENDER_CRYSTAL:
cause = IgniteCause.ENDER_CRYSTAL; cause = IgniteCause.ENDER_CRYSTAL;
break; break;
case LIGHTNING: case LIGHTNING:
cause = IgniteCause.LIGHTNING; cause = IgniteCause.LIGHTNING;
break; break;
case SMALL_FIREBALL: case SMALL_FIREBALL:
case FIREBALL: case FIREBALL:
cause = IgniteCause.FIREBALL; cause = IgniteCause.FIREBALL;
break; break;
default: default:
cause = IgniteCause.FLINT_AND_STEEL; cause = IgniteCause.FLINT_AND_STEEL;
} }
BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter); BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter);
@ -1037,7 +1037,7 @@ public class CraftEventFactory {
} }
public static EntityBreedEvent callEntityBreedEvent(EntityLiving child, EntityLiving mother, EntityLiving father, EntityLiving breeder, ItemStack bredWith, int experience) { public static EntityBreedEvent callEntityBreedEvent(EntityLiving child, EntityLiving mother, EntityLiving father, EntityLiving breeder, ItemStack bredWith, int experience) {
org.bukkit.entity.LivingEntity breederEntity = (LivingEntity)(breeder == null ? null : breeder.getBukkitEntity()); org.bukkit.entity.LivingEntity breederEntity = (LivingEntity) (breeder == null ? null : breeder.getBukkitEntity());
CraftItemStack bredWithStack = bredWith == null ? null : CraftItemStack.asCraftMirror(bredWith).clone(); CraftItemStack bredWithStack = bredWith == null ? null : CraftItemStack.asCraftMirror(bredWith).clone();
EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience); EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience);