Jump to content

Choonster

Moderators
  • Posts

    5153
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. 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.
  2. 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 .
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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).
  12. 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 .
  13. 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).
  14. 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.
  15. 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.
  16. 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.
  17. Call RegistryNamespaced#getNameForObject on Item.itemRegistry to get the name of an Item .
  18. Your init method is still handling FMLPreInitializationEvent Your ClientProxy#renderRegisterBlock method is using a hardcoded model name, so every block you register with it will use the same model. You're also creating a new Item to access the static method Item.getItemFromBlock , this makes no sense.
  19. Yes, you should call them in the preInit phase from your @Mod class. If you don't call them anywhere, how do you expect the biomes to be registered?
  20. The idea { module { inheritOutputDirs = true; } } line hasn't been required since this commit in ForgeGradle 2.0.
  21. Your MyModBase.init method actually handles FMLPreInitializationEvent instead of FMLInitializationEvent , so it's being called in the preInit phase rather than init. The RenderItem instance is only created between preInit and init, so you can't use it in preInit. I highly suggest using ModelLoader.setCustomModelResourceLocation / ModelLoader.setCustomMeshDefinition instead of the ItemModelMesher#register overloads. You should also use the sided proxy system (i.e. @SidedProxy ) instead of checking the event's side.
  22. Does your block have an item model? If you name your block's item model the same as the block's registry name, it will automatically be loaded without having to be registered manually. Please post the FML log (from logs/fml-client-latest.log, not your IDE's console), it will almost certainly tell you what went wrong.
  23. You can try using a single texture with both greyscale and pre-coloured parts, but I'm not sure it would work properly (I don't know much about OpenGL). If that doesn't work, you'll need to separate the greyscale and pre-coloured parts into separate textures and render your item in multiple passes. Override the following methods: Item#requiresMultipleRenderPasses to return true Item#getRenderPasses to return the number of render passes you need (only if you need more than 2) Item#getIconFromDamageForRenderPass to return the appropriate IIcon for the render pass Item#getColorFromItemStack to return the appropriate colour for the render pass (or return the super method's result for no colour)
  24. Again, the error tells you exactly what went wrong and which file it looked for. There's no model at the location minecraft:models/block/unstable_ore.json ( minecraft is the default resource domain if you don't specify one), presumably there is one in the at that path in the um resource domain.
×
×
  • Create New...

Important Information

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