Skip to content

Remaining Entities and Tiles#664

Open
Wilyicaro wants to merge 8 commits into
nbcraft-org:masterfrom
Wilyicaro:remaining-entities-and-tiles
Open

Remaining Entities and Tiles#664
Wilyicaro wants to merge 8 commits into
nbcraft-org:masterfrom
Wilyicaro:remaining-entities-and-tiles

Conversation

@Wilyicaro

@Wilyicaro Wilyicaro commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Entities

  • Minecart (default, chest and furnace)
  • Boat
  • Painting
  • Wolf
  • Lightning Bolt

Tiles and Tile Entities

  • Mob Spawner
  • Sign
  • Record Player (only the tile entity)
  • Piston and Sticky Piston (PistonBaseTile, PistonHeadTile and MovingPistonTile)
  • Mushroom (it was using Bush beforehand)

Related Items

  • Saddle
  • Minecart
  • Boat
  • Painting
  • Sign
  • Piston

Misc and Fixes

  • Fixed Ghast shooting at the wrong direction
  • Riddeable Pig
  • Reduced repeated code between the projectiles (it could be better)
  • Weather (rain and snow, with its own shader material)
  • Tile Entity Renderer
  • Enhanced the rendering of tile faces, so it supports face rotation and doesn't repeat code for different face directions
  • BiomeSource supports checking bigger areas now
  • ImprovedNoise and PerlinNoise are accurate to Java (still using floats)

Comment thread GameMods.hpp
//#define ENH_RENDER_HAND_ARMOR // Render the right arm of the chestplate you are wearing on top the first-person hand.
#define ENH_SAVE_REMOTE_PLAYERS // Save remote player data on the server, such as inventory, position, health, etc.
//#define ENH_BETA_1_7_TERRAIN_ATLAS // Enables support for the vertical shift of some textures from Beta 1.7, such as cake
#define ENH_BETA_1_7_TERRAIN_ATLAS // Enables support for the vertical shift of some textures from Beta 1.7, such as cake

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default terrain.png needs to be updated to accommodate this.

@BrentDaMage BrentDaMage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review. More tomorrow.

Comment thread compat/KeyCodes.hpp
#define AKEYCODE_FORWARD_DEL VK_DELETE
#define AKEYCODE_ARROW_LEFT VK_LEFT
#define AKEYCODE_ARROW_RIGHT VK_RIGHT
#define AKEYCODE_DEL VK_BACK

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

"blendDst": "OneMinusSrcAlpha",

"vertexShader" : "shaders/uv.vertex",
"fragmentShader" : "shaders/texture_ccolor.fragment"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we need ccolor here? I don't think rain or snow ever gets recolored live, unless we need it for alpha or something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it for the alpha

"Blending",
"Textured"],

"blendSrc": "SourceAlpha",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are default and don't need to be specified.

{
int x = m_width / 2 - 50;
int y = m_height / 4 + 20;
VirtualKeyboard keyboard;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line above this

VirtualKeyboard keyboard;
keyboard.rect = IntRectangle(x / Gui::GuiScale, y / Gui::GuiScale, (x + 100) / Gui::GuiScale, (y + 100) / Gui::GuiScale);
m_pMinecraft->m_pPlatform->showKeyboard(0, keyboard);
m_btnDone.m_xPos = m_width / 2 - 100;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line above this

TileData auxValue = m_pLevel->getData(pos);

m_pMinecraft->m_pParticleEngine->destroyEffect(pos);
m_pMinecraft->m_pParticleEngine->destroyEffect(pos, pTile->m_ID, auxValue);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

_addRenderer(Entity::RENDER_GIANT, new GiantMobRenderer( new ZombieModel, 0.5f, 6.0f));
_addRenderer(Entity::RENDER_SLIME, new SlimeRenderer( new SlimeModel(16), new SlimeModel(0), 0.25f));
_addRenderer(Entity::RENDER_GHAST, new GhastRenderer());
_addRenderer(Entity::RENDER_WOLF, new WolfRenderer(new WolfModel, 0.5f));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make indentation in-line with the others up top

_addRenderer(Entity::RENDER_MINECART, new MinecartRenderer());
_addRenderer(Entity::RENDER_BOAT, new BoatRenderer());
_addRenderer(Entity::RENDER_PAINTING, new PaintingRenderer());
_addRenderer(Entity::RENDER_LIGHTNING_BOLT, new LightningBoltRenderer());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make all of the others in-line with this


var10.begin(mce::PRIMITIVE_MODE_TRIANGLE_STRIP, 10);
float var31 = 0.5f;
var10.color(0.9f * var31, 0.9f * var31, 1.0f * var31, 0.3f);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably get away with just doing the currentShaderColor here and switching off of the vertex-color entity shader.

}
Lighting::turnOn();
}
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

@BrentDaMage BrentDaMage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review. Half way there.

p1 = p;

cPos.x += p->x - smoothPos.x;
cPos.y += (p0->y + p1->y) / 2.0 - smoothPos.y;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the fs here

{
MatrixStack::Ref tileMatrix = MatrixStack::World.push();
bindTexture(C_TERRAIN_NAME);
float ss = 0.75F;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make Fs lowercase and make


protected:
Model* m_pModel;
TileRenderer m_tileRenderer;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be using a the singleton here or something instead of making a new one specifically for this? Better yet, we should do what the FallingTileRenderer does.

bindTexture("art/kz.png");
const Painting& painting = (const Painting&)pEntity;
PaintingType& motive = painting.getPaintingType();
float s = 0.0625F;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make constexpr and make Fs lowercase.


void PaintingRenderer::render(const Entity& pEntity, const Vec3& pos, float rot, float b)
{
m_random.setSeed(187L);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the L


if (m_life >= 0)
{
constexpr float var6 = 3.0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the f

void tick() override;
virtual bool shouldRender(Vec3& camPos) const override;

public:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private above public

addSpawnData(EntityCategories::ANIMAL, EntityType::SHEEP, 12);
addSpawnData(EntityCategories::ANIMAL, EntityType::PIG, 10);
addSpawnData(EntityCategories::ANIMAL, EntityType::CHICKEN, 10);
addSpawnData(EntityCategories::ANIMAL, EntityType::COW, 10);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't Cows supposed to be 8? Where'd 10 come from?

return true;

return false;
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line

{
}

virtual bool canSpawn(Level& level, EntityType::ID id, const TilePos&) const { return true; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this abstract, aka = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants