本文整理汇总了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);
}
}
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:27,代码来源:EEPlayerListeners.java
示例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;
}
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:26,代码来源:PaintingEntityProtocol.java
示例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;
}
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:8,代码来源:MixinPacketSpawnPainting.java
示例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;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:8,代码来源:UtilsPainting.java
示例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);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:9,代码来源:UtilsPainting.java
示例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;
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:10,代码来源:MessagePlayOutSpawnPainting.java
示例7: setArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
@Override
public void setArt(Art art) {
title = ((EnumArt)(Object)art).title;
}
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:5,代码来源:MixinPacketSpawnPainting.java
示例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());
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:UtilsPainting.java
示例9: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
private Art getArt() {
return this.entity.get(Keys.ART).orElse(Arts.KEBAB);
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:PaintingEntityProtocol.java
示例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));
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:PaintingEntityProtocol.java
示例11: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
public Art getArt() {
return this.art;
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:MessagePlayOutSpawnPainting.java
示例12: getArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
Art getArt();
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:2,代码来源:PacketSpawnPainting.java
示例13: setArt
import org.spongepowered.api.data.type.Art; //导入依赖的package包/类
void setArt(Art art);
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:2,代码来源:PacketSpawnPainting.java
注:本文中的org.spongepowered.api.data.type.Art类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论