Jump to content

[Solved] How to solve the overlay on universal bucket problem?


DeathSpawn

Recommended Posts

How do I make my Universal Bucket added by Forge have an overlay?

 

Fluid class

ublic class FluidEnchantedLiquid extends Fluid{
	
	 protected static int mapColor = 0xFFFFFFFF;
	    protected static float overlayAlpha = 0.2F;
	    protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
	    protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL;
	    protected static Material material = Material.WATER;
	 
	    public FluidEnchantedLiquid(String fluidName, ResourceLocation still, ResourceLocation flowing) 
	    {
	        super(fluidName, still, flowing);
	        ModFluids.FLUIDS.add(this);
	    }
	 
	    public FluidEnchantedLiquid(String fluidName, ResourceLocation still, ResourceLocation flowing, int mapColor) 
	    {
	        this(fluidName, still, flowing);
	        setColor(mapColor);
	        ModFluids.FLUIDS.add(this);
	    }
	 
	    public FluidEnchantedLiquid(String fluidName, ResourceLocation still, ResourceLocation flowing, int mapColor, float overlayAlpha) 
	    {
	        this(fluidName, still, flowing, mapColor);
	        setAlpha(overlayAlpha);
	        ModFluids.FLUIDS.add(this);
	    }
	 
	    @Override
	    public int getColor()
	    {
	        return mapColor;
	    }
	 
	    public FluidEnchantedLiquid setColor(int parColor)
	    {
	        mapColor = parColor;
	        return this;
	    }
	 
	    public float getAlpha()
	    {
	        return overlayAlpha;
	    }
	 
	    public FluidEnchantedLiquid setAlpha(float parOverlayAlpha)
	    {
	        overlayAlpha = parOverlayAlpha;
	        return this;
	    }
	 
	    @Override
	    public FluidEnchantedLiquid setEmptySound(SoundEvent parSound)
	    {
	        emptySound = parSound;
	        return this;
	    }
	 
	    @Override
	    public SoundEvent getEmptySound()
	    {
	        return emptySound;
	    }
	 
	    @Override
	    public FluidEnchantedLiquid setFillSound(SoundEvent parSound)
	    {
	        fillSound = parSound;
	        return this;
	    }
	 
	    @Override
	    public SoundEvent getFillSound()
	    {
	        return fillSound;
	    }
	 
	    public FluidEnchantedLiquid setMaterial(Material parMaterial)
	    {
	        material = parMaterial;
	        return this;
	    }
	 
	    public Material getMaterial()
	    {
	        return material;
	    }
	 
	    @Override
	    public boolean doesVaporize(FluidStack fluidStack)
	    {
	        if (block == null)
	            return false;
	        return block.getDefaultState().getMaterial() == getMaterial();
	    }
	
}

 

ModFluids class

public class ModFluids {
	
	public static List<Fluid> FLUIDS = new ArrayList<Fluid>();
	
	public static Fluid enchantedFluid = new FluidEnchantedLiquid("enchanted", new ResourceLocation(Reference.MOD_ID, "enchanted_still"), new ResourceLocation(Reference.MOD_ID, "enchanted_flow")).setMaterial(ModMaterials.ENCHANTED).setDensity(100).setGaseous(false).setLuminosity(2).setViscosity(25000).setTemperature(300);
	
}

 

How I registered my fluid:

public static void onBlockRegister(RegistryEvent.Register<Block> event) {
		event.getRegistry().registerAll(ModBlocks.BLOCKS.toArray(new Block[0]));
		GameRegistry.registerTileEntity(((BlockRotatableBase) ModBlocks.enchanterGem).getTileEntityClass(),
				ModBlocks.enchanterGem.getRegistryName().toString());
		for (Fluid fluid : ModFluids.FLUIDS) {
			boolean done = FluidRegistry.registerFluid(fluid);
			FluidRegistry.addBucketForFluid(fluid);
			if(done) {
				Utils.getLogger().info("Succcessful!");
			}
		}
	}

 

So, How do I add an overlay to the universal bucket?

2018-10-05_09.57.09.png

Edited by DeathSpawn
Link to comment
Share on other sites

5 hours ago, DeathSpawn said:

You have to it seems.

You actually don't have to create a block to make your fluids have textures. The reason you don't see a texture without a fluid block is because it's not stitched to the texture atlas. Creating a block automatically stiches the texture and so you now have the ability to see it. However that is not the only way to do this and in fact is not the preffered way. Just stitch your fluid texture in the TextureStitchEvent.

  • Thanks 1
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

    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m
    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER web [ ht tps:// muyerntrusthack.solutions/ ] for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m  
    • Do you have still this problem? (I have it too so I want to know if you did something with it)  
    • Thank you very much, the mod worked. I almost destroyed my computer out of anger because I couldn't find the error.
  • Topics

×
×
  • Create New...

Important Information

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