Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import net.minecraftforge.fml.relauncher.SideOnly;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.common.registry.EntityRegistry;
- import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
- import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- import net.minecraftforge.fml.client.registry.RenderingRegistry;
- import net.minecraft.world.biome.Biome;
- import net.minecraft.world.World;
- import net.minecraft.util.math.MathHelper;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.DamageSource;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.Item;
- import net.minecraft.init.Blocks;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.EnumCreatureType;
- import net.minecraft.entity.Entity;
- import net.minecraft.client.renderer.entity.RenderLiving;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.client.model.ModelBase;
- import net.minecraft.client.Minecraft;
- import java.util.Random;
- import java.util.Iterator;
- import java.util.ArrayList;
- @SuppressWarnings("unchecked")
- public class mcreator_testmodel {
- 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_testmodel.ModelNew(), 0) {
- protected ResourceLocation getEntityTexture(Entity par1Entity) {
- return new ResourceLocation("texture.png");
- }
- };
- RenderingRegistry.registerEntityRenderingHandler(mcreator_testmodel.Entitytestmodel.class, customRender);
- }
- public void serverLoad(FMLServerStartingEvent event) {
- }
- public void preInit(FMLPreInitializationEvent event) {
- int entityID = MathHelper.getRandomUUID().hashCode();
- mobid = entityID;
- EntityRegistry.registerModEntity(mcreator_testmodel.Entitytestmodel.class, "testmodel", entityID, instance, 64, 1, true, (102 << 16)
- + (102 << 8) + 0, (255 << 16) + (51 << 8) + 51);
- EntityRegistry.addSpawn(mcreator_testmodel.Entitytestmodel.class, 20, 3, 30, EnumCreatureType.MONSTER, clean(Biome.REGISTRY));
- }
- 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 Entity spawnEntity(int var1, World var2, double var3, double var5,
- * double var7) { if(var1==mobid) return new
- * mcreator_testmodel.Entitytestmodel(var2); else return null; }
- */
- public static class Entitytestmodel extends EntityMob {
- World world = null;
- public Entitytestmodel(World var1) {
- super(var1);
- world = var1;
- experienceValue = 5;
- this.isImmuneToFire = false;
- addRandomArmor();
- setNoAI(!false);
- }
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
- this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10D);
- if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
- this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3D);
- }
- protected void addRandomArmor() {
- }
- @Override
- protected Item getDropItem() {
- return new ItemStack(Blocks.DROPPER).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("game.neutral.hurt"));
- }
- @Override
- protected net.minecraft.util.SoundEvent getDeathSound() {
- return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.die"));
- }
- @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, ItemStack stack) {
- super.processInteract(entity, hand, stack);
- int i = (int) this.posX;
- int j = (int) this.posY;
- int k = (int) this.posZ;
- return true;
- }
- @Override
- protected float getSoundVolume() {
- return 1.0F;
- }
- }
- // Date: 25/09/2016 23:02:44
- // Template version 1.1
- // Java generated by Techne
- // Keep in mind that you still need to fill in some blanks
- // - ZeuX
- public static class ModelNew extends ModelBase {
- // fields
- ModelRenderer Shape1;
- ModelRenderer Shape2;
- ModelRenderer Shape3;
- ModelRenderer Shape4;
- ModelRenderer Shape5;
- ModelRenderer Shape6;
- ModelRenderer Shape7;
- ModelRenderer Shape8;
- ModelRenderer Shape9;
- ModelRenderer Shape10;
- ModelRenderer Shape11;
- ModelRenderer Shape12;
- ModelRenderer Shape13;
- ModelRenderer Shape14;
- ModelRenderer Shape15;
- ModelRenderer Shape16;
- ModelRenderer Shape17;
- ModelRenderer Shape18;
- ModelRenderer Shape19;
- ModelRenderer Shape20;
- ModelRenderer Shape21;
- ModelRenderer Shape22;
- ModelRenderer Shape23;
- ModelRenderer Shape24;
- ModelRenderer Shape25;
- ModelRenderer Shape26;
- ModelRenderer Shape27;
- public ModelNew()
- {
- textureWidth = 128;
- textureHeight = 128;
- Shape1
- Shape1 = new ModelRenderer(this, 34, 0);
- Shape1.addBox(0F, 0F, 0F, 3, 3, 3);
- Shape1.setRotationPoint(-2F, 16F, -6F);
- Shape1.setTextureSize(128, 128);
- Shape1
- setRotation(Shape1, 0F, 0F, 0F);
- Shape1.mirror = false;
- Shape2
- Shape2.addBox(0F, 0F, 0F, 9, 7, 5);
- Shape2.setRotationPoint(-5F, 14F, -3F);
- Shape2.setTextureSize(128, 128);
- Shape2
- setRotation(Shape2, 0F, 0F, 0F);
- Shape3 = new ModelRenderer(this, 49, 0);
- Shape3.addBox(0F, 0F, 0F, 3, 3, 3);
- Shape3.setRotationPoint(-2F, 20F, 2F);
- Shape3.setTextureSize(128, 128);
- Shape3
- setRotation(Shape3, 0F, 0F, 0F);
- Shape4 = new ModelRenderer(this, 62, 0);
- Shape4.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape4.setRotationPoint(-1F, 21F, 5F);
- Shape4.setTextureSize(128, 128);
- Shape4
- setRotation(Shape4, 0F, 0F, 0F);
- Shape5 = new ModelRenderer(this, 67, 0);
- Shape5.addBox(0F, 0F, 0F, 3, 3, 3);
- Shape5.setRotationPoint(-2F, 20F, 6F);
- Shape5.setTextureSize(128, 128);
- Shape5
- setRotation(Shape5, 0F, 0F, 0F);
- Shape6 = new ModelRenderer(this, 0, 13);
- Shape6.addBox(0F, 0F, 0F, 3, 1, 6);
- Shape6.setRotationPoint(-2F, 15F, -11F);
- Shape6.setTextureSize(128, 128);
- Shape6
- setRotation(Shape6, 0F, 0F, 0F);
- Shape7 = new ModelRenderer(this, 19, 13);
- Shape7.addBox(0F, 0F, 0F, 3, 1, 6);
- Shape7.setRotationPoint(-2F, 19F, -11F);
- Shape7.setTextureSize(128, 128);
- Shape7
- setRotation(Shape7, 0F, 0F, 0F);
- Shape8 = new ModelRenderer(this, 43, 13);
- Shape8.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape8.setRotationPoint(0F, 16F, -10F);
- Shape8.setTextureSize(128, 128);
- Shape8
- setRotation(Shape8, 0F, 0F, 0F);
- Shape9 = new ModelRenderer(this, 48, 13);
- Shape9.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape9.setRotationPoint(0F, 16F, -8F);
- Shape9.setTextureSize(128, 128);
- Shape9
- setRotation(Shape9, 0F, 0F, 0F);
- Shape10 = new ModelRenderer(this, 38, 13);
- Shape10.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape10.setRotationPoint(-1F, 16F, -11F);
- Shape10.setTextureSize(128, 128);
- Shape10
- setRotation(Shape10, 0F, 0F, 0F);
- Shape11 = new ModelRenderer(this, 58, 13);
- Shape11.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape11.setRotationPoint(-2F, 16F, -8F);
- Shape11.setTextureSize(128, 128);
- Shape11
- setRotation(Shape11, 0F, 0F, 0F);
- Shape12 = new ModelRenderer(this, 53, 13);
- Shape12.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape12.setRotationPoint(-2F, 16F, -10F);
- Shape12.setTextureSize(128, 128);
- Shape12
- setRotation(Shape12, 0F, 0F, 0F);
- Shape13 = new ModelRenderer(this, 68, 13);
- Shape13.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape13.setRotationPoint(0F, 18F, -10F);
- Shape13.setTextureSize(128, 128);
- Shape13
- setRotation(Shape13, 0F, 0F, 0F);
- Shape14 = new ModelRenderer(this, 63, 13);
- Shape14.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape14.setRotationPoint(0F, 18F, -8F);
- Shape14.setTextureSize(128, 128);
- Shape14
- setRotation(Shape14, 0F, 0F, 0F);
- Shape15 = new ModelRenderer(this, 73, 13);
- Shape15.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape15.setRotationPoint(-1F, 18F, -11F);
- Shape15.setTextureSize(128, 128);
- Shape15
- setRotation(Shape15, 0F, 0F, 0F);
- Shape16 = new ModelRenderer(this, 78, 13);
- Shape16.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape16.setRotationPoint(-2F, 18F, -8F);
- Shape16.setTextureSize(128, 128);
- Shape16
- setRotation(Shape16, 0F, 0F, 0F);
- Shape17 = new ModelRenderer(this, 83, 13);
- Shape17.addBox(0F, 0F, 0F, 1, 1, 1);
- Shape17.setRotationPoint(-2F, 18F, -10F);
- Shape17.setTextureSize(128, 128);
- Shape17
- setRotation(Shape17, 0F, 0F, 0F);
- Shape18
- Shape18.addBox(0F, 0F, 0F, 5, 5, 3);
- Shape18.setRotationPoint(-3F, 10F, 2F);
- Shape18.setTextureSize(128, 128);
- Shape18
- setRotation(Shape18, -0.5585054F, 0F, 0F);
- Shape19
- Shape19.addBox(0F, 0F, 0F, 3, 3, 2);
- Shape19.setRotationPoint(-2F, 9F, 3F);
- Shape19.setTextureSize(128, 128);
- Shape19
- setRotation(Shape19, -0.5585054F, 0F, 0F);
- Shape20 = new ModelRenderer(this, 12, 21);
- Shape20.addBox(0F, 0F, 0F, 1, 2, 1);
- Shape20.setRotationPoint(1F, 22F, 3F);
- Shape20.setTextureSize(128, 128);
- Shape20
- setRotation(Shape20, 0F, 0F, 0F);
- Shape21 = new ModelRenderer(this, 2, 21);
- Shape21.addBox(0F, 0F, 0F, 1, 2, 1);
- Shape21.setRotationPoint(1F, 22F, 7F);
- Shape21.setTextureSize(128, 128);
- Shape21
- setRotation(Shape21, 0F, 0F, 0F);
- Shape22 = new ModelRenderer(this, 7, 21);
- Shape22.addBox(0F, 0F, 0F, 1, 2, 1);
- Shape22.setRotationPoint(-3F, 22F, 3F);
- Shape22.setTextureSize(128, 128);
- Shape22
- setRotation(Shape22, 0F, 0F, 0F);
- Shape23 = new ModelRenderer(this, 7, 21);
- Shape23.addBox(0F, 0F, 0F, 1, 2, 1);
- Shape23.setRotationPoint(-3F, 22F, 7F);
- Shape23.setTextureSize(128, 128);
- Shape23
- setRotation(Shape23, 0F, 0F, 0F);
- Shape24 = new ModelRenderer(this, 0, 25);
- Shape24.addBox(0F, 0F, 0F, 3, 1, 3);
- Shape24.setRotationPoint(-2F, 19F, 2F);
- Shape24.setTextureSize(128, 128);
- Shape24
- setRotation(Shape24, 0F, 0F, 0F);
- Shape25 = new ModelRenderer(this, 0, 25);
- Shape25.addBox(0F, 0F, 0F, 3, 1, 3);
- Shape25.setRotationPoint(-2F, 19F, 6F);
- Shape25.setTextureSize(128, 128);
- Shape25
- setRotation(Shape25, 0F, 0F, 0F);
- Shape26 = new ModelRenderer(this, 0, 30);
- Shape26.addBox(0F, 0F, 0F, 1, 1, 3);
- Shape26.setRotationPoint(-1F, 20F, 9F);
- Shape26.setTextureSize(128, 128);
- Shape26
- setRotation(Shape26, 0.3316126F, 0.4886922F, 0F);
- Shape27 = new ModelRenderer(this, 0, 30);
- Shape27.addBox(0F, 0F, 0F, 1, 1, 3);
- Shape27.setRotationPoint(-1F, 20F, 9F);
- Shape27.setTextureSize(128, 128);
- Shape27
- setRotation(Shape27, 0.3490659F, -0.4886922F, 0F);
- }
- public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.render(entity, f, f1, f2, f3, f4, f5);
- setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- Shape1
- Shape2
- Shape3
- Shape4
- Shape5
- Shape6
- Shape7
- Shape8
- Shape9
- Shape10
- Shape11
- Shape12
- Shape13
- Shape14
- Shape15
- Shape16
- Shape17
- Shape18
- Shape19
- Shape20
- Shape21
- Shape22
- Shape23
- Shape24
- Shape25
- Shape26
- Shape27
- }
- private void setRotation(ModelRenderer model, float x, float y, float z) {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
- public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement