From adf81b9b51f2cfdcd91c8dcad163a9dc9e65d003 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 8 Oct 2024 23:07:50 +0100 Subject: [PATCH 1/7] Fixed snow gathering on clouds / clouds blocking snow from gathering below them --- .../java/com/minelittlepony/unicopia/block/UBlocks.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index 521281ac..70de855b 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -197,7 +197,7 @@ public interface UBlocks { Block SLIME_PUSTULE = register("slime_pustule", new SlimePustuleBlock(Settings.copy(Blocks.SLIME_BLOCK)), ItemGroups.NATURAL); Block SHAPING_BENCH = register("shaping_bench", new ShapingBenchBlock(Settings.create().mapColor(MapColor.OFF_WHITE).hardness(0.3F).resistance(0).sounds(BlockSoundGroup.WOOL)), ItemGroups.FUNCTIONAL); - Block CLOUD = register("cloud", new NaturalCloudBlock(Settings.create().mapColor(MapColor.OFF_WHITE).hardness(0.3F).resistance(0).sounds(BlockSoundGroup.WOOL), true, + Block CLOUD = register("cloud", new NaturalCloudBlock(Settings.create().notSolid().mapColor(MapColor.OFF_WHITE).hardness(0.3F).resistance(0).sounds(BlockSoundGroup.WOOL), true, () -> UBlocks.SOGGY_CLOUD, () -> UBlocks.COMPACTED_CLOUD), ItemGroups.NATURAL); Block COMPACTED_CLOUD = register("compacted_cloud", new CompactedCloudBlock(CLOUD.getDefaultState())); @@ -216,14 +216,14 @@ public interface UBlocks { () -> UBlocks.COMPACTED_CLOUD_BRICKS), ItemGroups.BUILDING_BLOCKS); Block COMPACTED_CLOUD_BRICKS = register("compacted_cloud_bricks", new CompactedCloudBlock(CLOUD_BRICKS.getDefaultState())); Block CLOUD_BRICK_SLAB = register("cloud_brick_slab", new CloudSlabBlock(Settings.copy(CLOUD_BRICKS), false, null), ItemGroups.BUILDING_BLOCKS); - Block CLOUD_BRICK_STAIRS = register("cloud_brick_stairs", new CloudStairsBlock(CLOUD_BRICKS.getDefaultState(), Settings.copy(CLOUD_PLANKS)), ItemGroups.BUILDING_BLOCKS); + Block CLOUD_BRICK_STAIRS = register("cloud_brick_stairs", new CloudStairsBlock(CLOUD_BRICKS.getDefaultState(), Settings.copy(CLOUD_BRICKS)), ItemGroups.BUILDING_BLOCKS); Block ETCHED_CLOUD = register("etched_cloud", new NaturalCloudBlock(Settings.copy(CLOUD_BRICKS), false, null, () -> UBlocks.COMPACTED_CLOUD_BRICKS), ItemGroups.BUILDING_BLOCKS); Block COMPACTED_ETCHED_CLOUD = register("compacted_etched_cloud", new CompactedCloudBlock(ETCHED_CLOUD.getDefaultState())); Block ETCHED_CLOUD_SLAB = register("etched_cloud_slab", new CloudSlabBlock(Settings.copy(ETCHED_CLOUD), false, null), ItemGroups.BUILDING_BLOCKS); - Block ETCHED_CLOUD_STAIRS = register("etched_cloud_stairs", new CloudStairsBlock(ETCHED_CLOUD.getDefaultState(), Settings.copy(CLOUD_PLANKS)), ItemGroups.BUILDING_BLOCKS); + Block ETCHED_CLOUD_STAIRS = register("etched_cloud_stairs", new CloudStairsBlock(ETCHED_CLOUD.getDefaultState(), Settings.copy(ETCHED_CLOUD)), ItemGroups.BUILDING_BLOCKS); SoggyCloudBlock SOGGY_CLOUD = register("soggy_cloud", new SoggyCloudBlock(Settings.copy(CLOUD).hardness(0.7F), () -> UBlocks.CLOUD)); SoggyCloudSlabBlock SOGGY_CLOUD_SLAB = register("soggy_cloud_slab", new SoggyCloudSlabBlock(Settings.copy(SOGGY_CLOUD), () -> UBlocks.CLOUD_SLAB)); From 83048f2a6b087385728be96ca9b744aa98a6b881 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 9 Oct 2024 00:01:25 +0100 Subject: [PATCH 2/7] Remove debug logging --- .../java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java index 6381eda2..6a4adb14 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/cloud/CloudBlock.java @@ -174,7 +174,6 @@ public class CloudBlock extends Block implements CloudLike { @Override @Deprecated public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) { - System.out.println(InteractionManager.getInstance().getPathingEquineContext().collidesWithClouds()); return type != NavigationType.LAND || !InteractionManager.getInstance().getPathingEquineContext().collidesWithClouds(); } From 7ecf4b136790bab03eece3b1a67b2548b30129d6 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 10 Oct 2024 18:04:05 +0100 Subject: [PATCH 3/7] Fix sweet apple acres advancement --- .../datagen/providers/UAdvancementsProvider.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java index de390bfb..394516f9 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.datagen.providers; +import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Consumer; @@ -95,7 +96,7 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { parent.child(UItems.TOAST).criterion("has_toast", hasItems(UItems.TOAST)).build(consumer, "toast") .child(UItems.BURNED_TOAST).hidden().criterion("has_burned_toast", hasItems(UItems.BURNED_TOAST)).build(consumer, "burn_toast"); parent.child(UItems.GREEN_APPLE).criterion("has_apple", hasItems(UTags.Items.FRESH_APPLES)).build(consumer, "apple_route").children(p -> { - p.child(UItems.SWEET_APPLE).criterion("has_all_apples", hasItems(Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE, UItems.ROTTEN_APPLE, UItems.ZAP_APPLE, UItems.COOKED_ZAP_APPLE, Items.GOLDEN_APPLE)).build(consumer, "sweet_apple_acres"); + requireAllItems(p.child(UItems.SWEET_APPLE), Items.APPLE, UItems.GREEN_APPLE, UItems.SWEET_APPLE, UItems.SOUR_APPLE, UItems.ROTTEN_APPLE, UItems.ZAP_APPLE, UItems.COOKED_ZAP_APPLE, Items.GOLDEN_APPLE).build(consumer, "sweet_apple_acres"); p.child(UItems.ZAP_BULB).criterion("has_zap_apple", hasItems(UItems.ZAP_APPLE)).build(consumer, "trick_apple").children(pp -> { pp.child(UItems.ZAP_APPLE).hidden().criterion("eat_trick_apple", CustomEventCriterion.createFlying("eat_trick_apple")).build(consumer, "eat_trick_apple"); pp.child(UItems.ZAP_APPLE).hidden().criterion("feed_trick_apple", CustomEventCriterion.createFlying("feed_trick_apple")).build(consumer, "feed_trick_apple"); @@ -130,6 +131,13 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 2048, 10000)).frame(AdvancementFrame.GOAL).build(consumer, "dedicated_flier"); } + private AdvancementDisplayBuilder requireAllItems(AdvancementDisplayBuilder builder, ItemConvertible...items) { + List.of(items).forEach(item -> { + builder.criterion("has_" + Registries.ITEM.getId(item.asItem()).getPath(), hasItems(item)); + }); + return builder.criteriaMerger(CriterionMerger.AND); + } + private AdvancementDisplayBuilder applyShedFeatherCriterions(AdvancementDisplayBuilder builder, int repeats, int experience) { for (int i = 1; i <= repeats; i++) { builder.criterion("shed_feather_" + i, CustomEventCriterion.createFlying("shed_feather", i)); From 93299feae6b0be01c1393070bdb9cb225d39a352 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 14 Oct 2024 18:45:49 +0100 Subject: [PATCH 4/7] Fixed the trick apple recipes # Conflicts: # src/main/java/com/minelittlepony/unicopia/datagen/providers/recipe/TrickCraftingRecipeJsonBuilder.java # src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java --- .../com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java b/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java index a92b956a..6ed7528c 100644 --- a/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java +++ b/src/main/java/com/minelittlepony/unicopia/recipe/ZapAppleRecipe.java @@ -8,6 +8,7 @@ import com.minelittlepony.unicopia.item.UItems; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.Ingredient; +import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.ShapelessRecipe; import net.minecraft.recipe.book.CraftingRecipeCategory; import net.minecraft.util.Identifier; @@ -21,6 +22,11 @@ public class ZapAppleRecipe extends ShapelessRecipe { super(id, group, category, output, input); } + @Override + public RecipeSerializer getSerializer() { + return URecipes.ZAP_APPLE_SERIALIZER; + } + public static class Serializer extends ShapelessRecipe.Serializer { @Override public ShapelessRecipe read(Identifier identifier, JsonObject json) { From fd65e7db174862b0d2ee3295fd594af4d49a44b9 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 12 Oct 2024 21:23:59 +0100 Subject: [PATCH 5/7] Change early molting season advancements to regular tasks Closes #483 --- .../datagen/providers/UAdvancementsProvider.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java index 394516f9..4b1760fa 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java @@ -117,17 +117,17 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(Race.CHANGELING), Set.of()), 10, 90)).build(consumer, "lightning_bug"); p.child(UItems.LIGHTNING_JAR).hidden().frame(AdvancementFrame.CHALLENGE).apply(d -> applyLightningBugCriterions(d, RacePredicate.of(Set.of(), Set.of(Race.CHANGELING)), 10, 90)).build(consumer, "wonder_bolt"); }); - parent.child(UItems.PEGASUS_FEATHER).hidden().frame(AdvancementFrame.CHALLENGE).criterion("shed_feather", CustomEventCriterion.createFlying("shed_feather")).rewards(AdvancementRewards.Builder.experience(1)).build(consumer, "molting_season_1") + parent.child(UItems.PEGASUS_FEATHER).hidden().frame(AdvancementFrame.TASK).criterion("shed_feather", CustomEventCriterion.createFlying("shed_feather")).rewards(AdvancementRewards.Builder.experience(1)).build(consumer, "molting_season_1") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 2, 2)).build(consumer, "molting_season_2") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 4, 8)).build(consumer, "molting_season_3") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 8, 20)).build(consumer, "molting_season_4") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 16, 40)).build(consumer, "molting_season_5") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 32, 80)).build(consumer, "molting_season_6") .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 64, 200)).build(consumer, "molting_season_7") - .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 128, 500)).build(consumer, "molting_season_8") - .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 256, 1000)).build(consumer, "molting_season_9") - .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 512, 2280)).build(consumer, "molting_season_10") - .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 1024, 4560)).build(consumer, "molting_season_11") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 128, 500)).frame(AdvancementFrame.CHALLENGE).build(consumer, "molting_season_8") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 256, 1000)).frame(AdvancementFrame.CHALLENGE).build(consumer, "molting_season_9") + .child(UItems.PEGASUS_FEATHER).apply(d -> applyShedFeatherCriterions(d, 512, 2280)).frame(AdvancementFrame.CHALLENGE).build(consumer, "molting_season_10") + .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 1024, 4560)).frame(AdvancementFrame.CHALLENGE).build(consumer, "molting_season_11") .child(UItems.GOLDEN_FEATHER).apply(d -> applyShedFeatherCriterions(d, 2048, 10000)).frame(AdvancementFrame.GOAL).build(consumer, "dedicated_flier"); } From a43f5d2022b3cb2b19725beb2b1f3513b4fc19de Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 12 Oct 2024 21:44:46 +0100 Subject: [PATCH 6/7] Fix carver crash #490 --- .../unicopia/server/world/gen/CloudCarver.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/gen/CloudCarver.java b/src/main/java/com/minelittlepony/unicopia/server/world/gen/CloudCarver.java index 41736d0d..f92abb9a 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/gen/CloudCarver.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/gen/CloudCarver.java @@ -167,7 +167,10 @@ public class CloudCarver extends CaveCarver { MutableBoolean replacedGrassy ) { if (super.carveAtPoint(context, config, chunk, posToBiome, mask, pos, tmp, aquiferSampler, replacedGrassy)) { - topWrittenPositions.remove(tmp.set(pos).move(Direction.DOWN).asLong()); + tmp.set(pos).move(Direction.DOWN); + if (!topWrittenPositions.isEmpty()) { + topWrittenPositions.remove(tmp.asLong()); + } topWrittenPositions.add(pos.asLong()); if (chunk.getBlockState(tmp).isOf(UBlocks.SOGGY_CLOUD)) { chunk.setBlockState(tmp, UBlocks.CLOUD.getDefaultState(), false); From 895a7bff604e09e02be96d936ac1c976dae8bf83 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 13 Oct 2024 18:18:50 +0100 Subject: [PATCH 7/7] Change criterion check to an OR for tribe joins # Conflicts: # src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java --- .../unicopia/datagen/providers/UAdvancementsProvider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java index 4b1760fa..42352276 100644 --- a/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java +++ b/src/main/java/com/minelittlepony/unicopia/datagen/providers/UAdvancementsProvider.java @@ -67,6 +67,7 @@ public class UAdvancementsProvider extends FabricAdvancementProvider { for (Race r : extra) { builder.criterion("be_" + r.getId().getPath(), new RaceChangeCriterion.Conditions(LootContextPredicate.EMPTY, r)); } + builder.criteriaMerger(CriterionMerger.OR); } return builder.build(consumer, race.getId().getPath() + "_route");