本文整理汇总了Java中org.spongepowered.api.data.type.Art类的典型用法代码示例。如果您正苦于以下问题:Java Art类的具体用法?Java Art怎么用?Java Art使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Art类属于org.spongepowered.api.data.type包,在下文中一共展示了Art类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerInteractEntity
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
@Listener(order=Order.LAST)
public void onPlayerInteractEntity(InteractEntityEvent event, @First Player player_sponge) {
EPlayer player = this.plugin.getEServer().getEPlayer(player_sponge);
// GameMode : Painting
if (event instanceof InteractEntityEvent.Secondary && event.getTargetEntity() instanceof Painting) {
if (this.plugin.getConfigs().isGameModePaint() && player.isSneaking() && player.isCreative()) {
Painting paint = (Painting) event.getTargetEntity();
if (paint.get(Keys.ART).isPresent()) {
Art art = paint.get(Keys.ART).get();
Art next = UtilsPainting.next(art);
while (!paint.offer(Keys.ART, next).isSuccessful() && !art.equals(next)){
next = UtilsPainting.next(next);
}
}
}
}
// AFK
player.updateLastActivated();
// Freeze
if(player.isFreeze()) {
event.setCancelled(true);
}
}
示例2: update
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
@Override
public void update(EntityProtocolUpdateContext context) {
final Art art = getArt();
final Direction direction = getDirection();
final Vector3i position = this.entity.getPosition().toInt();
final int x = position.getX();
final int y = position.getY();
final int z = position.getZ();
if (art != this.lastArt || direction != this.lastDirection) {
spawn(context, art, direction, position);
update0(EntityProtocolUpdateContext.empty());
this.lastDirection = direction;
this.lastArt = art;
this.lastX = x;
this.lastY = y;
this.lastZ = z;
} else if (x != this.lastX || y != this.lastY || z != this.lastZ) {
update0(context);
context.sendToAll(() -> new MessagePlayOutEntityTeleport(getRootEntityId(), x, y, z, (byte) 0, (byte) 0, true));
this.lastX = x;
this.lastY = y;
this.lastZ = z;
}
}
示例3: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
@Override
public Art getArt() {
for(EnumArt art : EnumArt.values()) {
if(art.title.equals(title)) return (Art)(Object)art;
}
return Arts.KEBAB;
}
示例4: getNumero
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
private static int getNumero(List<Art> arts, Art art) {
int cpt = 0;
while(cpt < arts.size() && !arts.get(cpt).equals(art)){
cpt++;
}
return cpt;
}
示例5: next
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
public static Art next(Art art) {
List<Art> arts = UtilsPainting.getAll();
int num = UtilsPainting.getNumero(arts, art) + 1;
if (num >= arts.size()) {
num = 0;
}
return arts.get(num);
}
示例6: MessagePlayOutSpawnPainting
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
public MessagePlayOutSpawnPainting(int entityId, UUID uniqueId, Art art, int x, int y, int z, Direction direction) {
this.entityId = entityId;
this.uniqueId = uniqueId;
this.direction = direction;
this.art = art;
this.x = x;
this.y = y;
this.z = z;
}
示例7: setArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
@Override
public void setArt(Art art) {
title = ((EnumArt)(Object)art).title;
}
示例8: getAll
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
public static List<Art> getAll() {
return Sponge.getRegistry().getAllOf(Art.class).stream().collect(Collectors.toList());
}
示例9: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
private Art getArt() {
return this.entity.get(Keys.ART).orElse(Arts.KEBAB);
}
示例10: spawn
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
private void spawn(EntityProtocolUpdateContext context, Art art, Direction direction, Vector3i position) {
context.sendToAll(() -> new MessagePlayOutSpawnPainting(getRootEntityId(),
this.entity.getUniqueId(), art, position.getX(), position.getY(), position.getZ(), direction));
}
示例11: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
public Art getArt() {
return this.art;
}
示例12: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
Art getArt();
示例13: setArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
void setArt(Art art);