Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ AgriCraft is *not* installed.
- 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
- now uses a fake player so certus quartz now actually drops, instead of getting voided because there was no entity passed to the drop generation

------------------------------------------------------
Version 3.3.5
Expand Down
24 changes: 18 additions & 6 deletions src/main/java/wayoftime/bloodmagic/ritual/types/RitualGeode.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package wayoftime.bloodmagic.ritual.types;

import com.mojang.authlib.GameProfile;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
Expand All @@ -14,8 +15,12 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParam;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.FakePlayerFactory;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.ConfigManager;
import wayoftime.bloodmagic.api.compat.EnumDemonWillType;
Expand Down Expand Up @@ -113,6 +118,8 @@ public void performRitual(IMasterRitualStone masterRitualStone) {
if (steadfastWill > MIN_STEADFAST) {
toolStack = silkPick;
doSilk = true;
// if both are configured silk touch takes priority and fortune cost shouldnt be paid
doFortune = false;
}

double fortuneWill = destructiveWill;
Expand All @@ -132,9 +139,15 @@ public void performRitual(IMasterRitualStone masterRitualStone) {
continue;
}
}
LootParams.Builder lootBuilder = new LootParams.Builder((ServerLevel) world);
Vec3 blockCenter = new Vec3(harvestPos.getX() + 0.5, harvestPos.getY() + 0.5, harvestPos.getZ() + 0.5);
List<ItemStack> blockDrops = state.getDrops(lootBuilder.withParameter(LootContextParams.ORIGIN, blockCenter).withParameter(LootContextParams.TOOL, toolStack));

LootParams.Builder paramsBuilder = new LootParams.Builder((ServerLevel) world)
.withParameter(LootContextParams.ORIGIN, pos.getCenter())
.withParameter(LootContextParams.BLOCK_STATE, world.getBlockState(pos))
.withParameter(LootContextParams.TOOL, toolStack)
.withOptionalParameter(LootContextParams.BLOCK_ENTITY, world.getBlockEntity(pos))
.withOptionalParameter(LootContextParams.THIS_ENTITY, FakePlayerFactory.get((ServerLevel) world, new GameProfile(masterRitualStone.getOwner(), "[BM Geode]")));

List<ItemStack> blockDrops = state.getDrops(paramsBuilder);
drops.addAll(blockDrops);
BlockProtectionHelper.tryBreakBlockNoDrops(world, harvestPos, masterRitualStone.getOwner());
if (doFortune) {
Expand All @@ -145,10 +158,9 @@ public void performRitual(IMasterRitualStone masterRitualStone) {
}

for (ItemStack dropStack : drops) {
if (doStore && storeWill >= WILL_PER_STORE * blockDrops.size()) {
int size = dropStack.getCount();
if (doStore && storeWill >= WILL_PER_STORE) {
dropStack = Utils.insertStackIntoTile(dropStack, inv, Direction.DOWN);
storeWill -= (size - dropStack.getCount());
storeWill -= WILL_PER_STORE;
}
if (!dropStack.isEmpty()) {
Utils.spawnStackAtBlock(world, harvestPos, Direction.UP, dropStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
{
"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)"
"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)$(li)now actually harvests certus quartz"
},
{
"type": "patchouli:text",
Expand Down
Loading