Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. If the problem was that your resources weren't being copied to the output and you were using IntelliJ IDEA, you can add this to your build.gradle to fix it: // Fix resources not being loaded in IDEA // http://www.minecraftforge.net/forum/index.php/topic,32467.msg169687.html#msg169687 idea.module.inheritOutputDirs = true
  2. This particular check is redundant. If getTagCompound returned null , hasTagCompound will always return false ; so there's no need to check both. Have you considered moving the spells to their own classes? It would reduce the number of huge if chains in your wand class.
  3. Like I've tried to tell you several times: don't use the WorldGenTallGrass class (because it can't be used to generate your block), adapt the logic from its generate method into your own class.
  4. Use the same logic as WorldGenTallGrass does for finding the ground level, then generate your block instead of tall grass. WorldGenTallGrass#generate is called from BiomeDecorator#genDecorations , you can trace the call locations from there to see how the initial position is determined.
  5. JSON models control all textures (except if you're using a TESR). Look at the model for a vanilla block with the type of sided textures you want to see which model it inherits.
  6. Don't compare strings with == , use the equals method. Strings with the same content (which is what the equals method checks) aren't always the same object (which is what the == operator checks). Since display names can be changed, I'd recommend storing the UUID of the owner instead (which is guaranteed to remain the same); you can get this from the Entity#getUniqueId method. UUID s are stored in NBT as a long for the most significant bits and a long for the least significant bits (returned from the appropriate UUID getter methods) and can be read back with the UUID(long,long) constructor. UsernameCache.getLastKnownUsername will return the last known username of the player with the specified UUID . I'm not too sure what would cause an item to lose its NBT when dropped. Your code is a bit hard to read, I'd recommend using your IDE's auto-format tool and posting it on Gist or Pastebin with syntax highlighting. The cooldown code in the second code block looks right to me.
  7. The owner of the skull is stored in the NBT, but vanilla recipes ignore the NBT of ingredients. You'd need to make your own recipe class that implements IRecipe and checks the NBT of the ingredients in addition to the Item and metadata.
  8. https://github.com/MinecraftForge/MinecraftForge/blob/b45fd787f36626ef84f26e881848167fec5957b5/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java
  9. WorldGenTallGrass only works with Blocks.tall_grass . I meant for you to look at the class to see how it chooses the generation position rather than use the class itself. In future, please give your Gist files the appropriate file extension (.java for Java code) so syntax highlighting works.
  10. Look at the doc comment for the VersionRange.createFromVersionSpec method, which is used to parse the acceptedMinecraftVersions field.
  11. What's your current issue? If it's still crashing, post the new crash report.
  12. Gradle skips a task when it's already run it before and the output is still valid. It's normal for those tasks to be skipped if you've already set up a workspace for that version before.
  13. WorldGenMinable is designed for replacing a terrain block (e.g. stone) with another block (e.g. ore), but your bushes are supposed to generate on top of the ground rather than in it or in the air. I'd recommend looking at WorldGenTallGrass to see how it determines where the ground level is and then generates on top of it.
  14. So create a getCooldown(ItemStack) method that reads the wand's level and spell from the ItemStack and returns the cooldown of the wand in ticks. Replace the FIRE_RATE constant with a call to this method in isOffCooldown .
  15. What determines the cooldown of the wand? Player level? Wand level? Wand type?
  16. Get the player's level (presumably using your IExtendedEntityProperties implementation), derive the cooldown from it and any relevant properties of the item and then use that instead of the constant.
  17. This section is for mod development help, not mod usage help. I'm not sure there's a section on this forum for that. Unless a mod is client-only (e.g. a minimap) or server-only (e.g. backup creation or admin tools), it must be installed on the dedicated server (if any) and all clients. You both need to have Pixelmon installed.
  18. You're using the 1.7.10 method signatures, but they were changed in 1.8. If you look at the WorldGenMinable class, you'll see the new signatures for the constructor and the generate method. In 1.8, most Block and metadata method parameters were replaced with an IBlockState parameter and individual coordinate parameters were replaced with a BlockPos parameter.
  19. Explicitly comparing booleans won't cause any problems, it just makes your code look messy (and needlessly verbose).
  20. When the player uses the item, store the current total world time (World#getTotalWorldTime) in the NBT. When they use it again, subtract the stored time from the current time and check if it's been at least X ticks since the last use (where X is the cooldown). If it has been, store the current time again and perform the effect; otherwise do nothing. I have an example of this for 1.8 here, I've tried to document it fairly well.
  21. Yes, but there's no need to explicitly compare a boolean to true or false. Just use if (someMethod()) or if (!someMethod()) .
  22. A NullPointerException is being thrown because either itemstack or itemstack.stackTagCompound is null , I suspect it's itemstack.stackCompound . Always check if an ItemStack has a stack tag compound before trying to read from or write to it.
  23. Use IWorldGenerator and GameRegistry.registerWorldGenerator to generate something in the world. You can use World#getTopSolidOrLiquidBlock to get the y coordinate of the highest solid block (excluding leaves) at the specified x and z coordinates (which is usually the ground).
  24. this is what i would do: (remember, you can design your own system to fit your needs, this is just what i would do) have a private final field in your item class containing the cooldown time in ticks. (in this example i'll call it cooldown). timer is the value of the timer (don't know if you want to save it to the nbt or as the dmgValue) in opUpdate(): if(timer > 0){ >>> decrement the timer } in onItemUse(): if(timer <= 0){ >>> use spell >>> reset timer to cooldown } you can use this to get an idea of a possible implementation, but you'll have to implement the actual system yourself, so you can make sure it fits your needs Storing any data in a field of your Item class is a Bad Idea. Item s are singletons, so that cooldown will be shared between all occurrences of that Item . If you need a cooldown, use NBT.
  25. When you set an item as "in use" (like the bow does), you specify the maximum duration of the use (how long the player can hold right click to continue using the item). The useRemaining parameter of getIcon is how many ticks of that maximum duration remain. Subtracting the remaining duration from the maximum duration gives you the current use duration (how long the player has been using the item).
×
×
  • Create New...

Important Information

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