Skip to content

Commit bca713d

Browse files
committed
Bugfix core
1 parent 2eff875 commit bca713d

6 files changed

Lines changed: 25 additions & 6 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod_name=Create Bits 'n' Bobs
3434
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3535
mod_license=All Rights Reserved
3636
# The mod version. See https://semver.org/
37-
mod_version=1.0.1
37+
mod_version=1.0.2
3838
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
3939
# This should match the base package used for the mod sources.
4040
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/com/kipti/bnb/content/light/founation/LightBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public LightBlock(Properties p_52591_, VoxelShaper shaper, boolean forcePlaceUpw
3737
super(p_52591_);
3838
this.shaper = shaper;
3939
registerDefaultState(defaultBlockState().setValue(LIT, false));
40-
CODEC = simpleCodec((p) -> new LightBlock(p, shaper, true));
40+
CODEC = simpleCodec((p) -> new LightBlock(p, shaper, forcePlaceUpwards));
4141
this.forcePlaceUpwards = forcePlaceUpwards;
4242
}
4343

src/main/java/com/kipti/bnb/content/light/headlamp/HeadlampBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
public class HeadlampBlock extends LightBlock implements IBE<HeadlampBlockEntity> {
4040

4141
public HeadlampBlock(Properties p_52591_) {
42-
super(p_52591_, BnbShapes.LIGHTBULB_SHAPE, false);
42+
super(p_52591_, BnbShapes.LIGHTBULB_SHAPE);
4343
}
4444

4545
@Override

src/main/java/com/kipti/bnb/content/light/lightbulb/LightbulbBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class LightbulbBlock extends LightBlock {
1818
public static final BooleanProperty CAGE = BooleanProperty.create("cage");
1919

2020
public LightbulbBlock(Properties properties) {
21-
super(properties, BnbShapes.LIGHTBULB_SHAPE, true);
21+
super(properties, BnbShapes.LIGHTBULB_SHAPE);
2222
this.registerDefaultState(this.defaultBlockState().setValue(CAGE, false));
2323
}
2424

src/main/java/com/kipti/bnb/content/nixie/foundation/DoubleOrientedDisplayBlock.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
import com.kipti.bnb.CreateBitsnBobs;
44
import com.kipti.bnb.content.nixie.nixie_board.NixieBoardBlock;
55
import com.mojang.serialization.MapCodec;
6+
import com.simibubi.create.AllBlocks;
7+
import com.simibubi.create.content.equipment.clipboard.ClipboardBlockItem;
8+
import com.simibubi.create.content.equipment.clipboard.ClipboardEntry;
69
import com.simibubi.create.content.equipment.wrench.IWrenchable;
710
import net.minecraft.core.BlockPos;
811
import net.minecraft.core.Direction;
12+
import net.minecraft.core.component.DataComponents;
13+
import net.minecraft.network.chat.Component;
914
import net.minecraft.world.InteractionHand;
1015
import net.minecraft.world.InteractionResult;
1116
import net.minecraft.world.ItemInteractionResult;
@@ -98,14 +103,28 @@ public InteractionResult onWrenched(BlockState state, UseOnContext context) {
98103
@Override
99104
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
100105
ItemStack heldItem = player.getItemInHand(hand);
101-
if (heldItem.getItem() instanceof NameTagItem) {
106+
if (heldItem.getItem() instanceof NameTagItem && heldItem.has(DataComponents.CUSTOM_NAME)) {
102107
BlockEntity blockEntity = level.getBlockEntity(pos);
103108
if (blockEntity instanceof GenericNixieDisplayBlockEntity display) {
104109
String name = heldItem.getHoverName().getString();
105110
display.findControllerBlockEntity().applyTextToDisplay(name, getLineForPlacement(state, hitResult.getBlockPos(), hitResult, level));
106111
}
107112
return ItemInteractionResult.SUCCESS;
108113
}
114+
if (AllBlocks.CLIPBOARD.isIn(stack)) {
115+
BlockEntity blockEntity = level.getBlockEntity(pos);
116+
List<ClipboardEntry> entries = ClipboardEntry.getLastViewedEntries(stack);
117+
int line = getLineForPlacement(state, hitResult.getBlockPos(), hitResult, level);
118+
for (ClipboardEntry entry : entries) {
119+
for (String string : entry.text.getString()
120+
.split("\n")) {
121+
if (blockEntity instanceof GenericNixieDisplayBlockEntity display) {
122+
display.findControllerBlockEntity().applyTextToDisplay(string, line++);
123+
}
124+
}
125+
}
126+
return ItemInteractionResult.SUCCESS;
127+
}
109128
return super.useItemOn(stack, state, level, pos, player, hand, hitResult);
110129
}
111130

src/main/java/com/kipti/bnb/registry/BnbShapes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class BnbShapes {
2424
public static final VoxelShaper BRASS_LAMP_SHAPE = shape(1, 0, 1, 15, 3, 15)
2525
.add(cuboid(2, 3, 2, 14, 10, 14))
2626
.add(cuboid(3, 10, 3, 13, 13, 13))
27-
.add(cuboid(6, 13, 6, 9, 16, 9))
27+
.add(cuboid(5, 13, 5, 10, 15, 10))
2828
.forDirectional();
2929

3030
public static final VoxelShaper NIXIE_BOARD_SIDE = shape(7, 0, 0, 9, 19, 16)

0 commit comments

Comments
 (0)