diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java index b69ebae4..f02ee066 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java @@ -1,10 +1,13 @@ package com.minelittlepony.unicopia.ability; +import java.util.HashSet; +import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.function.DoubleSupplier; import java.util.function.Supplier; - import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.ability.data.Pos; @@ -12,9 +15,12 @@ import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.particle.MagicParticleEffect; import com.minelittlepony.unicopia.particle.ParticleUtils; +import com.minelittlepony.unicopia.server.world.BlockDestructionManager; +import com.minelittlepony.unicopia.server.world.UTreeGen; import com.minelittlepony.unicopia.util.TraceHelper; import com.minelittlepony.unicopia.util.VecHelper; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.CarrotsBlock; @@ -23,10 +29,13 @@ import net.minecraft.item.BoneMealItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.particle.ParticleTypes; +import net.minecraft.state.property.Property; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.random.Random; import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; /** * Earth Pony ability to grow crops @@ -67,10 +76,14 @@ public class EarthPonyGrowAbility implements Ability { public boolean apply(Pony player, Pos data) { int count = 0; - for (BlockPos pos : BlockPos.iterate( - data.pos().add(-2, -2, -2), - data.pos().add( 2, 2, 2))) { - count += applySingle(player, player.asWorld(), player.asWorld().getBlockState(pos), pos); + if (!applyDirectly(player, data.pos())) { + for (BlockPos pos : BlockPos.iterate( + data.pos().add(-2, -2, -2), + data.pos().add( 2, 2, 2))) { + count += applySingle(player, player.asWorld(), player.asWorld().getBlockState(pos), pos); + } + } else { + count = 1; } if (count > 0) { @@ -90,16 +103,7 @@ public class EarthPonyGrowAbility implements Ability { if (state.isOf(Blocks.CARROTS)) { if (state.get(CarrotsBlock.AGE) == CarrotsBlock.MAX_AGE) { boolean transform = w.random.nextInt(3) == 0; - DoubleSupplier vecComponentFactory = () -> w.random.nextTriangular(0, 0.5); - Supplier posSupplier = () -> pos.toCenterPos().add(VecHelper.supply(vecComponentFactory)); - - for (int i = 0; i < 25; i++) { - ParticleUtils.spawnParticle(w, new MagicParticleEffect(0xFFFF00), posSupplier.get(), Vec3d.ZERO); - if (transform) { - ParticleUtils.spawnParticle(w, ParticleTypes.CLOUD, posSupplier.get(), Vec3d.ZERO); - } - } - + spawnConversionParticles(w, pos, transform); if (transform) { w.setBlockState(pos, UBlocks.GOLD_ROOT.getDefaultState().with(CarrotsBlock.AGE, CarrotsBlock.MAX_AGE)); } @@ -134,6 +138,55 @@ public class EarthPonyGrowAbility implements Ability { return 0; } + private boolean applyDirectly(Pony player, BlockPos pos) { + return TransmutationRecipe.RECIPES.stream() + .filter(recipe -> recipe.matches(player.asWorld(), pos)) + .map(recipe -> recipe.checkPattern(player.asWorld(), pos)) + .filter(result -> result.matchedLocations().size() + 1 >= TransmutationRecipe.MINIMUM_INPUT) + .filter(result -> { + boolean transform = result.shoudTransform(player.asWorld().random); + + player.playSound(USounds.ENTITY_CRYSTAL_SHARDS_AMBIENT, 1); + + result.matchedLocations().forEach(cell -> { + spawnConversionParticles(player.asWorld(), cell.up(), false); + BlockDestructionManager manager = BlockDestructionManager.of(player.asWorld()); + if (transform) { + if (manager.damageBlock(cell, 8) >= BlockDestructionManager.MAX_DAMAGE || player.asWorld().random.nextInt(20) == 0) { + player.asWorld().setBlockState(cell, Blocks.DIRT.getDefaultState()); + player.asWorld().syncWorldEvent(WorldEvents.BLOCK_BROKEN, cell, Block.getRawIdFromState(player.asWorld().getBlockState(cell))); + } + } else { + if (manager.damageBlock(cell, 4) >= BlockDestructionManager.MAX_DAMAGE || player.asWorld().random.nextInt(20) == 0) { + player.asWorld().setBlockState(cell, Blocks.DIRT.getDefaultState()); + player.asWorld().syncWorldEvent(WorldEvents.BLOCK_BROKEN, cell, Block.getRawIdFromState(player.asWorld().getBlockState(cell))); + } + } + }); + + spawnConversionParticles(player.asWorld(), pos, transform); + if (transform) { + player.asWorld().setBlockState(pos, result.recipe().getResult(player.asWorld(), pos)); + } + + return true; + }) + .findFirst() + .isPresent(); + } + + private static void spawnConversionParticles(World w, BlockPos pos, boolean success) { + DoubleSupplier vecComponentFactory = () -> w.random.nextTriangular(0, 0.5); + Supplier posSupplier = () -> pos.toCenterPos().add(VecHelper.supply(vecComponentFactory)); + + for (int i = 0; i < 25; i++) { + ParticleUtils.spawnParticle(w, new MagicParticleEffect(0xFFFF00), posSupplier.get(), Vec3d.ZERO); + if (success) { + ParticleUtils.spawnParticle(w, ParticleTypes.CLOUD, posSupplier.get(), Vec3d.ZERO); + } + } + } + @Override public void warmUp(Pony player, AbilitySlot slot) { player.getMagicalReserves().getExertion().addPercent(30); @@ -148,6 +201,57 @@ public class EarthPonyGrowAbility implements Ability { } + private static record TransmutationRecipe(Block input, BlockState output, BlockState material) { + static final List RECIPES = List.of( + new TransmutationRecipe(Blocks.OAK_SAPLING, UTreeGen.GOLDEN_APPLE_TREE.sapling().get().getDefaultState(), Blocks.RAW_GOLD_BLOCK.getDefaultState()), + new TransmutationRecipe(Blocks.CARROTS, UBlocks.GOLD_ROOT.getDefaultState(), Blocks.RAW_GOLD_BLOCK.getDefaultState()), + new TransmutationRecipe(Blocks.CORNFLOWER, UBlocks.CURING_JOKE.getDefaultState(), Blocks.LAPIS_BLOCK.getDefaultState()), + new TransmutationRecipe(Blocks.WITHER_ROSE, UBlocks.PLUNDER_VINE_BUD.getDefaultState(), Blocks.NETHERRACK.getDefaultState()) + ); + static final int RADIUS = 3; + static final int SIDE_LENGTH = (2 * RADIUS) + 1; + static final int AREA = (SIDE_LENGTH * SIDE_LENGTH) - 1; + static final int MINIMUM_INPUT = 9; + + public boolean matches(World world, BlockPos pos) { + return world.getBlockState(pos).isOf(input); + } + + public Result checkPattern(World world, BlockPos pos) { + BlockPos center = pos.down(); + Set matches = new HashSet<>(); + for (BlockPos cell : BlockPos.iterateInSquare(center, RADIUS, Direction.EAST, Direction.NORTH)) { + if (cell.equals(center)) { + continue; + } + if (!world.getBlockState(cell).equals(material)) { + break; + } + matches.add(cell.toImmutable()); + } + return new Result(this, matches); + } + + public BlockState getResult(World world, BlockPos pos) { + BlockState input = world.getBlockState(pos); + BlockState output = this.output; + for (var property : input.getProperties()) { + output = copyProperty(input, output, property); + } + return output; + } + + private > BlockState copyProperty(BlockState from, BlockState to, Property property) { + return to.withIfExists(property, from.get(property)); + } + + record Result (TransmutationRecipe recipe, Set matchedLocations) { + public boolean shoudTransform(Random random) { + return random.nextInt(TransmutationRecipe.AREA) < matchedLocations().size(); + } + } + } + public interface Growable { boolean grow(World world, BlockState state, BlockPos pos); } diff --git a/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java b/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java new file mode 100644 index 00000000..c6af9166 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/EnchantedFruitBlock.java @@ -0,0 +1,24 @@ +package com.minelittlepony.unicopia.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; + +public class EnchantedFruitBlock extends FruitBlock { + static final BooleanProperty ENCHANTED = BooleanProperty.of("enchanted"); + + public EnchantedFruitBlock(Settings settings, Direction attachmentFace, Block stem, VoxelShape shape) { + super(settings, attachmentFace, stem, shape); + setDefaultState(getDefaultState().with(ENCHANTED, false)); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(ENCHANTED); + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java b/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java index 8faa118a..b9741cef 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java @@ -62,6 +62,14 @@ public class FruitBearingBlock extends LeavesBlock implements TintedBlock, Bucka return true; } + protected boolean shouldAdvance(Random random) { + return true; + } + + protected BlockState getPlacedFruitState(Random random) { + return fruit.get().getDefaultState(); + } + @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { super.randomTick(state, world, pos, random); @@ -74,6 +82,10 @@ public class FruitBearingBlock extends LeavesBlock implements TintedBlock, Bucka BlockSoundGroup group = getSoundGroup(state); int steps = FertilizableUtil.getGrowthSteps(world, pos, state, random); while (steps-- > 0) { + if (!shouldAdvance(random)) { + continue; + } + if (state.get(STAGE) == Stage.FRUITING) { state = state.cycle(AGE); if (state.get(AGE) > 20) { @@ -89,7 +101,7 @@ public class FruitBearingBlock extends LeavesBlock implements TintedBlock, Bucka if (stage == Stage.FRUITING && isPositionValidForFruit(state, pos)) { if (world.isAir(fruitPosition)) { - world.setBlockState(fruitPosition, fruit.get().getDefaultState(), Block.NOTIFY_ALL); + world.setBlockState(fruitPosition, getPlacedFruitState(random), Block.NOTIFY_ALL); } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/GoldenOakLeavesBlock.java b/src/main/java/com/minelittlepony/unicopia/block/GoldenOakLeavesBlock.java new file mode 100644 index 00000000..1ae9ed61 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/GoldenOakLeavesBlock.java @@ -0,0 +1,26 @@ +package com.minelittlepony.unicopia.block; + +import java.util.function.Supplier; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.random.Random; + +public class GoldenOakLeavesBlock extends FruitBearingBlock { + + public GoldenOakLeavesBlock(Settings settings, int overlay, Supplier fruit, + Supplier rottenFruitSupplier) { + super(settings, overlay, fruit, rottenFruitSupplier); + } + + @Override + protected boolean shouldAdvance(Random random) { + return random.nextInt(1000) == 0; + } + + @Override + protected BlockState getPlacedFruitState(Random random) { + return super.getPlacedFruitState(random).with(EnchantedFruitBlock.ENCHANTED, random.nextInt(1000) == 0); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index ca6726e9..7fc8d666 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -79,7 +79,7 @@ public interface UBlocks { Block PALM_STAIRS = register("palm_stairs", new StairsBlock(PALM_PLANKS.getDefaultState(), Settings.copy(PALM_PLANKS).pistonBehavior(PistonBehavior.NORMAL)), ItemGroups.BUILDING_BLOCKS); Block PALM_SLAB = register("palm_slab", new SlabBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).strength(2, 3).sounds(BlockSoundGroup.WOOD).pistonBehavior(PistonBehavior.NORMAL)), ItemGroups.BUILDING_BLOCKS); Block PALM_FENCE = register("palm_fence", new FenceBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).strength(2, 3).sounds(BlockSoundGroup.WOOD).pistonBehavior(PistonBehavior.NORMAL)), ItemGroups.BUILDING_BLOCKS); - Block PALM_FENCE_GATE = register("palm_fence_gate", new FenceGateBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).strength(2, 3).sounds(BlockSoundGroup.WOOD).pistonBehavior(PistonBehavior.NORMAL), WoodType.OAK), ItemGroups.BUILDING_BLOCKS); + Block PALM_FENCE_GATE = register("palm_fence_gate", new FenceGateBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).strength(2, 3).sounds(BlockSoundGroup.WOOD).pistonBehavior(PistonBehavior.NORMAL), UWoodTypes.PALM), ItemGroups.BUILDING_BLOCKS); Block PALM_DOOR = register("palm_door", new DoorBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).instrument(Instrument.BASS).strength(3.0f).nonOpaque().burnable().pistonBehavior(PistonBehavior.DESTROY), UWoodTypes.PALM.setType()), ItemGroups.FUNCTIONAL); Block PALM_TRAPDOOR = register("palm_trapdoor", new TrapdoorBlock(Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).instrument(Instrument.BASS).strength(3).nonOpaque().allowsSpawning(BlockConstructionUtils::never).burnable(), UWoodTypes.PALM.setType()), ItemGroups.FUNCTIONAL); Block PALM_PRESSURE_PLATE = register("palm_pressure_plate", new PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, Settings.create().mapColor(PALM_PLANKS.getDefaultMapColor()).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD).pistonBehavior(PistonBehavior.DESTROY), BlockSetType.OAK), ItemGroups.BUILDING_BLOCKS); @@ -127,6 +127,16 @@ public interface UBlocks { Block SOUR_APPLE = register("sour_apple", new FruitBlock(Settings.create().mapColor(MapColor.GREEN), Direction.DOWN, SOUR_APPLE_LEAVES, FruitBlock.DEFAULT_SHAPE)); Block SOUR_APPLE_SPROUT = register("sour_apple_sprout", new SproutBlock(0xE5FFCC88, () -> UItems.SOUR_APPLE_SEEDS, () -> UTreeGen.SOUR_APPLE_TREE.sapling().map(Block::getDefaultState).get())); + Block GOLDEN_OAK_LEAVES = register("golden_oak_leaves", new GoldenOakLeavesBlock(FabricBlockSettings.copy(Blocks.OAK_LEAVES), + MapColor.GOLD.color, + () -> UBlocks.GOLDEN_APPLE, + () -> Items.GOLDEN_APPLE.getDefaultStack() + ), ItemGroups.NATURAL); + Block GOLDEN_APPLE = register("golden_apple", new EnchantedFruitBlock(Settings.create().mapColor(MapColor.GOLD), Direction.DOWN, GOLDEN_OAK_LEAVES, FruitBlock.DEFAULT_SHAPE)); + Block GOLDEN_OAK_SPROUT = register("golden_oak_sprout", new SproutBlock(0xE5FFCC88, () -> UItems.GOLDEN_OAK_SEEDS, () -> UTreeGen.GOLDEN_APPLE_TREE.sapling().map(Block::getDefaultState).get())); + + Block GOLDEN_OAK_LOG = register("golden_oak_log", BlockConstructionUtils.createLogBlock(MapColor.OFF_WHITE, MapColor.GOLD), ItemGroups.BUILDING_BLOCKS); + Block APPLE_PIE = register("apple_pie", new PieBlock(Settings.create().solid().mapColor(MapColor.ORANGE).strength(0.5F).sounds(BlockSoundGroup.WOOL).pistonBehavior(PistonBehavior.DESTROY), () -> UItems.APPLE_PIE_SLICE, () -> UItems.APPLE_PIE, @@ -254,10 +264,12 @@ public interface UBlocks { FlammableBlockRegistry.getDefaultInstance().add(GREEN_APPLE_LEAVES, 30, 60); FlammableBlockRegistry.getDefaultInstance().add(SWEET_APPLE_LEAVES, 30, 60); FlammableBlockRegistry.getDefaultInstance().add(SOUR_APPLE_LEAVES, 30, 60); + FlammableBlockRegistry.getDefaultInstance().add(GOLDEN_OAK_LEAVES, 60, 120); FlammableBlockRegistry.getDefaultInstance().add(MANGO_LEAVES, 30, 60); FlammableBlockRegistry.getDefaultInstance().add(PALM_LEAVES, 30, 60); FlammableBlockRegistry.getDefaultInstance().add(PALM_LOG, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(PALM_WOOD, 5, 5); + FlammableBlockRegistry.getDefaultInstance().add(GOLDEN_OAK_LOG, 15, 15); FlammableBlockRegistry.getDefaultInstance().add(STRIPPED_PALM_LOG, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(STRIPPED_PALM_WOOD, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(PALM_PLANKS, 5, 20); diff --git a/src/main/java/com/minelittlepony/unicopia/block/UWoodTypes.java b/src/main/java/com/minelittlepony/unicopia/block/UWoodTypes.java index 0a44586e..5f76ed97 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UWoodTypes.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UWoodTypes.java @@ -15,6 +15,7 @@ import net.minecraft.util.Identifier; public interface UWoodTypes { WoodType PALM = register("palm"); + WoodType GOLDEN_OAK = register("golden_oak"); RegistryKey PALM_BOAT_TYPE = TerraformBoatTypeRegistry.createKey(Unicopia.id("palm")); BlockSetType CLOUD = new BlockSetTypeBuilder() diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index 40f9eccd..a5ede2a8 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -107,6 +107,7 @@ public interface UItems { Item GREEN_APPLE_SEEDS = register("green_apple_seeds", new AliasedBlockItem(UBlocks.GREEN_APPLE_SPROUT, new Item.Settings()), ItemGroups.NATURAL); Item SWEET_APPLE_SEEDS = register("sweet_apple_seeds", new AliasedBlockItem(UBlocks.SWEET_APPLE_SPROUT, new Item.Settings()), ItemGroups.NATURAL); Item SOUR_APPLE_SEEDS = register("sour_apple_seeds", new AliasedBlockItem(UBlocks.SOUR_APPLE_SPROUT, new Item.Settings()), ItemGroups.NATURAL); + Item GOLDEN_OAK_SEEDS = register("golden_oak_seeds", new AliasedBlockItem(UBlocks.GOLDEN_OAK_SPROUT, new Item.Settings()), ItemGroups.NATURAL); Item MUG = register("mug", new Item(new Settings().maxCount(16)), ItemGroups.TOOLS); Item CIDER = register("cider", new DrinkableItem(new Item.Settings().food(UFoodComponents.CIDER).maxCount(1).recipeRemainder(MUG)), ItemGroups.FOOD_AND_DRINK); 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 bb55a235..8331e694 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java @@ -46,6 +46,16 @@ public interface UTreeGen { Tree GREEN_APPLE_TREE = createAppleTree("green_apple", UBlocks.GREEN_APPLE_LEAVES, 2); Tree SWEET_APPLE_TREE = createAppleTree("sweet_apple", UBlocks.SWEET_APPLE_LEAVES, 3); Tree SOUR_APPLE_TREE = createAppleTree("sour_apple", UBlocks.SOUR_APPLE_LEAVES, 5); + Tree GOLDEN_APPLE_TREE = Tree.Builder.create(Unicopia.id("golden_oak_tree"), + new StraightTrunkPlacer(6, 7, 3), + new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(0), 3) + ) + .configure(TreeFeatureConfig.Builder::forceDirt) + .farmingCondition(1, 3, 5) + .log(UBlocks.GOLDEN_OAK_LOG) + .leaves(UBlocks.GOLDEN_OAK_LEAVES) + .sapling(Unicopia.id("golden_oak_sapling")) + .build(); Tree BANANA_TREE = Tree.Builder.create(Unicopia.id("banana_tree"), new StraightTrunkPlacer(4, 5, 3), new FernFoliagePlacer(ConstantIntProvider.create(4), ConstantIntProvider.create(0)) @@ -84,6 +94,8 @@ public interface UTreeGen { new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(0), 3) ) .configure(TreeFeatureConfig.Builder::forceDirt) + .biomes(selector -> selector.hasTag(BiomeTags.IS_FOREST)) + .count(2, 0.01F, 1) .farmingCondition(1, preferredDensity - 2, preferredDensity) .log(Blocks.OAK_LOG) .leaves(leaves) diff --git a/src/main/resources/assets/unicopia/blockstates/golden_apple.json b/src/main/resources/assets/unicopia/blockstates/golden_apple.json new file mode 100644 index 00000000..e0c679aa --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/golden_apple.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/golden_apple" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/golden_oak_leaves.json b/src/main/resources/assets/unicopia/blockstates/golden_oak_leaves.json new file mode 100644 index 00000000..b8084dfb --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/golden_oak_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/golden_oak_leaves" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/golden_oak_log.json b/src/main/resources/assets/unicopia/blockstates/golden_oak_log.json new file mode 100644 index 00000000..4f50529f --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/golden_oak_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "unicopia:block/golden_oak_log_horizontal", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "unicopia:block/golden_oak_log" + }, + "axis=z": { + "model": "unicopia:block/golden_oak_log_horizontal", + "x": 90 + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/golden_oak_sapling.json b/src/main/resources/assets/unicopia/blockstates/golden_oak_sapling.json new file mode 100644 index 00000000..7288f548 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/golden_oak_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/golden_oak_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/golden_oak_sprout.json b/src/main/resources/assets/unicopia/blockstates/golden_oak_sprout.json new file mode 100644 index 00000000..f88ff7ea --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/golden_oak_sprout.json @@ -0,0 +1,28 @@ +{ + "variants": { + "age=0": { + "model": "unicopia:block/apple_sprout_stage0" + }, + "age=1": { + "model": "unicopia:block/apple_sprout_stage1" + }, + "age=2": { + "model": "unicopia:block/apple_sprout_stage2" + }, + "age=3": { + "model": "unicopia:block/apple_sprout_stage3" + }, + "age=4": { + "model": "unicopia:block/apple_sprout_stage4" + }, + "age=5": { + "model": "unicopia:block/apple_sprout_stage5" + }, + "age=6": { + "model": "unicopia:block/apple_sprout_stage6" + }, + "age=7": { + "model": "unicopia:block/apple_sprout_stage7" + } + } +} \ 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 97196487..d516f4d9 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -123,6 +123,7 @@ "item.unicopia.green_apple_seeds": "Granny Smith Apple Seeds", "item.unicopia.sweet_apple_seeds": "Sweet Apple Seeds", "item.unicopia.sour_apple_seeds": "Sour Apple Seeds", + "item.unicopia.golden_oak_seeds": "Golden Oak Seeds", "item.unicopia.apple_pie_hoof": "Apple Pie with a Hoofprint", "item.unicopia.apple_pie_slice": "Slice Of Apple Pie", "item.unicopia.candied_apple": "Candied Apple", @@ -248,6 +249,10 @@ "block.unicopia.weather_vane": "Weather Vane", "block.unicopia.curing_joke": "Curing Joke", "block.unicopia.gold_root": "Gold Root", + "block.unicopia.golden_oak_sprout": "Golden Oak Sprout", + "block.unicopia.golden_oak_sapling": "Golden Oak Sapling", + "block.unicopia.golden_oak_leaves": "Golden Oak Leaves", + "block.unicopia.golden_oak_log": "Golden Oak Log", "block.unicopia.mango": "Mango", "block.unicopia.mango_leaves": "Mango Leaves", "block.unicopia.mango_sapling": "Mango Sapling", diff --git a/src/main/resources/assets/unicopia/models/block/golden_apple.json b/src/main/resources/assets/unicopia/models/block/golden_apple.json new file mode 100644 index 00000000..a2a567a9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/golden_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:block/fruit", + "textures": { + "cross": "minecraft:item/golden_apple" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/golden_oak_leaves.json b/src/main/resources/assets/unicopia/models/block/golden_oak_leaves.json new file mode 100644 index 00000000..0c8f2bd9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/golden_oak_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/leaves", + "textures": { + "all": "unicopia:block/golden_oak_leaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/golden_oak_log.json b/src/main/resources/assets/unicopia/models/block/golden_oak_log.json new file mode 100644 index 00000000..d4909cb0 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/golden_oak_log.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "unicopia:block/golden_oak_log_top", + "side": "unicopia:block/golden_oak_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/golden_oak_log_horizontal.json b/src/main/resources/assets/unicopia/models/block/golden_oak_log_horizontal.json new file mode 100644 index 00000000..8dc80c7b --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/golden_oak_log_horizontal.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column_horizontal", + "textures": { + "end": "unicopia:block/golden_oak_log_top", + "side": "unicopia:block/golden_oak_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/golden_oak_sapling.json b/src/main/resources/assets/unicopia/models/block/golden_oak_sapling.json new file mode 100644 index 00000000..c4c2ba33 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/golden_oak_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "unicopia:item/golden_oak_sapling" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/golden_oak_leaves.json b/src/main/resources/assets/unicopia/models/item/golden_oak_leaves.json new file mode 100644 index 00000000..14afba2f --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/golden_oak_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/golden_oak_leaves" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/golden_oak_log.json b/src/main/resources/assets/unicopia/models/item/golden_oak_log.json new file mode 100644 index 00000000..699482c5 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/golden_oak_log.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/golden_oak_log" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/golden_oak_sapling.json b/src/main/resources/assets/unicopia/models/item/golden_oak_sapling.json new file mode 100644 index 00000000..cc4be552 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/golden_oak_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/golden_oak_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/golden_oak_seeds.json b/src/main/resources/assets/unicopia/models/item/golden_oak_seeds.json new file mode 100644 index 00000000..16cb1fc6 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/golden_oak_seeds.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/golden_oak_seeds" + } +} diff --git a/src/main/resources/assets/unicopia/textures/block/golden_oak_leaves.png b/src/main/resources/assets/unicopia/textures/block/golden_oak_leaves.png new file mode 100644 index 00000000..2242b168 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/golden_oak_leaves.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/golden_oak_log.png b/src/main/resources/assets/unicopia/textures/block/golden_oak_log.png new file mode 100644 index 00000000..414dd04c Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/golden_oak_log.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/golden_oak_log_top.png b/src/main/resources/assets/unicopia/textures/block/golden_oak_log_top.png new file mode 100644 index 00000000..be183711 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/golden_oak_log_top.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/golden_oak_sapling.png b/src/main/resources/assets/unicopia/textures/item/golden_oak_sapling.png new file mode 100644 index 00000000..2facd03b Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/golden_oak_sapling.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/golden_oak_seeds.png b/src/main/resources/assets/unicopia/textures/item/golden_oak_seeds.png new file mode 100644 index 00000000..27526d07 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/golden_oak_seeds.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/dragon_immune.json b/src/main/resources/data/minecraft/tags/blocks/dragon_immune.json index 2daf1e1f..955d6bc1 100644 --- a/src/main/resources/data/minecraft/tags/blocks/dragon_immune.json +++ b/src/main/resources/data/minecraft/tags/blocks/dragon_immune.json @@ -1,6 +1,8 @@ { "replace": false, "values": [ - "unicopia:frosted_obsidian" + "unicopia:frosted_obsidian", + "unicopia:golden_oak_leaves", + "unicopia:golden_oak_log" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/leaves.json b/src/main/resources/data/minecraft/tags/blocks/leaves.json index 8221c009..ced25022 100644 --- a/src/main/resources/data/minecraft/tags/blocks/leaves.json +++ b/src/main/resources/data/minecraft/tags/blocks/leaves.json @@ -7,6 +7,7 @@ "unicopia:green_apple_leaves", "unicopia:sweet_apple_leaves", "unicopia:sour_apple_leaves", + "unicopia:golden_oak_leaves", "unicopia:mango_leaves" ] } diff --git a/src/main/resources/data/minecraft/tags/blocks/logs.json b/src/main/resources/data/minecraft/tags/blocks/logs.json index 4e7dd5d0..f3a91e42 100644 --- a/src/main/resources/data/minecraft/tags/blocks/logs.json +++ b/src/main/resources/data/minecraft/tags/blocks/logs.json @@ -3,6 +3,7 @@ "values": [ "unicopia:palm_log", "unicopia:palm_wood", + "unicopia:golden_oak_log", "unicopia:stripped_palm_log", "unicopia:stripped_palm_wood", "unicopia:zap_log", diff --git a/src/main/resources/data/minecraft/tags/blocks/logs_that_burn.json b/src/main/resources/data/minecraft/tags/blocks/logs_that_burn.json index 38397972..31e49b86 100644 --- a/src/main/resources/data/minecraft/tags/blocks/logs_that_burn.json +++ b/src/main/resources/data/minecraft/tags/blocks/logs_that_burn.json @@ -3,6 +3,7 @@ "values": [ "unicopia:palm_log", "unicopia:palm_wood", + "unicopia:golden_oak_log", "unicopia:stripped_palm_log", "unicopia:stripped_palm_wood" ] diff --git a/src/main/resources/data/minecraft/tags/blocks/maintains_farmland.json b/src/main/resources/data/minecraft/tags/blocks/maintains_farmland.json index 0e142e00..2d5d0b68 100644 --- a/src/main/resources/data/minecraft/tags/blocks/maintains_farmland.json +++ b/src/main/resources/data/minecraft/tags/blocks/maintains_farmland.json @@ -8,6 +8,7 @@ "unicopia:green_apple_sprout", "unicopia:sweet_apple_sprout", "unicopia:sour_apple_sprout", + "unicopia:golden_oak_sprout", "unicopia:gold_root" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json index 8221c009..ced25022 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json @@ -7,6 +7,7 @@ "unicopia:green_apple_leaves", "unicopia:sweet_apple_leaves", "unicopia:sour_apple_leaves", + "unicopia:golden_oak_leaves", "unicopia:mango_leaves" ] } diff --git a/src/main/resources/data/minecraft/tags/blocks/piglin_loved.json b/src/main/resources/data/minecraft/tags/blocks/piglin_loved.json new file mode 100644 index 00000000..22641dfc --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/piglin_loved.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "unicopia:golden_oak_leaves", + "unicopia:golden_oak_log", + "unicopia:golden_oak_sapling" + ] +} diff --git a/src/main/resources/data/minecraft/tags/items/piglin_loved.json b/src/main/resources/data/minecraft/tags/items/piglin_loved.json new file mode 100644 index 00000000..e34a469d --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/piglin_loved.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "unicopia:golden_oak_seeds", + "unicopia:golden_oak_leaves", + "unicopia:golden_oak_log", + "unicopia:golden_oak_sapling" + ] +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json b/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json new file mode 100644 index 00000000..7bd87a25 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/golden_apple.json @@ -0,0 +1,49 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:golden_apple" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + }, + { + "block": "unicopia:golden_apple", + "condition": "minecraft:block_state_property", + "properties": { + "enchanted": "false" + } + } + ] + }, + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:enchanted_golden_apple" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + }, + { + "block": "unicopia:golden_apple", + "condition": "minecraft:block_state_property", + "properties": { + "enchanted": "true" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_leaves.json b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_leaves.json new file mode 100644 index 00000000..62c30a92 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_leaves.json @@ -0,0 +1,116 @@ +{ + "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:golden_oak_leaves" + } + ] + } + ], + "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:blaze_rod" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_log.json b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_log.json new file mode 100644 index 00000000..63a2ecb4 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_log.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:golden_oak_log" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_sapling.json new file mode 100644 index 00000000..d97e4dfe --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/golden_oak_sapling.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:golden_oak_sapling" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/gold_nugget.json b/src/main/resources/data/unicopia/recipes/gold_nugget.json new file mode 100644 index 00000000..5b393a11 --- /dev/null +++ b/src/main/resources/data/unicopia/recipes/gold_nugget.json @@ -0,0 +1,9 @@ +{ + "type": "smelting", + "ingredient": { + "item": "unicopia:golden_oak_seeds" + }, + "result": "minecraft:gold_nugget", + "experience": 0.2, + "cookingtime": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/tags/items/loot_bug_high_value_drops.json b/src/main/resources/data/unicopia/tags/items/loot_bug_high_value_drops.json index 38c39b74..c0417584 100644 --- a/src/main/resources/data/unicopia/tags/items/loot_bug_high_value_drops.json +++ b/src/main/resources/data/unicopia/tags/items/loot_bug_high_value_drops.json @@ -23,6 +23,7 @@ "unicopia:golden_polearm", "unicopia:golden_feather", "unicopia:golden_wing", + "unicopia:golden_oak_seeds", { "id": "farmersdelight:golden_knife", "required": false } ] }