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


Java ByteBufUtils.readTag方法代码示例

本文整理汇总了Java中cpw.mods.fml.common.network.ByteBufUtils.readTag方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufUtils.readTag方法的具体用法?Java ByteBufUtils.readTag怎么用?Java ByteBufUtils.readTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.common.network.ByteBufUtils的用法示例。


在下文中一共展示了ByteBufUtils.readTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	player = tag.getString("player");
	switch (tag.getInteger("type")) {
		case 0:
			buttonType = EnumButtonType.DISTRIBUTE;
			break;
		case 1:
			buttonType = EnumButtonType.SMART_ASSIST;
			break;
		case 2:
			buttonType = EnumButtonType.REMOVE;
			break;
	}
	world = WorldUtils.getWorldFromDimensionId(tag.getInteger("dim"));
}
 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:18,代码来源:ClipboardButtonPressPacket.java

示例2: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    NBTTagCompound data = ByteBufUtils.readTag(buf);
    x = data.getInteger("x");
    y = data.getInteger("y");
    z = data.getInteger("z");
    once = data.getBoolean("once");
}
 
开发者ID:XFactHD,项目名称:RFUtilities,代码行数:10,代码来源:PacketSetTransferMode.java

示例3: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) 
{
 entityId = ByteBufUtils.readVarInt(buf, 4);
 entitySyncDataCompound = ByteBufUtils.readTag(buf); // this class is very useful in general for writing more complex objects
 // DEBUG
 System.out.println("fromBytes");
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:9,代码来源:MessageSyncEntityToServer.java

示例4: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	startTime = tag.getLong("startTime");
	time = tag.getInteger("time");
	profile = new GameProfile(UUID.fromString(tag.getString("uuid")), tag.getString("name"));
}
 
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:8,代码来源:TimeUpdatePacket.java

示例5: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	world = WorldUtils.getWorldFromDimensionId(tag.getInteger("dim"));
	x = tag.getInteger("x");
	y = tag.getInteger("y");
	z = tag.getInteger("z");
	updateData = tag.getCompoundTag("tag");
}
 
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:10,代码来源:TileEntityClientUpdatePacket.java

示例6: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	configName = tag.getString("configName");
	config = tag.getString("config");
	isRevert = tag.getBoolean("isRevert");
}
 
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:8,代码来源:ConfigPacket.java

示例7: handle

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void handle(ByteBuf data, EntityPlayer player) {
	int dimension = data.readInt();
	int xPos = data.readInt();
	int yPos = data.readInt();
	int zPos = data.readInt();
	NBTTagCompound nbt = ByteBufUtils.readTag(data);

	WorldClient proxyworld = ProxyWorldManager.getProxyworld(dimension);
	if (proxyworld == null) return;
	if (proxyworld.provider.dimensionId != dimension) return;
	if (proxyworld.blockExists(xPos, yPos, zPos)) {
		TileEntity tileentity = proxyworld.getTileEntity(xPos, yPos, zPos);

		if (tileentity != null) {
			tileentity.readFromNBT(nbt);
		} else {
			//Create tile entity from data
			tileentity = TileEntity.createAndLoadEntity(nbt);
			if (tileentity != null) {
				proxyworld.addTileEntity(tileentity);
			}
		}
		proxyworld.markTileEntityChunkModified(xPos, yPos, zPos, tileentity);
		proxyworld.setTileEntity(xPos, yPos, zPos, tileentity);
		proxyworld.markBlockForUpdate(xPos, yPos, zPos);
	}
}
 
开发者ID:XCompWiz,项目名称:LookingGlass,代码行数:29,代码来源:PacketTileEntityNBT.java

示例8: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	world = WorldUtils.getWorldFromDimensionId(tag.getInteger("dim"));
	isEntity = tag.getBoolean("isEntity");
	if (isEntity) 
		entityId = tag.getInteger("entityId");
	else {
		x = tag.getInteger("x");
		y = tag.getInteger("y");
		z = tag.getInteger("z");
	}
	player = (EntityPlayer) world.getEntityByID(tag.getInteger("player"));
}
 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:15,代码来源:TransmutePacket.java

示例9: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound tag = ByteBufUtils.readTag(buf);
	world = WorldUtils.getWorldFromDimensionId(tag.getInteger("dim"));
	x = tag.getDouble("x");
	y = tag.getDouble("y");
	z = tag.getDouble("z");
}
 
开发者ID:austinv11,项目名称:DartCraft2,代码行数:9,代码来源:DartCraftEffectPacket.java

示例10: decodeInto

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
    NBTTagCompound data = ByteBufUtils.readTag(buffer);
    ptm = new PortalTextureManager();

    if (data.hasKey("Texture"))
        ptm.readFromNBT(data, "Texture");

    name = data.getString("name");
    glyphs = data.getString("glyphs");
}
 
开发者ID:enhancedportals,项目名称:enhancedportals,代码行数:12,代码来源:PacketTextureData.java

示例11: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	NBTTagCompound data = ByteBufUtils.readTag(buf);
	player = MinecraftServer.getServer().worldServerForDimension(data.getInteger("dim")).func_152378_a(UUID.fromString(data.getString("player")));
	fixed = data.getBoolean("fixed");
	mode = data.getInteger("mode");
}
 
开发者ID:Elix-x,项目名称:toolscompressor,代码行数:8,代码来源:OnKeyOnCTMessage.java

示例12: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    location = new int[3];
    for (int i=0;i<3;i++)
    {
        location[i] = ByteBufUtils.readVarInt(buf,5);
    }
    tagCompound = ByteBufUtils.readTag(buf);
}
 
开发者ID:M4thG33k,项目名称:M4thThings,代码行数:11,代码来源:PacketNBT.java

示例13: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    NBTTagCompound tagCompound = ByteBufUtils.readTag(buf);

    try {
        this.playerUUID = UUID.fromString(tagCompound.getString("playerUUID"));
        this.guiID = tagCompound.getInteger("guiID");
    }
    catch (IllegalArgumentException ex) {
        LogHelper.info("Converting UUID from Bytes failed.");
        ex.printStackTrace();
    }
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:14,代码来源:MessageOpenGui.java

示例14: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    NBTTagCompound tag = ByteBufUtils.readTag(buf);
    if (tag != null && tag.hasKey("KnownItems", 9)) {
        NBTTagList tagList = tag.getTagList("KnownItems", 10);
        for (int i = 0; i < tagList.tagCount(); i++) {
            NBTTagCompound itemTag = tagList.getCompoundTagAt(i);
            this.knownTransmutations.add(ItemStack.loadItemStackFromNBT(itemTag));
        }
    }
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:12,代码来源:MessageKnowledge.java

示例15: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override 
public void fromBytes ( ByteBuf buf ) {
	
   try {
	   
	   if ( buf . readBoolean ( ) ) {

		   NBTTagCompound data = ByteBufUtils . readTag ( buf ) ;

		   is = ItemStack . loadItemStackFromNBT ( data ) ;

		   data = null ;
		   
 }

   } catch ( Exception ex ) {
	   
	   ex . printStackTrace ( ) ;
	   
   }

}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:23,代码来源:ItemMergedPacket.java


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