tick freeze
This commit is contained in:
1 parent
3330e6f922
commit
109dd4d013
3 files changed
+131
-3
No files matched your search
@@ -1,13 +1,17 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.server.world.ServerChunkManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
import net.minecraft.world.level.LevelProperties;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
@@ -61,4 +65,16 @@ public abstract class ServerChunkManager_tickMixin
|
||||
CarpetProfiler.end_current_section(currentSection);
|
||||
}
|
||||
}
|
||||
|
||||
//// Tick freeze
|
||||
@Redirect(method = "tickChunks", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/LevelProperties;getGeneratorType()Lnet/minecraft/world/level/LevelGeneratorType;"
|
||||
))
|
||||
private LevelGeneratorType skipChunkTicking(LevelProperties levelProperties)
|
||||
{
|
||||
if (!TickSpeed.process_entities) return LevelGeneratorType.DEBUG_ALL_BLOCK_STATES;
|
||||
return levelProperties.getGeneratorType();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user