Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mod.mcreator;
- 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.EnumParticleTypes;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.DamageSource;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.Item;
- import net.minecraft.entity.projectile.EntityTippedArrow;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.monster.EntityWitch;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.ai.EntityAIWander;
- import net.minecraft.entity.ai.EntityAISwimming;
- import net.minecraft.entity.ai.EntityAILookIdle;
- import net.minecraft.entity.ai.EntityAILeapAtTarget;
- import net.minecraft.entity.ai.EntityAIAttackRanged;
- import net.minecraft.entity.ai.EntityAIAttackMelee;
- import net.minecraft.entity.IRangedAttackMob;
- import net.minecraft.entity.EnumCreatureType;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.Entity;
- import net.minecraft.client.renderer.entity.RenderSnowball;
- import net.minecraft.client.renderer.entity.RenderLiving;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.client.model.ModelPlayer;
- 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_apurpleMage {
- 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_apurpleMage.ModelPlayer(), 0) {
- protected ResourceLocation getEntityTexture(Entity par1Entity) {
- return new ResourceLocation("sss.png");
- }
- };
- RenderingRegistry.registerEntityRenderingHandler(mcreator_apurpleMage.EntityapurpleMage.class, customRender);
- RenderingRegistry.registerEntityRenderingHandler(EntityArrowCustom.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(),
- new ItemStack(mcreator_ashootingskull.block).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:apurpleMage"), mcreator_apurpleMage.EntityapurpleMage.class,
- "apurpleMage", entityID, instance, 64, 1, true, (102 << 16) + (0 << 8) + 102, (0 << 16) + (0 << 8) + 0);
- EntityRegistry.addSpawn(mcreator_apurpleMage.EntityapurpleMage.class, 0, 0, 0, EnumCreatureType.MONSTER, clean(Biome.REGISTRY));
- int entityID2 = MathHelper.getRandomUUID().hashCode();
- EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:entitybulletapurplemage"), EntityArrowCustom.class,
- "entitybulletapurplemage", 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 EntityapurpleMage extends EntityWitch implements IRangedAttackMob {
- World world = null;
- public EntityapurpleMage(World var1) {
- super(var1);
- world = var1;
- experienceValue = 8;
- this.isImmuneToFire = false;
- addRandomArmor();
- setNoAI(!true);
- this.tasks.addTask(0, new EntityAISwimming(this));
- this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
- this.tasks.addTask(8, new EntityAILookIdle(this));
- this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
- this.tasks.addTask(5, new EntityAILookIdle(this));
- this.tasks.addTask(10, new EntityAILeapAtTarget(this, 0.8F));
- this.tasks.addTask(20, new EntityAIAttackMelee(this, 1.0D, false));
- this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
- }
- protected void addRandomArmor() {
- }
- public void onLivingUpdate() {
- super.onLivingUpdate();
- World par1World = this.world;
- int par2 = (int) this.posX;
- int par3 = (int) this.posY;
- int par4 = (int) this.posZ;
- Random par5Random = this.rand;
- if (true)
- for (int l = 0; l < 2; ++l) {
- double d0 = (double) ((float) par2 + par5Random.nextFloat());
- double d1 = (double) ((float) par3 + par5Random.nextFloat());
- double d2 = (double) ((float) par4 + par5Random.nextFloat());
- double d3 = 0.0D;
- double d4 = 0.0D;
- double d5 = 0.0D;
- int i1 = par5Random.nextInt(2) * 2 - 1;
- d3 = ((double) par5Random.nextFloat() - 0.5D) * 0.2999999985098839D;
- d4 = ((double) par5Random.nextFloat() - 0.5D) * 0.2999999985098839D;
- d5 = ((double) par5Random.nextFloat() - 0.5D) * 0.2999999985098839D;
- par1World.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
- }
- }
- 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 null;
- }
- @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) {
- 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;
- }
- }
- /**
- * ModelPlayer - Either Mojang or a mod author Created using Tabula 5.1.0
- */
- public static class ModelPlayer extends ModelBase {
- public ModelRenderer leftleg;
- public ModelRenderer rightleg;
- public ModelRenderer leftarm;
- public ModelRenderer head;
- public ModelRenderer rightarm;
- public ModelRenderer torso;
- public ModelRenderer circle;
- public ModelRenderer leftarmcape;
- public ModelRenderer headtop;
- public ModelRenderer headsideright;
- public ModelRenderer headsideleft;
- public ModelRenderer headsideback;
- public ModelRenderer shadeleft;
- public ModelRenderer shaderight;
- public ModelRenderer shaderL2;
- public ModelRenderer shaderR2;
- public ModelRenderer undershader;
- public ModelRenderer bachshade1;
- public ModelRenderer bachshade2;
- public ModelRenderer bachshade3;
- public ModelRenderer rightarmcape;
- public ModelRenderer capefront;
- public ModelRenderer capefrontnder;
- public ModelRenderer capeback;
- public ModelRenderer capebackunder;
- public ModelPlayer() {
- this.textureWidth = 64;
- this.textureHeight = 64;
- this.torso = new ModelRenderer(this, 16, 32);
- this.torso.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.torso.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.25F);
- this.rightarm = new ModelRenderer(this, 32, 48);
- this.rightarm.setRotationPoint(5.0F, 2.5F, -0.0F);
- this.rightarm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, 0.0F);
- this.setRotateAngle(rightarm, -1.1838568316277536F, 0.40980330836826856F, -0.10000736613927509F);
- this.shaderL2 = new ModelRenderer(this, 10, 0);
- this.shaderL2.setRotationPoint(2.0F, -5.0F, -5.1F);
- this.shaderL2.addBox(0.0F, 0.0F, 0.0F, 1, 3, 1, 0.0F);
- this.rightleg = new ModelRenderer(this, 0, 48);
- this.rightleg.setRotationPoint(1.9F, 12.0F, 0.1F);
- this.rightleg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.25F);
- this.shaderR2 = new ModelRenderer(this, 10, 0);
- this.shaderR2.setRotationPoint(-3.0F, -4.9F, -5.1F);
- this.shaderR2.addBox(0.0F, 0.0F, 0.0F, 1, 3, 1, 0.0F);
- this.rightarmcape = new ModelRenderer(this, 3, 0);
- this.rightarmcape.setRotationPoint(-1.5F, -2.1F, -2.4F);
- this.rightarmcape.addBox(0.0F, 0.0F, 0.0F, 4, 11, 6, 0.0F);
- this.bachshade3 = new ModelRenderer(this, 6, 2);
- this.bachshade3.setRotationPoint(-2.0F, -5.0F, 8.0F);
- this.bachshade3.addBox(0.0F, 0.0F, 0.0F, 4, 5, 3, 0.0F);
- this.setRotateAngle(bachshade3, -0.40980330836826856F, 0.0F, 0.0F);
- this.shaderight = new ModelRenderer(this, 10, 0);
- this.shaderight.setRotationPoint(-2.0F, -4.9F, -5.1F);
- this.shaderight.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
- this.capeback = new ModelRenderer(this, 44, 31);
- this.capeback.setRotationPoint(-4.0F, 1.0F, 2.3F);
- this.capeback.addBox(0.0F, 0.0F, 0.0F, 9, 16, 1, 0.0F);
- this.setRotateAngle(capeback, 0.045553093477052F, 0.0F, 0.0F);
- this.undershader = new ModelRenderer(this, 4, 9);
- this.undershader.setRotationPoint(-5.0F, 1.0F, -5.0F);
- this.undershader.addBox(0.0F, 0.0F, 0.0F, 9, 1, 2, 0.0F);
- this.bachshade1 = new ModelRenderer(this, 4, 0);
- this.bachshade1.setRotationPoint(-4.0F, -8.8F, 3.0F);
- this.bachshade1.addBox(0.0F, 0.0F, 0.0F, 8, 9, 4, 0.0F);
- this.setRotateAngle(bachshade1, -0.091106186954104F, 0.0F, 0.0F);
- this.capefront = new ModelRenderer(this, 46, 31);
- this.capefront.setRotationPoint(-4.0F, 2.0F, -3.3F);
- this.capefront.addBox(0.0F, 0.0F, 0.0F, 8, 15, 1, 0.0F);
- this.setRotateAngle(capefront, -0.045553093477052F, 0.0F, 0.0F);
- this.headsideright = new ModelRenderer(this, 5, -3);
- this.headsideright.setRotationPoint(3.0F, -8.0F, -5.1F);
- this.headsideright.addBox(0.0F, 0.0F, 0.0F, 2, 9, 10, 0.0F);
- this.bachshade2 = new ModelRenderer(this, 6, 2);
- this.bachshade2.setRotationPoint(-3.0F, -7.0F, 6.0F);
- this.bachshade2.addBox(0.0F, 0.0F, 0.0F, 6, 7, 3, 0.0F);
- this.setRotateAngle(bachshade2, -0.27314402793711257F, 0.0F, 0.0F);
- this.head = new ModelRenderer(this, 32, 12);
- this.head.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 9, 8, 0.0F);
- this.leftarm = new ModelRenderer(this, 50, 48);
- this.leftarm.setRotationPoint(-5.0F, 2.5F, 0.0F);
- this.leftarm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, 0.0F);
- this.setRotateAngle(leftarm, -1.4067353771074294F, -0.3068288825006031F, 0.3722787294503905F);
- this.capebackunder = new ModelRenderer(this, 44, 41);
- this.capebackunder.setRotationPoint(-4.0F, 16.5F, 3.0F);
- this.capebackunder.addBox(0.0F, 0.0F, 0.0F, 9, 4, 1, 0.0F);
- this.setRotateAngle(capebackunder, 0.22759093446006054F, 0.0F, 0.0F);
- this.shadeleft = new ModelRenderer(this, 10, 0);
- this.shadeleft.setRotationPoint(1.0F, -4.9F, -5.1F);
- this.shadeleft.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
- this.headsideleft = new ModelRenderer(this, 4, -3);
- this.headsideleft.setRotationPoint(-5.1F, -8.0F, -5.1F);
- this.headsideleft.addBox(0.0F, 0.0F, 0.0F, 2, 9, 10, 0.0F);
- this.capefrontnder = new ModelRenderer(this, 46, 42);
- this.capefrontnder.setRotationPoint(-4.0F, 16.5F, -4.0F);
- this.capefrontnder.addBox(0.0F, 0.0F, 0.0F, 8, 4, 1, 0.0F);
- this.setRotateAngle(capefrontnder, -0.22759093446006054F, 0.0F, 0.0F);
- this.leftleg = new ModelRenderer(this, 0, 32);
- this.leftleg.setRotationPoint(-1.9F, 12.0F, 0.1F);
- this.leftleg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.25F);
- this.headtop = new ModelRenderer(this, -7, 9);
- this.headtop.setRotationPoint(-5.0F, -8.8F, -5.1F);
- this.headtop.addBox(0.0F, 0.0F, 0.0F, 10, 4, 10, 0.0F);
- this.circle = new ModelRenderer(this, 36, 0);
- this.circle.setRotationPoint(-6.3F, -1.3F, -12.7F);
- this.circle.addBox(0.0F, 0.0F, 0.0F, 14, 14, 0, 0.0F);
- this.leftarmcape = new ModelRenderer(this, 7, 0);
- this.leftarmcape.setRotationPoint(-2.2F, -2.2F, -2.8F);
- this.leftarmcape.addBox(0.0F, 0.0F, 0.0F, 4, 11, 6, 0.0F);
- this.headsideback = new ModelRenderer(this, -6, 0);
- this.headsideback.setRotationPoint(-4.0F, -8.8F, 1.8F);
- this.headsideback.addBox(0.0F, 0.0F, 0.0F, 9, 10, 3, 0.0F);
- this.head.addChild(this.shaderL2);
- this.head.addChild(this.shaderR2);
- this.rightarm.addChild(this.rightarmcape);
- this.head.addChild(this.bachshade3);
- this.head.addChild(this.shaderight);
- this.torso.addChild(this.capeback);
- this.head.addChild(this.undershader);
- this.head.addChild(this.bachshade1);
- this.torso.addChild(this.capefront);
- this.head.addChild(this.headsideright);
- this.head.addChild(this.bachshade2);
- this.torso.addChild(this.capebackunder);
- this.head.addChild(this.shadeleft);
- this.head.addChild(this.headsideleft);
- this.torso.addChild(this.capefrontnder);
- this.head.addChild(this.headtop);
- this.leftarm.addChild(this.leftarmcape);
- this.head.addChild(this.headsideback);
- }
- @Override
- public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
- this.torso.render(f5);
- this.rightarm.render(f5);
- this.rightleg.render(f5);
- GlStateManager.pushMatrix();
- GlStateManager.translate(this.head.offsetX, this.head.offsetY, this.head.offsetZ);
- GlStateManager.translate(this.head.rotationPointX * f5, this.head.rotationPointY * f5, this.head.rotationPointZ * f5);
- GlStateManager.scale(0.9D, 0.9D, 0.9D);
- GlStateManager.translate(-this.head.offsetX, -this.head.offsetY, -this.head.offsetZ);
- GlStateManager.translate(-this.head.rotationPointX * f5, -this.head.rotationPointY * f5, -this.head.rotationPointZ * f5);
- this.head.render(f5);
- GlStateManager.popMatrix();
- this.leftarm.render(f5);
- this.leftleg.render(f5);
- this.circle.render(f5);
- }
- /**
- * This is a helper function from Tabula to set the rotation of model
- * parts
- */
- public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
- modelRenderer.rotateAngleX = x;
- modelRenderer.rotateAngleY = y;
- modelRenderer.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);
- this.head.rotateAngleY = f3 / (180F / (float) Math.PI);
- this.head.rotateAngleX = f4 / (180F / (float) Math.PI);
- this.leftleg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
- this.rightleg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement