本文整理汇总了Java中net.minecraft.entity.ai.attributes.AttributeMap类的典型用法代码示例。如果您正苦于以下问题:Java AttributeMap类的具体用法?Java AttributeMap怎么用?Java AttributeMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttributeMap类属于net.minecraft.entity.ai.attributes包,在下文中一共展示了AttributeMap类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sendMetadataToAllAssociatedPlayers
import net.minecraft.entity.ai.attributes.AttributeMap; //导入依赖的package包/类
/**
* Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity
* itself if a player.
*/
private void sendMetadataToAllAssociatedPlayers()
{
EntityDataManager entitydatamanager = this.trackedEntity.getDataManager();
if (entitydatamanager.isDirty())
{
this.sendToTrackingAndSelf(new SPacketEntityMetadata(this.trackedEntity.getEntityId(), entitydatamanager, false));
}
if (this.trackedEntity instanceof EntityLivingBase)
{
AttributeMap attributemap = (AttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
Set<IAttributeInstance> set = attributemap.getAttributeInstanceSet();
if (!set.isEmpty())
{
this.sendToTrackingAndSelf(new SPacketEntityProperties(this.trackedEntity.getEntityId(), set));
}
set.clear();
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:EntityTrackerEntry.java
示例2: getAttributeMap
import net.minecraft.entity.ai.attributes.AttributeMap; //导入依赖的package包/类
/**
* Returns this entity's attribute map (where all its attributes are stored)
*/
public AbstractAttributeMap getAttributeMap()
{
if (this.attributeMap == null)
{
this.attributeMap = new AttributeMap();
}
return this.attributeMap;
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:EntityLivingBase.java
示例3: getAttributeMap
import net.minecraft.entity.ai.attributes.AttributeMap; //导入依赖的package包/类
@Override
public AbstractAttributeMap getAttributeMap() {
//null check because super constructor calls this method
if(getSettler() == null) {
AbstractAttributeMap map = new AttributeMap();
map.registerAttribute(SharedMonsterAttributes.MAX_HEALTH);
return map;
} else {
return getSettler().getAttributeMap();
}
}
开发者ID:InfinityRaider,项目名称:SettlerCraft,代码行数:12,代码来源:EntityPlayerWrappedSettler.java
示例4: getAttributeMap
import net.minecraft.entity.ai.attributes.AttributeMap; //导入依赖的package包/类
public AbstractAttributeMap getAttributeMap()
{
if (this.attributeMap == null)
{
this.attributeMap = new AttributeMap();
}
return this.attributeMap;
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:10,代码来源:EntityLivingBase.java
注:本文中的net.minecraft.entity.ai.attributes.AttributeMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论