Skip to content

Commit 617c77d

Browse files
committed
新增技能按键V、B;
按键命名与汉化;
1 parent c9cb109 commit 617c77d

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

src/main/java/xyz/lisbammisakait/RelightTheThreePointStrategyClient.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@
99
import org.lwjgl.glfw.GLFW;
1010

1111
public class RelightTheThreePointStrategyClient implements ClientModInitializer {
12-
private static KeyBinding keyBinding;
12+
private static KeyBinding keyBindingV;
13+
private static KeyBinding keyBindingB;
1314

1415
@Override
1516
public void onInitializeClient() {
16-
System.out.println("Hello, RelightTheThreePointStrategyClient!");
17-
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
18-
"key.examplemod.spook", // The translation key of the keybinding's name
17+
keyBindingV = KeyBindingHelper.registerKeyBinding(new KeyBinding(
18+
"key.RelightTheThreePointStrategy.SkillA", // The translation key of the keybinding's name
1919
InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse.
20-
GLFW.GLFW_KEY_R, // The keycode of the key
21-
"category.examplemod.test" // The translation key of the keybinding's category.
20+
GLFW.GLFW_KEY_V, // The keycode of the key
21+
"category.RelightTheThreePointStrategy.SkillGroup" // The translation key of the keybinding's category.
22+
));
23+
keyBindingB = KeyBindingHelper.registerKeyBinding(new KeyBinding(
24+
"key.RelightTheThreePointStrategy.SkillB", // The translation key of the keybinding's name
25+
InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse.
26+
GLFW.GLFW_KEY_B, // The keycode of the key
27+
"category.RelightTheThreePointStrategy.SkillGroup" // The translation key of the keybinding's category.
2228
));
2329
ClientTickEvents.END_CLIENT_TICK.register(client -> {
24-
while (keyBinding.wasPressed()) {
25-
RelightTheThreePointStrategy.LOGGER.info("Spooky!");
30+
while (keyBindingV.wasPressed()) {
31+
RelightTheThreePointStrategy.LOGGER.info("VVVVVVV!");
2632
}
2733
});
2834
}

src/main/java/xyz/lisbammisakait/item/FeilongduofengItem.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package xyz.lisbammisakait.item;
22

33

4+
import net.minecraft.entity.EquipmentSlot;
5+
import net.minecraft.entity.LivingEntity;
6+
import net.minecraft.item.ItemStack;
47
import net.minecraft.item.SwordItem;
58
import net.minecraft.item.ToolMaterial;
69
import net.minecraft.util.ActionResult;
@@ -26,7 +29,7 @@ public boolean postHit(net.minecraft.item.ItemStack stack, net.minecraft.entity.
2629
double motionX = attacker.getRotationVector().x;
2730
double motionZ = attacker.getRotationVector().z;
2831
// 计算击退强度,这里假设一个简单的强度值
29-
double knockbackStrength = 1;
32+
double knockbackStrength = 1.5;
3033
// 给目标添加击退效果
3134
//target.addVelocity(motionX * knockbackStrength, 0.5, motionZ * knockbackStrength);
3235
target.takeKnockback(knockbackStrength, -motionX, -motionZ);

src/main/java/xyz/lisbammisakait/item/ModItems.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class ModItems {
2323
// }
2424
//注册飞龙夺凤
2525
public static final RegistryKey<Item> FEILONGDUOFENG_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(RelightTheThreePointStrategy.MOD_ID, "feilongduofeng"));
26-
public static final Item FEILONGDUOFENG = register(new FeilongduofengItem(ToolMaterial.GOLD, 1f, 1f, new Item.Settings().registryKey(FEILONGDUOFENG_KEY)), FEILONGDUOFENG_KEY);
26+
public static final Item FEILONGDUOFENG = register(new FeilongduofengItem(ToolMaterial.GOLD, 4f, 1f, new Item.Settings().registryKey(FEILONGDUOFENG_KEY)), FEILONGDUOFENG_KEY);
2727
//注册虎头湛金枪
2828
public static final RegistryKey<Item> HUTOUZHANJINQIANG_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(RelightTheThreePointStrategy.MOD_ID, "hutouzhanjinqiang"));
29-
public static final Item HUTOUZHANJINQIANG = register(new HutouzhanjinqiangItem(ToolMaterial.GOLD, 1f, 1f, new Item.Settings().registryKey(HUTOUZHANJINQIANG_KEY)), HUTOUZHANJINQIANG_KEY);
29+
public static final Item HUTOUZHANJINQIANG = register(new HutouzhanjinqiangItem(ToolMaterial.GOLD, 6f, 1f, new Item.Settings().registryKey(HUTOUZHANJINQIANG_KEY)), HUTOUZHANJINQIANG_KEY);
3030

3131
public static Item register(Item item, RegistryKey<Item> registryKey) {
3232
// Register the item.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"item.relight-the-three-point-strategy.feilongduofeng": "feilongduofeng",
33
"item.relight-the-three-point-strategy.hutouzhanjinqiang": "hutouzhanjinqiang",
4-
"key.examplemod.spook": "Spook Key",
5-
"category.examplemod.test": "Example Mod Test"
4+
"key.RelightTheThreePointStrategy.SkillA": "SkillA",
5+
"key.RelightTheThreePointStrategy.SkillB": "SkillB",
6+
"category.RelightTheThreePointStrategy.SkillGroup": "Skill Group"
67
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"item.relight-the-three-point-strategy.feilongduofeng": "飞龙夺凤",
3-
"item.relight-the-three-point-strategy.hutouzhanjinqiang": "虎头湛金枪"
3+
"item.relight-the-three-point-strategy.hutouzhanjinqiang": "虎头湛金枪",
4+
"key.RelightTheThreePointStrategy.SkillA": "技能A",
5+
"key.RelightTheThreePointStrategy.SkillB": "技能B",
6+
"category.RelightTheThreePointStrategy.SkillGroup": "技能组"
47
}

0 commit comments

Comments
 (0)