暂时禁用bocek的部分动画逻辑
This commit is contained in:
parent
a710b6b807
commit
47ea1b967a
1 changed files with 8 additions and 5 deletions
|
@ -13,7 +13,6 @@ import com.atsuishio.superbwarfare.network.message.receive.ShootClientMessage;
|
||||||
import com.atsuishio.superbwarfare.perk.AmmoPerk;
|
import com.atsuishio.superbwarfare.perk.AmmoPerk;
|
||||||
import com.atsuishio.superbwarfare.perk.Perk;
|
import com.atsuishio.superbwarfare.perk.Perk;
|
||||||
import com.atsuishio.superbwarfare.tools.GunsTool;
|
import com.atsuishio.superbwarfare.tools.GunsTool;
|
||||||
import com.atsuishio.superbwarfare.tools.InventoryTool;
|
|
||||||
import com.atsuishio.superbwarfare.tools.SoundTool;
|
import com.atsuishio.superbwarfare.tools.SoundTool;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.player.LocalPlayer;
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
@ -104,7 +103,10 @@ public class BocekItem extends GunItem implements GeoItem {
|
||||||
|
|
||||||
var data = GunData.from(stack);
|
var data = GunData.from(stack);
|
||||||
|
|
||||||
if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0 && data.ammo.get() == 0 && (data.countBackupAmmo(player) > 0 || InventoryTool.hasCreativeAmmoBox(player))) {
|
// TODO 调整成正常的判断逻辑
|
||||||
|
if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0 && data.ammo.get() == 0
|
||||||
|
// && (data.countBackupAmmo(player) > 0 || InventoryTool.hasCreativeAmmoBox(player))
|
||||||
|
) {
|
||||||
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.bocek.reload"));
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.bocek.reload"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,11 +133,12 @@ public class BocekItem extends GunItem implements GeoItem {
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
|
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
|
||||||
super.inventoryTick(stack, world, entity, slot, selected);
|
super.inventoryTick(stack, world, entity, slot, selected);
|
||||||
var data = GunData.from(stack);
|
|
||||||
|
|
||||||
if (entity instanceof Player player) {
|
if (entity instanceof Player player) {
|
||||||
if (GunsTool.getGunIntTag(data.tag, "ArrowEmpty") > 0) {
|
var data = GunData.from(stack);
|
||||||
GunsTool.setGunIntTag(data.tag, "ArrowEmpty", GunsTool.getGunIntTag(data.tag, "ArrowEmpty") - 1);
|
|
||||||
|
if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0) {
|
||||||
|
GunsTool.setGunIntTag(data.tag, "ArrowEmpty", GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GunsTool.getGunIntTag(data.tag, "ArrowEmpty") == 0 && data.ammo.get() == 0 && data.hasBackupAmmo(player)) {
|
if (GunsTool.getGunIntTag(data.tag, "ArrowEmpty") == 0 && data.ammo.get() == 0 && data.hasBackupAmmo(player)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue