Skip to content

Commit

Permalink
Workaround Mixin generics. Fixes #3647
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Mar 19, 2022
1 parent 5c27896 commit f3f9023
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Interface.Remap;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -104,8 +103,9 @@
import java.util.Optional;
import java.util.UUID;

@SuppressWarnings("rawtypes")
@Mixin(MinecraftServer.class)
@Implements(value = @Interface(iface = Server.class, prefix = "server$", remap = Remap.NONE))
@Implements(value = @Interface(iface = Server.class, prefix = "server$", remap = Interface.Remap.NONE))
public abstract class MinecraftServerMixin_API extends ReentrantBlockableEventLoop<TickTask> implements SpongeServer, SpongeRegistryHolder {

// @formatter:off
Expand All @@ -130,6 +130,11 @@ public abstract class MinecraftServerMixin_API extends ReentrantBlockableEventLo
@Shadow public abstract boolean shadow$isNetherEnabled();
@Shadow public abstract Commands shadow$getCommands();
@Shadow public abstract PackRepository shadow$getPackRepository();
// We can't extend ReentrantBlockableEventLoop<TickTask> because of
// https://github.com/SpongePowered/Sponge/issues/3647
// which is related to https://github.com/SpongePowered/Mixin/issues/169
@Shadow(aliases = "func_212871_a_", remap = false) @Override public abstract void tell(TickTask runnable);
@Shadow(aliases = "func_212871_a_", remap = false) public abstract void shadow$tell(Runnable runnable);
// @formatter:on

private Iterable<? extends Audience> audiences;
Expand Down Expand Up @@ -163,6 +168,8 @@ public MinecraftServerMixin_API(final String name) {
this.api$userManager = new SpongeUserManager((MinecraftServer) (Object) this);
}



@Override
public RecipeManager recipeManager() {
return (RecipeManager) this.shadow$getRecipeManager();
Expand Down

0 comments on commit f3f9023

Please sign in to comment.