diff --git a/src/main/java/biomesoplenty/common/entities/EntitySnail.java b/src/main/java/biomesoplenty/common/entities/EntitySnail.java new file mode 100644 index 000000000..469c69eaa --- /dev/null +++ b/src/main/java/biomesoplenty/common/entities/EntitySnail.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.entities; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.monster.IMob; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySnail extends EntityLiving implements IMob { + + public EntitySnail(World worldIn) { + super(worldIn); + this.setSize(0.5F, 0.5F); + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(2.0D); + } + +} diff --git a/src/main/java/biomesoplenty/common/entities/ModelSnail.java b/src/main/java/biomesoplenty/common/entities/ModelSnail.java index d52568db0..6562b9984 100644 --- a/src/main/java/biomesoplenty/common/entities/ModelSnail.java +++ b/src/main/java/biomesoplenty/common/entities/ModelSnail.java @@ -19,26 +19,26 @@ public class ModelSnail extends ModelBase textureHeight = 32; Shell = new ModelRenderer(this, 0, 0); - Shell.addBox(0F, 0F, 0F, 3, 8, 8); - Shell.setRotationPoint(0F, 0F, 0F); + Shell.addBox(-1F, 0F, -3F, 3, 8, 8); + Shell.setRotationPoint(0F, 14F, 0F); Shell.setTextureSize(64, 32); Shell.mirror = true; setRotation(Shell, 0F, 0F, 0F); Body = new ModelRenderer(this, 0, 16); Body.addBox(0F, 0F, 0F, 3, 2, 12); - Body.setRotationPoint(0F, 8F, -3F); + Body.setRotationPoint(-1F, 22F, -6F); Body.setTextureSize(64, 32); Body.mirror = true; setRotation(Body, 0F, 0F, 0F); Left_Eye = new ModelRenderer(this, 22, 12); Left_Eye.addBox(0F, 0F, 0F, 1, 3, 1); - Left_Eye.setRotationPoint(2F, 5F, -2F); + Left_Eye.setRotationPoint(1F, 19F, -5F); Left_Eye.setTextureSize(64, 32); Left_Eye.mirror = true; setRotation(Left_Eye, 0F, 0F, 0F); Right_Eye = new ModelRenderer(this, 22, 12); Right_Eye.addBox(0F, 0F, 0F, 1, 3, 1); - Right_Eye.setRotationPoint(0F, 5F, -2F); + Right_Eye.setRotationPoint(-1F, 19F, -5F); Right_Eye.setTextureSize(64, 32); Right_Eye.mirror = true; setRotation(Right_Eye, 0F, 0F, 0F); diff --git a/src/main/java/biomesoplenty/common/entities/RenderSnail.java b/src/main/java/biomesoplenty/common/entities/RenderSnail.java new file mode 100644 index 000000000..2229066fb --- /dev/null +++ b/src/main/java/biomesoplenty/common/entities/RenderSnail.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.entities; + +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + +@SideOnly(Side.CLIENT) +public class RenderSnail extends RenderLiving +{ + private static final ResourceLocation snailTextureLocation = new ResourceLocation("biomesoplenty:textures/entity/snail.png"); + + public RenderSnail(RenderManager renderManager) + { + super(renderManager, new ModelSnail(), 0.25F); + } + + @Override + protected ResourceLocation getEntityTexture(EntitySnail entity) + { + return snailTextureLocation; + } +} diff --git a/src/main/java/biomesoplenty/common/init/ModEntities.java b/src/main/java/biomesoplenty/common/init/ModEntities.java index e02c0bbd2..f228bee50 100644 --- a/src/main/java/biomesoplenty/common/init/ModEntities.java +++ b/src/main/java/biomesoplenty/common/init/ModEntities.java @@ -40,8 +40,9 @@ public class ModEntities registerBOPEntity(EntityMudball.class, "mudball", 80, 3, true); // mobs - registerBOPEntityWithSpawnEgg(EntityWasp.class, "wasp", 80, 3, true, 0xFEE563, 0x000000); - registerBOPEntityWithSpawnEgg(EntityPixie.class, "pixie", 80, 3, true, 0xFFFFFF, 0xFF4DFF); + registerBOPEntityWithSpawnEgg(EntityWasp.class, "wasp", 80, 3, true, 0xE5B013, 0x333234); + registerBOPEntityWithSpawnEgg(EntityPixie.class, "pixie", 80, 3, true, 0xFF99E9, 0xFFFFFF); + registerBOPEntityWithSpawnEgg(EntitySnail.class, "snail", 80, 3, true, 0xA694BC, 0xCDA26E); } // register an entity diff --git a/src/main/java/biomesoplenty/core/ClientProxy.java b/src/main/java/biomesoplenty/core/ClientProxy.java index e38865e37..7bc5a16d0 100644 --- a/src/main/java/biomesoplenty/core/ClientProxy.java +++ b/src/main/java/biomesoplenty/core/ClientProxy.java @@ -11,21 +11,6 @@ package biomesoplenty.core; import java.util.List; import java.util.Map; -import biomesoplenty.api.block.IBOPBlock; -import biomesoplenty.api.item.BOPItems; -import biomesoplenty.api.particle.BOPParticleTypes; -import biomesoplenty.client.particle.EntityPixieTrailFX; -import biomesoplenty.client.particle.EntityTrailFX; -import biomesoplenty.client.texture.ForgeRedirectedResourcePack; -import biomesoplenty.common.config.MiscConfigurationHandler; -import biomesoplenty.common.entities.EntityPixie; -import biomesoplenty.common.entities.EntityWasp; -import biomesoplenty.common.entities.RenderPixie; -import biomesoplenty.common.entities.RenderWasp; -import biomesoplenty.common.entities.projectiles.EntityDart; -import biomesoplenty.common.entities.projectiles.EntityMudball; -import biomesoplenty.common.entities.projectiles.RenderDart; -import biomesoplenty.common.entities.projectiles.RenderMudball; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; @@ -49,11 +34,27 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.ForgeModContainer; import net.minecraftforge.fml.client.FMLClientHandler; -import net.minecraftforge.fml.client.FMLFileResourcePack; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.ReflectionHelper; +import biomesoplenty.api.block.IBOPBlock; +import biomesoplenty.api.item.BOPItems; +import biomesoplenty.api.particle.BOPParticleTypes; +import biomesoplenty.client.particle.EntityPixieTrailFX; +import biomesoplenty.client.particle.EntityTrailFX; +import biomesoplenty.client.texture.ForgeRedirectedResourcePack; +import biomesoplenty.common.config.MiscConfigurationHandler; +import biomesoplenty.common.entities.EntityPixie; +import biomesoplenty.common.entities.EntitySnail; +import biomesoplenty.common.entities.EntityWasp; +import biomesoplenty.common.entities.RenderPixie; +import biomesoplenty.common.entities.RenderSnail; +import biomesoplenty.common.entities.RenderWasp; +import biomesoplenty.common.entities.projectiles.EntityDart; +import biomesoplenty.common.entities.projectiles.EntityMudball; +import biomesoplenty.common.entities.projectiles.RenderDart; +import biomesoplenty.common.entities.projectiles.RenderMudball; public class ClientProxy extends CommonProxy { @@ -70,6 +71,7 @@ public class ClientProxy extends CommonProxy registerEntityRenderer(EntityDart.class, RenderDart.class); registerEntityRenderer(EntityWasp.class, RenderWasp.class); registerEntityRenderer(EntityPixie.class, RenderPixie.class); + registerEntityRenderer(EntitySnail.class, RenderSnail.class); registerEntityRenderer(EntityMudball.class, RenderMudball.class); replaceForgeResources(); diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 53c0cd078..d4c070157 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -165,6 +165,7 @@ item.shroompowder.name=Shroom Powder item.soul.name=Soul item.spawn_egg_pixie.name=Spawn Pixie item.spawn_egg_wasp.name=Spawn Wasp +item.spawn_egg_snail.name=Spawn Snail item.stone_scythe.name=Stone Scythe item.turnip.name=Turnip item.turnip_seeds.name=Turnip Seeds diff --git a/src/main/resources/assets/biomesoplenty/models/item/spawn_egg_snail.json b/src/main/resources/assets/biomesoplenty/models/item/spawn_egg_snail.json new file mode 100644 index 000000000..1ddad18f4 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/spawn_egg_snail.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/spawn_egg", + "layer1": "items/spawn_egg_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +}