当前位置: 首页>>代码示例>>Java>>正文


Java PlayerManagerTFC类代码示例

本文整理汇总了Java中com.bioxx.tfc.Core.Player.PlayerManagerTFC的典型用法代码示例。如果您正苦于以下问题:Java PlayerManagerTFC类的具体用法?Java PlayerManagerTFC怎么用?Java PlayerManagerTFC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PlayerManagerTFC类属于com.bioxx.tfc.Core.Player包,在下文中一共展示了PlayerManagerTFC类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onKeyInput

import com.bioxx.tfc.Core.Player.PlayerManagerTFC; //导入依赖的package包/类
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    PlayerInfo pi = PlayerManagerTFC.getInstance().getClientPlayer();
    EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;

    if (FMLClientHandler.instance().getClient().inGameHasFocus &&
            FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem() != null &&
            FMLClientHandler.instance().getClient().currentScreen == null) {
        if (Key_PrevChiselMode.isPressed()) {
            if (player.getCurrentEquippedItem().getItem() instanceof ItemChisel) {
                pi.setChiselMode(prevChiselMode(pi));
                //Let's send the actual ChiselMode so the server/client does not
                //come out of sync.
                AbstractPacket pkt = new KeyPressPacket(pi.chiselMode);
                TerraFirmaCraft.PACKET_PIPELINE.sendToServer(pkt);

            }
        }
    }
}
 
开发者ID:raymondbh,项目名称:TFC-Additions,代码行数:21,代码来源:KeyBindingHandler.java

示例2: actionHandlerBuy

import com.bioxx.tfc.Core.Player.PlayerManagerTFC; //导入依赖的package包/类
private void actionHandlerBuy(NBTTagCompound nbt)
{
	UUID actionPlayerID = UUID.fromString(nbt.getString("playerID"));
	UUID playerID = PlayerManagerTFC.getInstance().getPlayerInfoFromPlayer(this.entityplayer).playerUUID;
	
	if(!actionPlayerID.equals(playerID))
		return;
	
    NBTTagCompound itemTag = nbt.getCompoundTag("Item");
    ItemStack itemStack = ItemStack.loadItemStackFromNBT(itemTag);
    
    this.entityplayer.inventory.setItemStack(itemStack);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:14,代码来源:TileEntityStall.java

示例3: actionSelectLimit

import com.bioxx.tfc.Core.Player.PlayerManagerTFC; //导入依赖的package包/类
public void actionSelectLimit(int goodSlotIndex)
{
    _activeGoodSlotIndex = goodSlotIndex;
    
    NBTTagCompound nbt = new NBTTagCompound();
    nbt.setByte("Action", _actionId_SelectLimit);
    
    nbt.setString("playername", PlayerManagerTFC.getInstance().getClientPlayer().playerName);
    nbt.setInteger("GoodSlotIndex", goodSlotIndex);
    
    this.broadcastPacketInRange(this.createDataPacket(nbt));

    this.worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:15,代码来源:TileEntityStall.java

示例4: actionSetLimit

import com.bioxx.tfc.Core.Player.PlayerManagerTFC; //导入依赖的package包/类
public void actionSetLimit(int goodSlotIndex, Integer limit)
{
    NBTTagCompound nbt = new NBTTagCompound();
    nbt.setByte("Action", _actionId_SetLimit);
    
    nbt.setString("playername", PlayerManagerTFC.getInstance().getClientPlayer().playerName);
    nbt.setInteger("GoodSlotIndex", goodSlotIndex);
    
    if(limit != null)
        nbt.setInteger("Limit", limit);
    
    this.broadcastPacketInRange(this.createDataPacket(nbt));

    this.worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:16,代码来源:TileEntityStall.java

示例5: actionBuy

import com.bioxx.tfc.Core.Player.PlayerManagerTFC; //导入依赖的package包/类
public void actionBuy(ItemStack itemStack)
{
    NBTTagCompound nbt = new NBTTagCompound();
    nbt.setByte("Action", _actionId_Buy);
    
    nbt.setString("playerID", PlayerManagerTFC.getInstance().getClientPlayer().playerUUID.toString());
    
    NBTTagCompound itemTag = new NBTTagCompound();
    itemStack.writeToNBT(itemTag);
    
    nbt.setTag("Item", itemTag);
    
    this.broadcastPacketInRange(this.createDataPacket(nbt));

    this.worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
 
开发者ID:Aleksey-Terzi,项目名称:MerchantsTFC,代码行数:17,代码来源:TileEntityStall.java


注:本文中的com.bioxx.tfc.Core.Player.PlayerManagerTFC类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。