Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ AgriCraft is *not* installed.
- prevent a crash when opening the Edit HUD position screen while looking at an entity
- soft coating no longer voids the contents of shulker boxes (or other tile-entities)
- bloodmagic:geode_harvestable now adds forge:clusters as a tag instead of a block, meaning it'll actually work with them
- teleposition sigil now teleports you when clicking on a non-teleposer block as well. it also now checks itself for a destination when inside a sigil of holding
- ritual diviner and tinkerer can now be cycled even when looking at a (non master ritual stone) block

------------------------------------------------------
Version 3.3.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ public void inventoryTick(ItemStack stack, Level worldIn, Entity entityIn, int i
@Override
public InteractionResult useOn(UseOnContext context)
{
// the things in this method only care about it being used on a MRS, if thats not the case we ignore
if (!(context.getLevel().getBlockEntity(context.getClickedPos()) instanceof TileMasterRitualStone)) {
return InteractionResult.PASS;
}

ItemStack stack = context.getPlayer().getItemInHand(context.getHand());
if (context.getPlayer().isShiftKeyDown())
{
Expand Down Expand Up @@ -363,13 +368,6 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
ItemStack stack = player.getItemInHand(hand);
setActivatedState(stack, false);

HitResult ray = getPlayerPOVHitResult(world, player, ClipContext.Fluid.NONE);

if (ray != null && ray.getType() == HitResult.Type.BLOCK)
{
return new InteractionResultHolder<>(InteractionResult.PASS, stack);
}

if (player.isShiftKeyDown())
{
if (!world.isClientSide)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ public void appendHoverText(ItemStack stack, Level world, List<Component> toolti
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand)
{
ItemStack stack = player.getItemInHand(hand);
HitResult ray = Item.getPlayerPOVHitResult(world, player, Fluid.NONE);
if (ray != null && ray.getType() == HitResult.Type.BLOCK)
{
return new InteractionResultHolder<>(InteractionResult.PASS, stack);
}

if (player.isShiftKeyDown())
{
Expand Down Expand Up @@ -114,10 +109,9 @@ public InteractionResult useOn(UseOnContext context)
{
EnumRitualReaderState state = this.getState(stack);
BlockEntity tile = world.getBlockEntity(pos);
if (tile instanceof IMasterRitualStone)
if (tile instanceof IMasterRitualStone master)
{
IMasterRitualStone master = (IMasterRitualStone) tile;
if (master.getCurrentRitual() == null)
if (master.getCurrentRitual() == null)
super.useOn(context);
this.setMasterBlockPos(stack, pos);
this.setBlockPos(stack, BlockPos.ZERO);
Expand Down Expand Up @@ -195,10 +189,9 @@ public InteractionResult useOn(UseOnContext context)
} else
{
tile = world.getBlockEntity(masterPos);
if (tile instanceof IMasterRitualStone)
if (tile instanceof IMasterRitualStone master)
{
IMasterRitualStone master = (IMasterRitualStone) tile;
BlockPos pos2 = pos.subtract(masterPos);
BlockPos pos2 = pos.subtract(masterPos);
String range = this.getCurrentBlockRange(stack);
if (range == null || range.isEmpty())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
if (itemUsing.isEmpty() || ((IBindable) itemUsing.getItem()).getBinding(itemUsing) == null)
return InteractionResultHolder.pass(stack);

itemUsing.getItem().use(world, player, hand);

InteractionResultHolder<ItemStack> result = itemUsing.getItem().use(world, player, hand);
saveInventory(stack, inv);

return InteractionResultHolder.pass(stack);
// dont throw away the internal sigils use result, didnt do that in useOn either
return result;
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public InteractionResultHolder<ItemStack> use(Level world, Player player, Intera
public InteractionResult useOn(UseOnContext context)
{
ItemStack stack = context.getItemInHand();
// need this to work in holding sigil
if (stack.getItem() instanceof ISigil.Holding) {
stack = ((Holding) stack.getItem()).getHeldItem(stack, context.getPlayer());
}
BlockPos pos = context.getClickedPos();
Level world = context.getLevel();
Player player = context.getPlayer();
Expand All @@ -108,9 +112,10 @@ public InteractionResult useOn(UseOnContext context)
BindableHelper.applyBinding(stack, player);
}
}
return InteractionResult.SUCCESS;
}

return InteractionResult.SUCCESS;
return InteractionResult.PASS;
}

public void setStoredPos(ItemStack stack, BlockPos pos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ public void onPlayerLeftClickAir(PlayerInteractEvent.LeftClickEmpty event)
}
}

@SubscribeEvent
// make cycling the diviner also work on clicking on a block instead of only on clicking nothing
public void onPlayerLeftClickBlock(PlayerInteractEvent.LeftClickBlock event)
{
if (event.getItemStack().getItem() instanceof ItemRitualDiviner)
{
BloodMagicPacketHandler.INSTANCE.sendToServer(new CycleRitualDivinerPacket(event.getEntity().getInventory().selected));
}
}

@SubscribeEvent
// Called when an entity is set to be hurt. Called before vanilla armour
// calculations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pages": [
{
"type": "patchouli:text",
"text": "Crafting rituals is an intricate business; Even if you have the correct $(item)Inscription Tools$(), you can't just slap runic inscriptions down any old how and expect things to happen. Luckily, the $(item)Ritual Diviner$() is here to help. $(br2)Hold [$(k:sneak)] and press [$(k:use)] or [$(k:attack)] while looking at empty air to cycle through the avaliable rituals in either direction."
"text": "Crafting rituals is an intricate business; Even if you have the correct $(item)Inscription Tools$(), you can't just slap runic inscriptions down any old how and expect things to happen. Luckily, the $(item)Ritual Diviner$() is here to help. $(br2)Hold [$(k:sneak)] and press [$(k:use)] or [$(k:attack)] to cycle through the avaliable rituals in either direction."
},
{
"type": "patchouli:text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"type": "patchouli:text",
"text": "$(li)forge:storage_blocks/hellforged block and item tags have been added to the respective forge:storage_blocks tag$(li)prevent a crash when opening the Edit HUD position screen while looking at an entity$(li)soft coating no longer voids the contents of shulker boxes (or other tile-entities)"
},
{
"type": "patchouli:text",
"text": "$(li)teleposition sigil now teleports you when clicking on a non-teleposer block as well. it also now checks itself for a destination when inside a sigil of holding$()$(li)ritual diviner and tinkerer can now be cycled even when looking at a (non master ritual stone) block"
},
{
"type": "patchouli:text",
"title": "3.3.5",
Expand Down