當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。