Jump to content

[1.15.2] FlowingFluidBlock onUpdate method


RobinCirex

Recommended Posts

10 minutes ago, RobinCirex said:

Hey, I'm trying to edit water at the moment and I'm looking for a method that is constantly called on the serverside. The method "tick" isn't called at all.

tick works for me:

		@Override
		public void tick(World worldIn, BlockPos pos, IFluidState state) {
			// TODO Auto-generated method stub
			super.tick(worldIn, pos, state);
			BunchOStuff.LOGGER.info("************FLOWING MUDDY WATER TICK ***********************");
		}
Quote

[m[32m[15:42:33] [Server thread/INFO] [bunchostuff/]: ************FLOWING MUDDY WATER TICK ***********************
[m[32m[15:42:33] [Server thread/INFO] [bunchostuff/]: ************FLOWING MUDDY WATER TICK ***********************
[m[32m[15:42:33] [Server thread/INFO] [bunchostuff/]: ************FLOWING MUDDY WATER TICK ***********************
[m[32m[15:42:33] [Server thread/INFO] [bunchostuff/]: ************FLOWING MUDDY WATER TICK ***********************
[m[32m[15:42:34] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game...

Are you using @Override?

Link to comment
Share on other sites

9 minutes ago, Ugdhar said:

tick works for me:


		@Override
		public void tick(World worldIn, BlockPos pos, IFluidState state) {
			// TODO Auto-generated method stub
			super.tick(worldIn, pos, state);
			BunchOStuff.LOGGER.info("************FLOWING MUDDY WATER TICK ***********************");
		}

Are you using @Override?

Yea, I am, weird.

Did you try it with a FlowingFluidBlock?

Edited by RobinCirex
Link to comment
Share on other sites

18 hours ago, RobinCirex said:

Yea, I am, weird.

Did you try it with a FlowingFluidBlock?

Sorry, didn't see your post for some reason.

Here's my whole fluid class:

package ugdhar.mod.bunchostuff.fluid;

import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.IFluidState;
import net.minecraft.state.StateContainer.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import ugdhar.mod.bunchostuff.BunchOStuff;

public abstract class MuddyWaterFluid extends ForgeFlowingFluid {

	public MuddyWaterFluid(Properties props) {
		super(props);
	}
	
	public static class Flowing extends MuddyWaterFluid {

		public Flowing(Properties props) {
			super(props);
			setDefaultState(getStateContainer().getBaseState().with(LEVEL_1_8, 7));
		}

		
		@Override
		public boolean isSource(IFluidState state) {
			return false;
		}
		

		@Override
		protected void fillStateContainer(Builder<Fluid, IFluidState> builder) {
			super.fillStateContainer(builder);
			builder.add(LEVEL_1_8);
		}


		
		@Override
		public int getLevel(IFluidState fluidState) {
			return fluidState.get(LEVEL_1_8);
		}


		@Override
		public void tick(World worldIn, BlockPos pos, IFluidState state) {
			// TODO Auto-generated method stub
			super.tick(worldIn, pos, state);
			BunchOStuff.LOGGER.info("************FLOWING MUDDY WATER TICK ***********************");
		}
		
		
		
	}
	
	public static class Source extends MuddyWaterFluid {

		public Source(Properties props) {
			super(props);
		}

		@Override
		public boolean isSource(IFluidState state) {
			return true;
		}

		@Override
		public int getLevel(IFluidState p_207192_1_) {
			return 8; // max fluid lvl since it's a source.
		}
		
		
		
	}

}

It's very basic, I was just tinkering, no goal in mind. Hope it helps ya!

Link to comment
Share on other sites

5 minutes ago, Ugdhar said:

Sorry, didn't see your post for some reason.

Here's my whole fluid class:


package ugdhar.mod.bunchostuff.fluid;

import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.IFluidState;
import net.minecraft.state.StateContainer.Builder;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import ugdhar.mod.bunchostuff.BunchOStuff;

public abstract class MuddyWaterFluid extends ForgeFlowingFluid {

	public MuddyWaterFluid(Properties props) {
		super(props);
	}
	
	public static class Flowing extends MuddyWaterFluid {

		public Flowing(Properties props) {
			super(props);
			setDefaultState(getStateContainer().getBaseState().with(LEVEL_1_8, 7));
		}

		
		@Override
		public boolean isSource(IFluidState state) {
			return false;
		}
		

		@Override
		protected void fillStateContainer(Builder<Fluid, IFluidState> builder) {
			super.fillStateContainer(builder);
			builder.add(LEVEL_1_8);
		}


		
		@Override
		public int getLevel(IFluidState fluidState) {
			return fluidState.get(LEVEL_1_8);
		}


		@Override
		public void tick(World worldIn, BlockPos pos, IFluidState state) {
			// TODO Auto-generated method stub
			super.tick(worldIn, pos, state);
			BunchOStuff.LOGGER.info("************FLOWING MUDDY WATER TICK ***********************");
		}
		
		
		
	}
	
	public static class Source extends MuddyWaterFluid {

		public Source(Properties props) {
			super(props);
		}

		@Override
		public boolean isSource(IFluidState state) {
			return true;
		}

		@Override
		public int getLevel(IFluidState p_207192_1_) {
			return 8; // max fluid lvl since it's a source.
		}
		
		
		
	}

}

It's very basic, I was just tinkering, no goal in mind. Hope it helps ya!

Okay.. thank you :D What version is this?

Link to comment
Share on other sites

1 minute ago, Ugdhar said:

1.15.2, using yesterdays mappings and current build of forge, I believe the one ending with .44

Yea okay, I found the difference now. You overwrote the fluid, not the block. I'm gonna try that too, thanks for your help

Edited by RobinCirex
Link to comment
Share on other sites

	public static final ForgeFlowingFluid.Properties MUDDY_WATER_PROPS = 
			new ForgeFlowingFluid.Properties(MUDDY_WATER, MUDDY_WATER_FLOW, FluidAttributes.builder(STILL, FLOWING)
					.overlay(OVERLAY)
					.color(0x3F1080FF))
			.bucket(ModItems.MUDDY_WATER_BUCKET)
			.block(ModBlocks.MUDDY_WATER); 

 

Link to comment
Share on other sites

Just now, Ugdhar said:

	public static final ForgeFlowingFluid.Properties MUDDY_WATER_PROPS = 
			new ForgeFlowingFluid.Properties(MUDDY_WATER, MUDDY_WATER_FLOW, FluidAttributes.builder(STILL, FLOWING)
					.overlay(OVERLAY)
					.color(0x3F1080FF))
			.bucket(ModItems.MUDDY_WATER_BUCKET)
			.block(ModBlocks.MUDDY_WATER); 

 

thanks :D

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Exception in thread "main" java.lang.IllegalStateException: Could not find forge-1.19-41.1.0 in classpath at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonDevLaunchHandler.lambda$findJarOnClasspath$3(CommonDevLaunchHandler.java:90) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonDevLaunchHandler.findJarOnClasspath(CommonDevLaunchHandler.java:90) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.ForgeUserdevLaunchHandler.processStreams(ForgeUserdevLaunchHandler.java:17) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.targets.CommonUserdevLaunchHandler.getMinecraftPaths(CommonUserdevLaunchHandler.java:32) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator.scanMods(MinecraftLocator.java:36) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:74) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:166) at MC-BOOTSTRAP/fmlloader@1.19.2-43.3.5/net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.run(Launcher.java:88) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.main(Launcher.java:78) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) I tried to make a minecraft mod but this error appears every time I click on the RunClient button and it won't start. Does anyone know how to get rid of this? (btw. I'm using version 1.19.2-43.3.5) https://pastebin.com/mQ3q4SwW
    • I've been following the discussion on automatically downloading mods from server to client, and I thought I'd share a helpful resource I stumbled upon. If you're looking for high-quality images for your mods or any other project, Depositphotos offers a fantastic collection for free download: free download images. In the spirit of collaboration, I believe that access to free, high-resolution visuals can greatly enhance the overall modding experience. Feel free to explore the link, and let me know what you think. Looking forward to hearing your thoughts and ideas on how we can collectively improve mod development efficiency.
    • Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira Indian & Pakistani Girls (+971525382202{{ Dubai House Wife Indian Call 'Girl Deira
    • full-service 0506530048 pakistani call 'girls in deira by dubai full-service 0506530048 pakistani call 'girls in deira by dubai full-service 0506530048 pakistani call 'girls in deira by dubai full-service 0506530048 pakistani call 'girls in deira by dubai full-service 0506530048 pakistani call 'girls in deira by dubai full-service 0506530048 pakistani call 'girls in deira by dubai
    • Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place Tempting +971525373611 Pakistani E'scorts in Deira Dubai by Escorts Near my Place
  • Topics

×
×
  • Create New...

Important Information

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