Jump to content

[1.10] On Rightclick entityThrowable,spawn and explode ... wont work anymore?!?


terraya

Recommended Posts

Hello Guys,

 

i think (the Entity wont spawn) ..

 

it workt before on 1.8.9 but since i update it wont work,

does anything changed? O.o

 

EntityClass:

public class BigFireBall
extends EntityThrowable
{
public int ticks = 100;
public int explosionRadius = 20;

public BigFireBall(World par1World)
{
  super(par1World);
}

public BigFireBall(World par1World, EntityPlayer par3EntityPlayer)
{
  super(par1World, par3EntityPlayer);
}

public BigFireBall(World par1World, double par2, double par4, double par6)
{
  super(par1World, par2, par4, par6);
}

public void onEntityUpdate()
{
  if (this.ticks <= 0)
  {
    this.ticks = 100;
    setDead();
  }
  else
  {
    this.ticks -= 1;
  }
}

protected void onImpact(RayTraceResult par1MovingObjectPosition)
{
  if (par1MovingObjectPosition.entityHit != null) {
    par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 20.0F);
  }
  if (!this.worldObj.isRemote)
  {
    this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, this.explosionRadius, true);
    this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 20.0F, true, true);
    setDead();
  }
}

protected float getGravityVelocity()
{
  return 0.0001F;
}
}

 

ThrowableItem:

public class TestThrowableItem extends Item
{
public TestThrowableItem(String string)
{
	super();
	this.setUnlocalizedName("throwable");
}

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (!par3EntityPlayer.capabilities.isCreativeMode)
        {
            --par1ItemStack.stackSize;
        }

        if (!par2World.isRemote)
        {
            par2World.spawnEntityInWorld(new BigFireBall(par2World, par3EntityPlayer));
        }

        return par1ItemStack;
    }

}

 

Client Proxy:

public class ClientProxy
  extends CommonProxy
{
  public void registeRenders()
  {
    BlocksUpdate.registerRenders();
    ItemsUpdate.registerRenders();
  }
  public void registerEntityRenders() {

	  //DEVIL FRUIT SKILLS
	  RenderManager rm = Minecraft.getMinecraft().getRenderManager();
	  EntityRegistry.registerModEntity(IceArrow.class, "IceArrow", 10, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceAge.class, "IceAge", 9, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceBall.class, "IceBall", 8, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceWall.class, "IceWall", 7, this, 80, 3, true);
	  EntityRegistry.registerModEntity(FireBall.class, "FireBall", 6, this, 80, 3, true);
	  EntityRegistry.registerModEntity(BigFireBall.class, "BigFireBall", 5, this, 80, 3, true);
	  EntityRegistry.registerModEntity(PawHit.class, "PawHit", 4, this, 80, 3, true);
	  EntityRegistry.registerModEntity(UrsusShock.class, "UrsusShock", 3, this, 80, 3, true);
	  EntityRegistry.registerModEntity(Volt1Billion.class, "TestThrowable", 2, this, 80, 3, true);
	  
	  		  RenderingRegistry.registerEntityRenderingHandler(PawHit.class, new ThrowableBlockRender(rm, ArturFarid.BlockUpdate.init.BlocksUpdate.planks1,Minecraft.getMinecraft().getRenderItem()));
	  RenderingRegistry.registerEntityRenderingHandler(BigFireBall.class, new RenderApple(rm, ItemsUpdate.yoru, Minecraft.getMinecraft().getRenderItem()));	  

  }
  
}

Link to comment
Share on other sites

Uh.

Why are you registering your entities in your client proxy? That needs to happen on BOTH sides

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

still sadly dont work :S

 

but actualy my "TEST NPCs" are spawning O.o

 

@Mod(modid = "BlockUpdate", name="BlockUpdate Mod", version="3.0", acceptedMinecraftVersions="[1.10.2]")
public class BlocksUpdate
{

  @SidedProxy(clientSide="ArturFarid.BlockUpdate.proxy.ClientProxy", serverSide="ArturFarid.BlockUpdate.proxy.CommonProxy")
  public static CommonProxy proxy;
  
public static Item_Tab item_tab = new Item_Tab();
public static Sword_Tab sword_tab = new Sword_Tab();
public static Food_Tab food_tab = new Food_Tab();
public static Devil_Fruit_Tab devil_fruit_tab = new Devil_Fruit_Tab();

@Instance  
public static BlocksUpdate instance;

  @EventHandler
  public void preInit(FMLPreInitializationEvent event)
  {
ArturFarid.BlockUpdate.init.BlocksUpdate.init();
ArturFarid.BlockUpdate.init.BlocksUpdate.register();
    ItemsUpdate.init();
    ItemsUpdate.register();
  }
  
  @EventHandler
  public void Init(FMLInitializationEvent event)
  {
  
  proxy.registeRenders();
  
     EntityRegistry.registerModEntity(EntityModelTest.class, "EntityModelTest", 19, BlocksUpdate.instance, 64, 20, true);
	 EntityRegistry.registerEgg(EntityModelTest.class, 0xFF00, 0xFF00);
	 EntityRegistry.addSpawn(EntityModelTest.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1));

     EntityRegistry.registerModEntity(EntityModelBall.class, "EntityModelBall", 21, BlocksUpdate.instance, 64, 20, true);
	 EntityRegistry.registerEgg(EntityModelBall.class, 0xFF00, 0xFF00);
	 EntityRegistry.addSpawn(EntityModelBall.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1));

	 RenderingRegistry.registerEntityRenderingHandler(EntityModelTest.class, new RenderModelTest()); 	
	 RenderingRegistry.registerEntityRenderingHandler(EntityModelBall.class, new RenderModelBall()); 	
	 RenderingRegistry.registerEntityRenderingHandler(EntityDragonTest.class, new RenderDragonTest()); 	

	  //DEVIL FRUIT SKILLS
	  RenderManager rm = Minecraft.getMinecraft().getRenderManager();
	  EntityRegistry.registerModEntity(IceArrow.class, "IceArrow", 10, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceAge.class, "IceAge", 9, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceBall.class, "IceBall", 8, this, 80, 3, true);
	  EntityRegistry.registerModEntity(IceWall.class, "IceWall", 7, this, 80, 3, true);
	  EntityRegistry.registerModEntity(FireBall.class, "FireBall", 6, this, 80, 3, true);
	  EntityRegistry.registerModEntity(BigFireBall.class, "BigFireBall", 5, this, 80, 3, true);
	  EntityRegistry.registerModEntity(PawHit.class, "PawHit", 4, this, 80, 3, true);
	  EntityRegistry.registerModEntity(UrsusShock.class, "UrsusShock", 3, this, 80, 3, true);
	  EntityRegistry.registerModEntity(Volt1Billion.class, "TestThrowable", 2, this, 80, 3, true);
	  
	  
	  //DEVIL FRUIT SWORDS SKILLS		
	  EntityRegistry.registerModEntity(ChainLightningEntity.class, "BlockUpdateSwordClass", 1, this, 80, 3, true);
	  

	  RenderingRegistry.registerEntityRenderingHandler(PawHit.class, new ThrowableBlockRender(rm, ArturFarid.BlockUpdate.init.BlocksUpdate.planks1,Minecraft.getMinecraft().getRenderItem()));
	  RenderingRegistry.registerEntityRenderingHandler(BigFireBall.class, new RenderApple(rm, ItemsUpdate.yoru, Minecraft.getMinecraft().getRenderItem()));	  




   
  /* REMOVING CRAFTING TABLE */
  Collection<Item> removeSet = new HashSet();
  Collections.addAll(removeSet, new Item[] {

  Item.REGISTRY.getObjectById(58)	   
  
  	}
  );
  Iterator<IRecipe> iterator1 = CraftingManager.getInstance().getRecipeList().iterator();

  while (iterator1.hasNext())
  {
  IRecipe recipe = iterator1.next();
  if (recipe == null)
  continue;
  ItemStack output = recipe.getRecipeOutput();
  if (output != null && output.getItem() != null && removeSet.contains(output.getItem()))
  iterator1.remove();
  }
  }
  


  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {}
}

Link to comment
Share on other sites

  • Register entities in preInit.
  • Anything rendering related must happen in your client proxy.
  • The version of
    registerEntityRenderingHandler

    you are using is deprecated. Use the new one.

  • Why on earth are you using
    getObjectById

    to obtain Item instances? :o

  • And you still have this two classes named the same, this is a terrible idea.

 

 

gonna fix that all right now, thank you very much !

Link to comment
Share on other sites

  • Register entities in preInit.
  • Anything rendering related must happen in your client proxy.
  • The version of
    registerEntityRenderingHandler

    you are using is deprecated. Use the new one.

  • Why on earth are you using
    getObjectById

    to obtain Item instances? :o

  • And you still have this two classes named the same, this is a terrible idea.

 

 

 

a bit late but couldnt work much on it bcuz of work :S

 

- well anyways, i changed the two "same named classes" ...

- i register my entities now in the "preInit"

- registerEntityHandler , i just removed the function, first wanna try to make it work then after i will try to fix this one

- im using getObjectID bcuz i want to remove "CraftingTable" from the list.

 

still wont work :(

 

heres my main class:

 

@Mod(modid = "BlockUpdate", name="BlockUpdate Mod", version="3.0", acceptedMinecraftVersions="[1.10.2]")
public class BlocksUpdate
{

  @SidedProxy(clientSide="ArturFarid.BlockUpdate.proxy.ClientProxy", serverSide="ArturFarid.BlockUpdate.proxy.CommonProxy")
  public static CommonProxy proxy;
  
public static Item_Tab item_tab = new Item_Tab();
public static Sword_Tab sword_tab = new Sword_Tab();
public static Food_Tab food_tab = new Food_Tab();
public static Devil_Fruit_Tab devil_fruit_tab = new Devil_Fruit_Tab();

@Instance  
public static BlocksUpdate instance;

  @EventHandler
  public void preInit(FMLPreInitializationEvent event)
  {
ArturFarid.BlockUpdate.init.CustomBlocks.init();
ArturFarid.BlockUpdate.init.CustomBlocks.register();
    ItemsUpdate.init();
    ItemsUpdate.register();

  //DEVIL FRUIT SKILLS
      EntityRegistry.registerModEntity(ThrowableEntity.class, "Test", 11, this, 80, 3, true);
  EntityRegistry.registerModEntity(IceArrow.class, "IceArrow", 10, this, 80, 3, true);
  EntityRegistry.registerModEntity(IceAge.class, "IceAge", 9, this, 80, 3, true);
  EntityRegistry.registerModEntity(IceBall.class, "IceBall", 8, this, 80, 3, true);
  EntityRegistry.registerModEntity(IceWall.class, "IceWall", 7, this, 80, 3, true);
  EntityRegistry.registerModEntity(FireBall.class, "FireBall", 6, this, 80, 3, true);
  EntityRegistry.registerModEntity(BigFireBall.class, "BigFireBall", 5, this, 80, 3, true);
  EntityRegistry.registerModEntity(PawHit.class, "PawHit", 4, this, 80, 3, true);
  EntityRegistry.registerModEntity(UrsusShock.class, "UrsusShock", 3, this, 80, 3, true);
  EntityRegistry.registerModEntity(Volt1Billion.class, "TestThrowable", 2, this, 80, 3, true);
  

  //DEVIL FRUIT SWORDS SKILLS		
     EntityRegistry.registerModEntity(ChainLightningEntity.class, "BlockUpdateSwordClass", 1, this, 80, 3, true);
  
     EntityRegistry.registerModEntity(EntityModelTest.class, "EntityModelTest", 19, BlocksUpdate.instance, 64, 20, true);
	 EntityRegistry.registerEgg(EntityModelTest.class, 0xFF00, 0xFF00);
	 EntityRegistry.addSpawn(EntityModelTest.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1));

     EntityRegistry.registerModEntity(EntityModelBall.class, "EntityModelBall", 21, BlocksUpdate.instance, 64, 20, true);
	 EntityRegistry.registerEgg(EntityModelBall.class, 0xFF00, 0xFF00);
	 EntityRegistry.addSpawn(EntityModelBall.class, 5, 1, 10, EnumCreatureType.MONSTER, Biome.getBiome(1));

  }
  

  @EventHandler
  public void Init(FMLInitializationEvent event)
  {
  
  proxy.registeRenders();
   
   
  /* REMOVING CRAFTING TABLE */
  Collection<Item> removeSet = new HashSet();
  Collections.addAll(removeSet, new Item[] {

  Item.REGISTRY.getObjectById(58)	   
  
  	}
  );
  Iterator<IRecipe> iterator1 = CraftingManager.getInstance().getRecipeList().iterator();

  while (iterator1.hasNext())
  {
  IRecipe recipe = iterator1.next();
  if (recipe == null)
  continue;
  ItemStack output = recipe.getRecipeOutput();
  if (output != null && output.getItem() != null && removeSet.contains(output.getItem()))
  iterator1.remove();
  }
  }
  


  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {}
}

 

the weird thing about is that my "TestNpcs" are spawning (which are not throwingentities)

 

, i tryed to make it even on "leftclick" but it dont work either so the entites dont wanna spawn .. -_-

 

 

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.

Announcements



×
×
  • Create New...

Important Information

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