From 7e3ec28d0dd075b0eff5e1c21e45450f02571916 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Tue, 18 Apr 2023 01:28:32 +0200 Subject: [PATCH] Port to 1.19.3 [build] [publish] --- changelog.md | 1 + gradle.properties | 10 ++++----- gradle/curseforge.gradle | 2 +- ... 57d5777fd2b2e3e2d3a9bf81b29e44ed8cdd2e32} | 2 +- .../735031f3addf80804addae5e3f53249900116f1e | 2 +- .../83a57a3b11e7a1a7fc4fb05f27595187ce2e309a | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 ++-- .../c622617f6fabf890a00b9275cd5f643584a8a2c8 | 2 +- .../chowderexpress/recipes/soup_cart.json | 1 + .../chowderexpress/ChowderExpress.java | 18 ++++++++++++++-- .../client/renderer/SoupCartRenderer.java | 10 ++++----- .../chowderexpress/data/CartDatagen.java | 19 ++++++++++++----- .../data/client/CartItemModelProvider.java | 5 +++-- .../data/client/CartLanguageProvider.java | 5 +++-- .../data/client/CartSoundProvider.java | 5 +++-- .../data/server/CartBlockTagProvider.java | 21 +++++++++++++++++++ .../data/server/CartItemTagProvider.java | 16 +++++++++----- .../data/server/CartRecipes.java | 11 +++++----- .../chowderexpress/entity/SoupCart.java | 17 +++++++++------ .../chowderexpress/registry/CartRegistry.java | 10 ++++----- src/main/resources/META-INF/mods.toml | 4 ++-- src/main/resources/pack.mcmeta | 14 ++++++------- 22 files changed, 120 insertions(+), 61 deletions(-) rename src/generated/resources/.cache/{03e4de26f1265135874f8cdcaebc09d9c08eb42b => 57d5777fd2b2e3e2d3a9bf81b29e44ed8cdd2e32} (50%) create mode 100644 src/main/java/com/mrbysco/chowderexpress/data/server/CartBlockTagProvider.java diff --git a/changelog.md b/changelog.md index e69de29..4b30622 100644 --- a/changelog.md +++ b/changelog.md @@ -0,0 +1 @@ +* Initial update to 1.19.3 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 4ac2b0b..fbf5907 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # Base info -mc_version=1.19.2 -forge_version=43.2.8 +mc_version=1.19.3 +forge_version=44.1.23 mcp_channel=official -mcp_mappings=1.19.2 +mcp_mappings=1.19.3 #Publishing mod_name=Chowder Express @@ -15,7 +15,7 @@ curseforge_id=783410 modrinth_id=CcY0wAVw # Version -version=1.1.0 +version=1.2.0 # Dependencies -jei_version=11.6.0.1013 \ No newline at end of file +jei_version=12.4.0.22 \ No newline at end of file diff --git a/gradle/curseforge.gradle b/gradle/curseforge.gradle index 8d62907..9785ce3 100644 --- a/gradle/curseforge.gradle +++ b/gradle/curseforge.gradle @@ -5,7 +5,7 @@ if (System.getenv().CURSEFORGE_KEY) { apiKey = System.getenv().CURSEFORGE_KEY project { id = project.curseforge_id - releaseType = "release" + releaseType = "beta" addGameVersion "Forge" addGameVersion "${mc_version}" addGameVersion "Java 17" diff --git a/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b b/src/generated/resources/.cache/57d5777fd2b2e3e2d3a9bf81b29e44ed8cdd2e32 similarity index 50% rename from src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b rename to src/generated/resources/.cache/57d5777fd2b2e3e2d3a9bf81b29e44ed8cdd2e32 index 2ed90f9..a286e74 100644 --- a/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b +++ b/src/generated/resources/.cache/57d5777fd2b2e3e2d3a9bf81b29e44ed8cdd2e32 @@ -1,2 +1,2 @@ -// 1.19.2 2023-01-04T02:59:55.3337736 Tags for minecraft:item +// 1.19.3 2023-04-18T01:11:03.260432 Tags for minecraft:item mod id chowderexpress 953a2d84283eb74fab164e4f15b3e025b4969366 data/chowderexpress/tags/items/soups.json diff --git a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e index dbc5a3a..ee51c85 100644 --- a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e +++ b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e @@ -1,2 +1,2 @@ -// 1.19.2 2023-01-03T01:40:56.5500115 Sound Definitions +// 1.19.3 2023-04-18T01:11:03.262435 Sound Definitions 45ca0a31bdc571cd49597904ef98727e71f3f745 assets/chowderexpress/sounds.json diff --git a/src/generated/resources/.cache/83a57a3b11e7a1a7fc4fb05f27595187ce2e309a b/src/generated/resources/.cache/83a57a3b11e7a1a7fc4fb05f27595187ce2e309a index 14c0e0a..c0fd1d0 100644 --- a/src/generated/resources/.cache/83a57a3b11e7a1a7fc4fb05f27595187ce2e309a +++ b/src/generated/resources/.cache/83a57a3b11e7a1a7fc4fb05f27595187ce2e309a @@ -1,2 +1,2 @@ -// 1.19.2 2022-12-29T23:27:23.1716271 Item Models: chowderexpress +// 1.19.3 2023-04-18T01:11:03.258932 Item Models: chowderexpress 6890e612ff24d2d617b406b23b447c50fa99328b assets/chowderexpress/models/item/soup_cart.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index c63670c..526d864 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,3 +1,3 @@ -// 1.19.2 2022-12-29T23:29:19.5698324 Recipes +// 1.19.3 2023-04-18T01:11:03.2599322 Recipes 87697b9ff626777c081797471122ff69ff48481b data/chowderexpress/advancements/recipes/transportation/soup_cart.json -c66bb42b33e84b32e7148cff2d6c8686b669d3a3 data/chowderexpress/recipes/soup_cart.json +0c7d883f64cfaac177d4bdb70b2048282692ba1f data/chowderexpress/recipes/soup_cart.json diff --git a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index c1a2b91..0e02107 100644 --- a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.19.2 2023-01-03T01:40:56.5485107 Languages: en_us +// 1.19.3 2023-04-18T01:11:03.2619605 Languages: en_us 63b8ca789489a584e633ade76911ec515a7315a7 assets/chowderexpress/lang/en_us.json diff --git a/src/generated/resources/data/chowderexpress/recipes/soup_cart.json b/src/generated/resources/data/chowderexpress/recipes/soup_cart.json index 9f72a68..1d9c5dc 100644 --- a/src/generated/resources/data/chowderexpress/recipes/soup_cart.json +++ b/src/generated/resources/data/chowderexpress/recipes/soup_cart.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shapeless", + "category": "misc", "ingredients": [ { "item": "minecraft:minecart" diff --git a/src/main/java/com/mrbysco/chowderexpress/ChowderExpress.java b/src/main/java/com/mrbysco/chowderexpress/ChowderExpress.java index 113e48b..761910f 100644 --- a/src/main/java/com/mrbysco/chowderexpress/ChowderExpress.java +++ b/src/main/java/com/mrbysco/chowderexpress/ChowderExpress.java @@ -4,11 +4,15 @@ import com.mrbysco.chowderexpress.client.ClientHandler; import com.mrbysco.chowderexpress.registry.CartDataSerializers; import com.mrbysco.chowderexpress.registry.CartRegistry; -import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.event.CreativeModeTabEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.common.Mod; @@ -19,7 +23,7 @@ public class ChowderExpress { public static final String MOD_ID = "chowderexpress"; private static final Logger LOGGER = LogUtils.getLogger(); - public static final TagKey SOUPS = TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(ChowderExpress.MOD_ID, "soups")); + public static final TagKey SOUPS = TagKey.create(Registries.ITEM, new ResourceLocation(ChowderExpress.MOD_ID, "soups")); public ChowderExpress() { IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); @@ -29,9 +33,19 @@ public ChowderExpress() { CartRegistry.ENTITY_TYPES.register(eventBus); CartDataSerializers.ENTITY_DATA_SERIALIZER.register(eventBus); + eventBus.addListener(this::buildCreativeContents); + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { eventBus.addListener(ClientHandler::registerEntityRenders); eventBus.addListener(ClientHandler::registerLayerDefinitions); }); } + + private void buildCreativeContents(CreativeModeTabEvent.BuildContents event) { + var entries = event.getEntries(); + var visibility = CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS; + if (event.getTab() == CreativeModeTabs.TOOLS_AND_UTILITIES) { + entries.put(new ItemStack(CartRegistry.SOUP_CART_ITEM.get()), visibility); + } + } } diff --git a/src/main/java/com/mrbysco/chowderexpress/client/renderer/SoupCartRenderer.java b/src/main/java/com/mrbysco/chowderexpress/client/renderer/SoupCartRenderer.java index 51b8475..d3d10fc 100644 --- a/src/main/java/com/mrbysco/chowderexpress/client/renderer/SoupCartRenderer.java +++ b/src/main/java/com/mrbysco/chowderexpress/client/renderer/SoupCartRenderer.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; -import com.mojang.math.Vector3f; +import com.mojang.math.Axis; import com.mrbysco.chowderexpress.client.ClientHandler; import com.mrbysco.chowderexpress.client.SoupRenderTypes; import com.mrbysco.chowderexpress.client.model.SoupModel; @@ -71,8 +71,8 @@ public void render(T cart, float entityYaw, float partialTicks, PoseStack poseSt } poseStack.translate(0.0D, 0.375D, 0.0D); - poseStack.mulPose(Vector3f.YP.rotationDegrees(180.0F - entityYaw)); - poseStack.mulPose(Vector3f.ZP.rotationDegrees(-f3)); + poseStack.mulPose(Axis.YP.rotationDegrees(180.0F - entityYaw)); + poseStack.mulPose(Axis.ZP.rotationDegrees(-f3)); float f5 = (float) cart.getHurtTime() - partialTicks; float f6 = cart.getDamage() - partialTicks; if (f6 < 0.0F) { @@ -80,7 +80,7 @@ public void render(T cart, float entityYaw, float partialTicks, PoseStack poseSt } if (f5 > 0.0F) { - poseStack.mulPose(Vector3f.XP.rotationDegrees(Mth.sin(f5) * f5 * f6 / 10.0F * (float) cart.getHurtDir())); + poseStack.mulPose(Axis.XP.rotationDegrees(Mth.sin(f5) * f5 * f6 / 10.0F * (float) cart.getHurtDir())); } int j = cart.getDisplayOffset(); @@ -90,7 +90,7 @@ public void render(T cart, float entityYaw, float partialTicks, PoseStack poseSt float f4 = 0.75F; poseStack.scale(f4, f4, f4); poseStack.translate(-0.5D, (double) ((float) (j - 8) / 16.0F), 0.5D); - poseStack.mulPose(Vector3f.YP.rotationDegrees(90.0F)); + poseStack.mulPose(Axis.YP.rotationDegrees(90.0F)); this.renderMinecartContents(cart, partialTicks, blockstate, poseStack, bufferSource, packedLightIn); poseStack.popPose(); } diff --git a/src/main/java/com/mrbysco/chowderexpress/data/CartDatagen.java b/src/main/java/com/mrbysco/chowderexpress/data/CartDatagen.java index f53c066..c25b4e2 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/CartDatagen.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/CartDatagen.java @@ -3,29 +3,38 @@ import com.mrbysco.chowderexpress.data.client.CartItemModelProvider; import com.mrbysco.chowderexpress.data.client.CartLanguageProvider; import com.mrbysco.chowderexpress.data.client.CartSoundProvider; +import com.mrbysco.chowderexpress.data.server.CartBlockTagProvider; import com.mrbysco.chowderexpress.data.server.CartItemTagProvider; import com.mrbysco.chowderexpress.data.server.CartRecipes; +import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; +import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; +import java.util.concurrent.CompletableFuture; + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class CartDatagen { @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); + PackOutput packOutput = generator.getPackOutput(); + CompletableFuture lookupProvider = event.getLookupProvider(); ExistingFileHelper helper = event.getExistingFileHelper(); if (event.includeServer()) { - generator.addProvider(event.includeClient(), new CartRecipes(generator)); - generator.addProvider(event.includeServer(), new CartItemTagProvider(generator, helper)); + generator.addProvider(event.includeClient(), new CartRecipes(packOutput)); + BlockTagsProvider blockTagsProvider = new CartBlockTagProvider(packOutput, lookupProvider, helper); + generator.addProvider(event.includeServer(), new CartItemTagProvider(packOutput, lookupProvider, blockTagsProvider, helper)); } if (event.includeClient()) { - generator.addProvider(event.includeClient(), new CartLanguageProvider(generator)); - generator.addProvider(event.includeClient(), new CartItemModelProvider(generator, helper)); - generator.addProvider(event.includeClient(), new CartSoundProvider(generator, helper)); + generator.addProvider(event.includeClient(), new CartLanguageProvider(packOutput)); + generator.addProvider(event.includeClient(), new CartItemModelProvider(packOutput, helper)); + generator.addProvider(event.includeClient(), new CartSoundProvider(packOutput, helper)); } } } diff --git a/src/main/java/com/mrbysco/chowderexpress/data/client/CartItemModelProvider.java b/src/main/java/com/mrbysco/chowderexpress/data/client/CartItemModelProvider.java index f1a2c42..fc12624 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/client/CartItemModelProvider.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/client/CartItemModelProvider.java @@ -3,13 +3,14 @@ import com.mrbysco.chowderexpress.ChowderExpress; import com.mrbysco.chowderexpress.registry.CartRegistry; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; public class CartItemModelProvider extends ItemModelProvider { - public CartItemModelProvider(DataGenerator gen, ExistingFileHelper helper) { - super(gen, ChowderExpress.MOD_ID, helper); + public CartItemModelProvider(PackOutput packOutput, ExistingFileHelper helper) { + super(packOutput, ChowderExpress.MOD_ID, helper); } @Override diff --git a/src/main/java/com/mrbysco/chowderexpress/data/client/CartLanguageProvider.java b/src/main/java/com/mrbysco/chowderexpress/data/client/CartLanguageProvider.java index e28828e..f22cbcf 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/client/CartLanguageProvider.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/client/CartLanguageProvider.java @@ -3,13 +3,14 @@ import com.mrbysco.chowderexpress.ChowderExpress; import com.mrbysco.chowderexpress.registry.CartRegistry; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraft.sounds.SoundEvent; import net.minecraftforge.common.data.LanguageProvider; import net.minecraftforge.registries.RegistryObject; public class CartLanguageProvider extends LanguageProvider { - public CartLanguageProvider(DataGenerator gen) { - super(gen, ChowderExpress.MOD_ID, "en_us"); + public CartLanguageProvider(PackOutput packOutput) { + super(packOutput, ChowderExpress.MOD_ID, "en_us"); } @Override diff --git a/src/main/java/com/mrbysco/chowderexpress/data/client/CartSoundProvider.java b/src/main/java/com/mrbysco/chowderexpress/data/client/CartSoundProvider.java index 9cf1f33..6359156 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/client/CartSoundProvider.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/client/CartSoundProvider.java @@ -3,14 +3,15 @@ import com.mrbysco.chowderexpress.ChowderExpress; import com.mrbysco.chowderexpress.registry.CartRegistry; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.SoundDefinitionsProvider; public class CartSoundProvider extends SoundDefinitionsProvider { - public CartSoundProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) { - super(generator, ChowderExpress.MOD_ID, existingFileHelper); + public CartSoundProvider(PackOutput packOutput, ExistingFileHelper existingFileHelper) { + super(packOutput, ChowderExpress.MOD_ID, existingFileHelper); } @Override diff --git a/src/main/java/com/mrbysco/chowderexpress/data/server/CartBlockTagProvider.java b/src/main/java/com/mrbysco/chowderexpress/data/server/CartBlockTagProvider.java new file mode 100644 index 0000000..3355634 --- /dev/null +++ b/src/main/java/com/mrbysco/chowderexpress/data/server/CartBlockTagProvider.java @@ -0,0 +1,21 @@ +package com.mrbysco.chowderexpress.data.server; + +import com.mrbysco.chowderexpress.ChowderExpress; +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; +import net.minecraftforge.common.data.BlockTagsProvider; +import net.minecraftforge.common.data.ExistingFileHelper; +import org.jetbrains.annotations.Nullable; + +import java.util.concurrent.CompletableFuture; + +public class CartBlockTagProvider extends BlockTagsProvider { + public CartBlockTagProvider(PackOutput output, CompletableFuture lookupProvider, @Nullable ExistingFileHelper existingFileHelper) { + super(output, lookupProvider, ChowderExpress.MOD_ID, existingFileHelper); + } + + @Override + protected void addTags(HolderLookup.Provider provider) { + + } +} diff --git a/src/main/java/com/mrbysco/chowderexpress/data/server/CartItemTagProvider.java b/src/main/java/com/mrbysco/chowderexpress/data/server/CartItemTagProvider.java index fb731a1..4ec09d9 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/server/CartItemTagProvider.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/server/CartItemTagProvider.java @@ -1,20 +1,26 @@ package com.mrbysco.chowderexpress.data.server; import com.mrbysco.chowderexpress.ChowderExpress; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.tags.BlockTagsProvider; +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; import net.minecraft.data.tags.ItemTagsProvider; +import net.minecraft.data.tags.TagsProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.Block; import net.minecraftforge.common.data.ExistingFileHelper; +import java.util.concurrent.CompletableFuture; + public class CartItemTagProvider extends ItemTagsProvider { - public CartItemTagProvider(DataGenerator dataGenerator, ExistingFileHelper existingFileHelper) { - super(dataGenerator, new BlockTagsProvider(dataGenerator), ChowderExpress.MOD_ID, existingFileHelper); + + public CartItemTagProvider(PackOutput output, CompletableFuture lookupProvider, + TagsProvider blockTagProvider, ExistingFileHelper existingFileHelper) { + super(output, lookupProvider, blockTagProvider, ChowderExpress.MOD_ID, existingFileHelper); } @Override - protected void addTags() { + protected void addTags(HolderLookup.Provider lookupProvider) { this.tag(ChowderExpress.SOUPS).add(Items.BEETROOT_SOUP, Items.MUSHROOM_STEW, Items.RABBIT_STEW, Items.SUSPICIOUS_STEW); //Enhanced Farming diff --git a/src/main/java/com/mrbysco/chowderexpress/data/server/CartRecipes.java b/src/main/java/com/mrbysco/chowderexpress/data/server/CartRecipes.java index 28e90a6..4f0b30d 100644 --- a/src/main/java/com/mrbysco/chowderexpress/data/server/CartRecipes.java +++ b/src/main/java/com/mrbysco/chowderexpress/data/server/CartRecipes.java @@ -1,8 +1,9 @@ package com.mrbysco.chowderexpress.data.server; import com.mrbysco.chowderexpress.registry.CartRegistry; -import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.world.item.Items; @@ -10,13 +11,13 @@ import java.util.function.Consumer; public class CartRecipes extends RecipeProvider { - public CartRecipes(DataGenerator generator) { - super(generator); + public CartRecipes(PackOutput packOutput) { + super(packOutput); } @Override - protected void buildCraftingRecipes(Consumer recipeConsumer) { - ShapelessRecipeBuilder.shapeless(CartRegistry.SOUP_CART_ITEM.get()) + protected void buildRecipes(Consumer recipeConsumer) { + ShapelessRecipeBuilder.shapeless(RecipeCategory.TRANSPORTATION, CartRegistry.SOUP_CART_ITEM.get()) .requires(Items.MINECART).requires(Items.BOWL) .unlockedBy("has_bowl", has(Items.BOWL)) .save(recipeConsumer); diff --git a/src/main/java/com/mrbysco/chowderexpress/entity/SoupCart.java b/src/main/java/com/mrbysco/chowderexpress/entity/SoupCart.java index 88e4405..488936f 100644 --- a/src/main/java/com/mrbysco/chowderexpress/entity/SoupCart.java +++ b/src/main/java/com/mrbysco/chowderexpress/entity/SoupCart.java @@ -9,6 +9,7 @@ import net.minecraft.nbt.ListTag; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -92,8 +93,10 @@ public InteractionResult doSoupInteraction(Player player, InteractionHand hand, effects.putAll(mobEffects); } - stack.shrink(1); - player.addItem(new ItemStack(Items.BOWL)); + if (!player.getAbilities().instabuild) { + stack.shrink(1); + player.addItem(new ItemStack(Items.BOWL)); + } level.playSound(null, blockPosition(), CartRegistry.EMPTY_BOWL.get(), SoundSource.PLAYERS, 1.0F, 1.0F); return InteractionResult.SUCCESS; } @@ -101,8 +104,10 @@ public InteractionResult doSoupInteraction(Player player, InteractionHand hand, if (mobEffects.keySet().equals(effects.keySet())) { if (setSoupAmount(getSoupAmount() + 1)) { this.maybePlaySound(player); - stack.shrink(1); - player.addItem(new ItemStack(Items.BOWL)); + if (!player.getAbilities().instabuild) { + stack.shrink(1); + player.addItem(new ItemStack(Items.BOWL)); + } level.playSound(null, blockPosition(), CartRegistry.EMPTY_BOWL.get(), SoundSource.PLAYERS, 1.0F, 1.0F); return InteractionResult.SUCCESS; } @@ -129,7 +134,7 @@ public InteractionResult doSoupInteraction(Player player, InteractionHand hand, } public void maybePlaySound(Player player) { - if(random.nextDouble() <= 0.05) { + if (random.nextDouble() <= 0.05) { player.displayClientMessage(Component.literal("Mm soup"), true); level.playSound(null, blockPosition(), CartRegistry.MM_SOUP.get(), SoundSource.PLAYERS, 1.0F, 1.0F); } @@ -306,7 +311,7 @@ public Type getMinecartType() { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } } diff --git a/src/main/java/com/mrbysco/chowderexpress/registry/CartRegistry.java b/src/main/java/com/mrbysco/chowderexpress/registry/CartRegistry.java index 2a07d08..7c7f8af 100644 --- a/src/main/java/com/mrbysco/chowderexpress/registry/CartRegistry.java +++ b/src/main/java/com/mrbysco/chowderexpress/registry/CartRegistry.java @@ -7,7 +7,6 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; @@ -19,14 +18,13 @@ public class CartRegistry { public static final DeferredRegister> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, ChowderExpress.MOD_ID); public static final RegistryObject MM_SOUP = SOUND_EVENTS.register("mm_soup", () -> - new SoundEvent(new ResourceLocation(ChowderExpress.MOD_ID, "mm_soup"))); + SoundEvent.createVariableRangeEvent(new ResourceLocation(ChowderExpress.MOD_ID, "mm_soup"))); public static final RegistryObject FILL_BOWL = SOUND_EVENTS.register("fill_bowl", () -> - new SoundEvent(new ResourceLocation(ChowderExpress.MOD_ID, "fill_bowl"))); + SoundEvent.createVariableRangeEvent(new ResourceLocation(ChowderExpress.MOD_ID, "fill_bowl"))); public static final RegistryObject EMPTY_BOWL = SOUND_EVENTS.register("empty_bowl", () -> - new SoundEvent(new ResourceLocation(ChowderExpress.MOD_ID, "empty_bowl"))); + SoundEvent.createVariableRangeEvent(new ResourceLocation(ChowderExpress.MOD_ID, "empty_bowl"))); - public static final RegistryObject SOUP_CART_ITEM = ITEMS.register("soup_cart", () -> new SoupCartItem( - new Item.Properties().tab(CreativeModeTab.TAB_TRANSPORTATION))); + public static final RegistryObject SOUP_CART_ITEM = ITEMS.register("soup_cart", () -> new SoupCartItem(new Item.Properties())); public static final RegistryObject> SOUP_CART = ENTITY_TYPES.register("soup_cart", () -> EntityType.Builder.of(SoupCart::new, MobCategory.MISC) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 363a39e..ed73c5c 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[41,)" +loaderVersion="[44,)" issueTrackerURL="https://github.com/Mrbysco/ChowderExpress/issues" license="MIT" @@ -15,6 +15,6 @@ Chowder Express is a mod that allows players to fill minecarts with soup and rid [[dependencies.chowderexpress]] modId="minecraft" mandatory=true -versionRange="[1.19,1.20)" +versionRange="[1.19.3,1.20)" ordering="NONE" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index f53ac44..60ab969 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,8 +1,8 @@ { - "pack": { - "description": "Chowder Express resources", - "pack_format": 9, - "forge:resource_pack_format": 9, - "forge:data_pack_format": 10 - } -} + "pack": { + "description": "Chowder Express resources", + "pack_format": 12, + "forge:resource_pack_format": 12, + "forge:data_pack_format": 10 + } +} \ No newline at end of file