Skip to content

Commit

Permalink
store commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Mar 14, 2024
1 parent 56dfa97 commit 954f488
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ public TreeTapBlockEntity(BlockPos pos, BlockState state) {
}

public void handleUse(PlayerEntity player, Hand hand, ItemStack handStack) {
ItemStack stored = inventory.get(0);
inventory.set(0, handStack);
player.setStackInHand(hand, stored);
markDirty();
ItemStack stored = inventory.get(0);
if (handStack.isEmpty()) {
player.setStackInHand(hand, stored);
inventory.set(0, ItemStack.EMPTY);
} else {
inventory.set(0, handStack.split(1));
}
markDirty();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {
if (!direction.getAxis().isHorizontal()) {
return null;
}

return this.getDefaultState().with(FACING, direction);
}

Expand All @@ -98,7 +97,6 @@ public BlockState mirror(BlockState state, BlockMirror mirror) {
@Override
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
super.randomTick(state, world, pos, random);

if (!world.isClient && world.getBlockEntity(pos) instanceof TreeTapBlockEntity treeTapBlockEntity) {
treeTapBlockEntity.tryCraft();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"authors": [
"Immortal Devs - parent organization",
"kalucky0 - head of project",
"Azazelthedemonlord - lead designer / local nsfw artist",
"Azazelthedemonlord - lead designer",
"24Chrome - lead artist",
"Jack Papel - lead developer",
"sunsette - lead sound designer",
Expand Down

0 comments on commit 954f488

Please sign in to comment.