Skip to content

Commit d769192

Browse files
committed
🔖 Update to 1.21
1 parent d086120 commit d769192

File tree

11 files changed

+56
-75
lines changed

11 files changed

+56
-75
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
# Use these Java versions
1414
java: [
15-
17, # Current Java LTS & minimum supported by Minecraft
15+
21, # Current Java LTS & minimum supported by Minecraft
1616
]
1717
# and run on both Linux
1818
os: [ubuntu-20.04]

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
# Use these Java versions
1515
java: [
16-
17, # Current Java LTS & minimum supported by Minecraft
16+
21, # Current Java LTS & minimum supported by Minecraft
1717
]
1818
# and run on both Linux
1919
os: [ubuntu-20.04]

build.gradle

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
plugins {
2-
id 'fabric-loom' version '0.12-SNAPSHOT'
2+
id 'fabric-loom' version '1.7-SNAPSHOT'
33
id 'maven-publish'
4-
id "com.modrinth.minotaur" version "2.+"
54
}
65

7-
sourceCompatibility = JavaVersion.VERSION_17
8-
targetCompatibility = JavaVersion.VERSION_17
6+
sourceCompatibility = JavaVersion.VERSION_21
7+
targetCompatibility = JavaVersion.VERSION_21
98

109
archivesBaseName = project.archives_base_name
1110
version = project.mod_version
@@ -23,10 +22,7 @@ dependencies {
2322
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
2423
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
2524

26-
modImplementation "com.ptsmods:devlogin:3.1.1" // Developpement deps : let me use my account
27-
28-
// not required, but we want to see our config screen
29-
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"
25+
modImplementation "com.ptsmods:devlogin:3.5" // Developpement deps : let me use my account
3026
}
3127

3228
processResources {
@@ -38,8 +34,7 @@ processResources {
3834
}
3935

4036
tasks.withType(JavaCompile).configureEach {
41-
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
42-
it.options.release = 17
37+
it.options.release = 21
4338
}
4439

4540
java {
@@ -70,14 +65,4 @@ publishing {
7065
// The repositories here will be used for publishing your artifact, not for
7166
// retrieving dependencies.
7267
}
73-
}
74-
75-
modrinth {
76-
token = System.getenv("MODRINTH")
77-
projectId = "dinnermod"
78-
versionNumber = project.version
79-
versionType = "release"
80-
uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`!
81-
gameVersions = [project.minecraft_version] // Must be an array, even with only one version
82-
loaders = ["fabric"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle
8368
}

gradle.properties

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
5-
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.19.4
7-
yarn_mappings=1.19.4+build.2
8-
loader_version=0.14.12
5+
minecraft_version=1.21
6+
yarn_mappings=1.21+build.8
7+
loader_version=0.15.11
98

109
# Mod Properties
11-
mod_version = 2.0.1
10+
mod_version = 2.1.0
1211
maven_group = dev.renoux
13-
archives_base_name = dinnermod-1.19.4
14-
15-
# Dependencies
16-
mod_menu_version=6.1.0-rc.3
12+
archives_base_name = dinnermod-1.21
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
7+
zipStorePath=wrapper/dists

src/main/java/dev/renoux/dinnermod/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ public String getRotationText() {
126126
}
127127

128128
public MutableText getText() {
129-
return Text.translatable("options.dinnermod.modelpart", this.getRotationText());
129+
return Text.literal("DinnerMod: " + this.getRotationText());
130130
}
131131
}

src/main/java/dev/renoux/dinnermod/Dinnermod.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public class Dinnermod implements ClientModInitializer {
3434
public static final String MODID = "dinnermod";
3535
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);
3636

37-
public static KeyBinding toogleGridKeyBind;
38-
3937
@Override
4038
public void onInitializeClient() {
4139
LOGGER.info("Dinnermod : LOADING");

src/main/java/dev/renoux/dinnermod/mixins/LivingEntityRendererMixin.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package dev.renoux.dinnermod.mixins;
22

33
import net.minecraft.client.render.entity.LivingEntityRenderer;
4-
import net.minecraft.client.render.entity.PlayerModelPart;
54
import net.minecraft.client.util.math.MatrixStack;
65
import net.minecraft.entity.LivingEntity;
76
import net.minecraft.entity.passive.*;
87
import net.minecraft.entity.player.PlayerEntity;
8+
import net.minecraft.entity.player.PlayerModelPart;
99
import net.minecraft.util.Formatting;
1010
import net.minecraft.util.math.RotationAxis;
1111
import org.spongepowered.asm.mixin.Mixin;
12+
import org.spongepowered.asm.mixin.Unique;
1213
import org.spongepowered.asm.mixin.injection.At;
1314
import org.spongepowered.asm.mixin.injection.Inject;
1415
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -19,25 +20,29 @@
1920
@Mixin(LivingEntityRenderer.class)
2021
public class LivingEntityRendererMixin {
2122

23+
@Unique
2224
private void transformFromName(String string, MatrixStack matrices) {
23-
if (string.equals("Pisteur_alpin")) {
24-
matrices.translate(0.3D, 0.1F, 0.0D);
25-
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(15.0F));
26-
} else if (string.equals("Kresqle")) {
27-
matrices.translate(0.8D, 0.1F, 0.0D);
28-
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(42.0F));
29-
} else if (string.equals("Aragorn1202")) {
30-
matrices.translate(0.0D, 0.1F, 0.0D);
31-
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(5.0F));
32-
}
25+
switch (string) {
26+
case "Pisteur_alpin" -> {
27+
matrices.translate(0.3D, 0.1F, 0.0D);
28+
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(15.0F));
29+
}
30+
case "Kresqle" -> {
31+
matrices.translate(0.8D, 0.1F, 0.0D);
32+
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(42.0F));
33+
}
34+
case "Aragorn1202" -> {
35+
matrices.translate(0.0D, 0.1F, 0.0D);
36+
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(5.0F));
37+
}
38+
}
3339
}
3440

3541
@Inject(at = @At("TAIL"), method = "setupTransforms")
36-
private void setupTransforms(LivingEntity entity, MatrixStack matrices, float animationProgress, float bodyYaw,
37-
float tickDelta, CallbackInfo ci) {
42+
private void setupTransforms(LivingEntity entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float scale, CallbackInfo ci) {
3843
Config Configuration = Config.getConfig();
3944
if ((entity instanceof PlayerEntity player)) {
40-
String string = player.getEntityName();
45+
String string = player.getName().getString();
4146
if (player.isMainPlayer() && Configuration.getRotation() > 1) {
4247
switch (Configuration.getRotation()) {
4348
case 2 -> {
@@ -64,7 +69,7 @@ private static void shouldFlipUpsideDown(LivingEntity entity, CallbackInfoReturn
6469
Config Configuration = Config.getConfig();
6570
boolean value = false;
6671
if (entity instanceof PlayerEntity player) {
67-
String string = player.getEntityName();
72+
String string = player.getName().getString();
6873
if ((player.isMainPlayer() && Configuration.getRotation() == 1) || ((string.equals("fantomitechno")
6974
|| string.equals("fant0mib0t") || string.equals("NewGlace") || string.equals("Hardel")
7075
|| string.equals("Dinnerbone") || string.equals("Grumm")) && !player.isMainPlayer())) {
@@ -86,4 +91,4 @@ private static void shouldFlipUpsideDown(LivingEntity entity, CallbackInfoReturn
8691
cir.cancel();
8792
cir.setReturnValue(value);
8893
}
89-
}
94+
}

src/main/java/dev/renoux/dinnermod/mixins/SkinOptionsScreenMixin.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import net.minecraft.client.gui.screen.Screen;
44
import net.minecraft.client.gui.screen.option.SkinOptionsScreen;
55
import net.minecraft.client.gui.widget.ButtonWidget;
6+
import net.minecraft.client.gui.widget.ClickableWidget;
7+
import net.minecraft.client.option.GameOptions;
68
import net.minecraft.text.Text;
79
import org.spongepowered.asm.mixin.Mixin;
810
import org.spongepowered.asm.mixin.injection.At;
@@ -12,6 +14,8 @@
1214

1315
import dev.renoux.dinnermod.Config;
1416

17+
import java.util.List;
18+
1519
@Mixin(SkinOptionsScreen.class)
1620
public class SkinOptionsScreenMixin extends Screen {
1721

@@ -21,23 +25,17 @@ protected SkinOptionsScreenMixin(Text title) {
2125

2226
private ButtonWidget dinnermodButton;
2327

24-
@Inject(method = "init", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILHARD)
25-
private void onInit(CallbackInfo ci, int i) {
26-
Config Configuration = Config.getConfig();
27-
dinnermodButton = ButtonWidget.builder(Configuration.getText(),
28-
button -> {
29-
Configuration.bumpRotation();
30-
button.setMessage(Configuration.getText());
31-
Configuration.save();
32-
})
33-
.size(150, 20)
34-
.position(this.width / 2 - 75, this.height / 6 + 24 * ((i + 2) >> 1))
35-
.build();
36-
this.addDrawableChild(dinnermodButton);
28+
@Inject(method = "addOptions", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/OptionListWidget;addAll(Ljava/util/List;)V"), locals = LocalCapture.CAPTURE_FAILHARD)
29+
private void addDinnerButton(CallbackInfo ci, List<ClickableWidget> list) {
30+
Config Configuration = Config.getConfig();
31+
dinnermodButton = ButtonWidget.builder(Configuration.getText(),
32+
button -> {
33+
Configuration.bumpRotation();
34+
button.setMessage(Configuration.getText());
35+
Configuration.save();
36+
})
37+
.size(150, 20)
38+
.build();
39+
list.add(dinnermodButton);
3740
}
3841
}
39-
40-
// MTA5NDMwNTYyNzYzMjgzMju4MgU4Mg.G5M09e.ra9C9vDtqel4FIigy__bKFEaId015UfAwu0qcY
41-
/*
42-
* Hi, Kiro you made a little misstake, showing your token online is a really bad idea. I've reset it for you so you don't have to worry for this one, get a new one with the discord developper portal, this time try to not post in on the internet (a stream count as posting) - anonymous developper
43-
*/

src/main/resources/assets/dinnermod/lang/en_us.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)