本文整理汇总了Java中org.bukkit.craftbukkit.CraftEffect类的典型用法代码示例。如果您正苦于以下问题:Java CraftEffect类的具体用法?Java CraftEffect怎么用?Java CraftEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CraftEffect类属于org.bukkit.craftbukkit包,在下文中一共展示了CraftEffect类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: playEffect
import org.bukkit.craftbukkit.CraftEffect; //导入依赖的package包/类
@Override
public <T> void playEffect(Location loc, Effect effect, T data) {
if (data != null) {
Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!");
} else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data);
playEffect(loc, effect, datavalue);
}
示例2: playEffect
import org.bukkit.craftbukkit.CraftEffect; //导入依赖的package包/类
public <T> void playEffect(Location loc, Effect effect, T data) {
if (data != null) {
Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!");
} else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
if (data != null && data.getClass().equals(org.bukkit.material.MaterialData.class)) {
org.bukkit.material.MaterialData materialData = (org.bukkit.material.MaterialData) data;
Validate.isTrue(!materialData.getItemType().isBlock(), "Material must be block");
spigot().playEffect(loc, effect, materialData.getItemType().getId(), materialData.getData(), 0, 0, 0, 1, 1, 64);
} else {
int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data);
playEffect(loc, effect, datavalue);
}
}
示例3: playEffect
import org.bukkit.craftbukkit.CraftEffect; //导入依赖的package包/类
@Override
public <T> void playEffect(Location loc, Effect effect, T data) {
if (data != null) {
Validate.isTrue(effect.getData() != null && effect.getData().isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!");
} else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data);
playEffect(loc, effect, datavalue);
}
示例4: playEffect
import org.bukkit.craftbukkit.CraftEffect; //导入依赖的package包/类
public <T> void playEffect(Location loc, Effect effect, T data) {
if (data != null) {
Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!");
} else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data);
playEffect(loc, effect, datavalue);
}