Jump to content

[1.7.10]Adjusting the speed a fluid pushes a player


theOriginalByte

Recommended Posts

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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