规范化部分音效名称

This commit is contained in:
17146 2024-05-10 00:57:02 +08:00
parent 977523ed67
commit 86f6ec2372
17 changed files with 48 additions and 41 deletions

View file

@ -165,9 +165,15 @@ public class GunEventHandler {
player.playSound(sound3p, 4f, 1f); player.playSound(sound3p, 4f, 1f);
} }
SoundEvent soundFar = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(TargetMod.MODID, name + "_far"));
if (soundFar != null) {
player.playSound(soundFar, 12f, 1f);
}
SoundEvent soundVeryFar = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(TargetMod.MODID, name + "_veryfar"));
if (soundVeryFar != null) {
player.playSound(soundVeryFar, 24f, 1f);
}
} }
} }

View file

@ -54,12 +54,12 @@ public class TargetModSounds {
public static final RegistryObject<SoundEvent> ABEKIRI_VERYFAR = REGISTRY.register("abekiri_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_veryfar"))); public static final RegistryObject<SoundEvent> ABEKIRI_VERYFAR = REGISTRY.register("abekiri_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_veryfar")));
public static final RegistryObject<SoundEvent> ABEKIRI_RELOAD_NORMAL = REGISTRY.register("abekiri_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_reload_normal"))); public static final RegistryObject<SoundEvent> ABEKIRI_RELOAD_NORMAL = REGISTRY.register("abekiri_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_reload_normal")));
public static final RegistryObject<SoundEvent> ABEKIRI_RELOAD_EMPTY = REGISTRY.register("abekiri_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_reload_empty"))); public static final RegistryObject<SoundEvent> ABEKIRI_RELOAD_EMPTY = REGISTRY.register("abekiri_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "abekiri_reload_empty")));
public static final RegistryObject<SoundEvent> AK47_FIRE_1P = REGISTRY.register("ak47_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_fire_1p"))); public static final RegistryObject<SoundEvent> AK_47_FIRE_1P = REGISTRY.register("ak_47_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_fire_1p")));
public static final RegistryObject<SoundEvent> AK47_FIRE_3P = REGISTRY.register("ak47_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_fire_3p"))); public static final RegistryObject<SoundEvent> AK_47_FIRE_3P = REGISTRY.register("ak_47_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_fire_3p")));
public static final RegistryObject<SoundEvent> AK47_FAR = REGISTRY.register("ak47_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_far"))); public static final RegistryObject<SoundEvent> AK_47_FAR = REGISTRY.register("ak_47_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_far")));
public static final RegistryObject<SoundEvent> AK47_VERYFAR = REGISTRY.register("ak47_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_veryfar"))); public static final RegistryObject<SoundEvent> AK_47_VERYFAR = REGISTRY.register("ak_47_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_veryfar")));
public static final RegistryObject<SoundEvent> AK47_RELOAD_NORMAL = REGISTRY.register("ak47_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_reload_normal"))); public static final RegistryObject<SoundEvent> AK_47_RELOAD_NORMAL = REGISTRY.register("ak_47_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_reload_normal")));
public static final RegistryObject<SoundEvent> AK47_RELOAD_EMPTY = REGISTRY.register("ak47_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak47_reload_empty"))); public static final RegistryObject<SoundEvent> AK_47_RELOAD_EMPTY = REGISTRY.register("ak_47_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "ak_47_reload_empty")));
public static final RegistryObject<SoundEvent> LAND = REGISTRY.register("land", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "land"))); public static final RegistryObject<SoundEvent> LAND = REGISTRY.register("land", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "land")));
public static final RegistryObject<SoundEvent> SHIFT = REGISTRY.register("shift", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "shift"))); public static final RegistryObject<SoundEvent> SHIFT = REGISTRY.register("shift", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "shift")));
public static final RegistryObject<SoundEvent> HEADSHOT = REGISTRY.register("headshot", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "headshot"))); public static final RegistryObject<SoundEvent> HEADSHOT = REGISTRY.register("headshot", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "headshot")));
@ -96,12 +96,12 @@ public class TargetModSounds {
public static final RegistryObject<SoundEvent> BOCEK_SHATTER_CAP_FIRE_3P = REGISTRY.register("bocek_shatter_cap_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_shatter_cap_fire_3p"))); public static final RegistryObject<SoundEvent> BOCEK_SHATTER_CAP_FIRE_3P = REGISTRY.register("bocek_shatter_cap_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_shatter_cap_fire_3p")));
public static final RegistryObject<SoundEvent> BOCEK_PULL_1P = REGISTRY.register("bocek_pull_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_pull_1p"))); public static final RegistryObject<SoundEvent> BOCEK_PULL_1P = REGISTRY.register("bocek_pull_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_pull_1p")));
public static final RegistryObject<SoundEvent> BOCEK_PULL_3P = REGISTRY.register("bocek_pull_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_pull_3p"))); public static final RegistryObject<SoundEvent> BOCEK_PULL_3P = REGISTRY.register("bocek_pull_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bocek_pull_3p")));
public static final RegistryObject<SoundEvent> HK416_FIRE_1P = REGISTRY.register("hk416_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_fire_1p"))); public static final RegistryObject<SoundEvent> HK_416_FIRE_1P = REGISTRY.register("hk_416_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_fire_1p")));
public static final RegistryObject<SoundEvent> HK416_FIRE_3P = REGISTRY.register("hk416_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_fire_3p"))); public static final RegistryObject<SoundEvent> HK_416_FIRE_3P = REGISTRY.register("hk_416_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_fire_3p")));
public static final RegistryObject<SoundEvent> HK416_FAR = REGISTRY.register("hk416_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_far"))); public static final RegistryObject<SoundEvent> HK_416_FAR = REGISTRY.register("hk_416_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_far")));
public static final RegistryObject<SoundEvent> HK416_VERYFAR = REGISTRY.register("hk416_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_veryfar"))); public static final RegistryObject<SoundEvent> HK_416_VERYFAR = REGISTRY.register("hk_416_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_veryfar")));
public static final RegistryObject<SoundEvent> HK416_RELOAD_NORMAL = REGISTRY.register("hk416_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_reload_normal"))); public static final RegistryObject<SoundEvent> HK_416_RELOAD_NORMAL = REGISTRY.register("hk_416_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_reload_normal")));
public static final RegistryObject<SoundEvent> HK416_RELOAD_EMPTY = REGISTRY.register("hk416_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk416_reload_empty"))); public static final RegistryObject<SoundEvent> HK_416_RELOAD_EMPTY = REGISTRY.register("hk_416_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hk_416_reload_empty")));
public static final RegistryObject<SoundEvent> RPK_FIRE_1P = REGISTRY.register("rpk_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_fire_1p"))); public static final RegistryObject<SoundEvent> RPK_FIRE_1P = REGISTRY.register("rpk_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_fire_1p")));
public static final RegistryObject<SoundEvent> RPK_FIRE_3P = REGISTRY.register("rpk_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_fire_3p"))); public static final RegistryObject<SoundEvent> RPK_FIRE_3P = REGISTRY.register("rpk_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_fire_3p")));
public static final RegistryObject<SoundEvent> RPK_FAR = REGISTRY.register("rpk_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_far"))); public static final RegistryObject<SoundEvent> RPK_FAR = REGISTRY.register("rpk_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "rpk_far")));

View file

@ -2,6 +2,7 @@ package net.mcreator.target.item.gun;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import net.mcreator.target.TargetMod;
import net.mcreator.target.client.renderer.item.M4ItemRenderer; import net.mcreator.target.client.renderer.item.M4ItemRenderer;
import net.mcreator.target.init.TargetModItems; import net.mcreator.target.init.TargetModItems;
import net.mcreator.target.item.AnimatedItem; import net.mcreator.target.item.AnimatedItem;
@ -150,7 +151,7 @@ public class M4Item extends GunItem implements GeoItem, AnimatedItem {
if (slot == EquipmentSlot.MAINHAND) { if (slot == EquipmentSlot.MAINHAND) {
map = HashMultimap.create(map); map = HashMultimap.create(map);
map.put(Attributes.MOVEMENT_SPEED, map.put(Attributes.MOVEMENT_SPEED,
new AttributeModifier(uuid, "henghengaaa", -0.04f, AttributeModifier.Operation.MULTIPLY_BASE)); new AttributeModifier(uuid, TargetMod.ATTRIBUTE_MODIFIER, -0.04f, AttributeModifier.Operation.MULTIPLY_BASE));
} }
return map; return map;
} }

View file

@ -23,7 +23,7 @@ public class M4WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure {
{ {
if (!entity.level().isClientSide() && entity.getServer() != null) { if (!entity.level().isClientSide() && entity.getServer() != null) {
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4, entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "playsound target:m4_reload_empty player @s ~ ~ ~ 100 1"); entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "playsound target:m_4_reload_empty player @s ~ ~ ~ 100 1");
} }
} }
entity.getPersistentData().putDouble("id", id); entity.getPersistentData().putDouble("id", id);
@ -46,7 +46,7 @@ public class M4WuPinZaiBeiBaoZhongShiMeiKeFaShengProcedure {
{ {
if (!entity.level().isClientSide() && entity.getServer() != null) { if (!entity.level().isClientSide() && entity.getServer() != null) {
entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4, entity.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, entity.position(), entity.getRotationVector(), entity.level() instanceof ServerLevel ? (ServerLevel) entity.level() : null, 4,
entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "playsound target:m4_reload_normal player @s ~ ~ ~ 100 1"); entity.getName().getString(), entity.getDisplayName(), entity.level().getServer(), entity), "playsound target:m_4_reload_normal player @s ~ ~ ~ 100 1");
} }
} }
entity.getPersistentData().putDouble("id", id); entity.getPersistentData().putDouble("id", id);

View file

@ -245,50 +245,50 @@
] ]
}, },
"ak47_fire_1p": { "ak_47_fire_1p": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_fire_1p", "name": "target:ak_47/ak_47_fire_1p",
"stream": false "stream": false
} }
] ]
}, },
"ak47_fire_3p": { "ak_47_fire_3p": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_fire_3p", "name": "target:ak_47/ak_47_fire_3p",
"stream": false "stream": false
} }
] ]
}, },
"ak47_far": { "ak_47_far": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_far", "name": "target:ak_47/ak_47_far",
"stream": false "stream": false
} }
] ]
}, },
"ak47_veryfar": { "ak_47_veryfar": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_veryfar", "name": "target:ak_47/ak_47_veryfar",
"stream": false "stream": false
} }
] ]
}, },
"ak47_reload_normal": { "ak_47_reload_normal": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_reload_normal", "name": "target:ak_47/ak_47_reload_normal",
"stream": false "stream": false
} }
] ]
}, },
"ak47_reload_empty": { "ak_47_reload_empty": {
"sounds": [ "sounds": [
{ {
"name": "target:ak47/ak47_reload_empty", "name": "target:ak_47/ak_47_reload_empty",
"stream": false "stream": false
} }
] ]
@ -531,50 +531,50 @@
] ]
}, },
"hk416_fire_1p": { "hk_416_fire_1p": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_fire_1p", "name": "target:hk_416/hk_416_fire_1p",
"stream": false "stream": false
} }
] ]
}, },
"hk416_fire_3p": { "hk_416_fire_3p": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_fire_3p", "name": "target:hk_416/hk_416_fire_3p",
"stream": false "stream": false
} }
] ]
}, },
"hk416_far": { "hk_416_far": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_far", "name": "target:hk_416/hk_416_far",
"stream": false "stream": false
} }
] ]
}, },
"hk416_veryfar": { "hk_416_veryfar": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_veryfar", "name": "target:hk_416/hk_416_veryfar",
"stream": false "stream": false
} }
] ]
}, },
"hk416_reload_normal": { "hk_416_reload_normal": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_reload_normal", "name": "target:hk_416/hk_416_reload_normal",
"stream": false "stream": false
} }
] ]
}, },
"hk416_reload_empty": { "hk_416_reload_empty": {
"sounds": [ "sounds": [
{ {
"name": "target:hk416/hk416_reload_empty", "name": "target:hk_416/hk_416_reload_empty",
"stream": false "stream": false
} }
] ]