diff --git a/.gitignore b/.gitignore index 94183b67..f2cb75bf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ ideas *.iml classes/ out/ -jars/ \ No newline at end of file +jars/ diff --git a/BlockusAddon b/BlockusAddon new file mode 160000 index 00000000..94ff5bab --- /dev/null +++ b/BlockusAddon @@ -0,0 +1 @@ +Subproject commit 94ff5babb976911f46d7efcdad2586652fb33047 diff --git a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java index 9f055212..de83f274 100644 --- a/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java +++ b/src/main/java/com/minelittlepony/unicopia/EquinePredicates.java @@ -11,6 +11,8 @@ import com.minelittlepony.unicopia.item.enchantment.WantItNeedItEnchantment; import net.minecraft.entity.*; import net.minecraft.entity.decoration.AbstractDecorationEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.ProjectileEntity; +import net.minecraft.entity.vehicle.BoatEntity; import net.minecraft.predicate.entity.EntityPredicates; public interface EquinePredicates { @@ -33,7 +35,11 @@ public interface EquinePredicates { Predicate IS_CASTER = e -> !e.isRemoved() && (e instanceof Caster || IS_PLAYER.test(e)); Predicate IS_PLACED_SPELL = e -> e instanceof Caster && !e.isRemoved(); - Predicate IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) && !(e instanceof ItemEntity) && !(e instanceof ExperienceOrbEntity); + Predicate IS_MAGIC_IMMUNE = e -> (e instanceof MagicImmune || !(e instanceof LivingEntity)) + && !(e instanceof ItemEntity) + && !(e instanceof ExperienceOrbEntity) + && !(e instanceof BoatEntity) + && !(e instanceof ProjectileEntity); Predicate EXCEPT_MAGIC_IMMUNE = IS_MAGIC_IMMUNE.negate(); Predicate VALID_LIVING_AND_NOT_MAGIC_IMMUNE = EntityPredicates.VALID_LIVING_ENTITY.and(EXCEPT_MAGIC_IMMUNE); diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java index 3d3dbc00..5726a36e 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java @@ -113,7 +113,7 @@ public class UnicornCastingAbility extends AbstractSpellCastingAbility { } else { player.setAnimation(Animation.ARMS_UP, Animation.Recipient.HUMAN); if (s instanceof HomingSpell homer) { - TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EquinePredicates.VALID_LIVING_AND_NOT_MAGIC_IMMUNE).ifPresent(homer::setTarget); + TraceHelper.findEntity(player.asEntity(), homer.getRange(player), 1, EquinePredicates.EXCEPT_MAGIC_IMMUNE).ifPresent(homer::setTarget); } player.playSound(USounds.SPELL_CAST_SUCCESS, 0.05F, 2.2F); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ChillingBreathSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ChillingBreathSpell.java index 18965bd4..90bcfd2d 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ChillingBreathSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ChillingBreathSpell.java @@ -30,6 +30,7 @@ public class ChillingBreathSpell extends AbstractSpell implements HomingSpell { public boolean setTarget(Entity target) { if (target instanceof LavaAffine affine) { affine.setLavaAffine(!affine.isLavaAffine()); + setDead(); } return true; } diff --git a/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java b/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java index 647531bd..30e3ccba 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/SlimePustuleBlock.java @@ -122,7 +122,7 @@ public class SlimePustuleBlock extends Block { @Override public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { if (state.get(SHAPE) == Shape.POD) { - world.getOtherEntities(null, new Box(pos).expand(1)).forEach(entity -> { + world.getOtherEntities(player.canHarvest(state) ? player : null, new Box(pos).expand(1)).forEach(entity -> { entity.damage(entity.getDamageSources().inFire(), 2); entity.setFireTicks(3); }); diff --git a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java index 2d7155b2..798d7668 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java +++ b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java @@ -26,7 +26,9 @@ import com.minelittlepony.unicopia.client.render.*; import com.minelittlepony.unicopia.client.render.entity.*; import com.minelittlepony.unicopia.client.render.shader.UShaders; import com.minelittlepony.unicopia.client.render.spell.SpellRendererFactory; +import com.minelittlepony.unicopia.entity.mob.ButterflyEntity; import com.minelittlepony.unicopia.entity.mob.UEntities; +import com.minelittlepony.unicopia.item.ButterflyItem; import com.minelittlepony.unicopia.item.ChameleonItem; import com.minelittlepony.unicopia.item.EnchantableItem; import com.minelittlepony.unicopia.item.FancyBedItem; @@ -119,6 +121,7 @@ public interface URenderers { PolearmRenderer.register(UItems.WOODEN_POLEARM, UItems.STONE_POLEARM, UItems.IRON_POLEARM, UItems.GOLDEN_POLEARM, UItems.DIAMOND_POLEARM, UItems.NETHERITE_POLEARM); ModelPredicateProviderRegistry.register(UItems.GEMSTONE, new Identifier("affinity"), (stack, world, entity, seed) -> EnchantableItem.isEnchanted(stack) ? EnchantableItem.getSpellKey(stack).getAffinity().getAlignment() : 0); ModelPredicateProviderRegistry.register(UItems.ROCK_CANDY, new Identifier("count"), (stack, world, entity, seed) -> stack.getCount() / (float)stack.getMaxCount()); + ModelPredicateProviderRegistry.register(UItems.BUTTERFLY, new Identifier("variant"), (stack, world, entity, seed) -> (float)ButterflyItem.getVariant(stack).ordinal() / ButterflyEntity.Variant.VALUES.length); ModelPredicateProviderRegistry.register(Unicopia.id("zap_cycle"), new ClampedModelPredicateProvider() { private double targetAngle; private double lastAngle; diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java index 1e0aba0c..4d8ecef3 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/EntityDisguiseRenderer.java @@ -34,7 +34,7 @@ class EntityDisguiseRenderer { public boolean render(Living pony, Disguise disguise, double x, double y, double z, - float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) { + float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light) { int fireTicks = pony.asEntity().doesRenderOnFire() ? 1 : 0; disguise.update(pony, false); @@ -51,20 +51,20 @@ class EntityDisguiseRenderer { e.setBoundingBox(pony.asEntity().getBoundingBox()); } - render(ve, e, x, y, z, fireTicks, tickDelta, matrices, vertexConsumers, light); + render(ve, e, x, y, z, fireTicks, tickDelta, matrices, vertices, light); ve.getAttachments().forEach(ee -> { PehkUtil.copyScale(pony.asEntity(), ee); Vec3d difference = ee.getPos().subtract(e.getPos()); - render(ve, ee, x + difference.x, y + difference.y, z + difference.z, fireTicks, tickDelta, matrices, vertexConsumers, light); + render(ve, ee, x + difference.x, y + difference.y, z + difference.z, fireTicks, tickDelta, matrices, vertices, light); PehkUtil.clearScale(ee); }); matrices.push(); matrices.translate(x, y, z); - SpellEffectsRenderDispatcher.INSTANCE.render(matrices, vertexConsumers, light, pony, 0, 0, tickDelta, pony.asEntity().age + tickDelta, 0, 0); + SpellEffectsRenderDispatcher.INSTANCE.render(matrices, vertices, light, pony, 0, 0, tickDelta, pony.asEntity().age + tickDelta, 0, 0); matrices.pop(); - delegate.afterEntityRender(pony, matrices, light); + delegate.afterEntityRender(pony, matrices, vertices, light); PehkUtil.clearScale(e); return true; } diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java b/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java index 70a7c975..2d813635 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/WorldRenderDelegate.java @@ -31,6 +31,7 @@ import net.minecraft.util.math.*; public class WorldRenderDelegate { public static final WorldRenderDelegate INSTANCE = new WorldRenderDelegate(); private static final Optional RED_SKY_COLOR = Optional.of(new Vec3d(1, 0, 0)); + private static final Identifier SHADOW_TEXTURE = new Identifier("textures/misc/shadow.png"); private final EntityReplacementManager disguiseLookup = new EntityReplacementManager(); private final EntityDisguiseRenderer disguiseRenderer = new EntityDisguiseRenderer(this); @@ -71,13 +72,23 @@ public class WorldRenderDelegate { if (MinecraftClient.getInstance().getResourceManager().getResource(frostingTexture).isPresent()) { recurseFrosting = true; + + Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEffectVertexConsumers(); + client.getEntityRenderDispatcher().render(entity, x, y, z, yaw, tickDelta, matrices, layer -> { - if (RenderLayerUtil.getTexture(layer).orElse(null) == null) { + + Identifier texture = RenderLayerUtil.getTexture(layer).orElse(null); + + if (texture == null || texture.equals(SHADOW_TEXTURE)) { return vertices.getBuffer(layer); } - return VertexConsumers.union(vertices.getBuffer(layer), vertices.getBuffer(RenderLayers.getEntityTranslucent(frostingTexture))); + return VertexConsumers.union( + vertices.getBuffer(layer), + immediate.getBuffer(RenderLayers.getEntityTranslucent(frostingTexture)) + ); }, light); recurseFrosting = false; + immediate.draw(); return true; } } @@ -89,14 +100,13 @@ public class WorldRenderDelegate { return Equine.of(entity).filter(eq -> onEntityRender(eq, x, y, z, yaw, tickDelta, matrices, vertices, light)).isPresent(); } - public void afterEntityRender(Equine pony, MatrixStack matrices, int light) { + public void afterEntityRender(Equine pony, MatrixStack matrices, VertexConsumerProvider vertices, int light) { if (recurseFrosting) { return; } if (pony instanceof Creature creature && smittenEyesRenderer.isSmitten(creature)) { - Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers(); - smittenEyesRenderer.render(creature, matrices, immediate, light, 0); + smittenEyesRenderer.render(creature, matrices, vertices, light, 0); } if (pony instanceof Pony p) { diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/spell/SpellEffectsRenderDispatcher.java b/src/main/java/com/minelittlepony/unicopia/client/render/spell/SpellEffectsRenderDispatcher.java index 37c4c51b..72d0db23 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/spell/SpellEffectsRenderDispatcher.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/spell/SpellEffectsRenderDispatcher.java @@ -79,6 +79,10 @@ public class SpellEffectsRenderDispatcher implements SynchronousResourceReloader } public void render(MatrixStack matrices, VertexConsumerProvider vertices, int light, Caster caster, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + if (!((RenderDispatcherAccessor)client.getEntityRenderDispatcher()).shouldRenderShadows()) { + return; + } + caster.getSpellSlot().forEach(spell -> { render(matrices, vertices, spell, caster, light, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch); return Operation.SKIP; @@ -156,4 +160,8 @@ public class SpellEffectsRenderDispatcher implements SynchronousResourceReloader matrices.pop(); } } + + public interface RenderDispatcherAccessor { + boolean shouldRenderShadows(); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Creature.java b/src/main/java/com/minelittlepony/unicopia/entity/Creature.java index 82039a7f..77d0c083 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Creature.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Creature.java @@ -70,13 +70,17 @@ public class Creature extends Living implements WeaklyOwned.Mutabl public Creature(LivingEntity entity) { super(entity, EFFECT); physics = new EntityPhysics<>(entity, GRAVITY); + addTicker(physics); + addTicker(this::updateConsumption); + } + + @Override + public void initDataTracker() { + super.initDataTracker(); entity.getDataTracker().startTracking(MASTER, owner.toNBT()); entity.getDataTracker().startTracking(EATING, 0); entity.getDataTracker().startTracking(DISCORDED, false); entity.getDataTracker().startTracking(SMITTEN, false); - - addTicker(physics); - addTicker(this::updateConsumption); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java index 3b912b76..1529989b 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java @@ -28,16 +28,8 @@ public class EntityPhysics implements Physics, Copyable gravity) { - this(entity, gravity, true); - } - - public EntityPhysics(T entity, TrackedData gravity, boolean register) { this.entity = entity; this.gravity = gravity; - - if (register) { - this.entity.getDataTracker().startTracking(gravity, 1F); - } } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java index a9cf3707..691bbfcf 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java @@ -19,6 +19,8 @@ public interface Equine extends NbtSerialisable, Tickable, Pro void setSpecies(Race race); + void initDataTracker(); + /** * Called at the beginning of an update cycle. */ diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java index 50680348..3d594ea7 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ItemImpl.java @@ -41,8 +41,12 @@ public class ItemImpl implements Equine { public ItemImpl(ItemEntity owner) { this.entity = owner; this.physics = new ItemPhysics(owner); - owner.getDataTracker().startTracking(ITEM_GRAVITY, 1F); - owner.getDataTracker().startTracking(ITEM_RACE, Race.REGISTRY.getId(Race.HUMAN).toString()); + } + + @Override + public void initDataTracker() { + entity.getDataTracker().startTracking(ITEM_GRAVITY, 1F); + entity.getDataTracker().startTracking(ITEM_RACE, Race.REGISTRY.getId(Race.HUMAN).toString()); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ItemPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/ItemPhysics.java index f1675f0d..b747dd0a 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ItemPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ItemPhysics.java @@ -4,7 +4,7 @@ import net.minecraft.entity.ItemEntity; class ItemPhysics extends EntityPhysics { public ItemPhysics(ItemEntity entity) { - super(entity, ItemImpl.ITEM_GRAVITY, false); + super(entity, ItemImpl.ITEM_GRAVITY); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index e0eb1aeb..9d1c57e2 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -111,12 +111,15 @@ public abstract class Living implements Equine, Caste protected Living(T entity, TrackedData effect) { this.entity = entity; this.effectDelegate = new EffectSync(this, effect); - this.sneakingHeuristic = addTicker(new Interactable(entity::isSneaking)); this.landedHeuristic = addTicker(new Interactable(entity::isOnGround)); this.jumpingHeuristic = addTicker(new Interactable(((LivingEntityDuck)entity)::isJumping)); + } - entity.getDataTracker().startTracking(effect, new NbtCompound()); + @Override + public void initDataTracker() { + effectDelegate.initDataTracker(); + entity.getDataTracker().startTracking(Creature.GRAVITY, 1F); entity.getDataTracker().startTracking(CARRIER_ID, Optional.empty()); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java index e16091bf..b313e4fb 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/ButterflyEntity.java @@ -1,19 +1,25 @@ package com.minelittlepony.unicopia.entity.mob; +import java.util.Arrays; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.item.ButterflyItem; import com.minelittlepony.unicopia.util.NbtSerialisable; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityType; +import net.minecraft.entity.ItemEntity; import net.minecraft.entity.SpawnReason; import net.minecraft.entity.attribute.DefaultAttributeContainer; import net.minecraft.entity.attribute.EntityAttributes; @@ -23,10 +29,13 @@ import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; import net.minecraft.entity.mob.AmbientEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.sound.SoundEvent; import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.util.Hand; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -144,6 +153,11 @@ public class ButterflyEntity extends AmbientEntity { if (e instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity)e; + if (player.getStackInHand(Hand.MAIN_HAND).isIn(ItemTags.FLOWERS)) { + setTarget(player); + return false; + } + if (player.isCreative() || player.isSpectator()) { return false; } @@ -174,6 +188,7 @@ public class ButterflyEntity extends AmbientEntity { if (!flowerPosition.isPresent()) { setResting(false); return; + } if (getWorld().getBlockState(below).isAir() @@ -193,20 +208,32 @@ public class ButterflyEntity extends AmbientEntity { } else { ticksResting = 0; - updateFlowerPosition().map(flower -> { - if (flower.isWithinDistance(getPos(), 1)) { - setResting(true); - visited.put(flower, (long)age); - if (breedingCooldown <= 0) { - breedingCooldown = MAX_BREEDING_COOLDOWN / 10; - } + if (getTarget() instanceof PlayerEntity player) { + if (player.isRemoved() || !player.getStackInHand(Hand.MAIN_HAND).isIn(ItemTags.FLOWERS)) { + setTarget(null); } + if (distanceTo(player) > 3) { + moveTowards(player.getBlockPos()); + } else { + this.addVelocity(random.nextFloat() * 0.1 - 0.05F, random.nextFloat() * 0.1, random.nextFloat() * 0.1 - 0.05F); + } + } else { - return flower; - }).or(this::findNextHoverPosition).ifPresent(this::moveTowards); + updateFlowerPosition().map(flower -> { + if (flower.isWithinDistance(getPos(), 1)) { + setResting(true); + visited.put(flower, (long)age); + if (breedingCooldown <= 0) { + breedingCooldown = MAX_BREEDING_COOLDOWN / 10; + } + } - if (random.nextInt(100) == 0 && getWorld().getBlockState(below).isOpaque()) { - setResting(true); + return flower; + }).or(this::findNextHoverPosition).ifPresent(this::moveTowards); + + if (random.nextInt(100) == 0 && getWorld().getBlockState(below).isOpaque()) { + setResting(true); + } } } } @@ -304,6 +331,11 @@ public class ButterflyEntity extends AmbientEntity { return getHeight() / 2; } + @Override + public ItemEntity dropStack(ItemStack stack, float yOffset) { + return super.dropStack(ButterflyItem.setVariant(stack, getVariant()), yOffset); + } + @Override public void writeCustomDataToNbt(NbtCompound nbt) { super.writeCustomDataToNbt(nbt); @@ -351,14 +383,14 @@ public class ButterflyEntity extends AmbientEntity { WHITE_MONARCH, BRIMSTONE; - private static final Variant[] VALUES = Variant.values(); + public static final Variant[] VALUES = Variant.values(); + private static final Map REGISTRY = Arrays.stream(VALUES).collect(Collectors.toMap(a -> a.name().toLowerCase(Locale.ROOT), Function.identity())); private final Identifier skin = Unicopia.id("textures/entity/butterfly/" + name().toLowerCase() + ".png"); public Identifier getSkin() { return skin; } - static Variant byId(int index) { return VALUES[Math.max(0, index) % VALUES.length]; } @@ -366,5 +398,9 @@ public class ButterflyEntity extends AmbientEntity { static Variant random(Random rand) { return VALUES[rand.nextInt(VALUES.length)]; } + + public static Variant byName(String name) { + return REGISTRY.getOrDefault(name == null ? "" : name, BUTTERFLY); + } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Acrobatics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Acrobatics.java index eb9c98eb..37009bb5 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Acrobatics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Acrobatics.java @@ -41,12 +41,13 @@ public class Acrobatics implements Tickable, NbtSerialisable { public Acrobatics(Pony pony) { this.pony = pony; this.entity = pony.asEntity(); - - entity.getDataTracker().startTracking(HANGING_POSITION, Optional.empty()); - pony.addTicker(this::checkDislodge); } + public void initDataTracker() { + entity.getDataTracker().startTracking(HANGING_POSITION, Optional.empty()); + } + public boolean isImmobile() { return isFloppy() && entity.isOnGround(); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/ManaContainer.java b/src/main/java/com/minelittlepony/unicopia/entity/player/ManaContainer.java index 4ab1ddf4..c527430d 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/ManaContainer.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/ManaContainer.java @@ -38,6 +38,10 @@ class ManaContainer implements MagicReserves, Tickable, NbtSerialisable, Copyabl }); } + public void initDataTracker() { + bars.values().forEach(BarInst::initDataTracker); + } + protected BarInst addBar(String name, BarInst bar) { bars.put(name, bar); return bar; @@ -164,7 +168,12 @@ class ManaContainer implements MagicReserves, Tickable, NbtSerialisable, Copyabl this.marker = marker; this.max = max; this.trailingValue = initial; - pony.asEntity().getDataTracker().startTracking(marker, getMax() * initial); + this.prevTrailingValue = initial; + this.prevValue = initial; + } + + public void initDataTracker() { + pony.asEntity().getDataTracker().startTracking(marker, max * trailingValue); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java index 006f20f8..f883529a 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java @@ -21,7 +21,6 @@ class PlayerLevelStore implements Levelled.LevelStore { this.dataEntry = dataEntry; this.upgradeMana = upgradeMana; this.levelUpSound = levelUpSound; - pony.asEntity().getDataTracker().startTracking(dataEntry, 0); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 67a93b73..02c1d532 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -125,15 +125,23 @@ public class Pony extends Living implements Copyable, Update this.corruption = new PlayerLevelStore(this, CORRUPTION, false, USounds.ENTITY_PLAYER_CORRUPTION); this.mana = addTicker(new ManaContainer(this)); - player.getDataTracker().startTracking(RACE, Race.DEFAULT_ID); - player.getDataTracker().startTracking(SUPPRESSED_RACE, Race.DEFAULT_ID); - addTicker(this::updateAnimations); addTicker(this::updateBatPonyAbilities); addTicker(this::updateCorruptionDecay); addTicker(new PlayerAttributes(this)); } + @Override + public void initDataTracker() { + super.initDataTracker(); + acrobatics.initDataTracker(); + mana.initDataTracker(); + entity.getDataTracker().startTracking(LEVEL, 0); + entity.getDataTracker().startTracking(CORRUPTION, 0); + entity.getDataTracker().startTracking(RACE, Race.DEFAULT_ID); + entity.getDataTracker().startTracking(SUPPRESSED_RACE, Race.DEFAULT_ID); + } + public static void registerAttributes(DefaultAttributeContainer.Builder builder) { builder.add(UEntityAttributes.EXTRA_MINING_SPEED); builder.add(UEntityAttributes.ENTITY_GRAVITY_MODIFIER); diff --git a/src/main/java/com/minelittlepony/unicopia/item/ButterflyItem.java b/src/main/java/com/minelittlepony/unicopia/item/ButterflyItem.java new file mode 100644 index 00000000..374838a6 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/ButterflyItem.java @@ -0,0 +1,53 @@ +package com.minelittlepony.unicopia.item; + +import java.util.Arrays; +import java.util.List; +import java.util.Locale; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.entity.mob.ButterflyEntity; +import com.minelittlepony.unicopia.item.group.MultiItem; + +import net.minecraft.client.item.TooltipContext; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import net.minecraft.world.World; + +public class ButterflyItem extends Item implements MultiItem { + + public ButterflyItem(Settings settings) { + super(settings); + } + + @Override + public List getDefaultStacks() { + return Arrays.stream(ButterflyEntity.Variant.VALUES).map(variant -> setVariant(getDefaultStack(), variant)).toList(); + } + + @Override + public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { + tooltip.add(Text.literal(getVariant(stack).name()).formatted(Formatting.LIGHT_PURPLE)); + } + + public static ButterflyEntity.Variant getVariant(ItemStack stack) { + NbtCompound nbt = stack.getNbt(); + if (nbt == null || !nbt.contains("variant", NbtElement.STRING_TYPE)) { + return ButterflyEntity.Variant.BUTTERFLY; + } + String variant = nbt.getString("variant"); + return ButterflyEntity.Variant.byName(variant); + } + + public static ItemStack setVariant(ItemStack stack, ButterflyEntity.Variant variant) { + if (stack.isOf(UItems.BUTTERFLY)) { + stack.getOrCreateNbt().putString("variant", variant.name().toLowerCase(Locale.ROOT)); + } + return stack; + } + +} diff --git a/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java b/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java index 6a5b9c08..ee6dc0dc 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/FilledJarItem.java @@ -2,6 +2,8 @@ package com.minelittlepony.unicopia.item; import com.minelittlepony.unicopia.entity.IItemEntity; import com.minelittlepony.unicopia.entity.Living; +import com.minelittlepony.unicopia.entity.mob.ButterflyEntity; +import com.minelittlepony.unicopia.entity.mob.UEntities; import com.minelittlepony.unicopia.projectile.MagicProjectileEntity; import net.minecraft.block.Block; @@ -125,8 +127,16 @@ public class FilledJarItem extends JarItem implements ChameleonItem { @Override public void onImpact(MagicProjectileEntity projectile) { ItemStack stack = getAppearanceStack(projectile.getStack()); - stack.damage(1, projectile.getWorld().random, null); - projectile.dropStack(stack); + + if (stack.isOf(UItems.BUTTERFLY)) { + ButterflyEntity butterfly = UEntities.BUTTERFLY.create(projectile.getWorld()); + butterfly.setVariant(ButterflyItem.getVariant(stack)); + butterfly.updatePosition(projectile.getX(), projectile.getY(), projectile.getZ()); + projectile.getWorld().spawnEntity(butterfly); + } else { + stack.damage(1, projectile.getWorld().random, null); + projectile.dropStack(stack); + } projectile.getWorld().syncWorldEvent(WorldEvents.BLOCK_BROKEN, projectile.getBlockPos(), Block.getRawIdFromState(Blocks.GLASS.getDefaultState())); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index cf71cf2a..5ee6baeb 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -145,7 +145,7 @@ public interface UItems { Item LOOT_BUG_SPAWN_EGG = register("loot_bug_spawn_egg", new SpawnEggItem(UEntities.LOOT_BUG, 0x3C9D14, 0xE66F16, new Item.Settings()), ItemGroups.SPAWN_EGGS); Item BUTTERFLY_SPAWN_EGG = register("butterfly_spawn_egg", new SpawnEggItem(UEntities.BUTTERFLY, 0x222200, 0xAAEEFF, new Item.Settings()), ItemGroups.SPAWN_EGGS); - Item BUTTERFLY = register("butterfly", new Item(new Item.Settings().food(UFoodComponents.INSECTS)), ItemGroups.FOOD_AND_DRINK); + Item BUTTERFLY = register("butterfly", new ButterflyItem(new Item.Settings().food(UFoodComponents.INSECTS)), ItemGroups.FOOD_AND_DRINK); Item PALM_BOAT = ItemGroupRegistry.register(TerraformBoatItemHelper.registerBoatItem(Unicopia.id("palm_boat"), UWoodTypes.PALM_BOAT_TYPE, false), ItemGroups.FUNCTIONAL); Item PALM_CHEST_BOAT = ItemGroupRegistry.register(TerraformBoatItemHelper.registerBoatItem(Unicopia.id("palm_chest_boat"), UWoodTypes.PALM_BOAT_TYPE, true), ItemGroups.FUNCTIONAL); diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java index 986e9bf5..6a9c29d3 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntity.java @@ -19,12 +19,14 @@ import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.duck.EntityDuck; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; import net.minecraft.entity.ItemEntity; import net.minecraft.entity.Entity.PositionUpdater; import net.minecraft.entity.Entity.RemovalReason; import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; import net.minecraft.registry.tag.TagKey; +import net.minecraft.world.World; @Mixin(Entity.class) abstract class MixinEntity implements EntityDuck { @@ -64,6 +66,14 @@ abstract class MixinEntity implements EntityDuck { return self.hasVehicle() && self.getVehicle() instanceof LavaAffine affine && affine.isLavaAffine(); } + + @Inject(method = "", at = @At(value = "INVOKE", target = "net/minecraft/entity/Entity.initDataTracker()V")) + private void onInstanceInit(EntityType type, World world, CallbackInfo info) { + if (this instanceof Equine.Container c) { + c.get().initDataTracker(); + } + } + @Inject(method = "isFireImmune", at = @At("HEAD"), cancellable = true) private void onIsFireImmune(CallbackInfoReturnable info) { if (isLavaAffine() || (this instanceof Equine.Container c) && c.get().getCompositeRace().includes(Race.KIRIN)) { diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java index b81bb782..c1954772 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinEntityRenderDispatcher.java @@ -1,11 +1,13 @@ package com.minelittlepony.unicopia.mixin.client; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.minelittlepony.unicopia.client.render.WorldRenderDelegate; +import com.minelittlepony.unicopia.client.render.spell.SpellEffectsRenderDispatcher; import com.minelittlepony.unicopia.entity.Equine; import net.minecraft.client.render.VertexConsumerProvider; @@ -14,7 +16,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; @Mixin(EntityRenderDispatcher.class) -abstract class MixinEntityRenderDispatcher { +abstract class MixinEntityRenderDispatcher implements SpellEffectsRenderDispatcher.RenderDispatcherAccessor { private static final String RENDER = "render(Lnet/minecraft/entity/Entity;DDDFFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V"; @@ -27,6 +29,10 @@ abstract class MixinEntityRenderDispatcher { @Inject(method = RENDER, at = @At("RETURN")) private void afterRender(E entity, double x, double y, double z, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo info) { - Equine.of(entity).ifPresent(eq -> WorldRenderDelegate.INSTANCE.afterEntityRender(eq, matrices, light)); + Equine.of(entity).ifPresent(eq -> WorldRenderDelegate.INSTANCE.afterEntityRender(eq, matrices, vertexConsumers, light)); } + + @Accessor("renderShadows") + @Override + public abstract boolean shouldRenderShadows(); } diff --git a/src/main/java/com/minelittlepony/unicopia/network/datasync/EffectSync.java b/src/main/java/com/minelittlepony/unicopia/network/datasync/EffectSync.java index 724c5660..c66cac4c 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/datasync/EffectSync.java +++ b/src/main/java/com/minelittlepony/unicopia/network/datasync/EffectSync.java @@ -43,6 +43,10 @@ public class EffectSync implements SpellContainer, NbtSerialisable { this.param = param; } + public void initDataTracker() { + owner.asEntity().getDataTracker().startTracking(param, new NbtCompound()); + } + public boolean tick(Situation situation) { return tick(spell -> { if (spell.isDying()) { diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java index dacbab72..8c8b09e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/MagicProjectileEntity.java @@ -67,7 +67,7 @@ public class MagicProjectileEntity extends ThrownItemEntity implements Caster physics = new EntityPhysics<>(this, GRAVITY, false); + private final EntityPhysics physics = new EntityPhysics<>(this, GRAVITY); private final EntityReference homingTarget = new EntityReference<>(); private EntityReference owner; diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/Tree.java b/src/main/java/com/minelittlepony/unicopia/server/world/Tree.java index 5f343f28..54b57ac7 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/Tree.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/Tree.java @@ -30,7 +30,8 @@ public record Tree ( TreeFeatureConfig.Builder config, RegistryKey> configuredFeatureId, Set placements, - Optional sapling + Optional sapling, + Optional pot ) { public static final List REGISTRY = new ArrayList<>(); @@ -131,6 +132,7 @@ public record Tree ( public Tree build() { RegistryKey> configuredFeatureId = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, id); + Optional sapling = saplingId.map(id -> UBlocks.register(id, saplingConstructor.apply(new SaplingGenerator(id.toString(), Optional.of(configuredFeatureId), Optional.empty(), Optional.empty()), FabricBlockSettings.copy(Blocks.OAK_SAPLING)), ItemGroups.NATURAL)); Tree tree = new Tree(id, configParameters.apply(new TreeFeatureConfig.Builder( BlockStateProvider.of(logType), trunkPlacer, @@ -139,7 +141,12 @@ public record Tree ( size.get() )), configuredFeatureId, placements.values().stream() .collect(Collectors.toUnmodifiableSet()), - saplingId.map(id -> UBlocks.register(id, saplingConstructor.apply(new SaplingGenerator(id.toString(), Optional.of(configuredFeatureId), Optional.empty(), Optional.empty()), FabricBlockSettings.copy(Blocks.OAK_SAPLING)), ItemGroups.NATURAL))); + sapling, + sapling.map(saplingBlock -> { + Block flowerPot = Registry.register(Registries.BLOCK, saplingId.get().withPrefixedPath("potted_"), Blocks.createFlowerPotBlock(saplingBlock)); + UBlocks.TRANSLUCENT_BLOCKS.add(flowerPot); + return flowerPot; + })); if (REGISTRY.isEmpty()) { bootstrap(); 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 7ad5aa26..143db033 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/UTreeGen.java @@ -48,7 +48,7 @@ public interface UTreeGen { Tree SWEET_APPLE_TREE = createAppleTree("sweet_apple", UBlocks.SWEET_APPLE_LEAVES, 3, 0.1F) .placement("orchard", 6, 0.1F, 3, BiomeSelectors.includeByKey(UWorldGen.SWEET_APPLE_ORCHARD)) .build(); - Tree SOUR_APPLE_TREE = createAppleTree("sour_apple", UBlocks.SOUR_APPLE_LEAVES, 5, 0.2F).build(); + Tree SOUR_APPLE_TREE = createAppleTree("sour_apple", UBlocks.SOUR_APPLE_LEAVES, 3, 0.2F).build(); Tree GOLDEN_APPLE_TREE = Tree.Builder.create(Unicopia.id("golden_oak_tree"), new StraightTrunkPlacer(6, 1, 3), new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(0), 3) diff --git a/src/main/resources/assets/unicopia/blockstates/potted_golden_oak_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_golden_oak_sapling.json new file mode 100644 index 00000000..0ceb8e14 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_golden_oak_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_golden_oak_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/potted_green_apple_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_green_apple_sapling.json new file mode 100644 index 00000000..69b2a3ca --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_green_apple_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_green_apple_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/potted_mango_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_mango_sapling.json new file mode 100644 index 00000000..427a7b7c --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_mango_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_mango_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/potted_palm_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_palm_sapling.json new file mode 100644 index 00000000..b73dcef1 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_palm_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_palm_sapling" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/potted_sour_apple_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_sour_apple_sapling.json new file mode 100644 index 00000000..00aa2145 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_sour_apple_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_sour_apple_sapling" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/potted_sweet_apple_sapling.json b/src/main/resources/assets/unicopia/blockstates/potted_sweet_apple_sapling.json new file mode 100644 index 00000000..b8106136 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_sweet_apple_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_sweet_apple_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/potted_zapling.json b/src/main/resources/assets/unicopia/blockstates/potted_zapling.json new file mode 100644 index 00000000..8e6fa653 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/potted_zapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/potted_zapling" + } + } +} \ 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 b0c81599..525c448b 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -228,6 +228,7 @@ "block.unicopia.spectral_fire": "Spectral Fire", "block.unicopia.bananas": "Bananas", "block.unicopia.zapling": "Zapling", + "block.unicopia.potted_zapling": "Potted Zapling", "block.unicopia.zap_log": "Zap Apple Log", "block.unicopia.zap_wood": "Zap Apple Wood", "block.unicopia.stripped_zap_log": "Stripped Zap Apple Log", @@ -251,6 +252,7 @@ "block.unicopia.zap_apple": "Zap Apple", "block.unicopia.zap_bulb": "Unripened Zap Apple", "block.unicopia.palm_sapling": "Palm Sapling", + "block.unicopia.potted_palm_sapling": "Potted Palm Sapling", "block.unicopia.palm_log": "Palm Log", "block.unicopia.palm_wood": "Palm Wood", "block.unicopia.palm_planks": "Palm Planks", @@ -273,11 +275,13 @@ "block.unicopia.gold_root": "Gold Root", "block.unicopia.golden_oak_sprout": "Golden Oak Sprout", "block.unicopia.golden_oak_sapling": "Golden Oak Sapling", + "block.unicopia.potted_golden_oak_sapling": "Potted 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", + "block.unicopia.potted_mango_sapling": "Potted Mango Sapling", "block.unicopia.pineapple": "Pineapple Plant", "block.unicopia.clam_shell": "Clam Shell", @@ -286,12 +290,15 @@ "block.unicopia.green_apple_leaves": "Granny Smith Leaves", "block.unicopia.green_apple_sapling": "Granny Smith Sapling", + "block.unicopia.potted_green_apple_sapling": "Potted Granny Smith Sapling", "block.unicopia.green_apple_sprout": "Granny Smith Sprout", "block.unicopia.sweet_apple_leaves": "Sweet Apple Leaves", "block.unicopia.sweet_apple_sapling": "Sweet Apple Sapling", + "block.unicopia.potted_sweet_apple_sapling": "Potted 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.potted_sour_apple_sapling": "Potted Sour Apple Sapling", "block.unicopia.sour_apple_sprout": "Sour Apple Sprout", "block.unicopia.surface_chitin": "Surface Chitin", diff --git a/src/main/resources/assets/unicopia/lang/zh_cn.json b/src/main/resources/assets/unicopia/lang/zh_cn.json index f15eb241..295bfc97 100644 --- a/src/main/resources/assets/unicopia/lang/zh_cn.json +++ b/src/main/resources/assets/unicopia/lang/zh_cn.json @@ -301,11 +301,11 @@ "block.unicopia.chitin": "几丁质块", "block.unicopia.chitin_spikes": "几丁质尖刺", "block.unicopia.chiselled_chitin": "雕纹几丁质块", - "block.unicopia.chiselled_chitin_hull": "雕纹几丁质船体", + "block.unicopia.chiselled_chitin_hull": "雕纹几丁质壁", "block.unicopia.chiselled_chitin_slab": "雕纹几丁质台阶", "block.unicopia.chiselled_chitin_stairs": "雕纹几丁质楼梯", - "block.unicopia.shaping_bench": "塑形长椅", + "block.unicopia.shaping_bench": "塑形台", "block.unicopia.cloud": "浮云", "block.unicopia.cloud_slab": "云台阶", "block.unicopia.cloud_stairs": "云楼梯", @@ -382,7 +382,7 @@ "effect.unicopia.change_race_hippogriff": "转生骏鹰", "effect.unicopia.morph_race_earth": "变身陆马", - "effect.unicopia.morph_race_unicopia": "变身独角兽", + "effect.unicopia.morph_race_unicorn": "变身独角兽", "effect.unicopia.morph_race_pegasus": "变身天马", "effect.unicopia.morph_race_changeling": "变身幻形灵", "effect.unicopia.morph_race_bat": "变身夜骐", @@ -617,6 +617,7 @@ "tag.unicopia.food_types.desserts": "甜品", "tag.unicopia.food_types.fruits_and_vegetables": "水果和蔬菜", "tag.unicopia.food_types.drinks": "饮品", + "tag.minecraft.leaves": "叶子", "tag.unicopia.food_types.forage_edible_filling": "大型植物料", "tag.unicopia.food_types.forage_edible": "植物料", diff --git a/src/main/resources/assets/unicopia/models/block/potted_golden_oak_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_golden_oak_sapling.json new file mode 100644 index 00000000..3423faef --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_golden_oak_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/golden_oak_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_green_apple_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_green_apple_sapling.json new file mode 100644 index 00000000..b2d76a3a --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_green_apple_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/green_apple_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_mango_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_mango_sapling.json new file mode 100644 index 00000000..c076b71d --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_mango_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/mango_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_palm_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_palm_sapling.json new file mode 100644 index 00000000..37ca7b25 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_palm_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/palm_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_sour_apple_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_sour_apple_sapling.json new file mode 100644 index 00000000..6a5cd19e --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_sour_apple_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/sour_apple_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_sweet_apple_sapling.json b/src/main/resources/assets/unicopia/models/block/potted_sweet_apple_sapling.json new file mode 100644 index 00000000..84f2327a --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_sweet_apple_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/sweet_apple_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/block/potted_zapling.json b/src/main/resources/assets/unicopia/models/block/potted_zapling.json new file mode 100644 index 00000000..24cd445e --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/potted_zapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "unicopia:item/zapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/blue_butterfly.json b/src/main/resources/assets/unicopia/models/item/blue_butterfly.json new file mode 100644 index 00000000..5006b4ce --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/blue_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/blue_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/brimstone_butterfly.json b/src/main/resources/assets/unicopia/models/item/brimstone_butterfly.json new file mode 100644 index 00000000..264d61b3 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/brimstone_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/brimstone_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/butterfly.json b/src/main/resources/assets/unicopia/models/item/butterfly.json index 9ec18ca8..875fa092 100644 --- a/src/main/resources/assets/unicopia/models/item/butterfly.json +++ b/src/main/resources/assets/unicopia/models/item/butterfly.json @@ -2,5 +2,21 @@ "parent": "unicopia:item/mug", "textures": { "layer0": "unicopia:item/butterfly" - } + }, + "overrides": [ + { "predicate": { "variant": 0.0666666666}, "model": "unicopia:item/yellow_butterfly" }, + { "predicate": { "variant": 0.1333333333}, "model": "unicopia:item/lime_butterfly" }, + { "predicate": { "variant": 0.2}, "model": "unicopia:item/red_butterfly" }, + { "predicate": { "variant": 0.2666666666}, "model": "unicopia:item/green_butterfly" }, + { "predicate": { "variant": 0.3333333333}, "model": "unicopia:item/blue_butterfly" }, + { "predicate": { "variant": 0.4}, "model": "unicopia:item/purple_butterfly" }, + { "predicate": { "variant": 0.4666666666}, "model": "unicopia:item/magenta_butterfly" }, + { "predicate": { "variant": 0.5333333333}, "model": "unicopia:item/pink_butterfly" }, + { "predicate": { "variant": 0.6}, "model": "unicopia:item/hedylidae_butterfly" }, + { "predicate": { "variant": 0.6666666666}, "model": "unicopia:item/lycaenidae_butterfly" }, + { "predicate": { "variant": 0.7333333333}, "model": "unicopia:item/nymphalidae_butterfly" }, + { "predicate": { "variant": 0.8}, "model": "unicopia:item/monarch_butterfly" }, + { "predicate": { "variant": 0.8666666666}, "model": "unicopia:item/white_monarch_butterfly" }, + { "predicate": { "variant": 0.9333333333}, "model": "unicopia:item/brimstone_butterfly" } + ] } diff --git a/src/main/resources/assets/unicopia/models/item/green_butterfly.json b/src/main/resources/assets/unicopia/models/item/green_butterfly.json new file mode 100644 index 00000000..f79317d9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/green_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/green_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/hedylidae_butterfly.json b/src/main/resources/assets/unicopia/models/item/hedylidae_butterfly.json new file mode 100644 index 00000000..5151d763 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/hedylidae_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/hedylidae_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/lime_butterfly.json b/src/main/resources/assets/unicopia/models/item/lime_butterfly.json new file mode 100644 index 00000000..bbb36011 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/lime_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/lime_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/lycaenidae_butterfly.json b/src/main/resources/assets/unicopia/models/item/lycaenidae_butterfly.json new file mode 100644 index 00000000..e0457136 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/lycaenidae_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/lycaenidae_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/magenta_butterfly.json b/src/main/resources/assets/unicopia/models/item/magenta_butterfly.json new file mode 100644 index 00000000..dfe6072c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/magenta_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/magenta_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/monarch_butterfly.json b/src/main/resources/assets/unicopia/models/item/monarch_butterfly.json new file mode 100644 index 00000000..895dcb56 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/monarch_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/monarch_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/nymphalidae_butterfly.json b/src/main/resources/assets/unicopia/models/item/nymphalidae_butterfly.json new file mode 100644 index 00000000..46a1dde2 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/nymphalidae_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/nymphalidae_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/pink_butterfly.json b/src/main/resources/assets/unicopia/models/item/pink_butterfly.json new file mode 100644 index 00000000..2093f6b6 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/pink_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/pink_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/purple_butterfly.json b/src/main/resources/assets/unicopia/models/item/purple_butterfly.json new file mode 100644 index 00000000..fc5a8214 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/purple_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/purple_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/red_butterfly.json b/src/main/resources/assets/unicopia/models/item/red_butterfly.json new file mode 100644 index 00000000..df49e71e --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/red_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/red_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/white_monarch_butterfly.json b/src/main/resources/assets/unicopia/models/item/white_monarch_butterfly.json new file mode 100644 index 00000000..e89aa594 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/white_monarch_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/white_monarch_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/yellow_butterfly.json b/src/main/resources/assets/unicopia/models/item/yellow_butterfly.json new file mode 100644 index 00000000..c4d12496 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/yellow_butterfly.json @@ -0,0 +1,6 @@ +{ + "parent": "unicopia:item/mug", + "textures": { + "layer0": "unicopia:item/yellow_butterfly" + } +} diff --git a/src/main/resources/assets/unicopia/textures/item/blue_butterfly.png b/src/main/resources/assets/unicopia/textures/item/blue_butterfly.png new file mode 100644 index 00000000..ab4ea1eb Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/blue_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/brimstone_butterfly.png b/src/main/resources/assets/unicopia/textures/item/brimstone_butterfly.png new file mode 100644 index 00000000..f11ea99e Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/brimstone_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/butterfly.png b/src/main/resources/assets/unicopia/textures/item/butterfly.png index 35e5ebd6..fad1ac6d 100644 Binary files a/src/main/resources/assets/unicopia/textures/item/butterfly.png and b/src/main/resources/assets/unicopia/textures/item/butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/green_butterfly.png b/src/main/resources/assets/unicopia/textures/item/green_butterfly.png new file mode 100644 index 00000000..b645ccac Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/green_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/hedylidae_butterfly.png b/src/main/resources/assets/unicopia/textures/item/hedylidae_butterfly.png new file mode 100644 index 00000000..843ece55 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/hedylidae_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/lime_butterfly.png b/src/main/resources/assets/unicopia/textures/item/lime_butterfly.png new file mode 100644 index 00000000..efe12901 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/lime_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/lycaenidae_butterfly.png b/src/main/resources/assets/unicopia/textures/item/lycaenidae_butterfly.png new file mode 100644 index 00000000..81e81ee6 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/lycaenidae_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/magenta_butterfly.png b/src/main/resources/assets/unicopia/textures/item/magenta_butterfly.png new file mode 100644 index 00000000..d8df366a Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/magenta_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/monarch_butterfly.png b/src/main/resources/assets/unicopia/textures/item/monarch_butterfly.png new file mode 100644 index 00000000..1c7c4862 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/monarch_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/nymphalidae_butterfly.png b/src/main/resources/assets/unicopia/textures/item/nymphalidae_butterfly.png new file mode 100644 index 00000000..75365550 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/nymphalidae_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/pink_butterfly.png b/src/main/resources/assets/unicopia/textures/item/pink_butterfly.png new file mode 100644 index 00000000..384ee2d5 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/pink_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/purple_butterfly.png b/src/main/resources/assets/unicopia/textures/item/purple_butterfly.png new file mode 100644 index 00000000..79c5c4ed Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/purple_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/red_butterfly.png b/src/main/resources/assets/unicopia/textures/item/red_butterfly.png new file mode 100644 index 00000000..ff07e69b Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/red_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/white_monarch_butterfly.png b/src/main/resources/assets/unicopia/textures/item/white_monarch_butterfly.png new file mode 100644 index 00000000..62a868cf Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/white_monarch_butterfly.png differ diff --git a/src/main/resources/assets/unicopia/textures/item/yellow_butterfly.png b/src/main/resources/assets/unicopia/textures/item/yellow_butterfly.png new file mode 100644 index 00000000..e27c9875 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/item/yellow_butterfly.png differ diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_golden_oak_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_golden_oak_sapling.json new file mode 100644 index 00000000..514f8e3a --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_golden_oak_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:golden_oak_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_green_apple_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_green_apple_sapling.json new file mode 100644 index 00000000..a648cbaf --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_green_apple_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:green_apple_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_mango_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_mango_sapling.json new file mode 100644 index 00000000..72ffe675 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_mango_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:mango_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_palm_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_palm_sapling.json new file mode 100644 index 00000000..8428fcdc --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_palm_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:palm_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_sour_apple_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_sour_apple_sapling.json new file mode 100644 index 00000000..6e5b7e92 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_sour_apple_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:sour_apple_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_sweet_apple_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_sweet_apple_sapling.json new file mode 100644 index 00000000..bc6aff30 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_sweet_apple_sapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:sweet_apple_sapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/potted_zapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/potted_zapling.json new file mode 100644 index 00000000..a93849c6 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/potted_zapling.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:zapling" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "minecraft:blocks/potted_dead_bush" +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json b/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json new file mode 100644 index 00000000..3945bf2f --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/slime_pustule.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:slime_pustule" + } + ], + "conditions": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "block": "unicopia:slime_pustule", + "condition": "minecraft:block_state_property", + "properties": { + "shape": "pod" + } + }, + { + "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 + } + } + ] + } + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file