File tree Expand file tree Collapse file tree 6 files changed +23
-20
lines changed
src/main/java/com/plusls/xma/compat/gui/screen
xaero_map_addition-compat-mc1_15/src/main/java/com/plusls/xma/compat/mixin/compat/screen
xaero_map_addition-compat-mc1_16/src/main/java/com/plusls/xma/compat/mixin/compat/screen
xaero_map_addition-compat-mc1_17/src/main/java/com/plusls/xma/compat/mixin/compat/screen
xaero_map_addition-compat-mc1_18/src/main/java/com/plusls/xma/compat/mixin/compat/screen Expand file tree Collapse file tree 6 files changed +23
-20
lines changed Original file line number Diff line number Diff line change 2
2
org.gradle.jvmargs =-Xmx4G
3
3
minecraft_version =1.18.2
4
4
loader_version =0.13.3
5
- mod_version =0.2
5
+ mod_version =0.2.1
6
6
pre_release =alpha
7
7
maven_group =com.plusls
8
8
archives_base_name =xaero-map-addition
Original file line number Diff line number Diff line change 3
3
import net .minecraft .client .gui .components .AbstractWidget ;
4
4
5
5
public interface CompatScreen {
6
- < T extends AbstractWidget > T addAbstractWidget (T abstractWidget );
6
+ AbstractWidget addAbstractWidget (AbstractWidget abstractWidget );
7
7
}
Original file line number Diff line number Diff line change 9
9
@ Mixin (Screen .class )
10
10
public abstract class MixinScreen implements CompatScreen {
11
11
12
- // 不知道为什么,如果不加前缀会自动帮我mapping,然而这里不存在mapping
13
12
@ Shadow
14
- protected abstract < T extends AbstractWidget > T shadow$ addButton (T abstractWidget );
13
+ protected abstract AbstractWidget addButton (AbstractWidget abstractWidget );
15
14
16
15
@ Override
17
- public < T extends AbstractWidget > T addAbstractWidget (T abstractWidget ) {
18
- return shadow$ addButton (abstractWidget );
16
+ public AbstractWidget addAbstractWidget (AbstractWidget abstractWidget ) {
17
+ return addButton (abstractWidget );
19
18
}
20
19
}
Original file line number Diff line number Diff line change 2
2
3
3
import com .plusls .xma .compat .gui .screen .CompatScreen ;
4
4
import net .minecraft .client .gui .components .AbstractWidget ;
5
+ import net .minecraft .client .gui .components .events .GuiEventListener ;
5
6
import net .minecraft .client .gui .screens .Screen ;
6
7
import org .spongepowered .asm .mixin .Mixin ;
7
8
import org .spongepowered .asm .mixin .Shadow ;
8
9
9
10
@ Mixin (Screen .class )
10
11
public abstract class MixinScreen implements CompatScreen {
11
12
13
+ // mojang mappings 这里显示是泛型
14
+ // yarn: protected Element addDrawableChild(Element drawableElement)
15
+ // 如果采用泛型会在编译时类型擦除成 Object,然后无法匹配上方法导致 shadow 失败
12
16
@ Shadow
13
- protected abstract < T extends AbstractWidget > T addButton (T abstractWidget );
17
+ protected abstract AbstractWidget addButton (AbstractWidget guiEventListener );
14
18
15
19
@ Override
16
- public < T extends AbstractWidget > T addAbstractWidget (T abstractWidget ) {
20
+ public AbstractWidget addAbstractWidget (AbstractWidget abstractWidget ) {
17
21
return addButton (abstractWidget );
18
22
}
19
23
}
Original file line number Diff line number Diff line change 2
2
3
3
import com .plusls .xma .compat .gui .screen .CompatScreen ;
4
4
import net .minecraft .client .gui .components .AbstractWidget ;
5
- import net .minecraft .client .gui .components .Widget ;
6
5
import net .minecraft .client .gui .components .events .GuiEventListener ;
7
- import net .minecraft .client .gui .narration .NarratableEntry ;
8
6
import net .minecraft .client .gui .screens .Screen ;
9
7
import org .spongepowered .asm .mixin .Mixin ;
10
8
import org .spongepowered .asm .mixin .Shadow ;
11
9
12
10
@ Mixin (Screen .class )
13
11
public abstract class MixinScreen implements CompatScreen {
14
12
13
+ // mojang mappings 这里显示是泛型
14
+ // yarn: protected Element addDrawableChild(Element drawableElement)
15
+ // 如果采用泛型会在编译时类型擦除成 Object,然后无法匹配上方法导致 shadow 失败
15
16
@ Shadow
16
- protected abstract <T extends GuiEventListener & Widget & NarratableEntry > T addRenderableWidget (T guiEventListener );
17
-
17
+ protected abstract GuiEventListener addRenderableWidget (GuiEventListener guiEventListener );
18
18
19
19
@ Override
20
- public < T extends AbstractWidget > T addAbstractWidget (T abstractWidget ) {
21
- return addRenderableWidget (abstractWidget );
20
+ public AbstractWidget addAbstractWidget (AbstractWidget abstractWidget ) {
21
+ return ( AbstractWidget ) addRenderableWidget (abstractWidget );
22
22
}
23
23
}
Original file line number Diff line number Diff line change 2
2
3
3
import com .plusls .xma .compat .gui .screen .CompatScreen ;
4
4
import net .minecraft .client .gui .components .AbstractWidget ;
5
- import net .minecraft .client .gui .components .Widget ;
6
5
import net .minecraft .client .gui .components .events .GuiEventListener ;
7
- import net .minecraft .client .gui .narration .NarratableEntry ;
8
6
import net .minecraft .client .gui .screens .Screen ;
9
7
import org .spongepowered .asm .mixin .Mixin ;
10
8
import org .spongepowered .asm .mixin .Shadow ;
11
9
12
10
@ Mixin (Screen .class )
13
11
public abstract class MixinScreen implements CompatScreen {
14
12
13
+ // mojang mappings 这里显示是泛型
14
+ // yarn: protected Element addDrawableChild(Element drawableElement)
15
+ // 如果采用泛型会在编译时类型擦除成 Object,然后无法匹配上方法导致 shadow 失败
15
16
@ Shadow
16
- protected abstract <T extends GuiEventListener & Widget & NarratableEntry > T addRenderableWidget (T guiEventListener );
17
-
17
+ protected abstract GuiEventListener addRenderableWidget (GuiEventListener guiEventListener );
18
18
19
19
@ Override
20
- public < T extends AbstractWidget > T addAbstractWidget (T abstractWidget ) {
21
- return addRenderableWidget (abstractWidget );
20
+ public AbstractWidget addAbstractWidget (AbstractWidget abstractWidget ) {
21
+ return ( AbstractWidget ) addRenderableWidget (abstractWidget );
22
22
}
23
23
}
You can’t perform that action at this time.
0 commit comments