Jump to content

Recommended Posts

Posted

dispenseEntity method in ModLoader-based mod is never called because FML has different method definition.

 

ML: int dispenseEntity(World, ItemStack, Random, int, int, int, int, int, double, double, double)

FML: int dispenseEntity(World, ItemStack, Random, double, double, double, int, int, double, double, double)

Posted

Updated forge to 4.0.0.245 (FML 3.0.175.350) and got same result.

 

Here's a small example.

package net.minecraft.src;

import java.util.Random;

public class mod_DispenseTest extends BaseMod {
public String getVersion() {
	return "1.0";
}

public void load() {}

public int dispenseEntity(World world, ItemStack item, Random rnd, int x, int y, int z, int xVel, int zVel, double entX, double entY, double entZ) {
	if (item.getItem().shiftedIndex == Block.stone.blockID) {
		EntityChicken chicken = new EntityChicken(world);
		chicken.setPosition(entX, entY, entZ);
		chicken.setVelocity(xVel, 0, zVel);
		world.spawnEntityInWorld(chicken);
		return 1;
	}
	return 0;
}
}

This works with ModLoader. (chicken pops out)

but with Forge, it's not. (just stone will dispensed)

 

--edit--

Confirmed that the problem has been fixed on Forge 4.0.0.246 / FML 3.0.180.354

Thank you cpw

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.

×
×
  • Create New...

Important Information

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