当前位置: 首页>>代码示例>>Java>>正文


Java CraftArt类代码示例

本文整理汇总了Java中org.bukkit.craftbukkit.CraftArt的典型用法代码示例。如果您正苦于以下问题:Java CraftArt类的具体用法?Java CraftArt怎么用?Java CraftArt使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CraftArt类属于org.bukkit.craftbukkit包,在下文中一共展示了CraftArt类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:15,代码来源:CraftPainting.java

示例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;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:15,代码来源:CraftPainting.java

示例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()));
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:10,代码来源:ArtTest.java

示例4: testCraftArtToBukkit

import org.bukkit.craftbukkit.CraftArt; //导入依赖的package包/类
@Test
public void testCraftArtToBukkit() {
    Map<Art, EnumArt> cache = new EnumMap(Art.class);
    for (EnumArt enumArt : EnumArt.values()) {
        Art art = CraftArt.NotchToBukkit(enumArt);
        assertNotNull(enumArt.name(), art);
        assertThat(enumArt.name(), cache.put(art, enumArt), is(nullValue()));
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:10,代码来源:ArtTest.java

示例5: 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;
}
 
开发者ID:agaricusb,项目名称:MCPBukkit,代码行数:15,代码来源:CraftPainting.java

示例6: getArt

import org.bukkit.craftbukkit.CraftArt; //导入依赖的package包/类
public Art getArt() {
    net.minecraft.entity.item.EntityPainting.EnumArt art = getHandle().art;
    return CraftArt.NotchToBukkit(art);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:CraftPainting.java

示例7: getArt

import org.bukkit.craftbukkit.CraftArt; //导入依赖的package包/类
public Art getArt() {
    EnumArt art = getHandle().art;
    return CraftArt.NotchToBukkit(art);
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:5,代码来源:CraftPainting.java


注:本文中的org.bukkit.craftbukkit.CraftArt类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。