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 00000000..fe7946aa Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/mango_sapling.png differ 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