Merge branch 'master' into future
This commit is contained in:
commit
cd1854a734
4 files changed
+26
-2
No files matched your search
@@ -13,5 +13,5 @@ public interface MinecraftServerInterface
|
|||||||
void forceTick(BooleanSupplier sup);
|
void forceTick(BooleanSupplier sup);
|
||||||
LevelStorageSource.LevelStorageAccess getCMSession();
|
LevelStorageSource.LevelStorageAccess getCMSession();
|
||||||
Map<ResourceKey<Level>, ServerLevel> getCMWorlds();
|
Map<ResourceKey<Level>, ServerLevel> getCMWorlds();
|
||||||
//ServerResources getResourceManager();
|
void reloadAfterReload();
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,16 @@ package carpet.mixins;
|
|||||||
import carpet.fakes.MinecraftServerInterface;
|
import carpet.fakes.MinecraftServerInterface;
|
||||||
import carpet.helpers.TickSpeed;
|
import carpet.helpers.TickSpeed;
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.server.ServerFunctionManager;
|
||||||
import net.minecraft.server.TickTask;
|
import net.minecraft.server.TickTask;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.server.players.PlayerList;
|
||||||
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -46,6 +50,16 @@ public abstract class MinecraftServer_scarpetMixin extends ReentrantBlockableEve
|
|||||||
|
|
||||||
//@Shadow private ServerResources resources;
|
//@Shadow private ServerResources resources;
|
||||||
|
|
||||||
|
@Shadow private MinecraftServer.ReloadableResources resources;
|
||||||
|
|
||||||
|
@Shadow public abstract RegistryAccess.Frozen registryAccess();
|
||||||
|
|
||||||
|
@Shadow public abstract PlayerList getPlayerList();
|
||||||
|
|
||||||
|
@Shadow @Final private ServerFunctionManager functionManager;
|
||||||
|
|
||||||
|
@Shadow @Final private StructureManager structureManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void forceTick(BooleanSupplier isAhead)
|
public void forceTick(BooleanSupplier isAhead)
|
||||||
{
|
{
|
||||||
@@ -84,5 +98,13 @@ public abstract class MinecraftServer_scarpetMixin extends ReentrantBlockableEve
|
|||||||
ENDER_TICK.onTick();
|
ENDER_TICK.onTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reloadAfterReload()
|
||||||
|
{
|
||||||
|
resources.managers().updateRegistryTags(registryAccess());
|
||||||
|
getPlayerList().saveAll();
|
||||||
|
getPlayerList().reloadResources();
|
||||||
|
functionManager.replaceLibrary(this.resources.managers().getFunctionLibrary());
|
||||||
|
structureManager.onResourceManagerReload(this.resources.resourceManager());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1144,6 +1144,7 @@ public class Auxiliary {
|
|||||||
addeds.add(ValueConversions.of(registryKey.location()));
|
addeds.add(ValueConversions.of(registryKey.location()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
((MinecraftServerInterface)server).reloadAfterReload();
|
||||||
return ListValue.wrap(addeds);
|
return ListValue.wrap(addeds);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ accessible class net/minecraft/server/level/ChunkMap$DistanceManager
|
|||||||
accessible class net/minecraft/server/level/ThreadedLevelLightEngine$TaskType
|
accessible class net/minecraft/server/level/ThreadedLevelLightEngine$TaskType
|
||||||
accessible class net/minecraft/world/item/crafting/Ingredient$Value
|
accessible class net/minecraft/world/item/crafting/Ingredient$Value
|
||||||
accessible class net/minecraft/world/level/lighting/BlockLightSectionStorage$BlockDataLayerStorageMap
|
accessible class net/minecraft/world/level/lighting/BlockLightSectionStorage$BlockDataLayerStorageMap
|
||||||
|
accessible class net/minecraft/server/MinecraftServer$ReloadableResources
|
||||||
Reference in new issue
Block a user