Skip to content

Commit

Permalink
check nbt data, fix vadis365#46
Browse files Browse the repository at this point in the history
ginyai committed Sep 7, 2021
1 parent 18f8fbc commit 432681b
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/primal_tech/blocks/BlockStoneGrill.java
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
if (side.getIndex() == 1) {
int slotClicked = getSlotClicked(direction, hitX, hitZ);
if (slotClicked == 0 && !player.isSneaking()) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && tile.getStackInSlot(slotClicked).getCount() < 16 && tile.getStackInSlot(slotClicked).isStackable())) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && ItemStack.areItemStackTagsEqual(tile.getStackInSlot(slotClicked), stack) && tile.getStackInSlot(slotClicked).getCount() < 16 && tile.getStackInSlot(slotClicked).isStackable())) {
if (!world.isRemote) {
if (!tile.getStackInSlot(slotClicked).isEmpty()) {
tile.getStackInSlot(slotClicked).grow(1);
2 changes: 1 addition & 1 deletion src/main/java/primal_tech/blocks/BlockWoodenHopper.java
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
if (side.getIndex() == 1) {
int slotClicked = getSlotClicked(direction, hitX, hitZ);
if (!player.isSneaking()) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && tile.getStackInSlot(slotClicked).getCount() < 64 && tile.getStackInSlot(slotClicked).isStackable())) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && ItemStack.areItemStackTagsEqual(tile.getStackInSlot(slotClicked), stack) && tile.getStackInSlot(slotClicked).getCount() < 64 && tile.getStackInSlot(slotClicked).isStackable())) {
if (!world.isRemote) {
if (!tile.getStackInSlot(slotClicked).isEmpty()) {
tile.getStackInSlot(slotClicked).grow(1);
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
int slotClicked = getSlotClicked(direction, hitX, hitZ);
if (!player.isSneaking()) {
if (stack.getItem() != ModItems.ROCK && getSlotClicked(direction, hitX, hitZ) != 10) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && tile.getStackInSlot(slotClicked).getCount() < 64 && tile.getStackInSlot(slotClicked).isStackable() && !tile.getStackInSlot(slotClicked).hasTagCompound())) {
if (!stack.isEmpty() && (tile.getStackInSlot(slotClicked).isEmpty() || tile.getStackInSlot(slotClicked).getItem() == stack.getItem() && tile.getStackInSlot(slotClicked).getItemDamage() == stack.getItemDamage() && ItemStack.areItemStackTagsEqual(tile.getStackInSlot(slotClicked), stack) && tile.getStackInSlot(slotClicked).getCount() < 64 && tile.getStackInSlot(slotClicked).isStackable() && !tile.getStackInSlot(slotClicked).hasTagCompound())) {
if (!world.isRemote) {
if (!tile.getStackInSlot(slotClicked).isEmpty()) {
tile.getStackInSlot(slotClicked).grow(1);

0 comments on commit 432681b

Please sign in to comment.