Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 authored Dec 4, 2023
2 parents 46c76bb + 842228d commit c07e283
Show file tree
Hide file tree
Showing 21 changed files with 300 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

ko_fi: wurst
custom: https://www.wurstclient.net/donate/
43 changes: 43 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle

on:
push:
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
pull_request:
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'microsoft'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build
- name: VirusTotal scan
if: github.event_name == 'push'
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
files: |
./build/libs/*.jar
continue-on-error: true
20 changes: 20 additions & 0 deletions .github/workflows/jsonsyntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: JSON syntax

on:
push:
paths:
- '**.json'
pull_request:
paths:
- '**.json'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

Adds glass stairs and glass slabs to Minecraft.

![https://www.curseforge.com/minecraft/mc-mods/fabric-api](https://user-images.githubusercontent.com/10100202/93722968-0aec9180-fb9b-11ea-9983-bc0fc51b47ab.png)
![Requires Fabric API](https://user-images.githubusercontent.com/10100202/93722968-0aec9180-fb9b-11ea-9983-bc0fc51b47ab.png)

## Downloads
## Downloads (for users)

https://www.curseforge.com/minecraft/mc-mods/mo-glass
[![Download Mo Glass](https://user-images.githubusercontent.com/10100202/214880552-859aa2ed-b4bc-4f8d-9ee7-bdd8c7fb33a2.png)](https://www.wurstimperium.net/mo-glass/download/?utm_source=GitHub&utm_medium=Mo+Glass&utm_campaign=README.md&utm_content=Download+Mo+Glass)

## Setup For Developers (using Windows 10 and Eclipse)
## Setup (for developers)

Requirements: [JDK 17](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot)
(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 17](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot) already installed.)

1. Clone / download the repository.

Expand Down
56 changes: 44 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
buildscript {
dependencies {
classpath 'org.kohsuke:github-api:1.135'
}
}

plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}
Expand Down Expand Up @@ -33,7 +39,7 @@ dependencies {

processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
Expand Down Expand Up @@ -66,7 +72,7 @@ publishing {
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.
Expand All @@ -86,7 +92,7 @@ curseforge {
changelogType = "html"
changelog = file("changelog.txt")
releaseType = "release"
addGameVersion "1.19.2"
addGameVersion "1.20.2"
addGameVersion "Fabric"

mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
Expand All @@ -105,12 +111,38 @@ curseforge {
}

afterEvaluate {
tasks.curseforge353426.dependsOn remapJar

tasks.named("curseforge353426") {
doFirst {
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-sources.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
}
}
tasks.curseforge353426.dependsOn moveDevLibs
}

task moveDevLibs(dependsOn: [remapJar, remapSourcesJar]) {
doLast {
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-sources.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
}
}

import org.kohsuke.github.GHReleaseBuilder
import org.kohsuke.github.GitHub

task github(dependsOn: moveDevLibs) {
onlyIf {
ENV.GITHUB_TOKEN
}

doLast {
def github = GitHub.connectUsingOAuth(ENV.GITHUB_TOKEN as String)
def repository = github.getRepository("Wurst-Imperium-MCX/Mo-Glass")
def ghVersion = "v" + version.substring(0, version.indexOf("-"))

def ghRelease = repository.getReleaseByTagName(ghVersion as String);
if(ghRelease == null) {
def releaseBuilder = new GHReleaseBuilder(repository, ghVersion as String)
ghRelease = releaseBuilder.create()
}

ghRelease.uploadAsset(remapJar.archiveFile.get().getAsFile(), "application/java-archive");
ghRelease.uploadAsset(remapSourcesJar.archiveFile.get().getAsFile(), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar"), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar"), "application/java-archive")
}
}
22 changes: 2 additions & 20 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
<p><strong>Note:</strong> Requires <a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/3919445" target="_blank" rel="noopener noreferrer">Fabric API for Minecraft 1.19.2</a>.</p>
<p>&nbsp;</p>
<p><strong>Changes:</strong></p>
<p>- Fixed a crash when running Mo Glass on a server.</p>
<p>&nbsp;</p>
<p><strong>v1.6 changes:</strong></p>
<p>- Added tinted glass slabs and stairs.</p>
<p>- Slightly modified the lighting engine to make tinted glass slabs and stairs possible.</p>
<p>- Added Italian (Italy) translations. (Thanks to <a href="https://github.com/XfedeX" target="_blank" rel="noopener noreferrer">XfedeX</a>!)</p>
<p>- Added French (France) translations. (Thanks to <a href="https://github.com/HanatakeYurii" target="_blank" rel="noopener noreferrer">HanatakeYurii</a>!)</p>
<p>- Added various common item tags that other mods can use in their crafting recipes to specify what kind of glass they want.</p>
<p>- Added a "mo_glass:glass_slabs" block tag containing all glass slabs and a "mo_glass:glass_stairs" block tag containing all glass stairs. This should be useful for vertical slabs mods.</p>
<p>- Added a "mo_glass:opaque_for_lighting" block tag for blocks that need my lighting engine modification to render properly. This should be useful for mods that change how lighting works.</p>
<p>- Reduced the file size of Mo Glass. (Thanks to <a href="https://github.com/RDKRACZ" target="_blank" rel="noopener noreferrer">RDKRACZ</a>!)</p>
<p>- Fixed glass stairs facing each other's front sides not being seamless. (<a href="https://user-images.githubusercontent.com/10100202/146294359-378351a4-9b1f-488d-9b4a-bba1309ac3fe.png" target="_blank" rel="noopener noreferrer">before</a>/<a href="https://user-images.githubusercontent.com/10100202/146294361-02af55ef-6998-46a3-a3c3-f5096caef95d.png" target="_blank" rel="noopener noreferrer">after</a>)</p>
<p>- Fixed glass stairs and glass slabs dripping when placed under a liquid (unlike vanilla glass blocks).</p>
<p>- Fixed glass stairs and glass slabs blocking the camera in 3rd person view (unlike vanilla glass blocks).</p>
<p>- Fixed glass slabs not being included in the "minecraft:slabs" tags.</p>
<p>- Fixed glass stairs not being included in the "minecraft:stairs" tags.</p>
<p>- Removed support for old Fabric Loader versions without the <a href="https://wiki.wurstclient.net/log4shell" target="_blank" rel="noopener noreferrer">Log4Shell</a> patch (older than v0.12.10).</p>
<p>A changelog can be found at:&nbsp;<a href="https://www.wimods.net/mo-glass/mo-glass-1-6-1/?mc=1.20.2&utm_source=CurseForge&utm_medium=Mo+Glass&utm_campaign=Changelog&utm_content=Mo+Glass+MC1.20.2">https://www.wimods.net/mo-glass/mo-glass-1-6-1/</a></p>
<p><strong>Note:</strong> This mod requires <a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/4757945" target="_blank" rel="noopener noreferrer">Fabric API for Minecraft 1.20.2</a>.</p>
11 changes: 6 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.1
loader_version=0.14.9
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22

#Fabric api
fabric_version=0.58.6+1.19.2
fabric_version=0.89.3+1.20.2

# Mod Properties
mod_version = 1.6.1-MC1.19.2
mod_version = 1.6.1-MC1.20.2
maven_group = net.wurstclient.glass
archives_base_name = Mo-Glass

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 19 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -143,12 +140,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand All @@ -205,6 +210,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand All @@ -231,4 +242,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"
Loading

0 comments on commit c07e283

Please sign in to comment.