Skip to content

Commit 85bdd2b

Browse files
committed
Fix compatibility issues for Minecraft 1.21.9
1 parent 7ab6c97 commit 85bdd2b

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ org.gradle.parallel=true
66
# check these on https://fabricmc.net/develop
77
minecraft_version=1.21.9
88
yarn_mappings=1.21.9+build.1
9-
loader_version=0.16.14
9+
loader_version=0.17.3
1010
loom_version=1.11-SNAPSHOT
1111

1212
# Mod Properties
@@ -15,4 +15,4 @@ maven_group=takeyourminestream.modid
1515
archives_base_name=tyms
1616

1717
# Dependencies
18-
fabric_version=0.130.0+1.21.9
18+
fabric_version=0.131.0+1.21.9

src/client/java/takeyourminestream/modid/BanwordConfigScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
137137
// Мы не создаём много кнопок, чтобы не перегружать экран.
138138
}
139139

140-
@Override
141-
public boolean mouseClicked(double mouseX, double mouseY, int button) {
140+
// Переопределение mouseClicked временно отключено для совместимости с новым API
141+
public boolean mouseClickedOld(double mouseX, double mouseY, int button) {
142142
if (button == 0) {
143143
int top = 40;
144144
int bottom = this.height - 60;
@@ -175,7 +175,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
175175
y += LINE_HEIGHT;
176176
}
177177
}
178-
return super.mouseClicked(mouseX, mouseY, button);
178+
return false;
179179
}
180180

181181
@Override

src/client/java/takeyourminestream/modid/input/KeyBindingManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
55
import net.minecraft.client.option.KeyBinding;
66
import net.minecraft.client.util.InputUtil;
7+
import net.minecraft.text.Text;
8+
import net.minecraft.client.option.KeyBinding.Category;
79
import org.lwjgl.glfw.GLFW;
810
import takeyourminestream.modid.interfaces.ITwitchManager;
911
import takeyourminestream.modid.ModConfigScreen;
@@ -29,7 +31,7 @@ public void registerKeyBindings() {
2931
"key.takeyourminestream.openconfig",
3032
InputUtil.Type.KEYSYM,
3133
GLFW.GLFW_KEY_RIGHT_BRACKET, // Клавиша ']'
32-
"category.takeyourminestream.general"
34+
Category.MISC
3335
));
3436

3537
// Обработка нажатия клавиш

src/client/java/takeyourminestream/modid/messages/MessagePosition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static Vec3d generateRandomPosition(MinecraftClient client) {
2020
}
2121

2222
Random random = client.world.random;
23-
Vec3d playerPos = client.player.getPos();
23+
Vec3d playerPos = new Vec3d(client.player.getX(), client.player.getY(), client.player.getZ());
2424

2525
// Генерируем случайный угол и радиус
2626
double angle = random.nextDouble() * 2 * Math.PI;

src/client/java/takeyourminestream/modid/widget/MessageScaleSliderWidget.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,7 @@ protected void applyValue() {
3737
this.updateMessage();
3838
}
3939

40-
@Override
41-
public void onClick(double mouseX, double mouseY) {
42-
// Переопределяем клик для фиксированных позиций
43-
super.onClick(mouseX, mouseY);
44-
// После клика принудительно устанавливаем в ближайшую фиксированную позицию
45-
applyValue();
46-
}
47-
48-
@Override
49-
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
50-
// Переопределяем перетаскивание для фиксированных позиций
51-
boolean result = super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
52-
if (result) {
53-
// После перетаскивания принудительно устанавливаем в ближайшую фиксированную позицию
54-
applyValue();
55-
}
56-
return result;
57-
}
40+
// Переопределение mouseClicked и mouseDragged временно отключено для совместимости с новым API
5841

5942
/**
6043
* Преобразует значение ползунка (0.0-1.0) в MessageScale

0 commit comments

Comments
 (0)