Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. Ah, I missed that. onBlockHarvested should work. This is only called server-side by vanilla, so send the message when World#isRemote is false .
  2. Got it. So I should write @SideOnly(Side.CLIENT) and then below override onBlockDestroyedByPlayer. Makes sense. No. Never use @SideOnly unless the method you're overriding uses it. This method is called on both sides. Instead, check the value of the World#isRemote field ( true on the client, false on the server). I usually send chat messages from the server side, but I don't think it matters as long as you only do it from one.
  3. There's no such thing as "the player" outside of client-only code. There may be any number of players in a World . You should override Block#onBlockDestroyedByPlayer instead, making sure to only send the message on one side.
  4. That won't work. Only one instance of the class exists, so any fields are shared between all stacks of that item type. You need to store all data in the NBT, read from and write to the stack's tag compound directly rather than storing data in fields.
  5. Item s are singletons, only one instance of the class exists for each type. If you want to store data for individual items, you need to use the NBTTagCompound of the ItemStack that you receive as an argument of various Item methods. If you don't have an ItemStack argument, you don't have access to the data.
  6. I've trouble with sending a packet from server side to client side It's my first time with packet sending Have you searched for a tutorial? I believe diesieben07 has one on this forum.
  7. Each possible state of a Block is assigned an ID based on the Block 's ID (automatically assigned) and the metadata value of that state (returned from Block#getMetaFromState ). These IDs are used by ExtendedBlockStorage to store the contents of each chunk. If two states share a metadata value, ExtendedBlockStorage won't distinguish between them. If you want a property's value to be saved with the world, you need to store it in the metadata (just like 1.7.10 and earlier).
  8. You need to encode the files in UTF-8 instead of ASCII/ANSI. How you do this depends on your IDE, there are probably instructions for this if you search.
  9. 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
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. https://github.com/MinecraftForge/MinecraftForge/blob/b45fd787f36626ef84f26e881848167fec5957b5/src/test/java/net/minecraftforge/debug/ModelFluidDebug.java
  17. 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.
  18. Look at the doc comment for the VersionRange.createFromVersionSpec method, which is used to parse the acceptedMinecraftVersions field.
  19. What's your current issue? If it's still crashing, post the new crash report.
  20. 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.
  21. 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.
  22. 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 .
  23. What determines the cooldown of the wand? Player level? Wand level? Wand type?
  24. 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.
  25. 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.
×
×
  • Create New...

Important Information

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