@SuppressWarnings("unchecked")
public class mcreator_fish {
public int mobid = 0;
public static Object instance;
public void load(FMLInitializationEvent event) {
}
public void generateNether(World world, Random random, int chunkX, int chunkZ) {
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
}
public int addFuel(ItemStack fuel) {
return 0;
}
@SideOnly(Side.CLIENT)
public void registerRenderers() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new mcreator_fish.Modelfish(), 0) {
protected ResourceLocation getEntityTexture(Entity par1Entity) {
return new ResourceLocation("fish.png");
}
};
RenderingRegistry.registerEntityRenderingHandler(mcreator_fish.Entityfish.class, customRender);
RenderingRegistry.registerEntityRenderingHandler(EntityArrowCustom.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(),
new ItemStack(Blocks.AIR).getItem(), Minecraft.getMinecraft().getRenderItem()));
}
public void serverLoad(FMLServerStartingEvent event) {
}
public void preInit(FMLPreInitializationEvent event) {
int entityID = MathHelper.getRandomUUID().hashCode();
mobid = entityID;
EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:fish"), mcreator_fish.Entityfish.class, "fish", entityID, instance,
64, 1, true, (255 << 16) + (102 << 8) + 255, (102 << 16) + (255 << 8) + 0);
EntityRegistry.addSpawn(mcreator_fish.Entityfish.class, 50, 5, 10, EnumCreatureType.WATER_CREATURE,
Biome.REGISTRY.getObject(new ResourceLocation("ocean")));
int entityID2 = MathHelper.getRandomUUID().hashCode();
EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:entitybulletfish"), EntityArrowCustom.class, "entitybulletfish",
entityID2, instance, 64, 1, true);
}
public static Biome[] clean(net.minecraft.util.registry.RegistryNamespaced<ResourceLocation, Biome> in) {
Iterator<Biome> itr = in.iterator();
ArrayList<Biome> ls = new ArrayList<Biome>();
while (itr.hasNext()) {
ls.add(itr.next());
}
return ls.toArray(new Biome[ls.size()]);
}
public static class EntityArrowCustom extends EntityTippedArrow {
public EntityArrowCustom(World a) {
super(a);
}
public EntityArrowCustom(World worldIn, double x, double y, double z) {
super(worldIn, x, y, z);
}
public EntityArrowCustom(World worldIn, EntityLivingBase shooter) {
super(worldIn, shooter);
}
}
public static class Entityfish extends EntitySquid implements IRangedAttackMob {
World world = null;
public Entityfish(World var1) {
super(var1);
world = var1;
experienceValue = 5;
this.isImmuneToFire = true;
addRandomArmor();
setNoAI(!true);
this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
}
protected void addRandomArmor() {
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Blocks.AIR));
}
protected void dropRareDrop(int par1) {
this.dropItem(new ItemStack(Blocks.AIR).getItem(), 1);
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float flval) {
EntityArrowCustom entityarrow = new EntityArrowCustom(this.world, this);
double d0 = target.posY + (double) target.getEyeHeight() - 1.1;
double d1 = target.posX - this.posX;
double d2 = d0 - entityarrow.posY;
double d3 = target.posZ - this.posZ;
float f = MathHelper.sqrt(d1 * d1 + d3 * d3) * 0.2F;
entityarrow.setThrowableHeading(d1, d2 + (double) f, d3, 1.6F, 12.0F);
this.world.spawnEntity(entityarrow);
}
@Override
protected Item getDropItem() {
return new ItemStack(Blocks.AIR).getItem();
}
@Override
protected net.minecraft.util.SoundEvent getAmbientSound() {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(""));
}
@Override
protected net.minecraft.util.SoundEvent getHurtSound() {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(""));
}
@Override
protected net.minecraft.util.SoundEvent getDeathSound() {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(
"testenvironmentmod:fishdie1"));
}
@Override
public void onStruckByLightning(EntityLightningBolt entityLightningBolt) {
super.onStruckByLightning(entityLightningBolt);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
@Override
public void fall(float l, float d) {
super.fall(l, d);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
super.fall(l, d);
Entity entity = this;
}
@Override
public void onDeath(DamageSource source) {
super.onDeath(source);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
@Override
public boolean processInteract(EntityPlayer entity, EnumHand hand) {
super.processInteract(entity, hand);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
return true;
}
@Override
protected float getSoundVolume() {
return 1.0F;
}
}