Add definitions for Minecraft 1.9 gameplay elements
Includes an API for AreaEffectCloud and rework of Sound enum to include new sound values. By: md_5 <git@md-5.net>
This commit is contained in:
174
paper-api/src/main/java/org/bukkit/entity/AreaEffectCloud.java
Normal file
174
paper-api/src/main/java/org/bukkit/entity/AreaEffectCloud.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
/**
|
||||
* Represents an area effect cloud which will imbue a potion effect onto
|
||||
* entities which enter it.
|
||||
*/
|
||||
public interface AreaEffectCloud extends Entity {
|
||||
|
||||
/**
|
||||
* Gets the duration which this cloud will exist for (in ticks).
|
||||
*
|
||||
* @return cloud duration
|
||||
*/
|
||||
int getDuration();
|
||||
|
||||
/**
|
||||
* Sets the duration which this cloud will exist for (in ticks).
|
||||
*
|
||||
* @param duration cloud duration
|
||||
*/
|
||||
void setDuration(int duration);
|
||||
|
||||
/**
|
||||
* Gets the time which an entity has to be exposed to the cloud before the
|
||||
* effect is applied.
|
||||
*
|
||||
* @return wait time
|
||||
*/
|
||||
int getWaitTime();
|
||||
|
||||
/**
|
||||
* Sets the time which an entity has to be exposed to the cloud before the
|
||||
* effect is applied.
|
||||
*
|
||||
* @param waitTime wait time
|
||||
*/
|
||||
void setWaitTime(int waitTime);
|
||||
|
||||
/**
|
||||
* Gets the time that an entity will be immune from subsequent exposure.
|
||||
*
|
||||
* @return reapplication delay
|
||||
*/
|
||||
int getReapplicationDelay();
|
||||
|
||||
/**
|
||||
* Sets the time that an entity will be immune from subsequent exposure.
|
||||
*
|
||||
* @param delay reapplication delay
|
||||
*/
|
||||
void setReapplicationDelay(int delay);
|
||||
|
||||
/**
|
||||
* Gets the amount that the duration of this cloud will decrease by when it
|
||||
* applies an effect to an entity.
|
||||
*
|
||||
* @return duration on use delta
|
||||
*/
|
||||
int getDurationOnUse();
|
||||
|
||||
/**
|
||||
* Sets the amount that the duration of this cloud will decrease by when it
|
||||
* applies an effect to an entity.
|
||||
*
|
||||
* @param duration duration on use delta
|
||||
*/
|
||||
void setDurationOnUse(int duration);
|
||||
/**
|
||||
* Gets the initial radius of the cloud.
|
||||
*
|
||||
* @return radius
|
||||
*/
|
||||
float getRadius();
|
||||
|
||||
/**
|
||||
* Sets the initial radius of the cloud.
|
||||
*
|
||||
* @param radius radius
|
||||
*/
|
||||
void setRadius(float radius);
|
||||
|
||||
/**
|
||||
* Gets the amount that the radius of this cloud will decrease by when it
|
||||
* applies an effect to an entity.
|
||||
*
|
||||
* @return radius on use delta
|
||||
*/
|
||||
float getRadiusOnUse();
|
||||
|
||||
/**
|
||||
* Sets the amount that the radius of this cloud will decrease by when it
|
||||
* applies an effect to an entity.
|
||||
*
|
||||
* @param radius radius on use delta
|
||||
*/
|
||||
void setRadiusOnUse(float radius);
|
||||
|
||||
/**
|
||||
* Gets the amount that the radius of this cloud will decrease by each tick.
|
||||
*
|
||||
* @return radius per tick delta
|
||||
*/
|
||||
float getRadiusPerTick();
|
||||
|
||||
/**
|
||||
* Gets the amount that the radius of this cloud will decrease by each tick.
|
||||
*
|
||||
* @param radius per tick delta
|
||||
*/
|
||||
void setRadiusPerTick(float radius);
|
||||
|
||||
/**
|
||||
* Gets the particle which this cloud will be composed of
|
||||
*
|
||||
* @return particle the set particle type
|
||||
*/
|
||||
Particle getParticle();
|
||||
|
||||
/**
|
||||
* Sets the particle which this cloud will be composed of
|
||||
*
|
||||
* @param particle the new particle type
|
||||
*/
|
||||
void setParticle(Particle particle);
|
||||
|
||||
/**
|
||||
* Get a copy of all effects which can be applied by this cloud. No
|
||||
* guarantees are made about the nature of the returned list.
|
||||
*
|
||||
* @return the list of all effects
|
||||
*/
|
||||
List<PotionEffect> getEffects();
|
||||
|
||||
/**
|
||||
* Add an effect which can be applied by this cloud.
|
||||
*
|
||||
* @param effect the effect to add
|
||||
*/
|
||||
void addEffect(PotionEffect effect);
|
||||
|
||||
/**
|
||||
* Remove an effect from this cloud.
|
||||
*
|
||||
* @param effect the effect to remove
|
||||
*/
|
||||
void removeEffect(PotionEffect effect);
|
||||
|
||||
/**
|
||||
* Set the effects of this cloud. Will remove all existing effects.
|
||||
*
|
||||
* @param effects the new effects to set
|
||||
*/
|
||||
void setEffects(List<PotionEffect> effects);
|
||||
|
||||
/**
|
||||
* Gets the color of this cloud. Will be applied as a tint to its particles.
|
||||
*
|
||||
* @return cloud color
|
||||
*/
|
||||
Color getColor();
|
||||
|
||||
/**
|
||||
* Sets the color of this cloud. Will be applied as a tint to its particles.
|
||||
*
|
||||
* @param color cloud color
|
||||
*/
|
||||
void setColor(Color color);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
public interface DragonFireball extends Fireball {}
|
||||
@@ -13,6 +13,7 @@ import org.bukkit.entity.minecart.StorageMinecart;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
public enum EntityType {
|
||||
|
||||
@@ -80,7 +81,29 @@ public enum EntityType {
|
||||
* A block that is going to or is about to fall.
|
||||
*/
|
||||
FALLING_BLOCK("FallingSand", FallingBlock.class, 21, false),
|
||||
/**
|
||||
* Internal representation of a Firework once it has been launched.
|
||||
*/
|
||||
FIREWORK("FireworksRocketEntity", Firework.class, 22, false),
|
||||
/**
|
||||
* Like {@link #ARROW} but tipped with a specific potion which is applied on contact.
|
||||
*/
|
||||
TIPPED_ARROW("TippedArrow", TippedArrow.class, 23),
|
||||
/**
|
||||
* Like {@link #TIPPED_ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members.
|
||||
*/
|
||||
SPECTRAL_ARROW("SpectralArrow", SpectralArrow.class, 24),
|
||||
/**
|
||||
* Bullet fired by {@link #SHULKER}.
|
||||
*/
|
||||
SHULKER_BULLET("ShulkerBullet", ShulkerBullet.class, 25),
|
||||
/**
|
||||
* Like {@link #FIREBALL} but with added effects.
|
||||
*/
|
||||
DRAGON_FIREBALL("DragonFireball", DragonFireball.class, 26),
|
||||
/**
|
||||
* Mechanical entity with an inventory for placing weapons / armor into.
|
||||
*/
|
||||
ARMOR_STAND("ArmorStand", ArmorStand.class, 30, false),
|
||||
/**
|
||||
* @see CommandMinecart
|
||||
@@ -133,6 +156,7 @@ public enum EntityType {
|
||||
WITCH("Witch", Witch.class, 66),
|
||||
ENDERMITE("Endermite", Endermite.class, 67),
|
||||
GUARDIAN("Guardian", Guardian.class, 68),
|
||||
SHULKER("Shulker", Shulker.class, 69),
|
||||
PIG("Pig", Pig.class, 90),
|
||||
SHEEP("Sheep", Sheep.class, 91),
|
||||
COW("Cow", Cow.class, 92),
|
||||
@@ -152,6 +176,7 @@ public enum EntityType {
|
||||
* A flying splash potion.
|
||||
*/
|
||||
SPLASH_POTION(null, ThrownPotion.class, -1, false),
|
||||
AREA_EFFECT_CLOUD(null, AreaEffectCloud.class, -1),
|
||||
/**
|
||||
* A flying chicken egg.
|
||||
*/
|
||||
|
||||
3
paper-api/src/main/java/org/bukkit/entity/Shulker.java
Normal file
3
paper-api/src/main/java/org/bukkit/entity/Shulker.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
public interface Shulker extends Golem {}
|
||||
34
paper-api/src/main/java/org/bukkit/entity/ShulkerBullet.java
Normal file
34
paper-api/src/main/java/org/bukkit/entity/ShulkerBullet.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
|
||||
public interface ShulkerBullet extends Entity {
|
||||
|
||||
/**
|
||||
* Retrieve the shooter of this bullet.
|
||||
*
|
||||
* @return the {@link ProjectileSource} that shot this bullet
|
||||
*/
|
||||
ProjectileSource getShooter();
|
||||
|
||||
/**
|
||||
* Set the shooter of this bullet.
|
||||
*
|
||||
* @param source the {@link ProjectileSource} that shot this bullet
|
||||
*/
|
||||
void setShooter(ProjectileSource source);
|
||||
|
||||
/**
|
||||
* Retrieve the target of this bullet.
|
||||
*
|
||||
* @return the targeted entity
|
||||
*/
|
||||
Entity getTarget();
|
||||
|
||||
/**
|
||||
* Sets the target of this bullet
|
||||
*
|
||||
* @param target the entity to target
|
||||
*/
|
||||
void setTarget(Entity target);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
public interface SpectralArrow extends Arrow {}
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
public interface TippedArrow extends Arrow {}
|
||||
@@ -30,6 +30,23 @@ public interface Zombie extends Monster {
|
||||
* Sets whether the zombie is a villager
|
||||
*
|
||||
* @param flag Whether the zombie is a villager
|
||||
* @deprecated Defaults to a basic villager
|
||||
*/
|
||||
@Deprecated
|
||||
public void setVillager(boolean flag);
|
||||
|
||||
/**
|
||||
* Sets whether the zombie is a villager
|
||||
*
|
||||
* @param profession the profession of the villager or null to clear
|
||||
*/
|
||||
public void setVillagerProfession(Villager.Profession profession);
|
||||
|
||||
/**
|
||||
* Returns the villager profession of the zombie if the
|
||||
* zombie is a villager
|
||||
*
|
||||
* @return the profession or null
|
||||
*/
|
||||
public Villager.Profession getVillagerProfession();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user