Skip to content

Commit 372be0e

Browse files
committed
Chain drive crash
1 parent eb3b6dc commit 372be0e

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,7 @@
7070
- Allowed chain cogwheels (that aren't flanged) to connect like normal cogwheels
7171
# 1.21.1-0.0.25
7272
- Changes:
73-
- Ru_ru localisation update
73+
- Ru_ru localisation update
74+
# 1.21.1-0.0.26
75+
- Changes:
76+
- Fixed crash chaz found related to nixie tubes

gradle.properties

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

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, final BlockStat
114114
Component component = stack.getOrDefault(DataComponents.CUSTOM_NAME, Component.empty());
115115
@Nullable Component secondRowComponent = null;
116116

117+
boolean forceFromTop = false;
118+
117119
if (AllBlocks.CLIPBOARD.isIn(stack)) {
118120
final List<ClipboardEntry> entries = ClipboardEntry.getLastViewedEntries(stack);
119-
component = entries.getFirst().text;
121+
component = !entries.isEmpty() ? entries.getFirst().text : Component.empty();
120122
if (entries.size() > 1) {
121123
secondRowComponent = entries.get(1).text;
124+
forceFromTop = true;
122125
}
123126
}
124127

@@ -129,7 +132,7 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, final BlockStat
129132
final @Nullable String secondRowTagUsed = secondRowComponent == null ? null :
130133
Component.Serializer.toJson(secondRowComponent, level.registryAccess());
131134

132-
final int startLine = getLineForPlacement(state, pos, hitResult, level);
135+
final int startLine = forceFromTop ? 0 : getLineForPlacement(state, pos, hitResult, level);
133136

134137
final GenericNixieDisplayBlockEntity.ConfigurableDisplayOptions currentDisplay = startBlockEntity.getCurrentDisplayOption();
135138
GenericNixieDisplayTarget.walkNixies(level, pos, (currentPos, consumedCharsOnRow, blockEntity) -> {

0 commit comments

Comments
 (0)