diff --git a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java index c1dee993..7cf6d718 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java +++ b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java @@ -26,6 +26,7 @@ public interface EquinePredicates { Predicate PLAYER_CHANGELING = IS_PLAYER.and(ofRace(Race.CHANGELING)); Predicate PLAYER_PEGASUS = IS_PLAYER.and(e -> ((PlayerEntity)e).getAbilities().creativeMode || RACE_INTERACT_WITH_CLOUDS.test(e)); + Predicate PLAYER_CAN_USE_EARTH = IS_PLAYER.and(raceMatches(Race::canUseEarth)); Predicate IS_CASTER = e -> !e.isRemoved() && (e instanceof Caster || PLAYER_UNICORN.test(e)); Predicate HAS_WANT_IT_NEED_IT = e -> EnchantmentHelper.getEquipmentLevel(UEnchantments.WANT_IT_NEED_IT, e) > 0; diff --git a/src/main/java/com/minelittlepony/unicopia/Unicopia.java b/src/main/java/com/minelittlepony/unicopia/Unicopia.java index 2c4665f0..1fd31966 100644 --- a/src/main/java/com/minelittlepony/unicopia/Unicopia.java +++ b/src/main/java/com/minelittlepony/unicopia/Unicopia.java @@ -12,6 +12,7 @@ import org.apache.logging.log4j.Logger; import com.minelittlepony.unicopia.ability.data.tree.TreeTypeLoader; import com.minelittlepony.unicopia.advancement.UCriteria; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.command.Commands; import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.entity.effect.UPotions; @@ -54,6 +55,7 @@ public class Unicopia implements ModInitializer { ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(TreeTypeLoader.INSTANCE); ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(UEnchantments.POISONED_JOKE); + UBlocks.bootstrap(); UItems.bootstrap(); UPotions.bootstrap(); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java index c380aff8..6bc67621 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java @@ -6,6 +6,7 @@ import com.minelittlepony.unicopia.BlockDestructionManager; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.particle.ParticleUtils; import com.minelittlepony.unicopia.particle.UParticles; @@ -14,11 +15,14 @@ import com.minelittlepony.unicopia.util.PosHelper; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.Material; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; @@ -163,6 +167,15 @@ public class EarthPonyStompAbility implements Ability { if (destr.damageBlock(pos, damage) >= BlockDestructionManager.MAX_DAMAGE) { w.breakBlock(pos, true); + + if (w instanceof ServerWorld) { + if (state.getMaterial() == Material.STONE && w.getRandom().nextInt(4) == 0) { + ItemStack stack = UItems.PEBBLES.getDefaultStack(); + stack.setCount(1 + w.getRandom().nextInt(2)); + Block.dropStack(w, pos, stack); + state.onStacksDropped((ServerWorld)w, pos, stack); + } + } } else { w.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); } diff --git a/src/main/java/com/minelittlepony/unicopia/block/RockCropBlock.java b/src/main/java/com/minelittlepony/unicopia/block/RockCropBlock.java new file mode 100644 index 00000000..048815a9 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/RockCropBlock.java @@ -0,0 +1,100 @@ +package com.minelittlepony.unicopia.block; + +import java.util.Random; + +import com.minelittlepony.unicopia.EquinePredicates; +import com.minelittlepony.unicopia.item.UItems; + +import net.minecraft.block.BlockState; +import net.minecraft.block.CropBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.item.ItemConvertible; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; + +public class RockCropBlock extends CropBlock { + private static final VoxelShape[] AGE_TO_SHAPE = new VoxelShape[] { + VoxelShapes.union( + createCuboidShape(7, -1, 11, 8, 0, 12), + createCuboidShape(3.5F, -1, 3.5F, 5, 0, 5), + createCuboidShape(11.5F, -1, 5.5F, 13, 0, 7) + ), + VoxelShapes.union( + createCuboidShape(6, -1, 10, 9, 1, 13), + createCuboidShape(2.5F, -1, 2.5F, 6.5F, 2, 6.5F), + createCuboidShape(10.5F, -1, 4.5F, 14.5F, 2, 8.5F) + ), + VoxelShapes.union( + createCuboidShape(4, -1, 9, 10, 2, 14), + createCuboidShape(1.5F, -1, 1.5F, 7.5F, 3, 7.5F), + createCuboidShape(9, -1, 3.5F, 15.5F, 3, 9.5F) + ), + VoxelShapes.union( + createCuboidShape(4, -1, 9, 10, 2, 14), + createCuboidShape(1.5F, -1, 1.5F, 7.5F, 4, 7.5F), + createCuboidShape(9, -1, 3.5F, 15.5F, 3, 9.5F) + ), + VoxelShapes.union( + createCuboidShape(3, -1, 8, 11, 3, 15), + createCuboidShape(0.5F, -1, 0.5F, 8.5F, 5, 8.5F), + createCuboidShape(7.5F, -1, 2, 17, 5, 10.5F) + ), + VoxelShapes.union( + createCuboidShape(3, -1, 8, 11, 4, 15), + createCuboidShape(0.5F, -1, 0.5F, 8.5F, 5, 8.5F), + createCuboidShape(7.5F, -1, 2, 17, 7, 10.5F) + ), + VoxelShapes.union( + createCuboidShape(3, -1, 8, 11, 4, 15), + createCuboidShape(0.5F, -1, 0.5F, 8.5F, 7, 8.5F), + createCuboidShape(7.5F, -1, 2, 17, 9, 10.5F) + ), + VoxelShapes.union( + createCuboidShape(3, -1, 8, 11, 4, 15), + createCuboidShape(0.5F, -1, 0.5F, 8.5F, 9, 8.5F), + createCuboidShape(7.5F, -1, 2, 17, 13, 10.5F) + ) + }; + + protected RockCropBlock(Settings settings) { + super(settings); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return AGE_TO_SHAPE[state.get(getAgeProperty())]; + } + + @Override + public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if (canGrow(world, random, pos, state)) { + super.randomTick(state, world, pos, random); + } + } + + @Override + @Deprecated + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + super.onStateReplaced(state, world, pos, newState, moved); + if (!moved && !(state.getBlock() == this && newState.getBlock() == this)) { + if (!world.isClient) { + world.syncWorldEvent(WorldEvents.BONE_MEAL_USED, pos, 0); + } + } + } + + @Override + public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { + return world.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ(), 20, EquinePredicates.PLAYER_CAN_USE_EARTH) != null; + } + + @Override + protected ItemConvertible getSeedsItem() { + return UItems.PEBBLES; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java new file mode 100644 index 00000000..3b356266 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -0,0 +1,24 @@ +package com.minelittlepony.unicopia.block; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricMaterialBuilder; +import net.minecraft.block.Block; +import net.minecraft.block.MapColor; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; + +public interface UBlocks { + Block ROCKS = register("rocks", new RockCropBlock(FabricBlockSettings.of( + new FabricMaterialBuilder(MapColor.STONE_GRAY).allowsMovement().lightPassesThrough().notSolid().destroyedByPiston().build() + ) + .ticksRandomly() + .strength(2) + .sounds(BlockSoundGroup.STONE))); + + private static T register(String name, T item) { + return Registry.register(Registry.BLOCK, new Identifier("unicopia", name), item); + } + + static void bootstrap() {} +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/RacePredicatedAliasedBlockItem.java b/src/main/java/com/minelittlepony/unicopia/item/RacePredicatedAliasedBlockItem.java new file mode 100644 index 00000000..e4bf9179 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/RacePredicatedAliasedBlockItem.java @@ -0,0 +1,31 @@ +package com.minelittlepony.unicopia.item; + +import java.util.function.Predicate; + +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.entity.player.Pony; + +import net.minecraft.block.Block; +import net.minecraft.item.AliasedBlockItem; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.util.ActionResult; + +public class RacePredicatedAliasedBlockItem extends AliasedBlockItem { + + private Predicate predicate; + + public RacePredicatedAliasedBlockItem(Block block, Settings settings, Predicate predicate) { + super(block, settings); + this.predicate = predicate; + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + Pony pony = Pony.of(context.getPlayer()); + if (pony == null || !predicate.test(pony.getSpecies())) { + return ActionResult.FAIL; + } + + return super.useOnBlock(context); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index a29d36c6..ba81296c 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -3,7 +3,9 @@ package com.minelittlepony.unicopia.item; import java.util.ArrayList; import java.util.List; +import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.item.toxin.UFoodComponents; @@ -66,6 +68,10 @@ public interface UItems { Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(16).food(UFoodComponents.HAY_FRIES))); Item WHEAT_WORMS = register("wheat_worms", new Item(new Item.Settings().group(ItemGroup.MISC).maxCount(16).food(UFoodComponents.INSECTS))); + Item PEBBLES = register("pebbles", new RacePredicatedAliasedBlockItem(UBlocks.ROCKS, new Item.Settings().group(ItemGroup.MATERIALS), Race::canUseEarth)); + Item ROCK = register("rock", new Item(new Item.Settings().group(ItemGroup.MATERIALS))); + Item ROCK_STEW = register("rock_stew", new Item(new Item.Settings().group(ItemGroup.FOOD))); + Item MUG = register("mug", new Item(new Settings().group(ItemGroup.MATERIALS).maxCount(16))); Item CIDER = register("cider", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.CIDER).maxCount(1).recipeRemainder(MUG))); Item JUICE = register("juice", new DrinkableItem(new Item.Settings().group(ItemGroup.FOOD).recipeRemainder(Items.GLASS_BOTTLE).maxCount(1).food(UFoodComponents.JUICE))); @@ -93,7 +99,6 @@ public interface UItems { if (item instanceof BlockItem) { ((BlockItem)item).appendBlocks(Item.BLOCK_ITEMS, item); } - Items.MILK_BUCKET.appendStacks(null, null); return Registry.register(Registry.ITEM, new Identifier("unicopia", name), item); } diff --git a/src/main/resources/assets/unicopia/blockstates/rocks.json b/src/main/resources/assets/unicopia/blockstates/rocks.json new file mode 100644 index 00000000..67c465f4 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/rocks.json @@ -0,0 +1,28 @@ +{ + "variants": { + "age=0": { + "model": "unicopia:block/rocks_stage0" + }, + "age=1": { + "model": "unicopia:block/rocks_stage1" + }, + "age=2": { + "model": "unicopia:block/rocks_stage2" + }, + "age=3": { + "model": "unicopia:block/rocks_stage3" + }, + "age=4": { + "model": "unicopia:block/rocks_stage4" + }, + "age=5": { + "model": "unicopia:block/rocks_stage5" + }, + "age=6": { + "model": "unicopia:block/rocks_stage6" + }, + "age=7": { + "model": "unicopia:block/rocks_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 836124df..8c4df720 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -48,6 +48,10 @@ "item.unicopia.juice": "Juice", "item.unicopia.burned_juice": "Burned Juice", + "item.unicopia.pebbles": "Pebbles", + "item.unicopia.rock": "Rock", + "item.unicopia.rock_stew": "Rock Stew", + "item.unicopia.daffodil_daisy_sandwich": "Daffodil Daisy Sandwich", "item.unicopia.hay_burger": "Hay Burger", "item.unicopia.hay_fries": "Hay Fries", @@ -69,6 +73,8 @@ "item.unicopia.music_disc_funk": "Music Disc", "item.unicopia.music_disc_funk.desc": "funk, just funk", + "block.unicopia.rocks": "Rocks", + "entity.unicopia.butterfly": "Butterfly", "entity.unicopia.cast_spell": "Cast Spell", "entity.unicopia.cast_spell.by": "a spell cast by %s", diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage0.json b/src/main/resources/assets/unicopia/models/block/rocks_stage0.json new file mode 100644 index 00000000..c7c5a793 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage0.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [4, -1, 4], + "to": [5, 0, 5], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [11, 0, 12, 1], "texture": "#all"}, + "east": {"uv": [11, 0, 12, 1], "texture": "#all"}, + "south": {"uv": [4, 0, 5, 1], "texture": "#all"}, + "west": {"uv": [4, 0, 5, 1], "texture": "#all"}, + "up": {"uv": [4, 4, 5, 5], "texture": "#all"}, + "down": {"uv": [4, 11, 5, 12], "texture": "#all"} + } + }, + { + "from": [7, -1, 11], + "to": [8, 0, 12], + "faces": { + "north": {"uv": [8, 0, 9, 1], "texture": "#all"}, + "east": {"uv": [4, 0, 5, 1], "texture": "#all"}, + "south": {"uv": [7, 0, 8, 1], "texture": "#all"}, + "west": {"uv": [11, 0, 12, 1], "texture": "#all"}, + "up": {"uv": [7, 11, 8, 12], "texture": "#all"}, + "down": {"uv": [7, 4, 8, 5], "texture": "#all"} + } + }, + { + "from": [12, -1, 6], + "to": [13, 0, 7], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [3, 0, 4, 1], "texture": "#all"}, + "east": {"uv": [9, 0, 10, 1], "texture": "#all"}, + "south": {"uv": [12, 0, 13, 1], "texture": "#all"}, + "west": {"uv": [6, 0, 7, 1], "texture": "#all"}, + "up": {"uv": [12, 6, 13, 7], "texture": "#all"}, + "down": {"uv": [12, 9, 13, 10], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage1.json b/src/main/resources/assets/unicopia/models/block/rocks_stage1.json new file mode 100644 index 00000000..259a6297 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage1.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [3, -1, 3], + "to": [6, 2, 6], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [10, 14, 13, 16], "texture": "#all"}, + "east": {"uv": [10, 14, 13, 16], "texture": "#all"}, + "south": {"uv": [3, 14, 6, 16], "texture": "#all"}, + "west": {"uv": [3, 14, 6, 16], "texture": "#all"}, + "up": {"uv": [3, 3, 6, 6], "texture": "#all"}, + "down": {"uv": [3, 10, 6, 13], "texture": "#all"} + } + }, + { + "from": [6, -2, 10], + "to": [9, 1, 13], + "faces": { + "north": {"uv": [7, 15, 10, 16], "texture": "#all"}, + "east": {"uv": [3, 15, 6, 16], "texture": "#all"}, + "south": {"uv": [6, 15, 9, 16], "texture": "#all"}, + "west": {"uv": [10, 15, 13, 16], "texture": "#all"}, + "up": {"uv": [6, 10, 9, 13], "texture": "#all"}, + "down": {"uv": [6, 3, 9, 6], "texture": "#all"} + } + }, + { + "from": [11, -1, 5], + "to": [14, 2, 8], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [2, 14, 5, 16], "texture": "#all"}, + "east": {"uv": [8, 14, 11, 16], "texture": "#all"}, + "south": {"uv": [11, 14, 14, 16], "texture": "#all"}, + "west": {"uv": [5, 14, 8, 16], "texture": "#all"}, + "up": {"uv": [11, 5, 14, 8], "texture": "#all"}, + "down": {"uv": [11, 8, 14, 11], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage2.json b/src/main/resources/assets/unicopia/models/block/rocks_stage2.json new file mode 100644 index 00000000..ee2f6251 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage2.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [2, -1, 2], + "to": [7, 3, 7], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [9, 13, 14, 16], "texture": "#all"}, + "east": {"uv": [9, 13, 14, 16], "texture": "#all"}, + "south": {"uv": [2, 13, 7, 16], "texture": "#all"}, + "west": {"uv": [2, 13, 7, 16], "texture": "#all"}, + "up": {"uv": [2, 2, 7, 7], "texture": "#all"}, + "down": {"uv": [2, 9, 7, 14], "texture": "#all"} + } + }, + { + "from": [4, -2, 9], + "to": [10, 2, 14], + "faces": { + "north": {"uv": [6, 14, 12, 16], "texture": "#all"}, + "east": {"uv": [2, 14, 7, 16], "texture": "#all"}, + "south": {"uv": [4, 14, 10, 16], "texture": "#all"}, + "west": {"uv": [9, 14, 14, 16], "texture": "#all"}, + "up": {"uv": [4, 9, 10, 14], "texture": "#all"}, + "down": {"uv": [4, 2, 10, 7], "texture": "#all"} + } + }, + { + "from": [10, -1, 4], + "to": [15, 3, 9], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [1, 13, 6, 16], "texture": "#all"}, + "east": {"uv": [7, 13, 12, 16], "texture": "#all"}, + "south": {"uv": [10, 13, 15, 16], "texture": "#all"}, + "west": {"uv": [4, 13, 9, 16], "texture": "#all"}, + "up": {"uv": [10, 4, 15, 9], "texture": "#all"}, + "down": {"uv": [10, 7, 15, 12], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage3.json b/src/main/resources/assets/unicopia/models/block/rocks_stage3.json new file mode 100644 index 00000000..4c48c887 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage3.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [2, -1, 2], + "to": [7, 4, 7], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [9, 12, 14, 16], "texture": "#all"}, + "east": {"uv": [9, 12, 14, 16], "texture": "#all"}, + "south": {"uv": [2, 12, 7, 16], "texture": "#all"}, + "west": {"uv": [2, 12, 7, 16], "texture": "#all"}, + "up": {"uv": [2, 2, 7, 7], "texture": "#all"}, + "down": {"uv": [2, 9, 7, 14], "texture": "#all"} + } + }, + { + "from": [4, -2, 9], + "to": [10, 2, 14], + "faces": { + "north": {"uv": [6, 14, 12, 16], "texture": "#all"}, + "east": {"uv": [2, 14, 7, 16], "texture": "#all"}, + "south": {"uv": [4, 14, 10, 16], "texture": "#all"}, + "west": {"uv": [9, 14, 14, 16], "texture": "#all"}, + "up": {"uv": [4, 9, 10, 14], "texture": "#all"}, + "down": {"uv": [4, 2, 10, 7], "texture": "#all"} + } + }, + { + "from": [10, -1, 4], + "to": [15, 3, 9], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [1, 13, 6, 16], "texture": "#all"}, + "east": {"uv": [7, 13, 12, 16], "texture": "#all"}, + "south": {"uv": [10, 13, 15, 16], "texture": "#all"}, + "west": {"uv": [4, 13, 9, 16], "texture": "#all"}, + "up": {"uv": [10, 4, 15, 9], "texture": "#all"}, + "down": {"uv": [10, 7, 15, 12], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage4.json b/src/main/resources/assets/unicopia/models/block/rocks_stage4.json new file mode 100644 index 00000000..426b8a98 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage4.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [1, -1, 1], + "to": [8, 5, 8], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [8, 11, 15, 16], "texture": "#all"}, + "east": {"uv": [8, 11, 15, 16], "texture": "#all"}, + "south": {"uv": [1, 11, 8, 16], "texture": "#all"}, + "west": {"uv": [1, 11, 8, 16], "texture": "#all"}, + "up": {"uv": [1, 1, 8, 8], "texture": "#all"}, + "down": {"uv": [1, 8, 8, 15], "texture": "#all"} + } + }, + { + "from": [3, -2, 8], + "to": [11, 3, 15], + "faces": { + "north": {"uv": [5, 13, 13, 16], "texture": "#all"}, + "east": {"uv": [1, 13, 8, 16], "texture": "#all"}, + "south": {"uv": [3, 13, 11, 16], "texture": "#all"}, + "west": {"uv": [8, 13, 15, 16], "texture": "#all"}, + "up": {"uv": [3, 8, 11, 15], "texture": "#all"}, + "down": {"uv": [3, 1, 11, 8], "texture": "#all"} + } + }, + { + "from": [9, -1, 3], + "to": [16, 5, 10], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [0, 11, 7, 16], "texture": "#all"}, + "east": {"uv": [6, 11, 13, 16], "texture": "#all"}, + "south": {"uv": [9, 11, 16, 16], "texture": "#all"}, + "west": {"uv": [3, 11, 10, 16], "texture": "#all"}, + "up": {"uv": [9, 3, 16, 10], "texture": "#all"}, + "down": {"uv": [9, 6, 16, 13], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage5.json b/src/main/resources/assets/unicopia/models/block/rocks_stage5.json new file mode 100644 index 00000000..7da929d1 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage5.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [1, -1, 1], + "to": [8, 5, 8], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [8, 11, 15, 16], "texture": "#all"}, + "east": {"uv": [8, 11, 15, 16], "texture": "#all"}, + "south": {"uv": [1, 11, 8, 16], "texture": "#all"}, + "west": {"uv": [1, 11, 8, 16], "texture": "#all"}, + "up": {"uv": [1, 1, 8, 8], "texture": "#all"}, + "down": {"uv": [1, 8, 8, 15], "texture": "#all"} + } + }, + { + "from": [3, -2, 8], + "to": [11, 4, 15], + "faces": { + "north": {"uv": [5, 12, 13, 16], "texture": "#all"}, + "east": {"uv": [1, 12, 8, 16], "texture": "#all"}, + "south": {"uv": [3, 12, 11, 16], "texture": "#all"}, + "west": {"uv": [8, 12, 15, 16], "texture": "#all"}, + "up": {"uv": [3, 8, 11, 15], "texture": "#all"}, + "down": {"uv": [3, 1, 11, 8], "texture": "#all"} + } + }, + { + "from": [9, -1, 3], + "to": [16, 7, 10], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [0, 9, 7, 16], "texture": "#all"}, + "east": {"uv": [6, 9, 13, 16], "texture": "#all"}, + "south": {"uv": [9, 9, 16, 16], "texture": "#all"}, + "west": {"uv": [3, 9, 10, 16], "texture": "#all"}, + "up": {"uv": [9, 3, 16, 10], "texture": "#all"}, + "down": {"uv": [9, 6, 16, 13], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage6.json b/src/main/resources/assets/unicopia/models/block/rocks_stage6.json new file mode 100644 index 00000000..13f507a9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage6.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [1, -1, 1], + "to": [8, 7, 8], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [8, 9, 15, 16], "texture": "#all"}, + "east": {"uv": [8, 9, 15, 16], "texture": "#all"}, + "south": {"uv": [1, 9, 8, 16], "texture": "#all"}, + "west": {"uv": [1, 9, 8, 16], "texture": "#all"}, + "up": {"uv": [1, 1, 8, 8], "texture": "#all"}, + "down": {"uv": [1, 8, 8, 15], "texture": "#all"} + } + }, + { + "from": [3, -2, 8], + "to": [11, 4, 15], + "faces": { + "north": {"uv": [5, 12, 13, 16], "texture": "#all"}, + "east": {"uv": [1, 12, 8, 16], "texture": "#all"}, + "south": {"uv": [3, 12, 11, 16], "texture": "#all"}, + "west": {"uv": [8, 12, 15, 16], "texture": "#all"}, + "up": {"uv": [3, 8, 11, 15], "texture": "#all"}, + "down": {"uv": [3, 1, 11, 8], "texture": "#all"} + } + }, + { + "from": [9, -1, 3], + "to": [16, 9, 10], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [0, 7, 7, 16], "texture": "#all"}, + "east": {"uv": [6, 7, 13, 16], "texture": "#all"}, + "south": {"uv": [9, 7, 16, 16], "texture": "#all"}, + "west": {"uv": [3, 7, 10, 16], "texture": "#all"}, + "up": {"uv": [9, 3, 16, 10], "texture": "#all"}, + "down": {"uv": [9, 6, 16, 13], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/rocks_stage7.json b/src/main/resources/assets/unicopia/models/block/rocks_stage7.json new file mode 100644 index 00000000..af93b0d5 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/rocks_stage7.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "block/stone" + }, + "elements": [ + { + "from": [1, -1, 1], + "to": [8, 9, 8], + "rotation": {"angle": -22.5, "axis": "y", "origin": [5, 0, 4]}, + "faces": { + "north": {"uv": [8, 7, 15, 16], "texture": "#all"}, + "east": {"uv": [8, 7, 15, 16], "texture": "#all"}, + "south": {"uv": [1, 7, 8, 16], "texture": "#all"}, + "west": {"uv": [1, 7, 8, 16], "texture": "#all"}, + "up": {"uv": [1, 1, 8, 8], "texture": "#all"}, + "down": {"uv": [1, 8, 8, 15], "texture": "#all"} + } + }, + { + "from": [3, -2, 8], + "to": [11, 4, 15], + "faces": { + "north": {"uv": [5, 12, 13, 16], "texture": "#all"}, + "east": {"uv": [1, 12, 8, 16], "texture": "#all"}, + "south": {"uv": [3, 12, 11, 16], "texture": "#all"}, + "west": {"uv": [8, 12, 15, 16], "texture": "#all"}, + "up": {"uv": [3, 8, 11, 15], "texture": "#all"}, + "down": {"uv": [3, 1, 11, 8], "texture": "#all"} + } + }, + { + "from": [9, -1, 3], + "to": [16, 13, 10], + "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, + "faces": { + "north": {"uv": [0, 3, 7, 16], "texture": "#all"}, + "east": {"uv": [6, 3, 13, 16], "texture": "#all"}, + "south": {"uv": [9, 3, 16, 16], "texture": "#all"}, + "west": {"uv": [3, 3, 10, 16], "texture": "#all"}, + "up": {"uv": [9, 3, 16, 10], "texture": "#all"}, + "down": {"uv": [9, 6, 16, 13], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/pebbles.json b/src/main/resources/assets/unicopia/models/item/pebbles.json new file mode 100644 index 00000000..b97fe49f --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/pebbles.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/pebbles" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/rock.json b/src/main/resources/assets/unicopia/models/item/rock.json new file mode 100644 index 00000000..f959182a --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/rock.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/rock" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/rock_stew.json b/src/main/resources/assets/unicopia/models/item/rock_stew.json new file mode 100644 index 00000000..632b6863 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/rock_stew.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/rock_stew" + } +} diff --git a/src/main/resources/assets/unicopia/textures/item/pebbles.png b/src/main/resources/assets/unicopia/textures/item/pebbles.png new file mode 100644 index 00000000..1a3b1428 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/pebbles.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rock.png b/src/main/resources/assets/unicopia/textures/item/rock.png new file mode 100644 index 00000000..849700d0 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rock.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/rock_stew.png b/src/main/resources/assets/unicopia/textures/item/rock_stew.png new file mode 100644 index 00000000..a89cbb41 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/rock_stew.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/crops.json b/src/main/resources/data/minecraft/tags/blocks/crops.json new file mode 100644 index 00000000..6257b7b3 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/crops.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "unicopia:rocks" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json b/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json index f2a599f3..6be80c2c 100644 --- a/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json +++ b/src/main/resources/data/unicopia/advancements/unicopia/sweet_apple_acres.json @@ -79,7 +79,7 @@ "trigger": "minecraft:inventory_changed", "conditions": { "items": [ - { "items": [ "unicopia:golden_apple" ] } + { "items": [ "minecraft:golden_apple" ] } ] } } diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json b/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json new file mode 100644 index 00000000..20a72cac --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/rocks.json @@ -0,0 +1,68 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "unicopia:rocks", + "properties": { + "age": "7" + } + } + ], + "name": "unicopia:rock" + }, + { + "type": "minecraft:item", + "name": "unicopia:pebbles" + } + ] + } + ] + }, + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:binomial_with_bonus_count", + "parameters": { + "extra": 3, + "probability": 0.5714286 + } + } + ], + "name": "unicopia:pebbles" + } + ], + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "unicopia:rocks", + "properties": { + "age": "7" + } + } + ] + } + ], + "functions": [ + { + "function": "minecraft:explosion_decay" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/rock_stew.json b/src/main/resources/data/unicopia/recipes/rock_stew.json new file mode 100644 index 00000000..907b249b --- /dev/null +++ b/src/main/resources/data/unicopia/recipes/rock_stew.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { "item": "unicopia:rock" }, + { "item": "unicopia:rock" }, + { "item": "unicopia:rock" }, + { "item": "minecraft:bowl" } + ], + "result": { "item": "unicopia:rock_stew" } +}