简化弹药合成配方,移除弹丸,添加底火材料,新增怪物猎人附魔
This commit is contained in:
parent
d0ecd7349a
commit
be44e01cba
37 changed files with 165 additions and 70 deletions
|
@ -0,0 +1,30 @@
|
||||||
|
|
||||||
|
package net.mcreator.target.enchantment;
|
||||||
|
|
||||||
|
import net.mcreator.target.init.TargetModItems;
|
||||||
|
import net.mcreator.target.tools.EnchantmentCategoryTool;
|
||||||
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
|
|
||||||
|
public class MonsterHunterEnchantment extends Enchantment {
|
||||||
|
public MonsterHunterEnchantment(EquipmentSlot... slots) {
|
||||||
|
super(Rarity.UNCOMMON, EnchantmentCategoryTool.GUN, slots);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMinCost(int pLevel) {
|
||||||
|
return 8 + 6 * pLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxCost(int pLevel) {
|
||||||
|
return super.getMaxCost(pLevel) + 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxLevel() {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ import net.minecraft.world.effect.MobEffects;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.monster.Monster;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.ClipContext;
|
import net.minecraft.world.level.ClipContext;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -54,6 +55,7 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
protected int shooterId;
|
protected int shooterId;
|
||||||
private float damage = 1f;
|
private float damage = 1f;
|
||||||
private float headShot = 1f;
|
private float headShot = 1f;
|
||||||
|
private int monster_multiple = 1;
|
||||||
private float legShot = 0.5f;
|
private float legShot = 0.5f;
|
||||||
private boolean beast = false;
|
private boolean beast = false;
|
||||||
|
|
||||||
|
@ -84,6 +86,11 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectileEntity monster_multiple(int monster_multiple) {
|
||||||
|
this.monster_multiple = monster_multiple;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ProjectileEntity legShot(float legShot) {
|
public ProjectileEntity legShot(float legShot) {
|
||||||
this.legShot = legShot;
|
this.legShot = legShot;
|
||||||
return this;
|
return this;
|
||||||
|
@ -318,6 +325,8 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onHitEntity(Entity entity, boolean headshot, boolean legshot) {
|
protected void onHitEntity(Entity entity, boolean headshot, boolean legshot) {
|
||||||
|
float m_multiple = (1 + 0.4f * this.monster_multiple);
|
||||||
|
|
||||||
if (entity == null) return;
|
if (entity == null) return;
|
||||||
|
|
||||||
if (entity instanceof PartEntity<?> part) {
|
if (entity instanceof PartEntity<?> part) {
|
||||||
|
@ -363,7 +372,11 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
|
|
||||||
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(1, 5));
|
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(1, 5));
|
||||||
}
|
}
|
||||||
entity.hurt(TargetModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.headShot);
|
if (entity instanceof Monster monster) {
|
||||||
|
monster.hurt(TargetModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.headShot * m_multiple);
|
||||||
|
} else {
|
||||||
|
entity.hurt(TargetModDamageTypes.causeGunFireHeadshotDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.headShot);
|
||||||
|
}
|
||||||
} else if (legshot) {
|
} else if (legshot) {
|
||||||
if (!this.shooter.level().isClientSide() && this.shooter instanceof ServerPlayer player) {
|
if (!this.shooter.level().isClientSide() && this.shooter instanceof ServerPlayer player) {
|
||||||
var holder = Holder.direct(TargetModSounds.INDICATION.get());
|
var holder = Holder.direct(TargetModSounds.INDICATION.get());
|
||||||
|
@ -371,7 +384,13 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
|
|
||||||
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
|
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
|
||||||
}
|
}
|
||||||
entity.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.legShot);
|
|
||||||
|
if (entity instanceof Monster monster) {
|
||||||
|
monster.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.legShot * m_multiple);
|
||||||
|
} else {
|
||||||
|
entity.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.legShot);
|
||||||
|
}
|
||||||
|
|
||||||
if (entity instanceof LivingEntity living) {
|
if (entity instanceof LivingEntity living) {
|
||||||
if (living instanceof Player player && player.isCreative()){
|
if (living instanceof Player player && player.isCreative()){
|
||||||
return;
|
return;
|
||||||
|
@ -388,7 +407,12 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
|
|
||||||
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
|
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
|
||||||
}
|
}
|
||||||
entity.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage);
|
|
||||||
|
if (entity instanceof Monster monster) {
|
||||||
|
monster.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage * m_multiple);
|
||||||
|
} else {
|
||||||
|
entity.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,7 @@ package net.mcreator.target.event;
|
||||||
|
|
||||||
import net.mcreator.target.TargetMod;
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.entity.ProjectileEntity;
|
import net.mcreator.target.entity.ProjectileEntity;
|
||||||
import net.mcreator.target.init.TargetModAttributes;
|
import net.mcreator.target.init.*;
|
||||||
import net.mcreator.target.init.TargetModItems;
|
|
||||||
import net.mcreator.target.init.TargetModSounds;
|
|
||||||
import net.mcreator.target.init.TargetModTags;
|
|
||||||
import net.mcreator.target.network.TargetModVariables;
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
import net.mcreator.target.tools.ParticleTool;
|
import net.mcreator.target.tools.ParticleTool;
|
||||||
import net.mcreator.target.tools.SoundTool;
|
import net.mcreator.target.tools.SoundTool;
|
||||||
|
@ -18,6 +15,7 @@ import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||||
import net.minecraftforge.event.TickEvent;
|
import net.minecraftforge.event.TickEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
@ -319,6 +317,7 @@ public class GunEventHandler {
|
||||||
|
|
||||||
if (!player.level().isClientSide()) {
|
if (!player.level().isClientSide()) {
|
||||||
float headshot = (float) heldItem.getOrCreateTag().getDouble("headshot");
|
float headshot = (float) heldItem.getOrCreateTag().getDouble("headshot");
|
||||||
|
int monster_multiple = EnchantmentHelper.getTagEnchantmentLevel(TargetModEnchantments.MONSTER_HUNTER.get(), heldItem);
|
||||||
float damage = (float) (heldItem.getOrCreateTag().getDouble("damage") + heldItem.getOrCreateTag().getDouble("add_damage")) * (float) heldItem.getOrCreateTag().getDouble("damageadd");
|
float damage = (float) (heldItem.getOrCreateTag().getDouble("damage") + heldItem.getOrCreateTag().getDouble("add_damage")) * (float) heldItem.getOrCreateTag().getDouble("damageadd");
|
||||||
|
|
||||||
ProjectileEntity projectile = new ProjectileEntity(player.level())
|
ProjectileEntity projectile = new ProjectileEntity(player.level())
|
||||||
|
@ -330,6 +329,8 @@ public class GunEventHandler {
|
||||||
projectile.beast();
|
projectile.beast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
projectile.monster_multiple(monster_multiple);
|
||||||
|
|
||||||
projectile.setPos(player.getX() - 0.1 * player.getLookAngle().x, player.getEyeY() - 0.1 - 0.1 * player.getLookAngle().y, player.getZ() + -0.1 * player.getLookAngle().z);
|
projectile.setPos(player.getX() - 0.1 * player.getLookAngle().x, player.getEyeY() - 0.1 - 0.1 * player.getLookAngle().y, player.getZ() + -0.1 * player.getLookAngle().z);
|
||||||
projectile.shoot(player.getLookAngle().x, player.getLookAngle().y + 0.0005f , player.getLookAngle().z, 1 * (float) heldItem.getOrCreateTag().getDouble("velocity"),
|
projectile.shoot(player.getLookAngle().x, player.getLookAngle().y + 0.0005f , player.getLookAngle().z, 1 * (float) heldItem.getOrCreateTag().getDouble("velocity"),
|
||||||
(float) player.getAttributeBaseValue(TargetModAttributes.SPREAD.get()));
|
(float) player.getAttributeBaseValue(TargetModAttributes.SPREAD.get()));
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
package net.mcreator.target.init;
|
package net.mcreator.target.init;
|
||||||
|
|
||||||
import net.mcreator.target.enchantment.LongerWireEnchantment;
|
import net.mcreator.target.enchantment.LongerWireEnchantment;
|
||||||
|
import net.mcreator.target.enchantment.MonsterHunterEnchantment;
|
||||||
import net.minecraftforge.registries.RegistryObject;
|
import net.minecraftforge.registries.RegistryObject;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
|
@ -17,4 +18,5 @@ public class TargetModEnchantments {
|
||||||
public static final RegistryObject<Enchantment> VOLT_OVERLOAD = REGISTRY.register("volt_overload", () -> new VoltOverloadEnchantment());
|
public static final RegistryObject<Enchantment> VOLT_OVERLOAD = REGISTRY.register("volt_overload", () -> new VoltOverloadEnchantment());
|
||||||
public static final RegistryObject<Enchantment> SUPER_RECHARGE = REGISTRY.register("super_recharge", () -> new SuperRechargeEnchantment());
|
public static final RegistryObject<Enchantment> SUPER_RECHARGE = REGISTRY.register("super_recharge", () -> new SuperRechargeEnchantment());
|
||||||
public static final RegistryObject<Enchantment> LONGER_WIRE = REGISTRY.register("longer_wire", () -> new LongerWireEnchantment());
|
public static final RegistryObject<Enchantment> LONGER_WIRE = REGISTRY.register("longer_wire", () -> new LongerWireEnchantment());
|
||||||
|
public static final RegistryObject<Enchantment> MONSTER_HUNTER = REGISTRY.register("monster_hunter", () -> new MonsterHunterEnchantment());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package net.mcreator.target.init;
|
||||||
|
|
||||||
import net.mcreator.target.TargetMod;
|
import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.item.*;
|
import net.mcreator.target.item.*;
|
||||||
import net.mcreator.target.item.common.Buckshot;
|
|
||||||
import net.mcreator.target.item.common.ammo.*;
|
import net.mcreator.target.item.common.ammo.*;
|
||||||
import net.mcreator.target.item.common.blueprint.*;
|
import net.mcreator.target.item.common.blueprint.*;
|
||||||
import net.mcreator.target.item.common.material.*;
|
import net.mcreator.target.item.common.material.*;
|
||||||
|
@ -88,6 +87,7 @@ public class TargetModItems {
|
||||||
public static final RegistryObject<Item> MORTAR_BASE_PLATE = ITEMS.register("mortar_base_plate", MortarBasePlate::new);
|
public static final RegistryObject<Item> MORTAR_BASE_PLATE = ITEMS.register("mortar_base_plate", MortarBasePlate::new);
|
||||||
public static final RegistryObject<Item> MORTAR_BIPOD = ITEMS.register("mortar_bipod", MortarBipod::new);
|
public static final RegistryObject<Item> MORTAR_BIPOD = ITEMS.register("mortar_bipod", MortarBipod::new);
|
||||||
public static final RegistryObject<Item> FUSEE = ITEMS.register("fusee", Fusee::new);
|
public static final RegistryObject<Item> FUSEE = ITEMS.register("fusee", Fusee::new);
|
||||||
|
public static final RegistryObject<Item> PRIMER = ITEMS.register("primer", Primer::new);
|
||||||
public static final RegistryObject<Item> SOUL_STEEL_NUGGET = ITEMS.register("soul_steel_nugget", SoulSteelNugget::new);
|
public static final RegistryObject<Item> SOUL_STEEL_NUGGET = ITEMS.register("soul_steel_nugget", SoulSteelNugget::new);
|
||||||
public static final RegistryObject<Item> COPPERPLATE = ITEMS.register("copperplate", Copperplate::new);
|
public static final RegistryObject<Item> COPPERPLATE = ITEMS.register("copperplate", Copperplate::new);
|
||||||
public static final RegistryObject<Item> INGOT_STEEL = ITEMS.register("ingot_steel", IngotSteel::new);
|
public static final RegistryObject<Item> INGOT_STEEL = ITEMS.register("ingot_steel", IngotSteel::new);
|
||||||
|
@ -106,7 +106,6 @@ public class TargetModItems {
|
||||||
public static final RegistryObject<Item> DEEPSLATE_SCHEELITE_ORE = block(TargetModBlocks.DEEPSLATE_SCHEELITE_ORE);
|
public static final RegistryObject<Item> DEEPSLATE_SCHEELITE_ORE = block(TargetModBlocks.DEEPSLATE_SCHEELITE_ORE);
|
||||||
public static final RegistryObject<Item> GALENA = ITEMS.register("galena", Galena::new);
|
public static final RegistryObject<Item> GALENA = ITEMS.register("galena", Galena::new);
|
||||||
public static final RegistryObject<Item> SCHEELITE = ITEMS.register("scheelite", Scheelite::new);
|
public static final RegistryObject<Item> SCHEELITE = ITEMS.register("scheelite", Scheelite::new);
|
||||||
public static final RegistryObject<Item> BUCKSHOT = ITEMS.register("buckshot", Buckshot::new);
|
|
||||||
public static final RegistryObject<Item> DOG_TAG = ITEMS.register("dog_tag", DogTag::new);
|
public static final RegistryObject<Item> DOG_TAG = ITEMS.register("dog_tag", DogTag::new);
|
||||||
|
|
||||||
public static final RegistryObject<Item> IRON_BARREL = ITEMS.register("iron_barrel", IronBarrel::new);
|
public static final RegistryObject<Item> IRON_BARREL = ITEMS.register("iron_barrel", IronBarrel::new);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class HandgunAmmo extends AmmoSupplierItem {
|
public class HandgunAmmo extends AmmoSupplierItem {
|
||||||
public HandgunAmmo() {
|
public HandgunAmmo() {
|
||||||
super(GunInfo.Type.HANDGUN, 10, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.HANDGUN, 5, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class HandgunAmmoBox extends AmmoSupplierItem {
|
public class HandgunAmmoBox extends AmmoSupplierItem {
|
||||||
public HandgunAmmoBox() {
|
public HandgunAmmoBox() {
|
||||||
super(GunInfo.Type.HANDGUN, 60, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.HANDGUN, 30, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class RifleAmmo extends AmmoSupplierItem {
|
public class RifleAmmo extends AmmoSupplierItem {
|
||||||
public RifleAmmo() {
|
public RifleAmmo() {
|
||||||
super(GunInfo.Type.RIFLE, 10, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.RIFLE, 5, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class RifleAmmoBox extends AmmoSupplierItem {
|
public class RifleAmmoBox extends AmmoSupplierItem {
|
||||||
public RifleAmmoBox() {
|
public RifleAmmoBox() {
|
||||||
super(GunInfo.Type.RIFLE, 60, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.RIFLE, 30, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class ShotgunAmmo extends AmmoSupplierItem {
|
public class ShotgunAmmo extends AmmoSupplierItem {
|
||||||
public ShotgunAmmo() {
|
public ShotgunAmmo() {
|
||||||
super(GunInfo.Type.SHOTGUN, 4, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.SHOTGUN, 2, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class ShotgunAmmoBox extends AmmoSupplierItem {
|
public class ShotgunAmmoBox extends AmmoSupplierItem {
|
||||||
public ShotgunAmmoBox() {
|
public ShotgunAmmoBox() {
|
||||||
super(GunInfo.Type.SHOTGUN, 24, new Item.Properties().stacksTo(8).rarity(Rarity.COMMON));
|
super(GunInfo.Type.SHOTGUN, 12, new Item.Properties().stacksTo(8).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class SniperAmmo extends AmmoSupplierItem {
|
public class SniperAmmo extends AmmoSupplierItem {
|
||||||
public SniperAmmo() {
|
public SniperAmmo() {
|
||||||
super(GunInfo.Type.SNIPER, 4, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.SNIPER, 2, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class SniperAmmoBox extends AmmoSupplierItem {
|
public class SniperAmmoBox extends AmmoSupplierItem {
|
||||||
public SniperAmmoBox() {
|
public SniperAmmoBox() {
|
||||||
super(GunInfo.Type.SNIPER, 24, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(GunInfo.Type.SNIPER, 12, new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package net.mcreator.target.item;
|
package net.mcreator.target.item.common.material;
|
||||||
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.mcreator.target.item;
|
package net.mcreator.target.item.common.material;
|
||||||
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.mcreator.target.item;
|
package net.mcreator.target.item.common.material;
|
||||||
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.mcreator.target.item.common;
|
package net.mcreator.target.item.common.material;
|
||||||
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
@ -9,9 +9,9 @@ import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Buckshot extends Item {
|
public class Primer extends Item {
|
||||||
public Buckshot() {
|
public Primer() {
|
||||||
super(new Item.Properties().stacksTo(64).rarity(Rarity.COMMON));
|
super(new Properties().stacksTo(64).rarity(Rarity.COMMON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -1,4 +1,4 @@
|
||||||
package net.mcreator.target.item;
|
package net.mcreator.target.item.common.material;
|
||||||
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
|
@ -4,6 +4,7 @@ import net.mcreator.target.TargetMod;
|
||||||
import net.mcreator.target.init.TargetModItems;
|
import net.mcreator.target.init.TargetModItems;
|
||||||
import net.mcreator.target.init.TargetModTags;
|
import net.mcreator.target.init.TargetModTags;
|
||||||
import net.mcreator.target.network.TargetModVariables;
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
|
import net.mcreator.target.tools.EnchantmentCategoryTool;
|
||||||
import net.mcreator.target.tools.GunsTool;
|
import net.mcreator.target.tools.GunsTool;
|
||||||
import net.mcreator.target.tools.ItemNBTTool;
|
import net.mcreator.target.tools.ItemNBTTool;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -15,6 +16,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||||
|
@ -114,4 +116,19 @@ public abstract class GunItem extends Item {
|
||||||
event.getItem().getItem().getOrCreateTag().putBoolean("draw", true);
|
event.getItem().getItem().getOrCreateTag().putBoolean("draw", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEnchantmentValue(ItemStack stack) {
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnchantable(ItemStack stack) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) {
|
||||||
|
return enchantment.category == EnchantmentCategoryTool.GUN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package net.mcreator.target.tools;
|
package net.mcreator.target.tools;
|
||||||
|
|
||||||
|
import net.mcreator.target.item.gun.GunItem;
|
||||||
import net.mcreator.target.item.gun.Taser;
|
import net.mcreator.target.item.gun.Taser;
|
||||||
import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
||||||
|
|
||||||
public class EnchantmentCategoryTool {
|
public class EnchantmentCategoryTool {
|
||||||
public static final EnchantmentCategory TASER = EnchantmentCategory.create("target:taser", item -> item instanceof Taser);
|
public static final EnchantmentCategory TASER = EnchantmentCategory.create("target:taser", item -> item instanceof Taser);
|
||||||
|
|
||||||
|
public static final EnchantmentCategory GUN = EnchantmentCategory.create("target:gun", item -> item instanceof GunItem && !(item instanceof Taser));
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,7 @@
|
||||||
"item.target.mortar_deployer": "Mortar",
|
"item.target.mortar_deployer": "Mortar",
|
||||||
"item.target.claymore_mine": "Claymore",
|
"item.target.claymore_mine": "Claymore",
|
||||||
"item.target.fusee": "Fusee",
|
"item.target.fusee": "Fusee",
|
||||||
|
"item.target.primer": "Primer",
|
||||||
"item.target.dog_tag": "Dog Tag",
|
"item.target.dog_tag": "Dog Tag",
|
||||||
"curios.identifier.dog_tag": "Dog Tag",
|
"curios.identifier.dog_tag": "Dog Tag",
|
||||||
|
|
||||||
|
@ -205,6 +206,8 @@
|
||||||
"enchantment.target.super_recharge.desc": "Increases the recharge speed of TaserGun",
|
"enchantment.target.super_recharge.desc": "Increases the recharge speed of TaserGun",
|
||||||
"enchantment.target.longer_wire": "Longer Wire",
|
"enchantment.target.longer_wire": "Longer Wire",
|
||||||
"enchantment.target.longer_wire.desc": "Increases the range of TaserGun",
|
"enchantment.target.longer_wire.desc": "Increases the range of TaserGun",
|
||||||
|
"enchantment.target.monster_hunter": "Monster Hunter",
|
||||||
|
"enchantment.target.monster_hunter.desc": "Increases bullet damage against monsters",
|
||||||
|
|
||||||
"des.target.sensitivity": "Current Sensitivity of This Gun: %1$s",
|
"des.target.sensitivity": "Current Sensitivity of This Gun: %1$s",
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@
|
||||||
"item.target.mortar_deployer": "迫击炮",
|
"item.target.mortar_deployer": "迫击炮",
|
||||||
"item.target.claymore_mine": "阔剑地雷",
|
"item.target.claymore_mine": "阔剑地雷",
|
||||||
"item.target.fusee": "引信",
|
"item.target.fusee": "引信",
|
||||||
|
"item.target.primer": "底火",
|
||||||
"item.target.dog_tag": "狗牌",
|
"item.target.dog_tag": "狗牌",
|
||||||
"curios.identifier.dog_tag": "狗牌",
|
"curios.identifier.dog_tag": "狗牌",
|
||||||
|
|
||||||
|
@ -205,6 +206,8 @@
|
||||||
"enchantment.target.super_recharge.desc": "增加泰瑟枪充能的速度",
|
"enchantment.target.super_recharge.desc": "增加泰瑟枪充能的速度",
|
||||||
"enchantment.target.longer_wire": "延长导线",
|
"enchantment.target.longer_wire": "延长导线",
|
||||||
"enchantment.target.longer_wire.desc": "增加泰瑟枪的射程",
|
"enchantment.target.longer_wire.desc": "增加泰瑟枪的射程",
|
||||||
|
"enchantment.target.monster_hunter": "怪物猎人",
|
||||||
|
"enchantment.target.monster_hunter.desc": "增加对怪物的子弹伤害",
|
||||||
|
|
||||||
"des.target.sensitivity": "当前枪械的灵敏度为:%1$s",
|
"des.target.sensitivity": "当前枪械的灵敏度为:%1$s",
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "target:item/buckshot"
|
"layer0": "target:item/primer"
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 495 B |
BIN
src/main/resources/assets/target/textures/item/primer.png
Normal file
BIN
src/main/resources/assets/target/textures/item/primer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 229 B |
|
@ -14,6 +14,6 @@
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:barbed_wire",
|
"item": "target:barbed_wire",
|
||||||
"count": 1
|
"count": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"type": "minecraft:crafting_shapeless",
|
|
||||||
"category": "misc",
|
|
||||||
"ingredients": [
|
|
||||||
{
|
|
||||||
"tag": "forge:ingots/lead"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tag": "forge:ingots/lead"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"result": {
|
|
||||||
"item": "target:buckshot",
|
|
||||||
"count": 2
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,7 +4,7 @@
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" a ",
|
" a ",
|
||||||
"bcb",
|
"bcb",
|
||||||
" d "
|
"d d"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
|
@ -17,11 +17,11 @@
|
||||||
"item": "minecraft:tnt"
|
"item": "minecraft:tnt"
|
||||||
},
|
},
|
||||||
"d": {
|
"d": {
|
||||||
"item": "minecraft:iron_bars"
|
"item": "minecraft:stick"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:claymore_mine",
|
"item": "target:claymore_mine",
|
||||||
"count": 1
|
"count": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,6 +19,6 @@
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:fusee",
|
"item": "target:fusee",
|
||||||
"count": 1
|
"count": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,27 +1,27 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:crafting_shaped",
|
"type": "minecraft:crafting_shaped",
|
||||||
"category": "equipment",
|
"category": "misc",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" a ",
|
" a ",
|
||||||
"bcb",
|
"bcb",
|
||||||
"bdb"
|
" d "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
"item": "target:fusee"
|
"item": "target:fusee"
|
||||||
},
|
},
|
||||||
"b": {
|
"b": {
|
||||||
"item": "minecraft:iron_nugget"
|
"item": "minecraft:iron_ingot"
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
"item": "minecraft:tnt"
|
"item": "minecraft:tnt"
|
||||||
},
|
},
|
||||||
"d": {
|
"d": {
|
||||||
"item": "minecraft:copper_ingot"
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:grenade_40mm",
|
"item": "target:grenade_40mm",
|
||||||
"count": 1
|
"count": 6
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,8 @@
|
||||||
"category": "misc",
|
"category": "misc",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" a ",
|
" a ",
|
||||||
"bcb"
|
"bcb",
|
||||||
|
" d "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
|
@ -14,10 +15,13 @@
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
"item": "minecraft:gunpowder"
|
"item": "minecraft:gunpowder"
|
||||||
|
},
|
||||||
|
"d": {
|
||||||
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:handgun_ammo",
|
"item": "target:handgun_ammo",
|
||||||
"count": 6
|
"count": 8
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,11 +17,11 @@
|
||||||
"item": "minecraft:tnt"
|
"item": "minecraft:tnt"
|
||||||
},
|
},
|
||||||
"d": {
|
"d": {
|
||||||
"item": "minecraft:gunpowder"
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:mortar_shells",
|
"item": "target:mortar_shells",
|
||||||
"count": 2
|
"count": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
20
src/main/resources/data/target/recipes/primer_crafting.json
Normal file
20
src/main/resources/data/target/recipes/primer_crafting.json
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"pattern": [
|
||||||
|
"b",
|
||||||
|
"a"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"a": {
|
||||||
|
"tag": "forge:plates/copper"
|
||||||
|
},
|
||||||
|
"b": {
|
||||||
|
"item": "minecraft:flint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "target:primer",
|
||||||
|
"count": 4
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" a ",
|
" a ",
|
||||||
"bcb",
|
"bcb",
|
||||||
"bcb"
|
" d "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
|
@ -15,6 +15,9 @@
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
"item": "minecraft:gunpowder"
|
"item": "minecraft:gunpowder"
|
||||||
|
},
|
||||||
|
"d": {
|
||||||
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:rocket",
|
"item": "target:rocket",
|
||||||
"count": 1
|
"count": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,26 +2,26 @@
|
||||||
"type": "minecraft:crafting_shaped",
|
"type": "minecraft:crafting_shaped",
|
||||||
"category": "misc",
|
"category": "misc",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" b ",
|
" a ",
|
||||||
"aba",
|
"bcb",
|
||||||
"cdc"
|
" d "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
"item": "minecraft:paper"
|
"tag": "forge:ingots/lead"
|
||||||
},
|
},
|
||||||
"b": {
|
"b": {
|
||||||
"item": "target:buckshot"
|
|
||||||
},
|
|
||||||
"c": {
|
|
||||||
"tag": "forge:plates/copper"
|
"tag": "forge:plates/copper"
|
||||||
},
|
},
|
||||||
"d": {
|
"c": {
|
||||||
"item": "minecraft:gunpowder"
|
"item": "minecraft:gunpowder"
|
||||||
|
},
|
||||||
|
"d": {
|
||||||
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:shotgun_ammo",
|
"item": "target:shotgun_ammo",
|
||||||
"count": 6
|
"count": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"pattern": [
|
"pattern": [
|
||||||
" a ",
|
" a ",
|
||||||
"bcb",
|
"bcb",
|
||||||
"bcb"
|
" d "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"a": {
|
"a": {
|
||||||
|
@ -15,10 +15,13 @@
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
"item": "minecraft:gunpowder"
|
"item": "minecraft:gunpowder"
|
||||||
|
},
|
||||||
|
"d": {
|
||||||
|
"item": "target:primer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "target:sniper_ammo",
|
"item": "target:sniper_ammo",
|
||||||
"count": 6
|
"count": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue