Files
Paper/paper-api/src/main/java/org/bukkit/GrassSpecies.java
Aikar 2825ece820 Fix Spigot annotation mistakes
while some of these may of been true, they are extreme cases and cause
a ton of noise to plugin developers.

Use ApiStatus.Internal instead of Deprecated for actual internal API
that continues to have use (internally).

These do not help plugin developers if they bring moise noise than value.
2019-03-24 18:39:01 -04:00

65 lines
1.5 KiB
Java

package org.bukkit;
import com.google.common.collect.Maps;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
/**
* Represents the different types of grass.
* @deprecated use {@link org.bukkit.block.data.BlockData}
*/
@Deprecated(forRemoval = true, since = "1.13")
public enum GrassSpecies {
/**
* Represents the dead looking grass.
*/
DEAD(0x0),
/**
* Represents the normal grass species.
*/
NORMAL(0x1),
/**
* Represents the fern-looking grass species.
*/
FERN_LIKE(0x2);
private final byte data;
private static final Map<Byte, GrassSpecies> BY_DATA = Maps.newHashMap();
private GrassSpecies(final int data) {
this.data = (byte) data;
}
/**
* Gets the associated data value representing this species
*
* @return A byte containing the data value of this grass species
* @deprecated Magic value
*/
@Deprecated(since = "1.6.2")
public byte getData() {
return data;
}
/**
* Gets the GrassSpecies with the given data value
*
* @param data Data value to fetch
* @return The {@link GrassSpecies} representing the given value, or null
* if it doesn't exist
* @deprecated Magic value
*/
@Deprecated(since = "1.6.2")
@Nullable
public static GrassSpecies getByData(final byte data) {
return BY_DATA.get(data);
}
static {
for (GrassSpecies grassSpecies : values()) {
BY_DATA.put(grassSpecies.getData(), grassSpecies);
}
}
}