-
Posts
188 -
Joined
-
Last visited
Everything posted by ModMCdl
-
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
Hahahahahaha NOW I feel stupid. I replaced everything that referenced the mysterious "slot 3" and reset the index to 0, 1, 2. Now the GUI works, it doesn't crash, and now I just have to figure out why the crafting recipes don't actually work! -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
Once I overrode hasTileEntity and createTileEntity, I now error in my TileEntityPestle class. https://pastebin.com/15r7mcCS -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
I use eclipse. It has never done that. Hovering over the method is what brings up said explanation, and I only get "Overrides hasTileEntity" and the path. -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
It only gave me the standard Overrides "x" method -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
You directed to me "read the documentation for the method" and that was the only documentation I found. -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
I went here: https://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.8-11.14.1.1320/net/minecraft/block/Block.html#hasTileEntity(net.minecraft.block.state.IBlockState) -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
Would I also need to override createTileEntity and, because I'm delving into new territory here, are there any thorough examples/explanations for how this is done? (Besides the documentations which helped me very little. -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
Alright, no need to get all up in arms. I'm still learning here. And you going off doesn't help anyone who comes to this post in the future trying to solve the same problem. -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
Ah, didn't realize that was a thing I needed to do! What would I put in the override here? Would I just return the tileentity I made? -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
TileEntityPestle.java https://pastebin.com/x1n5wapC -
[1.11.2] [Solved]Custom GUI error: NullPointerException
ModMCdl replied to ModMCdl's topic in Modder Support
An error in the console was pointing at it, must have been a fluke. Block Class: https://pastebin.com/hHA0scMf -
Hey, so in my custom GUI, I'm getting a NullPointerException directed at the following override: (according to the console) @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) playerIn.openGui(Reference.MOD_ID, GuiHandler.PESTLE_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ()); return true; } I just can't figure out why I'm getting this error. Crash report: https://pastebin.com/NyFi0T5X My GUI Handler: https://pastebin.com/b4w8x1Zf My Container: https://pastebin.com/YYhks7au
-
Try running the following command in Windows Powershell instead. I've found that Windows 10 sometimes likes it more. (You can open Powershell in the "file" tab of the explorer menu). .\gradlew setupDecompWorkspace I've no idea why cmd doesn't work on certain win10 instances, but Powershell does. Even though they're slowly trying to transfer over from cmd, it should still work.
-
[1.11.2][Solved] Cannot cast from boolean to ItemStack
ModMCdl replied to ModMCdl's topic in Modder Support
Wow. I can't believe I missed that. (Essentially, I guess I put my parenthesis in the wrong place lol). The fixed code looks like this to those who are having a similar issue. if(((ItemStack)this.inventory.get(0)).isEmpty() || ((ItemStack)this.inventory.get(1)).isEmpty()) And a boolean would be used to do this, as the solution above depicts. -
Hey, I'm trying to set up my custom crafting tile entity, and I cannot find out why I'm getting this error: Cannot cast from boolean to ItemStack private boolean canCraft() { if(((ItemStack)this.inventory.get(0).isEmpty() || ((ItemStack)this.inventory.get(1).isEmpty()))) //this line errors return false; else { ItemStack result = PestleRecipe.instance().getPestleResult((ItemStack)this.inventory.get(0), (ItemStack)this.inventory.get(1)); if(result.isEmpty()) return false; else { ItemStack output = (ItemStack)this.inventory.get(3); if(output.isEmpty()) return true; if(!output.isItemEqual(result)) return false; int res = output.getCount() + result.getCount(); return res <= getInventoryStackLimit() && res <= output.getMaxStackSize(); } } } Nothing else is broken, just this small bit. Thanks
-
You're missing definitions for unlocalizedName and registryName. I would add them here: public String getUnlocalizedName() { return unlocalizedName; } public String getRegistryName() { return registryName; } Just throw those underneath your MoreMaterialsItems in your Reference class, and it should solve your problem. Putting them in your reference class fine, the OP just blatantly decided not to define them.
-
Minecraft names their jar files per version. For example, in the default installation, the 1.12.2 version jar path is C:\Users\<username>\AppData\Roaming\.minecraft\versions\1.12.2\1.12.2.jar . The launcher profiles (which landles the specific versions and such that are launched when you create or edit a launch option), are stored in a file named "launcher_profiles.json." You could write a process that adds a new profile, or checks to see if the said profile already exists on startup. From there, it should be easy to figure out the rest. As for the without opening the launcher part, good luck. I don't see what the issue with having the player click one more button is, besides attempting to remove all of the original branding and make it appear yours. Curse/Twitch, which is one of the most popular launchers, requires you to go through the original launcher as well. Take a look at how they do it: https://mods.curse.com/client
-
Ahahahahahahahahaha. Yes.
-
[SOLVED] [1.11.2] Plant Crop on Custom Modded Block
ModMCdl replied to ModMCdl's topic in Modder Support
Lol, I literally just got it to work as I got your notification. It really was a stupid problem, and had to do with the "BlockPlanter" class. I had overridden isFertile, but had forgotten to override canSustainPlant. Solved -
Hey, I'm trying to only allow a certain crop to be planted on a custom block (BlockPlanter aka "planter"), but I just cannot get it to work. Any ideas? My seed (in ModItems.java): thaumseed = new ItemSeeds(ModBlocks.thaummix, ModBlocks.planter).setUnlocalizedName("thaumseed").setRegistryName(new ResourceLocation(Reference.MOD_ID, "thaumseed")).setCreativeTab(Magitech.tabMagitech); My Crop (BlockThaummix.java): https://pastebin.com/XeBUtjfD If you need anything else, let me know.
-
It's not necessarily a forge problem though. I've isolated it to be a problem with the jar decompiler that (as far as I can tell), ships with forge.
-
Which is a major step of the learning process. I guess my initial statement was a bit vague. I was trying to emphasize that an underlying understanding of java must be known first.
-
It actually is. While it may not suit you in particular, I know several friends who really got down to it and used Minecraft Modding as a way to implement what they were learning in Java. It isn't an independent way to learn, but it allows an outlet to take what you learn and utilize it and build up off of it.
-
Hey, I just updated to the new Oct release of Eclipse Oxygen, and now, I can no longer access the Minecraft source files. Whenever I try to do so, I get an "Editor could not be initialized" error, with a NoSuchMethodError. Everything else, (including my non Minecraft related java projects), still works fine. I have never seen this before, and googling it is not providing me with working solutions. I believe it has something to do with the provided decompiler, but eclipse cannot detect any updates, and removing it causes elicpse to yell at me for removing a plugin essential to my project. UPDATE: Reverting back to the June release has solved the problem, and I have confirmed there's an incompatibility with the supplied class decompiler. I'm hesitant on marking this problem as solved, however, as the actual problem with the version hasn't been solved.