Solved New remapping tool (specialsource-maven-plugin) doesn't rename fields?

Discussion in 'Spigot Plugin Development' started by StudioCode, Jun 11, 2021.

Thread Status:
Not open for further replies.
  1. Hey, I am having an issue with the new remapping tool:
    In the first step of the remapping (offical mojang names to obfuscated names): Field names aren't getting remapped, meaning player.level (nms player) should be translated to player.t (which is the obfuscated name) but it stays player.level
    Class names and method names are getting renamed though.

    This is a code snippet that causes this issue:
    Code (Java):
        public AnvilInventoryImpl(ServerPlayer player, String title, Consumer<String> renameHandler) {
            super(player.nextContainerCounter(), player.getInventory(),
                ContainerLevelAccess.create(player.level, new BlockPos(Integer.MAX_VALUE, 0, 0)));
         
            this.title = title;
            this.renameHandler = renameHandler;
            this.player = player;
         
            CraftInventoryAnvil inventory = new CraftInventoryAnvil(access.getLocation(),
                inputSlots, resultSlots, this);
            this.view = new CraftInventoryView(player.getBukkitEntity(), inventory, this);
        }
    which gets remapped to this (remapped-obf.jar)
    player.level should be player.t now, but it isn't
    Code (Java):
        public AnvilInventoryImpl(final abs player, final String title, final Consumer<String> renameHandler) {
            super(player.nextContainerCounter(), player.getInventory(), bmu.a(player.level, new gg(Integer.MAX_VALUE, 0, 0)));
            this.title = title;
            this.renameHandler = renameHandler;
            this.player = player;
            final CraftInventoryAnvil inventory = new CraftInventoryAnvil(this.access.getLocation(), this.inputSlots, (art)this.resultSlots, (bml)this);
            this.view = new CraftInventoryView((HumanEntity)player.getBukkitEntity(), (Inventory)inventory, (bmj)this);
        }
    This is the build config I am using, as I said everything works except fields, which aren't getting renamed:
    Code (Text):
        <build>
            <plugins>
                <plugin>
                    <groupId>net.md-5</groupId>
                    <artifactId>specialsource-maven-plugin</artifactId>
                    <version>1.2.2</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>remap</goal>
                            </goals>
                            <id>remap-obf</id>
                            <configuration>
                                <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                                <reverse>true</reverse>
                                <remappedArtifactAttached>true</remappedArtifactAttached>
                                <remappedClassifierName>remapped-obf</remappedClassifierName>
                            </configuration>
                        </execution>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>remap</goal>
                            </goals>
                            <id>remap-spigot</id>
                            <configuration>
                                <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                                <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-spigot</srgIn>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
     
Thread Status:
Not open for further replies.