From fc29057f055eaeeaf30fac39312f6fc38fae02fe Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 8 Sep 2023 12:36:37 +0100 Subject: [PATCH] Added mango trees --- .../unicopia/block/UBlocks.java | 8 +- .../unicopia/server/world/UTreeGen.java | 16 +++ .../assets/unicopia/blockstates/mango.json | 7 + .../unicopia/blockstates/mango_leaves.json | 7 + .../unicopia/blockstates/mango_sapling.json | 7 + .../resources/assets/unicopia/lang/en_us.json | 3 + .../assets/unicopia/models/block/mango.json | 6 + .../unicopia/models/block/mango_sapling.json | 6 + .../unicopia/models/item/mango_leaves.json | 3 + .../unicopia/models/item/mango_sapling.json | 6 + .../unicopia/textures/item/mango_sapling.png | Bin 0 -> 6763 bytes .../unicopia/loot_tables/blocks/mango.json | 20 +++ .../loot_tables/blocks/mango_leaves.json | 135 ++++++++++++++++++ 13 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/assets/unicopia/blockstates/mango.json create mode 100644 src/main/resources/assets/unicopia/blockstates/mango_leaves.json create mode 100644 src/main/resources/assets/unicopia/blockstates/mango_sapling.json create mode 100644 src/main/resources/assets/unicopia/models/block/mango.json create mode 100644 src/main/resources/assets/unicopia/models/block/mango_sapling.json create mode 100644 src/main/resources/assets/unicopia/models/item/mango_leaves.json create mode 100644 src/main/resources/assets/unicopia/models/item/mango_sapling.json create mode 100644 src/main/resources/assets/unicopia/textures/item/mango_sapling.png create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/mango.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/mango_leaves.json diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index e313f357..9870044e 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -70,9 +70,15 @@ public interface UBlocks { Block PALM_WALL_HANGING_SIGN = register("palm_wall_hanging_sign", new WallHangingSignBlock(Settings.create().mapColor(PALM_LOG.getDefaultMapColor()).solid().instrument(Instrument.BASS).noCollision().strength(1.0f).burnable().dropsLike(PALM_HANGING_SIGN), UWoodTypes.PALM)); Block PALM_LEAVES = register("palm_leaves", BlockConstructionUtils.createLeavesBlock(BlockSoundGroup.GRASS), ItemGroups.BUILDING_BLOCKS); - Block BANANAS = register("bananas", new FruitBlock(Settings.create().mapColor(MapColor.YELLOW).sounds(BlockSoundGroup.WOOD).hardness(3).pistonBehavior(PistonBehavior.DESTROY), Direction.DOWN, PALM_LEAVES, VoxelShapes.fullCube())); + Block MANGO_LEAVES = register("mango_leaves", new FruitBearingBlock(FabricBlockSettings.copy(Blocks.JUNGLE_LEAVES), + 0xCCFFAA00, + () -> UBlocks.MANGO, + () -> UItems.MANGO.getDefaultStack() + ), ItemGroups.NATURAL); + Block MANGO = register("mango", new FruitBlock(Settings.create().mapColor(MapColor.ORANGE), Direction.DOWN, MANGO_LEAVES, FruitBlock.DEFAULT_SHAPE)); + Block WEATHER_VANE = register("weather_vane", new WeatherVaneBlock(Settings.create().mapColor(MapColor.BLACK).requiresTool().strength(3.0f, 6.0f).sounds(BlockSoundGroup.METAL).nonOpaque().pistonBehavior(PistonBehavior.BLOCK)), ItemGroups.TOOLS); Block GREEN_APPLE_LEAVES = register("green_apple_leaves", new FruitBearingBlock(FabricBlockSettings.copy(Blocks.OAK_LEAVES), diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java index 04cc4bb5..6add2f79 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.server.world; +import com.google.common.collect.ImmutableList; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.block.UBlocks; @@ -15,6 +16,9 @@ import net.minecraft.world.gen.feature.TreeFeatureConfig; import net.minecraft.world.gen.foliage.BlobFoliagePlacer; import net.minecraft.world.gen.foliage.JungleFoliagePlacer; import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.treedecorator.LeavesVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.trunk.MegaJungleTrunkPlacer; import net.minecraft.world.gen.trunk.StraightTrunkPlacer; import net.minecraft.world.gen.trunk.UpwardsBranchingTrunkPlacer; @@ -61,6 +65,18 @@ public interface UTreeGen { .biomes(selector -> selector.hasTag(BiomeTags.IS_BEACH) || selector.hasTag(BiomeTags.IS_JUNGLE)) .count(2, 0.01F, 1) .build(); + Tree MANGO_TREE = Tree.Builder.create(Unicopia.id("mango_tree"), + new MegaJungleTrunkPlacer(8, 9, 19), + new JungleFoliagePlacer(ConstantIntProvider.create(4), ConstantIntProvider.create(0), 2) + ) + .farmingCondition(9, 0, 4) + .log(Blocks.JUNGLE_LOG) + .leaves(UBlocks.MANGO_LEAVES) + .biomes(selector -> selector.hasTag(BiomeTags.IS_JUNGLE)) + .sapling(Unicopia.id("mango_sapling")) + .count(1, 1, 2) + .configure(builder -> builder.decorators(ImmutableList.of(TrunkVineTreeDecorator.INSTANCE, new LeavesVineTreeDecorator(0.25f)))) + .build(); static Tree createAppleTree(String name, Block leaves, int preferredDensity) { return Tree.Builder.create(Unicopia.id(name + "_tree"), diff --git a/src/main/resources/assets/unicopia/blockstates/mango.json b/src/main/resources/assets/unicopia/blockstates/mango.json new file mode 100644 index 00000000..7941fcf8 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/mango.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/mango" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/mango_leaves.json b/src/main/resources/assets/unicopia/blockstates/mango_leaves.json new file mode 100644 index 00000000..b0cd81cb --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/mango_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "minecraft:block/jungle_leaves" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/mango_sapling.json b/src/main/resources/assets/unicopia/blockstates/mango_sapling.json new file mode 100644 index 00000000..751bec0e --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/mango_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/mango_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index ce7e8cee..87d92a4c 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -182,6 +182,9 @@ "block.unicopia.palm_hanging_sign": "Palm Hanging Sign", "block.unicopia.apple_pie": "Apple Pie", "block.unicopia.weather_vane": "Weather Vane", + "block.unicopia.mango": "Mango", + "block.unicopia.mango_leaves": "Mango Leaves", + "block.unicopia.mango_sapling": "Mango Sapling", "block.unicopia.green_apple_leaves": "Granny Smith Leaves", "block.unicopia.green_apple_sapling": "Granny Smith Sapling", diff --git a/src/main/resources/assets/unicopia/models/block/mango.json b/src/main/resources/assets/unicopia/models/block/mango.json new file mode 100644 index 00000000..af25a18b --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/mango.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:block/fruit", + "textures": { + "cross": "unicopia:item/mango" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/mango_sapling.json b/src/main/resources/assets/unicopia/models/block/mango_sapling.json new file mode 100644 index 00000000..e064e572 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/mango_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "unicopia:item/mango_sapling" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/mango_leaves.json b/src/main/resources/assets/unicopia/models/item/mango_leaves.json new file mode 100644 index 00000000..4be7c1ad --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/mango_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:block/jungle_leaves" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/mango_sapling.json b/src/main/resources/assets/unicopia/models/item/mango_sapling.json new file mode 100644 index 00000000..a7d65508 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/mango_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/mango_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/textures/item/mango_sapling.png b/src/main/resources/assets/unicopia/textures/item/mango_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..fe7946aa87916b0ed2f481c3ffefdee082cee6a6 GIT binary patch literal 6763 zcmeHLdstIP7QZ100R#~VRxL^lSR)$pgghhx2?3%;2}Voby-98$3Ivk~!HTumqQ(am zY_%>@3AS3T?bb)Dv{)6b^~FOgNqg*F(*NC&myB&xe#4&x`i_=LC{x1fNH41Nrc8zT^cJ(n+#awSr(n8D*oW4ThU0JKRP?t28Lm_K$8 z^I#*S-k1<PMr|{Qdm`0_j140|o>R8yp%;A2B>)N$u-fS**7`|*T=0wq(ZzBE7ofB~SeYY<|J>_Z__sT2yV7Q;G5384-i#hd6G zs=;Z@IduMOtE&AXlRnuWmeG78N}#ip_y-JmV(75pqn{eX8XGN)jT4C_Qbn>dB{fYo zX}WgC%%?M-c~);Aj9J;HSytQJfbKrrv-X{J&YF$yy}xPm z2V1u9*tzS|&vx&rJy3t}&{v1QK63PA%Qvmxp8D?ene!KZx_IewTlYOlN5h7!oBsKl&yL%^lgF3#{aSimWfN`*EGY0?8yu9ytU{z`E`^SQ~u2EqGJ5 z)6u!3{dfn6%5v`guIrrB!NMMDJ*I6v*7m?Set=;T&+*P#o;`Hx> z6;8*v;}goBg|4kk+u(FWs{&Zgg>owhu9j7yv23J+^)ch-w3#3}AphmoI+nAp*c(r~A&O zYcf6#a>+(_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oS->N31;^8Uqh_$& zi5mN$FNN6z$^sC^=1SOH@xz31ya992JEJ$^c+S6Z67N>%_mTlSj|^U3@Gj)^y$rpa zfxmy{3Spv9!dG}>3U4pBQfwu%8yUi|BbGI``0NV4}Jv| z!eyyr-S|^*)$-L%PEE#o&}T#4rV5bw=chem#jpWzV;&Gn!q!y|1tHC*QY&d~@XvKV zx!}ji!{9cZsY;%x6(8GH&YN7HNI%>&hV9S=p8t?uGHT#dO;UBmvfXEt)U1gDVoqyt zQzx}{&u-(9)ibt>!}eECrw(u`PAX<4YowKnUYwGoD(!xI!VmwrTX*N)by81m-P8)& z%7zyCi7l=dHyvqt^z6PKJS zP^2$CAexb!L#e-3{^^rRKdjkfY~7R1Ci{i2UnZZeo!TB7UDLYZH)HYg$nB183&OVf zo=A+w1~&_Tu27JepLI|0KX)PX@U?%0PAxFv-<2h6N9p**)RhfAFDK|6M-RSps)WvN zy|VwQm&%9a_uQz|uBK^^#<^k_r2ckWBY#76d2Id3Rt_cS`<0u>Y0F$KB#fb}IdI2( YdeG|b$O()2=pw9APEGzO>E)7t0WRQ$>i_@% literal 0 HcmV?d00001 diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/mango.json b/src/main/resources/data/unicopia/loot_tables/blocks/mango.json new file mode 100644 index 00000000..d9e9e3d4 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/mango.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:mango" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/mango_leaves.json b/src/main/resources/data/unicopia/loot_tables/blocks/mango_leaves.json new file mode 100644 index 00000000..d48c4a30 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/mango_leaves.json @@ -0,0 +1,135 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + ], + "name": "unicopia:mango_leaves" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:survives_explosion" + }, + { + "chances": [ + 0.05, + 0.0625, + 0.083333336, + 0.1 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "name": "unicopia:mango_sapling" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "chances": [ + 0.02, + 0.022222223, + 0.025, + 0.033333335, + 0.1 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 2.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "minecraft:stick" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file