Skip to content

Commit 23ca615

Browse files
committed
Fine, you win
1 parent 44ce14f commit 23ca615

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/dev/enjarai/trickster/item/InactiveSpawnerSpellCoreItem.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ public ActionResult useOnBlock(ItemUsageContext context) {
2020
var player = context.getPlayer();
2121
if (world.getBlockState(pos).isOf(Blocks.SPAWNER) && player != null) {
2222
world.setBlockState(pos, ModBlocks.INERT_SPAWNER.getDefaultState());
23-
player.setStackInHand(context.getHand(), context.getStack().withItem(ModItems.SPAWNER_SPELL_CORE));
23+
24+
var splitStack = context.getStack().split(1).withItem(ModItems.SPAWNER_SPELL_CORE);
25+
if (player.getStackInHand(context.getHand()).isEmpty()) {
26+
player.setStackInHand(context.getHand(), splitStack);
27+
} else {
28+
player.getInventory().offerOrDrop(splitStack);
29+
}
2430
return ActionResult.SUCCESS;
2531
}
2632

src/main/java/dev/enjarai/trickster/item/KnotItem.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,12 @@ public float getConstructExecutionLimitMultiplier(ItemStack stack) {
108108
public static class CrackedQuartz extends KnotItem implements ChannelItem {
109109
public CrackedQuartz() {
110110
super(new Settings()
111-
.component(ModComponents.MANA, new ManaComponent(new SimpleManaPool(0), 0))
112-
.component(ModComponents.TICK_CREATED, new TickTrackerComponent(0)),
111+
.component(ModComponents.MANA, new ManaComponent(new SimpleManaPool(0), 0)),
113112
Float.MAX_VALUE);
114113
}
115114

116115
public EvaluationResult messageListenBehavior(Trick<?> trickSource, SpellContext ctx, ItemStack stack, Optional<Integer> timeout) {
117-
return new ListFragment(List.of(new NumberFragment(stack.get(ModComponents.TICK_CREATED).getTick(ctx.source().getWorld()))));
116+
return new ListFragment(List.of(new NumberFragment(ctx.source().getWorld().getTimeOfDay())));
118117
}
119118

120119
public void messageSendBehavior(Trick<?> trickSource, SpellContext ctx, ItemStack stack, Fragment value) {

0 commit comments

Comments
 (0)