-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds secret horses and their config.
- Adds secret horses, which can be acquired... secretly.
- Loading branch information
BuildTools
committed
Feb 16, 2020
1 parent
aa9df12
commit b2012f8
Showing
3 changed files
with
179 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package com.nevakanezah.horseenhancer.util; | ||
|
||
import org.bukkit.EntityEffect; | ||
import org.bukkit.Location; | ||
import org.bukkit.attribute.Attribute; | ||
import org.bukkit.entity.AbstractHorse; | ||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.potion.PotionEffect; | ||
import org.bukkit.potion.PotionEffectType; | ||
|
||
import com.nevakanezah.horseenhancer.HorseData; | ||
|
||
import net.md_5.bungee.api.ChatColor; | ||
|
||
public class SpecialHorses { | ||
|
||
private SpecialHorses() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Spawn a horse whose parents were maybe a little too close. | ||
* @param loc Location to spawn the new entity | ||
* @param horseData Data container to be attached to the new entity | ||
* @return the newly-spawned horse | ||
*/ | ||
public static AbstractHorse spawnInbred(Location loc, HorseData horseData) { | ||
AbstractHorse horse = (AbstractHorse)loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE_HORSE); | ||
horseData.setUniqueID(horse.getUniqueId()); | ||
horseData.setType(EntityType.ZOMBIE_HORSE); | ||
|
||
horse.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0.1); | ||
horse.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(10); | ||
horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).setBaseValue(0.3); | ||
horse.setTamed(true); | ||
horse.setAge(-9999999); | ||
horse.setAgeLock(true); | ||
horse.setBreed(false); | ||
|
||
horseData.setGender("INBRED"); | ||
|
||
return horse; | ||
} | ||
|
||
public static AbstractHorse spawnMaximule(Location loc, HorseData horseData) { | ||
AbstractHorse horse = (AbstractHorse)loc.getWorld().spawnEntity(loc, EntityType.MULE); | ||
horseData.setUniqueID(horse.getUniqueId()); | ||
horseData.setType(EntityType.MULE); | ||
|
||
horse.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0.35); | ||
horse.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(35); | ||
horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).setBaseValue(1.18); | ||
horse.setCustomName(ChatColor.DARK_RED + "MA"+ ChatColor.GOLD + "XI" + ChatColor.DARK_BLUE + "MU" + ChatColor.DARK_GREEN + "LE"); | ||
horse.setBreed(false); | ||
horse.setAge(0); | ||
horse.setAgeLock(true); | ||
horse.playEffect(EntityEffect.FIREWORK_EXPLODE); | ||
|
||
horseData.setGender("UNIQUE"); | ||
|
||
return horse; | ||
} | ||
|
||
public static AbstractHorse spawnInvincible(Location loc, HorseData horseData) { | ||
AbstractHorse horse = (AbstractHorse)loc.getWorld().spawnEntity(loc, EntityType.HORSE); | ||
horseData.setUniqueID(horse.getUniqueId()); | ||
horseData.setType(EntityType.HORSE); | ||
|
||
horse.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0.38); | ||
horse.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(15); | ||
horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).setBaseValue(0.565); | ||
horse.setCustomName(ChatColor.DARK_BLUE + "Invincible"); | ||
horse.setAge(0); | ||
horse.setAgeLock(true); | ||
horse.setTamed(true); | ||
horse.setBreed(false); | ||
horse.playEffect(EntityEffect.FIREWORK_EXPLODE); | ||
PotionEffect invis = new PotionEffect(PotionEffectType.INVISIBILITY, 2147483000, 1, false, false); | ||
horse.addPotionEffect(invis, true); | ||
horseData.setGender("UNIQUE"); | ||
|
||
return horse; | ||
} | ||
|
||
} |