Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have another question... how do i adjust the speed my custom fluid pushes players? I know using the 'setViscosity()' method doesn't do anything...

onEntityCollidedWithBlock passes an Entity argument

I try my best, so apologies if I said something obviously stupid!

Get the blocks metadata (or whatever data from the fluid), and adjust the players motion depending on that.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Multiply entity.motionX, entity.motionY, entity.motionZ by whatever you want.

I try my best, so apologies if I said something obviously stupid!

  • Author

Multiply entity.motionX, entity.motionY, entity.motionZ by whatever you want.

I did this:

public void onEntityCollidedWithBlock(Entity entity)
    {
            entity.motionX = entity.motionX*2;
            entity.motionY = entity.motionY*2;
            entity.motionZ = entity.motionZ*2;
    }

but it doesn't change anything... the ide says the method is never used

  • Author

Get the blocks metadata (or whatever data from the fluid), and adjust the players motion depending on that.

I think your way is the way to go.... but how would i do that...

Use @Override to check if you are actually overriding a method. You have to use that method's parameters. Look at the onEntityCollidedWithBlock method in Block or BlockCactus.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

You aren't overriding it correctly, that method doesn't only pass an Entity parameter.

If you are using eclipse, use the Ctrl + Space shortcut to automatically have the method overridden, and then of course use the parameters you are given

I try my best, so apologies if I said something obviously stupid!

  • Author

I figured it out... thanks guys! I have another question that i don't want to open another thread for.... how do i apply a texture to my liquid... here is the code for it:

@Override
    public void registerBlockIcons(IIconRegister register) {
        this.flowingIcon = register.registerIcon(Reference.MODID + ":" + getUnlocalizedName().substring(5) + "_flow");
        this.stillIcon = register.registerIcon(Reference.MODID + ":" + getUnlocalizedName().substring(5) + "_still");

    }
    @Override
    public IIcon getIcon(int side, int meta) {
        return (side == 0 || side == 1)? stillIcon : flowingIcon;
    }

I'm using a recolored vanilla texture... should it be a different size or am i not registering/using the icon code right?

I got this:

 

https://bitbucket.org/Dragonisser/cobaltmod/src/178c28c1f444b11466696e40bcbfb0f8978acf76/cobaltmod/blocks/BlockFluidDarkWater.java?at=master

 

and this in the main:

 

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
	if (event.map.getTextureType() == 0) {
		CMStuff.darkwater_fluid.setIcons(CMStuff.darkwater.getIcon(0, 0), CMStuff.darkwater.getIcon(1, 0));

	}
}

 

Ii dont know if its necessary, because i didnt checked afterwards, but i think it was for the bc tanks

  • Author

I got this:

 

https://bitbucket.org/Dragonisser/cobaltmod/src/178c28c1f444b11466696e40bcbfb0f8978acf76/cobaltmod/blocks/BlockFluidDarkWater.java?at=master

 

and this in the main:

 

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
	if (event.map.getTextureType() == 0) {
		CMStuff.darkwater_fluid.setIcons(CMStuff.darkwater.getIcon(0, 0), CMStuff.darkwater.getIcon(1, 0));

	}
}

 

Ii dont know if its necessary, because i didnt checked afterwards, but i think it was for the bc tanks

I did that but i still get the ugly pink and black tiles.... what size is your texture? 16x16 or a different size?

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.