Compare commits
2 Commits
52a97dc2c1
...
1d0f7f0f05
Author | SHA1 | Date | |
---|---|---|---|
1d0f7f0f05 | |||
7d969d0013 |
@ -29,7 +29,6 @@ As a challenge I'm trying to make it as user-friendly as possible. (It ain't the
|
|||||||
- Vein miner
|
- Vein miner
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Commands
|
### Commands
|
||||||
- /spectator | Essentially server-side free-cam, you get put in spectator and are able to fly around, once you use the command again you get put back to where you were.
|
- /spectator | Essentially server-side free-cam, you get put in spectator and are able to fly around, once you use the command again you get put back to where you were.
|
||||||
- /slimechunk (/sc) | See if you're currently in a slimechunk
|
- /slimechunk (/sc) | See if you're currently in a slimechunk
|
||||||
@ -40,9 +39,11 @@ As a challenge I'm trying to make it as user-friendly as possible. (It ain't the
|
|||||||
- [x] Chat Calculator
|
- [x] Chat Calculator
|
||||||
|
|
||||||
## Client Side
|
## Client Side
|
||||||
|
- [x] Teleportation Angle Viewer for [this machine](https://www.youtube.com/watch?v=FnUE-ZaALLw)
|
||||||
- [x] Teleportation Angle Viewer
|
|
||||||

|

|
||||||
|
- [x] Removed game fog (lava, water, etc.)
|
||||||
|
- [ ] Made it toggleable
|
||||||
|
- [ ] Mod Menu integration
|
||||||
|
|
||||||
# Features to come
|
# Features to come
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package wtf.hak.survivalfabric;
|
package wtf.hak.survivalfabric;
|
||||||
|
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import wtf.hak.survivalfabric.teleportation.AngleViewHandler;
|
import wtf.hak.survivalfabric.features.AngleViewer;
|
||||||
|
|
||||||
public class SurvivalFabricClient implements ClientModInitializer {
|
public class SurvivalFabricClient implements ClientModInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
AngleViewHandler.registerKeybindings();
|
AngleViewer.register();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.hak.survivalfabric.teleportation;
|
package wtf.hak.survivalfabric.features;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||||
@ -11,12 +11,12 @@ import java.util.concurrent.Executors;
|
|||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class AngleViewHandler {
|
public class AngleViewer {
|
||||||
|
|
||||||
private static final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
private static final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||||
public static boolean PREVENT_HEAD_MOVEMENT = false;
|
public static boolean PREVENT_HEAD_MOVEMENT = false;
|
||||||
|
|
||||||
public static void registerKeybindings() {
|
public static void register() {
|
||||||
for(Angle angle : Angle.values()) {
|
for(Angle angle : Angle.values()) {
|
||||||
KeyBinding keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
KeyBinding keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
"key.survivalfabric." + angle.name().toLowerCase(),
|
"key.survivalfabric." + angle.name().toLowerCase(),
|
@ -0,0 +1,20 @@
|
|||||||
|
package wtf.hak.survivalfabric.mixin.client;
|
||||||
|
|
||||||
|
import net.minecraft.client.render.BackgroundRenderer;
|
||||||
|
import net.minecraft.client.render.Camera;
|
||||||
|
import net.minecraft.client.render.Fog;
|
||||||
|
import net.minecraft.client.render.FogShape;
|
||||||
|
import org.joml.Vector4f;
|
||||||
|
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.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(value = BackgroundRenderer.class, priority = 910)
|
||||||
|
public abstract class BackgroundRendererMixin {
|
||||||
|
|
||||||
|
@Inject(method = "applyFog", at = @At("RETURN"), cancellable = true)
|
||||||
|
private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType, Vector4f color, float viewDistance, boolean thickenFog, float tickProgress, CallbackInfoReturnable<Fog> cir) {
|
||||||
|
cir.setReturnValue(new Fog(-8.0f, 1_000_000.0F, FogShape.CYLINDER, 0,0,0,0));
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ 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 wtf.hak.survivalfabric.teleportation.AngleViewHandler;
|
import wtf.hak.survivalfabric.features.AngleViewer;
|
||||||
|
|
||||||
@Mixin(Entity.class)
|
@Mixin(Entity.class)
|
||||||
public abstract class EntityMixin {
|
public abstract class EntityMixin {
|
||||||
@ -14,7 +14,7 @@ public abstract class EntityMixin {
|
|||||||
@Inject(method = "setYaw", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "setYaw", at = @At("HEAD"), cancellable = true)
|
||||||
private void preventYawChange(float yaw, CallbackInfo ci) {
|
private void preventYawChange(float yaw, CallbackInfo ci) {
|
||||||
if((Object) this instanceof ClientPlayerEntity player) {
|
if((Object) this instanceof ClientPlayerEntity player) {
|
||||||
if(player.isMainPlayer() && AngleViewHandler.PREVENT_HEAD_MOVEMENT) {
|
if(player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ public abstract class EntityMixin {
|
|||||||
@Inject(method = "setPitch", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "setPitch", at = @At("HEAD"), cancellable = true)
|
||||||
private void preventPitchChange(float pitch, CallbackInfo ci) {
|
private void preventPitchChange(float pitch, CallbackInfo ci) {
|
||||||
if((Object) this instanceof ClientPlayerEntity player) {
|
if((Object) this instanceof ClientPlayerEntity player) {
|
||||||
if(player.isMainPlayer() && AngleViewHandler.PREVENT_HEAD_MOVEMENT) {
|
if(player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "wtf.hak.survivalfabric.mixin.client",
|
"package": "wtf.hak.survivalfabric.mixin.client",
|
||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"client": [
|
"client": [
|
||||||
"EntityMixin"
|
"BackgroundRendererMixin",
|
||||||
],
|
"EntityMixin"
|
||||||
"injectors": {
|
],
|
||||||
"defaultRequire": 1
|
"injectors": {
|
||||||
|
"defaultRequire": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user