Jump to content

Recommended Posts

Posted

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!

Posted

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

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

Posted

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

Posted

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!

Posted

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!

Posted

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?

Posted

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

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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