Cuberite Forum

Full Version: Set frame by plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can not understand in any way as to set a frame on (X, Y, Z)
Please help meBlush
Any ideas?
I don't think there's an API for that yet. Sorry.
I believe there is: http://mc-server.xoft.cz/LuaAPI/cItemFrame.html

Or at least if that's the frame that you mean.

World:ForEachEntityInBox(cBoundingBox(X, X, Y, Y, Z, Z),
 function(a_Entity
  if (not a_Entity:IsItemFrame()) then
   return false
  end
  tolua.cast(a_Entity, "cItemFrame"):SetItem(MycItem)
 end
)
Oh, right, the server keeps surprising me, we're better than I expect Smile
Thank you. I'll try it.
(01-18-2016, 06:30 PM)NiLSPACE Wrote: [ -> ]I believe there is: http://mc-server.xoft.cz/LuaAPI/cItemFrame.html

Or at least if that's the frame that you mean.

World:ForEachEntityInBox(cBoundingBox(X, X, Y, Y, Z, Z),
 function(a_Entity
  if (not a_Entity:IsItemFrame()) then
   return false
  end
  tolua.cast(a_Entity, "cItemFrame"):SetItem(MycItem)
 end
)

Thank you. But, I want to install a lot of frames on the wall. Not items into frames.
Oh, I'm afraid we don't have an API to create those. It should be fairly easy to do. Just put this in a cWorld method. Something like this:
Uint32 cWorld:SpawnPainting(double a_PosX, double a_PosY, double a_PosZ, eBlockFace a_BlockFace, AString a_PaintingName)
{
	cPainting * Painting = new cPainting(a_PaintingName, a_BlockFace, a_PosX, a_PosY, a_PosZ);
	Painting->Initialize(*this);
	return Painting->GetUniqueID();
}