Jump to content

Recommended Posts

Posted

I'm having problems with rendering my custom chest using animated texture. I'm using TESR with code from ender chest. The problem is that TileEntitySpecialRenderer#bindTexture() doesn't support animated textures. I also tried adding my texture to the TextureMap but I don't know how to use AtlasSprite in this renderer. Any help would be appreciated.

Here is my TileEntitySpecialRenderer:

Spoiler

package com.d4rsorc.ultimatestorage.tile;

import com.d4rsorc.ultimatestorage.UltimateStorage;

import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class TESRUltimateChest extends TileEntitySpecialRenderer<TileEntityInfiniteStorage>
{
	private static final ResourceLocation ULTIMATE_CHEST_TEXTURE = new ResourceLocation(UltimateStorage.MODID + ":textures/blocks/ultimate_chest.png");
    private final ModelChest modelChest = new ModelChest();

    public void render(TileEntityInfiniteStorage te, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
    {
        int i = 0;

        if (te.hasWorld())
        {
            i = te.getBlockMetadata();
        }

        if (destroyStage >= 0)
        {
            this.bindTexture(DESTROY_STAGES[destroyStage]);
            GlStateManager.matrixMode(5890);
            GlStateManager.pushMatrix();
            GlStateManager.scale(4.0F, 4.0F, 1.0F);
            GlStateManager.translate(0.0625F, 0.0625F, 0.0625F);
            GlStateManager.matrixMode(5888);
        }
        else
        {
        	this.bindTexture(ULTIMATE_CHEST_TEXTURE);
        }
        

        GlStateManager.pushMatrix();
        
        GlStateManager.enableRescaleNormal();
        GlStateManager.color(1.0F, 1.0F, 1.0F, alpha);
        GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F);
        GlStateManager.scale(1.0F, -1.0F, -1.0F);
        GlStateManager.translate(0.5F, 0.5F, 0.5F);     
        
        int j = 0;

        if (i == 2)
        {
            j = 180;
        }

        if (i == 3)
        {
            j = 0;
        }

        if (i == 4)
        {
            j = 90;
        }

        if (i == 5)
        {
            j = -90;
        }

        GlStateManager.rotate((float)j, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(-0.5F, -0.5F, -0.5F);
        float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks;
        f = 1.0F - f;
        f = 1.0F - f * f * f;
        this.modelChest.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F));
        this.modelChest.renderAll();
        GlStateManager.disableRescaleNormal();
        GlStateManager.popMatrix();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

        if (destroyStage >= 0)
        {
            GlStateManager.matrixMode(5890);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
        }
    }

}

 

 

Posted

Yea, I tried that and that's what I got:

Spoiler

2018-12-08_23_29_04.png.8c14c058f86a34070d4c66885bc17056.png2018-12-08_23_29_05.png.50b23ef3eab1759c4e9506bcc9e39725.png

If I bind the global texture map I need somehow get only the part where my texture is. The only solution I can think of rn is to split my animation into single frames and bind different texture corresponding to frame I want to render.

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

    • I've had this problem for a long time.  I tried uninstalling and reinstalling drivers, I've tried running different mods, nothing is working so far and I wanted to try reaching out finally     [11:49:27] [main/INFO]:ModLauncher running: args [--username, Blankx04, --version, forge-45.3.0, --gameDir, C:\Users\bleed\curseforge\minecraft\Instances\For A Week, --assetsDir, C:\Users\bleed\curseforge\minecraft\Install\assets, --assetIndex, 3, --uuid, 7890f19cddfc46cbac4dd27b0b6d91d4, --accessToken, ????????, --clientId, NGJjZWNiMzEtNWRmNC00MTlhLThkMjMtNmU5ZmFkNjRhZTMx, --xuid, 2535417508633963, --userType, msa, --versionType, release, --width, 1024, --height, 768, --launchTarget, forgeclient, --fml.forgeVersion, 45.3.0, --fml.mcVersion, 1.19.4, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230314.122934] [11:49:27] [main/INFO]: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 [11:49:28] [main/INFO]:SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/bleed/curseforge/minecraft/Install/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2397!/ Service=ModLauncher Env=CLIENT [11:49:29] [main/INFO]:Found mod file Animation_Overhaul-forge-1.19.x-1.3.1.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file bettercombat-forge-1.7.1+1.19.4.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file biomemusic-1.19.4-1.7.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file BiomesOPlenty-1.19.4-17.3.0.542.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file Bookshelf-Forge-1.19.4-18.0.6.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file cloth-config-10.1.135-forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file CorgiLib-forge-1.19.4-3.0.0.0.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file geckolib-forge-1.19.4-4.2.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file jei-1.19.4-forge-13.1.0.15.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file macawsbridgesbop-1.19.3-1.4.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file macawsbridgesbyg-1.19.3-1.4.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file macawsroofsbop-1.19.3-1.3.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file macawsroofsbyg-1.19.3-1.1.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-bridges-3.0.1-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-doors-1.1.1forge-mc1.19.4.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-fences-1.1.2-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-furniture-3.3.0-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-holidays-1.1.0-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-lights-1.1.0-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-paintings-1.0.5-1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-paths-1.0.5-1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-roofs-2.3.1-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-stairs-1.0.0-1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-trapdoors-1.1.4-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcw-windows-2.3.0-mc1.19.4forge.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods} [11:49:29] [main/INFO]:Found mod file mcwbridgesmoddinglegacy-1.19.4-1.1.jar of type MOD with provider {mods folder locator at C:\Users\bleed\curseforge\minecraft\Instances\For A Week\mods}
    • The error in the console Starting Gradle Daemon... Gradle Daemon started in 2 s 964 ms FAILURE: Build failed with an exception. * Where: Build file 'C:\Data\forge-1.20.1-47.3.22-mdk\build.gradle' line: 5 * What went wrong: Could not apply requested plugin [id: 'net.minecraftforge.gradle', version: '[6.0,6.2)'] as it does not provide a plugin with id 'net.minecraftforge.gradle'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s). > Plugin with id 'net.minecraftforge.gradle' not found. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 6s The 'error line is "id 'net.minecraftforge.gradle' version '[6.0,6.2)'" which is the code that came with the mdk. I can also give the build.gradle file if you think that'll help. How do I get the plugin to work again? I didnt even touch it. It seems to have broken on its own. Any help is appreciated! Thanks!  
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • Add the new crash-report
    • Everytime i try to launch Minecraft at 1.20.1 with the forge version, the game wont start, telling me a error happened, even without mods loaded, the error only happens with forge, every other mod loader or vanilla opens the game normally, what should i do? i have no clue.
  • Topics

×
×
  • Create New...

Important Information

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