Squashed commit of the following:

commit e398793b887986e730cf6b3c7a9c96861d186591
Author: simibubi <31564874+simibubi@users.noreply.github.com>
Date:   Thu Jul 25 11:00:21 2024 +0200

    Remove duplicate line in buildscript

commit e6a1ebd40332ba649fab968841d7b88cdec51553
Merge: acbe5102c 283998711
Author: simibubi <31564874+simibubi@users.noreply.github.com>
Date:   Thu Jul 25 10:48:13 2024 +0200

    Merge branch 'mc1.18/dev' into pr/6403

commit acbe5102cf4757f75adeb21ebff8b0649e74e2a5
Merge: 4d2c35b11 1038b76d3
Author: simibubi <31564874+simibubi@users.noreply.github.com>
Date:   Thu Jul 18 10:27:51 2024 +0200

    Merge branch 'mc1.18/dev' into pr/6403

commit 4d2c35b11b
Author: attackeight <attackeight@gmail.com>
Date:   Tue Apr 23 15:39:37 2024 -0400

    Re-Activate Dynamic Trees Compat
This commit is contained in:
simibubi 2024-07-25 11:00:57 +02:00
parent 283998711d
commit b90e11c120
3 changed files with 31 additions and 22 deletions

View File

@ -195,9 +195,12 @@ dependencies {
runtimeOnly fg.deobf("org.squiddev:cc-tweaked-${cc_tweaked_minecraft_version}:${cc_tweaked_version}")
}
if (dynamic_trees_enable.toBoolean()) {
compileOnly fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-${dynamic_trees_minecraft_version}:${dynamic_trees_version}")
}
// implementation fg.deobf("curse.maven:ic2-classic-242942:4563059")
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
// implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
// runtimeOnly fg.deobf("vazkii.arl:AutoRegLib:1.4-35.69")
// runtimeOnly fg.deobf("vazkii.quark:Quark:r2.0-212.984")
// runtimeOnly fg.deobf("curse.maven:mantle-74924:4509007")

View File

@ -33,6 +33,10 @@ cc_tweaked_enable = true
cc_tweaked_minecraft_version = 1.18.2
cc_tweaked_version = 1.100.10
dynamic_trees_enable = true
dynamic_trees_minecraft_version = 1.18.2
dynamic_trees_version = 1.0.4
# curseforge information
projectId = 328085
curse_type = beta

View File

@ -4,32 +4,36 @@ import java.util.function.BiConsumer;
import javax.annotation.Nullable;
import com.ferreusveritas.dynamictrees.api.TreeHelper;
import com.ferreusveritas.dynamictrees.block.branch.BranchBlock;
import com.ferreusveritas.dynamictrees.block.branch.TrunkShellBlock;
import com.ferreusveritas.dynamictrees.util.BranchDestructionData;
import com.simibubi.create.foundation.utility.AbstractBlockBreakQueue;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
// Commented until dynamic trees are updated
public class DynamicTree extends AbstractBlockBreakQueue {
// private BlockPos startCutPos;
private BlockPos startCutPos;
public DynamicTree(BlockPos startCutPos) {
// this.startCutPos = startCutPos;
}
public static boolean isDynamicBranch(Block block) {
return false; // TreeHelper.isBranch(block) || block instanceof TrunkShellBlock;
this.startCutPos = startCutPos;
}
public static boolean isDynamicBranch(Block block) {
return TreeHelper.isBranch(block) || block instanceof TrunkShellBlock;
}
@Override
public void destroyBlocks(Level world, ItemStack toDamage, @Nullable Player playerEntity, BiConsumer<BlockPos, ItemStack> drop) {
/*
BranchBlock start = TreeHelper.getBranch(world.getBlockState(startCutPos));
if (start == null) //if start is null, it was not a branch
start = setBranchToShellMuse(world, world.getBlockState(startCutPos)); //we check for a trunk shell instead
@ -39,20 +43,19 @@ public class DynamicTree extends AbstractBlockBreakQueue {
// Play and render block break sound and particles
world.levelEvent(null, 2001, startCutPos, Block.getId(world.getBlockState(startCutPos)));
// Actually breaks the tree
// Actually breaks the tree
BranchDestructionData data = start.destroyBranchFromNode(world, startCutPos, Direction.DOWN, false, playerEntity);
// Feed all the tree drops to drop bi-consumer
data.leavesDrops.forEach(stackPos -> drop.accept(stackPos.pos.offset(startCutPos), stackPos.stack));
start.getLogDrops(world, startCutPos, data.species, data.woodVolume).forEach(stack -> drop.accept(startCutPos, stack));
*/
start.getFamily().getCommonSpecies().getBranchesDrops(world, data.woodVolume).forEach(stack -> drop.accept(startCutPos, stack));
}
/*
private BranchBlock setBranchToShellMuse(World world, BlockState state) {
private BranchBlock setBranchToShellMuse(Level world, BlockState state) {
Block block = state.getBlock();
if (block instanceof TrunkShellBlock){
TrunkShellBlock.ShellMuse muse = ((TrunkShellBlock)block).getMuse(world, startCutPos);
@ -61,10 +64,9 @@ public class DynamicTree extends AbstractBlockBreakQueue {
return TreeHelper.getBranch(muse.state);
}
}
return null;
}
*/
}