diff --git a/oats_guide.png b/oats_guide.png new file mode 100644 index 00000000..45305cbc Binary files /dev/null and b/oats_guide.png differ diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java index 47aeffce..45794fd4 100644 --- a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java +++ b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java @@ -17,6 +17,8 @@ public interface UCriteria { CustomEventCriterion.Trigger SCREECH_TWENTY_MOBS = CUSTOM_EVENT.createTrigger("screech_twenty_mobs"); CustomEventCriterion.Trigger SHED_FEATHER = CUSTOM_EVENT.createTrigger("shed_feather"); CustomEventCriterion.Trigger THROW_MUFFIN = CUSTOM_EVENT.createTrigger("throw_muffin"); + CustomEventCriterion.Trigger SEND_OATS = CUSTOM_EVENT.createTrigger("send_oats"); + CustomEventCriterion.Trigger RECEIVE_OATS = CUSTOM_EVENT.createTrigger("receive_oats"); private static > T register(T obj) { return MixinCriteria.register(obj); diff --git a/src/main/java/com/minelittlepony/unicopia/block/SegmentedBlock.java b/src/main/java/com/minelittlepony/unicopia/block/SegmentedBlock.java new file mode 100644 index 00000000..441e9882 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/SegmentedBlock.java @@ -0,0 +1,63 @@ +package com.minelittlepony.unicopia.block; + +import java.util.Arrays; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; + +public interface SegmentedBlock { + double[] STAGE_SIZES = new double[] {3.2, 6.4, 9.6, 12.8, 16}; + VoxelShape[] STAGE_SHAPES = Arrays.stream(STAGE_SIZES).mapToObj(height -> { + return Block.createCuboidShape(0, 0, 0, 16, height, 16); + }).toArray(VoxelShape[]::new); + + static VoxelShape getShape(int age) { + if (age < 0 || age >= STAGE_SHAPES.length) { + return VoxelShapes.fullCube(); + } + return STAGE_SHAPES[age]; + } + + static double getHeight(int age) { + if (age < 0 || age >= STAGE_SHAPES.length) { + return 16; + } + return STAGE_SIZES[age]; + } + + static VoxelShape[] computeShapes(int maxHeight) { + VoxelShape[] shapes = new VoxelShape[STAGE_SIZES.length * maxHeight]; + + for (int i = 0; i < maxHeight; i++) { + for (int j = 0; j < STAGE_SIZES.length; j++) { + shapes[j + (i * STAGE_SIZES.length)] = Block.createCuboidShape(0, 0, 0, 16, STAGE_SIZES[j] + (i * 16), 16); + } + } + + return shapes; + } + + boolean isBase(BlockState state); + + boolean isNext(BlockState state); + + default BlockPos getTip(BlockView world, BlockPos startingPos) { + while (isNext(world.getBlockState(startingPos.up())) && !world.isOutOfHeightLimit(startingPos)) { + startingPos = startingPos.up(); + } + + return startingPos; + } + + default BlockPos getRoot(BlockView world, BlockPos startingPos) { + while (isBase(world.getBlockState(startingPos.down())) && !world.isOutOfHeightLimit(startingPos)) { + startingPos = startingPos.down(); + } + + return startingPos; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java b/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java new file mode 100644 index 00000000..a71ba5bb --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/SegmentedCropBlock.java @@ -0,0 +1,170 @@ +package com.minelittlepony.unicopia.block; + +import java.util.function.Supplier; + +import org.jetbrains.annotations.Nullable; + +import net.minecraft.block.*; +import net.minecraft.item.ItemConvertible; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.IntProperty; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.random.Random; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.*; + +public class SegmentedCropBlock extends CropBlock implements SegmentedBlock { + + private final ItemConvertible seeds; + + @Nullable + private final Supplier prevSegmentSupplier; + @Nullable + private Supplier nextSegmentSupplier; + + private final int progressionAge; + + public static SegmentedCropBlock create(final int maxAge, int progressionAge, Block.Settings settings, + ItemConvertible seeds, + @Nullable Supplier prevSegmentSupplier, + @Nullable Supplier nextSegmentSupplier) { + + final IntProperty age = IntProperty.of("age", 0, maxAge); + return new SegmentedCropBlock(progressionAge, settings, seeds, prevSegmentSupplier, nextSegmentSupplier) { + @Override + public IntProperty getAgeProperty() { + return age; + } + + @Override + public int getMaxAge() { + return maxAge; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(age); + } + }; + } + + protected SegmentedCropBlock(int progressionAge, Block.Settings settings, + ItemConvertible seeds, + @Nullable Supplier prevSegmentSupplier, + @Nullable Supplier nextSegmentSupplier) { + super(settings); + this.seeds = seeds; + this.prevSegmentSupplier = prevSegmentSupplier; + this.nextSegmentSupplier = nextSegmentSupplier; + this.progressionAge = progressionAge; + } + + public SegmentedCropBlock createNext(int progressionAge) { + SegmentedCropBlock next = create(getMaxAge() - this.progressionAge, progressionAge, Settings.copy(this), seeds, () -> this, null); + nextSegmentSupplier = () -> next; + return next; + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + BlockPos tip = getTip(world, pos); + BlockPos root = getRoot(world, pos); + + int height = (tip.getY() - root.getY()); + + BlockState tipState = world.getBlockState(tip); + double tipHeight = SegmentedBlock.getHeight(((SegmentedCropBlock)tipState.getBlock()).getAge(tipState)); + + double offset = (root.getY() - pos.getY()) * 16; + + return Block.createCuboidShape(0, offset, 0, 16, height * 16 + tipHeight + offset, 16); + } + + @Override + public ItemConvertible getSeedsItem() { + return seeds; + } + + @Override + protected boolean canPlantOnTop(BlockState state, BlockView view, BlockPos pos) { + return (state.getBlock() instanceof SegmentedCropBlock o && o.canSupportBlock(this, state, view, pos)) || super.canPlantOnTop(state, view, pos); + } + + protected boolean canSupportBlock(Block other, BlockState state, BlockView view, BlockPos pos) { + return (nextSegmentSupplier != null && nextSegmentSupplier.get() == other); + } + + @Override + public void applyGrowth(World world, BlockPos pos, BlockState state) { + super.applyGrowth(world, pos, state); + propagateGrowth(world, pos, state); + } + + @Override + public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + super.randomTick(state, world, pos, random); + propagateGrowth(world, pos, state); + } + + private void propagateGrowth(World world, BlockPos pos, BlockState state) { + int oldAge = getAge(state); + state = world.getBlockState(pos); + int ageChange = getAge(state) - oldAge; + + if (ageChange <= 0) { + return; + } + + onGrown(world, pos, state, ageChange); + + BlockPos root = getRoot(world, pos); + BlockPos tip = getTip(world, pos); + for (BlockPos p : BlockPos.iterate(root, tip)) { + if (p.getY() == pos.getY()) { + continue; + } + + BlockState s = world.getBlockState(p); + if (s.getBlock() instanceof SegmentedCropBlock segment) { + int segAge = Math.min(segment.getAge(s) + ageChange, segment.getMaxAge()); + world.setBlockState(p, s.with(segment.getAgeProperty(), segAge)); + segment.onGrown(world, p, s, ageChange); + } + } + } + + private void onGrown(World world, BlockPos pos, BlockState state, int ageChange) { + if (nextSegmentSupplier != null && getAge(state) >= progressionAge && world.isAir(pos.up())) { + SegmentedCropBlock nxt = nextSegmentSupplier.get(); + + world.setBlockState(pos.up(), nxt.withAge(Math.min(ageChange, nxt.getMaxAge())), Block.NOTIFY_LISTENERS); + } + } + + @Override + public boolean hasRandomTicks(BlockState state) { + return super.hasRandomTicks(state) || nextSegmentSupplier != null; + } + + @Override + public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) { + return super.isFertilizable(world, pos, state, isClient) || (nextSegmentSupplier != null && isNext(world.getBlockState(pos.up()))); + } + + @Override + protected int getGrowthAmount(World world) { + return super.getGrowthAmount(world) / 2; + } + + @Override + public boolean isBase(BlockState state) { + return state.getBlock() == this || (prevSegmentSupplier != null && prevSegmentSupplier.get().isBase(state)); + } + + @Override + public boolean isNext(BlockState state) { + return state.getBlock() == this || (nextSegmentSupplier != null && nextSegmentSupplier.get().isNext(state)); + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index b67faef5..de44e001 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -66,6 +66,10 @@ public interface UBlocks { Block SOUR_APPLE = register("sour_apple", new FruitBlock(FabricBlockSettings.of(Material.GOURD, MapColor.GREEN).sounds(BlockSoundGroup.WOOD), 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())); + SegmentedCropBlock OATS = register("oats", SegmentedCropBlock.create(11, 5, AbstractBlock.Settings.copy(Blocks.WHEAT), () -> UItems.OAT_SEEDS, null, () -> UBlocks.OATS_STEM)); + SegmentedCropBlock OATS_STEM = register("oats_stem", OATS.createNext(5)); + SegmentedCropBlock OATS_CROWN = register("oats_crown", OATS_STEM.createNext(5)); + static T register(String name, T item) { return register(Unicopia.id(name), item); } @@ -83,7 +87,7 @@ public interface UBlocks { if (block instanceof TintedBlock) { TintedBlock.REGISTRY.add(block); } - if (block instanceof SaplingBlock || block instanceof SproutBlock || block instanceof FruitBlock) { + if (block instanceof SaplingBlock || block instanceof SproutBlock || block instanceof FruitBlock || block instanceof CropBlock) { TRANSLUCENT_BLOCKS.add(block); } return Registry.register(Registry.BLOCK, id, block); diff --git a/src/main/java/com/minelittlepony/unicopia/block/data/DragonBreathStore.java b/src/main/java/com/minelittlepony/unicopia/block/data/DragonBreathStore.java index 9c4b9369..2e0f8e0b 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/data/DragonBreathStore.java +++ b/src/main/java/com/minelittlepony/unicopia/block/data/DragonBreathStore.java @@ -3,6 +3,8 @@ package com.minelittlepony.unicopia.block.data; import java.util.*; import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.item.UItems; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.*; import net.minecraft.util.Identifier; @@ -79,6 +81,15 @@ public class DragonBreathStore extends PersistentState { } public void put(String recipient, ItemStack payload) { + + if (payload.getItem() == UItems.OATS) { + ItemStack oats = UItems.IMPORTED_OATS.getDefaultStack(); + oats.setNbt(payload.getNbt()); + oats.setCount(payload.getCount()); + put(recipient, oats); + return; + } + synchronized (locker) { doPurge(); if (peekEntries(recipient).stream().noneMatch(i -> { diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/GlassesFeatureRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/GlassesFeatureRenderer.java index 385832ab..7b0536b8 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/GlassesFeatureRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/GlassesFeatureRenderer.java @@ -70,8 +70,6 @@ public class GlassesFeatureRenderer implements Accessory public void setAngles(LivingEntity entity, BipedEntityModel biped) { root.getChild(EntityModelPartNames.HEAD).copyTransform(biped.head); root.getChild(EntityModelPartNames.HAT).copyTransform(biped.hat); - - root.getChild(EntityModelPartNames.HAT).resetTransform(); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 880c77af..45cb9179 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -12,6 +12,7 @@ import com.minelittlepony.unicopia.ability.magic.SpellContainer; import com.minelittlepony.unicopia.ability.magic.SpellPredicate; import com.minelittlepony.unicopia.ability.magic.SpellContainer.Operation; import com.minelittlepony.unicopia.ability.magic.spell.Situation; +import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.block.data.DragonBreathStore; import com.minelittlepony.unicopia.item.GlassesItem; import com.minelittlepony.unicopia.item.UItems; @@ -143,6 +144,10 @@ public abstract class Living implements Equine, Caste item.setPosition(randomPos); item.world.spawnEntity(item); entity.world.playSoundFromEntity(null, entity, SoundEvents.ITEM_FIRECHARGE_USE, entity.getSoundCategory(), 1, 1); + + if (stack.payload().getItem() == UItems.OATS && entity instanceof PlayerEntity player) { + UCriteria.RECEIVE_OATS.trigger(player); + } }); } } diff --git a/src/main/java/com/minelittlepony/unicopia/item/DragonBreathScrollItem.java b/src/main/java/com/minelittlepony/unicopia/item/DragonBreathScrollItem.java index 064d6ef6..402111aa 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/DragonBreathScrollItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/DragonBreathScrollItem.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.item; import java.util.UUID; +import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.block.data.DragonBreathStore; import net.minecraft.entity.player.PlayerEntity; @@ -29,6 +30,9 @@ public class DragonBreathScrollItem extends Item { stack.split(1); if (!world.isClient) { + if (payload.getItem() == UItems.OATS) { + UCriteria.SEND_OATS.trigger(player); + } DragonBreathStore.get(world).put(stack.getName().getString(), payload.split(1)); } player.playSound(SoundEvents.ITEM_FIRECHARGE_USE, 1, 1); diff --git a/src/main/java/com/minelittlepony/unicopia/item/OatmealItem.java b/src/main/java/com/minelittlepony/unicopia/item/OatmealItem.java new file mode 100644 index 00000000..32ee0276 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/OatmealItem.java @@ -0,0 +1,21 @@ +package com.minelittlepony.unicopia.item; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.StewItem; +import net.minecraft.world.World; + +public class OatmealItem extends StewItem { + + public OatmealItem(Settings settings) { + super(settings); + } + + @Override + public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { + if (!world.isClient) { + user.clearStatusEffects(); + } + return super.finishUsing(stack, world, user); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index caf902a9..52c74c7e 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -9,8 +9,6 @@ import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.item.toxin.UFoodComponents; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.*; import net.minecraft.item.Item.Settings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; @@ -29,14 +27,7 @@ public interface UItems { Item SOUR_APPLE = register("sour_apple", AppleItem.registerTickCallback(new Item(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE)))); ZapAppleItem ZAP_APPLE = register("zap_apple", AppleItem.registerTickCallback(new ZapAppleItem(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.ZAP_APPLE)))); - Item ZAP_BULB = register("zap_bulb", new Item(new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder() - .hunger(-2) - .saturationModifier(-0.8f) - .alwaysEdible() - .statusEffect(new StatusEffectInstance(StatusEffects.POISON, 100, 0), 0.6F) - .statusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 100, 0), 0.6F) - .statusEffect(new StatusEffectInstance(StatusEffects.BAD_OMEN, 100, 0), 0.6F) - .build()))); + Item ZAP_BULB = register("zap_bulb", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.ZAP_BULB))); Item ROTTEN_APPLE = register("rotten_apple", new RottenAppleItem(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE))); Item COOKED_ZAP_APPLE = register("cooked_zap_apple", new Item(new Item.Settings().group(ItemGroup.FOOD).food(FoodComponents.APPLE))); @@ -68,6 +59,11 @@ public interface UItems { Item PEGASUS_FEATHER = register("pegasus_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS))); Item GRYPHON_FEATHER = register("gryphon_feather", new Item(new Item.Settings().group(ItemGroup.MATERIALS))); + Item OAT_SEEDS = register("oat_seeds", new AliasedBlockItem(UBlocks.OATS, new Item.Settings().group(ItemGroup.MATERIALS))); + Item OATS = register("oats", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.OATS))); + Item IMPORTED_OATS = register("imported_oats", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.IMPORTED_OATS))); + Item OATMEAL = register("oatmeal", new OatmealItem(new Item.Settings().recipeRemainder(Items.BOWL).maxCount(1).group(ItemGroup.FOOD).food(UFoodComponents.OATMEAL))); + Item DAFFODIL_DAISY_SANDWICH = register("daffodil_daisy_sandwich", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.DAFODIL_DAISY_SANDWICH))); Item HAY_BURGER = register("hay_burger", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(1).food(UFoodComponents.HAY_BURGER))); Item HAY_FRIES = register("hay_fries", new Item(new Item.Settings().group(ItemGroup.FOOD).maxCount(16).food(UFoodComponents.HAY_FRIES))); diff --git a/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java b/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java index 393911e2..98cbf1d8 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java +++ b/src/main/java/com/minelittlepony/unicopia/item/toxin/UFoodComponents.java @@ -1,20 +1,22 @@ package com.minelittlepony.unicopia.item.toxin; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.FoodComponent; public interface UFoodComponents { - - FoodComponent BAD_TOMATO = builder(3, 14).build(); - FoodComponent TOMATO = builder(4, 13).build(); - FoodComponent GOOD_TOMATO = builder(6, 14).build(); - - FoodComponent ALFALFA_SEEDS = builder(1, 4).build(); - FoodComponent ALFALFA_LEAVES = builder(1, 3).build(); + FoodComponent OATS = builder(1, 0.7F).build(); + FoodComponent IMPORTED_OATS = builder(3, 1.3F).build(); + FoodComponent OATMEAL = builder(0, 1.3F) + .statusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST, 1200, 1), 1) + .statusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1200, 1), 0.3F) + .statusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1200, 1), 0.2F) + .build(); FoodComponent DAFODIL_DAISY_SANDWICH = builder(3, 2).build(); - FoodComponent HAY_BURGER = builder(3, 4).build(); - FoodComponent HAY_FRIES = builder(1, 5).build(); - FoodComponent SALAD = builder(4, 2).build(); - FoodComponent CIDER = builder(4, 2).alwaysEdible().build(); + FoodComponent HAY_BURGER = builder(7, 1.4F).build(); + FoodComponent HAY_FRIES = builder(4, 2).build(); + FoodComponent SALAD = builder(3, 1).build(); + FoodComponent CIDER = builder(2, 1.7F).alwaysEdible().build(); FoodComponent JUICE = builder(2, 2).alwaysEdible().build(); FoodComponent BURNED_JUICE = builder(3, 1).build(); @@ -26,6 +28,12 @@ public interface UFoodComponents { FoodComponent SUGAR = builder(20, -2).build(); FoodComponent ZAP_APPLE = builder(4, 0.3F).alwaysEdible().snack().build(); + FoodComponent ZAP_BULB = builder(-2, -0.8f) + .alwaysEdible() + .statusEffect(new StatusEffectInstance(StatusEffects.POISON, 100, 0), 0.6F) + .statusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 100, 0), 0.6F) + .statusEffect(new StatusEffectInstance(StatusEffects.BAD_OMEN, 100, 0), 0.6F) + .build(); static FoodComponent.Builder builder(int hunger, float saturation) { return new FoodComponent.Builder() diff --git a/src/main/resources/assets/unicopia/blockstates/oats.json b/src/main/resources/assets/unicopia/blockstates/oats.json new file mode 100644 index 00000000..cdba5a4a --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/oats.json @@ -0,0 +1,16 @@ +{ + "variants": { + "age=0": { "model": "unicopia:block/oats_stage0" }, + "age=1": { "model": "unicopia:block/oats_stage1" }, + "age=2": { "model": "unicopia:block/oats_stage2" }, + "age=3": { "model": "unicopia:block/oats_stage3" }, + "age=4": { "model": "unicopia:block/oats_stage4" }, + "age=5": { "model": "unicopia:block/oats_stage5_lower" }, + "age=6": { "model": "unicopia:block/oats_stage6_lower" }, + "age=7": { "model": "unicopia:block/oats_stage7_lower" }, + "age=8": { "model": "unicopia:block/oats_stage8_lower" }, + "age=9": { "model": "unicopia:block/oats_stage9_lower" }, + "age=10": { "model": "unicopia:block/oats_stage9_lower" }, + "age=11": { "model": "unicopia:block/oats_stage9_lower" } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/oats_crown.json b/src/main/resources/assets/unicopia/blockstates/oats_crown.json new file mode 100644 index 00000000..1f75a155 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/oats_crown.json @@ -0,0 +1,6 @@ +{ + "variants": { + "age=0": { "model": "unicopia:block/oats_stage10_upper" }, + "age=1": { "model": "unicopia:block/oats_stage11_upper" } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/oats_stem.json b/src/main/resources/assets/unicopia/blockstates/oats_stem.json new file mode 100644 index 00000000..9182a177 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/oats_stem.json @@ -0,0 +1,11 @@ +{ + "variants": { + "age=0": { "model": "unicopia:block/oats_stage5_upper" }, + "age=1": { "model": "unicopia:block/oats_stage6_upper" }, + "age=2": { "model": "unicopia:block/oats_stage7_upper" }, + "age=3": { "model": "unicopia:block/oats_stage8_upper" }, + "age=4": { "model": "unicopia:block/oats_stage9_upper" }, + "age=5": { "model": "unicopia:block/oats_stage10_lower" }, + "age=6": { "model": "unicopia:block/oats_stage9_lower" } + } +} diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index c5c9e78e..5695e416 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -62,7 +62,12 @@ "item.unicopia.rock_stew": "Rock Stew", "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.oats": "Oats", + "item.unicopia.imported_oats": "Fancy Imported Oats", + "item.unicopia.oatmeal": "Oatmeal", + "item.unicopia.oat_seeds": "Oat Seeds", "item.unicopia.daffodil_daisy_sandwich": "Daffodil Daisy Sandwich", "item.unicopia.hay_burger": "Hay Burger", "item.unicopia.hay_fries": "Hay Fries", @@ -108,6 +113,11 @@ "block.unicopia.sweet_apple_leaves": "Sweet Apple Leaves", "block.unicopia.sweet_apple_sapling": "Sweet Apple Sapling", "block.unicopia.sweet_apple_sprout": "Sweet Apple Sprout", + "block.unicopia.sour_apple_leaves": "Sour Apple Leaves", + "block.unicopia.sour_apple_sapling": "Sour Apple Sapling", + "block.unicopia.sour_apple_sprout": "Sour Apple Sprout", + + "block.unicopia.oats": "Oats", "entity.unicopia.butterfly": "Butterfly", "entity.unicopia.twittermite": "Twittermite", diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage0.json b/src/main/resources/assets/unicopia/models/block/oats_stage0.json new file mode 100644 index 00000000..0eb3069a --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage0" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage1.json b/src/main/resources/assets/unicopia/models/block/oats_stage1.json new file mode 100644 index 00000000..5bcf45ed --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage1" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage10_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage10_lower.json new file mode 100644 index 00000000..126b394e --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage10_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage10_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage10_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage10_upper.json new file mode 100644 index 00000000..e3551738 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage10_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage10_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage11_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage11_lower.json new file mode 100644 index 00000000..f8e678ab --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage11_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage11_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage11_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage11_upper.json new file mode 100644 index 00000000..fc0fd0cd --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage11_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage11_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage2.json b/src/main/resources/assets/unicopia/models/block/oats_stage2.json new file mode 100644 index 00000000..e6e4d396 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage2" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage3.json b/src/main/resources/assets/unicopia/models/block/oats_stage3.json new file mode 100644 index 00000000..0fa98fc6 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage3" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage4.json b/src/main/resources/assets/unicopia/models/block/oats_stage4.json new file mode 100644 index 00000000..a3c5b132 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage4.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage4" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage5_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage5_lower.json new file mode 100644 index 00000000..8ba06faa --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage5_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage5_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage5_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage5_upper.json new file mode 100644 index 00000000..a6b268e9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage5_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage5_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage6_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage6_lower.json new file mode 100644 index 00000000..8d26e73c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage6_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage6_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage6_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage6_upper.json new file mode 100644 index 00000000..e1040e8d --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage6_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage6_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage7_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage7_lower.json new file mode 100644 index 00000000..1fd6ad91 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage7_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage7_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage7_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage7_upper.json new file mode 100644 index 00000000..979716e3 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage7_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage7_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage8_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage8_lower.json new file mode 100644 index 00000000..b3a03e8b --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage8_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage8_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage8_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage8_upper.json new file mode 100644 index 00000000..02950f05 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage8_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage8_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage9_lower.json b/src/main/resources/assets/unicopia/models/block/oats_stage9_lower.json new file mode 100644 index 00000000..9e46c3f5 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage9_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage9_lower" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/oats_stage9_upper.json b/src/main/resources/assets/unicopia/models/block/oats_stage9_upper.json new file mode 100644 index 00000000..a45d5194 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/oats_stage9_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "unicopia:block/oats_stage9_upper" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/imported_oats.json b/src/main/resources/assets/unicopia/models/item/imported_oats.json new file mode 100644 index 00000000..554311e8 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/imported_oats.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/imported_oats" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/oat_seeds.json b/src/main/resources/assets/unicopia/models/item/oat_seeds.json new file mode 100644 index 00000000..653d2e0f --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/oat_seeds.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/oat_seeds" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/oatmeal.json b/src/main/resources/assets/unicopia/models/item/oatmeal.json new file mode 100644 index 00000000..1975a5aa --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/oatmeal.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/oatmeal" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/oats.json b/src/main/resources/assets/unicopia/models/item/oats.json new file mode 100644 index 00000000..b2928654 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/oats.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/oats" + } +} diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage0.png b/src/main/resources/assets/unicopia/textures/block/oats_stage0.png new file mode 100644 index 00000000..f82a89a8 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage0.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage1.png b/src/main/resources/assets/unicopia/textures/block/oats_stage1.png new file mode 100644 index 00000000..12b01a48 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage1.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage10_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage10_lower.png new file mode 100644 index 00000000..60f2d466 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage10_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage10_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage10_upper.png new file mode 100644 index 00000000..9cfef8cd Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage10_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage11_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage11_upper.png new file mode 100644 index 00000000..5cc4253e Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage11_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage2.png b/src/main/resources/assets/unicopia/textures/block/oats_stage2.png new file mode 100644 index 00000000..11e6d25f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage2.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage3.png b/src/main/resources/assets/unicopia/textures/block/oats_stage3.png new file mode 100644 index 00000000..158cb443 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage3.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage4.png b/src/main/resources/assets/unicopia/textures/block/oats_stage4.png new file mode 100644 index 00000000..e608705d Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage4.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage5_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage5_lower.png new file mode 100644 index 00000000..de0f6502 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage5_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage5_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage5_upper.png new file mode 100644 index 00000000..7e96e59d Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage5_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage6_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage6_lower.png new file mode 100644 index 00000000..4d8a3e21 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage6_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage6_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage6_upper.png new file mode 100644 index 00000000..3dd2b8eb Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage6_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage7_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage7_lower.png new file mode 100644 index 00000000..604f41cc Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage7_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage7_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage7_upper.png new file mode 100644 index 00000000..1f5f3a15 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage7_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage8_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage8_lower.png new file mode 100644 index 00000000..7b7fbe9e Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage8_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage8_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage8_upper.png new file mode 100644 index 00000000..8ec47213 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage8_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage9_lower.png b/src/main/resources/assets/unicopia/textures/block/oats_stage9_lower.png new file mode 100644 index 00000000..a7635f20 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage9_lower.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/oats_stage9_upper.png b/src/main/resources/assets/unicopia/textures/block/oats_stage9_upper.png new file mode 100644 index 00000000..e8c832f3 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/oats_stage9_upper.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/imported_oats.png b/src/main/resources/assets/unicopia/textures/item/imported_oats.png new file mode 100644 index 00000000..b84d7de7 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/imported_oats.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/oat_seeds.png b/src/main/resources/assets/unicopia/textures/item/oat_seeds.png new file mode 100644 index 00000000..7cd7fc7f Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/oat_seeds.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/oatmeal.png b/src/main/resources/assets/unicopia/textures/item/oatmeal.png new file mode 100644 index 00000000..11ede2f4 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/oatmeal.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/oats.png b/src/main/resources/assets/unicopia/textures/item/oats.png new file mode 100644 index 00000000..3b069977 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/oats.png differ diff --git a/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json b/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json new file mode 100644 index 00000000..1bcf0711 --- /dev/null +++ b/src/main/resources/data/unicopia/advancements/recipes/food/oatmeal.json @@ -0,0 +1,30 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "unicopia:oatmeal" + ] + }, + "criteria": { + "has_ingredients": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { "tag": "unicopia:oats" } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "unicopia:oatmeal" + } + } + }, + "requirements": [ + [ + "has_ingredients", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats.json new file mode 100644 index 00000000..3adf5caf --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/oats.json @@ -0,0 +1,68 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:explosion_decay" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "block": "unicopia:oats", + "condition": "minecraft:block_state_property", + "properties": { + "age": "11" + } + } + ], + "name": "unicopia:oats" + }, + { + "type": "minecraft:item", + "name": "unicopia:oat_seeds" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "block": "unicopia:oats", + "condition": "minecraft:block_state_property", + "properties": { + "age": "11" + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:binomial_with_bonus_count", + "function": "minecraft:apply_bonus", + "parameters": { + "extra": 3, + "probability": 0.5714286 + } + } + ], + "name": "unicopia:oat_seeds" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json new file mode 100644 index 00000000..4d3e6bd0 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/oats_crown.json @@ -0,0 +1,68 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:explosion_decay" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "block": "unicopia:oats_crown", + "condition": "minecraft:block_state_property", + "properties": { + "age": "1" + } + } + ], + "name": "unicopia:oats" + }, + { + "type": "minecraft:item", + "name": "unicopia:oat_seeds" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "block": "unicopia:oats_crown", + "condition": "minecraft:block_state_property", + "properties": { + "age": "1" + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:binomial_with_bonus_count", + "function": "minecraft:apply_bonus", + "parameters": { + "extra": 3, + "probability": 0.5714286 + } + } + ], + "name": "unicopia:oat_seeds" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json b/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json new file mode 100644 index 00000000..5cadc205 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/oats_stem.json @@ -0,0 +1,64 @@ +{ + "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:explosion_decay" + } + ], + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "block": "unicopia:oats_stem", + "condition": "minecraft:block_state_property", + "properties": { + "age": "6" + } + } + ], + "name": "unicopia:oats" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "block": "unicopia:oats_stem", + "condition": "minecraft:block_state_property", + "properties": { + "age": "6" + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:binomial_with_bonus_count", + "function": "minecraft:apply_bonus", + "parameters": { + "extra": 3, + "probability": 0.5714286 + } + } + ], + "name": "unicopia:oat_seeds" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/oatmeal.json b/src/main/resources/data/unicopia/recipes/oatmeal.json new file mode 100644 index 00000000..14a6d641 --- /dev/null +++ b/src/main/resources/data/unicopia/recipes/oatmeal.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { "item": "unicopia:oats" }, + { "item": "unicopia:oats" }, + { "item": "unicopia:oats" }, + { "item": "minecraft:milk_bucket" }, + { "item": "minecraft:bowl" } + ], + "result": { "item": "unicopia:oatmeal" } +} diff --git a/src/main/resources/data/unicopiamc/loot_tables/blocks/grass.json b/src/main/resources/data/unicopiamc/loot_tables/blocks/grass.json new file mode 100644 index 00000000..b4294034 --- /dev/null +++ b/src/main/resources/data/unicopiamc/loot_tables/blocks/grass.json @@ -0,0 +1,37 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune", + "chances": [ + 0.05, 0.052222223, 0.055, 0.066666665, 0.1 + ] + } + ], + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1.0, + "max": 2.0, + "type": "minecraft:uniform" + } + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "unicopia:oat_seeds" + } + ] + } + ] +} \ No newline at end of file