Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

[![Fabric Mod](https://img.shields.io/badge/modloader-fabric-informational)](https://fabricmc.net/use/) [![GitHub Release](https://img.shields.io/github/v/release/Giggitybyte/SleepWarp?include_prereleases)](https://github.com/Giggitybyte/SleepWarp/releases) [![Curseforge Download](https://cf.way2muchnoise.eu/full_579295_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/sleep-warp/files/all) [![Modrinth Download](https://img.shields.io/modrinth/dt/sleep-warp?label=modrinth&logo=modrinth)](https://modrinth.com/mod/sleep-warp/versions) [![Discord Server](https://img.shields.io/discord/385375030755983372.svg?label=discord)](https://discord.gg/UPKuVWgU4G)

**Instead of skipping directly to day when sleeping, time will speed up based on how many players are sleeping.**
Instead of skipping directly to day when sleeping, time will speed up based on how many players are sleeping.

<details>
<summary><b>Mod showcase</b></summary>

https://user-images.githubusercontent.com/19187704/153569152-1eb07fec-c93a-4e8f-b48b-46252ce628aa.mp4

**When enabled in the config file, block entities and chunks can also be ticked more often while sleeping to simulate the passage of time.**
Expand All @@ -13,3 +16,12 @@ https://user-images.githubusercontent.com/19187704/155882953-427244fa-9943-4088-
https://user-images.githubusercontent.com/19187704/155883315-6bbac83b-b429-4f41-88bf-401733e7c20e.mp4

https://user-images.githubusercontent.com/19187704/155883317-07af47a1-cb13-4895-a577-612c656077ab.mp4
</details>

> # Archived
> I've been very busy nowadays and I've lost interest in modding Minecraft in my spare time, so I've decided to archive this project.
>
> The `development` and `1.20.x` branches are unstable as a result of experimentation with multithreading ticks.
> All other branches (`1.19.x` and older) were a written lot simipler and are stable in single player but playing on multiplayer isn't the best experience.
>
> If you wish to fork this project or reference any code in this repository, feel free to do so. All I ask is that you respect the [license](https://github.com/Giggitybyte/SleepWarp/blob/development/LICENSE).
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.10.0'
id 'io.github.juuxel.loom-vineflower' version '1.11.0'
}

repositories {
maven { url = "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url = "https://maven.isxander.dev/releases" }
maven { url "https://maven.terraformersmc.com/releases/"}
}
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22

#Fabric api
fabric_version=0.83.0+1.20
fabric_version=0.88.1+1.20.1

mod_menu_version=7.0.1
yacl_version=3.0.1+1.20
mod_menu_version=7.2.2
yacl_version=3.1.1+1.20

mod_version=2.1.0
version_suffix=
mod_version=2.2.0
version_suffix=rc1
maven_group=me.thegiggitybyte
archives_base_name=sleepwarp

12 changes: 1 addition & 11 deletions src/main/java/me/thegiggitybyte/sleepwarp/SleepWarp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,14 @@
import me.thegiggitybyte.sleepwarp.config.JsonConfiguration;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.entity.event.v1.EntitySleepEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.util.ActionResult;

public class SleepWarp {
public static class Common implements ModInitializer {
@Override
public void onInitialize() {
JsonConfiguration.getUserInstance();
Commands.register();

ServerTickEvents.END_WORLD_TICK.register(WarpDrive::engage);
EntitySleepEvents.ALLOW_SLEEP_TIME.register((player, sleepingPos, vanillaResult) -> {
if (!vanillaResult && (player.getWorld().getTimeOfDay() % 24000 > 12542))
return ActionResult.SUCCESS;
else
return ActionResult.PASS;
});
WarpEngine.initialize();
}
}

Expand Down
Loading