Skip to content

Commit 417bdbf

Browse files
committed
1.21.4
1 parent 82ecc27 commit 417bdbf

15 files changed

Lines changed: 104 additions & 75 deletions

File tree

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.github/workflows/build.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,26 @@ jobs:
1212
matrix:
1313
# Use these Java versions
1414
java: [
15-
17, # Current Java LTS & minimum supported by Minecraft
15+
21, # Current Java LTS
1616
]
17-
# and run on both Linux and Windows
18-
os: [ubuntu-22.04, windows-2022]
19-
runs-on: ${{ matrix.os }}
17+
runs-on: ubuntu-22.04
2018
steps:
2119
- name: checkout repository
22-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2321
- name: validate gradle wrapper
24-
uses: gradle/wrapper-validation-action@v1
22+
uses: gradle/wrapper-validation-action@v2
2523
- name: setup jdk ${{ matrix.java }}
26-
uses: actions/setup-java@v3
24+
uses: actions/setup-java@v4
2725
with:
2826
java-version: ${{ matrix.java }}
2927
distribution: 'microsoft'
3028
- name: make gradle wrapper executable
31-
if: ${{ runner.os != 'Windows' }}
3229
run: chmod +x ./gradlew
3330
- name: build
3431
run: ./gradlew build
3532
- name: capture build artifacts
36-
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
37-
uses: actions/upload-artifact@v3
33+
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
34+
uses: actions/upload-artifact@v4
3835
with:
3936
name: Artifacts
4037
path: build/libs/

build.gradle

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.4-SNAPSHOT'
2+
id 'fabric-loom' version '1.8-SNAPSHOT'
33
id 'maven-publish'
44
}
55

@@ -30,11 +30,6 @@ dependencies {
3030
// Fabric API. This is technically optional, but you probably want it anyway.
3131
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
3232

33-
// Uncomment the following line to enable the deprecated Fabric API modules.
34-
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
35-
36-
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
37-
3833
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"
3934
}
4035

@@ -47,7 +42,7 @@ processResources {
4742
}
4843

4944
tasks.withType(JavaCompile).configureEach {
50-
it.options.release = 17
45+
it.options.release = 21
5146
}
5247

5348
java {
@@ -56,8 +51,8 @@ java {
5651
// If you remove this line, sources will not be generated.
5752
withSourcesJar()
5853

59-
sourceCompatibility = JavaVersion.VERSION_17
60-
targetCompatibility = JavaVersion.VERSION_17
54+
sourceCompatibility = JavaVersion.VERSION_21
55+
targetCompatibility = JavaVersion.VERSION_21
6156
}
6257

6358
jar {
@@ -67,7 +62,8 @@ jar {
6762
// configure the maven publication
6863
publishing {
6964
publications {
70-
mavenJava(MavenPublication) {
65+
create("mavenJava", MavenPublication) {
66+
artifactId = project.archives_base_name
7167
from components.java
7268
}
7369
}

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.20.2
8-
yarn_mappings=1.20.2+build.4
9-
loader_version=0.14.24
7+
minecraft_version=1.21.4
8+
yarn_mappings=1.21.4+build.1
9+
loader_version=0.16.9
1010

1111
# Mod Properties
12-
mod_version=1.6+1.20.2
12+
mod_version=1.6+1.21.4
1313
maven_group=re.domi
1414
archives_base_name=fast-chest
1515

1616
# Dependencies
17-
fabric_version=0.90.7+1.20.2
18-
mod_menu_version=8.0.0
17+
fabric_version=0.110.5+1.21.4
18+
mod_menu_version=13.0.0-beta.1

gradle/wrapper/gradle-wrapper.jar

-19.3 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/re/domi/fastchest/config/Config.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.*;
66
import java.util.Properties;
77

8+
@SuppressWarnings("CallToPrintStackTrace")
89
public class Config
910
{
1011
private static final File CONFIG_FILE = new File(FabricLoader.getInstance().getConfigDir().toFile(), "fast-chest.properties");
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
package re.domi.fastchest.mixin;
22

3-
import net.minecraft.block.BlockRenderType;
4-
import net.minecraft.block.BlockState;
5-
import net.minecraft.block.ChestBlock;
3+
import net.minecraft.block.*;
64
import net.minecraft.block.entity.BlockEntity;
75
import net.minecraft.block.entity.BlockEntityTicker;
86
import net.minecraft.block.entity.BlockEntityType;
7+
import net.minecraft.block.entity.ChestBlockEntity;
98
import net.minecraft.world.World;
109
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.Unique;
1111
import org.spongepowered.asm.mixin.injection.At;
1212
import org.spongepowered.asm.mixin.injection.Inject;
1313
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1414
import re.domi.fastchest.config.Config;
1515

16-
@Mixin(ChestBlock.class)
17-
public class ChestBlockMixin
16+
import java.util.function.Supplier;
17+
18+
@Mixin(value = ChestBlock.class, priority = 1500)
19+
public abstract class ChestBlockMixin extends AbstractChestBlock<ChestBlockEntity>
1820
{
19-
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
21+
@Override
22+
@Unique(silent = true)
23+
protected BlockRenderType getRenderType(BlockState state)
24+
{
25+
return super.getRenderType(state);
26+
}
27+
28+
@SuppressWarnings({ "MixinAnnotationTarget", "UnresolvedMixinReference" })
29+
@Inject(method = {"getRenderType", "method_9604"}, at = @At("HEAD"), cancellable = true, remap = false)
2030
private void replaceRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> cir)
2131
{
22-
if (Config.simplifiedChest)
32+
if (!Config.simplifiedChest)
2333
{
24-
cir.setReturnValue(BlockRenderType.MODEL);
34+
cir.setReturnValue(BlockRenderType.INVISIBLE);
2535
}
2636
}
2737

@@ -33,4 +43,10 @@ private <T extends BlockEntity> void removeTicker(World world, BlockState state,
3343
cir.setReturnValue(null);
3444
}
3545
}
46+
47+
@SuppressWarnings({"DataFlowIssue", "unused"})
48+
protected ChestBlockMixin(Settings settings, Supplier<BlockEntityType<? extends ChestBlockEntity>> entityTypeRetriever)
49+
{
50+
super(null, null);
51+
}
3652
}

0 commit comments

Comments
 (0)