Skip to content

Commit

Permalink
* Add pressure plates
Browse files Browse the repository at this point in the history
  • Loading branch information
iProgramMC committed Apr 8, 2024
1 parent f478bfe commit 02f046e
Show file tree
Hide file tree
Showing 9 changed files with 433 additions and 194 deletions.
5 changes: 5 additions & 0 deletions source/world/entity/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,11 @@ bool Entity::isPlayer()
return false;
}

bool Entity::isMob()
{
return false;
}

bool Entity::isCreativeModeAllowed()
{
return false;
Expand Down
1 change: 1 addition & 0 deletions source/world/entity/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class Entity
virtual bool isAlive();
virtual bool isOnFire();
virtual bool isPlayer();
virtual bool isMob();
virtual bool isCreativeModeAllowed();
virtual bool shouldRender(Vec3& camPos);
virtual bool shouldRenderAtSqrDistance(float distSqr);
Expand Down
5 changes: 5 additions & 0 deletions source/world/entity/Mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ bool Mob::isShootable()
return true;
}

bool Mob::isMob()
{
return true;
}

bool Mob::isAlive()
{
if (m_bRemoved)
Expand Down
1 change: 1 addition & 0 deletions source/world/entity/Mob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Mob : public Entity
virtual void setSize(float rad, float height) override;
virtual void outOfWorld() override;
virtual void causeFallDamage(float level) override;
virtual bool isMob() override;

//virtuals
virtual void knockback(Entity* pEnt, int a, float x, float z);
Expand Down
3 changes: 2 additions & 1 deletion source/world/item/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ void Inventory::prepareCreativeInventory()

// redstone stuff
addCreativeItem(Tile::wire->m_ID);
addCreativeItem(Tile::notGate_off->m_ID);
addCreativeItem(Tile::notGate->m_ID);
addCreativeItem(Tile::lever->m_ID);
addCreativeItem(Tile::button->m_ID);
addCreativeItem(Tile::plate_stone->m_ID);
addCreativeItem(Tile::plate_wood->m_ID);

for (int i = 0; i < C_MAX_HOTBAR_ITEMS; i++)
m_hotbar[i] = i;
Expand Down
Loading

0 comments on commit 02f046e

Please sign in to comment.