13
0
geforkt von Mirrors/Paper

Improve entity hierarchy by adding Mob interface.

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2018-08-10 19:47:56 +10:00
Ursprung 30068a6e08
Commit d2b8685893
5 geänderte Dateien mit 28 neuen und 38 gelöschten Zeilen

Datei anzeigen

@ -3,4 +3,4 @@ package org.bukkit.entity;
/** /**
* Represents an ambient mob * Represents an ambient mob
*/ */
public interface Ambient extends LivingEntity {} public interface Ambient extends Mob {}

Datei anzeigen

@ -4,23 +4,4 @@ package org.bukkit.entity;
* Represents a Creature. Creatures are non-intelligent monsters or animals * Represents a Creature. Creatures are non-intelligent monsters or animals
* which have very simple abilities. * which have very simple abilities.
*/ */
public interface Creature extends LivingEntity { public interface Creature extends Mob {}
/**
* Instructs this Creature to set the specified LivingEntity as its
* target.
* <p>
* Hostile creatures may attack their target, and friendly creatures may
* follow their target.
*
* @param target New LivingEntity to target, or null to clear the target
*/
public void setTarget(LivingEntity target);
/**
* Gets the current target of this Creature
*
* @return Current target of this creature, or null if none exists
*/
public LivingEntity getTarget();
}

Datei anzeigen

@ -3,4 +3,4 @@ package org.bukkit.entity;
/** /**
* Represents a Flying Entity. * Represents a Flying Entity.
*/ */
public interface Flying extends LivingEntity {} public interface Flying extends Mob {}

Datei anzeigen

@ -0,0 +1,24 @@
package org.bukkit.entity;
/**
* Represents a Mob. Mobs are living entities with simple AI.
*/
public interface Mob extends LivingEntity {
/**
* Instructs this Mob to set the specified LivingEntity as its target.
* <p>
* Hostile creatures may attack their target, and friendly creatures may
* follow their target.
*
* @param target New LivingEntity to target, or null to clear the target
*/
public void setTarget(LivingEntity target);
/**
* Gets the current target of this Mob
*
* @return Current target of this creature, or null if none exists
*/
public LivingEntity getTarget();
}

Datei anzeigen

@ -3,7 +3,7 @@ package org.bukkit.entity;
/** /**
* Represents a Slime. * Represents a Slime.
*/ */
public interface Slime extends LivingEntity { public interface Slime extends Mob {
/** /**
* @return The size of the slime * @return The size of the slime
@ -14,19 +14,4 @@ public interface Slime extends LivingEntity {
* @param sz The new size of the slime. * @param sz The new size of the slime.
*/ */
public void setSize(int sz); public void setSize(int sz);
/**
* Set the {@link LivingEntity} target for this slime. Set to null to clear
* the target.
*
* @param target the entity to target
*/
public void setTarget(LivingEntity target);
/**
* Get the {@link LivingEntity} this slime is currently targeting.
*
* @return the current target, or null if no target exists.
*/
public LivingEntity getTarget();
} }