GotoLink
Members-
Posts
2012 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GotoLink
-
gradlew --refresh-dependencies eclipse That should set the libraries appropriately.
-
[How-To]Build multiple separate projects with Gradle
GotoLink replied to GotoLink's topic in ForgeGradle
@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' } } -
You should really consider changing this.
-
You are supposed to set the initial value in entityInit().
-
[1.6.4] [SOLVED] KeyBinding multiplayer problem
GotoLink replied to Jacky2611's topic in Modder Support
Look at the packet tutorials on the wiki. -
Integration with other mods without being a dependency
GotoLink replied to SkylordJoel's topic in Modder Support
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. -
Well, read BlockSapling again, the answer is there.
-
Look at the bonemeal tutorial on the wiki.
-
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.
-
[1.6.4] setting harvest level of vanilla minecraft blocks
GotoLink replied to Ziplock_Jim's topic in Modder Support
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. -
Use IShearable interface.
-
You should use FMLPreInitializationEvent.
-
Closing bracket ] is missing.
-
[1.6.4]Forge Block Event Handler and Tile entities
GotoLink replied to skullywag's topic in Modder Support
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. -
[Question] Is it possible to use blocks from other mods?
GotoLink replied to ColdFox's topic in Modder Support
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. -
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); } }
-
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 }
-
You can still put breakpoints and run client/server debug.
-
You need to add something after --accessToken, as with --version and --tweakClass.
-
[1.7.2] sound bug with tick event with demostration video
GotoLink replied to mrgreaper's topic in Modder Support
@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. -
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 } } }
-
[1.7.2] Drawing a string on the top-left corner of the screen.
GotoLink replied to coolboy4531's topic in Modder Support
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. -
Then remove the task when there is no player around.
-
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.
-
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