Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. You can either save each position as an int array or a compound tag. You don't write to NBT every time a block is added/removed, Minecraft will call readFromNBT and writeToNBT for you.
  2. It looks like you're running OptiFine, which messes with a lot of stuff and occasionally breaks things. Can you reproduce this without any mods installed?
  3. The source download was renamed to MDK (Mod Development Kit), since it hasn't actually included any Forge or Minecraft source code since the switch to ForgeGradle. Forge's official documentation has a Getting Started page here that explains how to set up modern versions of Forge.
  4. Upload the logs/fml-client-latest.log file to Gist and link it here.
  5. You must create a class that extends WorldSavedData and store the data in each instance of that, yes. The page I linked in my first post explains this in more detail. You can't store the list in your Block class directly, since you don't have any way to load/save the data and can't easily separate each dimension's list.
  6. In general, instance methods will only be called if the instance was actually involved in whatever happened. This means that Block#onBlockAdded will only be called on the Block that was actually added to the world.
  7. You're missing a required library (log4j), which is almost certainly an issue with your launcher.
  8. That's not the issue here. You're passing an Object array containing the pattern strings and some of the ingredients followed by the rest of the ingredients, so essentially you end up with this: new ShapedOreRecipe(new ItemStack(tool), new Object[]{ "hXf", " X ", " I ", 'h', "hammer", 'f', "file" }, 'X', "ingot" + mat, 'P', "plate" + mat, 'R', "rod" + mat, 'I', "stickWood") What you want is this (every argument except the first will be wrapped in an array because this is a vararg method): new ShapedOreRecipe(new ItemStack(tool), "hXf", " X ", " I ", 'h', "hammer", 'f', "file", 'X', "ingot" + mat, 'P', "plate" + mat, 'R', "rod" + mat, 'I', "stickWood") You need to create a single array containing all the pattern strings and ingredients and pass that as the second argument of the constructor.
  9. I suggest you override Block#onBlockAdded (called after a block is added to the world) and Block#breakBlock (called when a block is removed from the world, make sure you call the super method so the TileEntity [if any] is removed). Use these to add and remove the block's position to your WorldSavedData .
  10. If you need a collection to store multiple types, you need to declare it using a common parent of those types. String and Character don't have any common parent apart from Object , so declare it as an array of Object s.
  11. ShapedOreRecipe expects the pattern to be 1-3 strings or an array of strings, you're passing an array of pattern strings and ingredients. You need to concatenate the pattern/ingredient array with the other ingredients.
  12. func_175173_a and sendAllWindowProperties are the SRG and MCP names of the same method. You have both in your class, so it's possible that the SRG name is being deobfuscated to the MCP name at load time, creating two methods with the same name and arguments. As a general principle, you can delete any non-override method if it's not being used in your class.
  13. A Container is created on both sides (in the IGuiHandler for the server or in the GuiContainer for the client). A GuiContainer is client-only.
  14. Could you post the crash report and the code mentioned in the stack trace (it doesn't have to be whole classes)? It's hard to help much more than we have since we're just relying on your interpretation of the situation and can't see it for ourselves.
  15. If it works in vanilla without OptiFine or any other mod, I'm not too sure what's going on. I assumed the face culling based on Block#isOpaqueCube was vanilla behaviour.
  16. I'm assuming this is 1.7.10? You should include the Minecraft version in the thread title. Pistons and Dispensers use BlockPistonBase.determineOrientation from their overrides of Block#onBlockPlacedBy to determine the orientation from the placer.
  17. You've posted your item model and .gitignore file, but that's not what I asked for. I need to see your whole project, preferably as a Git repository on GitHub/BitBucket.
  18. Enchantment#canApply is only used by the /enchant command and the Anvil and falls back to Enchantment#canApplyAtEnchantingTable . Enchantment#canApplyAtEnchantingTable is used by the Enchanting Table and the EnchantmentHelper.addRandomEnchantment method (used by mobs and dungeon/fishing loot).
  19. Minecraft assumes that every block is an opaque cube unless told otherwise (i.e. the block overrides Block#isOpaqueCube to return false ). Minecraft won't render a block face if it's being covered by an opaque cube, because the player wouldn't be able to see it anyway. Minecraft doesn't actually analyse models to determine if they're opaque cubes, so you get this x-ray effect when you use a custom model that isn't an opaque cube for a block that Minecraft thinks is one. I don't know what OptiFine's doing behind the scenes, it's possible that it analyses models instead of relying on Block#isOpaqueCube .
  20. Then I'm not too sure what's going on. The log should report any missing/invalid textures or models, but I can't see any errors in it. Could you upload your code to a site like GitHub/BitBucket and link it here? Create the Git repository in your mod's root directory (where build.gradle and src are) and use a gitignore file like this one (the first two lines ignore everything, the rest unignore the files we actually want in the repository).
  21. No, just fix the syntax error.
  22. There's no point in creating an instance yourself and assigning it to the field, FML will always overwrite it with an instance created from the @SidedProxy annotation.
  23. You can subscribe to LivingSpawnEvent.CheckSpawn and set the result to DENY to prevent a passive mob spawn. This isn't fired for mobs spawned from a mob spawner. You'll probably want to maintain a list of locations that have this block using World Saved Data and iterate through them to check whether any are in range to prevent the spawn in your event handler.
  24. Did you try looking at line 192 of BiomeGenBase to see what could be throwing the exception? I suspect it's being thrown because you used an ID of 765, but the BiomeList.biomeList array (where every biome is stored using its ID as the index) is only 256 long.
  25. Call RegistryNamespaced#getNameForObject on Item.itemRegistry to get the name of an Item .
×
×
  • Create New...

Important Information

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