Jump to content

GotoLink

Members
  • Posts

    2012
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GotoLink

  1. gradlew --refresh-dependencies eclipse That should set the libraries appropriately.
  2. @dev909 You didn't follow my instructions for the "Independent setup" here. I see two mods in the same project folder, and the forge license, readme files...bad boy The problem you might not see, is that Gradle sets by default a test folder as src/test/java and src/test/resources, but this is for testing purposes and not supposed to be built with the 'main' sources. This probably conflicts with what you set into the build.gradle file. If you don't want to move out of the Forge folder, at least make a build.gradle file per mod. That is the easiest way to go. In your situation, put them into the "main" and "test" subfolders with: sourceSets.main{ java{ srcDirs 'java' } resources{ srcDirs 'resources' } }
  3. You should really consider changing this.
  4. You are supposed to set the initial value in entityInit().
  5. Look at the packet tutorials on the wiki.
  6. What's reflection? How do I use it? Reflection is a soft dependency tool, its package is: java.lang.reflect. The main methods you are likely to use are: Class.forName(String)//load a class object from its path Class#getMethod(String, Class...)//get a method object from the class object, with name and parameters Method#invoke(Object, Object...)//call the method from the class object, with given parameters See an example here.
  7. Well, read BlockSapling again, the answer is there.
  8. Look at the bonemeal tutorial on the wiki.
  9. You don't have to configure anything. Just add all the projects. You can import them all at the same time if they are in the same folder.
  10. Man, breaking block by hand != breaking with a tool, that is as simple as that. By the way, the default ItemAxe harvest most things wooden independently of the block harvest level. You should use the BlockEvent(s) if the conditions are met.
  11. Use IShearable interface.
  12. You should use FMLPreInitializationEvent.
  13. Closing bracket ] is missing.
  14. The HarvestDropsEvent only fires if the block can be harvested...i am not sure there is even a case where a player can harvest a mob spawner.
  15. In the particular aspect of recipes, the OreDictionary is here for such a thing. Provided other mod blocks are registered in this dictionary, you can add recipes for them.
  16. EntityAIAttackOnCollide attackoncollide = null; this.tasks.removeTask(attackoncollide); This is really unlikely to work. You need to cache the task you want to change. public EntityAIBase cache; public void onUpdate{ ... EntityPlayer closePlayer = this.worldObj.getClosestPlayerToEntity(this, 4); if(closePlayer==null){ if(this.cache!=null){ this.tasks.removeTask(cache); this.cache = null; } }else if(this.cache ==null) { this.cache = new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false); this.tasks.addTask(3, cache); } }
  17. What? How i suppose to do that? Please give the code if you know something about it. See the line task.addTask ? Then this exist too task.removeTask Now, how to find a player ? EntityPlayer closePlayer = this.worldObj.getClosestPlayerToEntity(this, putSomeDistanceHere); if(closePlayer==null){ //forever alone }else{ //kill the bastard }
  18. You can still put breakpoints and run client/server debug.
  19. You need to add something after --accessToken, as with --version and --tweakClass.
  20. @mrgreaper If you only want to make a funny sound for the player holding the item, client-side all the way. You don't even need to change the sound toggle, since there only is one player on client-side. @Ernio No, what he meant is, his sound toggle as of now, is not player sensitive. If two players equip the item, only the first one will trigger a sound. The flag will be false for the second one. Even more bizarre, if after that, one of the player unequip the item, the other will get a sound.
  21. With a player instance taken from LivingUpdateEvent: AxisAlignedBB aabb= null; if (player.ridingEntity != null && !player.ridingEntity.isDead) { aabb= player.boundingBox.func_111270_a(player.ridingEntity.boundingBox).expand(1.0D, 0.0D, 1.0D); } else { aabb= player.boundingBox.expand(1.0D, 0.5D, 1.0D); } List list = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, aabb); if (list != null) { for (int i = 0; i < list.size(); ++i) { EntityXPOrb xpOrb = (EntityXPOrb)list.get(i); if (!xpOrb.isDead) { //We are sure the xp orb is colliding here } } }
  22. The biggest help you can get is by your own doing: learn how to code. You make nearly one mistakes per line at the moment.
  23. Then remove the task when there is no player around.
  24. Anywhere you want. You don't need to use the forge folder, as long as: -you first ran (by command line in the forge folder) gradlew setupDevWorkspace -your mod folder contains the build.gradle file, gradlew files and gradle folder. By default, the build.gradle file sets things with: /src/main/java/your-packages-here /src/main/resources/your-resources-here Though you can change that.
  25. You can modify the values in xp orb without reflection. Just use the NBT methods: NBTTagCompound nbt = new NBTTagCompound(); xpOrb.writeEntityToNBT(nbt); nbt.setShort("Value", nbt.getShort("Value")*2);//beware out of Short range values xpOrb.readEntityFromNBT(nbt); I'd recommend using the LivingUpdateEvent and perform collision detection for xp orb around the player. This way you can be player specific
×
×
  • Create New...

Important Information

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