Skip to content

Commit

Permalink
update to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Minecraftschurli committed Aug 2, 2023
1 parent 1615285 commit b764318
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ repositories {

dependencies {
minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}"
compileOnly fg.deobf("mezz.jei:jei-1.19.3-common-api:${project.jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-1.19.3-forge:${project.jei_version}")
compileOnly fg.deobf("mezz.jei:jei-1.19.4-common-api:${project.jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-1.19.4-forge:${project.jei_version}")
implementation 'org.jetbrains:annotations:23.0.0'
}

Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ java_version=17
forgegradle_version=5.1.+
librarian_version=1.+

loader_version_range=[44,)
loader_version_range=[45,)

mc_version=1.19.3
mc_version_range=[1.19.3,1.20)
mc_version=1.19.4
mc_version_range=[1.19.4,1.20)

forge_version=44.1.0
forge_version_range=[44.1,)
forge_version=45.1.0
forge_version_range=[45.1,)

mappings_version=1.19.3
mappings_version=1.19.4
mappings_channel=official

jei_version=12.1.1.9
jei_version=13.1.0.9

curse_project_id=382836
modrinth_project_id=ZZLWU8jS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import net.minecraft.core.RegistryAccess;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffectInstance;
Expand Down Expand Up @@ -69,9 +70,8 @@ public boolean matches(CraftingContainer inv, @Nonnull Level world) {
return potions == this.bundle.getMaxUses() && string;
}

@Nonnull
@Override
public ItemStack assemble(CraftingContainer inv) {
public ItemStack assemble(CraftingContainer inv, RegistryAccess access) {
Potion potion = null;
List<MobEffectInstance> customEffects = null;
ItemStack string = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.github.ichhabehunger54.potionbundles;

import com.mojang.datafixers.util.Pair;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.core.RegistryAccess;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -64,13 +68,19 @@ private static void addBundlesForAllPotions(CreativeModeTabEvent.BuildContents p

@Nonnull
private static ItemStack getStringFromRecipe(@Nonnull AbstractPotionBundle bundle) {
RecipeManager recipeManager = DistExecutor.unsafeRunForDist(
() -> () -> Minecraft.getInstance().getConnection().getRecipeManager(),
() -> () -> ServerLifecycleHooks.getCurrentServer().getRecipeManager()
Pair<RecipeManager, RegistryAccess> pair = DistExecutor.unsafeRunForDist(
() -> () -> {
ClientPacketListener connection = Minecraft.getInstance().getConnection();
return Pair.of(connection.getRecipeManager(), connection.registryAccess());
},
() -> () -> {
MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
return Pair.of(server.getRecipeManager(), server.registryAccess());
}
);
for (Recipe<?> recipe : recipeManager.getRecipes()) {
for (Recipe<?> recipe : pair.getFirst().getRecipes()) {
if (recipe.getSerializer() != POTION_BUNDLE_RECIPE_SERIALIZER.get()) continue;
if (recipe.getResultItem().getItem() != bundle) continue;
if (recipe.getResultItem(pair.getSecond()).getItem() != bundle) continue;
PotionBundleRecipe potionBundleRecipe = (PotionBundleRecipe) recipe;
Ingredient stringIngredient = potionBundleRecipe.getString();
ItemStack[] stacks = stringIngredient.getItems();
Expand Down

0 comments on commit b764318

Please sign in to comment.