mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Add PatchManager - Allows you to patch terrain.png and items.png on the fly.
This can be used for modding, since you don't need to share copyrighted Mojang assets alongside your texture patches.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "Tile.hpp"
|
||||
#include "world/level/Level.hpp"
|
||||
#include "client/renderer/PatchManager.hpp"
|
||||
|
||||
MetalTile::MetalTile(int ID, int texture, Material* pMtl) : Tile(ID, pMtl)
|
||||
{
|
||||
@@ -19,5 +20,12 @@ MetalTile::MetalTile(int ID, int texture, Material* pMtl) : Tile(ID, pMtl)
|
||||
// textures for these tiles. :)
|
||||
int MetalTile::getTexture(int dir)
|
||||
{
|
||||
return m_TextureFrame;
|
||||
int yoff = GetPatchManager()->GetMetalSideYOffset();
|
||||
if (yoff < 0)
|
||||
return m_TextureFrame;
|
||||
|
||||
if (dir == DIR_YPOS) return m_TextureFrame;
|
||||
if (dir == DIR_YNEG) return m_TextureFrame + 16 * (yoff + 1);
|
||||
|
||||
return m_TextureFrame + 16 * (yoff + 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user