當前位置: 首頁>>代碼示例>>Java>>正文


Java PlayerEvent.StartTracking方法代碼示例

本文整理匯總了Java中net.minecraftforge.event.entity.player.PlayerEvent.StartTracking方法的典型用法代碼示例。如果您正苦於以下問題:Java PlayerEvent.StartTracking方法的具體用法?Java PlayerEvent.StartTracking怎麽用?Java PlayerEvent.StartTracking使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.event.entity.player.PlayerEvent的用法示例。


在下文中一共展示了PlayerEvent.StartTracking方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void startTracking(PlayerEvent.StartTracking event)
{
    Entity entity = event.getTarget();
    if (!(entity instanceof EntityPlayer))
        return;

    EntityPlayer player = (EntityPlayer) entity;
    BeltFinder.sendSync(player);
}
 
開發者ID:gigaherz,項目名稱:ToolBelt,代碼行數:11,代碼來源:BeltEvents.java

示例2: startTrack

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void startTrack(PlayerEvent.StartTracking event) {
	if(event.getTarget().hasCapability(TF2weapons.WEAPONS_CAP, null)) {
		TF2weapons.network.sendTo(new TF2Message.CapabilityMessage(event.getTarget(), true), (EntityPlayerMP) event.getEntityPlayer());
	}
	if (event.getTarget() instanceof EntityPlayer && !event.getTarget().world.isRemote) {
		// System.out.println("Tracking");
		InventoryWearables inv = event.getTarget().getCapability(TF2weapons.INVENTORY_CAP, null);
		TF2weapons.network.sendTo(new TF2Message.WearableChangeMessage((EntityPlayer) event.getTarget(), 0, inv.getStackInSlot(0)), (EntityPlayerMP) event.getEntityPlayer());
		TF2weapons.network.sendTo(new TF2Message.WearableChangeMessage((EntityPlayer) event.getTarget(), 1, inv.getStackInSlot(1)), (EntityPlayerMP) event.getEntityPlayer());
		TF2weapons.network.sendTo(new TF2Message.WearableChangeMessage((EntityPlayer) event.getTarget(), 2, inv.getStackInSlot(2)), (EntityPlayerMP) event.getEntityPlayer());
		TF2weapons.network.sendTo(new TF2Message.WearableChangeMessage((EntityPlayer) event.getTarget(), 3, inv.getStackInSlot(3)), (EntityPlayerMP) event.getEntityPlayer());
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:15,代碼來源:TF2EventsCommon.java

示例3: onStartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onStartTracking(PlayerEvent.StartTracking event) {
    if (event.getTarget() instanceof EntityPlayerMP) {
        EntityPlayer player = event.getEntityPlayer();
        EntityPlayerMP target = (EntityPlayerMP) event.getTarget();
        if (!player.worldObj.isRemote && player instanceof EntityPlayerMP) {
            if (target.getHealth() > 0.0F) {
                Possessed.getNetworkWrapper().sendTo(new PossessMessage(target, PossessHandler.get(target)), (EntityPlayerMP) player);
            }
            if (player.getHealth() > 0.0F) {
                Possessed.getNetworkWrapper().sendTo(new PossessMessage(player, PossessHandler.get(player)), target);
            }
        }
    }
}
 
開發者ID:Fararise,項目名稱:Possessed,代碼行數:16,代碼來源:ServerEventHandler.java

示例4: beginTrack

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void beginTrack(PlayerEvent.StartTracking trackEvent) {
    if (!trackEvent.getEntityPlayer().getEntityWorld().isRemote) {
        Entity target = trackEvent.getTarget();
        EntityPlayerMP player = (EntityPlayerMP) trackEvent.getEntityPlayer();

        UUID uuid = target.getUniqueID();

        if (BossList.containsKey(uuid)) {
            BossInfoServer bossInfo = BossList.get(uuid);
            bossInfo.addPlayer(player);
        }
    }
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:15,代碼來源:AssortedHandler.java

示例5: sendData

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void sendData(PlayerEvent.StartTracking event){
	Entity entity = event.getTarget();
	if(EntityUtil.hasCustomData(entity) && event.getEntityPlayer() instanceof EntityPlayerMP){
		CrystalModNetwork.sendTo(new PacketEntityMessage(entity, "CustomDataSync", EntityUtil.getCustomEntityData(entity)), (EntityPlayerMP)event.getEntityPlayer());
	}
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:8,代碼來源:EventHandler.java

示例6: trackingEvent

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void trackingEvent(@Nonnull final PlayerEvent.StartTracking event) {
	final IEmojiData data = event.getTarget().getCapability(EMOJI, DEFAULT_FACING);
	if (data != null) {
		Network.sendToPlayer((EntityPlayerMP) event.getEntityPlayer(), new PacketEntityEmote(data));
	}
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:8,代碼來源:CapabilityEmojiData.java

示例7: onPlayer_StartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayer_StartTracking(PlayerEvent.StartTracking event) {
	SkinInfo info = event.getTarget().getCapability(SkinCore.skin_info, null);
	if (info != null && info.skin_data != null && info.skin_type != null)
		AlchemyNetworkHandler.network_wrapper.sendTo(new UpdateSkinClient(event.getTarget().getEntityId(),
				event.getTarget().getName(), info.skin_type, info.skin_data), (EntityPlayerMP) event.getEntityPlayer());
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:8,代碼來源:SkinCapability.java

示例8: onPlayer_StartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayer_StartTracking(PlayerEvent.StartTracking event) {
	if (event.getTarget() instanceof EntityLivingBase) {
		EntityLivingBase living = event.getEntityPlayer();
		if (living.isPotionActive(this))
			updatePlayer((EntityPlayerMP) event.getEntityPlayer(), living);
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:9,代碼來源:PotionWitchcraft.java

示例9: onStartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onStartTracking(PlayerEvent.StartTracking event) {
  if (event.getTarget() instanceof EntityPlayerMP) {
    for (PacketUpgradeState.Type type : PacketUpgradeState.Type.values()) {
      PacketHandler.sendTo(new PacketUpgradeState(type, isActive((EntityPlayer) event.getTarget(), type), event.getTarget().getEntityId()),
          (EntityPlayerMP) event.getEntityPlayer());
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:10,代碼來源:DarkSteelController.java

示例10: onPlayer_StartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayer_StartTracking(PlayerEvent.StartTracking event) {
	InventoryBauble inventory = event.getTarget().getCapability(AlchemyCapabilityLoader.bauble, null);
	if (inventory != null && inventory.hasItem())
		inventory.updatePlayer((EntityPlayerMP) event.getEntityPlayer(), inventory.serializeNBT());
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:7,代碼來源:CapabilityBauble.java

示例11: onStartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onStartTracking(PlayerEvent.StartTracking event) {
	EntityPropertiesBase.syncProperties(event.entityPlayer, event.target);
}
 
開發者ID:copygirl,項目名稱:copycore,代碼行數:5,代碼來源:CommonProxy.java

示例12: incomingPlayer

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void incomingPlayer(PlayerEvent.StartTracking e){
	if(e.target instanceof EntityPlayer)
		RpgInventoryMod.SNW.sendTo(new PacketSyncOtherInventory((EntityPlayer) e.target), (EntityPlayerMP) e.entityPlayer);
}
 
開發者ID:ArtixAllMighty,項目名稱:rpginventory,代碼行數:6,代碼來源:RPGEventHooks.java

示例13: onPlayerStartTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerStartTracking(PlayerEvent.StartTracking event)
	{ sendBackpackStack(event.getTarget(), event.getEntityPlayer()); }
 
開發者ID:copygirl,項目名稱:WearableBackpacks,代碼行數:4,代碼來源:ProxyCommon.java

示例14: addTracking

import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void addTracking(PlayerEvent.StartTracking event){
    if(isValid(event.getTarget())){
        ((EntityPlayerMP)event.getEntityPlayer()).connection.sendPacket(new BattlegearSyncItemPacket((EntityPlayer) event.getTarget()).generatePacket());
    }
}
 
開發者ID:Mine-and-blade-admin,項目名稱:Battlegear2,代碼行數:7,代碼來源:BattlemodeHookContainerClass.java


注:本文中的net.minecraftforge.event.entity.player.PlayerEvent.StartTracking方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。