added WIP 'custom_dimension' to the API
This commit is contained in:
1 parent
e2c8b9cc41
commit
598219608b
5 files changed
+152
No files matched your search
@@ -4,8 +4,11 @@ import carpet.CarpetServer;
|
||||
import carpet.fakes.MinecraftServerInterface;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.ServerTask;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.util.thread.ReentrantThreadExecutor;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.storage.LevelStorage;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -14,6 +17,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
import static carpet.script.CarpetEventServer.Event.ENDER_TICK;
|
||||
@@ -38,6 +42,8 @@ public abstract class MinecraftServer_scarpetMixin extends ReentrantThreadExecut
|
||||
|
||||
@Shadow @Final protected LevelStorage.Session session;
|
||||
|
||||
@Shadow @Final private Map<RegistryKey<World>, ServerWorld> worlds;
|
||||
|
||||
@Override
|
||||
public void forceTick(BooleanSupplier isAhead)
|
||||
{
|
||||
@@ -52,6 +58,12 @@ public abstract class MinecraftServer_scarpetMixin extends ReentrantThreadExecut
|
||||
return session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<RegistryKey<World>, ServerWorld> getCMWorlds()
|
||||
{
|
||||
return worlds;
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(
|
||||
value = "CONSTANT",
|
||||
args = "stringValue=tallying"
|
||||
|
||||
Reference in new issue
Block a user