-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Working on net/minecraft/village/TradeOffers$EnchantBookFactory on QuiltMC/quilt-mappings@3f6043b
Proposed param names don't always propagate through constructors, and you can end up with a "ghost" proposal from a previous name that was reset.
I think these issues are just "visual" issues in the editor.
0. Start state
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> f_fykexdki;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> arg) {
this(experience, 0, Integer.MAX_VALUE, arg);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> arg) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.f_fykexdki = arg;
}
//...
}1. Name `f_fykexdki` -> `enchantmentPool` (no propagation)
change propagates to the second constructor, but not the first
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> enchantmentPool;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> arg) {
this(experience, 0, Integer.MAX_VALUE, arg);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> enchantmentPool) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.enchantmentPool = enchantmentPool;
}
//...
}2. Give first constructor param a temp name so it can be reset to obfuscated
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> enchantmentPool;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> TEMP) {
this(experience, 0, Integer.MAX_VALUE, TEMP);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> enchantmentPool) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.enchantmentPool = enchantmentPool;
}
//...
}3. Reset `TEMP` to obfuscated
it ends up with the correct name
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> enchantmentPool;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> enchantmentPool) {
this(experience, 0, Integer.MAX_VALUE, enchantmentPool);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> enchantmentPool) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.enchantmentPool = enchantmentPool;
}
//...
}4. Reset `enchantmentPool` field to obfuscated (no propagation)
change propagates to the second constructor, but not the first, as in 2.
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> f_fykexdki;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> enchantmentPool) {
this(experience, 0, Integer.MAX_VALUE, enchantmentPool);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> arg) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.f_fykexdki = arg;
}
//...
}5. Repeat 2.
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> f_fykexdki;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> TEMP) {
this(experience, 0, Integer.MAX_VALUE, TEMP);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> arg) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.f_fykexdki = arg;
}
//...
}6. Repeat 3. ("ghost" proposal)
TEMP gets reset to enchantmentPool, despite that name appearing nowhere else.
Restarting the editor makes it go back to arg as expected.
static class EnchantBookFactory implements TradeOffers.Factory {
private final int experience;
private final TagKey<Enchantment> f_fykexdki;
private final int minLevel;
private final int maxLevel;
public EnchantBookFactory(int experience, TagKey<Enchantment> enchantmentPool) {
this(experience, 0, Integer.MAX_VALUE, enchantmentPool);
}
public EnchantBookFactory(int experience, int minLevel, int maxLevel, TagKey<Enchantment> arg) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.experience = experience;
this.f_fykexdki = arg;
}
//...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working