本文整理汇总了Java中net.minecraft.network.packet.Packet132TileEntityData类的典型用法代码示例。如果您正苦于以下问题:Java Packet132TileEntityData类的具体用法?Java Packet132TileEntityData怎么用?Java Packet132TileEntityData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Packet132TileEntityData类属于net.minecraft.network.packet包,在下文中一共展示了Packet132TileEntityData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public Packet getDescriptionPacket()
{
NBTTagCompound root = new NBTTagCompound();
NBTTagList nbttaglist = root.getTagList("contents");
for (ItemStack itemStack : contents)
{
nbttaglist.appendTag(itemStack == null ? new NBTTagCompound() : itemStack.writeToNBT(new NBTTagCompound()));
}
root.setTag("contents", nbttaglist);
root.setString("username", username);
root.setCompoundTag("holding", holding == null ? new NBTTagCompound() : holding.writeToNBT(new NBTTagCompound()));
root.setString("text", BSConstants.TEXT_JOINER.join(text));
root.setInteger("age", age);
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 15, root);
}
示例2: onDataPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
@Override
public void onDataPacket( INetworkManager net, Packet132TileEntityData packet )
{
switch( packet.actionType )
{
case 0:
{
this.readFromNBT( packet.data );
worldObj.markBlockForUpdate( xCoord, yCoord, zCoord );
break;
}
default:
{
break;
}
}
}
示例3: func_72468_a
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public void func_72468_a(Packet132TileEntityData p_72468_1_) {
if(this.field_72563_h.field_71441_e.func_72899_e(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c)) {
TileEntity var2 = this.field_72563_h.field_71441_e.func_72796_p(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c);
if(var2 != null) {
if(p_72468_1_.field_73330_d == 1 && var2 instanceof TileEntityMobSpawner) {
var2.func_70307_a(p_72468_1_.field_73331_e);
} else if(p_72468_1_.field_73330_d == 2 && var2 instanceof TileEntityCommandBlock) {
var2.func_70307_a(p_72468_1_.field_73331_e);
} else if(p_72468_1_.field_73330_d == 3 && var2 instanceof TileEntityBeacon) {
var2.func_70307_a(p_72468_1_.field_73331_e);
} else if(p_72468_1_.field_73330_d == 4 && var2 instanceof TileEntitySkull) {
var2.func_70307_a(p_72468_1_.field_73331_e);
}
}
}
}
示例4: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket() {
NBTTagCompound dataTag = new NBTTagCompound();
NBTTagList itemList = new NBTTagList();
for (int i = 0; i < this.inventory.length; i++) {
ItemStack stack = this.inventory[i];
if (stack != null) {
NBTTagCompound tag = new NBTTagCompound();
tag.setByte("Slot", (byte) i);
stack.writeToNBT(tag);
itemList.appendTag(tag);
}
}
dataTag.setTag("AmitStandInventory", itemList);
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, dataTag);
}
示例5: onDataPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet)
{
super.onDataPacket(net, packet);
readFromNBT(packet.data);
NBTTagCompound fluids = packet.data.getCompoundTag("fluids");
fluidsInNetwork = new ArrayList<SpecialFluidStack>();
int[] fluidIDs = fluids.getIntArray("FluidIDs");
for (int i = 0; i < fluidIDs.length; i++)
{
fluidsInNetwork.add(new SpecialFluidStack(fluidIDs[i], fluids.getLong("FluidAmount#" + i)));
}
NBTTagCompound craftableFluids = packet.data.getCompoundTag("craftablefluids");
craftableFluidsInNetwork = new ArrayList<Fluid>();
int[] craftableFluidIDs = craftableFluids.getIntArray("FluidIDs");
for (int i = 0; i < craftableFluidIDs.length; i++)
{
craftableFluidsInNetwork.add(FluidRegistry.getFluid(craftableFluidIDs[i]));
}
currentFluid = FluidRegistry.getFluid(packet.data.getInteger("currentFluid"));
powerStatus = packet.data.getBoolean("powered");
networkReady = packet.data.getBoolean("ready");
worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
}
示例6: onDataPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt)
{
NBTTagList nbttaglist = pkt.data.getTagList("contents");
contents = new ItemStack[nbttaglist.tagCount()];
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
contents[i] = ItemStack.loadItemStackFromNBT((NBTTagCompound) nbttaglist.tagAt(i));
}
username = pkt.data.getString("username");
holding = ItemStack.loadItemStackFromNBT(pkt.data.getCompoundTag("holding"));
text = pkt.data.getString("text").split("\n");
age = pkt.data.getInteger("age");
}
示例7: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
/**
* Overriden in a sign to provide the text.
*/
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.writeToNBT(nbttagcompound);
nbttagcompound.removeTag("SpawnPotentials");
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
示例8: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.writeToNBT( nbttagcompound );
return new Packet132TileEntityData( this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound );
}
示例9: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket()
{
Packet132TileEntityData packet = new Packet132TileEntityData(xCoord, yCoord, zCoord, 5, new NBTTagCompound());
packet.data.setInteger("redstoneMode", redstoneMode);
packet.data.setInteger("crafts", crafts);
return packet;
}
示例10: onDataPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
@Override
public void onDataPacket(INetworkManager manager, Packet132TileEntityData packet) {
switch (packet.actionType) {
case DATA_CLIENT:
readFromNBT(packet.data);
break;
case DATA_POKE:
onPoke();
break;
case DATA_DATA:
onData(packet.data);
break;
}
}
示例11: handleTileEntityData
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData)
{
if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition))
{
TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition);
if (tileentity != null)
{
if (par1Packet132TileEntityData.actionType == 1 && tileentity instanceof TileEntityMobSpawner)
{
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
else if (par1Packet132TileEntityData.actionType == 2 && tileentity instanceof TileEntityCommandBlock)
{
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
else if (par1Packet132TileEntityData.actionType == 3 && tileentity instanceof TileEntityBeacon)
{
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
else if (par1Packet132TileEntityData.actionType == 4 && tileentity instanceof TileEntitySkull)
{
tileentity.readFromNBT(par1Packet132TileEntityData.data);
}
else
{
tileentity.onDataPacket(netManager, par1Packet132TileEntityData);
}
}
}
}
示例12: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
/**
* Overriden in a sign to provide the text.
*/
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.writeToNBT(nbttagcompound);
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, nbttagcompound);
}
示例13: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
/**
* Overriden in a sign to provide the text.
*/
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.writeToNBT(nbttagcompound);
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, nbttagcompound);
}
示例14: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
/**
* Overriden in a sign to provide the text.
*/
public Packet getDescriptionPacket()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.writeToNBT(nbttagcompound);
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound);
}
示例15: getDescriptionPacket
import net.minecraft.network.packet.Packet132TileEntityData; //导入依赖的package包/类
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
if (magitank.getFluid() != null) {
nbt.setInteger("Magi", magitank.getFluid().amount);
}
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, nbt);
}