Jump to content

[SOLVED][1.8.9] TileEntityContainer per-slot max stack size possible?


iRhuel

Recommended Posts

Hi, I'm a novice modder (and coder), and I need your help...!!!

 

I have a working furnace with multiple input slots (1 fuel and 1 output). All basic functionality is working properly. I'd like to implement some additional behavior, but for the life of me I can't figure out how. I did an initial search and was surprised to turn up nothing about this. All the info I found was to set behaviors for the entire entity, not individual slots.

[*]I'd like to restrict maxstacksize for input slots to 1, and leave maxstacksize for fuel and output slots at default (64).

[*]I'd also like to be able to restrict valid ItemStack for input slots based on oredict tags (ore* and dust*)

 

PART 1

 

I've been able to get correct shift-click behavior with custom Slot class, custom mergeItemStack(), and transferStackInSlot() in the Container class. But this yields odd left-click behavior if implemented (left clicking an occupied input slot while holding a matching ItemStack withdraws the stack from the slot and increases the held stack, even past stacksize limits) so I've reverted it.

 

I also can't get automation (hoppers) to change behavior (round robin) or respect the custom inputSlot's stacksize limits, without setting the TileEntity'sgetInventoryStackLimit() to return 1 instead of 64. This of course causes problems for the fuel and output slots.

 

PART 2

 

Honestly have no clue where to begin. I looked through the oredict class, but couldn't find any way to make a given ItemStack return its oredict tag.

 

CODE

 

Tile Entity:

 

public class TileCupolaFurnace extends TileEntity implements ITickable, IInventory {

    // index 0-3 = input, 4 = fuel, 5 = output
    private ItemStack[] furnaceItemStacks = new ItemStack[6];

    private int burnTimeRemaining;  // number of ticks remaining on current piece of fuel
    private int fuelBurnTime;  // initial fuel value of the currently burning fuel
    private int[] itemCookTime = new int[4];   // current cook time for input slots

    private static final int COOK_TIME_FOR_COMPLETION = 400;  // the number of ticks to smelt

    @Override
    public int getSizeInventory() {
        return furnaceItemStacks.length;
    }

    @Override
    public ItemStack getStackInSlot(int index) {
        return furnaceItemStacks[index];
    }

    @Override
    public ItemStack decrStackSize(int index, int count) {
        ItemStack stackInSlot = furnaceItemStacks[index];
        ItemStack stackRemoved;

        if (stackInSlot == null)
            return null;

        if (stackInSlot.stackSize <= count) {
            stackRemoved = stackInSlot;
            setInventorySlotContents(index, null);
        } else {
            stackRemoved = stackInSlot.splitStack(count);
            if (stackInSlot.stackSize == 0)
                setInventorySlotContents(index, null);
        }
        markDirty();
        return stackRemoved;
    }

    @Override
    public void setInventorySlotContents(int index, ItemStack stack) {
        furnaceItemStacks[index] = stack;

        if (stack != null && stack.stackSize > getInventoryStackLimit())
            stack.stackSize = getInventoryStackLimit();

        markDirty();
    }

    @Override
    public int getInventoryStackLimit() {
        return 64;
    }

    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
        if (this.worldObj.getTileEntity(this.pos) != this) return false;
        final double X_CENTRE_OFFSET = 0.5;
        final double Y_CENTRE_OFFSET = 0.5;
        final double Z_CENTRE_OFFSET = 0.5;
        final double MAXIMUM_DISTANCE_SQ = 8.0 * 8.0;
        return player.getDistanceSq(pos.getX() + X_CENTRE_OFFSET, pos.getY() + Y_CENTRE_OFFSET, pos.getZ() + Z_CENTRE_OFFSET) < MAXIMUM_DISTANCE_SQ;
    }

    @Override
    public boolean isItemValidForSlot(int index, ItemStack stack) {
        return index != 5 && (index != 4 || isItemFuel(stack));
    }

    @Override
    public void update() {
        for (int i = 0; i < 4; i++) {
            ItemStack input = furnaceItemStacks[i];
            if (input != null && canSmelt(i)) {
                startBurnFuel();
                cookItem(i);
            }
            else {
                if (input == null) itemCookTime[i] = 0;
                if (itemCookTime[i] > 0 && !isBurning()) itemCookTime[i]--;
            }
        }
        if (isBurning()) burnTimeRemaining--;
    }

    private boolean isBurning() {
        return this.burnTimeRemaining > 0;
    }

    private void startBurnFuel() {
        if (!this.isBurning()) {
            boolean inventoryChanged = false;
            if (this.furnaceItemStacks[4] != null && isItemFuel(this.furnaceItemStacks[4]) && this.furnaceItemStacks[4].stackSize > 0) {
                this.burnTimeRemaining = this.fuelBurnTime = getFuelBurnTime(this.furnaceItemStacks[4]);
                this.furnaceItemStacks[4].stackSize--;
                inventoryChanged = true;
                if (this.furnaceItemStacks[4].stackSize == 0)
                    this.furnaceItemStacks[4] = null;
            }
            if (inventoryChanged) markDirty();
        }
    }

    private boolean canSmelt(int index) {
        ItemStack input = this.furnaceItemStacks[index];
        ItemStack output = FurnaceRecipes.instance().getSmeltingResult(input);
        if (output == null) return false;
        if (this.furnaceItemStacks[5] == null) return true;
        if (!this.furnaceItemStacks[5].isItemEqual(output)) return false;
        int result = this.furnaceItemStacks[5].stackSize + output.stackSize;
        return result <= getInventoryStackLimit() && result <= this.furnaceItemStacks[5].getMaxStackSize();
    }

    private void cookItem(int index) {
        if (isBurning())
            itemCookTime[index]++;
        if (itemCookTime[index] == COOK_TIME_FOR_COMPLETION) {
            smeltItem(index);
            itemCookTime[index] = 0;
        }
    }

    private void smeltItem(int index) {
        ItemStack smeltingResult = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[index]);

        if (this.furnaceItemStacks[5] == null)
            this.furnaceItemStacks[5] = smeltingResult.copy();
        else if (this.furnaceItemStacks[5].getItem() == smeltingResult.getItem())
            this.furnaceItemStacks[5].stackSize += smeltingResult.stackSize;
        this.furnaceItemStacks[index].stackSize--;
        if (furnaceItemStacks[index].stackSize <= 0)
            furnaceItemStacks[index] = null;
        markDirty();
    }

    public boolean isItemFuel(ItemStack stack) {
        return stack != null && getFuelBurnTime(stack) > 0;
    }

    private int getFuelBurnTime(ItemStack stack) {
        if (stack == null) {
            return 0;
        } else {
            Item item = stack.getItem();

            if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
                Block block = Block.getBlockFromItem(item);
                if (block == Blocks.coal_block) return 16000;
                else return 0;
            }
            if (item == Items.coal) return 1600;
        }
        return 0;
    }

    public int getBurnRemainingSeconds() {
        if (burnTimeRemaining <= 0) return 0;
        return burnTimeRemaining / 20;
    }

    public double getBurnRemainingRatio() {
        if (burnTimeRemaining <= 0) return 0;
        double ratio = (double) burnTimeRemaining / (double) fuelBurnTime;
        return MathHelper.clamp_double(ratio, 0.0, 1.0);
    }

    public double getCookProgressRatio(int index) {
        double ratio = (double) itemCookTime[index] / (double) COOK_TIME_FOR_COMPLETION;
        return MathHelper.clamp_double(ratio, 0.0, 1.0);
    }

    @Override
    public void writeToNBT(NBTTagCompound compound) {
        super.writeToNBT(compound);

        NBTTagList tagList = new NBTTagList();

        for (int i = 0; i < this.furnaceItemStacks.length; i++) {
            if (this.furnaceItemStacks[i] != null) {
                NBTTagCompound stackTag = new NBTTagCompound();
                stackTag.setByte("Slot", (byte) i);
                this.furnaceItemStacks[i].writeToNBT(stackTag);
                tagList.appendTag(stackTag);
            }
        }
        compound.setTag("Items", tagList);
        compound.setInteger("burnTimeRemaining", this.burnTimeRemaining);
        compound.setInteger("fuelBurnTime", this.fuelBurnTime);
        compound.setTag("itemCookTime", new NBTTagIntArray(this.itemCookTime));
    }

    @Override
    public void readFromNBT(NBTTagCompound compound) {
        super.readFromNBT(compound);

        final byte NBT_TYPE = 10;
        NBTTagList tagList = compound.getTagList("Items", NBT_TYPE);

        for (int i = 0; i < tagList.tagCount(); i++) {
            NBTTagCompound stackTag = tagList.getCompoundTagAt(i);
            int slot = stackTag.getByte("Slot") & 255;
            this.furnaceItemStacks[slot] = ItemStack.loadItemStackFromNBT(stackTag);
        }
        this.burnTimeRemaining = compound.getInteger("burnTimeRemaining");
        this.fuelBurnTime = compound.getInteger("fuelBurnTime");
        this.itemCookTime = Arrays.copyOf(compound.getIntArray("itemCookTime"), 4);
    }

    @Override
    public void clear() {
        Arrays.fill(furnaceItemStacks, null);
    }

    @Override
    public String getName() {
        return "container.cupola_furnace.name";
    }

    @Override
    public boolean hasCustomName() {
        return false;
    }

    @Override
    public IChatComponent getDisplayName() {
        return this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName());
    }

    @Override
    public Packet getDescriptionPacket() {
        NBTTagCompound nbtTagCompound = new NBTTagCompound();
        writeToNBT(nbtTagCompound);
        int metadata = getBlockMetadata();
        return new S35PacketUpdateTileEntity(this.pos, metadata, nbtTagCompound);
    }

    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
        readFromNBT(pkt.getNbtCompound());
    }

    @Override
    public ItemStack removeStackFromSlot(int index) {
        ItemStack stackremoved = furnaceItemStacks[index];

        if (stackremoved != null)
            setInventorySlotContents(index, null);

        return stackremoved;
    }

    @Override
    public void openInventory(EntityPlayer player) {
    }

    @Override
    public void closeInventory(EntityPlayer player) {
    }

    @Override
    public int getField(int id) {
        if (id == 0) return this.burnTimeRemaining;
        if (id == 1) return this.fuelBurnTime;
        if (id > 1 && id <= 5) return itemCookTime[id - 2];
        System.err.println("Invalid field ID in TileCupolaFurnace.getField:" + id);
        return 0;
    }

    @Override
    public void setField(int id, int value) {
        if (id == 0) this.burnTimeRemaining = value;
        else if (id == 1) this.fuelBurnTime = value;
        else if (id > 1 && id <= 5) this.itemCookTime[id - 2] = value;
        else System.err.println("Invalid field ID in TileCupolaFurnace.setField:" + id);
    }

    @Override
    public int getFieldCount() {
        return 6;
    }
}

 

 

Container:

 

public class ContainerCupolaFurnace extends Container {

    /**
     * SLOTS                            INDEX
     * <p>
     * 0-8 = hotbar slots               0-8
     * 9-35 = player inventory slots    9-35
     * <p>
     * 36-41 = furnace slots
     * 36-39 = input slots              0-3
     * 40 = fuel slot                   4
     * 41 = output slot                 5
     */

    private TileCupolaFurnace tileCupolaFurnace;

    public ContainerCupolaFurnace(InventoryPlayer invPlayer, TileCupolaFurnace tileCupolaFurnace) {
        this.tileCupolaFurnace = tileCupolaFurnace;

        // hotbar slots
        for (int x = 0; x < 9; x++) {
            addSlotToContainer(new Slot(invPlayer, x, 8 + 18 * x, 134));
        }
        // player inv slots
        for (int y = 0; y < 3; ++y) {
            for (int x = 0; x < 9; ++x) {
                addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + x * 18, 76 + y * 18));
            }
        }
        // furnace input slots
        for (int y = 0; y < 2; y++) {
            for (int x = 0; x < 2; x++) {
                addSlotToContainer(new inputSlot(tileCupolaFurnace, x + y * 2, 24 + x * 21, 24 + y * 18));
            }
        }
        // furnace fuel slot
        addSlotToContainer(new Slot(tileCupolaFurnace, 4, 80, 51));
        //furnace output slot
        addSlotToContainer(new Slot(tileCupolaFurnace, 5, 125, 27));
    }

    @Override
    public boolean canInteractWith(EntityPlayer playerIn) {
        return this.tileCupolaFurnace.isUseableByPlayer(playerIn);
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
        Slot sourceSlot = this.inventorySlots.get(index);
        if (sourceSlot == null || !sourceSlot.getHasStack()) return null;
        ItemStack sourceStack = sourceSlot.getStack();
        ItemStack copyOfSourceStack = sourceStack.copy();

        if (index >= 0 && index < 36) {
            if (tileCupolaFurnace.isItemFuel(sourceStack)) {
                if (!mergeItemStack(sourceStack, 40, 41, false)) {
                    return null;
                }
            }
            else if (!mergeItemStack(sourceStack, 36, 40, false)) {
                return null;
            }
        } else if (index >= 36 && index < 42) {
            if (!mergeItemStack(sourceStack, 0, 36, false)) {
                return null;
            }
        } else {
            System.err.print("Invalid slotIndex:" + index);
            return null;
        }

        if (sourceStack.stackSize == 0) {
            sourceSlot.putStack(null);
        } else {
            sourceSlot.onSlotChanged();
        }

        sourceSlot.onPickupFromSlot(playerIn, sourceStack);
        return copyOfSourceStack;
    }

//    private boolean mergeInputStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) {
//        boolean success = false;
//        int index = startIndex;
//
//        if (useEndIndex)
//            index = endIndex - 1;
//
//        Slot slot;
//        ItemStack stackInSlot;
//
//        if (stack.isStackable()) {
//            while (stack.stackSize > 0 && (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex)) {
//                slot = this.inventorySlots.get(index);
//                stackInSlot = slot.getStack();
//
//                if (stackInSlot != null && stackInSlot.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == stackInSlot.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, stackInSlot)) {
//                    int l = stackInSlot.stackSize + stack.stackSize;
//                    int maxsize = Math.min(stack.getMaxStackSize(), slot.getItemStackLimit(stack));
//
//                    if (l <= maxsize) {
//                        stack.stackSize = 0;
//                        stackInSlot.stackSize = l;
//                        slot.onSlotChanged();
//                        success = true;
//                    } else if (stackInSlot.stackSize < maxsize) {
//                        stack.stackSize -= stack.getMaxStackSize() - stackInSlot.stackSize;
//                        stackInSlot.stackSize = stack.getMaxStackSize();
//                        slot.onSlotChanged();
//                        success = true;
//                    }
//                }
//
//                if (useEndIndex) {
//                    --index;
//                } else {
//                    ++index;
//                }
//            }
//        }
//
//        if (stack.stackSize > 0) {
//            if (useEndIndex) {
//                index = endIndex - 1;
//            } else {
//                index = startIndex;
//            }
//
//            while (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex && stack.stackSize > 0) {
//                slot = this.inventorySlots.get(index);
//                stackInSlot = slot.getStack();
//
//                // Forge: Make sure to respect isItemValid in the slot.
//                if (stackInSlot == null && slot.isItemValid(stack)) {
//                    if (stack.stackSize < slot.getItemStackLimit(stack)) {
//                        slot.putStack(stack.copy());
//                        stack.stackSize = 0;
//                        success = true;
//                        break;
//                    } else {
//                        ItemStack newstack = stack.copy();
//                        newstack.stackSize = slot.getItemStackLimit(stack);
//                        slot.putStack(newstack);
//                        stack.stackSize -= slot.getItemStackLimit(stack);
//                        success = true;
//                    }
//                }
//
//                if (useEndIndex) {
//                    --index;
//                } else {
//                    ++index;
//                }
//            }
//        }
//
//        return success;
//    }

    @Override
    public void onContainerClosed(EntityPlayer playerIn) {
        super.onContainerClosed(playerIn);
        this.tileCupolaFurnace.closeInventory(playerIn);
    }

    private int[] cachedFields;

    @Override
    public void detectAndSendChanges() {
        super.detectAndSendChanges();

        boolean allFieldsHaveChanged = false;
        boolean fieldHasChanged[] = new boolean[tileCupolaFurnace.getFieldCount()];
        if (cachedFields == null) {
            cachedFields = new int[tileCupolaFurnace.getFieldCount()];
            allFieldsHaveChanged = true;
        }
        for (int i = 0; i < cachedFields.length; ++i) {
            if (allFieldsHaveChanged || cachedFields[i] != tileCupolaFurnace.getField(i)) {
                cachedFields[i] = tileCupolaFurnace.getField(i);
                fieldHasChanged[i] = true;
            }
        }
        for (ICrafting icrafting : this.crafters) {
            for (int fieldID = 0; fieldID < tileCupolaFurnace.getFieldCount(); ++fieldID) {
                if (fieldHasChanged[fieldID]) {
                    icrafting.sendProgressBarUpdate(this, fieldID, cachedFields[fieldID]);
                }
            }
        }
    }

    private class inputSlot extends Slot {

        inputSlot(IInventory inventoryIn, int index, int xPosition, int yPosition) {
            super(inventoryIn, index, xPosition, yPosition);
        }

        @Override
        public int getSlotStackLimit() {
            return 64;
        }
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void updateProgressBar(int id, int data) {
        tileCupolaFurnace.setField(id, data);
    }
}

 

 

Thanks for any help!

Link to comment
Share on other sites

Use your custom slot for the slot that should have a max stack size of 1 and return 1 for the Slot#getSlotStackLimit method.

 

However, the vanilla #mergeStackInSlot implementations DO NOT check the slot's stack limit (at least as of 1.8 - maybe it has changed), and also has trouble handling slot limits of 1.

 

Here is an implementation I came up with for #mergeStackInSlot - there are others out there as well that do the same thing.

 

As for the shift-clicking moving items into the wrong slots, that has to do with how you choose to implement #transferStackInSlot - you can find some information about that in this tutorial, though I recommend you skip to the final spoiler section first, as that is the most recent.

Link to comment
Share on other sites

!!!

 

Hey, it's you! Your tutorials (and others') are the reason I've gotten this far. Thanks for putting those together!

 

I've re-implemented custom Slot classes and MergeStackInSlot() to handle the Container interactions. This time I've also implemented more comprehensive logic in TileEntity.isItemValidForSlot() to handle automated insertion, to catch itemstack.stackSize > 1 for those slots. Hopefully that'll cover all of it.

 

The errant clicking behavior actually happens on regular click and not shift click, as described in the OP:

(If for whatever reason the itemstack in the slot has stacksize > 1) left clicking an occupied input slot while holding a matching ItemStack withdraws the stack from the slot and increases the held stack, even past stacksize limits, so I've reverted it.

 

Hopefully now it's a moot point, unless there's a way to get an itemstack > 1 into a slot that I'm missing. I still want to fix that behavior, just in case. Thanks for the help, and again for the tutorials.

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

    • Another Update: Updating the Forge MDL version worked. My conjecture to this weird bug or issue of sorts is that the plugin was downloading mappings and MDK from the latest forge minecraft version instead of the set forge minecraft version. This could be the only possible case of explanation, because clearing gradle cache does not work for me. I have tried this for over hours and just upgrading the MDK worked for me. Build and compile gradlew commands also works now, which further proves my guess. This is probably a bug on the plugin's side somehow, but it just doesn't make sense since at start trying the 40.2.18 MDL works fine and then deleting the cache breaks it.
    • Update: It seems like the forge version I was using was broken entirely, somehow... I am now using the Forge MDL 1.18.2-40.2.21 (previous used 40.2.18) version and now everything is working sort-of fine.... adding extra dependencies seems to break it again. It is so weird... Did anyone have similar issues with this before? I'm also using the Minecraft Development plugin for IntelliJ IDEA
    • Hello! I'm currently having issues while building a jar file for my Minecraft 1.18.2 Forge mod. I've attached a link to imgur below that holds two screenshots of the errors. I'm using Jetbrains IntelliJ IDEA 2024.1 and Gradle 8.4. This is my repo: Mod Repo When I was modding, I needed to build the mod in order to test the mod, which didn't work, as the first screenshot gives. It throws errors for each classes in the forge registry class (or whatever the hell that mess is) and is just generally confusing. Now I have deleted everything in my project folder and re-pulled the repo from github, which now gives the errors in the second image where all forge classes are not imported somehow. When I try to build it now, it just repeats the same errors in the first image. https://imgur.com/a/DYwSKqJ Please I need help desparately
    • [main/WARN] [net.minecraft.server.Main/]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode 8400java.util.concurrent.ExecutionException: com.google.gson.JsonParseException: Error loading registry data: No key name in MapLike[{"elements":[{"element":{"element_type":"minecraft:legacy_single_pool_element","location":"duneons:towns/village_creeperforest/town_center_01","processors":{"processors":[]},"projection":"rigid"},"weight":1}],"fallback":"minecraft:empty","forge:registry_name":"duneons:towns/village_creeperforest/town_centers"}] 8401at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?] 8402at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?] 8403at net.minecraft.server.Main.main(Main.java:182) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8404at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] 8405at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] 8406at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] 8407at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] 8408at net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:29) ~[fmlloader-1.19.2-43.3.13.jar%2367!/:?] 8409at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2354!/:?] 8410at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2354!/:?] 8411at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2354!/:?] 8412at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2354!/:?] 8413at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2354!/:?] 8414at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2354!/:?] 8415at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2354!/:?] 8416at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] 8417Caused by: com.google.gson.JsonParseException: Error loading registry data: No key name in MapLike[{"elements":[{"element":{"element_type":"minecraft:legacy_single_pool_element","location":"duneons:towns/village_creeperforest/town_center_01","processors":{"processors":[]},"projection":"rigid"},"weight":1}],"fallback":"minecraft:empty","forge:registry_name":"duneons:towns/village_creeperforest/town_centers"}] 8418at net.minecraft.core.RegistryAccess.m_206152_(RegistryAccess.java:211) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8419at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] 8420at net.minecraft.core.RegistryAccess.m_206159_(RegistryAccess.java:210) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8421at net.minecraft.core.RegistryAccess.m_206171_(RegistryAccess.java:203) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8422at net.minecraft.resources.RegistryOps.m_206817_(RegistryOps.java:32) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8423at net.minecraft.resources.RegistryOps.m_206813_(RegistryOps.java:25) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8424at net.minecraft.server.Main.lambda$main$2(Main.java:160) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8425at net.minecraft.server.WorldLoader.m_214362_(WorldLoader.java:24) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8426at net.minecraft.server.WorldStem.m_214415_(WorldStem.java:18) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8427at net.minecraft.server.Main.lambda$main$3(Main.java:158) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8428at net.minecraft.Util.m_214652_(Util.java:775) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8429at net.minecraft.Util.m_214679_(Util.java:770) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8430at net.minecraft.server.Main.main(Main.java:157) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8431... 13 more 8432  
    • Try using 1.20.6-50.0.5, it just fixed an issue related to enchanting: https://github.com/MinecraftForge/MinecraftForge/commit/0e829630da67c91d2b5a91ea4b65eb033f868e76
  • Topics

×
×
  • Create New...

Important Information

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