Compare commits

...

8 Commits

Author SHA1 Message Date
4a339a6ee5
Merge pull request #7 from TopchetoEU/TopchetoEU/Rename
Resolves #5
2022-09-21 19:35:17 +03:00
530f280842
chore: Replace smooth chunks with animated chunks 2022-09-21 19:32:17 +03:00
8a8f1c48e1
chore: Reduce GIF width in README 2022-09-21 10:58:06 +03:00
1c3d4e25d2
fix: Tweak GIFs timing 2022-09-21 10:57:37 +03:00
174144c2cc
chore: Reduce size of GIFs 2022-09-21 10:54:25 +03:00
d55d116a5e
feat: Add example GIFs to README 2022-09-21 10:50:21 +03:00
95fdf39671
Merge pull request #1 from RaptaG/new-readme
Improve the README, compress the icon
2022-09-21 10:36:45 +03:00
RaptaG
2d47d8607e
Improve the README, compress the icon 2022-09-13 16:20:47 +03:00
41 changed files with 133 additions and 106 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
* *
!gifs
!gifs/**
!src !src
!src/** !src/**
!.gitignore !.gitignore

52
README.md Normal file
View File

@ -0,0 +1,52 @@
<div align="center">
<img src="src/main/resources/assets/smooth-chunks/icon.png" width="100">
# Smooth Chunks
[![Mod Loader](https://img.shields.io/badge/Mod%20Loader-Fabric-lightyellow?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE4LTEyLTE2VDE2OjU0OjE3LTA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAxOS0wNy0yOFQyMToxNzo0OC0wNzowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0wNy0yOFQyMToxNzo0OC0wNzowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowZWRiMWMyYy1mZjhjLWU0NDEtOTMxZi00OTVkNGYxNGM3NjAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowZWRiMWMyYy1mZjhjLWU0NDEtOTMxZi00OTVkNGYxNGM3NjAiIHN0RXZ0OndoZW49IjIwMTgtMTItMTZUMTY6NTQ6MTctMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE4IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4/HiGMAAAAtUlEQVRYw+XXrQqAMBQF4D2P2eBL+QIG8RnEJFaNBjEum+0+zMQLtwwv+wV3ZzhhMDgfJ0wUSinxZUQWgKos1JP/AbD4OneIDyQPwCFniA+EJ4CaXm4TxAXCC0BNHgLhAdAnx9hC8PwGSRtAFVMQjF7cNTWED8B1cgwW20yfJgAvrssAsZ1cB3g/xckAxr6FmCDU5N6f488BrpCQ4rQBJkiMYh4ACmLzwOQF0CExinkCsvw7vgGikl+OotaKRwAAAABJRU5ErkJggg==)](https://fabricmc.net)
![Enviroment](https://img.shields.io/badge/Enviroment-Client-purple)
An enhanecd fork of [cadenkriese's mod](https://github.com/cadenkriese/smooth-chunks) for the latest versions of the game, with a completely different code base.
</div>
## What is this?
Smooth Chunks is a Fabric mod that adds animations of currently loading chunks. This makes chunk loading generally seem much more pleasant than them appearing out of thin air. There are multiple built-in animations and ease types, and if this isnt't enough, there's an API which will allow you to add your own animations and eases (with ease :trollface:)
Generally, this is what you'd call an "eye-candy" mod.
### Currently supported animations:
- Rise
<img src="gifs/rise.gif" width="300">
- Fall
<img src="gifs/fall.gif" width="300">
- Scale
<img src="gifs/scale.gif" width="300">
- Fly in
<img src="gifs/fly-in.gif" width="300">
### Currently supported interpolation types:
- Linear
- Sine
- Quadratic
- Elastic
## Future plans
In the future, I plan to extend the scope of this mod to not only smoothen the chunk loading, but entity spawning/despawning/dying, liquid flowing, crops growing etc.
## License
This mod is under the [MIT License](LICENSE).

View File

@ -96,5 +96,5 @@ publishing {
} }
} }
loom { loom {
accessWidenerPath = file("src/main/resources/smooth-chunks.accesswidener") accessWidenerPath = file("src/main/resources/animated-chunks.accesswidener")
} }

BIN
gifs/fall.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

BIN
gifs/fly-in.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

BIN
gifs/rise.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

BIN
gifs/scale.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

View File

@ -10,7 +10,7 @@ loader_version=0.13.3
# Mod Properties # Mod Properties
mod_version=0.2.0 mod_version=0.2.0
maven_group=me.topchetoeu maven_group=me.topchetoeu
archives_base_name=smooth-chunks archives_base_name=animated-chunks
# Dependencies # Dependencies
fabric_version=0.47.8+1.18.2 fabric_version=0.47.8+1.18.2

View File

@ -1,27 +0,0 @@
# Smooth chunks
This is a fork of [flogic](https://github.com/cadenkriese/smooth-chunks)'s mod (although code bases have nothing in common)
## What is this?
This is a mod that adds animations of currently loading chunks. This makes chunk loading generally seem much more pleasant than them appearing out of thin air. There are multiple built-in animations and ease types, and if this isnt't enough, there's an API which will allow you to add your own animations and eases (with ease)
Generally, this is what you'd call an "eye-candy" mod.
## Currently supported animations:
- Rise
- Fall
- Scale
## Currently supported interpolation types:
- Linear
- Sine
- Quadratic
- Elastic
## Future plans:
In the future, I plan to extend the scope of this mod to not only smoothen the chunk loading, but entity spawning / despawning / dying, liquid flowing, crops growing, etc.

View File

@ -1,32 +1,32 @@
package me.topchetoeu.smoothchunks; package me.topchetoeu.animatedchunks;
import java.io.File; import java.io.File;
import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi; import com.terraformersmc.modmenu.api.ModMenuApi;
import me.topchetoeu.smoothchunks.Manager.RegisterEvent; import me.topchetoeu.animatedchunks.Manager.RegisterEvent;
import me.topchetoeu.smoothchunks.animation.Animation; import me.topchetoeu.animatedchunks.animation.Animation;
import me.topchetoeu.smoothchunks.animation.FallAnimation; import me.topchetoeu.animatedchunks.animation.FallAnimation;
import me.topchetoeu.smoothchunks.animation.FlyInAnimation; import me.topchetoeu.animatedchunks.animation.FlyInAnimation;
import me.topchetoeu.smoothchunks.animation.ProgressManager; import me.topchetoeu.animatedchunks.animation.ProgressManager;
import me.topchetoeu.smoothchunks.animation.RiseAnimation; import me.topchetoeu.animatedchunks.animation.RiseAnimation;
import me.topchetoeu.smoothchunks.animation.ScaleAnimation; import me.topchetoeu.animatedchunks.animation.ScaleAnimation;
import me.topchetoeu.smoothchunks.easing.Ease; import me.topchetoeu.animatedchunks.easing.Ease;
import me.topchetoeu.smoothchunks.easing.ElasticEase; import me.topchetoeu.animatedchunks.easing.ElasticEase;
import me.topchetoeu.smoothchunks.easing.LinearEase; import me.topchetoeu.animatedchunks.easing.LinearEase;
import me.topchetoeu.smoothchunks.easing.SineEase; import me.topchetoeu.animatedchunks.easing.QuadraticEase;
import me.topchetoeu.smoothchunks.gui.SmoothChunksScreen; import me.topchetoeu.animatedchunks.easing.SineEase;
import me.topchetoeu.smoothchunks.easing.QuadraticEase; import me.topchetoeu.animatedchunks.gui.AnimatedChunksScreen;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.Event;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
public final class SmoothChunks implements ClientModInitializer, ModMenuApi { public final class AnimatedChunks implements ClientModInitializer, ModMenuApi {
private static SmoothChunks instance; private static AnimatedChunks instance;
public static SmoothChunks getInstance() { public static AnimatedChunks getInstance() {
return instance; return instance;
} }
@ -134,7 +134,7 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
registerEases(ease); registerEases(ease);
registerAnimations(animation); registerAnimations(animation);
config = new ConfigManager(new File("config/smooth-chunks.dat"), animation, ease); config = new ConfigManager(new File("config/animated-chunks.dat"), animation, ease);
EASES_REGISTERING.invoker().register(ease); EASES_REGISTERING.invoker().register(ease);
ANIMATIONS_REGISTERING.invoker().register(animation); ANIMATIONS_REGISTERING.invoker().register(animation);
@ -148,7 +148,7 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
public ConfigScreenFactory<?> getModConfigScreenFactory() { public ConfigScreenFactory<?> getModConfigScreenFactory() {
return (Screen parent) -> { return (Screen parent) -> {
var _this = getInstance(); var _this = getInstance();
return new SmoothChunksScreen(parent, _this.animation, _this.ease, _this.config); return new AnimatedChunksScreen(parent, _this.animation, _this.ease, _this.config);
}; };
} }
} }

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks; package me.topchetoeu.animatedchunks;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -8,8 +8,8 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import me.topchetoeu.smoothchunks.animation.Animation; import me.topchetoeu.animatedchunks.animation.Animation;
import me.topchetoeu.smoothchunks.easing.Ease; import me.topchetoeu.animatedchunks.easing.Ease;
public class ConfigManager { public class ConfigManager {
public final File configFile; public final File configFile;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks; package me.topchetoeu.animatedchunks;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks; package me.topchetoeu.animatedchunks;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec2f;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.animation; package me.topchetoeu.animatedchunks.animation;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.easing; package me.topchetoeu.animatedchunks.easing;
public interface Ease { public interface Ease {
/** /**

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.easing; package me.topchetoeu.animatedchunks.easing;
public class ElasticEase implements Ease { public class ElasticEase implements Ease {
private float steepness = 1; private float steepness = 1;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.easing; package me.topchetoeu.animatedchunks.easing;
public class LinearEase implements Ease { public class LinearEase implements Ease {
public float ease(float x) { public float ease(float x) {

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.easing; package me.topchetoeu.animatedchunks.easing;
public class QuadraticEase implements Ease { public class QuadraticEase implements Ease {
@Override @Override

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.easing; package me.topchetoeu.animatedchunks.easing;
public class SineEase implements Ease { public class SineEase implements Ease {
@Override @Override

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.sound.PositionedSoundInstance;
@ -8,14 +8,14 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import net.minecraft.util.math.ColorHelper.Argb; import net.minecraft.util.math.ColorHelper.Argb;
import me.topchetoeu.smoothchunks.ConfigManager; import me.topchetoeu.animatedchunks.ConfigManager;
import me.topchetoeu.smoothchunks.Manager; import me.topchetoeu.animatedchunks.Manager;
import me.topchetoeu.smoothchunks.animation.Animation; import me.topchetoeu.animatedchunks.animation.Animation;
import me.topchetoeu.smoothchunks.easing.Ease; import me.topchetoeu.animatedchunks.easing.Ease;
import me.topchetoeu.smoothchunks.gui.Section.OrderType; import me.topchetoeu.animatedchunks.gui.Section.OrderType;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
public class SmoothChunksScreen extends Screen { public class AnimatedChunksScreen extends Screen {
public final Screen parent; public final Screen parent;
private final HorizontalSection mainSection = new HorizontalSection(); private final HorizontalSection mainSection = new HorizontalSection();
private final Manager<Animation> animation; private final Manager<Animation> animation;
@ -105,8 +105,8 @@ public class SmoothChunksScreen extends Screen {
res.children.addSelectableChild(selectionSection(ease, "Ease")); res.children.addSelectableChild(selectionSection(ease, "Ease"));
return res; return res;
} }
public SmoothChunksScreen(Screen parent, Manager<Animation> animation, Manager<Ease> ease, ConfigManager config) { public AnimatedChunksScreen(Screen parent, Manager<Animation> animation, Manager<Ease> ease, ConfigManager config) {
super(Text.of("Smooth Chunks Config")); super(Text.of("Animated Chunks Config"));
config.reload(); config.reload();
this.animation = animation; this.animation = animation;
this.ease = ease; this.ease = ease;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
public class Boundbox implements BoundboxProvider { public class Boundbox implements BoundboxProvider {
public float x, y, width, height; public float x, y, width, height;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
public interface BoundboxProvider { public interface BoundboxProvider {
float getX(); float getX();

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;

View File

@ -1,11 +1,11 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import me.topchetoeu.smoothchunks.SmoothChunks; import me.topchetoeu.animatedchunks.AnimatedChunks;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Drawable; import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.DrawableHelper; import net.minecraft.client.gui.DrawableHelper;
@ -170,8 +170,8 @@ public class ChunkPreview extends DrawableHelper implements Drawable, Element, S
if (progress < 0) progress = 0; if (progress < 0) progress = 0;
if (progress > 1) progress = 1; if (progress > 1) progress = 1;
if (progress < 0.999) { if (progress < 0.999) {
float _progress = SmoothChunks.getInstance().getEaseManager().getValue().ease(progress); float _progress = AnimatedChunks.getInstance().getEaseManager().getValue().ease(progress);
SmoothChunks.getInstance().getAnimationManager().getValue().animate( AnimatedChunks.getInstance().getAnimationManager().getValue().animate(
_progress, matrices, _progress, matrices,
x * 16, 0, y * 16, 0, 0, 0 x * 16, 0, y * 16, 0, 0, 0
); );
@ -187,7 +187,7 @@ public class ChunkPreview extends DrawableHelper implements Drawable, Element, S
matrices.pop(); matrices.pop();
} }
private void renderChunks(MatrixStack matrices, float delta, int n) { private void renderChunks(MatrixStack matrices, float delta, int n) {
duration = SmoothChunks.getInstance().getProgressManager().getDuration(); duration = AnimatedChunks.getInstance().getProgressManager().getDuration();
// globalProgress += (lastTime - (lastTime = System.nanoTime())) / -1000000000f; // globalProgress += (lastTime - (lastTime = System.nanoTime())) / -1000000000f;
globalProgress += delta * 0.05f; globalProgress += delta * 0.05f;
matrices.push(); matrices.push();

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Hashtable; import java.util.Hashtable;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;

View File

@ -1,10 +1,10 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import me.topchetoeu.smoothchunks.Descriptor; import me.topchetoeu.animatedchunks.Descriptor;
import me.topchetoeu.smoothchunks.Manager; import me.topchetoeu.animatedchunks.Manager;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer; import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.gui; package me.topchetoeu.animatedchunks.gui;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Hashtable; import java.util.Hashtable;

View File

@ -1,11 +1,11 @@
package me.topchetoeu.smoothchunks.mixin; package me.topchetoeu.animatedchunks.mixin;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import me.topchetoeu.smoothchunks.SmoothChunks; import me.topchetoeu.animatedchunks.AnimatedChunks;
import net.minecraft.client.render.chunk.ChunkBuilder; import net.minecraft.client.render.chunk.ChunkBuilder;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -17,6 +17,6 @@ abstract class BuiltChunkMixin {
// ci.cancel(); // ci.cancel();
// return; // return;
BlockPos origin = ((ChunkBuilder.BuiltChunk)(Object)this).getOrigin(); BlockPos origin = ((ChunkBuilder.BuiltChunk)(Object)this).getOrigin();
SmoothChunks.getInstance().getProgressManager().unload(origin.getX(), 0, origin.getZ()); AnimatedChunks.getInstance().getProgressManager().unload(origin.getX(), 0, origin.getZ());
} }
} }

View File

@ -1,4 +1,4 @@
package me.topchetoeu.smoothchunks.mixin; package me.topchetoeu.animatedchunks.mixin;
import net.minecraft.client.gl.GlUniform; import net.minecraft.client.gl.GlUniform;
import net.minecraft.client.render.BuiltChunkStorage; import net.minecraft.client.render.BuiltChunkStorage;
@ -21,8 +21,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import it.unimi.dsi.fastutil.objects.ObjectListIterator; import it.unimi.dsi.fastutil.objects.ObjectListIterator;
import me.topchetoeu.smoothchunks.SmoothChunks; import me.topchetoeu.animatedchunks.AnimatedChunks;
import me.topchetoeu.smoothchunks.animation.ProgressManager; import me.topchetoeu.animatedchunks.animation.ProgressManager;
@Mixin(WorldRenderer.class) @Mixin(WorldRenderer.class)
abstract class WorldRendererMixin { abstract class WorldRendererMixin {
@ -31,7 +31,7 @@ abstract class WorldRendererMixin {
@Accessor abstract BuiltChunkStorage getChunks(); @Accessor abstract BuiltChunkStorage getChunks();
private ProgressManager getProgressManager() { private ProgressManager getProgressManager() {
return SmoothChunks.getInstance().getProgressManager(); return AnimatedChunks.getInstance().getProgressManager();
} }
@Inject(method = "render", at = @At(value = "HEAD")) @Inject(method = "render", at = @At(value = "HEAD"))
@ -69,14 +69,14 @@ abstract class WorldRendererMixin {
float progress = getProgressManager().getChunkProgress(x, 0, z); float progress = getProgressManager().getChunkProgress(x, 0, z);
if (progress < 0.999) { if (progress < 0.999) {
progress = SmoothChunks.getInstance().getEaseManager().getValue().ease(progress); progress = AnimatedChunks.getInstance().getEaseManager().getValue().ease(progress);
float centerX = (float)playerX - x; float centerX = (float)playerX - x;
float centerY = (float)playerY - y; float centerY = (float)playerY - y;
float centerZ = (float)playerZ - z; float centerZ = (float)playerZ - z;
matrices.translate(-centerX, -centerY, -centerZ); matrices.translate(-centerX, -centerY, -centerZ);
SmoothChunks.getInstance().getAnimationManager().getValue().animate(progress, matrices, x, y, z, (float)playerX, (float)playerY, (float)playerZ); AnimatedChunks.getInstance().getAnimationManager().getValue().animate(progress, matrices, x, y, z, (float)playerX, (float)playerY, (float)playerZ);
matrices.translate(centerX, centerY, centerZ); matrices.translate(centerX, centerY, centerZ);
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "me.topchetoeu.smoothchunks.mixin", "package": "me.topchetoeu.animatedchunks.mixin",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [], "mixins": [],
"client": [ "client": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,24 +1,24 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "smooth-chunks", "id": "animated-chunks",
"version": "0.2.0", "version": "0.2.0",
"name": "Smooth Chunks", "name": "Animated Chunks",
"description": "Smooth chunk load animations.", "description": "animated chunk load animations.",
"authors": [ "TopchetoEU" ], "authors": [ "TopchetoEU" ],
"license": "MIT", "license": "MIT",
"icon": "assets/smooth-chunks/icon.png", "icon": "assets/animated-chunks/icon.png",
"environment": "client", "environment": "client",
"accessWidener": "smooth-chunks.accesswidener", "accessWidener": "animated-chunks.accesswidener",
"entrypoints": { "entrypoints": {
"client": [ "client": [
"me.topchetoeu.smoothchunks.SmoothChunks" "me.topchetoeu.animatedchunks.AnimatedChunks"
], ],
"modmenu": [ "modmenu": [
"me.topchetoeu.smoothchunks.SmoothChunks" "me.topchetoeu.animatedchunks.AnimatedChunks"
] ]
}, },
"mixins": [ "mixins": [
"smooth-chunks.mixins.json" "animated-chunks.mixins.json"
], ],
"depends": { "depends": {
"fabricloader": ">=0.9.3+build.207", "fabricloader": ">=0.9.3+build.207",