移除玩家冲刺procedure

This commit is contained in:
17146 2024-05-07 22:11:48 +08:00
parent ee83b49df9
commit fb0831c6db
26 changed files with 64 additions and 83 deletions

View file

@ -2,6 +2,6 @@
"_fv": 57,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"40\" y=\"40\"><field name=\"trigger\">player_ticks</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"math_binary_ops\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"item_nbt_num_get\"><value name=\"item\"><block type=\"entity_iteminhand\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">fireanim</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">unspringtable</field></block></value><value name=\"tagValue\"><block type=\"math_number\"><field name=\"NUM\">20</field></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"entity_issneaking\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"entity_isriding\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value></block></value><value name=\"B\"><block type=\"entity_isinwater\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value></block></value><value name=\"B\"><block type=\"logic_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_logic\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" is_player_var=\"true\" has_entity=\"true\"></mutation><field name=\"VAR\">global:zooming</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">unspringtable</field></block></value><value name=\"tagValue\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"math_binary_ops\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"entity_nbt_num_get\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">unspringtable</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">unspringtable</field></block></value><value name=\"tagValue\"><block type=\"math_dual_ops\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"entity_nbt_num_get\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">unspringtable</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_logic\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" is_player_var=\"true\" has_entity=\"true\"></mutation><field name=\"VAR\">global:zooming</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_set_sprinting\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"boolean\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></xml>"
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"40\" y=\"40\"><field name=\"trigger\">player_ticks</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"math_binary_ops\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"item_nbt_num_get\"><value name=\"item\"><block type=\"entity_iteminhand\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">fireanim</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">noRun</field></block></value><value name=\"tagValue\"><block type=\"math_number\"><field name=\"NUM\">20</field></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_binary_ops\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"entity_issneaking\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"entity_isriding\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value></block></value><value name=\"B\"><block type=\"entity_isinwater\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value></block></value><value name=\"B\"><block type=\"logic_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_logic\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" is_player_var=\"true\" has_entity=\"true\"></mutation><field name=\"VAR\">global:zooming</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">noRun</field></block></value><value name=\"tagValue\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"math_binary_ops\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"entity_nbt_num_get\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">noRun</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_nbt_num_set\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">noRun</field></block></value><value name=\"tagValue\"><block type=\"math_dual_ops\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"entity_nbt_num_get\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"tagName\"><block type=\"text\"><field name=\"TEXT\">noRun</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></statement><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_logic\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" is_player_var=\"true\" has_entity=\"true\"></mutation><field name=\"VAR\">global:zooming</field><value name=\"entity\"><block type=\"entity_from_deps\"></block></value></block></value><value name=\"B\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_set_sprinting\"><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"boolean\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></xml>"
}
}

View file

@ -3,6 +3,7 @@ package net.mcreator.target.event;
import net.mcreator.target.init.TargetModTags;
import net.mcreator.target.network.TargetModVariables;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
@ -42,6 +43,12 @@ public class PlayerEventHandler {
}
if (event.phase == TickEvent.Phase.END) {
handlePlayerProne(player);
handlePlayerSprint(player);
}
}
private static void handlePlayerProne(Player player) {
Level level = player.level();
if (player.getBbHeight() <= 1) {
@ -64,5 +71,22 @@ public class PlayerEventHandler {
capability.syncPlayerVariables(player);
});
}
private static void handlePlayerSprint(Player player) {
if (player.getMainHandItem().getOrCreateTag().getDouble("fireanim") > 0) {
player.getPersistentData().putDouble("noRun", 20);
}
if (player.isShiftKeyDown() || player.isPassenger() || player.isInWater() || (player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
player.getPersistentData().putDouble("noRun", 1);
}
if (player.getPersistentData().getDouble("noRun") > 0) {
player.getPersistentData().putDouble("noRun", (player.getPersistentData().getDouble("noRun") - 1));
}
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
player.setSprinting(false);
}
}
}

View file

@ -96,7 +96,7 @@ public class AK47Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak47.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.ak47.run"));
}

View file

@ -102,7 +102,7 @@ public class Aa12Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aa12.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.aa12.run"));
}

View file

@ -90,7 +90,7 @@ public class Abekiri extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ab.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.ab.run"));
}

View file

@ -89,7 +89,7 @@ public class Devotion extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.devotion.reload2"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.devotion.run"));
}

View file

@ -96,7 +96,7 @@ public class Hk416Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m4.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m4.run"));
}

View file

@ -84,7 +84,7 @@ public class HuntingRifle extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.hunting_rifle.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.hunting_rifle.run"));
}
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.hunting_rifle.idle"));

View file

@ -96,7 +96,7 @@ public class Kraber extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.kraber.reload2"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.kraber.run"));
}

View file

@ -96,7 +96,7 @@ public class M4Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m4.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m4.run"));
}

View file

@ -101,7 +101,7 @@ public class M60Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m60.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m60.run"));
}

View file

@ -85,7 +85,7 @@ public class M79Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m79.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m79.run"));
}

View file

@ -104,7 +104,7 @@ public class M870Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m870.finish"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m870.run"));
}

View file

@ -92,7 +92,7 @@ public class M98bItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.m98b.reload2"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.m98b.run"));
}

View file

@ -111,7 +111,7 @@ public class MarlinItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.marlin.finish"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.marlin.run"));
}

View file

@ -115,7 +115,7 @@ public class Minigun extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.minigun.draw"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.minigun.run"));
}
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.minigun.idle"));

View file

@ -97,7 +97,7 @@ public class Mk14Item extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.model.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.model.run"));
}

View file

@ -86,7 +86,7 @@ public class RpgItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.rpg.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.rpg.run"));
}

View file

@ -97,7 +97,7 @@ public class RpkItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak47.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.ak47.run"));
}

View file

@ -125,7 +125,7 @@ public class SentinelItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.sentinel.charge"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.sentinel.run"));
}

View file

@ -88,7 +88,7 @@ public class SksItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.sks.reload2"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.sks.run"));
}

View file

@ -89,7 +89,7 @@ public class SvdItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.svd.reload2"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.svd.run"));
}

View file

@ -87,7 +87,7 @@ public class Taser extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.taser.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.taser.run"));
}

View file

@ -89,7 +89,7 @@ public class Trachelium extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.trachelium.reload"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.trachelium.run"));
}

View file

@ -101,7 +101,7 @@ public class VectorItem extends GunItem implements GeoItem {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.vec.changefirerate"));
}
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("unspringtable") == 0) {
if (player.isSprinting() && player.onGround() && player.getPersistentData().getDouble("noRun") == 0) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.vec.run"));
}

View file

@ -1,43 +0,0 @@
package net.mcreator.target.procedures;
import net.mcreator.target.network.TargetModVariables;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import javax.annotation.Nullable;
@Mod.EventBusSubscriber
public class UnsprintableProcedure {
@SubscribeEvent
public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
execute(event, event.player);
}
}
public static void execute(Entity entity) {
execute(null, entity);
}
private static void execute(@Nullable Event event, Entity entity) {
if (entity == null)
return;
if ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getOrCreateTag().getDouble("fireanim") > 0) {
entity.getPersistentData().putDouble("unspringtable", 20);
}
if (entity.isShiftKeyDown() || entity.isPassenger() || entity.isInWater() || (entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
entity.getPersistentData().putDouble("unspringtable", 1);
}
if (entity.getPersistentData().getDouble("unspringtable") > 0) {
entity.getPersistentData().putDouble("unspringtable", (entity.getPersistentData().getDouble("unspringtable") - 1));
}
if ((entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
entity.setSprinting(false);
}
}
}