Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit f7c5ee5

Browse files
committed
Link item shouldn't be null.
1 parent a505669 commit f7c5ee5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public AbstractMinecartEntityMixin(EntityType<?> type, World world) {
125125

126126
linkart$spawnChainParticles((AbstractMinecartEntity) (Object) this, this);
127127

128-
duck.linkart$setLinkItem(null);
128+
duck.linkart$setLinkItem(ItemStack.EMPTY);
129129
}
130130

131131
@Inject(at = @At("HEAD"), method = "pushAwayFrom", cancellable = true)
@@ -198,6 +198,6 @@ void onPushAway(Entity entity, CallbackInfo ci) {
198198

199199
@Override
200200
public void linkart$setLinkItem(ItemStack linkItem) {
201-
this.linkart$itemStack = linkItem;
201+
this.linkart$itemStack = linkItem == null ? ItemStack.EMPTY : linkItem;
202202
}
203203
}

src/main/java/com/github/vini2003/linkart/mixin/PlayerEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void onInteract(Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> c
6565

6666
linkart$spawnChainParticles(minecart, duck);
6767

68-
duck.linkart$setLinkItem(null);
68+
duck.linkart$setLinkItem(ItemStack.EMPTY);
6969

7070
cir.setReturnValue(ActionResult.SUCCESS);
7171
} else {

0 commit comments

Comments
 (0)