the whole game

This commit is contained in:
Kolyah35
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

32
src/world/item/EggItem.h Executable file
View File

@@ -0,0 +1,32 @@
#ifndef NET_MINECRAFT_WORLD_ITEM__EggItem_H__
#define NET_MINECRAFT_WORLD_ITEM__EggItem_H__
//package net.minecraft.world.item;
#include "Item.h"
#include "../entity/player/Player.h"
#include "../entity/projectile/ThrownEgg.h"
#include "../level/Level.h"
class EggItem: public Item
{
typedef Item super;
public:
EggItem(int id)
: super(id)
{
maxStackSize = 16;
}
ItemInstance* use(ItemInstance* instance, Level* level, Player* player) {
if (!player->abilities.instabuild)
instance->count--;
level->playSound(player, "random.bow", 0.5f, 0.4f / (random.nextFloat() * 0.4f + 0.8f));
if (!level->isClientSide) level->addEntity(new ThrownEgg(level, player));
return instance;
}
};
#endif /*NET_MINECRAFT_WORLD_ITEM__EggItem_H__*/