DeathSpawn Posted October 5, 2018 Share Posted October 5, 2018 (edited) 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? Edited October 5, 2018 by DeathSpawn Quote Link to comment Share on other sites More sharing options...
jabelar Posted October 5, 2018 Share Posted October 5, 2018 (edited) I am not positive but I think you have to create a fluid block as well. And the color/texture from that gets used. Or something like that. Edited October 5, 2018 by jabelar 1 Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
DeathSpawn Posted October 5, 2018 Author Share Posted October 5, 2018 43 minutes ago, jabelar said: I am not positive but I think you have to create a fluid block as well. And the color/texture from that gets used. Or something like that. You have to it seems. The texture changed as soon as I created a fluid block. Quote Link to comment Share on other sites More sharing options...
V0idWa1k3r Posted October 5, 2018 Share Posted October 5, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
DeathSpawn Posted October 11, 2018 Author Share Posted October 11, 2018 Thank you for the info. I wasn't aware of the fact till I read your comment that there was this sort of an event (TextureStitchEvent). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.