geforkt von Mirrors/Paper
SPIGOT-1592: Implement ItemMeta for Spawn Eggs
The Minecraft implementation of spawn eggs is able to construct an entity using all data that is present in the save format, however since the Bukkit API has no such way to construct an entity unattached to a world, and it appears creating such a way is a very challenging task, the decision was instead made to add this API now that 1.11 has entities which may not be represented by data values. In the future it may be possible to implement a more expanded API cognate with this one. By: Matthew <stteg@hotmail.com>
Dieser Commit ist enthalten in:
Ursprung
8c5665d841
Commit
ef84e6b90f
28
paper-api/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java
Normale Datei
28
paper-api/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java
Normale Datei
@ -0,0 +1,28 @@
|
|||||||
|
package org.bukkit.inventory.meta;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a {@link Material#MONSTER_EGG} and it's spawned type.
|
||||||
|
*/
|
||||||
|
public interface SpawnEggMeta extends ItemMeta {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type of entity this egg will spawn.
|
||||||
|
*
|
||||||
|
* @return The entity type. May be null for implementation specific default.
|
||||||
|
*/
|
||||||
|
EntityType getSpawnedType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type of entity this egg will spawn.
|
||||||
|
*
|
||||||
|
* @param type The entity type. May be null for implementation specific
|
||||||
|
* default.
|
||||||
|
*/
|
||||||
|
void setSpawnedType(EntityType type);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
SpawnEggMeta clone();
|
||||||
|
}
|
@ -2,11 +2,13 @@ package org.bukkit.material;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.SpawnEggMeta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a spawn egg that can be used to spawn mobs
|
* Represents a spawn egg that can be used to spawn mobs
|
||||||
|
* @deprecated use {@link SpawnEggMeta}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class SpawnEgg extends MaterialData {
|
public class SpawnEgg extends MaterialData {
|
||||||
|
|
||||||
public SpawnEgg() {
|
public SpawnEgg() {
|
||||||
@ -41,7 +43,7 @@ public class SpawnEgg extends MaterialData {
|
|||||||
* Get the type of entity this egg will spawn.
|
* Get the type of entity this egg will spawn.
|
||||||
*
|
*
|
||||||
* @return The entity type.
|
* @return The entity type.
|
||||||
* @deprecated This is now stored in {@link ItemMeta}. See SPIGOT-1592.
|
* @deprecated This is now stored in {@link SpawnEggMeta}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public EntityType getSpawnedType() {
|
public EntityType getSpawnedType() {
|
||||||
@ -52,7 +54,7 @@ public class SpawnEgg extends MaterialData {
|
|||||||
* Set the type of entity this egg will spawn.
|
* Set the type of entity this egg will spawn.
|
||||||
*
|
*
|
||||||
* @param type The entity type.
|
* @param type The entity type.
|
||||||
* @deprecated This is now stored in {@link ItemMeta}. See SPIGOT-1592.
|
* @deprecated This is now stored in {@link SpawnEggMeta}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setSpawnedType(EntityType type) {
|
public void setSpawnedType(EntityType type) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren