mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
Fix placing blocks with rightclick with tools not respecting creative mode #1011
This commit is contained in:
1 parent
570edc802e
commit
15902fbf5d
1 file changed
+9
@@ -191,7 +191,16 @@ public abstract class HarvestTool extends ToolCore
|
||||
return false;
|
||||
}
|
||||
|
||||
int dmg = nearbyStack.getItemDamage();
|
||||
int count = nearbyStack.stackSize;
|
||||
|
||||
used = item.onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
|
||||
// handle creative mode
|
||||
if(player.capabilities.isCreativeMode) {
|
||||
// fun fact: vanilla minecraft does it exactly the same way
|
||||
nearbyStack.setItemDamage(dmg);
|
||||
nearbyStack.stackSize = count;
|
||||
}
|
||||
if (nearbyStack.stackSize < 1)
|
||||
{
|
||||
nearbyStack = null;
|
||||
|
||||
Reference in new issue
Block a user