Jump to content

How do I get what's there in a slot in a tile entity


PadFoot2008

Recommended Posts

I don't get what do I have to do exactly.

I'm following Kaupenjoe's tutorial: https://github.com/Tutorials-By-Kaupenjoe/Minecraft-1.16.5

Here's the TileEntity class:

public class EnchantingPedestralTile extends TileEntity implements ITickableTileEntity {

    private final ItemStackHandler itemHandler = createHandler();
    private final LazyOptional<IItemHandler> handler = LazyOptional.of(() -> itemHandler);

    public EnchantingPedestralTile(TileEntityType<?> tileEntityTypeIn) {

        super(tileEntityTypeIn);
    }

    public EnchantingPedestralTile() {

        this(ModTileEntities.ENCHANTING_PEDESTRAL_TILE.get());
    }

    @Override
    public void read(BlockState state, CompoundNBT nbt) {
        itemHandler.deserializeNBT(nbt.getCompound("inv"));
        super.read(state, nbt);
    }

    @Override
    public CompoundNBT write(CompoundNBT compound) {
        compound.put("inv", itemHandler.serializeNBT());
        return super.write(compound);
    }

    private ItemStackHandler createHandler() {
        return new ItemStackHandler(2) {
            @Override
            protected void onContentsChanged(int slot) {
                markDirty();
            }

            @Override
            public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
                return true;
            }

            @Override
            public int getSlotLimit(int slot) {
                return 1;
            }

            @Nonnull
            @Override
            public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
                if(!isItemValid(slot, stack)) {
                    return stack;
                }

                return super.insertItem(slot, stack, simulate);
            }
        };
    }

    @Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
            return handler.cast();
        }


        return super.getCapability(cap, side);
    }

    private void strikeLightning() {
        if(!this.world.isRemote()) {
            EntityType.LIGHTNING_BOLT.spawn((ServerWorld)world, null, null,
                    pos, SpawnReason.TRIGGERED, true, true);
        }
    }

    public void craft() {
        Inventory inv = new Inventory(itemHandler.getSlots());
        for (int i = 0; i < itemHandler.getSlots(); i++) {
            inv.setInventorySlotContents(i, itemHandler.getStackInSlot(i));
        }

        Optional<EnchantingPedestralRecipe> recipe = world.getRecipeManager()
                .getRecipe(ModRecipeTypes.ENCHANTING_RECIPE, inv, world);

        recipe.ifPresent(iRecipe -> {
            ItemStack tool = iRecipe.getRecipeOutput();

            if(iRecipe.getWeather().equals(EnchantingPedestralRecipe.Weather.CLEAR) &&
                    !world.isRaining()) {
                craftTheItem(tool);
            }

            if(iRecipe.getWeather().equals(EnchantingPedestralRecipe.Weather.RAIN) &&
                    world.isRaining()) {
                craftTheItem(tool);
            }

            if(iRecipe.getWeather().equals(EnchantingPedestralRecipe.Weather.THUNDERING) &&
                    world.isThundering()) {
                strikeLightning();
                craftTheItem(tool);
            }

            markDirty();
        });
    }

    private void craftTheItem(ItemStack tool) {
        itemHandler.extractItem(0, 1, false);
        itemHandler.extractItem(1, 1, false);
        itemHandler.insertItem(0, tool, false);
    }

    @Override
    public void tick() {
        if(world.isRemote)
            return;

        craft();
    }
}

And the custom Recipe class:

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final ItemStack output;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;

    public EnchantingPedestralRecipe(ResourceLocation id, ItemStack output,
                                    NonNullList<Ingredient> recipeItems, Weather weather) {
        this.id = id;
        this.output = output;
        this.recipeItems = recipeItems;
        this.weather = weather;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
        // Checks for correct focus (Glass Pane)
        if(recipeItems.get(0).test(inv.getStackInSlot(0))) {
            return recipeItems.get(1).test(inv.getStackInSlot(1));
        }

        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        return output.copy();
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));
      		
      		//Here's where I want to get what's in the first slot of my TileEntity

            ItemStack output = ShapedRecipe.deserializeItem(JSONUtils.getJsonObject(json, "output"));
            output.addEnchantment(enchant,1);

            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, Weather.getWeatherByString(weather));
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeItemStack(recipe.getRecipeOutput(), false);
        }
    }
}

 

What do I add to the Recipe class?

Edited by PadFoot2008
Link to comment
Share on other sites

I'm making a Tile Entity. It has 2 slots: one for a tool and the second for a crystal. The tool will be enchanted based on the crystal provided. Which enchantment will be applied in respect to the crystal is kept in a Json file. I've been able to get enchantment from the Json file and it also checks whether the correct crystal is present.

But I am unable to get the tool present in the first slot and then enchant it.

Link to comment
Share on other sites

Wait, let me explain –

Currently, in recipe Json, there's 5 objects –

1. Weather – Returns the weather required for the recipe to work

2. Enchantment – Returns the enchantment that will be applied to the output

3. Ingredients (slot 0) – Returns the tool required in slot 0.

4. Ingredients (slot 1) – Returns the crystal required in slot 1.

5. Output – Returns the output tool.

So, I get the Output and the Enchantment and then apply the enchantment on the output and then return it in

public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer)

. And in

public boolean matches(IInventory inv, World worldIn)

I check if Ingredient (slot 0) and Ingredient (slot 1) are placed in their respective slots.

This will be really tedious as I have to add recipes for all tools and armour and their respective Enchantments.

 

Instead, I thought it would be better if

public boolean matches(IInventory inv, World worldIn)

would check for only the Ingredients (slot 1) in slot 1 and any tool that will be placed slot 0 shall be enchanted based it. For that I would need to get what is there in slot 0 in

public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer)

get the enchantment and then enchant it; and return it as the output. 

 

So how do I get what's kept in slot 0?

Edited by PadFoot2008
Link to comment
Share on other sites

Thanks it worked!

But I just wanted to know how can I get the max enchantment level of an enchantment like for Power it's 5, for Fortune it's 3, etc. Is there a method I can use like:

int enchantmentlevel = SomeClass.getEnchantmentLevel(Enchantments.SILK_TOUCH);

 

Link to comment
Share on other sites

Hye I want a bit of help.

I modified the code to this :

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final ItemStack output;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;

    public static ItemStack outputin;

    public EnchantingPedestralRecipe(ResourceLocation id, ItemStack output,
                                    NonNullList<Ingredient> recipeItems, Weather weather) {
        this.id = id;
        this.output = output;
        this.recipeItems = recipeItems;
        this.weather = weather;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
        ItemStack item = inv.getStackInSlot(0);
        if(item != null) {
            if (recipeItems.get(1).test(inv.getStackInSlot(1))) {
                outputin = item;
                return recipeItems.get(1).test(inv.getStackInSlot(1));
            }
        }
        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        return output.copy();
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));

            ItemStack output;

            if (outputin != null) {
                output = outputin;
                int i = EnchantmentHelper.getEnchantmentLevel(enchant, output);
                int j = enchant.getMaxLevel();
                int k = i++;
                if (output.isEnchantable() == true) {
                    if (i<j) {
                        output.addEnchantment(enchant, k);
                    }
                }
            } else {
                output = new ItemStack(Items.BELL);
            }

            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, Weather.getWeatherByString(weather));
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeItemStack(recipe.getRecipeOutput(), false);
        }
    }
}

And when I run Minecraft, it always outputs a bell, instead of enchanting the item? What's the mistake I've done? How do I solve it?

Edited by PadFoot2008
Link to comment
Share on other sites

34 minutes ago, PadFoot2008 said:
output.addEnchantment(enchant, k);

It does enchant.

8 minutes ago, diesieben07 said:

Why is this static? Do you know what static means? Why is this assigned in matches? The values inside a recipe instance should really be immutable, i.e. the recipe should be stateless.

So what do I do? You know what I want to do. I have told that earlier in this post itself. Please help.

Link to comment
Share on other sites

Okay, but what do I add here?

@Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
            //What do I add here
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null, enchant);
        }

The whole code (as of now):

package com.padfoot.immersivesurvival.data.recipes;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonObject;
import com.padfoot.immersivesurvival.block.ModBlocks;
import com.padfoot.immersivesurvival.container.EnchantingPedestralContainer;
import com.padfoot.immersivesurvival.screen.EnchantingPedestralScreen;
import com.padfoot.immersivesurvival.tileentity.EnchantingPedestralTile;
import net.minecraft.enchantment.*;
import net.minecraft.entity.item.minecart.MinecartEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.nbt.ListNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.ForgeRegistryEntry;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects;

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final ItemStack output;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;
    private final Enchantment enchant;

    public EnchantingPedestralRecipe(ResourceLocation id, ItemStack output,
                                    NonNullList<Ingredient> recipeItems, Weather weather, Enchantment enchant) {
        this.id = id;
        this.output = output;
        this.recipeItems = recipeItems;
        this.weather = weather;
        this.enchant = enchant;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
            if (recipeItems.get(1).test(inv.getStackInSlot(1))) {
                return recipeItems.get(1).test(inv.getStackInSlot(1));
        }
        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        ItemStack output = inv.getStackInSlot(0);
        int i = EnchantmentHelper.getEnchantmentLevel(enchant, output);
        int j = enchant.getMaxLevel();
        int k = i++;
        if (output.isEnchantable() == true) {
            if (i<j) {
                    output.addEnchantment(enchant, k);
            }
        }
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        return output.copy();
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));

            ItemStack output = new ItemStack(Items.BELL);


            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, Weather.getWeatherByString(weather), enchant);
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
			//What do I add here
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null, enchant);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeItemStack(recipe.getRecipeOutput(), false);
          	//Do I add anything here?
        }
    }
}

Also do I need to anything in write method?

Link to comment
Share on other sites

It isn't working (see code):

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final ItemStack output;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;
    private final Enchantment enchant;

    public EnchantingPedestralRecipe(ResourceLocation id, ItemStack output,
                                    NonNullList<Ingredient> recipeItems, Weather weather, Enchantment enchant) {
        this.id = id;
        this.output = output;
        this.recipeItems = recipeItems;
        this.weather = weather;
        this.enchant = enchant;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
            if (recipeItems.get(1).test(inv.getStackInSlot(1))) {
                return recipeItems.get(1).test(inv.getStackInSlot(1));
        }
        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        ItemStack output = inv.getStackInSlot(0);
        int i = EnchantmentHelper.getEnchantmentLevel(enchant, output);
        int j = enchant.getMaxLevel();
        int k = i++;
        if (output.isEnchantable() == true) {
            if (i<j) {
                    output.addEnchantment(enchant, k);
            }
        }
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        return output.copy();
    }

    public Enchantment getEnchant() {
        return enchant;
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));

            ItemStack output = null; //I know this is incorrect; what do I do?


            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, Weather.getWeatherByString(weather), enchant);
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
            Enchantment enchant = buffer.readRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS);
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null, enchant);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeItemStack(recipe.getRecipeOutput(), false);
            buffer.writeRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS, recipe.getEnchant());
        }
    }
}

 

Edited by PadFoot2008
Link to comment
Share on other sites

But this is a syntax error? In read method output's coming as red.

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final ItemStack output;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;
    private final Enchantment enchant;

    public EnchantingPedestralRecipe(ResourceLocation id, ItemStack output,
                                    NonNullList<Ingredient> recipeItems, Weather weather, Enchantment enchant) {
        this.id = id;
        this.output = output;
        this.recipeItems = recipeItems;
        this.weather = weather;
        this.enchant = enchant;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
            if (recipeItems.get(1).test(inv.getStackInSlot(1))) {
                return recipeItems.get(1).test(inv.getStackInSlot(1));
        }
        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        ItemStack output = inv.getStackInSlot(0);
        int i = EnchantmentHelper.getEnchantmentLevel(enchant, output);
        int j = enchant.getMaxLevel();
        int k = i++;
        if (output.isEnchantable() == true) {
            if (i<j) {
                    output.addEnchantment(enchant, k);
            }
        }
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        return output.copy();
    }

    public Enchantment getEnchant() {
        return enchant;
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));



            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, Weather.getWeatherByString(weather), enchant);
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            ItemStack output = buffer.readItemStack();
            Enchantment enchant = buffer.readRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS);
            return new EnchantingPedestralRecipe(recipeId, output,
                    inputs, null, enchant);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeItemStack(recipe.getRecipeOutput(), false);
            buffer.writeRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS, recipe.getEnchant());
        }
    }
}

 

Link to comment
Share on other sites

Eg, ItemStack.EMPTY ...

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Current code:

public class EnchantingPedestralRecipe implements IEnchantingPedestralRecipe {
    public enum Weather {
        CLEAR,
        RAIN,
        THUNDERING;

        public static Weather getWeatherByString(String s) {
            return Objects.equals(s, "thundering") ? THUNDERING : Objects.equals(s, "rain") ? RAIN : CLEAR;
        }
    }

    private final ResourceLocation id;
    private final NonNullList<Ingredient> recipeItems;
    private final Weather weather;
    private final Enchantment enchant;

    public EnchantingPedestralRecipe(ResourceLocation id,
                                    NonNullList<Ingredient> recipeItems, Weather weather, Enchantment enchant) {
        this.id = id;
        this.recipeItems = recipeItems;
        this.weather = weather;
        this.enchant = enchant;
    }

    @Override
    public boolean matches(IInventory inv, World worldIn) {
            if (recipeItems.get(1).test(inv.getStackInSlot(1))) {
                return recipeItems.get(1).test(inv.getStackInSlot(1));
        }
        return false;
    }

    @Override
    public NonNullList<Ingredient> getIngredients() {
        return recipeItems;
    }

    @Override
    public ItemStack getCraftingResult(IInventory inv) {
        ItemStack output = inv.getStackInSlot(0);
        int i = EnchantmentHelper.getEnchantmentLevel(enchant, output);
        int j = enchant.getMaxLevel();
        int k = i++;
        if (output.isEnchantable() == true) {
            if (i<j) {
                    output.addEnchantment(enchant, k);
            }
        }
        return output;
    }

    @Override
    public ItemStack getRecipeOutput() {
        ItemStack output = ItemStack.EMPTY;
        return output.copy();
    }

    public Enchantment getEnchant() {
        return enchant;
    }

    public Weather getWeather() {
        return this.weather;
    }

    public ItemStack getIcon() {
        return new ItemStack(ModBlocks.ENCHANTING_PEDESTRAL.get());
    }

    @Override
    public ResourceLocation getId() {
        return id;
    }

    @Override
    public IRecipeSerializer<?> getSerializer() {
        return ModRecipeTypes.ENCHANTING_SERIALIZER.get();
    }

    public static class EnchantingRecipeType implements IRecipeType<EnchantingPedestralRecipe> {
        @Override
        public String toString() {
            return EnchantingPedestralRecipe.TYPE_ID.toString();
        }
    }

    public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>>
            implements IRecipeSerializer<EnchantingPedestralRecipe> {


        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, JsonObject json) {
            String enchantraw = JSONUtils.getString(json, "enchantment");
            Enchantment enchant = ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(enchantraw));



            String weather = JSONUtils.getString(json, "weather");

            JsonArray ingredients = JSONUtils.getJsonArray(json, "ingredients");
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.deserialize(ingredients.get(i)));
            }

            return new EnchantingPedestralRecipe(recipeId,
                    inputs, Weather.getWeatherByString(weather), enchant);
        }

        @Nullable
        @Override
        public EnchantingPedestralRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
            NonNullList<Ingredient> inputs = NonNullList.withSize(2, Ingredient.EMPTY);

            for (int i = 0; i < inputs.size(); i++) {
                inputs.set(i, Ingredient.read(buffer));
            }

            Enchantment enchant = buffer.readRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS);
            return new EnchantingPedestralRecipe(recipeId,
                    inputs, null, enchant);
        }

        @Override
        public void write(PacketBuffer buffer, EnchantingPedestralRecipe recipe) {
            buffer.writeInt(recipe.getIngredients().size());
            for (Ingredient ing : recipe.getIngredients()) {
                ing.write(buffer);
            }
            buffer.writeRegistryIdUnsafe(ForgeRegistries.ENCHANTMENTS, recipe.getEnchant());
        }
    }
}

Please help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yes, I have the same issue even without Mowzies Mobs. I then get a crash report from the Mahou Tsukai Mod. If I remove the Mahou Tsukai the error continues with another mod. Somehow my Aternos server launches with these mods perfect fine. Mahou Tsukai Error Image: https://ibb.co/KGtrWLy Mahou Tsukai Crash Report: https://paste.ee/p/b3yaA
    • For a while now I have been following a tutorial on YouTube for DataGen that I am using for my mod. I have come across an error that I wanted to check on here before acting on anything that could mess up my progress. The error is as follows: Caused by: java.lang.IllegalStateException: No way of obtaining recipe droidsancientrelics:lemon_juice Curiously, It has worked fine with the "orange_juice" item but not the "lemon_juice," even though their code is the same. I am basically just reposting the same thing as before, though I am yet to get a reply.  Video link for reference.   PLEASE HELP!!!!
    • I have instaled sophisticated core and Creative core and both give me an error that puta code error 1
    • didnt work, showed the same error and the logs seemed identical
    • When I start the modpack in the Minecraft launcher there is a very fast loading of the green bar and then the launcher closes and nothing appears, here is the log   [30May2024 20:32:38.114] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, GrimmWolfXxX, --version, forge-43.3.13, --gameDir, G:\MINECRAFT MODS\CurseForge\Instances\MedievalTech, --assetsDir, G:\MINECRAFT MODS\CurseForge\Install\assets, --assetIndex, 1.19, --uuid, a82398839c5942c98568c89d20911ded, --accessToken, ????????, --clientId, Y2Q2ZDhmMjktOGQwMS00N2MxLThmYzYtNWYzMTU1YThlZjI1, --xuid, 2535458029473870, --userType, msa, --versionType, release, --width, 1024, --height, 768, --launchTarget, forgeclient, --fml.forgeVersion, 43.3.13, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [30May2024 20:32:38.116] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.8 by Microsoft; OS Windows 10 arch amd64 version 10.0 [30May2024 20:32:39.200] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirector CoreMod initialized successfully! [30May2024 20:32:39.219] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/G:/MINECRAFT%20MODS/CurseForge/Install/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2397!/ Service=ModLauncher Env=CLIENT [30May2024 20:32:39.642] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file G:\MINECRAFT MODS\CurseForge\Install\libraries\net\minecraftforge\fmlcore\1.19.2-43.3.13\fmlcore-1.19.2-43.3.13.jar is missing mods.toml file [30May2024 20:32:39.643] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file G:\MINECRAFT MODS\CurseForge\Install\libraries\net\minecraftforge\javafmllanguage\1.19.2-43.3.13\javafmllanguage-1.19.2-43.3.13.jar is missing mods.toml file [30May2024 20:32:39.643] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file G:\MINECRAFT MODS\CurseForge\Install\libraries\net\minecraftforge\lowcodelanguage\1.19.2-43.3.13\lowcodelanguage-1.19.2-43.3.13.jar is missing mods.toml file [30May2024 20:32:39.644] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file G:\MINECRAFT MODS\CurseForge\Install\libraries\net\minecraftforge\mclanguage\1.19.2-43.3.13\mclanguage-1.19.2-43.3.13.jar is missing mods.toml file [30May2024 20:32:39.784] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File:  and Mod File: . Using Mod File: [30May2024 20:32:39.785] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: curios. Using Mod File: G:\MINECRAFT MODS\CurseForge\Instances\MedievalTech\mods\curios-forge-1.19.2-5.1.6.2.jar [30May2024 20:32:39.785] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 21 dependencies adding them to mods collection [30May2024 20:32:42.451] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [30May2024 20:32:42.483] [main/ERROR] [mixin/]: Mixin config epicsamurai.mixins.json does not specify "minVersion" property [30May2024 20:32:42.532] [main/ERROR] [mixin/]: Mixin config dynamiclightsreforged.mixins.json does not specify "minVersion" property [30May2024 20:32:42.556] [main/ERROR] [mixin/]: Mixin config radon.mixins.json does not specify "minVersion" property [30May2024 20:32:42.624] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [tictim.paraglider.MixinConnector] [30May2024 20:32:42.625] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [com.sonicether.soundphysics.MixinConnector] [30May2024 20:32:42.625] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [ca.spottedleaf.starlight.mixin.MixinConnector] [30May2024 20:32:42.627] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeclient' with arguments [--version, forge-43.3.13, --gameDir, G:\MINECRAFT MODS\CurseForge\Instances\MedievalTech, --assetsDir, G:\MINECRAFT MODS\CurseForge\Install\assets, --uuid, a82398839c5942c98568c89d20911ded, --username, GrimmWolfXxX, --assetIndex, 1.19, --accessToken, ????????, --clientId, Y2Q2ZDhmMjktOGQwMS00N2MxLThmYzYtNWYzMTU1YThlZjI1, --xuid, 2535458029473870, --userType, msa, --versionType, release, --width, 1024, --height, 768] [30May2024 20:32:42.661] [main/WARN] [ModernFixConfig/]: ModelDataManager bugfixes have been disabled to prevent broken rendering with Rubidium installed. Please migrate to Embeddium. [30May2024 20:32:42.662] [main/INFO] [ModernFix/]: Loaded configuration file for ModernFix 5.17.0+mc1.19.2: 84 options available, 2 override(s) found [30May2024 20:32:42.662] [main/WARN] [ModernFix/]: Option 'mixin.bugfix.model_data_manager_cme' overriden (by mods [rubidium]) to 'false' [30May2024 20:32:42.662] [main/WARN] [ModernFix/]: Option 'mixin.bugfix.item_cache_flag' overriden (by mods [radium]) to 'false' [30May2024 20:32:42.662] [main/INFO] [ModernFix/]: Applying Nashorn fix [30May2024 20:32:42.667] [main/INFO] [ModernFix/]: Applied Forge config corruption patch [30May2024 20:32:42.676] [main/WARN] [mixin/]: Reference map 'morevillagers-forge-forge-refmap.json' for morevillagers.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.679] [main/WARN] [mixin/]: Reference map 'yungsextras.refmap.json' for yungsextras.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.680] [main/WARN] [mixin/]: Reference map 'yungsextras.refmap.json' for yungsextras_forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.681] [main/WARN] [mixin/]: Reference map 'brrp-forge-forge-refmap.json' for brrp-forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.684] [main/WARN] [mixin/]: Reference map 'nitrogen_internals.refmap.json' for nitrogen_internals.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.692] [main/ERROR] [RadiumConfig/]: Option entity.collisions.fluid for dependency 'entity.collisions.fluid depends on chunk=true' not found. Skipping. [30May2024 20:32:42.692] [main/ERROR] [RadiumConfig/]: Option entity.collisions.fluid for dependency 'entity.collisions.fluid depends on chunk.block_counting=true' not found. Skipping. [30May2024 20:32:42.693] [main/INFO] [Radium/]: Loaded configuration file for Radium: 96 options available, 0 override(s) found [30May2024 20:32:42.696] [main/WARN] [mixin/]: Reference map 'arclight.mixins.refmap.json' for epicsamurai.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.699] [main/WARN] [mixin/]: Reference map 'untamedwilds.refmap.json' for untamedwilds.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.700] [main/WARN] [mixin/]: Reference map 'jeitweaker.refmap.json' for jeitweaker.forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.701] [main/WARN] [mixin/]: Reference map 'jeitweaker.refmap.json' for jeitweaker.common.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.703] [main/WARN] [mixin/]: Reference map 'antiqueatlas-forge-refmap.json' for antiqueatlas.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.706] [main/WARN] [mixin/]: Reference map '${refmap_target}refmap.json' for corgilib.forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.718] [main/WARN] [mixin/]: Reference map 'tlc.refmap.json' for tlc.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.722] [main/WARN] [mixin/]: Reference map 'insanelib.refmap.json' for insanelib.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.726] [main/WARN] [mixin/]: Reference map 'Bakery-forge-refmap.json' for bakery.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.744] [main/WARN] [mixin/]: Reference map 'xlpackets.refmap.json' for xlpackets.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.752] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting com/llamalad7/mixinextras/service/MixinExtrasVersion [30May2024 20:32:42.778] [main/WARN] [mixin/]: Reference map 'mes-forge-refmap.json' for mes-forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.785] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting malte0811/ferritecore/mixin/config/FerriteMixinConfig$LithiumSupportState [30May2024 20:32:42.796] [main/INFO] [com.abdelaziz.saturn.common.Saturn/]: Loaded Saturn config file with 4 configurable options [30May2024 20:32:42.808] [main/INFO] [Rubidium/]: Loaded configuration file for Rubidium: 30 options available, 0 override(s) found [30May2024 20:32:42.813] [main/WARN] [mixin/]: Reference map 'labels-common-refmap.json' for labels-common.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.813] [main/WARN] [mixin/]: Reference map 'labels-forge-refmap.json' for labels.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.815] [main/WARN] [mixin/]: Reference map 'lmft-forge-refmap.json' for lmft.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.817] [main/WARN] [mixin/]: Reference map 'mysticaloaktree-common-refmap.json' for mysticaloaktree-common.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.818] [main/WARN] [mixin/]: Reference map 'mysticaloaktree-forge-refmap.json' for mysticaloaktree.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.826] [main/WARN] [mixin/]: Reference map 'thirst.refmap.json' for villagercomfort.mixin.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.830] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations$Mod [30May2024 20:32:42.831] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations$Loader [30May2024 20:32:42.849] [main/WARN] [mixin/]: Reference map 'naturalist-forge-forge-refmap.json' for naturalist.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.852] [main/INFO] [fpsreducer/]: OptiFine was NOT detected. [30May2024 20:32:42.853] [main/INFO] [fpsreducer/]: OptiFabric was NOT detected. [30May2024 20:32:42.854] [main/WARN] [mixin/]: Reference map 'dummmmmmy-forge-refmap.json' for dummmmmmy.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.858] [main/WARN] [mixin/]: Reference map 'VampirismCoveredArmor.refmap.json' for vampirismcoveredarmor.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.862] [main/INFO] [Sodium Extra Config/]: Loaded configuration file for Sodium Extra: 28 options available, 0 override(s) found [30May2024 20:32:42.864] [main/WARN] [mixin/]: Reference map 'smallships-forge-refmap.json' for smallships.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.866] [main/WARN] [mixin/]: Reference map 'limitedchunks.refmap.json' for limitedchunks.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.875] [main/WARN] [mixin/]: Reference map 'mvs-forge-refmap.json' for mvs-forge.mixins.json could not be read. If this is a development environment you can ignore this message [30May2024 20:32:42.979] [main/INFO] [net.minecraftforge.coremod.CoreMod.placebo/COREMODLOG]: Patching IForgeItemStack#getEnchantmentLevel [30May2024 20:32:42.982] [main/INFO] [net.minecraftforge.coremod.CoreMod.placebo/COREMODLOG]: Patching IForgeItemStack#getEnchantmentLevel [30May2024 20:32:43.092] [main/WARN] [mixin/]: Error loading class: mezz/modnametooltip/TooltipEventHandler (java.lang.ClassNotFoundException: mezz.modnametooltip.TooltipEventHandler) [30May2024 20:32:43.093] [main/WARN] [mixin/]: Error loading class: me/shedaniel/rei/impl/client/ClientHelperImpl (java.lang.ClassNotFoundException: me.shedaniel.rei.impl.client.ClientHelperImpl) [30May2024 20:32:43.142] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/renderer/item/ItemProperties$static$1 (java.lang.ClassNotFoundException: net.minecraft.client.renderer.item.ItemProperties$static$1) [30May2024 20:32:43.143] [main/WARN] [mixin/]: @Mixin target net.minecraft.client.renderer.item.ItemProperties$static$1 was not found infernal-expansion.mixins.json:client.MixinItemProperties [30May2024 20:32:43.150] [main/WARN] [mixin/]: Error loading class: com/simibubi/create/content/contraptions/components/fan/AirCurrent (java.lang.ClassNotFoundException: com.simibubi.create.content.contraptions.components.fan.AirCurrent) [30May2024 20:32:43.300] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 2 calls to Enchantment#getMaxLevel() in net/minecraft/world/inventory/AnvilMenu [30May2024 20:32:43.307] [main/INFO] [net.minecraftforge.coremod.CoreMod.placebo/COREMODLOG]: Patching IForgeItemStack#getEnchantmentLevel [30May2024 20:32:43.308] [main/INFO] [net.minecraftforge.coremod.CoreMod.placebo/COREMODLOG]: Patching IForgeItemStack#getEnchantmentLevel [30May2024 20:32:43.312] [main/WARN] [mixin/]: Error loading class: com/hollingsworth/arsnouveau/common/items/SpellCrossbow (java.lang.ClassNotFoundException: com.hollingsworth.arsnouveau.common.items.SpellCrossbow) [30May2024 20:32:43.470] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting link/infra/indium/renderer/aocalc/AoConfig [30May2024 20:32:43.634] [main/WARN] [mixin/]: Error loading class: com/mrcrayfish/guns/client/handler/RecoilHandler (java.lang.ClassNotFoundException: com.mrcrayfish.guns.client.handler.RecoilHandler) [30May2024 20:32:43.635] [main/WARN] [mixin/]: Error loading class: dev/tr7zw/skinlayers/render/CustomizableModelPart (java.lang.ClassNotFoundException: dev.tr7zw.skinlayers.render.CustomizableModelPart) [30May2024 20:32:43.637] [main/WARN] [mixin/]: Error loading class: net/optifine/shaders/ShadersRender (java.lang.ClassNotFoundException: net.optifine.shaders.ShadersRender) [30May2024 20:32:43.637] [main/WARN] [mixin/]: @Mixin target net.optifine.shaders.ShadersRender was not found shouldersurfing.forge.mixins.json:MixinShadersRender [30May2024 20:32:43.709] [main/WARN] [mixin/]: Error loading class: com/min01/archaeology/item/BrushItem (java.lang.ClassNotFoundException: com.min01.archaeology.item.BrushItem) [30May2024 20:32:43.709] [main/WARN] [mixin/]: @Mixin target com.min01.archaeology.item.BrushItem was not found cataclysm.mixins.json:BrushItemMixin [30May2024 20:32:43.712] [main/WARN] [mixin/]: Error loading class: shadows/apotheosis/ench/table/ApothEnchantContainer (java.lang.ClassNotFoundException: shadows.apotheosis.ench.table.ApothEnchantContainer) [30May2024 20:32:43.712] [main/WARN] [mixin/]: @Mixin target shadows.apotheosis.ench.table.ApothEnchantContainer was not found origins_classes.mixins.json:common.apotheosis.ApotheosisEnchantmentMenuMixin [30May2024 20:32:43.714] [main/WARN] [mixin/]: Error loading class: se/mickelus/tetra/blocks/workbench/WorkbenchTile (java.lang.ClassNotFoundException: se.mickelus.tetra.blocks.workbench.WorkbenchTile) [30May2024 20:32:43.714] [main/WARN] [mixin/]: @Mixin target se.mickelus.tetra.blocks.workbench.WorkbenchTile was not found origins_classes.mixins.json:common.tetra.WorkbenchTileMixin [30May2024 20:32:43.749] [main/WARN] [mixin/]: Error loading class: dev/ftb/mods/ftbchunks/data/ClaimedChunkManager (java.lang.ClassNotFoundException: dev.ftb.mods.ftbchunks.data.ClaimedChunkManager) [30May2024 20:32:43.749] [main/WARN] [mixin/]: @Mixin target dev.ftb.mods.ftbchunks.data.ClaimedChunkManager was not found doespotatotick.mixins.json:ClaimedChunkManagerAccessor [30May2024 20:32:43.777] [main/INFO] [auudio/mixin/AuudioMixinPlugin/]: APPLYING MIXIN: de.keksuccino.auudio.mixin.client.MixinSoundBufferLibrary | TO TARGET: net.minecraft.client.sounds.SoundBufferLibrary [30May2024 20:32:43.777] [main/INFO] [auudio/mixin/AuudioMixinPlugin/]: APPLYING MIXIN: de.keksuccino.auudio.mixin.client.MixinSoundEngine | TO TARGET: net.minecraft.client.sounds.SoundEngine [30May2024 20:32:43.806] [main/WARN] [mixin/]: Error loading class: com/izofar/takesapillage/entity/Archer (java.lang.ClassNotFoundException: com.izofar.takesapillage.entity.Archer) [30May2024 20:32:43.806] [main/WARN] [mixin/]: @Mixin target com.izofar.takesapillage.entity.Archer was not found difficultraids.mixin.json:compat.ArcherMixin [30May2024 20:32:43.806] [main/WARN] [mixin/]: Error loading class: cn/leolezury/leosillagers/entity/Clownager (java.lang.ClassNotFoundException: cn.leolezury.leosillagers.entity.Clownager) [30May2024 20:32:43.807] [main/WARN] [mixin/]: @Mixin target cn.leolezury.leosillagers.entity.Clownager was not found difficultraids.mixin.json:compat.ClownagerMixin [30May2024 20:32:43.810] [main/WARN] [mixin/]: Error loading class: baguchan/hunterillager/entity/HunterIllagerEntity (java.lang.ClassNotFoundException: baguchan.hunterillager.entity.HunterIllagerEntity) [30May2024 20:32:43.810] [main/WARN] [mixin/]: @Mixin target baguchan.hunterillager.entity.HunterIllagerEntity was not found difficultraids.mixin.json:compat.HunterIllagerMixin [30May2024 20:32:43.810] [main/WARN] [mixin/]: Error loading class: com/izofar/takesapillage/entity/Legioner (java.lang.ClassNotFoundException: com.izofar.takesapillage.entity.Legioner) [30May2024 20:32:43.810] [main/WARN] [mixin/]: @Mixin target com.izofar.takesapillage.entity.Legioner was not found difficultraids.mixin.json:compat.LegionerMixin [30May2024 20:32:43.811] [main/WARN] [mixin/]: Error loading class: cn/leolezury/leosillagers/entity/LightningCaller (java.lang.ClassNotFoundException: cn.leolezury.leosillagers.entity.LightningCaller) [30May2024 20:32:43.811] [main/WARN] [mixin/]: @Mixin target cn.leolezury.leosillagers.entity.LightningCaller was not found difficultraids.mixin.json:compat.LightningCallerMixin [30May2024 20:32:43.824] [main/WARN] [mixin/]: Error loading class: com/infamous/dungeons_mobs/entities/illagers/MountaineerEntity (java.lang.ClassNotFoundException: com.infamous.dungeons_mobs.entities.illagers.MountaineerEntity) [30May2024 20:32:43.824] [main/WARN] [mixin/]: @Mixin target com.infamous.dungeons_mobs.entities.illagers.MountaineerEntity was not found difficultraids.mixin.json:compat.MountaineerMixin [30May2024 20:32:43.825] [main/WARN] [mixin/]: Error loading class: com/infamous/dungeons_mobs/entities/redstone/RedstoneGolemEntity (java.lang.ClassNotFoundException: com.infamous.dungeons_mobs.entities.redstone.RedstoneGolemEntity) [30May2024 20:32:43.825] [main/WARN] [mixin/]: @Mixin target com.infamous.dungeons_mobs.entities.redstone.RedstoneGolemEntity was not found difficultraids.mixin.json:compat.RedstoneGolemMixin [30May2024 20:32:43.826] [main/WARN] [mixin/]: Error loading class: com/infamous/dungeons_mobs/entities/illagers/RoyalGuardEntity (java.lang.ClassNotFoundException: com.infamous.dungeons_mobs.entities.illagers.RoyalGuardEntity) [30May2024 20:32:43.826] [main/WARN] [mixin/]: @Mixin target com.infamous.dungeons_mobs.entities.illagers.RoyalGuardEntity was not found difficultraids.mixin.json:compat.RoyalGuardMixin [30May2024 20:32:43.826] [main/WARN] [mixin/]: Error loading class: com/izofar/takesapillage/entity/Skirmisher (java.lang.ClassNotFoundException: com.izofar.takesapillage.entity.Skirmisher) [30May2024 20:32:43.826] [main/WARN] [mixin/]: @Mixin target com.izofar.takesapillage.entity.Skirmisher was not found difficultraids.mixin.json:compat.SkirmisherMixin [30May2024 20:32:43.828] [main/WARN] [mixin/]: Error loading class: cn/leolezury/leosillagers/entity/VindicatorWithShield (java.lang.ClassNotFoundException: cn.leolezury.leosillagers.entity.VindicatorWithShield) [30May2024 20:32:43.829] [main/WARN] [mixin/]: @Mixin target cn.leolezury.leosillagers.entity.VindicatorWithShield was not found difficultraids.mixin.json:compat.VindicatorWithShieldMixin [30May2024 20:32:43.849] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Patching FishingHook#catchingFish [30May2024 20:32:43.927] [main/WARN] [mixin/]: Error loading class: net/minecraft/resources/RegistryDataLoader (java.lang.ClassNotFoundException: net.minecraft.resources.RegistryDataLoader) [30May2024 20:32:43.927] [main/WARN] [mixin/]: @Mixin target net.minecraft.resources.RegistryDataLoader was not found zeta.mixins.json:RegistryDataLoaderMixin [30May2024 20:32:43.971] [main/INFO] [fpsreducer/]: bre2el.fpsreducer.mixin.RenderSystemMixin will be applied. [30May2024 20:32:43.972] [main/INFO] [fpsreducer/]: bre2el.fpsreducer.mixin.WindowMixin will NOT be applied because OptiFine was NOT detected. [30May2024 20:32:44.036] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 1 calls to Enchantment#getMaxLevel() in net/minecraft/world/entity/npc/VillagerTrades$EnchantBookForEmeralds [30May2024 20:32:44.036] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 1 calls to Enchantment#isTreasureOnly() in net/minecraft/world/entity/npc/VillagerTrades$EnchantBookForEmeralds [30May2024 20:32:44.036] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 1 calls to Enchantment#isTradeable() in net/minecraft/world/entity/npc/VillagerTrades$EnchantBookForEmeralds [30May2024 20:32:44.040] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 2 calls to Enchantment#getMaxLevel() in net/minecraft/world/item/EnchantedBookItem [30May2024 20:32:44.044] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 1 calls to Enchantment#getMaxLevel() in net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction [30May2024 20:32:44.044] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Replaced 1 calls to Enchantment#isDiscoverable() in net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction [30May2024 20:32:44.055] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Patching EffectRenderingInventoryScreen#renderEffects [30May2024 20:32:44.170] [main/INFO] [MixinExtras|Service/]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [30May2024 20:32:44.198] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/util/datafix/DataFixerOptimizationOption [30May2024 20:32:44.206] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/util/Unit [30May2024 20:32:44.231] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/ChatFormatting [30May2024 20:32:44.239] [main/WARN] [mixin/]: Static binding violation: PRIVATE @Overwrite method m_216202_ in modernfix-forge.mixins.json:perf.tag_id_caching.TagOrElementLocationMixin cannot reduce visibiliy of PUBLIC target method, visibility will be upgraded. [30May2024 20:32:44.277] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/client/User$Type [30May2024 20:32:45.032] [main/INFO] [mixin/]: BeforeConstant is searching for constants in method with descriptor (Lnet/minecraft/network/chat/Component;Z)V [30May2024 20:32:45.032] [main/INFO] [mixin/]:   BeforeConstant found INTEGER constant: value = 0, intValue = null [30May2024 20:32:45.032] [main/INFO] [mixin/]:     BeforeConstant found a matching constant TYPE at ordinal 0 [30May2024 20:32:45.032] [main/INFO] [mixin/]:       BeforeConstant found Insn [ICONST_0] [30May2024 20:32:45.032] [main/INFO] [mixin/]:   BeforeConstant found INTEGER constant: value = 60, intValue = null [30May2024 20:32:45.033] [main/INFO] [mixin/]:     BeforeConstant found a matching constant TYPE at ordinal 1 [30May2024 20:32:45.033] [main/INFO] [mixin/]:       BeforeConstant found IntInsn 60 [30May2024 20:32:45.184] [main/INFO] [net.minecraftforge.coremod.CoreMod.apotheosis/COREMODLOG]: Patching EffectRenderingInventoryScreen#renderEffects [30May2024 20:32:45.205] [main/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/Util$OS [30May2024 20:32:45.218] [pool-4-thread-1/INFO] [net.minecraft.server.Bootstrap/]: ModernFix reached bootstrap stage (8.092 s after launch) [30May2024 20:32:45.232] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/Util$IdentityStrategy [30May2024 20:32:45.236] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/core/Holder$Reference$Type [30May2024 20:32:45.247] [pool-4-thread-1/WARN] [mixin/]: @Final field delegatesByName:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin should be final [30May2024 20:32:45.247] [pool-4-thread-1/WARN] [mixin/]: @Final field delegatesByValue:Ljava/util/Map; in modernfix-forge.mixins.json:perf.forge_registry_alloc.ForgeRegistryMixin should be final [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getOpacityIfCached from ca.spottedleaf.starlight.mixin.common.blockstate.BlockStateBaseMixin [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getNeighborPathNodeType from me.jellysquid.mods.lithium.mixin.ai.pathing.AbstractBlockStateMixin [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getPathNodeType from me.jellysquid.mods.lithium.mixin.ai.pathing.AbstractBlockStateMixin [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into m_60823_ from me.jellysquid.mods.lithium.mixin.block.flatten_states.AbstractBlockStateMixin [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into isConditionallyFullOpaque from ca.spottedleaf.starlight.mixin.common.blockstate.BlockStateBaseMixin [30May2024 20:32:45.284] [pool-4-thread-1/INFO] [ModernFix/]: Injecting BlockStateBase cache population hook into getAllFlags from me.jellysquid.mods.lithium.mixin.chunk.block_counting.AbstractBlockStateMixin [30May2024 20:32:45.725] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/core/Direction [30May2024 20:32:45.726] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/core/Direction$AxisDirection [30May2024 20:32:45.726] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/core/Direction$Axis [30May2024 20:32:45.741] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/world/level/material/PushReaction [30May2024 20:32:45.766] [pool-4-thread-1/INFO] [com.cupboard.Cupboard/]: Loaded config for: biomemusic.json [30May2024 20:32:45.768] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/world/level/block/state/BlockBehaviour$OffsetType [30May2024 20:32:45.791] [pool-4-thread-1/INFO] [com.teampotato.redirector.Redirector/]: Redirecting net/minecraft/world/level/pathfinder/BlockPathTypes    
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.