Jump to content

[1.12] [Solved] Adding Custom Particle Effects with Custom Texture


GooberGunter

Recommended Posts

So I've been looking around for tutorials on custom particles and I can't find any up-to-date tutorials or anything on the forge doc. So far from what I can tell, spawning custom particles is different from vanilla since the spawnParticle method relies on the actual EnumParticleTypeClass. 

 

Basically, what I want to do is, when I place down a block, that block starts to slowly emit a purple particle effect. I already have the particle class, I just don't know how to get the block's position (which I think is impossible) or how to set the particles to start spawning from the block

 

ParticleManu.java:

Spoiler

package com.ninja3659.explorationexpansion.client.particle;

import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleBubble;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class ParticleManu extends ParticleBubble{

	
	public ParticleManu(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn,
			double ySpeedIn, double zSpeedIn) {
		super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
        this.setParticleTextureIndex(32);
        this.setRBGColorF(0x8A, 0x2B, 0xE2);
	}	
	

}

 

 

Edited by GooberGunter
Link to comment
Share on other sites

8 minutes ago, GooberGunter said:

Basically, what I want to do is, when I place down a block, that block starts to slowly emit a purple particle effect. I already have the particle class, I just don't know how to get the block's position (which I think is impossible) or how to set the particles to start spawning from the block

See how BlockFurnace does this.

Custom particles are a thing that is not easily done afaik. You either need to add an enum constant to the EnumParticleType using EnumHelper and register your particle factory for the particleID you specify in your enum constant or you need to build your own particle system from the ground.

Link to comment
Share on other sites

From the looks of it, the textureAtlasSprite class, which is what loads the texture for particles, has a built in forge method that allows for custom textures. if I'm looking at this right, it's promising.

Spoiler

TextureAtlasSprite.class



    /*===================================== FORGE START =====================================*/
    /**
     * The result of this function determines is the below 'load' function is called, and the
     * default vanilla loading code is bypassed completely.
     * @param manager Main resource manager
     * @param location File resource location
     * @return True to use your own custom load code and bypass vanilla loading.
     */
    public boolean hasCustomLoader(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location)
    {
        return false;
    }

    /**
     * Load the specified resource as this sprite's data.
     * Returning false from this function will prevent this icon from being stitched onto the master texture.
     * @param manager Main resource manager
     * @param location File resource location
     * @param textureGetter accessor for dependencies. All of them will be loaded before this one
     * @return False to prevent this Icon from being stitched
     */
    public boolean load(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location, java.util.function.Function<ResourceLocation, TextureAtlasSprite> textureGetter)
    {
        return true;
    }

    /**
     * @return all textures that should be loaded before this texture.
     */
    public java.util.Collection<ResourceLocation> getDependencies() {
        return com.google.common.collect.ImmutableList.of();
    }

    /*===================================== FORGE END ======================================*/
}

 

EDIT: It looks like I need a resource manager AND resource location. Sadly, I don't know how to do resource managers

Edited by GooberGunter
Link to comment
Share on other sites

I've gotten as far as the resource manager, but I don't know how to set up the resource manager.

Spoiler

public ParticleManu(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn,
			double ySpeedIn, double zSpeedIn) {
		super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
        this.setParticleTextureIndex(32);
        this.particleRed = 1;
        this.particleBlue = 1;
        this.particleGreen = 0;
        this.particleMaxAge = 100000;
		this.particleTexture.hasCustomLoader(manager, particleTex);//figure out the Resource Manager
	}	

 

 

Link to comment
Share on other sites

3 minutes ago, GooberGunter said:

I've gotten as far as the resource manager, but I don't know how to set up the resource manager.

I'm not sure if you need to create your own IResourceManager for this(I don't really think you do, but I may be mistaken), but you can get a IResourceManager instance like so.

Minecraft.getMinecraft().getResourceManager();

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I tried that and it gave me the following null exception:

Spoiler

[13:16:59] [main/FATAL]: Unreported exception thrown!
java.lang.NullPointerException: null
    at com.ninja3659.explorationexpansion.client.particle.ParticleManu.<init>(ParticleManu.java:27) ~[ParticleManu.class:?]
    at com.ninja3659.explorationexpansion.proxy.ClientProxy.generateManuPart(ClientProxy.java:88) ~[ClientProxy.class:?]
    at com.ninja3659.explorationexpansion.blocks.BlockManuCogBlockH.randomDisplayTick(BlockManuCogBlockH.java:38) ~[BlockManuCogBlockH.class:?]
    at net.minecraft.client.multiplayer.WorldClient.showBarrierParticles(WorldClient.java:386) ~[WorldClient.class:?]
    at net.minecraft.client.multiplayer.WorldClient.doVoidFogParticles(WorldClient.java:374) ~[WorldClient.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2002) ~[Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1171) ~[Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_131]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_131]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:26) [start/:?]
[13:16:59] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:630]: ---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!

Time: 7/21/17 1:16 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at com.ninja3659.explorationexpansion.client.particle.ParticleManu.<init>(ParticleManu.java:27)
    at com.ninja3659.explorationexpansion.proxy.ClientProxy.generateManuPart(ClientProxy.java:88)
    at com.ninja3659.explorationexpansion.blocks.BlockManuCogBlockH.randomDisplayTick(BlockManuCogBlockH.java:38)
    at net.minecraft.client.multiplayer.WorldClient.showBarrierParticles(WorldClient.java:386)
    at net.minecraft.client.multiplayer.WorldClient.doVoidFogParticles(WorldClient.java:374)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2002)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1171)
    at net.minecraft.client.Minecraft.run(Minecraft.java:436)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at com.ninja3659.explorationexpansion.client.particle.ParticleManu.<init>(ParticleManu.java:27)
    at com.ninja3659.explorationexpansion.proxy.ClientProxy.generateManuPart(ClientProxy.java:88)
    at com.ninja3659.explorationexpansion.blocks.BlockManuCogBlockH.randomDisplayTick(BlockManuCogBlockH.java:38)
    at net.minecraft.client.multiplayer.WorldClient.showBarrierParticles(WorldClient.java:386)
    at net.minecraft.client.multiplayer.WorldClient.doVoidFogParticles(WorldClient.java:374)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityPlayerSP['Player593'/79, l='MpServer', x=1515.43, y=64.00, z=1510.11]]
    Chunk stats: MultiplayerChunkCache: 656, 656
    Level seed: 0
    Level generator: ID 01 - flat, ver 0. Features enabled: false
    Level generator options: 
    Level spawn location: World: (1480,4,1316), Chunk: (at 8,0,4 in 92,82; contains blocks 1472,0,1312 to 1487,255,1327), Region: (2,2; contains chunks 64,64 to 95,95, blocks 1024,0,1024 to 1535,255,1535)
    Level time: 9746 game time, 9746 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 79 total; [EntityPlayerSP['Player593'/79, l='MpServer', x=1515.43, y=64.00, z=1510.11], EntityItem['item.item.seeds'/138, l='MpServer', x=1512.98, y=64.00, z=1556.99], EntityCreeper['Creeper'/139, l='MpServer', x=1548.50, y=25.00, z=1525.18], EntityBat['Bat'/140, l='MpServer', x=1535.90, y=31.10, z=1536.37], EntityCreeper['Creeper'/150, l='MpServer', x=1472.50, y=64.00, z=1507.50], EntityCreeper['Creeper'/27, l='MpServer', x=1467.70, y=64.00, z=1495.70], EntitySkeleton['Skeleton'/28, l='MpServer', x=1460.72, y=64.00, z=1495.50], EntitySkeleton['Skeleton'/29, l='MpServer', x=1463.96, y=64.00, z=1490.96], EntityZombie['Zombie'/30, l='MpServer', x=1461.30, y=64.00, z=1510.70], EntityBat['Bat'/33, l='MpServer', x=1480.47, y=54.51, z=1441.43], EntityBat['Bat'/34, l='MpServer', x=1480.55, y=54.90, z=1442.80], EntityZombie['Zombie'/35, l='MpServer', x=1475.70, y=64.00, z=1488.30], EntityBat['Bat'/41, l='MpServer', x=1503.57, y=49.10, z=1487.29], EntityBat['Bat'/42, l='MpServer', x=1503.39, y=49.05, z=1489.31], EntityCreeper['Creeper'/43, l='MpServer', x=1497.50, y=64.00, z=1503.50], EntityCreeper['Creeper'/44, l='MpServer', x=1495.50, y=64.00, z=1504.50], EntitySpider['Spider'/174, l='MpServer', x=1570.70, y=31.00, z=1557.21], EntityItem['item.item.string'/175, l='MpServer', x=1572.88, y=31.00, z=1566.57], EntityBat['Bat'/48, l='MpServer', x=1508.95, y=47.13, z=1483.89], EntitySpider['Spider'/176, l='MpServer', x=1573.50, y=31.00, z=1560.50], EntityZombie['Zombie'/49, l='MpServer', x=1507.44, y=48.00, z=1489.72], EntitySpider['Spider'/177, l='MpServer', x=1571.50, y=31.00, z=1562.50], EntityMinecartChest['Minecart with Chest'/50, l='MpServer', x=1559.50, y=29.06, z=1515.50], EntitySkeleton['Skeleton'/178, l='MpServer', x=1572.50, y=31.00, z=1563.50], EntityCreeper['Creeper'/51, l='MpServer', x=1561.50, y=26.00, z=1516.50], EntitySkeleton['Skeleton'/179, l='MpServer', x=1573.50, y=31.00, z=1563.50], EntitySkeleton['Skeleton'/52, l='MpServer', x=1569.50, y=28.00, z=1496.50], EntitySkeleton['Skeleton'/180, l='MpServer', x=1576.50, y=31.00, z=1556.50], EntityCreeper['Creeper'/53, l='MpServer', x=1568.50, y=26.00, z=1516.50], EntityCreeper['Creeper'/181, l='MpServer', x=1577.50, y=31.00, z=1557.50], EntityCreeper['Creeper'/54, l='MpServer', x=1583.77, y=30.00, z=1506.48], EntityCreeper['Creeper'/182, l='MpServer', x=1573.80, y=31.00, z=1562.43], EntitySkeleton['Skeleton'/183, l='MpServer', x=1575.50, y=31.00, z=1563.50], EntitySkeleton['Skeleton'/184, l='MpServer', x=1575.50, y=32.00, z=1566.50], EntitySquid['Squid'/185, l='MpServer', x=1572.14, y=62.18, z=1566.76], EntityMinecartChest['Minecart with Chest'/186, l='MpServer', x=1560.50, y=32.06, z=1581.50], EntityBat['Bat'/187, l='MpServer', x=1566.75, y=33.10, z=1579.25], EntityCreeper['Creeper'/188, l='MpServer', x=1587.50, y=30.00, z=1536.50], EntityZombie['Zombie'/193, l='MpServer', x=1591.50, y=34.00, z=1550.50], EntityZombie['Zombie'/195, l='MpServer', x=1593.50, y=34.00, z=1549.50], EntitySkeleton['Skeleton'/197, l='MpServer', x=1593.50, y=33.00, z=1529.50], EntityBat['Bat'/201, l='MpServer', x=1588.25, y=35.10, z=1558.88], EntityBat['Bat'/202, l='MpServer', x=1589.02, y=34.00, z=1553.27], EntityMinecartChest['Minecart with Chest'/203, l='MpServer', x=1569.51, y=33.06, z=1580.50], EntitySpider['Spider'/204, l='MpServer', x=1578.32, y=34.50, z=1579.70], EntityMinecartChest['Minecart with Chest'/211, l='MpServer', x=1559.50, y=29.06, z=1520.50], EntityMinecartChest['Minecart with Chest'/212, l='MpServer', x=1554.50, y=29.06, z=1525.50], EntityBat['Bat'/213, l='MpServer', x=1557.13, y=25.10, z=1529.41], EntitySkeleton['Skeleton'/214, l='MpServer', x=1563.53, y=24.00, z=1531.28], EntityCreeper['Creeper'/215, l='MpServer', x=1565.50, y=30.00, z=1529.50], EntityZombie['Zombie'/216, l='MpServer', x=1563.50, y=30.00, z=1527.50], EntityCreeper['Creeper'/217, l='MpServer', x=1561.50, y=24.00, z=1530.50], EntityMinecartChest['Minecart with Chest'/218, l='MpServer', x=1579.50, y=31.06, z=1547.50], EntityBat['Bat'/219, l='MpServer', x=1575.75, y=31.10, z=1538.93], EntitySkeleton['Skeleton'/220, l='MpServer', x=1573.47, y=30.00, z=1537.91], EntitySkeleton['Skeleton'/221, l='MpServer', x=1572.50, y=30.00, z=1536.50], EntitySkeleton['Skeleton'/222, l='MpServer', x=1574.50, y=30.00, z=1541.24], EntityCreeper['Creeper'/223, l='MpServer', x=1560.81, y=35.00, z=1559.51], EntityMinecartChest['Minecart with Chest'/224, l='MpServer', x=1577.50, y=30.06, z=1525.50], EntityZombie['Zombie'/225, l='MpServer', x=1573.30, y=30.00, z=1530.95], EntitySkeleton['Skeleton'/226, l='MpServer', x=1582.30, y=30.00, z=1534.70], EntityZombie['Zombie'/227, l='MpServer', x=1582.89, y=30.00, z=1534.70], EntitySheep['Sheep'/100, l='MpServer', x=1464.22, y=64.00, z=1583.76], EntityZombie['Zombie'/228, l='MpServer', x=1573.50, y=30.00, z=1524.50], EntityZombie['Zombie'/229, l='MpServer', x=1573.50, y=30.00, z=1524.50], EntityZombie['Zombie'/230, l='MpServer', x=1569.43, y=30.00, z=1528.98], EntitySkeleton['Skeleton'/231, l='MpServer', x=1575.50, y=30.00, z=1524.50], EntityZombie['Zombie'/232, l='MpServer', x=1576.65, y=33.00, z=1527.21], EntitySkeleton['Skeleton'/233, l='MpServer', x=1577.48, y=33.00, z=1525.69], EntityBat['Bat'/236, l='MpServer', x=1591.15, y=35.07, z=1570.29], EntitySkeleton['Skeleton'/237, l='MpServer', x=1591.50, y=34.00, z=1582.50], EntitySkeleton['Skeleton'/238, l='MpServer', x=1580.95, y=33.00, z=1589.39], EntitySpider['Spider'/240, l='MpServer', x=1570.50, y=34.00, z=1588.50], EntitySkeleton['Skeleton'/241, l='MpServer', x=1578.50, y=33.00, z=1585.50], EntityZombie['Zombie'/245, l='MpServer', x=1595.30, y=32.00, z=1586.30], EntitySkeleton['Skeleton'/247, l='MpServer', x=1593.50, y=34.00, z=1584.50], EntityCreeper['Creeper'/248, l='MpServer', x=1589.50, y=33.00, z=1588.50], EntityCreeper['Creeper'/249, l='MpServer', x=1590.30, y=34.00, z=1586.30], EntitySkeleton['Skeleton'/250, l='MpServer', x=1592.70, y=34.00, z=1586.70]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:456)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2868)
    at net.minecraft.client.Minecraft.run(Minecraft.java:465)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
    Minecraft Version: 1.12
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 581193416 bytes (554 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.40 Powered by Forge 14.21.1.2415 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA    minecraft{1.12} [Minecraft] (minecraft.jar) 
    UCHIJAAAA    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAA    FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2415.jar) 
    UCHIJAAAA    forge{14.21.1.2415} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2415.jar) 
    UCHIJAAAA    neem{1.0-alpha} [Exploration Expansion] (bin) 
    Loaded coremods (and transformers): 
    GL info: ' Vendor: 'Intel' Version: '4.4.0 - Build 21.20.16.4550' Renderer: 'Intel(R) HD Graphics 520'
    Launched Version: 1.12
    LWJGL: 2.9.4
    OpenGL: Intel(R) HD Graphics 520 GL version 4.4.0 - Build 21.20.16.4550, Intel
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
[13:16:59] [Server thread/INFO] [FML]: Applying holder lookups
[13:16:59] [Server thread/INFO] [FML]: Holder lookups applied
[13:16:59] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:630]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\JEHan\Desktop\Exploration Expanded\run\.\crash-reports\crash-2017-07-21_13.16.59-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
 

 

Link to comment
Share on other sites

3 minutes ago, GooberGunter said:

I tried that and it gave me the following null exception:

Where are you initializing ParticleManu?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

In the client proxy class:

Spoiler

package com.ninja3659.explorationexpansion.proxy;

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.lwjgl.opengl.GL11;

import com.ninja3659.explorationexpansion.Reference;
import com.ninja3659.explorationexpansion.blocks.BlockManuCogBlockH;
import com.ninja3659.explorationexpansion.init.ModBlocks;
import com.ninja3659.explorationexpansion.init.ModEntities;
import com.ninja3659.explorationexpansion.init.ModItems;
import com.ninja3659.explorationexpansion.init.ModTools;
import com.ninja3659.explorationexpansion.client.entities.EntityBeelzebook;
import com.ninja3659.explorationexpansion.client.entities.EntityChimera;
import com.ninja3659.explorationexpansion.client.entities.EntityMindFlayer;
import com.ninja3659.explorationexpansion.client.model.ModelChimera;
import com.ninja3659.explorationexpansion.client.particle.ParticleManu;
import com.ninja3659.explorationexpansion.client.renders.RenderBeelzebook;
import com.ninja3659.explorationexpansion.client.renders.RenderChimera;
import com.ninja3659.explorationexpansion.client.renders.RenderFlayer;
import com.ninja3659.explorationexpansion.util.Utils;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelCow;
import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.chunk.IRenderChunkFactory;
import net.minecraft.client.renderer.chunk.RenderChunk;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderFallingBlock;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import scala.collection.parallel.ParIterableLike.Min;

public class ClientProxy extends CommonProxy {
	
	@Override
	public void registerRenders() {
		RenderingRegistry.registerEntityRenderingHandler(EntityChimera.class, new IRenderFactory<EntityChimera>() {

			@Override
			public Render<? super EntityChimera> createRenderFor(RenderManager manager) {
				return new RenderChimera(manager);
			}
		
		});
		RenderingRegistry.registerEntityRenderingHandler(EntityMindFlayer.class, new IRenderFactory<EntityMindFlayer>() {
			
			@Override
			public Render<? super EntityMindFlayer> createRenderFor(RenderManager manager) {
				return new RenderFlayer(manager);
			}
		});
		RenderingRegistry.registerEntityRenderingHandler(EntityBeelzebook.class, new IRenderFactory<EntityBeelzebook>() {

			@Override
			public Render<? super EntityBeelzebook> createRenderFor(RenderManager manager) {
				// TODO Auto-generated method stub
				return new RenderBeelzebook(manager);
			}
			
		});
		Utils.getLogger().info("Rendered Chimera");
	}

	@Override
	public void registerModelBakeryGoods() {
		//meta data thing
		ModelBakery.registerItemVariants(ModItems.diamondilium, new ResourceLocation(Reference.MOD_ID, "diamondilium_normal"), new ResourceLocation(Reference.MOD_ID, "diamondilium_corrupted"));
	}
	
	@Override
	public void generateManuPart(Block block, BlockPos pos) {
		World world = Minecraft.getMinecraft().world;
		ParticleManu part = new ParticleManu(world, pos.getX() + world.rand.nextFloat(), pos.getY()+1, pos.getZ() + world.rand.nextFloat(), world.rand.nextFloat() * .4f, .7F, world.rand.nextFloat() * .4f);
		
		Minecraft.getMinecraft().effectRenderer.addEffect(part);
		
	}
}

 

At the bottom

Link to comment
Share on other sites

11 minutes ago, GooberGunter said:

In the BlockManuCogBlockH class

Then I believe that your particleTexture field is null when you access it in your constructor.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

TextureAtlasSprite has nothing to do with particles. It is simply a 'pointer' to a location of a specific image on a texture sheet(or if we disassemble the name - it is a sprite of a texture atlas(aka map)). Forge just allows custom loading of your sprites with those methods. By default there is only 1 texture map in the game - the blocks+items textures map.

Particles have that field avaliable mostly for block/item crack/break particles, as they need to know what texture to be rendered with. This field is null for other particle types and theirt textureIndex determines their location on their texture map(default vanilla particles.png file).

If you need a custom texture for your particles you can return 1 in your Particle::getFXLayer to use the blocks+items map as your texture and then call Particle::setParticleTexture with a TextureAtlasSprite object that would point to your custom texture on the blocks map. You will need to load that texture yourself using TextureStitchEvent and TextureMap::registerSprite.

  • Like 1
Link to comment
Share on other sites

1 hour ago, V0idWa1k3r said:

TextureAtlasSprite object that would point to your custom texture on the blocks map. You will need to load that texture yourself using TextureStitchEvent and TextureMap::registerSprite.

TextureMap::registerSprite returns you a TextureAtlasSprite object. This method must be called during TextureStitchEvent.Pre

Edited by V0idWa1k3r
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

    • Slot Gacor >> Mudah Maxwin Bersama Djarum4D   Slot gacor adalah salah satu jenis permainan judi online yang sangat populer di Indonesia. Bermain slot gacor berarti bermain permainan slot dengan kemungkinan keluaran yang lebih tinggi daripada slot tradisional. Dalam artikel ini, kami akan membahas secara lengkap tentang slot gacor, mulai dari pengertian dasar, cara bermain, strategi pemain, serta aspek keamanan dan etika dalam bermain.
    • DAFTAR & LOGIN TAYO4D   Slot gacor online adalah permainan yang menarik dan menghasilkan keuntungan untuk banyak pemain di seluruh dunia. Dalam artikel ini, kita akan membahas tentang cara memilih dan memainkan slot gacor online terbaik.
    • Tayo4D : Bandar Online Togel Dan Slot Terbesar Di Indonesia     Pemain taruhan Tayo4D yang berkualitas memerlukan platform yang aman, terpercaya, dan mudah digunakan. Dalam era teknologi ini, banyak situs online yang menawarkan layanan taruhan togel 4D, tetapi memilih yang tepat menjadi tuntas. Berikut adalah cara untuk membuat artikel yang membahas tentang situs online terpercaya untuk permainan taruhan togel 4D.  
    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
  • Topics

×
×
  • Create New...

Important Information

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