Skip to content

Commit

Permalink
scan tool fixes (#719) port
Browse files Browse the repository at this point in the history
Fix slab/domum handling and water handling and grass/dirt path handling and stairs handling
  • Loading branch information
Raycoms committed Feb 9, 2025
1 parent 1d334ab commit 1d96126
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;

/**
* Operation for removing one type of block.
Expand Down Expand Up @@ -37,6 +38,10 @@ protected void apply(final ServerLevel world, final BlockPos position)
{
storage.addPreviousDataFor(position, world);
world.removeBlock(position, false);
if (!world.getFluidState(position).isEmpty())
{
world.setBlock(position, Blocks.AIR.defaultBlockState(), 3);
}
storage.addPostDataFor(position, world);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BedPart;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
import net.minecraft.world.level.block.state.properties.DripstoneThickness;
import net.minecraft.world.level.block.state.properties.*;
import net.minecraft.world.phys.AABB;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -341,9 +338,11 @@ public List<ItemStack> getRequiredItems(
@Nullable final CompoundTag tileEntityData,
final boolean complete)
{
final List<ItemStack> itemList = new ArrayList<>();
itemList.add(new ItemStack(Blocks.DIRT));
return itemList;
if (complete)
{
return Collections.singletonList(new ItemStack(blockState.getBlock()));
}
return Collections.singletonList(new ItemStack(Blocks.DIRT));
}
}

Expand Down Expand Up @@ -647,9 +646,11 @@ public List<ItemStack> getRequiredItems(
@Nullable final CompoundTag tileEntityData,
final boolean complete)
{
final List<ItemStack> itemList = new ArrayList<>();
itemList.add(new ItemStack(Blocks.DIRT, 1));
return itemList;
if (complete)
{
return Collections.singletonList(new ItemStack(blockState.getBlock()));
}
return Collections.singletonList(new ItemStack(Blocks.DIRT));
}
}

Expand Down Expand Up @@ -686,6 +687,10 @@ public List<ItemStack> getRequiredItems(
@Nullable final CompoundTag tileEntityData,
final boolean complete)
{
if (complete)
{
return Collections.singletonList(new ItemStack(blockState.getBlock()));
}
return new ArrayList<>();
}
}
Expand Down

0 comments on commit 1d96126

Please sign in to comment.