优化部分代码
This commit is contained in:
parent
8766a69a7a
commit
75ca155776
1 changed files with 1 additions and 9 deletions
|
@ -198,8 +198,7 @@ public class GunEventHandler {
|
||||||
String origin = stack.getItem().getDescriptionId();
|
String origin = stack.getItem().getDescriptionId();
|
||||||
String name = origin.substring(origin.lastIndexOf(".") + 1);
|
String name = origin.substring(origin.lastIndexOf(".") + 1);
|
||||||
|
|
||||||
SoundEvent sound1p;
|
SoundEvent sound1p = BuiltInRegistries.SOUND_EVENT.get(Mod.loc(name + "_reload_normal"));
|
||||||
sound1p = BuiltInRegistries.SOUND_EVENT.get(Mod.loc(name + "_reload_normal"));
|
|
||||||
|
|
||||||
if (sound1p != null && player instanceof ServerPlayer serverPlayer) {
|
if (sound1p != null && player instanceof ServerPlayer serverPlayer) {
|
||||||
SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f);
|
SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f);
|
||||||
|
@ -220,13 +219,6 @@ public class GunEventHandler {
|
||||||
reload.iterativeLoadTimer.reduce();
|
reload.iterativeLoadTimer.reduce();
|
||||||
reload.finishTimer.reduce();
|
reload.finishTimer.reduce();
|
||||||
|
|
||||||
// player.displayClientMessage(Component.literal("prepare: " + new DecimalFormat("##.#").format(data.reload.prepareTimer.get())
|
|
||||||
// + " prepare_load: " + new DecimalFormat("##.#").format(data.reload.iterativeLoadTimer.get())
|
|
||||||
// + " iterative: " + new DecimalFormat("##.#").format(tag.getDouble("IterativeLoadTime"))
|
|
||||||
// + " finish: " + new DecimalFormat("##.#").format(tag.getDouble("FinishTime"))
|
|
||||||
// + " reload_stage: " + new DecimalFormat("##.#").format(tag.getDouble("reload_stage"))
|
|
||||||
// ), true);
|
|
||||||
|
|
||||||
// 一阶段
|
// 一阶段
|
||||||
if (reload.singleReloadStarter.start()) {
|
if (reload.singleReloadStarter.start()) {
|
||||||
NeoForge.EVENT_BUS.post(new ReloadEvent.Pre(player, data));
|
NeoForge.EVENT_BUS.post(new ReloadEvent.Pre(player, data));
|
||||||
|
|
Loading…
Add table
Reference in a new issue