aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StoneMonsterTile.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/StoneMonsterTile.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/StoneMonsterTile.cpp')
-rw-r--r--Minecraft.World/StoneMonsterTile.cpp73
1 files changed, 40 insertions, 33 deletions
diff --git a/Minecraft.World/StoneMonsterTile.cpp b/Minecraft.World/StoneMonsterTile.cpp
index d3d6a846..ec31992f 100644
--- a/Minecraft.World/StoneMonsterTile.cpp
+++ b/Minecraft.World/StoneMonsterTile.cpp
@@ -1,29 +1,36 @@
#include "stdafx.h"
#include "net.minecraft.world.entity.monster.h"
#include "net.minecraft.world.level.h"
+#include "net.minecraft.world.level.tile.h"
#include "StoneMonsterTile.h"
const unsigned int StoneMonsterTile::STONE_MONSTER_NAMES[STONE_MONSTER_NAMES_LENGTH] = { IDS_TILE_STONE_SILVERFISH,
- IDS_TILE_STONE_SILVERFISH_COBBLESTONE,
- IDS_TILE_STONE_SILVERFISH_STONE_BRICK,
- };
+ IDS_TILE_STONE_SILVERFISH_COBBLESTONE,
+ IDS_TILE_STONE_SILVERFISH_STONE_BRICK,
+};
StoneMonsterTile::StoneMonsterTile(int id) : Tile(id, Material::clay)
{
- setDestroyTime(0);
+ setDestroyTime(0);
}
Icon *StoneMonsterTile::getTexture(int face, int data)
{
- if (data == HOST_COBBLE)
+#ifndef _CONTENT_PACKAGE
+ if(app.DebugArtToolsOn())
{
- return Tile::stoneBrick->getTexture(face);
- }
- if (data == HOST_STONEBRICK)
+ return Tile::fire->getTexture(face, 0);
+ }
+#endif
+ if (data == HOST_COBBLE)
+ {
+ return Tile::cobblestone->getTexture(face);
+ }
+ if (data == HOST_STONEBRICK)
{
- return Tile::stoneBrickSmooth->getTexture(face);
- }
- return Tile::rock->getTexture(face);
+ return Tile::stoneBrick->getTexture(face);
+ }
+ return Tile::stone->getTexture(face);
}
void StoneMonsterTile::registerIcons(IconRegister *iconRegister)
@@ -33,7 +40,7 @@ void StoneMonsterTile::registerIcons(IconRegister *iconRegister)
void StoneMonsterTile::destroy(Level *level, int x, int y, int z, int data)
{
- if (!level->isClientSide)
+ if (!level->isClientSide)
{
// 4J - limit total amount of monsters. The normal map spawning limits these to 50, and mobspawning tiles limit to 60, so give ourselves a bit of headroom here to also be able to make silverfish
if(level->countInstanceOf( eTYPE_MONSTER, false) < 70 )
@@ -48,8 +55,8 @@ void StoneMonsterTile::destroy(Level *level, int x, int y, int z, int data)
silverfish->spawnAnim();
}
}
- }
- Tile::destroy(level, x, y, z, data);
+ }
+ Tile::destroy(level, x, y, z, data);
}
int StoneMonsterTile::getResourceCount(Random *random)
@@ -59,20 +66,20 @@ int StoneMonsterTile::getResourceCount(Random *random)
bool StoneMonsterTile::isCompatibleHostBlock(int block)
{
- return block == Tile::rock_Id || block == Tile::stoneBrick_Id || block == Tile::stoneBrickSmooth_Id;
+ return block == Tile::stone_Id || block == Tile::cobblestone_Id || block == Tile::stoneBrick_Id;
}
int StoneMonsterTile::getDataForHostBlock(int block)
{
- if (block == Tile::stoneBrick_Id)
+ if (block == Tile::cobblestone_Id)
{
- return HOST_COBBLE;
- }
- if (block == Tile::stoneBrickSmooth_Id)
+ return HOST_COBBLE;
+ }
+ if (block == Tile::stoneBrick_Id)
{
- return HOST_STONEBRICK;
- }
- return HOST_ROCK;
+ return HOST_STONEBRICK;
+ }
+ return HOST_ROCK;
}
Tile *StoneMonsterTile::getHostBlockForData(int data)
@@ -80,26 +87,26 @@ Tile *StoneMonsterTile::getHostBlockForData(int data)
switch (data)
{
case HOST_COBBLE:
- return Tile::stoneBrick;
+ return Tile::cobblestone;
case HOST_STONEBRICK:
- return Tile::stoneBrickSmooth;
+ return Tile::stoneBrick;
default:
- return Tile::rock;
+ return Tile::stone;
}
}
shared_ptr<ItemInstance> StoneMonsterTile::getSilkTouchItemInstance(int data)
{
- Tile *tile = Tile::rock;
- if (data == HOST_COBBLE)
+ Tile *tile = Tile::stone;
+ if (data == HOST_COBBLE)
{
- tile = Tile::stoneBrick;
- }
- if (data == HOST_STONEBRICK)
+ tile = Tile::cobblestone;
+ }
+ if (data == HOST_STONEBRICK)
{
- tile = Tile::stoneBrickSmooth;
- }
- return shared_ptr<ItemInstance>(new ItemInstance(tile));
+ tile = Tile::stoneBrick;
+ }
+ return shared_ptr<ItemInstance>(new ItemInstance(tile));
}
int StoneMonsterTile::cloneTileData(Level *level, int x, int y, int z)