将部分附魔修改为perk,移除冗余文本
This commit is contained in:
parent
8a729db826
commit
f55d171b7f
5 changed files with 13 additions and 25 deletions
|
@ -25,7 +25,6 @@ import net.minecraft.world.entity.LivingEntity;
|
|||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.projectile.Projectile;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
|
@ -41,7 +40,7 @@ public class LivingEventHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
handleGunEnchantmentsWhenHurt(event);
|
||||
handleGunPerksWhenHurt(event);
|
||||
renderDamageIndicator(event);
|
||||
reduceBulletDamage(event, event.getSource(), event.getEntity(), event.getSource().getEntity(), event.getAmount());
|
||||
}
|
||||
|
@ -255,7 +254,7 @@ public class LivingEventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private static void handleGunEnchantmentsWhenHurt(LivingHurtEvent event) {
|
||||
private static void handleGunPerksWhenHurt(LivingHurtEvent event) {
|
||||
DamageSource source = event.getSource();
|
||||
|
||||
Player attacker = null;
|
||||
|
@ -288,7 +287,7 @@ public class LivingEventHandler {
|
|||
}
|
||||
|
||||
if (source.getDirectEntity() instanceof ProjectileEntity projectile) {
|
||||
if (EnchantmentHelper.getTagEnchantmentLevel(ModEnchantments.FOURTH_TIMES_CHARM.get(), stack) > 0) {
|
||||
if (PerkHelper.getItemPerkLevel(ModPerks.FOURTH_TIMES_CHARM.get(), stack) > 0) {
|
||||
float bypassArmorRate = projectile.getBypassArmorRate();
|
||||
if (bypassArmorRate >= 1.0f && source.is(ModDamageTypes.GUN_FIRE_HEADSHOT_ABSOLUTE)) {
|
||||
handleFourthTimesCharm(stack);
|
||||
|
@ -382,7 +381,7 @@ public class LivingEventHandler {
|
|||
}
|
||||
|
||||
private static void handleFourthTimesCharm(ItemStack stack) {
|
||||
int level = EnchantmentHelper.getTagEnchantmentLevel(ModEnchantments.FOURTH_TIMES_CHARM.get(), stack);
|
||||
int level = PerkHelper.getItemPerkLevel(ModPerks.FOURTH_TIMES_CHARM.get(), stack);
|
||||
if (level == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,5 +15,4 @@ public class ModEnchantments {
|
|||
public static final RegistryObject<Enchantment> SUPER_RECHARGE = REGISTRY.register("super_recharge", SuperRecharge::new);
|
||||
public static final RegistryObject<Enchantment> LONGER_WIRE = REGISTRY.register("longer_wire", LongerWire::new);
|
||||
public static final RegistryObject<Enchantment> MONSTER_HUNTER = REGISTRY.register("monster_hunter", MonsterHunter::new);
|
||||
public static final RegistryObject<Enchantment> FOURTH_TIMES_CHARM = REGISTRY.register("fourth_times_charm", FourthTimesCharm::new);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package net.mcreator.superbwarfare.item.gun;
|
||||
|
||||
import net.mcreator.superbwarfare.ModUtils;
|
||||
import net.mcreator.superbwarfare.init.ModEnchantments;
|
||||
import net.mcreator.superbwarfare.init.ModItems;
|
||||
import net.mcreator.superbwarfare.init.ModPerks;
|
||||
import net.mcreator.superbwarfare.init.ModTags;
|
||||
import net.mcreator.superbwarfare.network.ModVariables;
|
||||
import net.mcreator.superbwarfare.perk.Perk;
|
||||
import net.mcreator.superbwarfare.perk.PerkHelper;
|
||||
import net.mcreator.superbwarfare.tools.EnchantmentCategoryTool;
|
||||
import net.mcreator.superbwarfare.tools.GunsTool;
|
||||
import net.mcreator.superbwarfare.tools.ItemNBTTool;
|
||||
|
@ -21,7 +22,6 @@ import net.minecraft.world.item.Item;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
|
@ -90,7 +90,7 @@ public abstract class GunItem extends Item {
|
|||
itemstack.getOrCreateTag().putDouble("flash_time", (itemstack.getOrCreateTag().getDouble("flash_time") - 1));
|
||||
}
|
||||
|
||||
handleEnchantments(itemstack);
|
||||
handleGunPerks(itemstack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ public abstract class GunItem extends Item {
|
|||
return enchantment.category == EnchantmentCategoryTool.GUN;
|
||||
}
|
||||
|
||||
private void handleEnchantments(ItemStack stack) {
|
||||
private void handleGunPerks(ItemStack stack) {
|
||||
if (stack.getOrCreateTag().getInt("HealClipTime") > 0) {
|
||||
stack.getOrCreateTag().putInt("HealClipTime", Math.max(0, stack.getOrCreateTag().getInt("HealClipTime") - 1));
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public abstract class GunItem extends Item {
|
|||
Math.max(0, stack.getOrCreateTag().getInt("FourthTimesCharmTick") - 1));
|
||||
}
|
||||
|
||||
if (EnchantmentHelper.getTagEnchantmentLevel(ModEnchantments.FOURTH_TIMES_CHARM.get(), stack) > 0) {
|
||||
if (PerkHelper.getItemPerkLevel(ModPerks.FOURTH_TIMES_CHARM.get(), stack) > 0) {
|
||||
int count = stack.getOrCreateTag().getInt("FourthTimesCharmCount");
|
||||
if (count >= 4) {
|
||||
stack.getOrCreateTag().putInt("FourthTimesCharmTick", 0);
|
||||
|
|
|
@ -171,8 +171,6 @@
|
|||
"item.superbwarfare.ingot_steel": "Steel Ingot",
|
||||
"item.superbwarfare.tungsten_ingot": "Tungsten Ingot",
|
||||
"item.superbwarfare.cemented_carbide_ingot": "Cemented Carbide Ingot",
|
||||
"item.superbwarfare.soul_steel_ingot": "Soul Steel Ingot",
|
||||
"item.superbwarfare.soul_steel_nugget": "Soul Steel Nugget",
|
||||
"item.superbwarfare.galena": "Raw Galena",
|
||||
"item.superbwarfare.scheelite": "Raw Galena",
|
||||
|
||||
|
@ -184,6 +182,8 @@
|
|||
"des.superbwarfare.killing_tally": "Kill increases the weapon's damage until it is stowed or reloaded",
|
||||
"item.superbwarfare.gutshot_straight": "Gutshot Straight",
|
||||
"des.superbwarfare.gutshot_straight": "Aiming down sights increases body shot damage",
|
||||
"item.superbwarfare.fourth_times_charm": "Fourth Time's The Charm",
|
||||
"des.superbwarfare.fourth_times_charm": "Rapidly landing precision hits will return two rounds to the magazine",
|
||||
|
||||
"perk.superbwarfare.tips": "[Perks]",
|
||||
"perk.superbwarfare.slot": "Type: ",
|
||||
|
@ -217,10 +217,7 @@
|
|||
"death.attack.cannon_fire.entity": "%1$s was cracked by %2$s",
|
||||
"death.attack.cannon_fire.item": "%1$s was cracked by %2$s using %3$s",
|
||||
|
||||
"gui.superbwarfare.gun_recycle_gui.tooltip_if_guns_level_10you_will_get": "If gun\u0027s level \u003e 10,you will get soul nuggets",
|
||||
"gui.superbwarfare.gun_recycle_gui.button_dismantle": "Dismantle",
|
||||
"gui.superbwarfare.mortar_gui.button_set": "Confirm",
|
||||
"gui.superbwarfare.gun_recycle_gui.label_gun_recycle": "Gun Dismantle",
|
||||
|
||||
"entity.superbwarfare.projectile": "Bullet",
|
||||
"entity.superbwarfare.projectile_frag": "Frag",
|
||||
|
@ -273,8 +270,6 @@
|
|||
"enchantment.superbwarfare.longer_wire.desc": "Increases the range of TaserGun",
|
||||
"enchantment.superbwarfare.monster_hunter": "Monster Hunter",
|
||||
"enchantment.superbwarfare.monster_hunter.desc": "Increases bullet damage against monsters",
|
||||
"enchantment.superbwarfare.fourth_times_charm": "Fourth Time's The Charm",
|
||||
"enchantment.superbwarfare.fourth_times_charm.desc": "Rapidly landing precision hits will return two rounds to the magazine",
|
||||
|
||||
"des.superbwarfare.sensitivity": "Current Sensitivity of This Gun: %1$s",
|
||||
"des.superbwarfare.need_bolt_action": "[ Need Bolt Action ]",
|
||||
|
|
|
@ -171,8 +171,6 @@
|
|||
"item.superbwarfare.ingot_steel": "钢锭",
|
||||
"item.superbwarfare.tungsten_ingot": "钨锭",
|
||||
"item.superbwarfare.cemented_carbide_ingot": "硬质合金锭",
|
||||
"item.superbwarfare.soul_steel_ingot": "魂钢锭",
|
||||
"item.superbwarfare.soul_steel_nugget": "魂钢粒",
|
||||
"item.superbwarfare.galena": "粗方铅矿",
|
||||
"item.superbwarfare.scheelite": "白钨矿",
|
||||
|
||||
|
@ -184,6 +182,8 @@
|
|||
"des.superbwarfare.killing_tally": "完成击杀可提高此武器的伤害,效果持续至切换或填装武器",
|
||||
"item.superbwarfare.gutshot_straight": "直击要害",
|
||||
"des.superbwarfare.gutshot_straight": "瞄准时增加身体射击伤害",
|
||||
"item.superbwarfare.fourth_times_charm": "事不过四",
|
||||
"des.superbwarfare.fourth_times_charm": "快速精准命中目标会向弹匣中返还两枚弹药",
|
||||
|
||||
"perk.superbwarfare.tips": "[武器模组]",
|
||||
"perk.superbwarfare.slot": "类型: ",
|
||||
|
@ -217,10 +217,7 @@
|
|||
"death.attack.cannon_fire.entity": "%1$s被%2$s用炮弹打得四分五裂",
|
||||
"death.attack.cannon_fire.item": "%1$s被%2$s用%3$s打得四分五裂",
|
||||
|
||||
"gui.superbwarfare.gun_recycle_gui.tooltip_if_guns_level_10you_will_get": "如果枪械熟练度大于10级,你将会获得魂钢粒",
|
||||
"gui.superbwarfare.gun_recycle_gui.button_dismantle": "拆解",
|
||||
"gui.superbwarfare.mortar_gui.button_set": "确认",
|
||||
"gui.superbwarfare.gun_recycle_gui.label_gun_recycle": "枪械拆解",
|
||||
|
||||
"entity.superbwarfare.projectile": "子弹",
|
||||
"entity.superbwarfare.projectile_frag": "破片",
|
||||
|
@ -273,8 +270,6 @@
|
|||
"enchantment.superbwarfare.longer_wire.desc": "增加泰瑟枪的射程",
|
||||
"enchantment.superbwarfare.monster_hunter": "怪物猎人",
|
||||
"enchantment.superbwarfare.monster_hunter.desc": "增加对怪物的子弹伤害",
|
||||
"enchantment.superbwarfare.fourth_times_charm": "事不过四",
|
||||
"enchantment.superbwarfare.fourth_times_charm.desc": "快速精准命中目标会向弹匣中返还两枚弹药",
|
||||
|
||||
"des.superbwarfare.sensitivity": "当前枪械的灵敏度为:%1$s",
|
||||
"des.superbwarfare.need_bolt_action": "【需要拉栓】",
|
||||
|
|
Loading…
Add table
Reference in a new issue