[SPIGOT-6672] Remapping jar to mapping-obf remaps only some fields Created: 23/Jul/21  Updated: 23/Jul/21  Resolved: 23/Jul/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: RedstoneExpert Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None

Version: This server is running Paper version git-Paper-121 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: b854e7e)
Guidelines Read: Yes

 Description   

Sorry for entering paper as version, but I found the error already, when I decompiled the jar, so testing on spigot would be useless.

I tried to remap my plugin using the two command from the forum post. (

java -cp $HOME/.m2/repository/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar:$HOME/.m2/repository/org/spigotmc/spigot/1.17-R0.1-SNAPSHOT/spigot-1.17-R0.1-SNAPSHOT-remapped-mojang.jar net.md_5.specialsource.SpecialSource --live -i TridentGamesPlugin.jar -o TridentGamesPlugin-obf.jar -m $HOME/.m2/repository/org/spigotmc/minecraft-server/1.17.1-R0.1-SNAPSHOT/minecraft-server-1.17.1-R0.1-SNAPSHOT-maps-mojang.txt --reverse
java -cp $HOME/.m2/repository/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar:$HOME/.m2/repository/org/spigotmc/spigot/1.17-R0.1-SNAPSHOT/spigot-1.17-R0.1-SNAPSHOT-remapped-obf.jar net.md_5.specialsource.SpecialSource --live -i TridentGamesPlugin-obf.jar -o TridentGamesPlugin.jar -m $HOME/.m2/repository/org/spigotmc/minecraft-server/1.17.1-R0.1-SNAPSHOT/minecraft-server-1.17.1-R0.1-SNAPSHOT-maps-spigot.csrg

), but when I decompiled the obfuscated jar (and in the spigot mapped jar, the problem was still there), only the fields and methods, that are declared in the nms class, that I am directly extending got obfuscated and all other are still same. For example, this is my custom entity class

public class Missile extends atw {
    Location mountingPoint;

    public Missile(Location l) {
        super(atk.f, ((CraftWorld)Objects.requireNonNull(l.getWorld())).getHandle());
        this.mountingPoint = l;
        this.setPos(l.getX(), l.getY(), l.getZ());
        this.bM = new MissileEngine(this, 10);
        this.bO = new MissileHomingSystem(this, this.level);
        this.setNoGravity(true);
        this.noPhysics = true;
    }

    protected void v() {
        this.bP.a(0, new PathfinderGoalFireMissile(this));
        this.bP.a(1, new PathfinderGoalTrackTarget(this));
        this.bP.a(2, new PathfinderGoalSelectMeteorite(this));
    }

    public void u_() {
        if (this.lerpSteps > 0) {
            double d0 = this.getX() + (this.lerpX - this.getX()) / (double)this.lerpSteps;
            double d1 = this.getY() + (this.lerpY - this.getY()) / (double)this.lerpSteps;
            double d2 = this.getZ() + (this.lerpZ - this.getZ()) / (double)this.lerpSteps;
            double d3 = ahb.f(this.lerpYRot - (double)this.getYRot());
            this.setYRot(this.getYRot() + (float)d3 / (float)this.lerpSteps);
            this.setXRot(this.getXRot() + (float)(this.lerpXRot - (double)this.getXRot()) / (float)this.lerpSteps);
            --this.lerpSteps;
            this.setPos(d0, d1, d2);
            this.setRot(this.getYRot(), this.getXRot());
        }

        if (this.lerpHeadSteps > 0) {
            this.yHeadRot = (float)((double)this.yHeadRot + ahb.f(this.lyHeadRot - (double)this.yHeadRot) / (double)this.lerpHeadSteps);
            --this.lerpHeadSteps;
        }

        this.level.ab().a("ai");
        if (this.eB()) {
            this.level.ab().a("newAi");
            this.ey();
            this.level.ab().c();
        }

        this.level.ab().c();
        this.level.ab().a("travel");
        this.move(aua.a, this.getDeltaMovement());
        this.level.ab().c();
    }

    public void knockback(double d0, double d1, double d2) {
    }
}

Sorry if I am doing something incorrectly, but I tried to double check everything.



 Comments   
Comment by RedstoneExpert [ 23/Jul/21 ]

I think, that it is, because this is my dependency

<dependency>
   <groupId>org.spigotmc</groupId>
   <artifactId>spigot</artifactId>
   <version>1.17.1-R0.1-SNAPSHOT</version>
   <type>jar</type>
   <classifier>remapped-mojang</classifier>
   <scope>provided</scope>
</dependency>

so it is almost same as the example from update log

<dependency>
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot</artifactId>
    <version>1.17-R0.1-SNAPSHOT</version>
    <classifier>remapped-mojang</classifier>
    <scope>provided</scope>
</dependency>

And in IntelliJ, it works without any problems and when I hit F4, it correctly shows me the decompiled mojang mapped source code

Comment by md_5 [ 23/Jul/21 ]

Your plugin is probably not compiling against mojang maps in the first place.

Generated at Wed Dec 17 19:55:20 UTC 2025 using Jira 10.3.15#10030015-sha1:909cc43d292ca09e774c1a243d9819be3f2628cd.