Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TextureFX


mrkarp
 Share

Recommended Posts

So to my understanding, this is how you get a block to look animated right, such as:

 

http://xycraft.wikispaces.com/Xychoridite+Bricks

 

They look all wavey and liquid like. Ive seen multiple listings on how to accomplish this, but I am still unable to even get the code right.

 

Here is the example code I have been following.

private byte bg[] = new byte[1024];

public TextureSomethingFX() {
        super(myIconIndex);
        try {
                loadBG(ImageIO.read(this.getClass().getResource("textures/background.png")));
        } catch (IOException e) {
                e.printStackTrace();
        }
}

private void loadBG(BufferedImage bi) {
        for (int row=0;row<16;row++)
                for (int col=0;col<16;col++) {
                        int pixel = bi.getRGB(col, row);
                        bg [((col+(row*16))*4)+0] = (byte)((pixel>>16)&0xFF); //Red
                        bg[((col+(row*16))*4)+1] = (byte)((pixel>>&0xFF); //Green
                        bg [((col+(row*16))*4)+2] = (byte)((pixel)&0xFF); //Blue
                        bg [((col+(row*16))*4)+3] = (byte)((pixel>>24)&0xFF); //Alpha
                }
}

 

Now, I know to replace the

                loadBG(ImageIO.read(this.getClass().getResource("textures/background.png")));

 

With the png I have, but do I put this code in my block code, or my core mod file?

 

And also, this will have 16 diffrent cycles right?

 

Appreciate it.

Link to comment
Share on other sites

Well after reading more and more, It looks like instead of tryin the advanced way, making a byte array, Looks like i should use the .gif method:

 

public void onTick() {
        Object imageData;
	switch (frame) {
        case 0:
                imageData = frame1;
                break;
        case 1:
                imageData = frame2;
                break;
        case 2:
                imageData = frame3;
                break;
        case 3:
                imageData = frame4;
                break; 
        default:
                break;
        }
}

 

But, what does the frame 1-4 mean, I think I replace them with the texture slot I want right?

Link to comment
Share on other sites

Wow was i tryin to hard! But im still struggling, almost!!!! almost!

 

Here is my FX class:

package karbide.FX;

import java.io.IOException;

import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.src.ModTextureAnimation;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.TextureFXManager;

public class KbrickFX extends ModTextureAnimation
{
public KbrickFX(String texture, int index) throws IOException
{
	super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 5);
}

@Override
    public void bindImage(RenderEngine renderengine)
    {
    	//Binds texture with GL11 to use specific icon index.
        GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderengine.getTexture("/gfx/tools.png"));
    }

}

 

and here is the block that im tryin to animated:

package karbide.blocks;

import java.util.Random;

import karbide.client.ClientProxy;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.world.World;

public class Block_KBrick extends Block{

public Block_KBrick(int id, int texture, Material mat){
	super(id, texture, mat);
	this.setCreativeTab(CreativeTabs.tabBlock);
}

public String getTextureFile(){
	return "/gfx/block_block.png";
}

@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
	return ClientProxy.RENDER_ID;
}
public boolean renderAsNormalBlock()
{
	return false;
}

public boolean isOpaqueCube()
{
	return false;
}

}

 

I also noticed that I need

			TextureFXManager.instance().addAnimation(new KbrickFX("/gfx/tools.png", KarbideCore.ANIMATED_TEXTURE_INDEX+1));
	} catch (IOException e) {
		e.printStackTrace();
	}

 

And

 

	public static int RENDER_ID = RenderingRegistry.getNextAvailableRenderId();

 

In my client proxy.

 

I know im close becuase its no longer the original texture, its clear, see through, but thats a start. Im catching on, just need some help in what is causing it to not read the png file.

 

Appreciate all the 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
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • How do i exactly change the time from day to night when an entity  is spawned thanks
    • ---- Minecraft Crash Report ---- // There are four lights! Time: 9/28/22, 4:08 PM Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed     at net.minecraftforge.logging.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:55) ~[forge-1.18.2-40.1.0-universal.jar%2359!/:?] {re:classloading}     at net.minecraftforge.client.loading.ClientModLoader.completeModLoading(ClientModLoader.java:169) ~[forge-1.18.2-40.1.0-universal.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.lambda$new$1(Minecraft.java:555) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.Util.m_137521_(Util.java:556) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,xf:OptiFine:default,re:mixin,xf:OptiFine:default}     at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:549) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.gui.screens.LoadingOverlay.m_6305_(LoadingOverlay.java:196) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,xf:OptiFine:default}     at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:1256) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:accesstransformer:B,xf:OptiFine:default}     at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1044) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:663) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2355!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.1.0.jar%2316!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:138) ~[securejarhandler-1.0.3.jar:?] {} -- MOD epicfight -- Details:     Caused by 0: java.lang.NoClassDefFoundError: net/minecraftforge/client/event/RenderLevelStageEvent         at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?] {}         at java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[?:?] {}         at java.lang.Class.privateGetPublicMethods(Class.java:3427) ~[?:?] {}         at java.lang.Class.getMethods(Class.java:2019) ~[?:?] {}         at net.minecraftforge.eventbus.EventBus.registerClass(EventBus.java:75) ~[eventbus-5.0.3.jar%232!/:?] {}         at net.minecraftforge.eventbus.EventBus.register(EventBus.java:118) ~[eventbus-5.0.3.jar%232!/:?] {}         at net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber.lambda$inject$6(AutomaticEventSubscriber.java:61) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}         at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {}         at net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:48) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}         at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:77) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}         at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:106) ~[fmlcore-1.18.2-40.1.0.jar%2356!/:?] {}         at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}         at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}         at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}         at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}         at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:computing_frames}         at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:computing_frames}         at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}     Mod File: EpicFight-18.3.6.jar     Failure message: Epic Fight (epicfight) has failed to load correctly         java.lang.NoClassDefFoundError: net/minecraftforge/client/event/RenderLevelStageEvent     Mod Version: 18.3.6     Mod Issue URL: NOT PROVIDED     Exception message: java.lang.ClassNotFoundException: net.minecraftforge.client.event.RenderLevelStageEvent Stacktrace:     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:138) ~[securejarhandler-1.0.3.jar:?] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {}     at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?] {}     at java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[?:?] {}     at java.lang.Class.privateGetPublicMethods(Class.java:3427) ~[?:?] {}     at java.lang.Class.getMethods(Class.java:2019) ~[?:?] {}     at net.minecraftforge.eventbus.EventBus.registerClass(EventBus.java:75) ~[eventbus-5.0.3.jar%232!/:?] {}     at net.minecraftforge.eventbus.EventBus.register(EventBus.java:118) ~[eventbus-5.0.3.jar%232!/:?] {}     at net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber.lambda$inject$6(AutomaticEventSubscriber.java:61) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}     at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {}     at net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:48) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}     at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:77) ~[javafmllanguage-1.18.2-40.1.0.jar%2357!/:?] {}     at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:106) ~[fmlcore-1.18.2-40.1.0.jar%2356!/:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}     at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}     at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}     at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:computing_frames}     at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:computing_frames}     at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {} -- System Details -- Details:     Minecraft Version: 1.18.2     Minecraft Version ID: 1.18.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 17.0.1, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 904468768 bytes (862 MiB) / 1409286144 bytes (1344 MiB) up to 2147483648 bytes (2048 MiB)     CPUs: 8     Processor Vendor: GenuineIntel     Processor Name: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz     Identifier: Intel64 Family 6 Model 60 Stepping 3     Microarchitecture: Haswell (Client)     Frequency (GHz): 3.49     Number of physical packages: 1     Number of physical CPUs: 4     Number of logical CPUs: 8     Graphics card #0 name: Radeon RX 580 Series     Graphics card #0 vendor: Advanced Micro Devices, Inc. (0x1002)     Graphics card #0 VRAM (MB): 4095.00     Graphics card #0 deviceId: 0x67df     Graphics card #0 versionInfo: DriverVersion=30.0.15021.11005     Memory slot #0 capacity (MB): 8192.00     Memory slot #0 clockSpeed (GHz): 1.60     Memory slot #0 type: DDR3     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 1.60     Memory slot #1 type: DDR3     Virtual memory max (MB): 18753.45     Virtual memory used (MB): 15457.49     Swap memory total (MB): 2432.00     Swap memory used (MB): 75.07     JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     OptiFine Version: OptiFine_1.18.2_HD_U_H7     OptiFine Build: 20220410-185216     Render Distance Chunks: 8     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: ComplementaryShaders_v4.4.zip     OpenGlVersion: 3.2.14800 Core Profile Forward-Compatible Context 22.5.1 30.0.15021.11005     OpenGlRenderer: Radeon RX 580 Series     OpenGlVendor: ATI Technologies Inc.     CpuCount: 8     ModLauncher: 9.1.3+9.1.3+main.9b69c82a     ModLauncher launch target: forgeclient     ModLauncher naming: srg     ModLauncher services:           mixin PLUGINSERVICE           eventbus PLUGINSERVICE           slf4jfixer PLUGINSERVICE           object_holder_definalize PLUGINSERVICE           runtime_enum_extender PLUGINSERVICE           capability_token_subclass PLUGINSERVICE           accesstransformer PLUGINSERVICE           runtimedistcleaner PLUGINSERVICE           mixin TRANSFORMATIONSERVICE           OptiFine TRANSFORMATIONSERVICE           fml TRANSFORMATIONSERVICE      FML Language Providers:          minecraft@1.0         javafml@null     Mod List:          client-1.18.2-20220404.173914-srg.jar             |Minecraft                     |minecraft                     |1.18.2              |COMMON_SET|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         simplyswordsforge-1.20-1.18.2.jar                 |Simply Swords                 |simplyswords                  |1.20-1.18.2         |COMMON_SET|Manifest: NOSIGNATURE         forge-1.18.2-40.1.0-universal.jar                 |Forge                         |forge                         |40.1.0              |COMMON_SET|Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90         EpicFight-18.3.6.jar                              |Epic Fight                    |epicfight                     |18.3.6              |ERROR     |Manifest: NOSIGNATURE     Crash Report UUID: 93c1caaa-073c-4695-948c-8d4ccaec1ccc     FML: 40.1     Forge: net.minecraftforge:40.1.0
    • latest.log: https://pastebin.com/rr9u8wz3 The server can startup with Industrial Reborn, but crashes on startup with Terraforged (it doesn't even generate a world before it crashes). Error with Mixin or with Java util.Map class loading? This happens with Minecraft 1.18.1 (newest version that Industrial Reborn is for) and this happens with both the Forge server version 39.1.0 and 39.1.2 (version 39.1.2 is the one used with the log I pasted). This happens with many other individual mods too, not just TerraForged. Clean Forge server install with only those two mods dropped in when I generated that log file. Edit: This happens with Minecraft 1.18.2 as well. Forge version 40.1.80. Clean Forge server install with no mods started up fine and generated a world, adding in TerraForged makes it crash on startup. These logs were produced with one mod, only TerraForged. latest.log: https://pastebin.com/RRKZmnem debug.log: https://pastebin.com/j6NwA8zE
    • sorry for the late reply.  Thank you very much, that worked!
    • I am a idiot. I noticed the problem finally. EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER, EntityWanderingRaider::new); it should be this instead EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER.get(), RendererWanderingRaider::new); I hate myself
  • Topics

×
×
  • Create New...

Important Information

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