Added Rose Types + jeb_ Easter egg

This commit is contained in:
piebot 2026-03-14 00:51:31 +03:00
parent 2c6060c26e
commit 00d3ca7b9b
12 changed files with 246 additions and 10 deletions

View file

@ -210,7 +210,16 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM_AUX(Tile::tallgrass_Id, TallGrass::FERN)
ITEM(Tile::deadBush_Id)
ITEM(Tile::flower_Id)
ITEM(Tile::rose_Id)
ITEM_AUX(Tile::rose_Id, 0)
ITEM_AUX(Tile::rose_Id, Rose::BLUE_ORCHID)
ITEM_AUX(Tile::rose_Id, Rose::ALLIUM)
ITEM_AUX(Tile::rose_Id, Rose::AZURE_BLUET)
ITEM_AUX(Tile::rose_Id, Rose::RED_TULIP)
ITEM_AUX(Tile::rose_Id, Rose::ORANGE_TULIP)
ITEM_AUX(Tile::rose_Id, Rose::WHITE_TULIP)
ITEM_AUX(Tile::rose_Id, Rose::PINK_TULIP)
ITEM_AUX(Tile::rose_Id, Rose::OXEYE_DAISY)
ITEM(Tile::mushroom_brown_Id)
ITEM(Tile::mushroom_red_Id)
ITEM(Tile::cactus_Id)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1018,13 +1018,13 @@ void PreStitchedTextureMap::loadUVs()
ADD_ICON(21, 9, L"stone_diorite");
ADD_ICON(21, 10, L"stone_diorite_smooth");
ADD_ICON(22, 1, L"flower_blue_orchid");
ADD_ICON(22, 2, L"flower_allium");
ADD_ICON(22, 3, L"flower_houstonia");
ADD_ICON(22, 4, L"flower_tulip_red");
ADD_ICON(22, 5, L"flower_tulip_orange");
ADD_ICON(22, 6, L"flower_tulip_white");
ADD_ICON(22, 7, L"flower_tulip_pink");
ADD_ICON(22, 8, L"flower_oxeye_daisy");
ADD_ICON(22, 0, L"flower_blue_orchid");
ADD_ICON(22, 1, L"flower_allium");
ADD_ICON(22, 2, L"flower_houstonia");
ADD_ICON(22, 3, L"flower_tulip_red");
ADD_ICON(22, 4, L"flower_tulip_orange");
ADD_ICON(22, 5, L"flower_tulip_white");
ADD_ICON(22, 6, L"flower_tulip_pink");
ADD_ICON(22, 7, L"flower_oxeye_daisy");
}
}

View file

@ -2,6 +2,7 @@
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
#include "SheepFurModel.h"
#include "ModelPart.h"
#include "../Minecraft.World/Sheep.cpp"
SheepFurModel::SheepFurModel() : QuadrupedModel(12, 0)
{
@ -48,6 +49,21 @@ void SheepFurModel::prepareMobModel(shared_ptr<LivingEntity> mob, float time, fl
shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(mob);
head->y = 6 + sheep->getHeadEatPositionScale(a) * 9.0f;
headXRot = sheep->getHeadEatAngleScale(a);
wstring name = mob->getAName();
if (name == L"jeb_")
{
int i1 = 25;
int i = mob->tickCount / 25;
int j = Sheep::COLOR_LENGTH;
int k = i % j;
int l = (i + 1) % j;
float f = ((float)(mob->tickCount % 25) + time) / 25.0F;
const float* afloat1 = Sheep::COLOR[k];
const float* afloat2 = Sheep::COLOR[l];
RenderManager.StateSetColour(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f, 1.0f);
}
}
void SheepFurModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)

View file

@ -3634,6 +3634,8 @@
<ClCompile Include="RailTile.cpp" />
<ClCompile Include="Redstone.cpp" />
<ClCompile Include="RepeaterTile.cpp" />
<ClCompile Include="Rose.cpp" />
<ClInclude Include="Rose.h" />
<ClCompile Include="RotatedPillarTile.cpp" />
<ClCompile Include="Score.cpp" />
<ClCompile Include="Scoreboard.cpp" />

View file

@ -3200,6 +3200,9 @@
<ClInclude Include="Rabbit.h">
<Filter>net\minecraft\world\entity\animal</Filter>
</ClInclude>
<ClInclude Include="Rose.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@ -5632,5 +5635,8 @@
<ClCompile Include="Rabbit.cpp">
<Filter>net\minecraft\world\entity\animal</Filter>
</ClCompile>
<ClCompile Include="Rose.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

141
Minecraft.World/Rose.cpp Normal file
View file

@ -0,0 +1,141 @@
#include "stdafx.h"
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.h"
#include "GrassTile.h"
#include "Rose.h"
const unsigned int Rose::FLOWER_NAMES[FLOWER_NAMES_LENGTH] = { IDS_TILE_ROSE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE };
const wstring Rose::TEXTURE_NAMES[] = {
L"flower_rose",
L"flower_blue_orchid",
L"flower_allium",
L"flower_houstonia",
L"flower_tulip_red",
L"flower_tulip_orange",
L"flower_tulip_white",
L"flower_tulip_pink",
L"flower_oxeye_daisy"
};
bool Rose::mayPlace(Level* level, int x, int y, int z)
{
return Tile::mayPlace(level, x, y, z) && mayPlaceOn(level->getTile(x, y - 1, z));
}
bool Rose::mayPlaceOn(int tile)
{
return tile == Tile::grass_Id || tile == Tile::dirt_Id || tile == Tile::farmland_Id;
}
// 4J Added override
void Rose::updateDefaultShape()
{
float ss = 0.2f;
setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, ss * 3, 0.5f + ss);
}
void Rose::_init()
{
setTicking(true);
updateDefaultShape();
}
Rose::Rose(int id) : Tile(id, Material::plant, isSolidRender())
{
icons = nullptr;
_init();
}
unsigned int Rose::getDescriptionId(int iData)
{
if (iData < 0 || iData >= FLOWER_NAMES_LENGTH) iData = 0;
return FLOWER_NAMES[iData];
}
int Rose::getSpawnResourcesAuxValue(int data)
{
return data;
}
Icon* Rose::getTexture(int face, int data)
{
if (data < 0 || data >= FLOWER_NAMES_LENGTH)
{
data = 0;
}
return icons[data];
}
void Rose::registerIcons(IconRegister* iconRegister)
{
icons = new Icon * [FLOWER_NAMES_LENGTH];
for (int i = 0; i < FLOWER_NAMES_LENGTH; i++)
{
#ifndef _CONTENT_PACKAGE
wprintf(L"Rose::registerIcons: idx=%d name=%ls\n", i, TEXTURE_NAMES[i].c_str());
#endif
icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]);
}
}
void Rose::neighborChanged(Level* level, int x, int y, int z, int type)
{
Tile::neighborChanged(level, x, y, z, type);
checkAlive(level, x, y, z);
}
void Rose::tick(Level* level, int x, int y, int z, Random* random)
{
checkAlive(level, x, y, z);
}
void Rose::checkAlive(Level* level, int x, int y, int z)
{
if (!canSurvive(level, x, y, z))
{
this->spawnResources(level, x, y, z, level->getData(x, y, z), 0);
level->setTileAndData(x, y, z, 0, 0, UPDATE_CLIENTS);
}
}
bool Rose::canSurvive(Level* level, int x, int y, int z)
{
return (level->getDaytimeRawBrightness(x, y, z) >= 8 || (level->canSeeSky(x, y, z))) && mayPlaceOn(level->getTile(x, y - 1, z));
}
AABB* Rose::getAABB(Level* level, int x, int y, int z)
{
return nullptr;
}
bool Rose::blocksLight()
{
return false;
}
bool Rose::isSolidRender(bool isServerLevel)
{
return false;
}
bool Rose::isCubeShaped()
{
return false;
}
int Rose::getRenderShape()
{
return Tile::SHAPE_CROSS_TEXTURE;
}

60
Minecraft.World/Rose.h Normal file
View file

@ -0,0 +1,60 @@
#pragma once
#include "Tile.h"
#include "Material.h"
#include "Definitions.h"
class Random;
class Level;
class Rose : public Tile
{
friend class Tile;
public:
static const int BLUE_ORCHID = 1;
static const int ALLIUM = 2;
static const int AZURE_BLUET = 3;
static const int RED_TULIP = 4;
static const int ORANGE_TULIP = 5;
static const int WHITE_TULIP = 6;
static const int PINK_TULIP = 7;
static const int OXEYE_DAISY = 8;
static const int FLOWER_NAMES_LENGTH = 9;
static const unsigned int FLOWER_NAMES[FLOWER_NAMES_LENGTH];
static const wstring TEXTURE_NAMES[];
private:
Icon** icons;
void _init();
protected:
Rose(int id);
public:
virtual void updateDefaultShape();
virtual bool mayPlace(Level* level, int x, int y, int z);
protected:
virtual bool mayPlaceOn(int tile);
public:
virtual void neighborChanged(Level* level, int x, int y, int z, int type);
virtual void tick(Level* level, int x, int y, int z, Random* random);
protected:
void checkAlive(Level* level, int x, int y, int z);
public:
virtual bool canSurvive(Level* level, int x, int y, int z);
virtual AABB* getAABB(Level* level, int x, int y, int z);
virtual bool blocksLight();
virtual bool isSolidRender(bool isServerLevel = false);
virtual bool isCubeShaped();
virtual int getRenderShape();
virtual Icon* getTexture(int face, int data);
virtual unsigned int getDescriptionId(int iData = -1);
virtual int getSpawnResourcesAuxValue(int data);
void registerIcons(IconRegister* iconRegister);
};

View file

@ -324,7 +324,7 @@ void Tile::staticCtor()
Tile::wool = (new ColoredTile(35, Material::cloth)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_cloth, Item::eMaterial_cloth)->setDestroyTime(0.8f)->setSoundType(Tile::SOUND_CLOTH)->setIconName(L"wool_colored")->setDescriptionId(IDS_TILE_CLOTH)->sendTileData()->setUseDescriptionId(IDS_DESC_WOOL);
Tile::pistonMovingPiece = static_cast<PistonMovingPiece *>((new PistonMovingPiece(36))->setDescriptionId(IDS_TILE_PISTON_BASE)->setUseDescriptionId(-1));
Tile::flower = static_cast<Bush *>((new Bush(37))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"flower_dandelion")->setDescriptionId(IDS_TILE_FLOWER)->setUseDescriptionId(IDS_DESC_FLOWER)->disableMipmap());
Tile::rose = static_cast<Bush *>((new Bush(38))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"flower_rose")->setDescriptionId(IDS_TILE_ROSE)->setUseDescriptionId(IDS_DESC_FLOWER)->disableMipmap());
Tile::rose = static_cast<Bush *>((new Rose(38))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"flower_rose")->setDescriptionId(IDS_TILE_ROSE)->setUseDescriptionId(IDS_DESC_FLOWER)->disableMipmap());
Tile::mushroom_brown = static_cast<Bush *>((new Mushroom(39))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setLightEmission(2 / 16.0f)->setIconName(L"mushroom_brown")->setDescriptionId(IDS_TILE_MUSHROOM)->setUseDescriptionId(IDS_DESC_MUSHROOM)->disableMipmap());
Tile::mushroom_red = static_cast<Bush *>((new Mushroom(40))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"mushroom_red")->setDescriptionId(IDS_TILE_MUSHROOM)->setUseDescriptionId(IDS_DESC_MUSHROOM)->disableMipmap());
@ -521,6 +521,7 @@ void Tile::staticCtor()
Item::items[anvil_Id] = ( new AnvilTileItem(anvil) )->setDescriptionId(IDS_TILE_ANVIL)->setUseDescriptionId(IDS_DESC_ANVIL);
Item::items[dirt_Id] = (new MultiTextureTileItem(Tile::dirt_Id - 256, dirt, (int*)DirtTile::DIRT_NAMES, 3))->setIconName(L"dirt")->setDescriptionId(IDS_TILE_DIRT)->setUseDescriptionId(IDS_DESC_DIRT);
Item::items[stone_Id] = (new MultiTextureTileItem(Tile::stone_Id - 256, dirt, (int*)StoneTile::STONE_NAMES, 3))->setIconName(L"stone")->setDescriptionId(IDS_TILE_STONE)->setUseDescriptionId(IDS_DESC_STONE);
Item::items[rose_Id] = (new MultiTextureTileItem(Tile::rose_Id - 256, rose, (int*)Rose::FLOWER_NAMES, Rose::FLOWER_NAMES_LENGTH))->setIconName(L"flower_rose")->setDescriptionId(IDS_TILE_ROSE)->setUseDescriptionId(IDS_DESC_FLOWER);
for (int i = 0; i < 256; i++)
{

View file

@ -129,5 +129,6 @@
#include "HalfSlabTile.h"
#include "WoodSlabTile.h"
#include "WoolCarpetTile.h"
#include "Rose.h"