Everything posted by Choonster
-
custom block that prevents spawning of mobs in a certain perimeter
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 .
-
[1.7.10] Problem adding recipes - ClassCastException
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.
-
[1.7.10] Problem adding recipes - ClassCastException
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.
-
[SOLVED] [1.8.9] java.lang.ClassNotFoundException SideOnly Client Code
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.
-
[SOLVED] [1.8.9] java.lang.ClassNotFoundException SideOnly Client Code
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.
-
[SOLVED] [1.8.9] java.lang.ClassNotFoundException SideOnly Client Code
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.
-
Graphical x-ray background using forge 1.8.9 with my resourcepack
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.
-
[Solved]Making a block face you when placed down
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.
-
[1.8.9] no textures
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.
-
[Solved] [1.8.9] Restricting Custom Enchants to Only Specified Item
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).
-
Graphical x-ray background using forge 1.8.9 with my resourcepack
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 .
-
[1.8.9] no textures
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).
-
[1.8.9] no textures
No, just fix the syntax error.
-
[SOLVED] [1.8.9] java.lang.ClassNotFoundException SideOnly Client Code
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.
-
custom block that prevents spawning of mobs in a certain perimeter
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.
-
[1.8] Custom Biome Not Spawning
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.
-
[1.7.10] How to get name ID from ItemStack
Call RegistryNamespaced#getNameForObject on Item.itemRegistry to get the name of an Item .
-
[1.8.9] Minecraft is crash at render register
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.
-
[1.8] Custom Biome Not Spawning
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?
-
Forge not finding mcmod.info file?
The idea { module { inheritOutputDirs = true; } } line hasn't been required since this commit in ForgeGradle 2.0.
-
[1.8.9] Minecraft is crash at render register
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.
-
[1.8.9] no textures
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.
-
[1.7.10] Generating textures during startup
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)
-
[1.8.9] no textures
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.
-
[1.7.10] Generating textures during startup
If you have a greyscale texture, you can override Item#getColorFromItemStack(ItemStack stack, int renderPass) to colour it at runtime.
IPS spam blocked by CleanTalk.