• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EntityInsentient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



EntityInsentient类属于net.minecraft.server包,在下文中一共展示了EntityInsentient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setCustomName

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public void setCustomName(String name) {
    if (!(getHandle() instanceof EntityInsentient)) {
        return;
    }

    if (name == null) {
        name = "";
    }

    // Names cannot be more than 64 characters due to DataWatcher limitations
    if (name.length() > 64) {
        name = name.substring(0, 64);
    }

    ((EntityInsentient) getHandle()).setCustomName(name);
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:17,代码来源:CraftLivingEntity.java


示例2: setLeashHolder

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public boolean setLeashHolder(Entity holder) {
    if ((getHandle() instanceof EntityWither) || !(getHandle() instanceof EntityInsentient)) {
        return false;
    }

    if (holder == null) {
        return unleash();
    }

    if (holder.isDead()) {
        return false;
    }

    unleash();
    ((EntityInsentient) getHandle()).setLeashHolder(((CraftEntity) holder).getHandle(), true);
    return true;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:18,代码来源:CraftLivingEntity.java


示例3: evaluate

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
@Override
public FilterState evaluate(final Object... objects) {
    boolean abstain = true;
    for (Object object : objects) {
        if (object instanceof Entity) {
            if (((CraftEntity)object).getHandle() instanceof EntityInsentient) {
                return allow ? FilterState.ALLOW : FilterState.DENY;
            }
            abstain = false;
        }
    }
    if (abstain) {
        return (getParent() == null ? ABSTAIN : getParent().evaluate(objects));
    }
    return allow ? FilterState.DENY : FilterState.ALLOW;
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:17,代码来源:AllMobFilter.java


示例4: CraftLivingEntity

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public CraftLivingEntity(final CraftServer server, final EntityLiving entity) {
    super(server, entity);

    if (entity instanceof EntityInsentient) {
        equipment = new CraftEntityEquipment(this);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:8,代码来源:CraftLivingEntity.java


示例5: getCustomName

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public String getCustomName() {
    if (!(getHandle() instanceof EntityInsentient)) {
        return null;
    }

    String name = ((EntityInsentient) getHandle()).getCustomName();

    if (name == null || name.length() == 0) {
        return null;
    }

    return name;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:14,代码来源:CraftLivingEntity.java


示例6: unleash

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
private boolean unleash() {
    if (!isLeashed()) {
        return false;
    }
    ((EntityInsentient) getHandle()).unleash(true, false);
    return true;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:8,代码来源:CraftLivingEntity.java


示例7: callEntityTameEvent

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
/**
 * EntityTameEvent
 */
public static EntityTameEvent callEntityTameEvent(EntityInsentient entity, EntityHuman tamer) {
    org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
    org.bukkit.entity.AnimalTamer bukkitTamer = (tamer != null ? tamer.getBukkitEntity() : null);
    CraftServer craftServer = (CraftServer) bukkitEntity.getServer();

    entity.persistent = true;

    EntityTameEvent event = new EntityTameEvent((LivingEntity) bukkitEntity, bukkitTamer);
    craftServer.getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:15,代码来源:CraftEventFactory.java


示例8: CraftLivingEntity

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public CraftLivingEntity(final CraftServer server, final EntityLiving entity) {
    super(server, entity);

    if (entity instanceof EntityInsentient || entity instanceof EntityArmorStand) {
        equipment = new CraftEntityEquipment(this);
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:8,代码来源:CraftLivingEntity.java


示例9: evaluate

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
@Override
public FilterState evaluate(Object... objects) {
    for (Object object : objects) {
        if (object instanceof Entity) {
            if (((CraftEntity)object).getHandle() instanceof EntityInsentient && mobType.equals(((CraftEntity) object).getType()))
                return ALLOW;
            else
                return DENY;
        }
    }
    return (getParent() == null ? ABSTAIN : getParent().evaluate(objects));
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:13,代码来源:MobFilter.java


示例10: setDropChance

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
private void setDropChance(EnumItemSlot slot, float chance) {
    if (slot == EnumItemSlot.MAINHAND || slot == EnumItemSlot.OFFHAND) {
        ((EntityInsentient) entity.getHandle()).dropChanceHand[slot.b()] = chance - 0.1F;
    } else {
        ((EntityInsentient) entity.getHandle()).dropChanceArmor[slot.b()] = chance - 0.1F;
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:8,代码来源:CraftEntityEquipment.java


示例11: getDropChance

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
private float getDropChance(EnumItemSlot slot) {
    if (slot == EnumItemSlot.MAINHAND || slot == EnumItemSlot.OFFHAND) {
        return ((EntityInsentient) entity.getHandle()).dropChanceHand[slot.b()] + 0.1F;
    } else {
        return ((EntityInsentient) entity.getHandle()).dropChanceArmor[slot.b()] + 0.1F;
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:8,代码来源:CraftEntityEquipment.java


示例12: getRemoveWhenFarAway

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public boolean getRemoveWhenFarAway() {
    return getHandle() instanceof EntityInsentient && !((EntityInsentient) getHandle()).persistent;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftLivingEntity.java


示例13: setRemoveWhenFarAway

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public void setRemoveWhenFarAway(boolean remove) {
    if (getHandle() instanceof EntityInsentient) {
        ((EntityInsentient) getHandle()).persistent = !remove;
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftLivingEntity.java


示例14: setCanPickupItems

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public void setCanPickupItems(boolean pickup) {
    if (getHandle() instanceof EntityInsentient) {
        ((EntityInsentient) getHandle()).canPickUpLoot = pickup;
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftLivingEntity.java


示例15: getCanPickupItems

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public boolean getCanPickupItems() {
    return getHandle() instanceof EntityInsentient && ((EntityInsentient) getHandle()).canPickUpLoot;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftLivingEntity.java


示例16: setCustomNameVisible

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public void setCustomNameVisible(boolean flag) {
    if (getHandle() instanceof EntityInsentient) {
        ((EntityInsentient) getHandle()).setCustomNameVisible(flag);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftLivingEntity.java


示例17: isCustomNameVisible

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public boolean isCustomNameVisible() {
    return getHandle() instanceof EntityInsentient && ((EntityInsentient) getHandle()).getCustomNameVisible();
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftLivingEntity.java


示例18: isLeashed

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public boolean isLeashed() {
    if (!(getHandle() instanceof EntityInsentient)) {
        return false;
    }
    return ((EntityInsentient) getHandle()).getLeashHolder() != null;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:7,代码来源:CraftLivingEntity.java


示例19: getLeashHolder

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
public Entity getLeashHolder() throws IllegalStateException {
    if (!isLeashed()) {
        throw new IllegalStateException("Entity not leashed");
    }
    return ((EntityInsentient) getHandle()).getLeashHolder().getBukkitEntity();
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:7,代码来源:CraftLivingEntity.java


示例20: setDropChance

import net.minecraft.server.EntityInsentient; //导入依赖的package包/类
private void setDropChance(int slot, float chance) {
    ((EntityInsentient) entity.getHandle()).dropChances[slot] = chance - 0.1F;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:4,代码来源:CraftEntityEquipment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MapIterator类代码示例发布时间:2022-05-23
下一篇:
Java CompilerThread类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap