Jump to content

[1.12.2]Is there an easy way to make a fluid in 1.12.2?


Xeraster

Recommended Posts

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
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

    • Selamat datang di Rajabonanza88 salah satu situs slot gacor gampang menang hari ini di Indonesia yang sangat menjajikan. Slot gacor adalah adalah suatu istilah yang digunakan untuk menjelaskan sebuah permainan slot gampang menang di situs slot online. Situs slot gacor Rajabonanza88 ini bisa menjadi populer walaupun terbilang baru karena RTP slot online yang disajikan begitu tinggi. Seiring dengan perkembangan zaman situs slot gacor terbaru ini juga sudah update dari segi teknologi yang menggunakan HTML5, inilah yang membuat grafis permainan terlihat begitu modern, audio lebih jernih, dan user interface yang smooth. Tidak dipungkiri grafis yang kami memiliki sudah menarik banyak sekali pendatang baru yang ingin merasakan terbawa dalam suasana tema permainan mesin slot. Kehadiran slot gacor menjadi angin segar bagi para pecinta judi online, memberikan alternatif permainan yang seru dan menguntungkan. Tak heran jika popularitas slot gacor terus meningkat, menarik minat para pemain baru untuk mencoba peruntungan mereka di situs slot gacor hari ini Rajabonanza88.
    • A code: public class CommonProxy {     public void registerItemRenderer() {         Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(                 ModItems.YOUR_ITEM,                 0,                 new ModelResourceLocation(ModItems.YOUR_ITEM.getRegistryName(), "inventory")         );         Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(                 ModItems.YOUR_ITEM,                 0,                 new ModelResourceLocation(ModItems.YOUR_ITEM.getRegistryName(), "inventory"),                 new CustomItemRenderer(Minecraft.getMinecraft().getTextureManager(), Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager(), Minecraft.getMinecraft().getItemColors())         );     } }   In YOUR_ITEM you must specify item. If not working try this: public class ModInit {     @Mod.EventHandler     public void init(FMLInitializationEvent event) {         CommonProxy commonProxy = new CommonProxy();         commonProxy.registerItemRenderer();     } }
    • Selamat datang di Rajacasino88 salah satu situs slot gacor gampang menang hari ini di Indonesia yang sangat menjajikan. Slot gacor adalah adalah suatu istilah yang digunakan untuk menjelaskan sebuah permainan slot gampang menang di situs slot online. Situs slot gacor ini bisa menjadi populer walaupun terbilang baru karena RTP slot online yang disajikan begitu tinggi. Seiring dengan perkembangan zaman situs slot gacor terbaru ini juga sudah update dari segi teknologi yang menggunakan HTML5, inilah yang membuat grafis permainan terlihat begitu modern, audio lebih jernih, dan user interface yang smooth. Tidak dipungkiri grafis yang kami memiliki sudah menarik banyak sekali pendatang baru yang ingin merasakan terbawa dalam suasana tema permainan mesin slot. Kehadiran slot gacor menjadi angin segar bagi para pecinta judi online, memberikan alternatif permainan yang seru dan menguntungkan. Tak heran jika popularitas slot gacor terus meningkat, menarik minat para pemain baru untuk mencoba peruntungan mereka di situs slot gacor hari ini Rajacasino88.
    • Dalam mengikuti tren perubahan digital, Bank BRI terus berinovasi untuk memenuhi kebutuhan dan keinginan nasabahnya. Salah satu upaya terbaru yang dilakukan oleh Bank BRI adalah meluncurkan platform permainan online yang menarik, yang
    • Selamat datang di Beton88 salah satu situs slot gacor gampang menang hari ini di Indonesia yang sangat menjajikan. Slot gacor adalah adalah suatu istilah yang digunakan untuk menjelaskan sebuah permainan slot gampang menang di situs slot online. Situs slot gacor ini bisa menjadi populer walaupun terbilang baru karena RTP slot online yang disajikan begitu tinggi. Seiring dengan perkembangan zaman situs slot gacor terbaru ini juga sudah update dari segi teknologi yang menggunakan HTML5, inilah yang membuat grafis permainan terlihat begitu modern, audio lebih jernih, dan user interface yang smooth. Tidak dipungkiri grafis yang kami memiliki sudah menarik banyak sekali pendatang baru yang ingin merasakan terbawa dalam suasana tema permainan mesin slot. Kehadiran slot gacor menjadi angin segar bagi para pecinta judi online, memberikan alternatif permainan yang seru dan menguntungkan. Tak heran jika popularitas slot gacor terus meningkat, menarik minat para pemain baru untuk mencoba peruntungan mereka di situs slot gacor hari ini Beton88.
  • Topics

×
×
  • Create New...

Important Information

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