本文整理匯總了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);
}
示例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());
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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());
}
}
示例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));
}
}
示例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());
}
示例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);
}
}
示例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());
}
}
}
示例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());
}
示例11: onStartTracking
import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onStartTracking(PlayerEvent.StartTracking event) {
EntityPropertiesBase.syncProperties(event.entityPlayer, event.target);
}
示例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);
}
示例13: onPlayerStartTracking
import net.minecraftforge.event.entity.player.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerStartTracking(PlayerEvent.StartTracking event)
{ sendBackpackStack(event.getTarget(), event.getEntityPlayer()); }
示例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());
}
}