Search in sources :

Example 1 with PlayerPointer

use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.

the class EntityEquipmentDataManager method onStopTracking.

@SubscribeEvent
public void onStopTracking(PlayerEvent.StopTracking event) {
    if (event.target instanceof EntityPlayerMP) {
        EntityPlayerMP target = (EntityPlayerMP) event.target;
        MessageServerPlayerLeftTrackingRange message = new MessageServerPlayerLeftTrackingRange(new PlayerPointer(target));
        PacketHandler.networkWrapper.sendTo(message, (EntityPlayerMP) event.entityPlayer);
    }
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) MessageServerPlayerLeftTrackingRange(riskyken.armourersWorkshop.common.network.messages.server.MessageServerPlayerLeftTrackingRange) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 2 with PlayerPointer

use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.

the class ExPropsPlayerSkinData method checkAndSendCustomArmourDataTo.

private void checkAndSendCustomArmourDataTo(EntityPlayerMP targetPlayer) {
    PlayerPointer playerPointer = new PlayerPointer(player);
    PacketHandler.networkWrapper.sendTo(new MessageServerSkinInfoUpdate(playerPointer, equipmentData), targetPlayer);
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) MessageServerSkinInfoUpdate(riskyken.armourersWorkshop.common.network.messages.server.MessageServerSkinInfoUpdate)

Example 3 with PlayerPointer

use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.

the class ExPropsPlayerSkinData method sendNakedData.

private void sendNakedData(EntityPlayerMP targetPlayer) {
    PlayerPointer playerPointer = new PlayerPointer(player);
    PacketHandler.networkWrapper.sendTo(new MessageServerSkinWardrobeUpdate(playerPointer, this.equipmentWardrobeData), targetPlayer);
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) MessageServerSkinWardrobeUpdate(riskyken.armourersWorkshop.common.network.messages.server.MessageServerSkinWardrobeUpdate)

Example 4 with PlayerPointer

use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.

the class ExPropsPlayerSkinData method updateEquipmentDataToPlayersAround.

public void updateEquipmentDataToPlayersAround() {
    if (!allowNetworkUpdates) {
        return;
    }
    TargetPoint p = new TargetPoint(player.dimension, player.posX, player.posY, player.posZ, 512);
    PlayerPointer playerPointer = new PlayerPointer(player);
    PacketHandler.networkWrapper.sendToAllAround(new MessageServerSkinInfoUpdate(playerPointer, equipmentData), p);
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) MessageServerSkinInfoUpdate(riskyken.armourersWorkshop.common.network.messages.server.MessageServerSkinInfoUpdate) TargetPoint(cpw.mods.fml.common.network.NetworkRegistry.TargetPoint)

Example 5 with PlayerPointer

use of riskyken.armourersWorkshop.common.data.PlayerPointer in project Armourers-Workshop by RiskyKen.

the class SkinModelRenderer method onRender.

@SubscribeEvent
public void onRender(RenderPlayerEvent.Pre event) {
    EntityPlayer player = event.entityPlayer;
    targetPlayer = player;
    if (ClientProxy.getSkinRenderType() == SkinRenderType.MODEL_ATTACHMENT) {
        attachModelsToBiped(event.renderer.modelBipedMain, event.renderer);
    }
    if (player.getGameProfile() == null) {
        return;
    }
    PlayerPointer playerPointer = new PlayerPointer(player);
    // A proper lady should not swing her legs around!
    if (isPlayerWearingSkirt(playerPointer)) {
        EquipmentWardrobeData ewd = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(playerPointer);
        if (ewd != null && ewd.limitLimbs) {
            if (player.limbSwingAmount > 0.25F) {
                player.limbSwingAmount = 0.25F;
                player.prevLimbSwingAmount = 0.25F;
            }
        }
    }
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData) EntityPlayer(net.minecraft.entity.player.EntityPlayer) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

PlayerPointer (riskyken.armourersWorkshop.common.data.PlayerPointer)24 EquipmentWardrobeData (riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)11 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)8 AbstractClientPlayer (net.minecraft.client.entity.AbstractClientPlayer)7 EntityPlayer (net.minecraft.entity.player.EntityPlayer)7 MannequinFakePlayer (riskyken.armourersWorkshop.client.render.MannequinFakePlayer)6 ISkinDye (riskyken.armourersWorkshop.api.common.skin.data.ISkinDye)4 EntityEquipmentData (riskyken.armourersWorkshop.common.skin.EntityEquipmentData)4 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)3 ItemStack (net.minecraft.item.ItemStack)3 FakePlayer (net.minecraftforge.common.util.FakePlayer)3 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)3 TargetPoint (cpw.mods.fml.common.network.NetworkRegistry.TargetPoint)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 Color (java.awt.Color)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 ISkinPointer (riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer)2 EntityTextureInfo (riskyken.armourersWorkshop.client.render.EntityTextureInfo)2 MessageServerSkinInfoUpdate (riskyken.armourersWorkshop.common.network.messages.server.MessageServerSkinInfoUpdate)2 MessageServerSkinWardrobeUpdate (riskyken.armourersWorkshop.common.network.messages.server.MessageServerSkinWardrobeUpdate)2