mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-03 14:24:42 +01:00
feat: unhardcode treecutter
This commit is contained in:
parent
ddae967de6
commit
75c1c8f200
10 changed files with 536 additions and 404 deletions
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"values": [
|
||||
"minecraft:mushroom_stem",
|
||||
{
|
||||
"id": "quark:glow_shroom_stem",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:indigo_mushroom_stem",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:blood_mushroom_stem",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:ink_mushroom_stem",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:veil_mushroom_stem",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"values": [
|
||||
{
|
||||
"id": "quark:glow_shroom_block",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"values": [
|
||||
"minecraft:red_mushroom_block",
|
||||
{
|
||||
"id": "aether_redux:cloud_cap_block",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "aether_redux:jellyshroom_jelly_block",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "deep_aether:lightcap_mushroom_block",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"values": [
|
||||
"minecraft:brown_mushroom_block",
|
||||
"minecraft:weeping_vines",
|
||||
"minecraft:weeping_vines_plant",
|
||||
"#minecraft:wart_blocks",
|
||||
{
|
||||
"id": "undergarden:indigo_mushroom_cap",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:blood_mushroom_cap",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:engorged_blood_mushroom_cap",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:ink_mushroom_cap",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "undergarden:veil_mushroom_cap",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"values": [
|
||||
"minecraft:bamboo",
|
||||
"minecraft:cactus",
|
||||
"minecraft:sugar_cane",
|
||||
"minecraft:kelp",
|
||||
"minecraft:kelp_plant",
|
||||
{
|
||||
"id": "gardens_of_the_dead:whistlecane",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "unusualend:chorus_cane",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "unusualend:blooming_chorus_cane",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -116,6 +116,11 @@ public class AllTags {
|
|||
NON_HARVESTABLE,
|
||||
|
||||
CORALS,
|
||||
VERTICAL_PLANTS,
|
||||
MUSHROOM_STEMS,
|
||||
NON_DECAYING_LEAF_DIST1,
|
||||
NON_DECAYING_LEAF_DIST2,
|
||||
NON_DECAYING_LEAF_DIST3,
|
||||
|
||||
RELOCATION_NOT_SUPPORTED(FORGE),
|
||||
WG_STONE(FORGE),
|
||||
|
|
|
@ -501,19 +501,11 @@ public class SawBlockEntity extends BlockBreakingKineticBlockEntity {
|
|||
return true;
|
||||
if (TreeCutter.isRoot(stateToBreak))
|
||||
return true;
|
||||
if (TreeCutter.isVerticalPlant(stateToBreak))
|
||||
return true;
|
||||
Block block = stateToBreak.getBlock();
|
||||
if (block instanceof BambooStalkBlock)
|
||||
return true;
|
||||
if (block instanceof StemGrownBlock)
|
||||
return true;
|
||||
if (block instanceof CactusBlock)
|
||||
return true;
|
||||
if (block instanceof SugarCaneBlock)
|
||||
return true;
|
||||
if (block instanceof KelpPlantBlock)
|
||||
return true;
|
||||
if (block instanceof KelpBlock)
|
||||
return true;
|
||||
if (block instanceof ChorusPlantBlock)
|
||||
return true;
|
||||
if (TreeCutter.canDynamicTreeCutFrom(block))
|
||||
|
|
|
@ -218,16 +218,7 @@ public class TreeCutter {
|
|||
}
|
||||
|
||||
public static boolean isVerticalPlant(BlockState stateAbove) {
|
||||
Block block = stateAbove.getBlock();
|
||||
if (block instanceof BambooStalkBlock)
|
||||
return true;
|
||||
if (block instanceof CactusBlock)
|
||||
return true;
|
||||
if (block instanceof SugarCaneBlock)
|
||||
return true;
|
||||
if (block instanceof KelpPlantBlock)
|
||||
return true;
|
||||
return block instanceof KelpBlock;
|
||||
return AllBlockTags.VERTICAL_PLANTS.matches(stateAbove);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,17 +291,20 @@ public class TreeCutter {
|
|||
}
|
||||
|
||||
public static boolean isLog(BlockState state) {
|
||||
return state.is(BlockTags.LOGS) || AllTags.AllBlockTags.SLIMY_LOGS.matches(state)
|
||||
|| state.is(Blocks.MUSHROOM_STEM);
|
||||
return state.is(BlockTags.LOGS) || AllBlockTags.SLIMY_LOGS.matches(state)
|
||||
|| AllBlockTags.MUSHROOM_STEMS.matches(state);
|
||||
}
|
||||
|
||||
private static int nonDecayingLeafDistance(BlockState state) {
|
||||
if (state.is(Blocks.RED_MUSHROOM_BLOCK))
|
||||
if (AllBlockTags.NON_DECAYING_LEAF_DIST3.matches(state)){
|
||||
return 3;
|
||||
}
|
||||
if (AllBlockTags.NON_DECAYING_LEAF_DIST2.matches(state)){
|
||||
return 2;
|
||||
if (state.is(Blocks.BROWN_MUSHROOM_BLOCK))
|
||||
return 3;
|
||||
if (state.is(BlockTags.WART_BLOCKS) || state.is(Blocks.WEEPING_VINES) || state.is(Blocks.WEEPING_VINES_PLANT))
|
||||
return 3;
|
||||
}
|
||||
if (AllBlockTags.NON_DECAYING_LEAF_DIST1.matches(state)){
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,6 +143,19 @@ public class CreateRegistrateTags {
|
|||
Blocks.BUBBLE_CORAL_WALL_FAN, Blocks.FIRE_CORAL_WALL_FAN, Blocks.HORN_CORAL_WALL_FAN
|
||||
);
|
||||
|
||||
prov.tag(AllBlockTags.VERTICAL_PLANTS.tag)
|
||||
.add(Blocks.BAMBOO, Blocks.CACTUS, Blocks.SUGAR_CANE, Blocks.KELP, Blocks.KELP_PLANT);
|
||||
|
||||
prov.tag(AllBlockTags.MUSHROOM_STEMS.tag)
|
||||
.add(Blocks.MUSHROOM_STEM);
|
||||
|
||||
prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST2.tag)
|
||||
.add(Blocks.RED_MUSHROOM_BLOCK);
|
||||
|
||||
prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST3.tag)
|
||||
.add(Blocks.BROWN_MUSHROOM_BLOCK, Blocks.WEEPING_VINES, Blocks.WEEPING_VINES_PLANT)
|
||||
.addTag(BlockTags.WART_BLOCKS);
|
||||
|
||||
// COMPAT
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.NON_MOVABLE.tag), Mods.IE, List.of(
|
||||
|
@ -150,8 +163,32 @@ public class CreateRegistrateTags {
|
|||
"connector_hv", "connector_hv_relay", "connector_bundled", "connector_structural",
|
||||
"connector_redstone", "connector_probe", "breaker_switch"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.ROOTS.tag), Mods.TF,
|
||||
List.of("root", "liveroot_block", "mangrove_root"));
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.ROOTS.tag), Mods.TF, List.of(
|
||||
"root", "liveroot_block", "mangrove_root"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST2.tag), Mods.AET_R, List.of(
|
||||
"cloud_cap_block", "jellyshroom_jelly_block"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST2.tag), Mods.D_AET, List.of(
|
||||
"lightcap_mushroom_block"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.VERTICAL_PLANTS.tag), Mods.GOTD, List.of(
|
||||
"whistlecane"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.VERTICAL_PLANTS.tag), Mods.UUE, List.of(
|
||||
"chorus_cane", "blooming_chorus_cane"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.MUSHROOM_STEMS.tag), Mods.Q, List.of(
|
||||
"glow_shroom_stem"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST1.tag), Mods.Q, List.of(
|
||||
"glow_shroom_block"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.MUSHROOM_STEMS.tag), Mods.UG, List.of(
|
||||
"indigo_mushroom_stem", "blood_mushroom_stem", "ink_mushroom_stem", "veil_mushroom_stem"));
|
||||
|
||||
TagGen.addOptional(prov.tag(AllBlockTags.NON_DECAYING_LEAF_DIST3.tag), Mods.UG, List.of(
|
||||
"indigo_mushroom_cap", "blood_mushroom_cap", "engorged_blood_mushroom_cap", "ink_mushroom_cap", "veil_mushroom_cap"));
|
||||
|
||||
// VALIDATE
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue