WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b199185

Browse files
committed
update to 1.21.9 (fixes #19)
update to 1.21.9 by making a separate version folder, also updated loom to 1.11, and Gradle to 8.14
1 parent f4a1c47 commit b199185

30 files changed

+1496
-9
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.10-SNAPSHOT'
2+
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
44
}
55

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx1G
2+
org.gradle.jvmargs=-Xmx3G
33
org.gradle.parallel=true
44

55
# Fabric Properties

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.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
}
1414
stonecutter {
1515
create(rootProject) {
16-
versions "1.20.1", "1.21.1", "1.21.2", "1.21.5", "1.21.6"
16+
versions "1.20.1", "1.21.1", "1.21.2", "1.21.5", "1.21.6", "1.21.9"
1717
vcsVersion = "1.21.1"
1818
}
1919
}

stonecutter.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id "dev.kikugie.stonecutter"
33
}
44

5-
stonecutter.active "1.21.5" /* [SC] DO NOT EDIT */
5+
stonecutter.active "1.21.9" /* [SC] DO NOT EDIT */
66

77
stonecutter.registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) {
88
setGroup "project"

versions/1.21.6/gradle.properties

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

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.6
8-
yarn_mappings=1.21.6+build.1
7+
minecraft_version=1.21.7
8+
yarn_mappings=1.21.7+build.1
99
loader_version=0.16.14
1010

1111
# Mod Properties
12-
mod_version=1.0.4-1.21.6
12+
mod_version=1.0.4-1.21.6-1.21.7
1313
maven_group=derp.immersive-hotbar
1414
archives_base_name=immersive-hotbar
1515

1616
# Dependencies
17-
fabric_version=0.128.1+1.21.6
17+
fabric_version=0.128.1+1.21.7
1818
yacl_version=3.7.1+1.21.6-fabric
1919
modmenu_version=15.0.0-beta.3

versions/1.21.9/gradle.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx3G
3+
org.gradle.parallel=true
4+
5+
# Fabric Properties
6+
# check these on https://fabricmc.net/develop
7+
minecraft_version=1.21.9
8+
yarn_mappings=1.21.9+build.1
9+
loader_version=0.17.2
10+
11+
# Mod Properties
12+
mod_version=1.0.4-1.21.9
13+
maven_group=derp.immersive-hotbar
14+
archives_base_name=immersive-hotbar
15+
16+
# Dependencies
17+
fabric_version=0.133.14+1.21.9
18+
yacl_version=3.8.0+1.21.9-fabric
19+
modmenu_version=15.0.0-beta.3
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package derp.immersivehotbar;
2+
3+
import derp.immersivehotbar.config.ImmersiveHotbarConfigHandler;
4+
import derp.immersivehotbar.util.TooltipAnimationState;
5+
import net.fabricmc.api.ClientModInitializer;
6+
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
7+
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
8+
import net.fabricmc.fabric.api.event.client.player.ClientPlayerBlockBreakEvents;
9+
import net.fabricmc.loader.api.FabricLoader;
10+
import net.minecraft.item.*;
11+
12+
import java.util.Arrays;
13+
14+
import static derp.immersivehotbar.config.ImmersiveHotbarConfig.*;
15+
import static derp.immersivehotbar.util.ItemChecker.isTool;
16+
import static derp.immersivehotbar.util.SlotAnimationState.*;
17+
18+
public class ImmersiveHotbarClient implements ClientModInitializer {
19+
private boolean wasUsingItem = false;
20+
private ItemStack lastUsedItem = ItemStack.EMPTY;
21+
private boolean wasCrossbowChargedMainhand = false;
22+
private boolean wasCrossbowChargedOffhand = false;
23+
public static final boolean IS_DOUBLEHOTBAR_LOADED = FabricLoader.getInstance().isModLoaded("double_hotbar");
24+
25+
@Override
26+
public void onInitializeClient() {
27+
ImmersiveHotbarConfigHandler.load();
28+
ClientPlayConnectionEvents.DISCONNECT.register((client, world) -> Arrays.fill(lastSlotStacks, ItemStack.EMPTY));
29+
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> TooltipAnimationState.reset());
30+
31+
ClientTickEvents.END_CLIENT_TICK.register(client -> {
32+
if (client.player == null) return;
33+
34+
boolean isUsing = client.player.isUsingItem();
35+
36+
// track bow usage
37+
if (isUsing) {
38+
lastUsedItem = client.player.getActiveItem();
39+
} else if (wasUsingItem && !lastUsedItem.isEmpty()) {
40+
Item item = lastUsedItem.getItem();
41+
42+
if (weaponAnimates && (item instanceof BowItem || item instanceof CrossbowItem)) {
43+
int slot = client.player.getMainHandStack() == lastUsedItem ? client.player.getInventory().getSelectedSlot() : 9;
44+
triggerShrink(slot);
45+
}
46+
lastUsedItem = ItemStack.EMPTY;
47+
}
48+
49+
wasUsingItem = isUsing;
50+
51+
// crossbow mainhand
52+
ItemStack mainHandStack = client.player.getMainHandStack();
53+
if (mainHandStack.getItem() instanceof CrossbowItem) {
54+
boolean isCharged = CrossbowItem.isCharged(mainHandStack);
55+
if (wasCrossbowChargedMainhand && !isCharged && weaponAnimates) {
56+
int slot = client.player.getInventory().getSelectedSlot();
57+
triggerShrink(slot);
58+
}
59+
wasCrossbowChargedMainhand = isCharged;
60+
} else {
61+
wasCrossbowChargedMainhand = false;
62+
}
63+
64+
// crossbow offhand
65+
ItemStack offHandStack = client.player.getOffHandStack();
66+
if (offHandStack.getItem() instanceof CrossbowItem) {
67+
boolean isCharged = CrossbowItem.isCharged(offHandStack);
68+
if (wasCrossbowChargedOffhand && !isCharged && weaponAnimates) {
69+
triggerShrink(9);
70+
}
71+
wasCrossbowChargedOffhand = isCharged;
72+
} else {
73+
wasCrossbowChargedOffhand = false;
74+
}
75+
});
76+
77+
// tool break animation
78+
ClientPlayerBlockBreakEvents.AFTER.register((world, player, pos, state) -> {
79+
ItemStack stack = player.getMainHandStack();
80+
if (isTool(stack) && toolAnimates) {
81+
int slot = player.getInventory().getSelectedSlot();
82+
triggerShrink(slot);
83+
}
84+
});
85+
}
86+
87+
private void triggerShrink(int slot) {
88+
if (slot >= 0 && slot < 9) {
89+
wasUsed[slot] = true;
90+
slotScales[slot] = nonSelectedItemSize - (shouldItemGrowWhenSelected ? 0.03f : 0.2f);
91+
} else if (slot == 9) {
92+
wasUsed[slot] = true;
93+
slotScales[slot] = nonSelectedItemSize - 0.2f;
94+
}
95+
}
96+
97+
98+
99+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package derp.immersivehotbar;
2+
3+
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
4+
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
5+
6+
public class ImmersiveHotbarDataGenerator implements DataGeneratorEntrypoint {
7+
@Override
8+
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
9+
10+
}
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package derp.immersivehotbar;
2+
3+
public interface InGameHudAnimationHandler {
4+
void immersive_hotbar$triggerSlotAnimation(int slotIndex);
5+
}

0 commit comments

Comments
 (0)