Jump to content

[1.15.2] Weird function name


costa99

Recommended Posts

hi,

I'm a beginner in forge programming.

I tried making base mod that add blocks,items ecc.

Today i downloaded a mod and i decomplied with intellij to see how it's made but some functions has weird name like "func_77973_b".

 

I hope someone can explain me this names

Thank you

Link to comment
Share on other sites

7 minutes ago, costa99 said:

I hope someone can explain me this names

Minecraft code is obfuscated. You can't just decompile it and get readable human names.

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.

Link to comment
Share on other sites

14 minutes ago, Animefan8888 said:

Minecraft code is obfuscated. You can't just decompile it and get readable human names.

ok i know that minecraft code is obfuscated and there is mcp but i decompiled a forge mod jar 

this is the code

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package bl4ckscor3.mod.xptome;

import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.ObjectHolder;

@Mod("xpbook")
@EventBusSubscriber(
    modid = "xpbook",
    bus = Bus.MOD
)
public class XPTome {
    public static final String MODID = "xpbook";
    @ObjectHolder("xpbook:xp_book")
    public static final Item XP_BOOK = null;

    public XPTome() {
        MinecraftForge.EVENT_BUS.addListener(this::onAnvilUpdate);
    }

    @SubscribeEvent
    public static void onRegisterItems(Register<Item> event) {
        event.getRegistry().register((new ItemXPTome()).setRegistryName(new ResourceLocation("xpbook", "xp_book")));
    }

    @SubscribeEvent
    public void onAnvilUpdate(AnvilUpdateEvent event) {
        if (event.getLeft().func_77973_b() == XP_BOOK || event.getRight().func_77973_b() == XP_BOOK) {
            event.setCanceled(true);
        }

    }
}

 

i read somewhere about "mappings" but i don't know about

Link to comment
Share on other sites

21 minutes ago, costa99 said:

i read somewhere about "mappings" but i don't know about

Search the forums for "MCP names" "SRG names" and "Notch names" (or "Mojang names").

There's like nine people who've asked that same question just in the last nine months.

 

Mappings are the SRG -> MCP names translation guide.

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.

Link to comment
Share on other sites

43 minutes ago, Draco18s said:

Search the forums for "MCP names" "SRG names" and "Notch names" (or "Mojang names").

I searched and i understand how it works thanks.

 

But my question is if  this mod use this functions means that who made this mod has the mcp name of it and why i didn't too?

I'm not up to date? 

Link to comment
Share on other sites

If you downloaded and decompiled someone else's mod, you will never see MCP names.

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.