本文整理汇总了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;未经允许,请勿转载。 |
请发表评论