mirror of
https://github.com/JonasunderscoreJones/nicer-skies.git
synced 2025-10-23 11:49:17 +02:00
remove: remove debug features
This commit is contained in:
parent
8af53aa1ff
commit
caded74ec3
3 changed files with 0 additions and 72 deletions
|
@ -1,12 +0,0 @@
|
||||||
package codes.ztereohype.nicerskies.mixin.debug;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.NativeImage;
|
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(LightTexture.class)
|
|
||||||
public interface LightTextureInvoker {
|
|
||||||
@Accessor
|
|
||||||
NativeImage getLightPixels();
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package codes.ztereohype.nicerskies.mixin.debug;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.NativeImage;
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiComponent;
|
|
||||||
import net.minecraft.client.gui.components.DebugScreenOverlay;
|
|
||||||
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.callback.CallbackInfo;
|
|
||||||
|
|
||||||
@Mixin(DebugScreenOverlay.class)
|
|
||||||
public abstract class MixinDebug {
|
|
||||||
@Final @Shadow private Minecraft minecraft;
|
|
||||||
|
|
||||||
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;)V", at = @At("HEAD"))
|
|
||||||
private void injectRender(PoseStack poseStack, CallbackInfo ci) {
|
|
||||||
int pixelSize = 6;
|
|
||||||
|
|
||||||
NativeImage lightPixels = ((LightTextureInvoker) minecraft.gameRenderer.lightTexture()).getLightPixels();
|
|
||||||
for (int x = 0; x < lightPixels.getWidth(); x++) {
|
|
||||||
for (int y = 0; y < lightPixels.getHeight(); y++) {
|
|
||||||
int colour = lightPixels.getPixelRGBA(x, y);
|
|
||||||
|
|
||||||
int b = colour & 0xFF;
|
|
||||||
int g = colour >> 8 & 0xFF;
|
|
||||||
int r = colour >> 16 & 0xFF;
|
|
||||||
|
|
||||||
int xCoord = minecraft.getWindow().getGuiScaledWidth() - (x * pixelSize);
|
|
||||||
int yCoord = minecraft.getWindow().getGuiScaledHeight() - (y * pixelSize);
|
|
||||||
|
|
||||||
GuiComponent.fill(poseStack, xCoord, yCoord, xCoord + pixelSize, yCoord + pixelSize, 0xFF000000 | b << 16 | g << 8 | r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package codes.ztereohype.nicerskies.mixin.debug;
|
|
||||||
|
|
||||||
import codes.ztereohype.nicerskies.NicerSkies;
|
|
||||||
import codes.ztereohype.nicerskies.core.NebulaSeedManager;
|
|
||||||
import net.minecraft.client.KeyboardHandler;
|
|
||||||
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;
|
|
||||||
|
|
||||||
@Mixin(KeyboardHandler.class)
|
|
||||||
public class MixinKeyboardHandler {
|
|
||||||
@Inject(at = @At("HEAD"), method = "keyPress")
|
|
||||||
private void printKey(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo ci) {
|
|
||||||
// \ key, keydown action
|
|
||||||
if (key == 92 && action == 1) {
|
|
||||||
NicerSkies.skyManager.generateSky(NebulaSeedManager.getSeed());
|
|
||||||
// NicerSkies.toggle = !NicerSkies.toggle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue