Jump to content

Choonster

Moderators
  • Posts

    5141
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Yes, that looks correct. Is your field a List or a List<Position> ? Always use generic types when they're available.
  2. You need to save the NBT list tag inside the provided NBT compound tag using NBTTagCompound#setTag in writeToNBT . If you're using generics properly, you shouldn't need to cast objects from your list to Position .
  3. Use Block#getDefaultState to get the default state of a block, then chain IBlockState#withProperty calls to get an IBlockState with the specified property values.
  4. World#getBlock and World#setBlock were replaced by World#getBlockState and World#setBlockState , respectively. These take a BlockPos instead of individual coordinates and take/return an IBlockState instead of a Block . Use IBlockState#getBlock to get the Block represented by a state. Use Block#getDefaultState to get the default state of a block, then chain IBlockState#withProperty calls to get an IBlockState with the specified property values.
  5. Yes, as long as you haven't installed any JAR mods (i.e. mods that you need to put into the Minecraft JAR).
  6. If the list is only maintained and checked on the server, won't it all be running in a single thread? Even if you needed to maintain the list on both sides, wouldn't each side have its own WorldSavedData instance(s) each only being accessed from a single thread?
  7. 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.
  8. 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?
  9. 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.
  10. Upload the logs/fml-client-latest.log file to Gist and link it here.
  11. 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.
  12. 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.
  13. You're missing a required library (log4j), which is almost certainly an issue with your launcher.
  14. 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.
  15. 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 .
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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.
  24. 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).
  25. 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 .
×
×
  • Create New...

Important Information

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