Jump to content

Recommended Posts

Posted

Heya,

 

I'm currently making a compatibility mod for our modpack.

Now I have the following issue:

 

I have created a fluid, and it's working fine. Buckets included. However when placed inside other mods containers this happens:

EUDLWki.png

As you can see, the fuel works in the bucket and when placed, however it shows a lava texture inside Thermal Expansions portable tank. (Mekanism tanks work fine however! :S)

 

Also inside the EnderIO VAT:

My1oKE7.png

It shows the fluid, but it has no texture (looks like it's empty, even tho it's full)

 

Do I have to include both their api's just to get the fluid working? Or is there something I'm missing.

 

 

 

Posted

Fluids:

package com.creepgaming.creepgamingmod.fluids;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;

public class Fluids {

public static Fluid rFuel;
public static Block blockRFuel;

public static void mainRegistry() {

	rFuel = new Fluid("fuel").setLuminosity(0).setDensity(790).setViscosity(1000);

	FluidRegistry.registerFluid(rFuel);

	blockRFuel = new BlockRFuel(rFuel, Material.water).setBlockName("rfuel");
	GameRegistry.registerBlock(blockRFuel, blockRFuel.getUnlocalizedName().substring(5));
	rFuel.setUnlocalizedName(blockRFuel.getUnlocalizedName());
}

}

 

FluidBlock:

package com.creepgaming.creepgamingmod.fluids;

import com.creepgaming.creepgamingmod.CreepGamingMod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;

public class BlockRFuel extends BlockFluidClassic{


@SideOnly(Side.CLIENT)
protected IIcon stillIcon;

@SideOnly(Side.CLIENT)
protected IIcon flowingIcon;


public BlockRFuel(Fluid fluid, Material material) {
	super(fluid, material);
	setCreativeTab(CreepGamingMod.tabCCG);
}

@Override
public IIcon getIcon(int side, int meta){
	return (side == 0 || side == 1)? stillIcon : flowingIcon;
}

@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister register){
	stillIcon = register.registerIcon("creepgamingmod:fuel_still");
	flowingIcon = register.registerIcon("creepgamingmod:fuel_flow");		
}

@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z){
	if (world.getBlock(x,  y,  z).getMaterial().isLiquid()) return false;
        return super.canDisplace(world, x, y, z);

}

    @Override
    public boolean displaceIfPossible(World world, int x, int y, int z) {
            if (world.getBlock(x,  y,  z).getMaterial().isLiquid()) return false;
            return super.displaceIfPossible(world, x, y, z);
    }


}

 

I used this tutorial:

 

http://www.minecraftforge.net/wiki/Create_a_Fluid

 

I don't think I've changed anything besides the textures and the properties of the liquid.

 

Posted

You need to call

Fluid#setIcons()

on your fluid to make the textures work (at least for me).

 

I'm confused. I thought I was setting the textures here already:

	@Override
public void registerBlockIcons(IIconRegister register){
	stillIcon = register.registerIcon("creepgamingmod:fuel_still");
	flowingIcon = register.registerIcon("creepgamingmod:fuel_flow");
}

Also the textures work flawlessly except inside TE and EnderIO machines.

 

How would I use setIcons()? Wouldn't I just register the same stuff again? oO I'm really confused why they work just fine outside of those 2 things :S

Posted

Those are the Icons for your Block. The fluid is technically not your Block, it is a different thing. When other mods interact with your Fluid they interact with the Fluid instance, not the Block. Hence you need to tell the Fluid about the Icons as well.

 

Oh I understand. So they are 2 separate things. I assumed the fluid was simply a reference to the block.

 

However I'm unsure of how I can set the textures inside the fluid class. I've checked a bunch of open source projects and found none of them were doing that. I'm not even sure I understand this whole Iicon thing. Any chance you could point me to an example class?

Posted

Inside registerBlockIcons after you got the IIcon objects (IIcon is really just a set of coordinates on the big texture sheet) you call setIcons on your Fluid object.

 

 

IIcon is really just a set of coordinates on the big texture sheet

Holy crap, you just summarized what I've been trying to understand via google for the past 2 hours. And it actually makes sense. Thank you!

 

Also, I feel like a complete Idiot now. I JUST had it fixed before reading your post, but I was catching the block and reading the Iicons off it in postInit, then applying them to the fluids.

This is 1000x smarter and better. Thanks! Just shows how little I understand Forge atm ._.

 

Thanks for the quick help!

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

    • ⚠️ DON'T CLICK THIS LINK OR ANYTHING RELATED TO THIS, IT HAS MALWARE IN THE LINK AND IT'S LIKELY A SCAM. ⚠️
    • ⚠️ DON'T CLICK THIS LINK OR ANYTHING RELATED TO THIS, IT HAS MALWARE IN THE LINK AND IT'S LIKELY A SCAM. ⚠️
    • I fight fires for a living, it's in my blood as a volunteer firefighter. But nothing could have prepared me for the fire that almost reduced my family's future to ashes. I had secretly accumulated $150,000 worth of Bitcoin over the years, intending to lock up my children's education and provide my wife with some leeway from our constant shift-work life. That was until a phishing attack struck me while I was out fighting a wildfire. The call had been on a hot afternoon. We were dashing to contain wildfires tearing across parched scrub lands. At such frantic moments, my phone pulsed with a security alert message from what looked like my Bitcoin wallet operator. Drenched with sweat, fatigue, and hyper adrenaline, I had clicked on the link and input my log-ins without questioning anything. I was tricked by hackers during my most vulnerable time. Hours later, returning to the station, I emptied my wallet. The harsh reality hit me with more force than any fire could ever have. My carefully saved safety net had vanished. My heart beat faster than the sirens. I felt as though I had failed my family. I explained my terror of burgers at our favorite local diner that evening to my friend. He leaned in close and whispered a single word: Digital Hack Recovery. He swore by their effectiveness, stating they worked miracles when his cousin had crypto stolen from him in a scam. I was skeptical old-school and desperate, so I called them. From the first call, their team treated me like family. They didn't only view figures; they viewed a husband and a father attempting to rectify a horrific error. They labored day and night, following stolen money through blockchain transactions like l detectives. Progress was made every day, translating intricate tech into fireman-speak. Ten days later, I got the call. “We recovered your Bitcoin.” I cried. Right there in the station, surrounded by smoke-stained gear, I let it all out. Relief. Gratitude. Hope they don't stop there. Knowing I worked in emergency services, Digital Hack Recovery offered to run an online security workshop for my entire fire department. They turned my disaster into a lesson that safeguarded my team. These folks don’t just recover wallets; they rebuild lives. They rebuilt mine. I fight fires for a living, it's in my blood as a volunteer firefighter. But nothing could have prepared me for the fire that almost reduced my family's future to ashes. I had secretly accumulated $150,000 worth of Bitcoin over the years, intending to lock up my children's education and provide my wife with some leeway from our constant shift-work life. That was until a phishing attack struck me while I was out fighting a wildfire. The call had been on a hot afternoon. We were dashing to contain wildfires tearing across parched scrub lands. At such frantic moments, my phone pulsed with a security alert message from what looked like my Bitcoin wallet operator. Drenched with sweat, fatigue, and hyper adrenaline, I had clicked on the link and input my log-ins without questioning anything. I was tricked by hackers during my most vulnerable time. Hours later, returning to the station, I emptied my wallet. The harsh reality hit me with more force than any fire could ever have. My carefully saved safety net had vanished. My heart beat faster than the sirens. I felt as though I had failed my family. I explained my terror of burgers at our favorite local diner that evening to my friend. He leaned in close and whispered a single word: Digital Hack Recovery. He swore by their effectiveness, stating they worked miracles when his cousin had crypto stolen from him in a scam. I was skeptical old-school and desperate, so I called them. From the first call, their team treated me like family. They didn't only view figures; they viewed a husband and a father attempting to rectify a horrific error. They labored day and night, following stolen money through blockchain transactions like l detectives. Progress was made every day, translating intricate tech into fireman-speak. Ten days later, I got the call. “We recovered your Bitcoin.” I cried. Right there in the station, surrounded by smoke-stained gear, I let it all out. Relief. Gratitude. Hope they don't stop there. Knowing I worked in emergency services, Digital Hack Recovery offered to run an online security workshop for my entire fire department. They turned my disaster into a lesson that safeguarded my team. These folks don’t just recover wallets; they rebuild lives. They rebuilt mine. Contact : Whats...App : +.1 .4 7.4.3 5.3.7 7..1.9 Website : https://       digitalhackrecovery.com     Mail:            digitalhackrecovery         @techie.       com 
    • I fight fires for a living, it's in my blood as a volunteer firefighter. But nothing could have prepared me for the fire that almost reduced my family's future to ashes. I had secretly accumulated $150,000 worth of Bitcoin over the years, intending to lock up my children's education and provide my wife with some leeway from our constant shift-work life. That was until a phishing attack struck me while I was out fighting a wildfire. The call had been on a hot afternoon. We were dashing to contain wildfires tearing across parched scrub lands. At such frantic moments, my phone pulsed with a security alert message from what looked like my Bitcoin wallet operator. Drenched with sweat, fatigue, and hyper adrenaline, I had clicked on the link and input my log-ins without questioning anything. I was tricked by hackers during my most vulnerable time. Hours later, returning to the station, I emptied my wallet. The harsh reality hit me with more force than any fire could ever have. My carefully saved safety net had vanished. My heart beat faster than the sirens. I felt as though I had failed my family. I explained my terror of burgers at our favorite local diner that evening to my friend. He leaned in close and whispered a single word: Digital Hack Recovery. He swore by their effectiveness, stating they worked miracles when his cousin had crypto stolen from him in a scam. I was skeptical old-school and desperate, so I called them. From the first call, their team treated me like family. They didn't only view figures; they viewed a husband and a father attempting to rectify a horrific error. They labored day and night, following stolen money through blockchain transactions like l detectives. Progress was made every day, translating intricate tech into fireman-speak. Ten days later, I got the call. “We recovered your Bitcoin.” I cried. Right there in the station, surrounded by smoke-stained gear, I let it all out. Relief. Gratitude. Hope they don't stop there. Knowing I worked in emergency services, Digital Hack Recovery offered to run an online security workshop for my entire fire department. They turned my disaster into a lesson that safeguarded my team. These folks don’t just recover wallets; they rebuild lives. They rebuilt mine. I fight fires for a living, it's in my blood as a volunteer firefighter. But nothing could have prepared me for the fire that almost reduced my family's future to ashes. I had secretly accumulated $150,000 worth of Bitcoin over the years, intending to lock up my children's education and provide my wife with some leeway from our constant shift-work life. That was until a phishing attack struck me while I was out fighting a wildfire. The call had been on a hot afternoon. We were dashing to contain wildfires tearing across parched scrub lands. At such frantic moments, my phone pulsed with a security alert message from what looked like my Bitcoin wallet operator. Drenched with sweat, fatigue, and hyper adrenaline, I had clicked on the link and input my log-ins without questioning anything. I was tricked by hackers during my most vulnerable time. Hours later, returning to the station, I emptied my wallet. The harsh reality hit me with more force than any fire could ever have. My carefully saved safety net had vanished. My heart beat faster than the sirens. I felt as though I had failed my family. I explained my terror of burgers at our favorite local diner that evening to my friend. He leaned in close and whispered a single word: Digital Hack Recovery. He swore by their effectiveness, stating they worked miracles when his cousin had crypto stolen from him in a scam. I was skeptical old-school and desperate, so I called them. From the first call, their team treated me like family. They didn't only view figures; they viewed a husband and a father attempting to rectify a horrific error. They labored day and night, following stolen money through blockchain transactions like l detectives. Progress was made every day, translating intricate tech into fireman-speak. Ten days later, I got the call. “We recovered your Bitcoin.” I cried. Right there in the station, surrounded by smoke-stained gear, I let it all out. Relief. Gratitude. Hope they don't stop there. Knowing I worked in emergency services, Digital Hack Recovery offered to run an online security workshop for my entire fire department. They turned my disaster into a lesson that safeguarded my team. These folks don’t just recover wallets; they rebuild lives. They rebuilt mine. Contact : Wh.ats.Ap.p : +1 .4 .7  4 3. 5  3  .7 7.1.9 Website : https://     digitalhackrecovery.   com Mail:       digitalhackrecovery     @         techie.                     com  
    • Ran it one more time just to check, and there's no errors this time on the log??? Log : https://mclo.gs/LnuaAiu I tried allocating more memory to the modpack, around 8000MB and it's still the same; stopping at "LOAD_REGISTRIES". Are some of the mods clashing, maybe? I have no clue what to do LOL
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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