mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-26 21:26:38 +01:00
Patch Notes: Blocks + Colored shulker boxes + Concrete powder + Concrete + Glazed terracotta Items + Shulker shell + Iron nugget UI Changes + Added Custom Controls to Keyboard & Mouse, as well as Controller + Added Custom SuperFlat + Added Edit Server Menu + Added Firework Crafting Feature Changes + Host Options + Added Pick Block + Added off-hand slot for maps and arrows. Bug Fixes & changes + TU47: Banner hitbox wrong (and inventory model fixed) + TU47/48: Ice not melting properly + TU48: Dead bushes not dropping sticks + TU48: Guardians and polar bears not dropping cooked fish when on fire + TU48: Bonus chest missing saplings and seeds + TU48: Frosted ice obtainable + TU48: Hoppers not collecting items + TU48: Wither skeletons spawning in 2-high gaps + TU48: End crystals exploding with “TNT Explodes” off + TU48: Tamed ocelots staying hostile + TU48: Signs not placing on tall grass + TU51: Skeleton hitbox wrong + TU53: Fall damage in shallow water + TU53: Squids not spawning in man-made pools + Elytra has been improved to be more accurate to the source material + Removed Spectral Arrow from crafting + Fixed several broken item descriptions + You can no longer cook Pufferfish or Clownfish + Fixed scaling issue with paperdoll and chat + Iron and gold armor can now be smelted into nuggets. + More items can now be used as fuel in a furnace. + Using a firework rocket while gliding with elytra will now give the player a boost. + Changed the color of dyes, wool, carpets, and banners. + Reordered all colored blocks and items in the Creative inventory. Banners now have the same order of colors as all other colored blocks and items. + Fishing rods can now hook on entities without causing knockback or pseudo-damage. + Fixed banner crafting + Fixed Map colors for certain blocks + Fixed Path block height + Fixed String block issues + Fixed Item frame culling. + Fixed Tutorial world NBT/Block State issues + Fixed World Slider + Fixed Enderman AI + Fixed Player animation bug + HUD Flash text changes + Generation accuracy changes + Many other small accuracy changes and fixes
149 lines
3.2 KiB
C++
149 lines
3.2 KiB
C++
#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_BLUE_ORCHID, IDS_TILE_ALLIUM, IDS_TILE_HOUSTONIA, IDS_TILE_TULIP_RED,
|
|
IDS_TILE_TULIP_ORANGE, IDS_TILE_TULIP_WHITE, IDS_TILE_TULIP_PINK, IDS_TILE_OXEYE_DAISY
|
|
};
|
|
|
|
const unsigned int Rose::FLOWER_DESCRIPTIONS[FLOWER_NAMES_LENGTH] = {
|
|
IDS_DESC_ROSE, IDS_DESC_BLUE_ORCHID, IDS_DESC_ALLIUM, IDS_DESC_HOUSTONIA, IDS_DESC_TULIP_RED,
|
|
IDS_DESC_TULIP_ORANGE, IDS_DESC_TULIP_WHITE, IDS_DESC_TULIP_PINK, IDS_DESC_OXEYE_DAISY
|
|
};
|
|
|
|
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_DESCRIPTIONS[iData];
|
|
}
|
|
|
|
unsigned int Rose::getUseDescriptionId(int iData)
|
|
{
|
|
if (iData < 0 || iData >= FLOWER_NAMES_LENGTH) iData = 0;
|
|
|
|
return FLOWER_DESCRIPTIONS[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;
|
|
}
|