-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make redstone dust hitbox work like MC Java
- Loading branch information
1 parent
b1a2a9d
commit b2fdb92
Showing
13 changed files
with
105 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************** | ||
Minecraft: Pocket Edition - Decompilation Project | ||
Copyright (C) 2023 iProgramInCpp | ||
The following code is licensed under the BSD 1 clause license. | ||
SPDX-License-Identifier: BSD-1-Clause | ||
********************************************************************/ | ||
|
||
#include "RedstoneItem.hpp" | ||
#include "world/level/Level.hpp" | ||
#include "world/entity/Player.hpp" | ||
#include "world/tile/Tile.hpp" | ||
|
||
RedstoneItem::RedstoneItem(int id) : Item(id) | ||
{ | ||
} | ||
|
||
bool RedstoneItem::useOn(ItemInstance* inst, Player* player, Level* level, int x, int y, int z, int dir) | ||
{ | ||
if (level->getTile(x, y, z) != Tile::topSnow->m_ID) | ||
{ | ||
switch (dir) | ||
{ | ||
case DIR_YNEG: y--; break; | ||
case DIR_YPOS: y++; break; | ||
case DIR_ZNEG: z--; break; | ||
case DIR_ZPOS: z++; break; | ||
case DIR_XNEG: x--; break; | ||
case DIR_XPOS: x++; break; | ||
} | ||
} | ||
|
||
if (level->getTile(x, y, z) != TILE_AIR) | ||
return false; | ||
|
||
if (Tile::wire->mayPlace(level, x, y, z)) | ||
{ | ||
level->setTile(x, y, z, Tile::wire->m_ID); | ||
inst->m_amount--; | ||
} | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/******************************************************************** | ||
Minecraft: Pocket Edition - Decompilation Project | ||
Copyright (C) 2023 iProgramInCpp | ||
The following code is licensed under the BSD 1 clause license. | ||
SPDX-License-Identifier: BSD-1-Clause | ||
********************************************************************/ | ||
#pragma once | ||
|
||
#include "Item.hpp" | ||
|
||
class RedstoneItem : public Item | ||
{ | ||
public: | ||
RedstoneItem(int id); | ||
|
||
virtual bool useOn(ItemInstance*, Player*, Level*, int, int, int, int); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters