Java 类net.minecraft.entity.ai.attributes.AttributeMap 实例源码
项目:Backmemed
文件:EntityTrackerEntry.java
/**
* 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();
}
}
项目:CustomWorldGen
文件:EntityTrackerEntry.java
/**
* 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();
}
}
项目:ExpandedRailsMod
文件:EntityTrackerEntry.java
/**
* 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();
}
}
项目:Backmemed
文件:EntityLivingBase.java
/**
* 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;
}
项目:CustomWorldGen
文件:EntityLivingBase.java
/**
* 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;
}
项目:SettlerCraft
文件:EntityPlayerWrappedSettler.java
@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();
}
}
项目:ExpandedRailsMod
文件:EntityLivingBase.java
public AbstractAttributeMap getAttributeMap()
{
if (this.attributeMap == null)
{
this.attributeMap = new AttributeMap();
}
return this.attributeMap;
}