Posted July 24, 20196 yr Hi, I've recently finished the classes for my BlockGrinder, but onBlockActivated seems to not be firing when I right-click the block. When I right-click it, absolutely nothing happens. Here's the code: //When right-clicked @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) { return true; } final TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileGrinder) { playerIn.openGui(Main.instance, ModGuiHandler.MOD_GRINDER, worldIn, pos.getX(), pos.getY(), pos.getZ()); playerIn.addStat(StatList.FURNACE_INTERACTION); } return true; } I used the BlockFurnace class as reference for this method, but it doesn't open the GUI nor make the player right-click animation for the block
July 24, 20196 yr This should probably be helping you : https://github.com/sunsigne/Sunsigne It's a mod i created 6 months ago in 1.12.2 and there is a fully fonctionnal "centrifuge", whose the fonction might be similar to your grinder
July 24, 20196 yr Author Thank you! I got the onBlockActivated method functioning correctly. Now I just have two smelting bugs... it instantly smelts items, even when there's no fuel
July 24, 20196 yr 45 minutes ago, ssbbpeople said: Thank you! I got the onBlockActivated method functioning correctly. Now I just have two smelting bugs... it instantly smelts items, even when there's no fuel Not sure if you are asking for help or not...but if you want help we need to see the code for your TE. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 24, 20196 yr Author Yes, sorry I forgot to link my GitHub. Here's the link:https://github.com/SpookyBarca/Metallurgy All my Grinder files are in the same package.
July 24, 20196 yr 21 minutes ago, ssbbpeople said: Yes, sorry I forgot to link my GitHub. Here's the link:https://github.com/SpookyBarca/Metallurgy All my Grinder files are in the same package. You never ever check if the time passed smelting is high enough and you also never check if the furnace has fuel in your trySmeltItem method. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 24, 20196 yr Author How can I check that in the trySmeltItem if there's no boolean? I thought I already checked that with boolean isItemValid method
July 24, 20196 yr 56 minutes ago, ssbbpeople said: How can I check that in the trySmeltItem if there's no boolean? I thought I already checked that with boolean isItemValid method if (this.smeltTime >= this.maxSmeltTime) Edited July 24, 20196 yr by Animefan8888 Using the code block. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 24, 20196 yr Author Okay, I inserted the code: private void trySmeltItem(){ if (this.smeltTime >= this.maxSmeltTime) { return; } ... And the bug still remains :-/
July 24, 20196 yr 12 minutes ago, ssbbpeople said: Okay, I inserted the code: private void trySmeltItem(){ if (this.smeltTime >= this.maxSmeltTime) { return; } ... And the bug still remains ? No that is not what I said. You need to actually smelt the item when that condition is true. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 25, 20196 yr Author Oh okay. So I rearranged it like this: if (this.canSmeltItem()) { if (this.smeltTime >= this.maxSmeltTime) { return; } The bug occurs, but its under the if statement canSmeltItem
July 25, 20196 yr Just now, ssbbpeople said: Oh okay. So I rearranged it like this: if (this.canSmeltItem()) { if (this.smeltTime >= this.maxSmeltTime) { return; } The bug occurs, but its under the if statement canSmeltItem Do you know the Java language or is Minecraft Modding your first venture? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 25, 20196 yr Author I'm starting to learn Java, I made the mistake of going to modding tutorials first
July 25, 20196 yr Look at the if-statement. Consider likely values. Compute the outcome in your head. If that fails, use the debugger. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
July 25, 20196 yr 2 minutes ago, ssbbpeople said: I'm starting to learn Java, I made the mistake of going to modding tutorials first Yes, yes you have. You should probably get some programming experience first. Or if you are dead set on doing this you won't really get help here because we don't like to have to teach Java to people. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 25, 20196 yr Author I understand that. I'm sort of in a time crunch, so I figured going for tutorials would be the fastest way, for now. In the future/now I'll study more on java
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.