Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
permissions: { contents: write }

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- uses: gradle/actions/setup-gradle@v6
- run: ./gradlew build

- uses: softprops/action-gh-release@v2
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Vasco

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
91 changes: 0 additions & 91 deletions build.gradle

This file was deleted.

100 changes: 100 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
plugins {
id("dev.architectury.loom-no-remap") version "1.14-SNAPSHOT" apply false
id("architectury-plugin") version "3.5-SNAPSHOT"
id("com.gradleup.shadow") version "9.4.1" apply false
}

architectury {
minecraft = property("minecraft_version") as String
}

allprojects {
group = property("maven_group") as String
version = property("mod_version") as String
}

subprojects {
apply(plugin = "dev.architectury.loom-no-remap")
apply(plugin = "architectury-plugin")
apply(plugin = "maven-publish")

configure<BasePluginExtension> {
archivesName = "${property("archives_name")}-${project.name}"
}

repositories {
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.

exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}

maven {
name = "Fuzs Mod Resources"
url = uri("https://raw.githubusercontent.com/Fuzss/modresources/main/maven/")
}
}

dependencies {
"minecraft"("net.minecraft:minecraft:${property("minecraft_version")}")
}

tasks.withType<JavaCompile>().configureEach {
options.release = 25
}

if (project.name != "common") {
apply(plugin = "com.gradleup.shadow")

val common by configurations.creating { isCanBeResolved = true; isCanBeConsumed = false }
val shadowBundle by configurations.creating { isCanBeResolved = true; isCanBeConsumed = false }

configurations {
getByName("compileClasspath").extendsFrom(common)
getByName("runtimeClasspath").extendsFrom(common)
}

tasks.named<Jar>("jar") {
archiveClassifier = "raw"
}

tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
from(zipTree(tasks.named<Jar>("jar").get().archiveFile))
configurations = listOf(shadowBundle)
archiveClassifier = ""

val mainOutput = project.the<SourceSetContainer>()["main"].output
exclude { element ->
mainOutput.classesDirs.any { element.file.startsWith(it) } ||
element.file.startsWith(mainOutput.resourcesDir!!)
}
}
}

// Configure Maven publishing.
// publishing {
// publications {
// mavenJava(MavenPublication) {
// artifactId = base.archivesName.get()
// from components . java
// }
// }
//
// // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
// repositories {
// // Add repositories to publish to here.
// // Notice: This block does NOT have the same function as the block in the top level.
// // The repositories here will be used for publishing your artifact, not for
// // retrieving dependencies.
// }
// }
}
16 changes: 0 additions & 16 deletions common/build.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
loom {
accessWidenerPath = file("src/main/resources/elevatormod.classtweaker")
}

architectury {
common((property("enabled_platforms") as String).split(','))
}

dependencies {
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
// which get remapped to the correct annotations on each platform.
// Do NOT use other classes from Fabric Loader.
implementation("net.fabricmc:fabric-loader:${property("fabric_loader_version")}")

api("fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:${property("forge_config_api_port_version")}")
}
6 changes: 3 additions & 3 deletions common/src/main/java/com/vsngarcia/ElevatorBlockBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ protected boolean propagatesSkylightDown(BlockState blockState) {
}

@Override
protected int getLightBlock(BlockState blockState) {
protected int getLightDampening(BlockState state) {
// TODO: Not dynamic
return super.getLightBlock(blockState);
return super.getLightDampening(state);
}

// @Override
// @Override
// public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
// return getHeldState(worldIn, pos)
// .map(s -> s.getLightBlock(worldIn, pos))
Expand Down
40 changes: 22 additions & 18 deletions common/src/main/java/com/vsngarcia/client/ColorCamoElevator.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
package com.vsngarcia.client;

import com.vsngarcia.ElevatorBlockBase;
import com.vsngarcia.level.ElevatorBlockEntityBase;
import net.minecraft.client.Minecraft;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.block.BlockTintSource;
import net.minecraft.client.renderer.block.BlockAndTintGetter;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.state.BlockState;

public class ColorCamoElevator implements BlockColor {
public class ColorCamoElevator implements BlockTintSource {

@Override
public int getColor(BlockState state, BlockAndTintGetter lightReader, BlockPos pos, int tintIndex) {
if (lightReader == null || pos == null) {
return -1;
public int color(BlockState state) {
return 0;
}

@Override
public int colorInWorld(BlockState state, BlockAndTintGetter level, BlockPos pos) {
if (!(level.getBlockEntity(pos) instanceof ElevatorBlockEntityBase tile)) {
return color(state);
}

if (state.getBlock() instanceof ElevatorBlockBase &&
lightReader.getBlockEntity(pos) instanceof ElevatorBlockEntityBase tile) {
if (tile.getHeldState() != null) {
return Minecraft.getInstance().getBlockColors().getColor(
tile.getHeldState(),
lightReader,
pos,
tintIndex
);
}
var heldState = tile.getHeldState();
if (heldState == null) {
return color(state);
}
return -1;

// TODO: Use just layer 0 for now
BlockTintSource tintSource = Minecraft.getInstance().getBlockColors().getTintSource(heldState, 0);
if (tintSource != null) {
return tintSource.colorInWorld(heldState, level, pos);
}

return color(state);
}
}
Loading