本文整理汇总了Java中org.bukkit.craftbukkit.CraftArt.BukkitToNotch方法的典型用法代码示例。如果您正苦于以下问题:Java CraftArt.BukkitToNotch方法的具体用法?Java CraftArt.BukkitToNotch怎么用?Java CraftArt.BukkitToNotch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.craftbukkit.CraftArt
的用法示例。
在下文中一共展示了CraftArt.BukkitToNotch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setArt
import org.bukkit.craftbukkit.CraftArt; //导入方法依赖的package包/类
public boolean setArt(Art art, boolean force) {
net.minecraft.entity.item.EntityPainting painting = this.getHandle();
net.minecraft.entity.item.EntityPainting.EnumArt oldArt = painting.art;
painting.art = CraftArt.BukkitToNotch(art);
painting.setDirection(painting.hangingDirection);
if (!force && !painting.onValidSurface()) {
// Revert painting since it doesn't fit
painting.art = oldArt;
painting.setDirection(painting.hangingDirection);
return false;
}
this.update();
return true;
}
示例2: setArt
import org.bukkit.craftbukkit.CraftArt; //导入方法依赖的package包/类
public boolean setArt(Art art, boolean force) {
EntityPainting painting = this.getHandle();
EnumArt oldArt = painting.art;
painting.art = CraftArt.BukkitToNotch(art);
painting.setDirection(painting.direction);
if (!force && !painting.survives()) {
// Revert painting since it doesn't fit
painting.art = oldArt;
painting.setDirection(painting.direction);
return false;
}
this.update();
return true;
}
示例3: testCraftArtToNotch
import org.bukkit.craftbukkit.CraftArt; //导入方法依赖的package包/类
@Test
public void testCraftArtToNotch() {
Map<EnumArt, Art> cache = new EnumMap(EnumArt.class);
for (Art art : Art.values()) {
EnumArt enumArt = CraftArt.BukkitToNotch(art);
assertNotNull(art.name(), enumArt);
assertThat(art.name(), cache.put(enumArt, art), is(nullValue()));
}
}
示例4: setArt
import org.bukkit.craftbukkit.CraftArt; //导入方法依赖的package包/类
public boolean setArt(Art art, boolean force) {
net.minecraft.entity.item.EntityPainting painting = this.getHandle();
net.minecraft.util.EnumArt oldArt = painting.field_70522_e;
painting.field_70522_e = CraftArt.BukkitToNotch(art);
painting.func_82328_a(painting.field_82332_a);
if (!force && !painting.func_70518_d()) {
// Revert painting since it doesn't fit
painting.field_70522_e = oldArt;
painting.func_82328_a(painting.field_82332_a);
return false;
}
this.update();
return true;
}