Skip to content

Commit

Permalink
1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
R0bbyYT committed Apr 28, 2024
1 parent c7d761c commit bfe75cc
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 7 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ labyMod {
"1.19.4",
"1.20.1",
"1.20.2",
"1.20.4"
"1.20.4",
"1.20.5"
) { version, provider ->
configureRun(provider, version)
}
Expand All @@ -41,7 +42,7 @@ labyMod {

addonDev {
//localRelease()
snapshotRelease()
productionRelease()
}
}

Expand All @@ -60,7 +61,7 @@ fun configureRun(provider: net.labymod.gradle.core.minecraft.provider.VersionPro

provider.javaVersion = when (gameVersion) {
else -> {
JavaVersion.VERSION_17
JavaVersion.VERSION_21
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (C) 2022 BurgerbudeORG & Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.burgerbude.labymod.addons.fullbright.v1_20_5.mixins;

import com.mojang.blaze3d.platform.NativeImage;
import net.labymod.api.Laby;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.texture.DynamicTexture;
import org.burgerbude.labymod.addons.fullbright.core.event.UpdateLightmapTextureEvent;
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(LightTexture.class)
public class MixinLightTexture {

@Shadow
@Final
private NativeImage lightPixels;

@Shadow
@Final
private DynamicTexture lightTexture;
@Shadow
private boolean updateLightTexture;
private boolean fullbright$updated = false;

@Inject(method = "updateLightTexture", at = @At("HEAD"), cancellable = true)
private void fullbright$updateLightTexture(float v, CallbackInfo ci) {
final var event = Laby.fireEvent(new UpdateLightmapTextureEvent());
if (event.isCancelled()) {
if (!this.fullbright$updated) {
this.fullbright$writeWhiteTexture();
}
this.fullbright$updated = true;
this.lightTexture.upload();
ci.cancel();
return;
}

// Is need for the singleplayer, if the user is in a screen,
// the tick method is not called and therefore the light level is not updated
if (this.fullbright$updated) {
this.updateLightTexture = true;
}

this.fullbright$updated = false;
}

private void fullbright$writeWhiteTexture() {
for (int x = 0; x < 16; x++) {
for (int y = 0; y < 16; y++) {
this.lightPixels.setPixelRGBA(x, y, 0xFFFFFFFF);
}
}
}

}
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.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 1 addition & 2 deletions laby-build-logic/src/main/kotlin/extensions.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gradle.kotlin.dsl.accessors._64acc05bf1a66f2c855e386526b4bcff.api
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.DependencyHandler
Expand All @@ -11,5 +10,5 @@ fun JavaPluginExtension.javaVersion(javaVersion: JavaVersion) {
}

fun DependencyHandler.apiProject(rootProject: Project, name: String, configuration: String? = null) {
api(project(":${rootProject.name}-$name", configuration))
add("api", project(":${rootProject.name}-$name", configuration))
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rootProject.name = "fullbright"
includeBuild("laby-build-logic")

pluginManagement {
val labyGradlePluginVersion = "0.3.25"
val labyGradlePluginVersion = "0.3.48"
plugins {
id("net.labymod.gradle") version (labyGradlePluginVersion)
}
Expand Down

0 comments on commit bfe75cc

Please sign in to comment.