清理部分tag

This commit is contained in:
Atsuihsio 2024-12-30 14:35:12 +08:00
parent a95d7f19ea
commit 970420d94b
22 changed files with 94 additions and 40 deletions

View file

@ -1,4 +1,4 @@
// 1.20.1 2024-12-30T13:49:03.1510086 Tags for minecraft:item mod id superbwarfare // 1.20.1 2024-12-30T14:34:41.442112 Tags for minecraft:item mod id superbwarfare
cf8d49a8d2872286d1a9c3d4a7e1c2b7690db0b8 data/forge/tags/items/dusts.json cf8d49a8d2872286d1a9c3d4a7e1c2b7690db0b8 data/forge/tags/items/dusts.json
0fa06c2ff83bf09797e3ddff90f62d1124e645b4 data/forge/tags/items/dusts/coal_coke.json 0fa06c2ff83bf09797e3ddff90f62d1124e645b4 data/forge/tags/items/dusts/coal_coke.json
295ddf906b7133a0558d03e9a60eea18281fe430 data/forge/tags/items/dusts/iron.json 295ddf906b7133a0558d03e9a60eea18281fe430 data/forge/tags/items/dusts/iron.json
@ -26,7 +26,6 @@ af6fd64b4a685c353f243763db268f7b2304c009 data/forge/tags/items/storage_blocks/le
30d1daa7590f7364b5bc2dc777a00caf2f5eecb0 data/forge/tags/items/storage_blocks/silver.json 30d1daa7590f7364b5bc2dc777a00caf2f5eecb0 data/forge/tags/items/storage_blocks/silver.json
3743c2790deca7e779d3e4b82f092de39b446988 data/forge/tags/items/storage_blocks/steel.json 3743c2790deca7e779d3e4b82f092de39b446988 data/forge/tags/items/storage_blocks/steel.json
144e54d908121dee498b2ebba3b24b09fd6f18d9 data/forge/tags/items/storage_blocks/tungsten.json 144e54d908121dee498b2ebba3b24b09fd6f18d9 data/forge/tags/items/storage_blocks/tungsten.json
4d4dfd25a2a749e000e1bb742c2f984d4e094e5d data/superbwarfare/tags/items/cannot_reload.json
cedce5ff7bbc95b40cbfced0f03a3da712118049 data/superbwarfare/tags/items/can_apply_barrel.json cedce5ff7bbc95b40cbfced0f03a3da712118049 data/superbwarfare/tags/items/can_apply_barrel.json
4b0864ba4b2bb2ca3b30bdc2fefe3077f5020466 data/superbwarfare/tags/items/can_apply_grip.json 4b0864ba4b2bb2ca3b30bdc2fefe3077f5020466 data/superbwarfare/tags/items/can_apply_grip.json
41a5f975239ec6e000229dfc212b9d886496cccc data/superbwarfare/tags/items/can_apply_magazine.json 41a5f975239ec6e000229dfc212b9d886496cccc data/superbwarfare/tags/items/can_apply_magazine.json
@ -36,7 +35,6 @@ cedce5ff7bbc95b40cbfced0f03a3da712118049 data/superbwarfare/tags/items/can_custo
52598e22974c8da0d2852defe4c9005e1d67744b data/superbwarfare/tags/items/gun.json 52598e22974c8da0d2852defe4c9005e1d67744b data/superbwarfare/tags/items/gun.json
62eb408544731ce4cfcd119d8a6cc74731189ac0 data/superbwarfare/tags/items/handgun.json 62eb408544731ce4cfcd119d8a6cc74731189ac0 data/superbwarfare/tags/items/handgun.json
49fbb8c030fdfafec1f291acc1cdff406c777c7e data/superbwarfare/tags/items/has_shell_effect.json 49fbb8c030fdfafec1f291acc1cdff406c777c7e data/superbwarfare/tags/items/has_shell_effect.json
dae3f86663e841d336efff9d23d8910aa7247be5 data/superbwarfare/tags/items/is_auto_weapon.json
68ec25b0ccd68abbbe2f33ab7097572c2140c9da data/superbwarfare/tags/items/launcher.json 68ec25b0ccd68abbbe2f33ab7097572c2140c9da data/superbwarfare/tags/items/launcher.json
b404c6fd99d2ca68c6738f225cb7d68ee443c10a data/superbwarfare/tags/items/machine_gun.json b404c6fd99d2ca68c6738f225cb7d68ee443c10a data/superbwarfare/tags/items/machine_gun.json
a53020091752016da6602ee1b8b7e08823614344 data/superbwarfare/tags/items/military_armor.json a53020091752016da6602ee1b8b7e08823614344 data/superbwarfare/tags/items/military_armor.json

View file

@ -1,6 +0,0 @@
{
"values": [
"superbwarfare:minigun",
"superbwarfare:bocek"
]
}

View file

@ -1,20 +0,0 @@
{
"values": [
"superbwarfare:aa_12",
"superbwarfare:ak_47",
"superbwarfare:ak_12",
"superbwarfare:hk_416",
"superbwarfare:aa_12",
"superbwarfare:m_4",
"superbwarfare:qbz_95",
"superbwarfare:mk_14",
"superbwarfare:aa_12",
"superbwarfare:glock_18",
"superbwarfare:vector",
"superbwarfare:aa_12",
"superbwarfare:minigun",
"superbwarfare:devotion",
"superbwarfare:m_60",
"superbwarfare:rpk"
]
}

View file

@ -7,6 +7,7 @@ import com.atsuishio.superbwarfare.config.client.ReloadConfig;
import com.atsuishio.superbwarfare.entity.*; import com.atsuishio.superbwarfare.entity.*;
import com.atsuishio.superbwarfare.event.ClientEventHandler; import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.gun.GunItem;
import com.atsuishio.superbwarfare.network.ModVariables; import com.atsuishio.superbwarfare.network.ModVariables;
import com.atsuishio.superbwarfare.network.message.*; import com.atsuishio.superbwarfare.network.message.*;
import com.atsuishio.superbwarfare.tools.GunsTool; import com.atsuishio.superbwarfare.tools.GunsTool;
@ -302,7 +303,7 @@ public class ClickHandler {
ClientEventHandler.holdFire = true; ClientEventHandler.holdFire = true;
} }
if (stack.is(ModTags.Items.GUN) && !(player.getVehicle() != null && player.getVehicle() instanceof ICannonEntity)) { if (stack.getItem() instanceof GunItem gunItem && !(player.getVehicle() != null && player.getVehicle() instanceof ICannonEntity)) {
if ((!(stack.getOrCreateTag().getBoolean("is_normal_reloading") || stack.getOrCreateTag().getBoolean("is_empty_reloading")) if ((!(stack.getOrCreateTag().getBoolean("is_normal_reloading") || stack.getOrCreateTag().getBoolean("is_empty_reloading"))
&& !stack.getOrCreateTag().getBoolean("reloading") && !stack.getOrCreateTag().getBoolean("reloading")
&& !stack.getOrCreateTag().getBoolean("charging") && !stack.getOrCreateTag().getBoolean("charging")
@ -313,7 +314,7 @@ public class ClickHandler {
player.playSound(ModSounds.TRIGGER_CLICK.get(), 1, 1); player.playSound(ModSounds.TRIGGER_CLICK.get(), 1, 1);
} }
if (!stack.is(ModTags.Items.CANNOT_RELOAD) && GunsTool.getGunIntTag(stack, "Ammo", 0) <= 0 && stack.getOrCreateTag().getInt("ReloadTime") == 0) { if (!gunItem.useBackpackAmmo(stack) && gunItem.getAmmoCount(stack) <= 0 && stack.getOrCreateTag().getInt("ReloadTime") == 0) {
if (ReloadConfig.LEFT_CLICK_RELOAD.get()) { if (ReloadConfig.LEFT_CLICK_RELOAD.get()) {
ModUtils.PACKET_HANDLER.sendToServer(new ReloadMessage(0)); ModUtils.PACKET_HANDLER.sendToServer(new ReloadMessage(0));
} }

View file

@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.client.tooltip.component.GunImageComponent;
import com.atsuishio.superbwarfare.init.ModKeyMappings; import com.atsuishio.superbwarfare.init.ModKeyMappings;
import com.atsuishio.superbwarfare.init.ModPerks; import com.atsuishio.superbwarfare.init.ModPerks;
import com.atsuishio.superbwarfare.init.ModTags; import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.GunItem;
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.perk.PerkHelper; import com.atsuishio.superbwarfare.perk.PerkHelper;
@ -29,11 +30,16 @@ public class ClientGunImageTooltip implements ClientTooltipComponent {
protected final int width; protected final int width;
protected final int height; protected final int height;
protected final ItemStack stack; protected final ItemStack stack;
protected GunItem gunItem = null;
public ClientGunImageTooltip(GunImageComponent tooltip) { public ClientGunImageTooltip(GunImageComponent tooltip) {
this.width = tooltip.width; this.width = tooltip.width;
this.height = tooltip.height; this.height = tooltip.height;
this.stack = tooltip.stack; this.stack = tooltip.stack;
if (this.stack.getItem() instanceof GunItem gunItem1) {
this.gunItem = gunItem1;
}
} }
@Override @Override
@ -100,7 +106,7 @@ public class ClientGunImageTooltip implements ClientTooltipComponent {
* 获取武器射速的文本组件 * 获取武器射速的文本组件
*/ */
protected Component getRpmComponent() { protected Component getRpmComponent() {
if (!stack.is(ModTags.Items.IS_AUTO_WEAPON)) { if (!gunItem.autoWeapon(this.stack)) {
return Component.literal(""); return Component.literal("");
} else { } else {
return Component.translatable("des.superbwarfare.tips.rpm").withStyle(ChatFormatting.GRAY) return Component.translatable("des.superbwarfare.tips.rpm").withStyle(ChatFormatting.GRAY)

View file

@ -98,12 +98,6 @@ public class ModItemTagProvider extends ItemTagsProvider {
this.tag(ModTags.Items.REVOLVER).add(ModItems.TRACHELIUM.get()); this.tag(ModTags.Items.REVOLVER).add(ModItems.TRACHELIUM.get());
this.tag(ModTags.Items.CANNOT_RELOAD).add(ModItems.MINIGUN.get(), ModItems.BOCEK.get());
this.tag(ModTags.Items.IS_AUTO_WEAPON).add(ModItems.AA_12.get(), ModItems.AK_47.get(), ModItems.AK_12.get(), ModItems.HK_416.get(), ModItems.AA_12.get(), ModItems.M_4.get(),
ModItems.QBZ_95.get(), ModItems.MK_14.get(), ModItems.AA_12.get(), ModItems.GLOCK_18.get(), ModItems.VECTOR.get(), ModItems.AA_12.get(), ModItems.MINIGUN.get(),
ModItems.DEVOTION.get(), ModItems.M_60.get(), ModItems.RPK.get());
this.tag(ModTags.Items.HAS_SHELL_EFFECT).add(ModItems.AK_47.get(), ModItems.AK_12.get(), ModItems.SVD.get(), ModItems.M_60.get(), ModItems.MK_14.get(), ModItems.VECTOR.get(), this.tag(ModTags.Items.HAS_SHELL_EFFECT).add(ModItems.AK_47.get(), ModItems.AK_12.get(), ModItems.SVD.get(), ModItems.M_60.get(), ModItems.MK_14.get(), ModItems.VECTOR.get(),
ModItems.SKS.get(), ModItems.RPK.get(), ModItems.HK_416.get(), ModItems.AA_12.get(), ModItems.M_4.get(), ModItems.DEVOTION.get(), ModItems.GLOCK_17.get(), ModItems.SKS.get(), ModItems.RPK.get(), ModItems.HK_416.get(), ModItems.AA_12.get(), ModItems.M_4.get(), ModItems.DEVOTION.get(), ModItems.GLOCK_17.get(),
ModItems.GLOCK_18.get(), ModItems.M_1911.get(), ModItems.QBZ_95.get()); ModItems.GLOCK_18.get(), ModItems.M_1911.get(), ModItems.QBZ_95.get());

View file

@ -28,8 +28,6 @@ public class ModTags {
public static final TagKey<Item> REVOLVER = tag("revolver"); public static final TagKey<Item> REVOLVER = tag("revolver");
public static final TagKey<Item> NORMAL_GUN = tag("normal_gun"); public static final TagKey<Item> NORMAL_GUN = tag("normal_gun");
public static final TagKey<Item> CANNOT_RELOAD = tag("cannot_reload");
public static final TagKey<Item> IS_AUTO_WEAPON = tag("is_auto_weapon");
public static final TagKey<Item> CAN_CUSTOM_GUN = tag("can_custom_gun"); public static final TagKey<Item> CAN_CUSTOM_GUN = tag("can_custom_gun");
public static final TagKey<Item> CAN_APPLY_BARREL = tag("can_apply_barrel"); public static final TagKey<Item> CAN_APPLY_BARREL = tag("can_apply_barrel");

View file

@ -250,6 +250,7 @@ public abstract class GunItem extends Item {
public boolean isIterativeReload(ItemStack stack) { public boolean isIterativeReload(ItemStack stack) {
return false; return false;
} }
public int getAmmoCount(ItemStack stack) { public int getAmmoCount(ItemStack stack) {
return GunsTool.getGunIntTag(stack, "Ammo", 0); return GunsTool.getGunIntTag(stack, "Ammo", 0);
} }
@ -261,4 +262,12 @@ public abstract class GunItem extends Item {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return false; return false;
} }
public boolean autoWeapon(ItemStack stack) {
return false;
}
public boolean useBackpackAmmo(ItemStack stack) {
return false;
}
} }

View file

@ -165,4 +165,9 @@ public class Glock18Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -149,4 +149,9 @@ public class DevotionItem extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -173,4 +173,9 @@ public class M60Item extends GunItem implements GeoItem, AnimatedItem {
public boolean isOpenBolt(ItemStack stack) { public boolean isOpenBolt(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -212,4 +212,14 @@ public class MinigunItem extends GunItem implements GeoItem, AnimatedItem {
case DAMAGE -> perk == ModPerks.MONSTER_HUNTER.get() || perk == ModPerks.KILLING_TALLY.get(); case DAMAGE -> perk == ModPerks.MONSTER_HUNTER.get() || perk == ModPerks.KILLING_TALLY.get();
}; };
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
@Override
public boolean useBackpackAmmo(ItemStack stack) {
return true;
}
} }

View file

@ -150,4 +150,9 @@ public class RpkItem extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -214,4 +214,9 @@ public class AK12Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -228,4 +228,9 @@ public class AK47Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -230,4 +230,9 @@ public class Hk416Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -229,4 +229,9 @@ public class M4Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -228,4 +228,9 @@ public class Mk14Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -231,4 +231,9 @@ public class Qbz95Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -182,4 +182,9 @@ public class Aa12Item extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -204,4 +204,9 @@ public class VectorItem extends GunItem implements GeoItem, AnimatedItem {
public boolean bulletInBarrel(ItemStack stack) { public boolean bulletInBarrel(ItemStack stack) {
return true; return true;
} }
@Override
public boolean autoWeapon(ItemStack stack) {
return true;
}
} }

View file

@ -170,4 +170,8 @@ public class BocekItem extends GunItem implements GeoItem, AnimatedItem {
return Optional.of(new BocekImageComponent(pStack)); return Optional.of(new BocekImageComponent(pStack));
} }
@Override
public boolean useBackpackAmmo(ItemStack stack) {
return true;
}
} }