Skip to content

Commit

Permalink
Flower pot placement
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksilassila committed Dec 5, 2022
1 parent 3438ef1 commit 3cc5746
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 19 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ other blocks are placed incorrectly, try to lower the printing speed. If certain
can create
[an issue](https://github.com/aleksilassila/litematica-printer/issues).

- Grindstones
- Skulls placed on the ground
- Signs
- Glow lichen and vines
- Rotating blocks such as skulls, banners and signs
- Entities, including item frames and armor stands
- Waterlogged blocks and liquids

## Building and Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ protected static void registerGuide(Class<? extends Guide> guideClass, Class<? e
registerGuide(TillingGuide.class, FarmlandBlock.class);
registerGuide(RailGuesserGuide.class, RailBlock.class);
registerGuide(ChestGuide.class, ChestBlock.class);
registerGuide(FlowerPotGuide.class, FlowerPotBlock.class);
registerGuide(FlowerPotFillGuide.class, FlowerPotBlock.class);

registerGuide(PropertySpecificGuesserGuide.class,
RepeaterBlock.class, ComparatorBlock.class, RedstoneWireBlock.class, RedstoneTorchBlock.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package me.aleksilassila.litematica.printer.v1_19.guides.interaction;

import me.aleksilassila.litematica.printer.v1_19.SchematicBlockState;
import net.minecraft.block.Block;
import net.minecraft.block.FlowerPotBlock;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.item.ItemStack;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.List;

public class FlowerPotFillGuide extends InteractionGuide {
private final Block content;

public FlowerPotFillGuide(SchematicBlockState state) {
super(state);

Block targetBlock = state.targetState.getBlock();
if (targetBlock instanceof FlowerPotBlock) {
this.content = ((FlowerPotBlock) targetBlock).getContent();
} else {
this.content = null;
}
}

@Override
public boolean canExecute(ClientPlayerEntity player) {
if (content == null) return false;

return super.canExecute(player);
}

@Override
protected @NotNull List<ItemStack> getRequiredItems() {
if (content == null) return Collections.emptyList();
else return Collections.singletonList(new ItemStack(content));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
public class BlockIndifferentGuesserGuide extends GuesserGuide {
public BlockIndifferentGuesserGuide(SchematicBlockState state) {
super(state);


}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package me.aleksilassila.litematica.printer.v1_19.guides.placement;

import me.aleksilassila.litematica.printer.v1_19.SchematicBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;
import java.util.List;

public class FlowerPotGuide extends BlockPlacementGuide {
public FlowerPotGuide(SchematicBlockState state) {
super(state);
}

@Override
protected @NotNull List<ItemStack> getRequiredItems() {
return Collections.singletonList(new ItemStack(Items.FLOWER_POT));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
],
"client": [
"ConfigsMixin",
"FlowerPotBlockAccessor",
"GuiConfigsMixin",
"InputHandlerMixin",
"PlayerMoveC2SPacketMixin"
Expand Down

0 comments on commit 3cc5746

Please sign in to comment.