Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pretty-things-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"CreateColonies": patch
---

Fix: Ask for redstone contacts instead of elevator contacts. Closes https://github.com/MotionlessTrain/CreateColonies/issues/38
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package nl.motionlesstrain.createcolonies.placementhandlers;

import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import nl.motionlesstrain.createcolonies.resources.CreateResources;
import nl.motionlesstrain.createcolonies.utils.ItemUtils;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class ElevatorPlacementHandler extends SimplePlacementHandler {
@Override
public boolean canHandle(Level level, BlockPos blockPos, BlockState blockState) {
return blockState.is(CreateResources.Blocks.elevatorContact);
}

@Override
public List<ItemStack> getRequiredItems(Level level, BlockPos blockPos, BlockState blockState, @Nullable CompoundTag compoundTag) {
return List.of(ItemUtils.stackFromNullable(CreateResources.Blocks.redstoneContact.asItem()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static void initialiseHandlers(FMLLoadCompleteEvent ignored) {
addHandler(new ChainConveyorPlacementHandler());
addHandler(new CopyCatPlacementHandler());
addHandler(new DeployerPlacementHandler());
addHandler(new ElevatorPlacementHandler());
addHandler(new EncasedShaftPlacementHandler());
addHandler(new EncasedPipePlacementHandler());
addHandler(new GearPlacementHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public static class Blocks {

@ObjectHolder(registryName = "minecraft:block", value = "create:chain_conveyor")
public static Block chainConveyor;

@ObjectHolder(registryName = "minecraft:block", value = "create:elevator_contact")
public static Block elevatorContact;

@ObjectHolder(registryName = "minecraft:block", value = "create:redstone_contact")
public static Block redstoneContact;
}

public static class Items {
Expand Down