forked from Kolyah35/minecraft-pe-0.6.1
3D/Fancy Clouds have been ported over Sky Rendering is now an option between Java and PE Java Sky/Fog color option is now accurate using the original color ramp instead of PE's slightly lower one Grass Sides are now tinted, and can be toggled in settings Added stars, the sun, and the moon in the daylight cycle Sunset color has been added, appears when the sun is rising or falling, buggy on PE's sky rendering option. Fixed leaves being rendered bright green when foliage tinting was turned off. Enabled Tall Grass generation code Tall Grass is now tinted. Other compile options have to be tested
50 lines
1.4 KiB
C++
Executable File
50 lines
1.4 KiB
C++
Executable File
#ifndef NET_MINECRAFT_WORLD_ITEM__ShearsItem_H__
|
|
#define NET_MINECRAFT_WORLD_ITEM__ShearsItem_H__
|
|
|
|
//package net.minecraft.world.item;
|
|
|
|
#include "Item.h"
|
|
|
|
#include "../entity/Mob.h"
|
|
#include "../level/tile/Tile.h"
|
|
|
|
// @todo: web and perhaps mineBlock
|
|
class ShearsItem: public Item
|
|
{
|
|
typedef Item super;
|
|
public:
|
|
ShearsItem(int itemId)
|
|
: super(itemId)
|
|
{
|
|
setMaxStackSize(1);
|
|
setMaxDamage(238);
|
|
}
|
|
|
|
/*@Override*/
|
|
bool mineBlock(ItemInstance* itemInstance, int tile, int x, int y, int z/*, Mob* owner*/) {
|
|
if (tile == ((Tile*)Tile::leaves)->id || tile == Tile::web->id || tile == Tile::tallgrass->id /*|| tile == Tile::vine->id*/) {
|
|
itemInstance->hurt(1);//, owner);
|
|
return true;
|
|
}
|
|
return super::mineBlock(itemInstance, tile, x, y, z); // owner);
|
|
}
|
|
|
|
/*@Override*/
|
|
bool canDestroySpecial(const Tile* tile) const {
|
|
return tile->id == Tile::web->id;
|
|
}
|
|
|
|
/*@Override*/
|
|
float getDestroySpeed(ItemInstance* itemInstance, Tile* tile) {
|
|
if (tile->id == Tile::web->id || tile->id == ((Tile*)Tile::leaves)->id) {
|
|
return 15;
|
|
}
|
|
if (tile->id == Tile::cloth->id) {
|
|
return 5;
|
|
}
|
|
return super::getDestroySpeed(itemInstance, tile);
|
|
}
|
|
};
|
|
|
|
#endif /*NET_MINECRAFT_WORLD_ITEM__ShearsItem_H__*/
|