Jump to content

Aggurai

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Aggurai

  1. Got it working now, managed to replicate the functionality of the egg's function in the one that passes on the itemstack. Now to just do a switch statement for the damage values
  2. Thanks! I have now registered my Dispenser behavior, however I am using an item with metadata and need to get the damage value of the item that is going to be shot, so that I can change the entity that spawns. The easy way of normally doing this without metadata would to use the code DispenserBehaviorEgg.java uses final class DispenserBehaviorEgg extends BehaviorProjectileDispense { /** * Return the projectile entity spawned by this dispense behavior. */ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { return new EntityEgg(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); } } But there is no itemstack argument I can use to find the damage value. Then I looked in the behavior for BehaviorDefaultDispenseItem, used by fireworks, mob eggs, etc so similar to what I am doing, and it has a method called public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) I have tried modifying my Dispenser Behaviour to use this, and have managed to get it to shoot my custom item out, howver it does not spawn the entity that it normally does when it hits the ground (when you throw it yourself) . I know it must have got to this part of code, because it is in the same place that the particles are told to appear, and they show up fine... If anyone could shed some light on this, I'd be very happy!
  3. Hello, I have a custom entity that spawns from an item, and I would like to make it so that when the item is placed in a dispenser, it shoots out the entity, like an egg or snowball. I have googled this already, but only found a few other people needing to do this, but on one of them someone said to the person that there was a way to do this, but didn't tell him how. I assume there probably is a way because it is implemented in modloader, and i don't want to have to overwrite DispenserBehaviours.java D: Any help gladly appreciated i'm sure its probable simple
  4. I should also add, I just tried adding the render code to one of my @SideOnly(Side.CLIENT) voids inside the actual item class, and that works on SMP too, however I really need to get the client proxy working instead of doing it this way
  5. Here is the crash of the server, only if I have the render code in Init: But it shouldn't have to be in init, I need it to work in my ClientProxy so i don't get the server error from the server trying to access the renderers
  6. Hello I am new to forge modding but am starting to get the hang of things. I have created a throw able entity, but it rendered as a white cube, so I added a RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg)) To my client proxy in a void that overrides the server/common proxy. However, this did nothing. Then I moved that line into the initialization event in my main mod class, and it worked! but, now it does not work in SMP as the server crashes because it tries to load the renderers for the server too. Obviously this is what the ClientProxy is for, but mine doesn't seem to be working if it worked in my main init event and not in there. In my main mod class I have the @SideProxy set up @SidedProxy(clientSide="aggurai.throwcraft.client.TCClientProxy", serverSide="aggurai.throwcraft.common.TCCommonProxy") public static TCCommonProxy proxy; And the Common/Server proxy package aggurai.throwcraft.common; public class TCCommonProxy { public void registerRenderThings() { // TODO Auto-generated method stub //lol } } And the client proxy that I tried rendering the entity in, and want to be able to render it in package aggurai.throwcraft.client; import net.minecraft.client.renderer.entity.RenderSnowball; import aggurai.throwcraft.ThrowCraft; import aggurai.throwcraft.common.TCCommonProxy; import aggurai.throwcraft.entity.BaseEntity; import cpw.mods.fml.client.registry.RenderingRegistry; public class TCClientProxy extends TCCommonProxy { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg)); } } If you could help that would be amazing! I know its probably a really simple mistake, if you need any more info let me know and I will give it to you.
×
×
  • Create New...

Important Information

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