Skip to content

Commit

Permalink
1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Jun 8, 2023
1 parent 0c1711d commit 4a8c44d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'idea'
id 'eclipse'

id 'fabric-loom' version '0.13-SNAPSHOT'
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'maven-publish'

id 'com.modrinth.minotaur' version '2.+'
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ github_repository = andantet/noclip-fabric
modrinth_id = yDx6WroB
curseforge_id = 653377

major_version = 1.19.4
github_branch = 1.19.4
supported_versions = 1.19.4
major_version = 1.20
github_branch = 1.20
supported_versions = 1.20

# Versions
ver_minecraft = 1.19.4
ver_loader = 0.14.17
ver_minecraft = 1.20
ver_loader = 0.14.21
ver_yarn = 1

ver_fabric = 0.75.3+1.19.4
ver_cloth_config = 10.0.95
ver_mod_menu = 6.1.0-rc.1
ver_fabric = 0.83.0+1.20
ver_cloth_config = 11.0.99
ver_mod_menu = 7.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.Window;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.util.Identifier;
Expand All @@ -27,7 +26,7 @@
* <p>The current instance used by the client can be obtained by {@link NoClipClientImpl#NOCLIP_HUD_RENDERER}.</p>
*/
@Environment(EnvType.CLIENT)
public class NoClipHudRenderer extends DrawableHelper implements HudRenderCallback {
public class NoClipHudRenderer implements HudRenderCallback {
public static final Identifier TEXTURE = new Identifier(NoClip.MOD_ID, "textures/gui/noclip.png");

private long fade = -1;
Expand All @@ -36,7 +35,7 @@ public class NoClipHudRenderer extends DrawableHelper implements HudRenderCallba
public NoClipHudRenderer() {}

@Override
public void onHudRender(MatrixStack matrices, float tickDelta) {
public void onHudRender(DrawContext context, float tickDelta) {
if (!NoClipManager.INSTANCE.isClipping() || !NoClipClient.getConfig().display.hudIcon) {
this.fade = -1;
return;
Expand All @@ -55,7 +54,6 @@ public void onHudRender(MatrixStack matrices, float tickDelta) {
.anyMatch(Predicate.not(StatusEffect::isBeneficial));

// render
RenderSystem.setShaderTexture(0, TEXTURE);
RenderSystem.enableBlend();

long ms = Util.getMeasuringTimeMs();
Expand All @@ -65,15 +63,15 @@ public void onHudRender(MatrixStack matrices, float tickDelta) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, clamp(alpha, 0.0F, 1.0F));

if (client.options.debugEnabled) {
this.renderIcon(matrices, scaledWidth - 18 - (client.textRenderer.getWidth(this.activeDebugLine) + 4), client.textRenderer.fontHeight + 1);
} else this.renderIcon(matrices, scaledWidth - 18 - 2, (2 + (hasStatusEffect ? 25 + (hasNonBeneficialEffect ? 25 + 1 : 0) : 0)));
this.renderIcon(context, scaledWidth - 18 - (client.textRenderer.getWidth(this.activeDebugLine) + 4), client.textRenderer.fontHeight + 1);
} else this.renderIcon(context, scaledWidth - 18 - 2, (2 + (hasStatusEffect ? 25 + (hasNonBeneficialEffect ? 25 + 1 : 0) : 0)));

RenderSystem.disableBlend();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
}

public void renderIcon(MatrixStack matrices, int x, int y) {
drawTexture(matrices, x, y, 0, 0, 18, 18, 18, 18);
public void renderIcon(DrawContext context, int x, int y) {
context.drawTexture(TEXTURE, x, y, 0, 0, 18, 18, 18, 18);
}

public void setActiveDebugLine(String activeDebugLine) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ private void onInit(World world, BlockPos pos, float yaw, GameProfile profile, C
private void onTickAfterNoClip(CallbackInfo ci) {
if (this.isClipping()) {
this.noClip = true;
this.onGround = false;
this.fallDistance = 0;
this.setOnGround(false);
}
}

Expand Down

0 comments on commit 4a8c44d

Please sign in to comment.