src\minecraft\net\minecraft\src\KODASRedCreeper.java:44: cannot find symbol
symbol : method attackEntityFrom(net.minecraft.src.Entity,int)
location: class net.minecraft.src.EntityCreeper
return super.attackEntityFrom(entity, i);
Red Creeper:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
EntityCreeper's onDeath() takes a DamageSource, not an Entity, which is your error. However, you don't even need that call - since all your method does is pass the call on to the superclass, virtual dispatch will take care of that for you if you just leave out your onDeath(). If your class does not define a method by that name, it will use the one defined in the superclass.
EntityCreeper's onDeath() takes a DamageSource, not an Entity, which is your error. However, you don't even need that call - since all your method does is pass the call on to the superclass, virtual dispatch will take care of that for you if you just leave out your onDeath(). If your class does not define a method by that name, it will use the one defined in the superclass.
Thanks for the help! I only have 2 errors left now, the addSpawn and the attackEntityFrom.
AttackEntityFrom also now takes a DamageSource, not an Entity. I guess this was changed in 1.8 (I don't work with entities myself). I do know that in 1.8 the arguments to AddSpawn changed to add min/max per chunk, but I don't know what the new arguments are. I suggest you look at that method in ModLoader.java to find out what they should be.
AttackEntityFrom also now takes a DamageSource, not an Entity. I guess this was changed in 1.8 (I don't work with entities myself). I do know that in 1.8 the arguments to AddSpawn changed to add min/max per chunk, but I don't know what the new arguments are. I suggest you look at that method in ModLoader.java to find out what they should be.
Thanks! I fixed the other error too, I just deleted the lines.
Last thing, I noticed the red one dies from it's TNT. How can I cause a mob to be immune to TNT?
Thanks! I fixed the other error too, I just deleted the lines.
Last thing, I noticed the red one dies from it's TNT. How can I cause a mob to be immune to TNT?
This is honestly a guess, but it looks like you'd override attackEntityFrom in your mob to make it not do anything if the DamageSource was an explosion, but I'm actually not sure how to tell that. Look at what happens when TNT explodes I guess.
I have one more error in a diffrent mod. I didn't want to start a new topic.
src\minecraft\net\minecraft\src\TextureFXWallClock.java:7: package com.pclewis.m
cpatcher.mod does not exist
import com.pclewis.mcpatcher.mod.TextureUtils;
src\minecraft\net\minecraft\src\TextureFXWallClock.java:48: cannot find symbol
symbol : variable TextureUtils
location: class net.minecraft.src.TextureFXWallClock
bufferedimage2 = TextureUtils.getResourceAsBufferedImage("/dial.png");
It seems I need to add mcpatcher to MCP. Is that what I need to do?
Uh, I've never actually used MCPatcher, but that error is saying your code wants it to be there and it isn't. I'm not sure how you managed to accomplish that state or how to fix it, I'm sorry; I'd expect that if everything for it was installed when you ran decompile that it would all be there now.
src\minecraft\net\minecraft\src\KODASRedCreeper.java:44: cannot find symbol
symbol : method attackEntityFrom(net.minecraft.src.Entity,int)
location: class net.minecraft.src.EntityCreeper
return super.attackEntityFrom(entity, i);
Red Creeper:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// EntityCreeper, EntityTNTPrimed, World, Block,
// BlockFire, Entity, Item, NBTTagCompound
public class KODASRedCreeper extends EntityCreeper
{
public KODASRedCreeper(World world)
{
super(world);
field_21473_fuseTime = 15;
field_21474_creeperState = -1;
field_21472_field_12241_e = -1;
health = 25;
moveSpeed = 0.8F;
isImmuneToFire = true;
texture = "/mob/redcreeper.png";
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
public boolean attackEntityFrom(Entity entity, int i)
{
if(entity instanceof EntityTNTPrimed)
{
i /= 2;
}
return super.attackEntityFrom(entity, i);
}
public void handleHealthUpdate(byte byte0)
{
super.handleHealthUpdate(byte0);
if(byte0 == 4)
{
if(pathToEntity == 0)
{
worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F);
}
field_21474_creeperState = 1;
}
if(byte0 == 5)
{
field_21474_creeperState = -1;
}
}
public void onUpdate()
{
lastActiveTime = pathToEntity;
if(worldObj.multiplayerWorld)
{
pathToEntity += field_21474_creeperState;
if(pathToEntity < 0)
{
pathToEntity = 0;
}
if(pathToEntity >= field_21473_fuseTime)
{
pathToEntity = field_21473_fuseTime;
}
}
super.onUpdate();
}
protected void updateEntityActionState()
{
if(field_21472_field_12241_e != field_21474_creeperState)
{
field_21472_field_12241_e = field_21474_creeperState;
if(field_21474_creeperState > 0)
{
worldObj.setEntityState(this, (byte)4);
} else
{
worldObj.setEntityState(this, (byte)5);
}
}
lastActiveTime = pathToEntity;
if(worldObj.multiplayerWorld)
{
super.updateEntityActionState();
} else
{
if(pathToEntity > 0 && field_21474_creeperState < 0)
{
pathToEntity--;
}
if(field_21474_creeperState >= 0)
{
field_21474_creeperState = 2;
}
super.updateEntityActionState();
if(field_21474_creeperState != 1)
{
field_21474_creeperState = -1;
}
}
}
protected String getHurtSound()
{
return "mob.creeper";
}
protected String getDeathSound()
{
return "mob.creeperdeath";
}
protected void attackEntity(Entity entity, float f)
{
if(f < 4.5F && rand.nextInt(20) == 0)
{
int i = (int)posX;
int j = (int)posY;
int k = (int)posZ;
if((worldObj.getBlockId(i, j, k) == 0 || worldObj.getBlockId(i, j, k) == Block.snow.blockID) && worldObj.getBlockId(i, j - 1, k) != 0)
{
worldObj.setBlock(i, j, k, Block.fire.blockID);
}
}
if(f < 4F && health >= 5)
{
motionX = entity.posX - posX;
motionZ = entity.posZ - posZ;
double d = -0.69999999999999996D / (motionX * motionX + motionZ * motionZ + 0.0625D);
motionX *= d;
motionZ *= d;
} else
if(field_21474_creeperState <= 0 && f < 8F || field_21474_creeperState > 0 && f < 10F)
{
field_21474_creeperState = 1;
pathToEntity++;
if(f < 6.5F)
{
motionX = 0.0D;
motionZ = 0.0D;
}
if(pathToEntity == field_21473_fuseTime && canEntityBeSeen(entity))
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldObj, posX, posY + 1.0D, posZ);
worldObj.entityJoinedWorld(entitytntprimed);
entitytntprimed.motionX = (entity.posX - posX) / 20D;
entitytntprimed.motionY = (entity.posY - posY) / 20D + 0.5D;
entitytntprimed.motionZ = (entity.posZ - posZ) / 20D;
entitytntprimed.fuse = 55;
worldObj.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 0.5F);
pathToEntity = 0;
field_21473_fuseTime = 30;
} else
if(pathToEntity >= field_21473_fuseTime)
{
pathToEntity = field_21473_fuseTime - 1;
}
hasAttacked = true;
}
}
public float setCreeperFlashTime(float f)
{
return ((float)lastActiveTime + (float)(pathToEntity - lastActiveTime) * f) / (float)(field_21473_fuseTime - 2);
}
protected int getDropItemId()
{
return Item.flintAndSteel.shiftedIndex;
}
public boolean getCanSpawnHere()
{
return rand.nextInt(3) == 0 && super.getCanSpawnHere();
}
int pathToEntity;
int lastActiveTime;
int field_21473_fuseTime;
int field_21474_creeperState;
int field_21472_field_12241_e;
}
INFORMATION WANTS TO BE WRONG
Thanks for the help! I only have 2 errors left now, the addSpawn and the attackEntityFrom.
INFORMATION WANTS TO BE WRONG
Thanks! I fixed the other error too, I just deleted the lines.
Last thing, I noticed the red one dies from it's TNT. How can I cause a mob to be immune to TNT?
This is honestly a guess, but it looks like you'd override attackEntityFrom in your mob to make it not do anything if the DamageSource was an explosion, but I'm actually not sure how to tell that. Look at what happens when TNT explodes I guess.
INFORMATION WANTS TO BE WRONG
It seems I need to add mcpatcher to MCP. Is that what I need to do?
INFORMATION WANTS TO BE WRONG