Skip to content

Commit 093d321

Browse files
build: update to forge 4.2.0
1 parent 48a2d45 commit 093d321

File tree

15 files changed

+52
-54
lines changed

15 files changed

+52
-54
lines changed

.github/workflows/auto-release.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818

1919
- run: |
2020
prop() { grep -P "^\s*[^#]?${1}=.*$" './gradle.properties' | cut -d'=' -f2; }
@@ -32,14 +32,14 @@ jobs:
3232
packages: write
3333

3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
3636

3737
- name: Set up JDK 17
38-
uses: actions/setup-java@v2
38+
uses: actions/setup-java@v3
3939
with:
4040
java-version: '17'
4141
distribution: 'temurin'
42-
architecture: x64
42+
architecture: 'x64'
4343

4444
- name: Build and publish with Gradle
4545
env:
@@ -54,18 +54,16 @@ jobs:
5454
./gradlew build publish genUpdateJson
5555
5656
- name: Update update JSON
57-
uses: JamesIves/github-pages-deploy-action@4.1.5
57+
uses: JamesIves/github-pages-deploy-action@v4
5858
with:
5959
clean: false
6060
target-folder: update
6161
branch: gh-pages
6262
folder: tmp
6363

6464
- name: Github release
65-
uses: marvinpinto/action-automatic-releases@latest
65+
uses: softprops/action-gh-release@v1
6666
with:
67-
repo_token: ${{secrets.GITHUB_TOKEN}}
68-
prerelease: false
6967
files: |
7068
build/libs/*.jar
7169
build/libs/*.asc

.github/workflows/dev-build.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ name: dev-build
55

66
on:
77
push:
8-
branches:
9-
- 1.18-forge
8+
branches-ignore:
9+
- 'test*'
1010
tags-ignore:
1111
- 'v*'
1212

@@ -17,14 +17,15 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121

2222
- name: Set up JDK 17
23-
uses: actions/setup-java@v2
23+
uses: actions/setup-java@v3
2424
with:
2525
java-version: '17'
2626
distribution: 'temurin'
27-
architecture: x64
27+
architecture: 'x64'
28+
cache: 'gradle'
2829

2930
- name: Build with Gradle
3031
run: |

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ bin
44
.metadata
55
.classpath
66
.project
7+
.factorypath
78
.vscode
89
tmp
910

@@ -22,6 +23,7 @@ run
2223
forge*changelog.txt
2324

2425
test*.*
25-
libs
2626

2727
mcmodsrepo
28+
29+
src/generated

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
[![GitHub license](https://img.shields.io/github/license/auioc/NotEnoughLuck?style=flat-square)](/LICENSE)
66
[![GitHub release](https://img.shields.io/github/v/release/auioc/NotEnoughLuck?style=flat-square)](https://github.com/auioc/NotEnoughLuck/releases/latest)
7-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/auioc/NotEnoughLuck/auto-release?label=release%20build&style=flat-square)](https://github.com/auioc/NotEnoughLuck/actions/workflows/auto-release.yml)
8-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/auioc/NotEnoughLuck/dev-build?label=dev%20build&style=flat-square)](https://github.com/auioc/NotEnoughLuck/actions/workflows/dev-build.yml)
7+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/auioc/NotEnoughLuck/dev-build.yml?branch=1.18-forge&label=dev%20build&style=flat-square)](https://github.com/auioc/NotEnoughLuck/actions/workflows/dev-build.yml)
98
<br/>
109
![Minecraft](https://img.shields.io/static/v1?label=Minecraft&message=1.18.2&color=00aa00&style=flat-square)
11-
[![Forge](https://img.shields.io/static/v1?label=Forge&message=40.1.0&color=e04e14&logo=Conda-Forge&style=flat-square)](http://files.minecraftforge.net/net/minecraftforge/forge/index_1.18.2.html)
12-
[![AdoptiumOpenJDK](https://img.shields.io/static/v1?label=AdoptiumOpenJDK&message=17.0.4%2B8&color=brightgreen&logo=java&style=flat-square)](https://adoptium.net)
10+
[![Forge](https://img.shields.io/static/v1?label=Forge&message=40.2.0&color=e04e14&logo=Conda-Forge&style=flat-square)](http://files.minecraftforge.net/net/minecraftforge/forge/index_1.18.2.html)
11+
![OpenJDK](https://img.shields.io/static/v1?label=OpenJDK&message=17&color=brightgreen&logo=java&style=flat-square)
1312
[![Gradle](https://img.shields.io/static/v1?label=Gradle&message=7.3&color=brightgreen&logo=gradle&style=flat-square)](https://docs.gradle.org/7.3/release-notes.html)
1413

1514
</div>

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ org.gradle.jvmargs=-Xmx4G
44
org.gradle.daemon=false
55

66
minecraft_version=1.18.2
7-
forge_version=40.1.0
7+
forge_version=40.2.0
88

99
mappings_channel=official
1010
mappings_version=1.18.2
1111

1212
mixin_version=0.8.5
1313

14-
arnicalib_version=5.6.3
15-
hulsealib_version=1.0.1
14+
arnicalib_version=5.7.3
15+
hulsealib_version=1.1.1
1616

1717
github_repo=auioc/NotEnoughLuck
1818
group=org.auioc.mcmod

src/main/java/org/auioc/mcmod/notenoughluck/client/gui/screen/tungshing/ClassicTungShingScreen.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,18 @@ public ClassicTungShingScreen() {
4141
}
4242

4343
@Override
44-
protected void init() {
45-
int divX = center(this.width, DIV_WIDTH);
46-
int divY = center(this.height, DIV_HEIGHT);
47-
44+
protected void subInit() {
4845
this.editbox = new EditBox(
4946
this.font,
50-
divX + EDITBOX_X_OFFSET, divY + EDITBOX_Y_OFFSET,
47+
boxX1 + EDITBOX_X_OFFSET, boxY1 + EDITBOX_Y_OFFSET,
5148
EDITBOX_WIDTH, EDITBOX_HEIGHT,
5249
i18n("editbox")
5350
);
5451
this.editbox.setFilter(TungShingScreenUtils.IS_INTEGER_STRING);
5552
this.addWidget(this.editbox);
5653

5754
this.button = new Button(
58-
divX + BUTTON_X_OFFSET, divY + BUTTON_Y_OFFSET,
55+
boxX1 + BUTTON_X_OFFSET, boxY1 + BUTTON_Y_OFFSET,
5956
BUTTON_WIDTH, BUTTON_HEIGHT,
6057
i18n("button.request"),
6158
(button) -> {
@@ -93,7 +90,7 @@ protected void subRender(PoseStack poseStack, int mouseX, int mouseY, float part
9390
this.font.drawShadow(
9491
poseStack,
9592
text,
96-
this.divX + UNSEI_LINE_X_OFFSET, this.divY + UNSEI_LINE_Y_OFFSET + (i + 1) * UNSEI_LINE_Y_ADDEND,
93+
boxX1 + UNSEI_LINE_X_OFFSET, boxY1 + UNSEI_LINE_Y_OFFSET + (i + 1) * UNSEI_LINE_Y_ADDEND,
9794
0x000000
9895
);
9996
}

src/main/java/org/auioc/mcmod/notenoughluck/common/item/base/DiceItem.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.function.Consumer;
44
import javax.annotation.Nullable;
55
import org.auioc.mcmod.arnicalib.game.chat.TextUtils;
6-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
6+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
77
import org.auioc.mcmod.notenoughluck.client.renderer.DiceItemRenderer;
88
import org.auioc.mcmod.notenoughluck.common.itemgroup.NELItemGroups;
99
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
@@ -64,7 +64,7 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int slot,
6464

6565
afterPickup(player, pips);
6666

67-
EffectUtils.removeEffect(player, (e) -> e.getEffect() == MobEffects.LUCK || e.getEffect() == MobEffects.UNLUCK);
67+
MobEffectUtils.remove(player, (e) -> e.getEffect() == MobEffects.LUCK || e.getEffect() == MobEffects.UNLUCK);
6868

6969
var effect = getEffect(pips, nbt);
7070
if (effect != null) {

src/main/java/org/auioc/mcmod/notenoughluck/common/item/impl/IndulgenceItem.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.auioc.mcmod.notenoughluck.common.item.impl;
22

3-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
3+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
44
import org.auioc.mcmod.hulsealib.game.item.UsableItem;
55
import org.auioc.mcmod.notenoughluck.common.effect.NELMobEffects;
66
import org.auioc.mcmod.notenoughluck.common.itemgroup.NELItemGroups;
@@ -33,7 +33,7 @@ public IndulgenceItem() {
3333
public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity living) {
3434
if (living instanceof ServerPlayer player) {
3535
player.addEffect(
36-
EffectUtils.makeIncurable(
36+
MobEffectUtils.makeIncurable(
3737
new MobEffectInstance(NELMobEffects.REDEMPTION.get(), REDEMPTION_DURATION)
3838
)
3939
);

src/main/java/org/auioc/mcmod/notenoughluck/mixin/server/MixinBowItem.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.auioc.mcmod.notenoughluck.mixin.server;
22

3-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
3+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
44
import org.auioc.mcmod.notenoughluck.api.mixin.server.IMixinAbstractArrow;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
@@ -36,8 +36,8 @@ public void releaseUsing(
3636
Player player, boolean flag, ItemStack itemstack, int i, float f, boolean flag1, ArrowItem arrowitem, AbstractArrow abstractarrow, int j, int k
3737
) {
3838
IMixinAbstractArrow mixinabstractarrow = ((IMixinAbstractArrow) abstractarrow);
39-
mixinabstractarrow.setLuck(EffectUtils.getEffectLevel(player, MobEffects.LUCK));
40-
mixinabstractarrow.setUnluck(EffectUtils.getEffectLevel(player, MobEffects.UNLUCK));
39+
mixinabstractarrow.setLuck(MobEffectUtils.getLevel(player, MobEffects.LUCK));
40+
mixinabstractarrow.setUnluck(MobEffectUtils.getLevel(player, MobEffects.UNLUCK));
4141
}
4242

4343
}

src/main/java/org/auioc/mcmod/notenoughluck/mixin/server/MixinCrossbowItem.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.auioc.mcmod.notenoughluck.mixin.server;
22

3-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
3+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
44
import org.auioc.mcmod.notenoughluck.api.mixin.server.IMixinAbstractArrow;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
@@ -33,8 +33,8 @@ private static void getArrow(
3333
) {
3434
if (p_40916_ instanceof ServerPlayer) {
3535
IMixinAbstractArrow mixinabstractarrow = ((IMixinAbstractArrow) abstractarrow);
36-
mixinabstractarrow.setLuck(EffectUtils.getEffectLevel(p_40916_, MobEffects.LUCK));
37-
mixinabstractarrow.setUnluck(EffectUtils.getEffectLevel(p_40916_, MobEffects.UNLUCK));
36+
mixinabstractarrow.setLuck(MobEffectUtils.getLevel(p_40916_, MobEffects.LUCK));
37+
mixinabstractarrow.setUnluck(MobEffectUtils.getLevel(p_40916_, MobEffects.UNLUCK));
3838
}
3939
}
4040

src/main/java/org/auioc/mcmod/notenoughluck/mixin/server/MixinPlayer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.function.Function;
66
import org.apache.commons.lang3.tuple.Triple;
77
import org.auioc.mcmod.arnicalib.base.random.RandomUtils;
8-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
8+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
99
import org.spongepowered.asm.mixin.Mixin;
1010
import org.spongepowered.asm.mixin.injection.At;
1111
import org.spongepowered.asm.mixin.injection.At.Shift;
@@ -65,12 +65,12 @@ private float modifyAttackDamage(float f) {
6565
return f;
6666
}
6767

68-
int unluck = EffectUtils.getEffectLevel(player, MobEffects.UNLUCK);
68+
int unluck = MobEffectUtils.getLevel(player, MobEffects.UNLUCK);
6969
if (unluck > 0 && !(player.getRandom().nextDouble() < Math.pow(0.8, (double) unluck))) {
7070
return 0.0F;
7171
}
7272

73-
int luck = EffectUtils.getEffectLevel(player, MobEffects.LUCK);
73+
int luck = MobEffectUtils.getLevel(player, MobEffects.LUCK);
7474
if (luck > 0) {
7575
Triple<Integer, Function<Integer, Float>, Function<Integer, Float>> bonusTriple =
7676
ATTACK_LUCK_BONUS_MAP.get(Math.min(luck - 1, ATTACK_LUCK_BONUS_MAP.size() - 1));

src/main/java/org/auioc/mcmod/notenoughluck/server/command/impl/UnseiCommand.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import org.apache.commons.lang3.RandomUtils;
1010
import org.auioc.mcmod.arnicalib.game.chat.TextUtils;
1111
import org.auioc.mcmod.arnicalib.game.command.CommandExceptions;
12-
import org.auioc.mcmod.arnicalib.mod.mixinapi.common.IMixinCommandSourceStack;
12+
import org.auioc.mcmod.arnicalib.game.command.CommandSourceUtils;
1313
import org.auioc.mcmod.notenoughluck.common.network.NELPacketHandler;
1414
import org.auioc.mcmod.notenoughluck.common.network.packet.client.ClearClientUnseiCachePacket;
1515
import org.auioc.mcmod.notenoughluck.server.unsei.ServerUnseiCache;
@@ -49,7 +49,8 @@ private static int clearClientCache(CommandContext<CommandSourceStack> ctx) thro
4949
private static int clearServerCache(CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException {
5050
var source = ctx.getSource();
5151

52-
if ((source.getServer() instanceof DedicatedServer) && !(((IMixinCommandSourceStack) source).getSource() instanceof DedicatedServer)) {
52+
53+
if (!(CommandSourceUtils.getRealSource(source) instanceof DedicatedServer)) {
5354
throw CommandExceptions.NOT_DEDICATED_SERVER_ERROR.create();
5455
}
5556

src/main/java/org/auioc/mcmod/notenoughluck/server/event/handler/PotionAddedHandler.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.auioc.mcmod.notenoughluck.server.event.handler;
22

3-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
3+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
44
import org.auioc.mcmod.notenoughluck.common.effect.NELMobEffects;
55
import net.minecraft.server.level.ServerPlayer;
66
import net.minecraft.world.effect.MobEffects;
@@ -12,13 +12,13 @@ public static void handle(final PotionAddedEvent event) {
1212
if (event.getEntityLiving() instanceof ServerPlayer player) {
1313
var newEffect = event.getPotionEffect();
1414
if (newEffect.getEffect() == MobEffects.UNLUCK) {
15-
int redemption = EffectUtils.getEffectLevel(player, NELMobEffects.REDEMPTION.get());
15+
int redemption = MobEffectUtils.getLevel(player, NELMobEffects.REDEMPTION.get());
1616
if (redemption > 0) {
1717
if (newEffect.getAmplifier() > 0) {
1818
int newUnluckAmplifier = newEffect.getAmplifier() - redemption;
19-
EffectUtils.setAmplifier(newEffect, Math.max(newUnluckAmplifier, 0));
19+
MobEffectUtils.setAmplifier(newEffect, Math.max(newUnluckAmplifier, 0));
2020
} else {
21-
EffectUtils.setDuration(newEffect, 1);
21+
MobEffectUtils.setDuration(newEffect, 1);
2222
}
2323
}
2424
}

src/main/java/org/auioc/mcmod/notenoughluck/utils/LuckUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.auioc.mcmod.notenoughluck.utils;
22

33
import org.auioc.mcmod.arnicalib.base.random.RandomUtils;
4-
import org.auioc.mcmod.arnicalib.game.effect.EffectUtils;
4+
import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils;
55
import net.minecraft.util.Mth;
66
import net.minecraft.world.effect.MobEffects;
77
import net.minecraft.world.entity.LivingEntity;
@@ -10,11 +10,11 @@
1010
public class LuckUtils {
1111

1212
public static int getLuckEffectLevel(LivingEntity living) {
13-
return EffectUtils.getEffectLevel(living, MobEffects.LUCK);
13+
return MobEffectUtils.getLevel(living, MobEffects.LUCK);
1414
}
1515

1616
public static int getUnluckEffectLevel(LivingEntity living) {
17-
return EffectUtils.getEffectLevel(living, MobEffects.UNLUCK);
17+
return MobEffectUtils.getLevel(living, MobEffects.UNLUCK);
1818
}
1919

2020
public static int getLuckValueByEffect(LivingEntity living) {

src/main/resources/META-INF/mods.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ Not Enough Luck
1919
[[dependencies.notenoughluck]]
2020
modId="forge"
2121
mandatory=true
22-
versionRange="[40,)"
22+
versionRange="[40.2.0,)"
2323
ordering="NONE"
2424
side="BOTH"
2525
[[dependencies.notenoughluck]]
2626
modId="minecraft"
2727
mandatory=true
28-
versionRange="[1.18.1,1.19)"
28+
versionRange="[1.18.2,1.19)"
2929
ordering="NONE"
3030
side="BOTH"
3131
[[dependencies.notenoughluck]]
3232
modId="arnicalib"
3333
mandatory=true
34-
versionRange="[5.6.3,)"
34+
versionRange="[5.7.3,)"
3535
ordering="NONE"
3636
side="BOTH"
3737
[[dependencies.notenoughluck]]
3838
modId="hulsealib"
3939
mandatory=true
40-
versionRange="[1.0.1,)"
40+
versionRange="[1.1.1,)"
4141
ordering="NONE"
4242
side="BOTH"

0 commit comments

Comments
 (0)