20ChenM Posted November 6, 2020 Posted November 6, 2020 I just moved my 1.15.2 mod to 1.16.1 by replacing the build.gradle with a 1.16.1 build.gradle from the 1.16.1 mdk. I then recreated the workspace. For some reason though, the .set commands dont work and I get an error saying:Cannot resolve method 'setLightLevel' in 'Properties' My Code: package com.Michael.TutorialMod2.blocks; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class RubyBlock extends Block { public RubyBlock() { super(Block.Properties.create(Material.IRON) .hardnessAndResistance(5.0f,6.0f) .sound(SoundType.METAL) .harvestLevel(3) .harvestTool(ToolType.PICKAXE) .setLightLevel(value ->1) ); } } Quote
poopoodice Posted November 6, 2020 Posted November 6, 2020 (edited) Have you even try to look at vanilla or do some research? Edited November 6, 2020 by poopoodice Quote
TheGreyGhost Posted November 6, 2020 Posted November 6, 2020 Hi Every time the Minecraft version updates, there are a lot of changes to functions; sometimes it's just the names, other times the signatures changes, and sometimes whole classes and groups of classes are refactored to work differently. The best way to fix these problems during an update is 1) Find a vanilla class that uses the method in (eg) 1.15.2 2) Find the same vanilla class in 1.16.3, browse through the code until you find the code that calls the same method and see what it has changed to. 90% of the time you'll find it within a minute. -TGG Quote
20ChenM Posted November 6, 2020 Author Posted November 6, 2020 what is an srg name? I have done lots of research but none of the posts that talk about my problem are clear enough for me to understand. Im still a modding newbie Quote
20ChenM Posted November 6, 2020 Author Posted November 6, 2020 is there an import to get the .set commands? does anyone know what they are? Quote
20ChenM Posted November 6, 2020 Author Posted November 6, 2020 I figured it out. My mappings were out of date. i was in 20200543.1.16 but I should have been in 20200723.1.16.1 For anyone that has the same problem as me and comes across this forum, you can change the mapping version by going to the build.gradle file in your forge mdk and it will be around line 29. Quote
Draco18s Posted November 6, 2020 Posted November 6, 2020 50 minutes ago, 20ChenM said: what is an srg name? Every class, method, field, parameter, and local variable has 4 names: Notch Names (these are what the game is originally programmed in). We do not have these for most things, Mojang is (supposedly?) publishing a deobf map, but I don't think it is in use by Forge yet. Obfuscated Names (these are what you would see if you opened Minecraft's source in a decompiler). a, aa, ab, abb, etc. It is unreadable. SRG Names (these are the first step in deobfuscation, machine translation from the obfuscated source to a consistent mapping). Not human readable, but the same method will always deobf to the same SRG name even as things change and get new Obfuscated names. MCP Names (these are the human readable ones). These take time and constant effort to map. Quote 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.
American2050 Posted November 6, 2020 Posted November 6, 2020 5 hours ago, 20ChenM said: I figured it out. My mappings were out of date. i was in 20200543.1.16 but I should have been in 20200723.1.16.1 For anyone that has the same problem as me and comes across this forum, you can change the mapping version by going to the build.gradle file in your forge mdk and it will be around line 29. I never had issues with this before, but I guess the mappings that come with the MDK download are out of date? Didn't know we had to manually change them when downloading the MDK I guess that's new also on 1.16. Or is there a reason the "Recommended" version doesn't update this value? My 1.16.3 download (forge-1.16.3-34.1.0-mdk) had on mappings mappings channel: 'snapshot', version: '20200514-1.16' Where you got the 20200723.1.16.1 from? So I can got get the corresponding for the 1.16.3- 34.1.0 version. Thanks a lot. Quote
Beethoven92 Posted November 6, 2020 Posted November 6, 2020 5 minutes ago, American2050 said: I never had issues with this before, but I guess the mappings that come with the MDK download are out of date? Didn't know we had to manually change them when downloading the MDK I guess that's new also on 1.16. Or is there a reason the "Recommended" version doesn't update this value? My 1.16.3 download (forge-1.16.3-34.1.0-mdk) had on mappings mappings channel: 'snapshot', version: '20200514-1.16' Where you got the 20200723.1.16.1 from? So I can got get the corresponding for the 1.16.3- 34.1.0 version. Thanks a lot. Take a look at this topic here: https://forums.minecraftforge.net/topic/91282-1161-setrequirestool/?tab=comments#comment-423212 1 Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
Recommended Posts
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.