mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Added mango trees
This commit is contained in:
parent
c4a5835b5d
commit
fc29057f05
13 changed files with 223 additions and 1 deletions
|
@ -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_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 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 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 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),
|
Block GREEN_APPLE_LEAVES = register("green_apple_leaves", new FruitBearingBlock(FabricBlockSettings.copy(Blocks.OAK_LEAVES),
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.minelittlepony.unicopia.server.world;
|
package com.minelittlepony.unicopia.server.world;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.minelittlepony.unicopia.Unicopia;
|
import com.minelittlepony.unicopia.Unicopia;
|
||||||
import com.minelittlepony.unicopia.block.UBlocks;
|
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.BlobFoliagePlacer;
|
||||||
import net.minecraft.world.gen.foliage.JungleFoliagePlacer;
|
import net.minecraft.world.gen.foliage.JungleFoliagePlacer;
|
||||||
import net.minecraft.world.gen.stateprovider.BlockStateProvider;
|
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.StraightTrunkPlacer;
|
||||||
import net.minecraft.world.gen.trunk.UpwardsBranchingTrunkPlacer;
|
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))
|
.biomes(selector -> selector.hasTag(BiomeTags.IS_BEACH) || selector.hasTag(BiomeTags.IS_JUNGLE))
|
||||||
.count(2, 0.01F, 1)
|
.count(2, 0.01F, 1)
|
||||||
.build();
|
.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) {
|
static Tree createAppleTree(String name, Block leaves, int preferredDensity) {
|
||||||
return Tree.Builder.create(Unicopia.id(name + "_tree"),
|
return Tree.Builder.create(Unicopia.id(name + "_tree"),
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "unicopia:block/mango"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "minecraft:block/jungle_leaves"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "unicopia:block/mango_sapling"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -182,6 +182,9 @@
|
||||||
"block.unicopia.palm_hanging_sign": "Palm Hanging Sign",
|
"block.unicopia.palm_hanging_sign": "Palm Hanging Sign",
|
||||||
"block.unicopia.apple_pie": "Apple Pie",
|
"block.unicopia.apple_pie": "Apple Pie",
|
||||||
"block.unicopia.weather_vane": "Weather Vane",
|
"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_leaves": "Granny Smith Leaves",
|
||||||
"block.unicopia.green_apple_sapling": "Granny Smith Sapling",
|
"block.unicopia.green_apple_sapling": "Granny Smith Sapling",
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "unicopia:block/fruit",
|
||||||
|
"textures": {
|
||||||
|
"cross": "unicopia:item/mango"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/cross",
|
||||||
|
"textures": {
|
||||||
|
"cross": "unicopia:item/mango_sapling"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/jungle_leaves"
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "unicopia:item/mango_sapling"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue