Jump to content

Recommended Posts

Posted (edited)

I am wanting to make a custom fluid in forge 1.12.2. I did it in a 1.7.2 mod and I think I remember it being substantially difficult but I did figure it out. I think my biggest problem was with textures. That is not the case now.

 

After looking at the minecraft files for 1.12.2, they seem to have made it so much more complicated that I don't even know where or how to start making a custom one. I've made a few attempts extending base classes but in the end haven't been able to get anywhere because of the way they register their liquids in net.minecraft.init.Blocks and how that applies to or works with net.minecraftforge.fluids.

 

The biggest barrier that makes it not possible to extend existing classes and mess with it until it works is in net.minecraft.init.Blocks where they have:

public static final BlockDynamicLiquid FLOWING_WATER;
    public static final BlockStaticLiquid WATER;

 

followed by:

@Nullable
    private static Block getRegisteredBlock(String blockName)
    {
        Block block = Block.REGISTRY.getObject(new ResourceLocation(blockName));

        if (!CACHE.add(block))
        {
            throw new IllegalStateException("Invalid Block requested: " + blockName);
        }
        else
        {
            return block;
        }
    }

    static
    {
        if (!Bootstrap.isRegistered())
        {
            throw new RuntimeException("Accessed Blocks before Bootstrap!");
        }
        else
        {
            FLOWING_WATER = (BlockDynamicLiquid)getRegisteredBlock("flowing_water");
            WATER = (BlockStaticLiquid)getRegisteredBlock("water");
          }
    }

 

I expected there to be something along the lines of:

public static final BlockDynamicLiquid FLOWING_WATER = new BlockDynamicLiquid().getRegisteredBlock("flowing_water")

public static final BlockStaticLiquid WATER = new BlockStaticLiquid().getRegisteredBlock("water")

Now after doing what I believe is a good job of duplicating or extending base class files or making new ones, the above won't work, nor will:

public static final BlockDynamicLiquid FLOWING_WATER = new BlockDynamicLiquid("flowing_water");

public static final BlockStaticLiquid WATER = new BlockStaticLiquid("water");

or any other variation after much messing around with it.

The idea was to get that to work and then in my block registry, just register it like any regular block like:

@Mod.EventBusSubscriber(modid = SuperTNTMod.MODID)
	public static class RegistrationHandler {
		public static final Set<ItemBlock> ITEM_BLOCKS = new HashSet<>();

	@SubscribeEvent
	public static void registerBlocks(final RegistryEvent.Register<Block> event) {
		final IForgeRegistry<Block> registry = event.getRegistry();
		System.out.println("register blocks event executed");

		final Block[] blocks = {FLOWING_WATER, WATER};
		registry.registerAll(blocks);
		System.out.println("register all function executed");
	}
  
  @SubscribeEvent
	public static void registerItemBlocks(final RegistryEvent.Register<Item> event) {
		final ItemBlock[] items = {new ItemBlock(WATER), new ItemBlock(FLOWING_WATER)
                                  };
    

 

I just can't even do a good enough job of this to even get it to compile.

 

I have also tried blatantly copy and pasting class files from TestMod3 to get a liquid working using that code. Seems like a reasonable idea if you're desperate enough but it just kept going down a never-ending rabbit hole and I had to keep creating more and more and more TestMod3 dependent classes. I gave up halfway through the multiplayer server crap which doesn't have anything to do with liquid but in TestMod3 I guess it does.

 

So is 1.12.2 liquid really this elusively difficult? What am I missing? I'm an experienced programmer but I'm dumbfounded from the unnecessary complexity of this liquid system.

I don't even have any code to post because I can't really get anything close to what might work or something I think should work that could compile.

Is there an "idiots guide" for 1.12.2 liquid?

Edited by Xeraster

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

    • I can't figure out if you're looking for help trying to steal someone elses work, or cheat at the game....
    • Title: Why Is It So Hard to Rename and Restructure Mods Like Xray or AntiXray? 🤔 Post text: Hey everyone! I’ve been digging into Minecraft modding for a while and have one big question that I can’t figure out on my own. Maybe someone with more experience could help or give me some advice. Here’s the issue: When I take a “normal” Minecraft mod — for example, one that just adds some blocks or new items — I can easily change its structure, package names, or even rebrand it entirely. It’s straightforward. But as soon as I try this with cheat-type mods like XrayMod or AntiXray, everything falls apart. Even if I just rename the classes, refactor the packages, or hide its identity somehow, the mod either breaks or stops working properly. XrayMod in particular is proving to be a nightmare to modify without losing its core function. So my question is — why is this so much harder with cheat mods like Xray? Is there something fundamentally different about how they’re coded, loaded, or protected that prevents simple renaming or restructuring? And if so, how can I actually learn to understand someone else’s cheat mod enough to safely refactor it without breaking the core features? I’ve already been spending over two months trying to figure this out and haven’t gotten anywhere. It feels like there must be some trick or knowledge I’m missing. Would really appreciate any thoughts, tips, or references — maybe there are guides or techniques for understanding cheat-mod internals? Or if you’ve successfully “disguised” a cheat mod like Xray before, I’d love to hear how you did it. Thanks in advance for any help or discussion. ✌️
    • just started making cinamatic contect check it out on my channel or check out my facebook page    Humbug City Minecraft Youtube https://www.youtube.com/watch?v=v2N6OveKwno https://www.facebook.com/profile.php?id=61575866982337  
    • Where did you get the schematic? Source/Link? And do use an own modpack or a pre-configured from curseforge? If yes, which one On a later time, I can make some tests on my own - but I need the schematic and the modpack name
  • Topics

×
×
  • Create New...

Important Information

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