Jump to content

Eastonium

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Eastonium

  1. I just used the latest version of forge to create a new workspace and such, and I don't know if this is concerning, but when I ran the setupDecompWorkspace command, when it was patching the minecraft files it "rejected" the patch for the WorldGenDungeons.java file. Here's what it said: Patching failed: net/minecraft/world/gen/feature/WorldGenDungeons.java Cannot find hunk target 2: Cannot find hunk target @ 0 1/3 failed Rejects written to C:\Users\FamilyVII\Desktop\mcp172\NuiCraft\build\tmp\expandedArchives\forgepatches.zi p_7m9h85aricudh12fe2i8mr2eam\net\minecraft\world\gen\feature\WorldGenDungeons.java.patch.rej just thought the forge people would want to know about this!
  2. I used this to fix the problem: if (entityHit instanceof EntityPlayerMP) { EntityPlayerMP entityPlayer = (EntityPlayerMP)entityHit; entityPlayer.playerNetServerHandler.setPlayerLocation(entityHit.posX, entityHit.posY, entityHit.posZ, entityHit.rotationYaw, entityHit.rotationPitch); }else{ entityHit.setPosition(entityHit.posX, entityHit.posY, entityHit.posZ); }
  3. I have an item that teleports an entity to another spot when hit with it. It works pretty much like the Enderman's teleporting, but the problem is when the item hits a player, the moved wrongly warning comes up and most of the time prevents my item from working. how can I prevent this?
  4. I figured it out. for some reason I was missing the entityPlayer variable for the line that spawns the snowball clone. It didn't give me an error because there's a method that doesn't use the entityPlayer. Thanks for your help, the Entity ID thing I wouldnt've spotted.
  5. I don't know for SURE if it's being spawned, but I checked to see if the spawning code was being ran, and it is. Here's my Client proxy file: package com.eastonium.bionicle; import net.minecraft.client.renderer.entity.RenderSnowball; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxyBionicle extends CommonProxyBionicle { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(EntitySnowballClone.class, new RenderSnowball(ModBase.itemFlying)); } }
  6. I've looked at the Ghast and Bat codes many times. It doesn't use the newer AI tasks, and I've tried adapting it many times...
  7. I have a 3-input furnace in my mod, It worked in 1.6.2, and i'm trying to get it to work in 1.7.2. if you want to see my old code, PM me, or just ask me to put it here. There's a lot of code...
  8. So for the global entity ID, i just put 0, and for any others just add one? Also, the flyingItem thing is just a typo when i was changing the name to put on here. they're the same thing and that item works fine and it's icon shows too. just not when it gets launched.
  9. I'm trying to make a basic clone of the snowball item/entity and I have copied the files directly, fixed any transfer-errors, Registered the Entity, registered the item that is used as the projectile, Registered the rendered in my Client proxy and everything. I am using preInit, and I have no idea what the problem is. In clientproxy: RenderingRegistry.registerEntityRenderingHandler(EntitySnowballClone.class, new RenderSnowball(ModBase.flyingItem)); In main mod file: @SidedProxy(clientSide = "com.eastonium.bionicle.ClientProxyBionicle", serverSide = "com.eastonium.bionicle.CommonProxyBionicle") public static CommonProxyBionicle proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { flyingItem = new ItemNormal().setUnlocalizedName("ItemFlying"); GameRegistry.registerItem(itemFllying, "itemFlying"); EntityRegistry.registerModEntity(EntitySnowballClone.class, "Snowball_Clone", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); snowballClone = new ItemSnowballClone("Teleportation").setUnlocalizedName("SnowballClone"); GameRegistry.registerItem(snowballClone, "snowballClone"); proxy.registerRenderThings(); } Please help!
  10. Is there a way to be able to use the 'gradlew build' command offline? this is assuming I've built once and have downloaded all the necessary assets.
  11. I've looked at a lot of AI now, but I haven't found anything that'd be much of a help. The only thing I found is the updateAITasks() method that runs at the same rate of AI tasks, so I won't be using the onUpdate() for the flying if I ever figure it out. At least I think that would work. I tried something but when it was "hovering" it never did any of the other AI tasks...
  12. Hi, I need some sort of AI for a mob I have that will make it hover above the ground about 4 blocks. I'm not sure how to accomplish this. I don't think I need a new AI class, I can just put it in my onLivingUpdate() method. I know there are some things like getEntityPosition, but I don't know how to utilize these as I don't know how to use the Vec3 object type. If anyone could help, that'd be great!
  13. Thanks a bunch! i didn't fix it at first, but i figured out the rest. thanks again!
  14. I've never used a preinit before. what's the basic setup for it?
  15. I've tried to figure out this error for many hours now. no idea what's wrong. Main file package com.eastonium.moDrinks; @Mod(modid = MoDrinks.MODID, name = "MoDrinks", version = "V2.0 1.7.2") public class MoDrinks { public static final String MODID = "eastonium_modrinks"; public static Block AluminumBlock; @EventHandler public void load(FMLInitializationEvent event) { AluminumBlock = new BlockGeneral().setStepSound(Block.soundTypeMetal).setHardness(1F).setResistance(10.0F).setBlockName("AluminumBlock"); GameRegistry.registerBlock(AluminumBlock, "Eastonium_AluminumBlock"); } package com.eastonium.moDrinks; public class BlockGeneral extends Block { public BlockGeneral() { super(Material.rock); setBlockTextureName(MoDrinks.MODID + ":" + this.getUnlocalizedName().substring(5)); } } (I removed all imports to save space, I know i have them right) In my folder structure is as follows mcp src main java --- com --- eastonium --- moDrinks --- *All java files here* resources --- assets --- eastonium_modrinks --- textures blocks --- *AluminumBlock.png here* I really have no idea what to do. it seems i've tried everything.
  16. The whole point of me asking is because I've tried and can't get the flying speed to change. And yes, I know than I control how it attacks. I want it to attack by touching you just like zombies do. But that is t working now that the mob flies.
  17. Thanks tons! It works beautifully! Maybe you could help me with one more thing... or 2, but they're both small. When the mob didn't have flying, it was easily able to attack me, but now with the flying I never take damage. Also the mob flies wayy to fast.
  18. THIS PART HAS BEEN SOLVED! SEE BELOW FOR NEW PROBLEMS! I'm trying to make a mob that flies toward you and attacks, but every 5 seconds or so, it'll throw a nullpointerexception saying the entity that it is attacking doesn't have a position. Here is all the relevant code: public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (this.isEntityInvulnerable()) { return false; } else { Entity entity = par1DamageSource.getEntity(); if (entity instanceof Entity) { List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(16.0D, 16.0D, 16.0D)); for (int i = 0; i < list.size(); ++i) { Entity entity1 = (Entity)list.get(i); if (entity1 instanceof EntityScarfy) { EntityScarfy entityscarfy = (EntityScarfy)entity1; entityscarfy.becomeAngryAt(entity); } } this.becomeAngryAt(entity); } return super.attackEntityFrom(par1DamageSource, par2); } } private void becomeAngryAt(Entity par1Entity) { this.isAngry = true; this.entityToAttack = par1Entity; } public void updateAITasks() { super.updateAITasks(); if (this.currentFlightTarget != null && (!this.worldObj.isAirBlock(this.currentFlightTarget.posX, this.currentFlightTarget.posY, this.currentFlightTarget.posZ) || this.currentFlightTarget.posY < 1)) { this.currentFlightTarget = null; } if (this.currentFlightTarget == null || this.rand.nextInt(30) == 0 || this.currentFlightTarget.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { if(this.entityToAttack != null) { //HERE IS THE PROBLEM this.currentFlightTarget.set((int)this.entityToAttack.posX, (int)(this.entityToAttack.posY + 0.5F), (int)this.entityToAttack.posZ); } else { this.currentFlightTarget = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(5) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); } } double d0 = (double)this.currentFlightTarget.posX - this.posX; double d1 = (double)this.currentFlightTarget.posY + 0.5F - this.posY; double d2 = (double)this.currentFlightTarget.posZ - this.posZ; this.motionX += (Math.signum(d0) * 0.5D - this.motionX) * 0.10000000149011612D; this.motionY += (Math.signum(d1) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; this.motionZ += (Math.signum(d2) * 0.5D - this.motionZ) * 0.10000000149011612D; float f = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; float f1 = MathHelper.wrapAngleTo180_float(f - this.rotationYaw); this.moveForward = 0.5F; this.rotationYaw += f1; } It doesn't always throw the null pointer, so I don't know why it doesn't work all the time.
  19. I had already played around with the ghast's code for over an hour trying to get it to work the way I wanted and it didn't work.
  20. I've already tried that, and it isn't at all what I wanted, they fly around wayyy to much. and wayy to high.
  21. I am trying to make a mob, and I'd like it to fly around above the ground about 10-16 blocks, wandering just like it would on ground. The other thing I want it to do, is attack anything that attacks it, by constantly changing it's flying trajectory toward the attacker. Please help me! (I'd really appreciate it.)
  22. Anyone have an answer? Even if I could use the decorator to replace it all at this point.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.