Jump to content

[1.18.1] Try to craft something if button clicked


MrOlegTitov

Recommended Posts

Hello all. I've started building a custom workbench, but have run into a problem. According to my idea, a person needs to press a special button to create a thing. But I don't know how to track its pressing from container class. I tried using ContainerData class, but it seems you can't change its values from Screen class. What can I do to fix this issue?

?

Container Class:

package net.xale.satiscraft.container;

import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.SlotItemHandler;
import net.xale.satiscraft.block.entity.WorkbenchBlockEntity;
import net.xale.satiscraft.container.syncdata.WorkbenchContainerData;
import net.xale.satiscraft.crafting.WorkbenchRecipes;
import net.xale.satiscraft.init.BlockInit;
import net.xale.satiscraft.init.ContainerInit;

public class WorkbenchContainer extends AbstractContainerMenu {
    private final ContainerLevelAccess containerAccess;
    public final ContainerData data;

    // Client Constructor
    public WorkbenchContainer(int id, Inventory playerInv) {
        this(id, playerInv, new ItemStackHandler(27), BlockPos.ZERO, new SimpleContainerData(1));
    }

    // Server constructor
    public WorkbenchContainer(int id, Inventory playerInv, IItemHandler slots, BlockPos pos, ContainerData data) {
        super(ContainerInit.WORKBENCH.get(), id);
        this.containerAccess = ContainerLevelAccess.create(playerInv.player.level, pos);
        this.data = data;

        final int slotSizePlus2 = 18, startX = 8, startY = 84, hotbarY = 142;
        for (int column = 0; column < 9; column++){
            for (int row = 0; row < 3; row++){
                addSlot(new Slot(playerInv, 9 + row * 9 + column, startX + column * slotSizePlus2, startY + row * slotSizePlus2));
            }

            addSlot(new Slot(playerInv, column, startX + column * slotSizePlus2, hotbarY));
        }

        addSlot(new SlotItemHandler(slots, 0, 30, 35));
        addSlot(new SlotItemHandler(slots, 1, 48, 35));
        addSlot(new SlotItemHandler(slots, 2, 66, 35));
        addSlot(new SlotItemHandler(slots, 3, 125, 35));

        addDataSlots(data);
    }

    @Override
    public void broadcastChanges() {
        if (this.data.get(0) == 1){
            ItemStack result = WorkbenchRecipes.getInstance().getCraftingResult(this.getSlot(36).getItem(), this.getSlot(37).getItem(), this.getSlot(38).getItem());
            if (result != ItemStack.EMPTY){
                this.getSlot(36).getItem().shrink(1);
                this.getSlot(37).getItem().shrink(1);
                this.getSlot(38).getItem().shrink(1);
                this.getSlot(39).safeInsert(result, 1);
                this.data.set(0, 0);
            }
        }
    }

    @Override
    public ItemStack quickMoveStack(Player player, int index) {
        var retStack = ItemStack.EMPTY;
        final Slot slot = getSlot(index);
        if (slot.hasItem()) {
            final ItemStack item = slot.getItem();
            retStack = item.copy();
            if (index < 27) {
                if (!moveItemStackTo(item, 27, this.slots.size(), true))
                    return ItemStack.EMPTY;
            } else if (!moveItemStackTo(item, 0, 27, false))
                return ItemStack.EMPTY;

            if (item.isEmpty()) {
                slot.set(ItemStack.EMPTY);
            } else {
                slot.setChanged();
            }
        }

        return retStack;
    }

    @Override
    public boolean stillValid(Player player) {
        return stillValid(this.containerAccess, player, BlockInit.WORKBENCH.get());
    }

    public static MenuConstructor getServerContainer(WorkbenchBlockEntity workbenchBlock, BlockPos pos) {
        return (id, playerInv, player) -> new WorkbenchContainer(id, playerInv, workbenchBlock.inventory, pos,
                new WorkbenchContainerData(workbenchBlock, 1));
    }
}

Screen Class:

package net.xale.satiscraft.screen;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraftforge.client.gui.widget.ExtendedButton;
import net.xale.satiscraft.SatisCraft;
import net.xale.satiscraft.block.entity.WorkbenchBlockEntity;
import net.xale.satiscraft.container.WorkbenchContainer;
import net.xale.satiscraft.crafting.WorkbenchRecipe;
import net.xale.satiscraft.crafting.WorkbenchRecipes;

public class WorkbenchScreen extends AbstractContainerScreen<WorkbenchContainer> {
    private static final ResourceLocation GUI_TEXTURE = new ResourceLocation(SatisCraft.MOD_ID, "textures/gui/workbench.png");
    private ExtendedButton craftbutton;

    public WorkbenchScreen(WorkbenchContainer container, Inventory playerInventory, Component title){
        super(container, playerInventory, title);
        this.leftPos = 0;
        this.topPos = 0;
        this.imageWidth = 176;
        this.imageHeight = 166;
    }

    @Override
    protected void renderBg(PoseStack stack, float mouseX, int mouseY, int partialTicks) {
        RenderSystem.setShader(GameRenderer::getPositionColorTexShader);
        RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
        RenderSystem.setShaderTexture(0, GUI_TEXTURE);
        blit(stack, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
    }

    @Override
    protected void renderLabels(PoseStack stack, int mouseX, int mouseY){
        drawString(stack, font, title, this.leftPos, this.topPos + 2, 0x404040);
        drawString(stack, font, playerInventoryTitle, this.leftPos + 8, this.topPos + 80, 0x404040);
    }

    @Override
    protected void init(){
        super.init();
        this.craftbutton = this.addRenderableWidget(new ExtendedButton(leftPos, topPos, 16, 16, new TextComponent("Craft!"), btn -> {
            if (this.menu.data.get(0) == 0){
                this.menu.data.set(0, 1);
                Minecraft.getInstance().player.displayClientMessage(new TextComponent(String.valueOf(this.menu.data.get(0))), false);
            }
        }));
    }
}

Custom Container Data Class:

package net.xale.satiscraft.container.syncdata;

import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.inventory.ContainerData;
import net.minecraft.world.inventory.SimpleContainerData;
import net.xale.satiscraft.block.entity.WorkbenchBlockEntity;
import net.xale.satiscraft.container.WorkbenchContainer;

public class WorkbenchContainerData extends SimpleContainerData {
    private final WorkbenchBlockEntity blockEntity;
    public WorkbenchContainerData(WorkbenchBlockEntity be, int amount){
        super(amount);
        this.blockEntity = be;
    }

    @Override
    public int get(int key) {
        return switch (key){
            case 0 -> this.blockEntity.canCraft;
            default -> throw new UnsupportedOperationException("There is no value corresponding to key: '" + key +
                    "' in '" + this.blockEntity + "'");
        };
    }

    @Override
    public void set(int key, int value) {
        Minecraft.getInstance().player.displayClientMessage(new TextComponent("Trying to set!"), false);
        switch (key){
            case 0:
                Minecraft.getInstance().player.displayClientMessage(new TextComponent("Setting 0"), false);
                this.blockEntity.canCraft = 1;
                break;
            default:
                throw new UnsupportedOperationException("There is no value corresponding to key: '" + key + "' in '"
                        + this.blockEntity + "'");

        }
    }
}

 

Edited by MrOlegTitov
wrong title
Link to comment
Share on other sites

  • MrOlegTitov changed the title to [1.18.1] Try to craft something if button clicked
15 hours ago, diesieben07 said:

You can call Minecraft#gameMode.handleInventoryButtonClick from your screen. It will then call clickMenuButton on your Menu class on the server.

I've got a bug, when I exit the gui and reopen it, the event stops working when the button is pressed. What can this be connected to?

Link to comment
Share on other sites

7 minutes ago, diesieben07 said:

Show updated code.

Workbench Screen class:

package net.xale.satiscraft.screen;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraftforge.client.gui.widget.ExtendedButton;
import net.xale.satiscraft.SatisCraft;
import net.xale.satiscraft.block.entity.WorkbenchBlockEntity;
import net.xale.satiscraft.container.WorkbenchContainer;
import net.xale.satiscraft.crafting.WorkbenchRecipe;
import net.xale.satiscraft.crafting.WorkbenchRecipes;

public class WorkbenchScreen extends AbstractContainerScreen<WorkbenchContainer> {
    private static final ResourceLocation GUI_TEXTURE = new ResourceLocation(SatisCraft.MOD_ID, "textures/gui/workbench.png");
    private ExtendedButton craftbutton;

    public WorkbenchScreen(WorkbenchContainer container, Inventory playerInventory, Component title){
        super(container, playerInventory, title);
        this.leftPos = 0;
        this.topPos = 0;
        this.imageWidth = 176;
        this.imageHeight = 166;
    }

    @Override
    protected void renderBg(PoseStack stack, float mouseX, int mouseY, int partialTicks) {
        renderBackground(stack);
        bindTexture();

        blit(stack, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
    }

    @Override
    protected void renderLabels(PoseStack stack, int mouseX, int mouseY){

    }

    @Override
    public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) {
        super.render(stack, mouseX, mouseY, partialTicks);

        this.font.draw(stack, this.title, this.leftPos + 20, this.topPos + 5, 0xFFFFFF);
        this.font.draw(stack, this.playerInventoryTitle, this.leftPos + 5, this.topPos + 73, 0x404040);
    }

    @Override
    protected void init(){
        super.init();
        this.craftbutton = this.addRenderableWidget(new ExtendedButton(150, 35, 40, 20, new TextComponent("Craft!"), btn -> {
            Minecraft.getInstance().gameMode.handleInventoryButtonClick(1, 0);
        }));
    }

    public static void bindTexture(){
        RenderSystem.setShader(GameRenderer::getPositionColorTexShader);
        RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
        RenderSystem.setShaderTexture(0, GUI_TEXTURE);
    }
}

WorkbenchContainer class:

package net.xale.satiscraft.container;

import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.SlotItemHandler;
import net.xale.satiscraft.block.entity.WorkbenchBlockEntity;
import net.xale.satiscraft.crafting.WorkbenchRecipes;
import net.xale.satiscraft.init.BlockInit;
import net.xale.satiscraft.init.ContainerInit;

public class WorkbenchContainer extends AbstractContainerMenu {
    private final ContainerLevelAccess containerAccess;

    // Client Constructor
    public WorkbenchContainer(int id, Inventory playerInv) {
        this(id, playerInv, new ItemStackHandler(27), BlockPos.ZERO);
    }

    // Server constructor
    public WorkbenchContainer(int id, Inventory playerInv, IItemHandler slots, BlockPos pos) {
        super(ContainerInit.WORKBENCH.get(), id);
        this.containerAccess = ContainerLevelAccess.create(playerInv.player.level, pos);

        final int slotSizePlus2 = 18, startX = 8, startY = 84, hotbarY = 142;
        for (int column = 0; column < 9; column++) {
            for (int row = 0; row < 3; row++) {
                addSlot(new Slot(playerInv, 9 + row * 9 + column, startX + column * slotSizePlus2, startY + row * slotSizePlus2));
            }

            addSlot(new Slot(playerInv, column, startX + column * slotSizePlus2, hotbarY));
        }

        addSlot(new SlotItemHandler(slots, 0, 30, 35));
        addSlot(new SlotItemHandler(slots, 1, 48, 35));
        addSlot(new SlotItemHandler(slots, 2, 66, 35));
        addSlot(new SlotItemHandler(slots, 3, 125, 35));
    }

    @Override
    public boolean clickMenuButton(Player clickedBy, int buttonId) {
        super.clickMenuButton(clickedBy, buttonId);
        if (buttonId == 0) {
            ItemStack result = WorkbenchRecipes.getInstance().getCraftingResult(this.getSlot(36).getItem(), this.getSlot(37).getItem(), this.getSlot(38).getItem());
            if (result != ItemStack.EMPTY && !this.getSlot(39).hasItem()) {
                this.getSlot(36).getItem().shrink(1);
                this.getSlot(37).getItem().shrink(1);
                this.getSlot(38).getItem().shrink(1);
                this.getSlot(39).safeInsert(result);
            }
        }

        return true;
    }

    @Override
    public ItemStack quickMoveStack(Player player, int index) {
        var retStack = ItemStack.EMPTY;
        final Slot slot = getSlot(index);
        if (slot.hasItem()) {
            final ItemStack item = slot.getItem();
            retStack = item.copy();
            if (index < 27) {
                if (!moveItemStackTo(item, 27, this.slots.size(), true))
                    return ItemStack.EMPTY;
            } else if (!moveItemStackTo(item, 0, 27, false))
                return ItemStack.EMPTY;

            if (item.isEmpty()) {
                slot.set(ItemStack.EMPTY);
            } else {
                slot.setChanged();
            }
        }

        return retStack;
    }

    @Override
    public boolean stillValid(Player player) {
        return stillValid(this.containerAccess, player, BlockInit.WORKBENCH.get());
    }

    public static MenuConstructor getServerContainer(WorkbenchBlockEntity workbenchBlock, BlockPos pos) {
        return (id, playerInv, player) -> new WorkbenchContainer(id, playerInv, workbenchBlock.inventory, pos);
    }
}

 

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

    • Crashlog: https://paste.ee/p/WrGYD I'm thinking the problem might be a client side mod but ive already checked the mod list like 5 times and still cant find the problem
    • I'm unable to join my local forge servers. When running my forge servers of seemingly any version (tested 1.18 to 1.21.1) I get an error message [Forge Version Check/WARN] [ne.mi.fm.VersionChecker/]: Failed to process update information The server continues to start up and run, however I'm unable to join. Looking for solutions? Full error message: (note last "thead warning" error seems to be unrelated and only happened once for 1.20.1) Forge version check warning has happened for every version. [09:52:31] [Forge Version Check/WARN] [ne.mi.fm.VersionChecker/]: Failed to process update information java.net.http.HttpConnectTimeoutException: HTTP connect timed out         at jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:950) ~[java.net.http:?] {}         at jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133) ~[java.net.http:?] {}         at net.minecraftforge.fml.VersionChecker$1.openUrlString(VersionChecker.java:142) ~[fmlcore-1.20.1-47.3.10.jar%23102!/:?] {}         at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:180) ~[fmlcore-1.20.1-47.3.10.jar%23102!/:?] {}         at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {}         at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:117) ~[fmlcore-1.20.1-47.3.10.jar%23102!/:?] {} Caused by: java.net.http.HttpConnectTimeoutException: HTTP connect timed out         at jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:68) ~[java.net.http:?] {}         at jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1788) ~[java.net.http:?] {}         at jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1385) ~[java.net.http:?] {} Caused by: java.net.ConnectException: HTTP connect timed out         at jdk.internal.net.http.ResponseTimerEvent.handle(ResponseTimerEvent.java:69) ~[java.net.http:?] {}         at jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(HttpClientImpl.java:1788) ~[java.net.http:?] {}         at jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1385) ~[java.net.http:?] {} [09:52:31] [Yggdrasil Key Fetcher/ERROR] [mojang/YggdrasilServicesKeyInfo]: Failed to request yggdrasil public key com.mojang.authlib.exceptions.AuthenticationUnavailableException: Cannot contact authentication server         at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:119) ~[authlib-4.0.43.jar%2375!/:?] {}         at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:91) ~[authlib-4.0.43.jar%2375!/:?] {}         at com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.fetch(YggdrasilServicesKeyInfo.java:94) ~[authlib-4.0.43.jar%2375!/:?] {}         at com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo.lambda$get$1(YggdrasilServicesKeyInfo.java:81) ~[authlib-4.0.43.jar%2375!/:?] {}         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?] {}         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[?:?] {}         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?] {}         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] {}         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] {}         at java.lang.Thread.run(Thread.java:1575) ~[?:?] {} Caused by: java.net.SocketTimeoutException: Connect timed out         at sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) ~[?:?] {}         at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[?:?] {}         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?] {}         at java.net.Socket.connect(Socket.java:760) ~[?:?] {}         at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?] {}         at sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?] {}         at sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?] {}         at sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?] {}         at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) ~[?:?] {}         at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) ~[?:?] {}         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?] {}         at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1273) ~[?:?] {}         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1114) ~[?:?] {}         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?] {}         at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1676) ~[?:?] {}         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1600) ~[?:?] {}         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223) ~[?:?] {}         at com.mojang.authlib.HttpAuthenticationService.performGetRequest(HttpAuthenticationService.java:140) ~[authlib-4.0.43.jar%2375!/:?] {}         at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:96) ~[authlib-4.0.43.jar%2375!/:?] {}         ... 9 more [09:52:31] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 5985ms or 119 ticks behind
    • Remove the mod tempad from the mods-folder
    • Hi, deleting the config folder did not appear to work, what mod are you referring to I could try to delete to fix the problem?
    • A friend found this code, but I don't know where. It seems to be very outdated, maybe from 1.12? and so uses TextureManager$loadTexture and TextureManager$deleteTexture which both don't seem to exist anymore. It also uses Minecraft.getMinecraft().mcDataDir.getCanonicalPath() which I replaced with the resource location of my texture .getPath()? Not sure if thats entirely correct. String textureName = "entitytest.png"; File textureFile = null; try { textureFile = new File(Minecraft.getMinecraft().mcDataDir.getCanonicalPath(), textureName); } catch (Exception ex) { } if (textureFile != null && textureFile.exists()) { ResourceLocation MODEL_TEXTURE = Resources.OTHER_TESTMODEL_CUSTOM; TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); texturemanager.deleteTexture(MODEL_TEXTURE); Object object = new ThreadDownloadImageData(textureFile, null, MODEL_TEXTURE, new ImageBufferDownload()); texturemanager.loadTexture(MODEL_TEXTURE, (ITextureObject)object); return true; } else { return false; }   Then I've been trying to go through the source code of the reload resource packs from minecraft, to see if I can "cache" some data and simply reload some textures and swap them out, but I can't seem to figure out where exactly its "loading" the texture files and such. Minecraft$reloadResourcePacks(bool) seems to be mainly controlling the loading screen, and using this.resourcePackRepository.reload(); which is PackRepository$reload(), but that function seems to be using this absolute confusion of a line List<String> list = this.selected.stream().map(Pack::getId).collect(ImmutableList.toImmutableList()); and then this.discoverAvailable() and this.rebuildSelected. The rebuild selected seemed promising, but it seems to just be going through each pack and doing this to them? pack.getDefaultPosition().insert(list, pack, Functions.identity(), false); e.g. putting them into a list of packs and returning that into this.selected? Where do the textures actually get baked/loaded/whatever? Any info on how Minecraft reloads resource packs or how the texture manager works would be appreciated!
  • Topics

×
×
  • Create New...

Important Information

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