-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
custom block that prevents spawning of mobs in a certain perimeter
Choonster replied to Thaliviel's topic in Modder Support
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. -
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?
-
Where are Forge source downloads for 1.8.9/1.8.8/1.8?
Choonster replied to bigbadwolf88888's topic in Modder Support
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. -
Upload the logs/fml-client-latest.log file to Gist and link it here.
-
custom block that prevents spawning of mobs in a certain perimeter
Choonster replied to Thaliviel's topic in Modder Support
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. -
custom block that prevents spawning of mobs in a certain perimeter
Choonster replied to Thaliviel's topic in Modder Support
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. -
Crash using Forge (Custom Launcher, *not cracked*)
Choonster replied to LucasansS's topic in Support & Bug Reports
You're missing a required library (log4j), which is almost certainly an issue with your launcher. -
[1.7.10] Problem adding recipes - ClassCastException
Choonster replied to ax1m's topic in Modder Support
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. -
custom block that prevents spawning of mobs in a certain perimeter
Choonster replied to Thaliviel's topic in Modder Support
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
Choonster replied to ax1m's topic in Modder Support
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
Choonster replied to ax1m's topic in Modder Support
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
Choonster replied to Zetal's topic in Modder Support
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
Choonster replied to Zetal's topic in Modder Support
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
Choonster replied to Zetal's topic in Modder Support
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. -
[Solved]Making a block face you when placed down
Choonster replied to Silly511's topic in Modder Support
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. -
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
Choonster replied to PegBeard's topic in Modder Support
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). -
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 .
-
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).
-
No, just fix the syntax error.
-
[SOLVED] [1.8.9] java.lang.ClassNotFoundException SideOnly Client Code
Choonster replied to Zetal's topic in Modder Support
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
Choonster replied to Thaliviel's topic in Modder Support
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. -
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.
-
Call RegistryNamespaced#getNameForObject on Item.itemRegistry to get the name of an Item .