Jump to content

Heltrato

Members
  • Posts

    261
  • Joined

  • Last visited

Posts posted by Heltrato

  1. Bump:

    Got a progress on a while and create my own throwable but still it own render the lightning bolt when it spawn

    any help pleaes/

     

    package mhfc.net.client.projectile;
    
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.effect.EntityLightningBolt;
    import net.minecraft.entity.projectile.EntityThrowable;
    import net.minecraft.util.DamageSource;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.world.World;
    
    public class MHFCLightning extends EntityThrowable
    {
    public EntityLiving el;
    public long field_92057_e;
    private int fire;
    
        public MHFCLightning(World world)
        {
            super(world);
        }
    
        public MHFCLightning(World world, EntityLiving entityliving)
        {
            super(world, entityliving);
        }
    
        public MHFCLightning(World world, double d, double d1, double d2)
        {
            super(world, d, d1, d2);
        }
    
        /**
         * Called when the throwable hits a block or entity.
         */
        protected void onImpact(MovingObjectPosition movingobjectposition)
        {
        	worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
        	
            if (movingobjectposition.entityHit != null)
            {
                if (!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 0));
            }
    
            if (!worldObj.isRemote)
            {
            	EntityLightningBolt entitylightningbolt = new EntityLightningBolt(worldObj, posX, posY, posZ);
                entitylightningbolt.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F);
                worldObj.addWeatherEffect(entitylightningbolt);
            }
    
            for (int i = 0; i < 8; i++)
            {
                worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
            }
    
            if (!worldObj.isRemote)
            {
                setDead();
            }
        }
        
        
    }
    
    

  2. Guys i just updated one of my Mob AI's from 1.6.4 but in 1.6.4 the lightning that my mob spawn renders ( as in it shows the lightning bolt)

    in 1.7.2 it doesnt show anything i mean it just shows the fire on the targeted entity.

     

    Here's my updateTasks on my one of Entity AI's

     

    public void updateTask(){
    	if(e.getAnimTick() == 30){
    		List list = e.worldObj.getEntitiesWithinAABBExcludingEntity(e, e.boundingBox.expand(12.0D, 8.0D, 12.0D));
    		for (int i = 0; i < list.size(); i++) {
    		Entity entity = (Entity)list.get(i);
    		if (e.getDistanceSqToEntity(entity) <= 100.0D) {
    		double x = entity.posX - e.posX;
    		double z = entity.posZ - e.posZ;
    		double d = Math.sqrt(x * x + z * z);
    		EntityLightningBolt l = new EntityLightningBolt(e.worldObj, entity.posX - 0.2D, entity.posY, entity.posZ - 0.2D);
    		e.worldObj.addWeatherEffect(l);
    		entity.motionX = (x / d * 0.699999988079071D);
    		entity.motionY = 0.300000011920929D;
    		entity.motionZ = (z / d * 0.699999988079071D);
    		if ((entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer))) entity.attackEntityFrom(DamageSource.generic, 85 + this.rand.nextInt(2)); 
    		}if((entity instanceof EntityPlayer)){
    			entity.attackEntityFrom(DamageSource.generic, 35 + this.rand.nextInt(2));
        }
       }
    
    
    

  3. Yeah man i tried my best to register it and debug but still these error crash come out

     

    There was a critical exception handling a packet on channel mhfc
    io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?]
    at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1647) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:994) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    Caused by: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.buffer.AbstractByteBuf.ensureWritable(AbstractByteBuf.java:241) ~[AbstractByteBuf.class:?]
    at io.netty.buffer.AbstractByteBuf.writeInt(AbstractByteBuf.java:776) ~[AbstractByteBuf.class:?]
    at mhfc.net.common.packet.Packet02Tigrex.encodeInto(Packet02Tigrex.java:23) ~[Packet02Tigrex.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:95) ~[PacketPipeline.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:1) ~[PacketPipeline.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?]
    ... 18 more
    
    

  4. Still crashes damn i cant understand what this CRITICAL ERROR MEANS .

     

    [08:50:58] [Client thread/ERROR] [FML]: There was a critical exception handling a packet on channel mhfc
    io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?]
    at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1647) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:994) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    Caused by: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.buffer.AbstractByteBuf.ensureWritable(AbstractByteBuf.java:241) ~[AbstractByteBuf.class:?]
    at io.netty.buffer.AbstractByteBuf.writeInt(AbstractByteBuf.java:776) ~[AbstractByteBuf.class:?]
    at mhfc.net.common.packet.Packet02Tigrex.encodeInto(Packet02Tigrex.java:23) ~[Packet02Tigrex.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:95) ~[PacketPipeline.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:1) ~[PacketPipeline.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?]
    ... 18 more
    
    

     

     

    If i can find out what makes this

  5. here mate

     

    Main Class

    package mhfc.net;
    
    import mhfc.net.client.lib.MHFCReference;
    import mhfc.net.client.tab.MHFCTab;
    import mhfc.net.common.MHFCCommon;
    import mhfc.net.common.configuration.MHFCConfig;
    import mhfc.net.common.handler.MHFCGuiHandler;
    import mhfc.net.common.handler.MHFCTickHandler;
    import mhfc.net.common.packet.Packet01Anim;
    import mhfc.net.common.packet.Packet02Tigrex;
    import mhfc.net.common.packet.PacketPipeline;
    import mhfc.net.common.registry.MHFCReg;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraftforge.common.MinecraftForge;
    import cpw.mods.fml.common.FMLCommonHandler;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.network.NetworkRegistry;
    
    
    /**
    * 
    * This Main File is owned by the MHF Modding Team
    * 
    * @author <Heltrato>
    * @license MHFModding Team Copyright (http://www.minecraftforum.net/topic/1977334-164spmp-monster-hunter-frontier-craft-extreme-mob-hunting-adventure-15000-downloads/) 
    * Visit www.mhfrontiercraft.blogspot.com for more info.
    * 
    */
    
    @Mod(modid = MHFCMain.modid, name = MHFCReference.name, version = MHFCReference.version)
    
    public class MHFCMain {
    @SidedProxy(clientSide = "mhfc.net.client.MHFCClient", serverSide = "mhfc.net.common.MHFCCommon")
    public static MHFCCommon proxy;
    public static MHFCConfig launch;
    public static MHFCReg	 reg;
    public static MHFCTickHandler handler;
    public static final PacketPipeline packetpipeline = new PacketPipeline();
    @Mod.Instance("mhfc")
    public static MHFCMain instance;
    // Mod References	
    public static final String modid = "mhfc";
    public static final String authors = "Heltrato , Karseus , Shaduun, Aleksandair, NightCrow";
    // Mod Statics
    public static final String[] fTimer;
    public static boolean explosionsDestroyBlocks = true;
    public static int startEntityId = 300;
    public static CreativeTabs mhfctabs = new MHFCTab(CreativeTabs.getNextID(),"MHFC Tab");
    
    //	
    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent pre){
    	launch.init(pre);
    	pre.getModMetadata().logoFile = "MHFCLogo.png";
    	handler = new MHFCTickHandler();
    	MinecraftForge.EVENT_BUS.register(handler);
    	 FMLCommonHandler.instance().bus().register(handler);
    	NetworkRegistry.INSTANCE.registerGuiHandler(this, new MHFCGuiHandler());
    
    }
    @Mod.EventHandler
    public void load(FMLInitializationEvent event){
    	packetpipeline.initialize();
    	packetpipeline.registerPacket(Packet02Tigrex.class);
    	packetpipeline.registerPacket(Packet01Anim.class);
    	proxy.regSounds();
    	proxy.regStuff();
    	proxy.regTimer();
    	proxy.regTick();
    	proxy.regCapes();
    }
    
    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent e) {
    	packetpipeline.postInitialize();
    }
    
    public static boolean isClient(){
    	return FMLCommonHandler.instance().getSide().isClient();
    }
    public static boolean isEffectiveClient(){
    	return FMLCommonHandler.instance().getEffectiveSide().isClient();
    }
    static {
    	fTimer = new String[] {"field_71428_T", "S", "timer"};
    }
    public static void onRenderTick() {}
    public static void onClientTick() {}
    public static void onServerTick() {}
    }
    
    

     

    new packet

     

    package mhfc.net.common.packet;
    
    import io.netty.buffer.ByteBuf;
    import io.netty.channel.ChannelHandlerContext;
    import mhfc.net.client.entity.mob.EntityTigrex;
    import mhfc.net.common.implement.iMHFC;
    import net.minecraft.entity.player.EntityPlayer;
    
    public class Packet02Tigrex extends AbstractPacket{
    
    private int attackID;
    private int entityID;
    
    public Packet02Tigrex(){
    
    }
    public Packet02Tigrex(int id, EntityTigrex tigrex){
    	attackID = id;
    	entityID = tigrex.getEntityId();
    }
    
    public void encodeInto(ChannelHandlerContext paramChannelHandlerContext, ByteBuf buff) {
    	buff.writeInt(attackID);
    	buff.writeInt(entityID);
    }
    
    public void decodeFrom(ChannelHandlerContext paramChannelHandlerContext, ByteBuf buff) {
    	attackID = buff.readInt();
    	entityID = buff.readInt();
    }
    
    public void handleClientSide(EntityPlayer player) {
    	EntityTigrex entity = (EntityTigrex)player.worldObj.getEntityByID(entityID);
    	if ((entity != null) && (attackID != -1)) {
    		entity.currentAttackID = attackID;
    	if (attackID == 0) entity.animTick = 0;
    	}
    }
    
    public void handleServerSide(EntityPlayer player) {
    
    }
    
    }
    
    

  6. Just did it a while ago and now gives me this crash

     

    io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?]
    at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1647) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:994) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    Caused by: java.lang.IndexOutOfBoundsException: writerIndex( + minWritableBytes(4) exceeds maxCapacity(: SlicedByteBuf(ridx: 0, widx: 8, cap: 8/8, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 9, cap: 9/9))
    at io.netty.buffer.AbstractByteBuf.ensureWritable(AbstractByteBuf.java:241) ~[AbstractByteBuf.class:?]
    at io.netty.buffer.AbstractByteBuf.writeInt(AbstractByteBuf.java:776) ~[AbstractByteBuf.class:?]
    at mhfc.net.common.packet.Packet02Tigrex.encodeInto(Packet02Tigrex.java:24) ~[Packet02Tigrex.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:94) ~[PacketPipeline.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:1) ~[PacketPipeline.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?]
    ... 18 more
    
    

    I just cant understand why this packet does it

  7. I fix some issues somehow but still having some crash issues

     

    heres the crash found in the eclipse console

     

    [09:27:13] [Client thread/ERROR] [FML]: There was a critical exception handling a packet on channel mhfc
    io.netty.handler.codec.DecoderException: java.lang.InstantiationException: mhfc.net.common.packet.Packet02Tigrex
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?]
    at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?]
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1647) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:994) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
    Caused by: java.lang.InstantiationException: mhfc.net.common.packet.Packet02Tigrex
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_51]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:93) ~[PacketPipeline.class:?]
    at mhfc.net.common.packet.PacketPipeline.decode(PacketPipeline.java:1) ~[PacketPipeline.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?]
    ... 18 more
    

     

     

    My Packet

     

    package mhfc.net.common.packet;
    
    import io.netty.buffer.ByteBuf;
    import io.netty.channel.ChannelHandlerContext;
    import mhfc.net.client.entity.mob.EntityTigrex;
    import mhfc.net.common.implement.iMHFC;
    import net.minecraft.entity.player.EntityPlayer;
    
    public class Packet02Tigrex extends AbstractPacket{
    
    private int attackID;
    private int entityID;
    
    public Packet02Tigrex(int id, EntityTigrex tigrex){
    	attackID = id;
    	entityID = tigrex.getEntityId();
    }
    
    @Override
    public void encodeInto(ChannelHandlerContext paramChannelHandlerContext, ByteBuf buff) {
    	buff.writeInt(attackID);
    	buff.writeInt(entityID);
    }
    
    @Override
    public void decodeFrom(ChannelHandlerContext paramChannelHandlerContext, ByteBuf buff) {
    	attackID = buff.readInt();
    	entityID = buff.readInt();
    }
    
    @Override
    public void handleClientSide(EntityPlayer player) {
    	EntityTigrex entity = (EntityTigrex)player.worldObj.getEntityByID(entityID);
    	if ((entity != null) && (attackID != -1)) {
    		entity.currentAttackID = attackID;
    	if (attackID == 0) entity.animTick = 0;
    	}
    }
    
    @Override
    public void handleServerSide(EntityPlayer player) {
    
    }
    
    }
    
    

  8. Hello everyone im trying to update my AI Packets for my mod however since Packets now use bytes often im having issues with my sendingPackets it often crashes here

     

    public class Packet02 extends AbstractPacket{
    
    private byte animID;
    private int entityID;
    
    public Packet02(int id, EntityMob mob) {
    	animID = (byte) id;
    	entityID = tigrex.getEntityId();
    }
    
    @Override
    public void encodeInto(ChannelHandlerContext paramChannelHandlerContext, ByteBuf x) {
    	x.writeByte(animID);
    	x.writeInt(entityID);
    }
    
    @Override
    public void decodeFrom(ChannelHandlerContext paramChannelHandlerContext, ByteBuf x) {
    	animID = x.readByte();
    	entityID = x.readInt();
    }
    
    @Override
    public void handleClientSide(EntityPlayer paramEntityPlayer) {
    	EntityMob mob= (EntityMob)paramEntityPlayer.worldObj.getEntityByID(entityID);
    	if(mob != null && animID != -1) {
    		mob.setAnimID(animID);
    		if(animID == 0) mob.setAnimTick(0);
    	}
    }
    
    @Override
    public void handleServerSide(EntityPlayer paramEntityPlayer) {
    
    }
    
    }
    
    
    

     

    specifically this line which causes the crash

     

    x.writeByte(animID);
    
    

     

    also this is the entity code that sends the packet to its AI

     

    public void sendAttackPacket(int id){
            if(ModMain.isEffectiveClient())
            {
                return;
            }
            currentAttackID = id;
            MHFCMain.pipe.sendToAll(new Packet02(id, this));
          
        }
    
    

  9. Hello guys i was trying to make my entity to spawn a group of lightnings but i cant seem to make it work.

     

    Here is my code anyways

     

    public void updateTask(){
    	if(e.set() == 10){
    		MHFCLightning l = new MHFCLightning(e.worldObj);
    		MHFCLightning l1 = new MHFCLightning(e.worldObj);
    		l.setLocationAndAngles(e.posX + 4, target.posY, e.posZ + 4, 0, 0);
    		l1.setLocationAndAngles(e.posX + 5, target.posY, e.posZ + 5, 0, 0);
    		e.worldObj.spawnEntityInWorld(l);
    		e.worldObj.spawnEntityInWorld(l1);
    	}
    
    

     

    Please help and i appreciated it :D

  10. Dude if you know java you must know the Difference between this

     

    public class(){} <------------------- constructor

     

    public void class(){} <---- what i know it is a method :)

     

    public interface class(){} <---------------- ahh for API's

     

    Its the first tutorial my teacher

     

    you're problem is you that you must make yours in constructor since yours is a method

  11. Hi everyone im trying to make a grenade that blinds entities in the are but

    i mess with codes somehow but no luck it dont work

     

    package MHF.Net.Client.Entity.Projectile;
    
    
    import java.util.List;
    
    import net.minecraft.block.Block;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.world.World;
    import MHF.Net.Client.Item.MHFItem;
    
    public class MHFEntityGrenadeIncenerate extends MHFEntityBombMaterial
    {
        protected String BOUNCE_SOUND;
        
        static final double MAX_DISTANCE = 32D;
        static final double MIN_DISTANCE = 8D;
        static final float MAX_ANGLE = 180F;
        static final float MIN_PITCH_ANGLE = 15F;
        static final float MIN_YAW_ANGLE = 15F;
        public static final int MAX_FLASH_TIME_PLAYER = 500;
        public static final int MAX_FLASH_TIME_ENTITY = 200;
    
        public MHFEntityGrenadeIncenerate(World world)
        {
            super(world);
            setEntityItemStack(new ItemStack(MHFItem.MHFIncenerateBomb, 1, 0));
        }
    
        public MHFEntityGrenadeIncenerate(World world, double d, double d1, double d2)
        {
            super(world, d, d1, d2);
            setEntityItemStack(new ItemStack(MHFItem.MHFIncenerateBomb, 1, 0));
        }
    
        public MHFEntityGrenadeIncenerate(World world, EntityLivingBase entityliving)
        {
            super(world, entityliving);
            setEntityItemStack(new ItemStack(MHFItem.MHFIncenerateBomb, 1, 0));
        }
    
        public void onUpdate()
        {
            super.onUpdate();
            List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox);
    
            if (list.size() > 0)
            {
                Entity entity = (Entity)list.get(0);
    
                if (entity instanceof EntityLiving)
                {
                	((EntityLiving) entity).addPotionEffect((new PotionEffect(Potion.blindness.id, 100, 6)));
                    entity.setFire(300);
                    explode();
                }
            }
        }
    
        protected void handleBounce()
        {
            explode();
        }
    
        protected void explode()
        {
            if (!exploded)
            {
                exploded = true;
                worldObj.playSoundAtEntity(this, Block.glass.stepSound.getBreakSound(), (Block.glass.stepSound.getVolume() + 1.0F) / 2.0F, Block.glass.stepSound.getPitch() * 0.8F);
                int i = (int)Math.floor(posX);
                int j = (int)Math.floor(posY);
                int k = (int)Math.floor(posZ);
    
                for (int l = -2; l <= 2; l++)
                {
                    for (int i1 = -2; i1 <= 2; i1++)
                    {
                        for (int j1 = -2; j1 <= 2; j1++)
                        {
                            int k1 = Math.abs(l) + Math.abs(i1) + Math.abs(j1);
    
                            if (k1 <= 2 && worldObj.isAirBlock(i + l, j + i1, k + j1))
                            {
                                worldObj.setBlock(i + l, j + i1, k + j1, Block.fire.blockID);
                            }
                        }
                    }
                }
    
                setDead();
            }
        }
    }
    
    
    
    

  12. Okay I'll ask a more specific question.

    What is myGenBiomes, what is myBiomeIndexLayer, what is myBiomeCache, and what is myBiomesToSpawnIn?

     

    This should be more answerable.

     

     

    Dude !! I can Help you ,

     

    You use Eclipse well if so

     

    Press Ctrl + click the code you wanna know and it will open declaration for ya

     

    Hows that =D

×
×
  • Create New...

Important Information

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