From fd296c9696c473c5e9b9a8d16392b09c696adff2 Mon Sep 17 00:00:00 2001 From: Aleksi Lassila Date: Thu, 15 Dec 2022 02:53:51 +0200 Subject: [PATCH] Ported changes & fixed flowerpots sometimes blocking the placement. --- build.gradle.kts | 10 +++++++++- gradle.properties | 1 + .../litematica/printer/v1_17/BlockHelper.java | 20 +++++++++++++++++++ .../printer/v1_17/UpdateChecker.java | 2 +- .../printer/v1_17/guides/Guide.java | 3 ++- .../interaction/FlowerPotFillGuide.java | 1 + .../guides/placement/PlacementGuide.java | 18 ++--------------- .../v1_17/implementation/BlockHelperImpl.java | 14 +++++++++++++ .../litematica/printer/v1_18/BlockHelper.java | 20 +++++++++++++++++++ .../printer/v1_18/UpdateChecker.java | 2 +- .../printer/v1_18/guides/Guide.java | 3 ++- .../interaction/FlowerPotFillGuide.java | 1 + .../guides/placement/PlacementGuide.java | 18 ++--------------- .../v1_18/implementation/BlockHelperImpl.java | 14 +++++++++++++ .../litematica/printer/v1_19/BlockHelper.java | 11 +++++----- .../printer/v1_19/UpdateChecker.java | 2 +- .../interaction/FlowerPotFillGuide.java | 1 + .../guides/placement/PlacementGuide.java | 2 +- .../v1_19/implementation/BlockHelperImpl.java | 10 +++++++--- .../interaction/FlowerPotFillGuide.java | 1 + .../implementation/BlockHelperImpl.java | 1 - 21 files changed, 107 insertions(+), 48 deletions(-) create mode 100644 v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/BlockHelper.java create mode 100644 v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/implementation/BlockHelperImpl.java create mode 100644 v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/BlockHelper.java create mode 100644 v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/implementation/BlockHelperImpl.java diff --git a/build.gradle.kts b/build.gradle.kts index 719552758..7dfb1e492 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,9 +24,17 @@ val buildAll = tasks.create("buildAll") { dependsOn(":v1_18:build") dependsOn(":v1_19:build") dependsOn(":v1_19_3:build") + // This isn't working.... you still have to run each build individually + tasks.findByName(":v1_19:build")?.mustRunAfter(":v1_19_3:build") + tasks.findByName(":v1_18:build")?.mustRunAfter(":v1_19:build") + tasks.findByName(":v1_17:build")?.mustRunAfter(":v1_18:build") + doLast { println("Copying files...") - file("v1_19_3/build/libs/v1_19_3.jar").copyTo(file("build/${archives_base_name}-1.19.3-${mod_version}.jar"), true) + file("v1_19_3/build/libs/v1_19_3.jar").copyTo( + file("build/${archives_base_name}-1.19.3-${mod_version}.jar"), + true + ) file("v1_19/build/libs/v1_19.jar").copyTo(file("build/${archives_base_name}-1.19-${mod_version}.jar"), true) file("v1_18/build/libs/v1_18.jar").copyTo(file("build/${archives_base_name}-1.18-${mod_version}.jar"), true) file("v1_17/build/libs/v1_17.jar").copyTo(file("build/${archives_base_name}-1.17-${mod_version}.jar"), true) diff --git a/gradle.properties b/gradle.properties index b21e73386..5db2da2af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx2G +org.gradle.parallel=false # Mod Properties mod_version=3.1 maven_group=net.fabricmc diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/BlockHelper.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/BlockHelper.java new file mode 100644 index 000000000..a9c4aa11e --- /dev/null +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/BlockHelper.java @@ -0,0 +1,20 @@ +package me.aleksilassila.litematica.printer.v1_17; + +import net.minecraft.block.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +abstract public class BlockHelper { + public static List> interactiveBlocks = new ArrayList<>(Arrays.asList( + AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, LeverBlock.class, + DoorBlock.class, TrapdoorBlock.class, BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, + HopperBlock.class, EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, + FenceGateBlock.class, BrewingStandBlock.class, DragonEggBlock.class, CommandBlock.class, + BeaconBlock.class, AnvilBlock.class, ComparatorBlock.class, RepeaterBlock.class, + DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, + FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, + LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, + StonecutterBlock.class, AbstractSignBlock.class)); +} diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/UpdateChecker.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/UpdateChecker.java index 7e53eb4a8..6048eac12 100644 --- a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/UpdateChecker.java +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/UpdateChecker.java @@ -9,7 +9,7 @@ import java.util.Scanner; public class UpdateChecker { - public static final String version = "v3.0"; + public static final String version = "v3.1"; public static String getPrinterVersion() { try (InputStream inputStream = new URL("https://api.github.com/repos/aleksilassila/litematica-printer/tags").openStream(); Scanner scanner = new Scanner(inputStream)) { diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/Guide.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/Guide.java index f8c9d79fa..e526849a2 100644 --- a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/Guide.java +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/Guide.java @@ -2,6 +2,7 @@ import me.aleksilassila.litematica.printer.v1_17.SchematicBlockState; import me.aleksilassila.litematica.printer.v1_17.actions.Action; +import me.aleksilassila.litematica.printer.v1_17.implementation.BlockHelperImpl; import net.minecraft.block.BlockState; import net.minecraft.block.CoralBlock; import net.minecraft.client.network.ClientPlayerEntity; @@ -15,7 +16,7 @@ import java.util.List; import java.util.Optional; -abstract public class Guide { +abstract public class Guide extends BlockHelperImpl { protected final SchematicBlockState state; protected final BlockState currentState; protected final BlockState targetState; diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/interaction/FlowerPotFillGuide.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/interaction/FlowerPotFillGuide.java index 99387d457..8afaa9309 100644 --- a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/interaction/FlowerPotFillGuide.java +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/interaction/FlowerPotFillGuide.java @@ -27,6 +27,7 @@ public FlowerPotFillGuide(SchematicBlockState state) { @Override public boolean canExecute(ClientPlayerEntity player) { if (content == null) return false; + if (!(currentState.getBlock() instanceof FlowerPotBlock)) return false; return super.canExecute(player); } diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/placement/PlacementGuide.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/placement/PlacementGuide.java index 1553d099c..cc2fdc3cc 100644 --- a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/placement/PlacementGuide.java +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/guides/placement/PlacementGuide.java @@ -14,7 +14,6 @@ import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; @@ -112,7 +111,7 @@ private static VoxelShape getOutlineShape(World world, BlockPos pos) { return world.getBlockState(pos).getOutlineShape(world, pos); } - public static boolean isInteractive(Block block) { + public boolean isInteractive(Block block) { for (Class clazz : interactiveBlocks) { if (clazz.isInstance(block)) { return true; @@ -126,7 +125,7 @@ private boolean canPlaceInWater(BlockState blockState) { Block block = blockState.getBlock(); if (block instanceof FluidFillable) { return true; - } else if (!(block instanceof DoorBlock) && !blockState.isIn(BlockTags.SIGNS) && !blockState.isOf(Blocks.LADDER) && !blockState.isOf(Blocks.SUGAR_CANE) && !blockState.isOf(Blocks.BUBBLE_COLUMN)) { + } else if (!(block instanceof DoorBlock) && !(blockState.getBlock() instanceof AbstractSignBlock) && !blockState.isOf(Blocks.LADDER) && !blockState.isOf(Blocks.SUGAR_CANE) && !blockState.isOf(Blocks.BUBBLE_COLUMN)) { Material material = blockState.getMaterial(); if (material != Material.PORTAL && material != Material.STRUCTURE_VOID && material != Material.UNDERWATER_PLANT && material != Material.REPLACEABLE_UNDERWATER_PLANT) { return material.blocksMovement(); @@ -137,17 +136,4 @@ private boolean canPlaceInWater(BlockState blockState) { return true; } - - public static Class[] interactiveBlocks = new Class[]{ - AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, - AbstractButtonBlock.class, LeverBlock.class, DoorBlock.class, TrapdoorBlock.class, - BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, HopperBlock.class, - EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, - FenceGateBlock.class, BrewingStandBlock.class, DragonEggBlock.class, CommandBlock.class, - BeaconBlock.class, AnvilBlock.class, ComparatorBlock.class, RepeaterBlock.class, - DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, - FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, - LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, - StonecutterBlock.class, AbstractSignBlock.class, - }; } diff --git a/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/implementation/BlockHelperImpl.java b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/implementation/BlockHelperImpl.java new file mode 100644 index 000000000..e9761f6f0 --- /dev/null +++ b/v1_17/src/main/java/me/aleksilassila/litematica/printer/v1_17/implementation/BlockHelperImpl.java @@ -0,0 +1,14 @@ +package me.aleksilassila.litematica.printer.v1_17.implementation; + +import me.aleksilassila.litematica.printer.v1_17.BlockHelper; +import net.minecraft.block.AbstractButtonBlock; + +import java.util.Arrays; + +public class BlockHelperImpl extends BlockHelper { + static { + interactiveBlocks.addAll(Arrays.asList( + AbstractButtonBlock.class + )); + } +} diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/BlockHelper.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/BlockHelper.java new file mode 100644 index 000000000..27f41a356 --- /dev/null +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/BlockHelper.java @@ -0,0 +1,20 @@ +package me.aleksilassila.litematica.printer.v1_18; + +import net.minecraft.block.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +abstract public class BlockHelper { + public static List> interactiveBlocks = new ArrayList<>(Arrays.asList( + AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, LeverBlock.class, + DoorBlock.class, TrapdoorBlock.class, BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, + HopperBlock.class, EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, + FenceGateBlock.class, BrewingStandBlock.class, DragonEggBlock.class, CommandBlock.class, + BeaconBlock.class, AnvilBlock.class, ComparatorBlock.class, RepeaterBlock.class, + DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, + FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, + LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, + StonecutterBlock.class, AbstractSignBlock.class)); +} diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/UpdateChecker.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/UpdateChecker.java index 74aecf28a..e192c1055 100644 --- a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/UpdateChecker.java +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/UpdateChecker.java @@ -9,7 +9,7 @@ import java.util.Scanner; public class UpdateChecker { - public static final String version = "v3.0"; + public static final String version = "v3.1"; public static String getPrinterVersion() { try (InputStream inputStream = new URL("https://api.github.com/repos/aleksilassila/litematica-printer/tags").openStream(); Scanner scanner = new Scanner(inputStream)) { diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/Guide.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/Guide.java index 459d2ea49..f7bc683b6 100644 --- a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/Guide.java +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/Guide.java @@ -2,6 +2,7 @@ import me.aleksilassila.litematica.printer.v1_18.SchematicBlockState; import me.aleksilassila.litematica.printer.v1_18.actions.Action; +import me.aleksilassila.litematica.printer.v1_18.implementation.BlockHelperImpl; import net.minecraft.block.BlockState; import net.minecraft.block.CoralBlock; import net.minecraft.client.network.ClientPlayerEntity; @@ -15,7 +16,7 @@ import java.util.List; import java.util.Optional; -abstract public class Guide { +abstract public class Guide extends BlockHelperImpl { protected final SchematicBlockState state; protected final BlockState currentState; protected final BlockState targetState; diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/interaction/FlowerPotFillGuide.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/interaction/FlowerPotFillGuide.java index de269b7dd..b4cb1bb2a 100644 --- a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/interaction/FlowerPotFillGuide.java +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/interaction/FlowerPotFillGuide.java @@ -27,6 +27,7 @@ public FlowerPotFillGuide(SchematicBlockState state) { @Override public boolean canExecute(ClientPlayerEntity player) { if (content == null) return false; + if (!(currentState.getBlock() instanceof FlowerPotBlock)) return false; return super.canExecute(player); } diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/placement/PlacementGuide.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/placement/PlacementGuide.java index 062e6a99f..f69421331 100644 --- a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/placement/PlacementGuide.java +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/guides/placement/PlacementGuide.java @@ -14,7 +14,6 @@ import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; @@ -112,7 +111,7 @@ private static VoxelShape getOutlineShape(World world, BlockPos pos) { return world.getBlockState(pos).getOutlineShape(world, pos); } - public static boolean isInteractive(Block block) { + public boolean isInteractive(Block block) { for (Class clazz : interactiveBlocks) { if (clazz.isInstance(block)) { return true; @@ -126,7 +125,7 @@ private boolean canPlaceInWater(BlockState blockState) { Block block = blockState.getBlock(); if (block instanceof FluidFillable) { return true; - } else if (!(block instanceof DoorBlock) && !blockState.isIn(BlockTags.SIGNS) && !blockState.isOf(Blocks.LADDER) && !blockState.isOf(Blocks.SUGAR_CANE) && !blockState.isOf(Blocks.BUBBLE_COLUMN)) { + } else if (!(block instanceof DoorBlock) && !(blockState.getBlock() instanceof AbstractSignBlock) && !blockState.isOf(Blocks.LADDER) && !blockState.isOf(Blocks.SUGAR_CANE) && !blockState.isOf(Blocks.BUBBLE_COLUMN)) { Material material = blockState.getMaterial(); if (material != Material.PORTAL && material != Material.STRUCTURE_VOID && material != Material.UNDERWATER_PLANT && material != Material.REPLACEABLE_UNDERWATER_PLANT) { return material.blocksMovement(); @@ -137,17 +136,4 @@ private boolean canPlaceInWater(BlockState blockState) { return true; } - - public static Class[] interactiveBlocks = new Class[]{ - AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, - AbstractButtonBlock.class, LeverBlock.class, DoorBlock.class, TrapdoorBlock.class, - BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, HopperBlock.class, - EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, - FenceGateBlock.class, BrewingStandBlock.class, DragonEggBlock.class, CommandBlock.class, - BeaconBlock.class, AnvilBlock.class, ComparatorBlock.class, RepeaterBlock.class, - DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, - FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, - LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, - StonecutterBlock.class, AbstractSignBlock.class, - }; } diff --git a/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/implementation/BlockHelperImpl.java b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/implementation/BlockHelperImpl.java new file mode 100644 index 000000000..d5c738f56 --- /dev/null +++ b/v1_18/src/main/java/me/aleksilassila/litematica/printer/v1_18/implementation/BlockHelperImpl.java @@ -0,0 +1,14 @@ +package me.aleksilassila.litematica.printer.v1_18.implementation; + +import me.aleksilassila.litematica.printer.v1_18.BlockHelper; +import net.minecraft.block.AbstractButtonBlock; + +import java.util.Arrays; + +public class BlockHelperImpl extends BlockHelper { + static { + interactiveBlocks.addAll(Arrays.asList( + AbstractButtonBlock.class + )); + } +} diff --git a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/BlockHelper.java b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/BlockHelper.java index 5a435381d..d37eaa547 100644 --- a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/BlockHelper.java +++ b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/BlockHelper.java @@ -2,10 +2,12 @@ import net.minecraft.block.*; -abstract public class BlockHelper { - abstract public Class[] getInteractiveBlocks(); +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; - public static Class[] interactiveBlocks = new Class[]{ +abstract public class BlockHelper { + public static List> interactiveBlocks = new ArrayList<>(Arrays.asList( AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, LeverBlock.class, DoorBlock.class, TrapdoorBlock.class, BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, HopperBlock.class, EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, @@ -14,6 +16,5 @@ abstract public class BlockHelper { DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, - StonecutterBlock.class, AbstractSignBlock.class, - }; + StonecutterBlock.class, AbstractSignBlock.class)); } diff --git a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/UpdateChecker.java b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/UpdateChecker.java index 6f3e113e5..2bb30369d 100644 --- a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/UpdateChecker.java +++ b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/UpdateChecker.java @@ -9,7 +9,7 @@ import java.util.Scanner; public class UpdateChecker { - public static final String version = "v3.0"; + public static final String version = "v3.1"; public static String getPrinterVersion() { try (InputStream inputStream = new URL("https://api.github.com/repos/aleksilassila/litematica-printer/tags").openStream(); Scanner scanner = new Scanner(inputStream)) { diff --git a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/interaction/FlowerPotFillGuide.java b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/interaction/FlowerPotFillGuide.java index 1abe0a74e..1c888f9b9 100644 --- a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/interaction/FlowerPotFillGuide.java +++ b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/interaction/FlowerPotFillGuide.java @@ -27,6 +27,7 @@ public FlowerPotFillGuide(SchematicBlockState state) { @Override public boolean canExecute(ClientPlayerEntity player) { if (content == null) return false; + if (!(currentState.getBlock() instanceof FlowerPotBlock)) return false; return super.canExecute(player); } diff --git a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/placement/PlacementGuide.java b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/placement/PlacementGuide.java index 46807a477..31db7f6cc 100644 --- a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/placement/PlacementGuide.java +++ b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/guides/placement/PlacementGuide.java @@ -112,7 +112,7 @@ private static VoxelShape getOutlineShape(World world, BlockPos pos) { } public boolean isInteractive(Block block) { - for (Class clazz : getInteractiveBlocks()) { + for (Class clazz : interactiveBlocks) { if (clazz.isInstance(block)) { return true; } diff --git a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/implementation/BlockHelperImpl.java b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/implementation/BlockHelperImpl.java index 38261f7e6..fe7cac1fb 100644 --- a/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/implementation/BlockHelperImpl.java +++ b/v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/implementation/BlockHelperImpl.java @@ -1,10 +1,14 @@ package me.aleksilassila.litematica.printer.v1_19.implementation; import me.aleksilassila.litematica.printer.v1_19.BlockHelper; +import net.minecraft.block.AbstractButtonBlock; + +import java.util.Arrays; public class BlockHelperImpl extends BlockHelper { - @Override - public Class[] getInteractiveBlocks() { - return BlockHelper.interactiveBlocks; + static { + interactiveBlocks.addAll(Arrays.asList( + AbstractButtonBlock.class + )); } } diff --git a/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/guides/interaction/FlowerPotFillGuide.java b/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/guides/interaction/FlowerPotFillGuide.java index 15b120dba..bed6a13ad 100644 --- a/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/guides/interaction/FlowerPotFillGuide.java +++ b/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/guides/interaction/FlowerPotFillGuide.java @@ -27,6 +27,7 @@ public FlowerPotFillGuide(SchematicBlockState state) { @Override public boolean canExecute(ClientPlayerEntity player) { if (content == null) return false; + if (!(currentState.getBlock() instanceof FlowerPotBlock)) return false; return super.canExecute(player); } diff --git a/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/implementation/BlockHelperImpl.java b/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/implementation/BlockHelperImpl.java index ec18fb75e..a1c0ee1a0 100644 --- a/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/implementation/BlockHelperImpl.java +++ b/v1_19_3/src/main/java/me/aleksilassila/litematica/printer/v1_19_3/implementation/BlockHelperImpl.java @@ -4,7 +4,6 @@ import net.minecraft.block.ButtonBlock; import java.util.Arrays; -import java.util.List; public class BlockHelperImpl extends BlockHelper { static {