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 1e989b2
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.ServerResources;
import net.minecraft.server.ServerScoreboard;
import net.minecraft.server.TickTask;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
import net.minecraft.server.packs.repository.PackRepository;
Expand Down Expand Up @@ -70,7 +69,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,9 +102,13 @@
import java.util.Optional;
import java.util.UUID;

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

// @formatter:off
@Shadow @Final public long[] tickTimes;
Expand Down Expand Up @@ -163,6 +165,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 1e989b2

Please sign in to comment.