Compare commits
8 Commits
0.1.0-alph
...
main
Author | SHA1 | Date | |
---|---|---|---|
4a339a6ee5 | |||
530f280842 | |||
8a8f1c48e1 | |||
1c3d4e25d2 | |||
174144c2cc | |||
d55d116a5e | |||
95fdf39671 | |||
|
2d47d8607e |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
||||
*
|
||||
!gifs
|
||||
!gifs/**
|
||||
!src
|
||||
!src/**
|
||||
!.gitignore
|
||||
|
52
README.md
Normal file
52
README.md
Normal 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).
|
||||
|
@ -96,5 +96,5 @@ publishing {
|
||||
}
|
||||
}
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/smooth-chunks.accesswidener")
|
||||
accessWidenerPath = file("src/main/resources/animated-chunks.accesswidener")
|
||||
}
|
||||
|
BIN
gifs/fall.gif
Normal file
BIN
gifs/fall.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 441 KiB |
BIN
gifs/fly-in.gif
Normal file
BIN
gifs/fly-in.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 370 KiB |
BIN
gifs/rise.gif
Normal file
BIN
gifs/rise.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 283 KiB |
BIN
gifs/scale.gif
Normal file
BIN
gifs/scale.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 272 KiB |
@ -10,7 +10,7 @@ loader_version=0.13.3
|
||||
# Mod Properties
|
||||
mod_version=0.2.0
|
||||
maven_group=me.topchetoeu
|
||||
archives_base_name=smooth-chunks
|
||||
archives_base_name=animated-chunks
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.47.8+1.18.2
|
||||
|
27
readme.md
27
readme.md
@ -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.
|
||||
|
@ -1,32 +1,32 @@
|
||||
package me.topchetoeu.smoothchunks;
|
||||
package me.topchetoeu.animatedchunks;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
|
||||
import me.topchetoeu.smoothchunks.Manager.RegisterEvent;
|
||||
import me.topchetoeu.smoothchunks.animation.Animation;
|
||||
import me.topchetoeu.smoothchunks.animation.FallAnimation;
|
||||
import me.topchetoeu.smoothchunks.animation.FlyInAnimation;
|
||||
import me.topchetoeu.smoothchunks.animation.ProgressManager;
|
||||
import me.topchetoeu.smoothchunks.animation.RiseAnimation;
|
||||
import me.topchetoeu.smoothchunks.animation.ScaleAnimation;
|
||||
import me.topchetoeu.smoothchunks.easing.Ease;
|
||||
import me.topchetoeu.smoothchunks.easing.ElasticEase;
|
||||
import me.topchetoeu.smoothchunks.easing.LinearEase;
|
||||
import me.topchetoeu.smoothchunks.easing.SineEase;
|
||||
import me.topchetoeu.smoothchunks.gui.SmoothChunksScreen;
|
||||
import me.topchetoeu.smoothchunks.easing.QuadraticEase;
|
||||
import me.topchetoeu.animatedchunks.Manager.RegisterEvent;
|
||||
import me.topchetoeu.animatedchunks.animation.Animation;
|
||||
import me.topchetoeu.animatedchunks.animation.FallAnimation;
|
||||
import me.topchetoeu.animatedchunks.animation.FlyInAnimation;
|
||||
import me.topchetoeu.animatedchunks.animation.ProgressManager;
|
||||
import me.topchetoeu.animatedchunks.animation.RiseAnimation;
|
||||
import me.topchetoeu.animatedchunks.animation.ScaleAnimation;
|
||||
import me.topchetoeu.animatedchunks.easing.Ease;
|
||||
import me.topchetoeu.animatedchunks.easing.ElasticEase;
|
||||
import me.topchetoeu.animatedchunks.easing.LinearEase;
|
||||
import me.topchetoeu.animatedchunks.easing.QuadraticEase;
|
||||
import me.topchetoeu.animatedchunks.easing.SineEase;
|
||||
import me.topchetoeu.animatedchunks.gui.AnimatedChunksScreen;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
|
||||
private static SmoothChunks instance;
|
||||
public static SmoothChunks getInstance() {
|
||||
public final class AnimatedChunks implements ClientModInitializer, ModMenuApi {
|
||||
private static AnimatedChunks instance;
|
||||
public static AnimatedChunks getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
|
||||
registerEases(ease);
|
||||
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);
|
||||
ANIMATIONS_REGISTERING.invoker().register(animation);
|
||||
@ -148,7 +148,7 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return (Screen parent) -> {
|
||||
var _this = getInstance();
|
||||
return new SmoothChunksScreen(parent, _this.animation, _this.ease, _this.config);
|
||||
return new AnimatedChunksScreen(parent, _this.animation, _this.ease, _this.config);
|
||||
};
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks;
|
||||
package me.topchetoeu.animatedchunks;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -8,8 +8,8 @@ import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
import me.topchetoeu.smoothchunks.animation.Animation;
|
||||
import me.topchetoeu.smoothchunks.easing.Ease;
|
||||
import me.topchetoeu.animatedchunks.animation.Animation;
|
||||
import me.topchetoeu.animatedchunks.easing.Ease;
|
||||
|
||||
public class ConfigManager {
|
||||
public final File configFile;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks;
|
||||
package me.topchetoeu.animatedchunks;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks;
|
||||
package me.topchetoeu.animatedchunks;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.Vec2f;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.animation;
|
||||
package me.topchetoeu.animatedchunks.animation;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.easing;
|
||||
package me.topchetoeu.animatedchunks.easing;
|
||||
|
||||
public interface Ease {
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.easing;
|
||||
package me.topchetoeu.animatedchunks.easing;
|
||||
|
||||
public class ElasticEase implements Ease {
|
||||
private float steepness = 1;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.easing;
|
||||
package me.topchetoeu.animatedchunks.easing;
|
||||
|
||||
public class LinearEase implements Ease {
|
||||
public float ease(float x) {
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.easing;
|
||||
package me.topchetoeu.animatedchunks.easing;
|
||||
|
||||
public class QuadraticEase implements Ease {
|
||||
@Override
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.easing;
|
||||
package me.topchetoeu.animatedchunks.easing;
|
||||
|
||||
public class SineEase implements Ease {
|
||||
@Override
|
@ -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.sound.PositionedSoundInstance;
|
||||
@ -8,14 +8,14 @@ import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.ColorHelper.Argb;
|
||||
import me.topchetoeu.smoothchunks.ConfigManager;
|
||||
import me.topchetoeu.smoothchunks.Manager;
|
||||
import me.topchetoeu.smoothchunks.animation.Animation;
|
||||
import me.topchetoeu.smoothchunks.easing.Ease;
|
||||
import me.topchetoeu.smoothchunks.gui.Section.OrderType;
|
||||
import me.topchetoeu.animatedchunks.ConfigManager;
|
||||
import me.topchetoeu.animatedchunks.Manager;
|
||||
import me.topchetoeu.animatedchunks.animation.Animation;
|
||||
import me.topchetoeu.animatedchunks.easing.Ease;
|
||||
import me.topchetoeu.animatedchunks.gui.Section.OrderType;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class SmoothChunksScreen extends Screen {
|
||||
public class AnimatedChunksScreen extends Screen {
|
||||
public final Screen parent;
|
||||
private final HorizontalSection mainSection = new HorizontalSection();
|
||||
private final Manager<Animation> animation;
|
||||
@ -105,8 +105,8 @@ public class SmoothChunksScreen extends Screen {
|
||||
res.children.addSelectableChild(selectionSection(ease, "Ease"));
|
||||
return res;
|
||||
}
|
||||
public SmoothChunksScreen(Screen parent, Manager<Animation> animation, Manager<Ease> ease, ConfigManager config) {
|
||||
super(Text.of("Smooth Chunks Config"));
|
||||
public AnimatedChunksScreen(Screen parent, Manager<Animation> animation, Manager<Ease> ease, ConfigManager config) {
|
||||
super(Text.of("Animated Chunks Config"));
|
||||
config.reload();
|
||||
this.animation = animation;
|
||||
this.ease = ease;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
public class Boundbox implements BoundboxProvider {
|
||||
public float x, y, width, height;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
public interface BoundboxProvider {
|
||||
float getX();
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.lwjgl.glfw.GLFW;
|
@ -1,11 +1,11 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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.gui.Drawable;
|
||||
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 > 1) progress = 1;
|
||||
if (progress < 0.999) {
|
||||
float _progress = SmoothChunks.getInstance().getEaseManager().getValue().ease(progress);
|
||||
SmoothChunks.getInstance().getAnimationManager().getValue().animate(
|
||||
float _progress = AnimatedChunks.getInstance().getEaseManager().getValue().ease(progress);
|
||||
AnimatedChunks.getInstance().getAnimationManager().getValue().animate(
|
||||
_progress, matrices,
|
||||
x * 16, 0, y * 16, 0, 0, 0
|
||||
);
|
||||
@ -187,7 +187,7 @@ public class ChunkPreview extends DrawableHelper implements Drawable, Element, S
|
||||
matrices.pop();
|
||||
}
|
||||
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 += delta * 0.05f;
|
||||
matrices.push();
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
@ -1,10 +1,10 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import me.topchetoeu.smoothchunks.Descriptor;
|
||||
import me.topchetoeu.smoothchunks.Manager;
|
||||
import me.topchetoeu.animatedchunks.Descriptor;
|
||||
import me.topchetoeu.animatedchunks.Manager;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.gui;
|
||||
package me.topchetoeu.animatedchunks.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
@ -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.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
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.util.math.BlockPos;
|
||||
|
||||
@ -17,6 +17,6 @@ abstract class BuiltChunkMixin {
|
||||
// ci.cancel();
|
||||
// return;
|
||||
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());
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package me.topchetoeu.smoothchunks.mixin;
|
||||
package me.topchetoeu.animatedchunks.mixin;
|
||||
|
||||
import net.minecraft.client.gl.GlUniform;
|
||||
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 it.unimi.dsi.fastutil.objects.ObjectListIterator;
|
||||
import me.topchetoeu.smoothchunks.SmoothChunks;
|
||||
import me.topchetoeu.smoothchunks.animation.ProgressManager;
|
||||
import me.topchetoeu.animatedchunks.AnimatedChunks;
|
||||
import me.topchetoeu.animatedchunks.animation.ProgressManager;
|
||||
|
||||
@Mixin(WorldRenderer.class)
|
||||
abstract class WorldRendererMixin {
|
||||
@ -31,7 +31,7 @@ abstract class WorldRendererMixin {
|
||||
@Accessor abstract BuiltChunkStorage getChunks();
|
||||
|
||||
private ProgressManager getProgressManager() {
|
||||
return SmoothChunks.getInstance().getProgressManager();
|
||||
return AnimatedChunks.getInstance().getProgressManager();
|
||||
}
|
||||
|
||||
@Inject(method = "render", at = @At(value = "HEAD"))
|
||||
@ -69,14 +69,14 @@ abstract class WorldRendererMixin {
|
||||
float progress = getProgressManager().getChunkProgress(x, 0, z);
|
||||
|
||||
if (progress < 0.999) {
|
||||
progress = SmoothChunks.getInstance().getEaseManager().getValue().ease(progress);
|
||||
progress = AnimatedChunks.getInstance().getEaseManager().getValue().ease(progress);
|
||||
|
||||
float centerX = (float)playerX - x;
|
||||
float centerY = (float)playerY - y;
|
||||
float centerZ = (float)playerZ - z;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "me.topchetoeu.smoothchunks.mixin",
|
||||
"package": "me.topchetoeu.animatedchunks.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [],
|
||||
"client": [
|
BIN
src/main/resources/assets/animated-chunks/icon.png
Normal file
BIN
src/main/resources/assets/animated-chunks/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
@ -1,24 +1,24 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "smooth-chunks",
|
||||
"id": "animated-chunks",
|
||||
"version": "0.2.0",
|
||||
"name": "Smooth Chunks",
|
||||
"description": "Smooth chunk load animations.",
|
||||
"name": "Animated Chunks",
|
||||
"description": "animated chunk load animations.",
|
||||
"authors": [ "TopchetoEU" ],
|
||||
"license": "MIT",
|
||||
"icon": "assets/smooth-chunks/icon.png",
|
||||
"icon": "assets/animated-chunks/icon.png",
|
||||
"environment": "client",
|
||||
"accessWidener": "smooth-chunks.accesswidener",
|
||||
"accessWidener": "animated-chunks.accesswidener",
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"me.topchetoeu.smoothchunks.SmoothChunks"
|
||||
"me.topchetoeu.animatedchunks.AnimatedChunks"
|
||||
],
|
||||
"modmenu": [
|
||||
"me.topchetoeu.smoothchunks.SmoothChunks"
|
||||
"me.topchetoeu.animatedchunks.AnimatedChunks"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"smooth-chunks.mixins.json"
|
||||
"animated-chunks.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.9.3+build.207",
|
||||
|
Loading…
Reference in New Issue
Block a user