add tag for non-harvestable blocks

This commit is contained in:
TropheusJ 2025-02-25 02:18:05 -05:00
parent ac20501426
commit 97aa549307
5 changed files with 391 additions and 378 deletions

View file

@ -0,0 +1,5 @@
{
"values": [
"minecraft:fire"
]
}

View file

@ -113,6 +113,7 @@ public class AllTags {
FALLBACK_MOUNTED_STORAGE_BLACKLIST,
ROOTS,
SUGAR_CANE_VARIANTS,
NOT_HARVESTABLE,
CORALS,

View file

@ -57,12 +57,15 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
@Override
public void visitNewPosition(MovementContext context, BlockPos pos) {
Level world = context.world;
BlockState stateVisited = world.getBlockState(pos);
boolean notCropButCuttable = false;
if (world.isClientSide)
return;
BlockState stateVisited = world.getBlockState(pos);
if (stateVisited.isAir() || AllBlockTags.NOT_HARVESTABLE.matches(stateVisited))
return;
boolean notCropButCuttable = false;
if (!isValidCrop(world, pos, stateVisited)) {
if (isValidOther(world, pos, stateVisited))
notCropButCuttable = true;

View file

@ -127,6 +127,9 @@ public class CreateRegistrateTags {
prov.tag(AllBlockTags.SUGAR_CANE_VARIANTS.tag)
.add(Blocks.SUGAR_CANE);
prov.tag(AllBlockTags.NOT_HARVESTABLE.tag)
.add(Blocks.FIRE);
prov.tag(AllBlockTags.CORALS.tag)
.add(Blocks.DEAD_TUBE_CORAL, Blocks.DEAD_BRAIN_CORAL, Blocks.DEAD_BUBBLE_CORAL, Blocks.DEAD_FIRE_CORAL,
Blocks.DEAD_HORN_CORAL, Blocks.TUBE_CORAL, Blocks.BRAIN_CORAL, Blocks.BUBBLE_CORAL,