本文整理匯總了Java中net.minecraft.tileentity.TileEntity.func_183000_F方法的典型用法代碼示例。如果您正苦於以下問題:Java TileEntity.func_183000_F方法的具體用法?Java TileEntity.func_183000_F怎麽用?Java TileEntity.func_183000_F使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.tileentity.TileEntity
的用法示例。
在下文中一共展示了TileEntity.func_183000_F方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setTileEntityNBT
import net.minecraft.tileentity.TileEntity; //導入方法依賴的package包/類
public static boolean setTileEntityNBT(World worldIn, EntityPlayer pos, BlockPos stack, ItemStack p_179224_3_)
{
MinecraftServer minecraftserver = MinecraftServer.getServer();
if (minecraftserver == null)
{
return false;
}
else
{
if (p_179224_3_.hasTagCompound() && p_179224_3_.getTagCompound().hasKey("BlockEntityTag", 10))
{
TileEntity tileentity = worldIn.getTileEntity(stack);
if (tileentity != null)
{
if (!worldIn.isRemote && tileentity.func_183000_F() && !minecraftserver.getConfigurationManager().canSendCommands(pos.getGameProfile()))
{
return false;
}
NBTTagCompound nbttagcompound = new NBTTagCompound();
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy();
tileentity.writeToNBT(nbttagcompound);
NBTTagCompound nbttagcompound2 = (NBTTagCompound)p_179224_3_.getTagCompound().getTag("BlockEntityTag");
nbttagcompound.merge(nbttagcompound2);
nbttagcompound.setInteger("x", stack.getX());
nbttagcompound.setInteger("y", stack.getY());
nbttagcompound.setInteger("z", stack.getZ());
if (!nbttagcompound.equals(nbttagcompound1))
{
tileentity.readFromNBT(nbttagcompound);
tileentity.markDirty();
return true;
}
}
}
return false;
}
}