本文整理汇总了Java中net.minecraftforge.event.entity.EntityEvent类的典型用法代码示例。如果您正苦于以下问题:Java EntityEvent类的具体用法?Java EntityEvent怎么用?Java EntityEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityEvent类属于net.minecraftforge.event.entity包,在下文中一共展示了EntityEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEntityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event) {
if(event.entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entity;
if(PlayerSymptoms.getForPlayer(player) == null) {
PlayerSymptoms.addToPlayer(player);
HealthMod.debug("Adding symptoms");
PlayerSymptoms.getForPlayer(player).addSymptom(new SymptomFever().instantiate(0));
PlayerSymptoms.getForPlayer(player).addSymptom(new SymptomNausea().instantiate(2));
}
if(PlayerBodyProperties.getForPlayer(player) == null) {
PlayerBodyProperties.addToPlayer(player);
}
if(PlayerDiseases.getForPlayer(player) == null) {
PlayerDiseases.addToPlayer(player);
}
}
}
示例2: onEntityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
if (event.entity instanceof EntityPlayer && ARKPlayer.get((EntityPlayer) event.entity) == null)
{
ARKPlayer.register((EntityPlayer) event.entity, event.entity.worldObj);
if (event.entity.worldObj.isRemote) // On client
{
LogHelper.info("ARKPlayerEventHandler: Registered a new ARKPlayer on client.");
}
else
{
LogHelper.info("ARKPlayerEventHandler: Registered a new ARKPlayer on server.");
}
}
}
示例3: onEnterChunk
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEnterChunk(EntityEvent.EnteringChunk event)
{
if(FMLCommonHandler.instance().getEffectiveSide().isServer() && (event.entity instanceof EntityMeteorite || event.entity instanceof EntityPigzilla) && !event.entity.isDead)
{
ForgeChunkManager.Ticket ticket = ChunkLoadHandler.tickets.get(event.entity);
if(ticket == null)
{
ticket = ForgeChunkManager.requestTicket(ItFellFromTheSky.instance, event.entity.worldObj, ForgeChunkManager.Type.ENTITY);
if(ticket != null)
{
ticket.bindEntity(event.entity);
ChunkLoadHandler.addTicket(event.entity, ticket);
}
}
if(ticket != null)
{
if(event.oldChunkX != 0 && event.oldChunkZ != 0)
{
ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(event.oldChunkX, event.oldChunkZ));
}
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(event.newChunkX, event.newChunkZ));
}
}
}
示例4: onPlayerJoinWorld
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@ForgeSubscribe
public void onPlayerJoinWorld(EntityEvent.EntityConstructing event)
{
if (event.entity != null)
if (event.entity.worldObj != null)
if (!event.entity.worldObj.isRemote)
if (event.entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entity;
if (player
.getExtendedProperties(R0b0tsPlayerProperties.IDENTIFIER) == null)
player.registerExtendedProperties(
R0b0tsPlayerProperties.IDENTIFIER,
new R0b0tsPlayerProperties());
}
}
示例5: onEntityConstructEvent
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onEntityConstructEvent(EntityEvent.EntityConstructing event)
{
Entity entity = event.getEntity();
if(entity instanceof EntityLivingBase) {
((EntityLivingBase) entity).getAttributeMap().registerAttribute(PHYSICAL_DAMAGE_RATE);
((EntityLivingBase) entity).getAttributeMap().registerAttribute(FIRE_DAMAGE_RATE);
}
}
示例6: entityConstruct
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstruct(EntityEvent.EntityConstructing e){
//add custom properties to players
if(e.entity instanceof EntityPlayer){
if(e.entity.getExtendedProperties(PlayerProperties.ID) == null){
e.entity.registerExtendedProperties(PlayerProperties.ID, new PlayerProperties());
}
}
}
示例7: entityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstructing(final EntityEvent.EntityConstructing event) {
if (event.getEntity() instanceof EntityPlayerSP) {
//System.out.println("Constructing player");
}
}
示例8: entityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityConstructing(final EntityEvent.EntityConstructing event) {
if (event.getEntity() instanceof EntityLivingBase) {
//event.getEntity().getDataManager().register(ENTITY_UBER, false);
event.getEntity().getDataManager().register(ENTITY_OVERHEAL, 0f);
}
if (event.getEntity() instanceof EntityPlayer && TF2UdpClient.instance != null) {
TF2UdpClient.instance.shutdown();
TF2UdpClient.instance = null;
}
}
示例9: onEntityConstruction
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOW)
public void onEntityConstruction(EntityEvent.EntityConstructing event)
{
Entity entity = event.getEntity();
if(entity instanceof EntityPlayer)
{
if(entity.world != null)
{
if(event.getEntity().world.isRemote)
{
CraftingParadise.proxy.registerCustomSky();
}
}
}
}
示例10: onEntityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
if (event.entity instanceof EntityPlayerMP && GCPlayerStats.get((EntityPlayerMP) event.entity) == null)
{
GCPlayerStats.register((EntityPlayerMP) event.entity);
}
}
示例11: onEntityConstructing
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
if (event.entity instanceof EntityPlayerMP && GCPlayerStats.get((EntityPlayerMP) event.entity) == null)
{
GCPlayerStats.register((EntityPlayerMP) event.entity);
}
if (isClient)
{
this.onEntityConstructingClient(event);
}
}
示例12: onEntityConstructingClient
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void onEntityConstructingClient(EntityEvent.EntityConstructing event)
{
if (event.entity instanceof EntityClientPlayerMP)
{
if (GCPlayerStatsClient.get((EntityClientPlayerMP) event.entity) == null)
{
GCPlayerStatsClient.register((EntityClientPlayerMP) event.entity);
}
Minecraft.getMinecraft().gameSettings.sendSettingsToServer();
}
}
示例13: handleEnteringProvince
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void handleEnteringProvince(EntityEvent.EnteringChunk event) {
if (!(event.getEntity() instanceof EntityPlayerMP)) {
return;
}
EntityPlayerMP player = (EntityPlayerMP) event.getEntity();
PlayerCivilizationCapabilityImpl.get(player).updatePlayerLocation(event.getNewChunkX(), event.getNewChunkZ());
}
示例14: entityEnteredChunk
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
@SubscribeEvent
public void entityEnteredChunk(EntityEvent.EnteringChunk event) {
Entity entity = event.entity;
if (entity instanceof LocoBase) {
if (!entity.worldObj.isRemote) {
((LocoBase) entity).forceChunkLoading(event.newChunkX, event.newChunkZ);
} else {
((LocoBase) entity).setupChunks(event.newChunkX, event.newChunkZ);
}
}
}
示例15: Entity
import net.minecraftforge.event.entity.EntityEvent; //导入依赖的package包/类
public Entity(World p_i1582_1_)
{
this.entityId = nextEntityID++;
this.renderDistanceWeight = 1.0D;
this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
this.field_70135_K = true;
this.width = 0.6F;
this.height = 1.8F;
this.nextStepDistance = 1;
this.rand = new Random();
this.fireResistance = 1;
this.firstUpdate = true;
this.entityUniqueID = UUID.randomUUID();
this.myEntitySize = Entity.EnumEntitySize.SIZE_2;
this.worldObj = p_i1582_1_;
this.setPosition(0.0D, 0.0D, 0.0D);
if (p_i1582_1_ != null)
{
this.dimension = p_i1582_1_.provider.dimensionId;
}
this.dataWatcher = new DataWatcher(this);
this.dataWatcher.addObject(0, Byte.valueOf((byte)0));
this.dataWatcher.addObject(1, Short.valueOf((short)300));
this.entityInit();
extendedProperties = new HashMap<String, IExtendedEntityProperties>();
MinecraftForge.EVENT_BUS.post(new EntityEvent.EntityConstructing(this));
for (IExtendedEntityProperties props : this.extendedProperties.values())
{
props.init(this, p_i1582_1_);
}
}