Skip to content

Commit bda45ca

Browse files
committed
Explicitly prevent breaking when not sneaking.
The default behaviour. This TODO seems to be outdated, at least in this instance, as it falls back.
1 parent 4b27d4c commit bda45ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common/src/main/java/noobanidus/mods/lootr/common/entity/LootrChestMinecartEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ public boolean isInvulnerableTo(DamageSource source) {
100100
} else if (!source.getEntity().isShiftKeyDown()) {
101101
((Player) source.getEntity()).displayClientMessage(Component.translatable("lootr.message.cart_should_sneak").setStyle(LootrAPI.getChatStyle()), false);
102102
((Player) source.getEntity()).displayClientMessage(Component.translatable("lootr.message.should_sneak2", Component.translatable("lootr.message.cart_should_sneak3").setStyle(Style.EMPTY.withBold(true))).setStyle(LootrAPI.getChatStyle()), false);
103-
// TODO: I think this is broken
104-
} else if (source.getEntity().isShiftKeyDown()) {
103+
return true;
104+
} else //noinspection RedundantIfStatement
105+
if (source.getEntity().isShiftKeyDown()) {
105106
return false;
106107
}
107108
} else {

0 commit comments

Comments
 (0)