注册otto
This commit is contained in:
parent
c1886d7da5
commit
1d4ad3fcdd
9 changed files with 2179 additions and 92 deletions
|
@ -25,13 +25,11 @@ import com.atsuishio.superbwarfare.item.gun.smg.VectorItem;
|
|||
import com.atsuishio.superbwarfare.item.gun.sniper.*;
|
||||
import com.atsuishio.superbwarfare.item.gun.special.BocekItem;
|
||||
import com.atsuishio.superbwarfare.item.gun.special.TaserItem;
|
||||
import com.atsuishio.superbwarfare.tiers.ModItemTier;
|
||||
import com.atsuishio.superbwarfare.tools.Ammo;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ProjectileItem;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
|
@ -144,8 +142,9 @@ public class ModItems {
|
|||
public static final DeferredHolder<Item, Detonator> DETONATOR = ITEMS.register("detonator", Detonator::new);
|
||||
public static final DeferredHolder<Item, TargetDeployer> TARGET_DEPLOYER = ITEMS.register("target_deployer", TargetDeployer::new);
|
||||
public static final DeferredHolder<Item, DPSGeneratorDeployer> DPS_GENERATOR_DEPLOYER = ITEMS.register("dps_generator_deployer", DPSGeneratorDeployer::new);
|
||||
public static final DeferredHolder<Item, Knife> KNIFE = ITEMS.register("knife", Knife::new);
|
||||
public static final DeferredHolder<Item, Item> KNIFE = ITEMS.register("knife", () -> new SwordItem(ModItemTier.STEEL, new Item.Properties().attributes(SwordItem.createAttributes(ModItemTier.STEEL, 0, -1.8f))));
|
||||
public static final DeferredHolder<Item, Hammer> HAMMER = ITEMS.register("hammer", Hammer::new);
|
||||
public static final DeferredHolder<Item, ElectricBaton> ELECTRIC_BATON = ITEMS.register("electric_baton", ElectricBaton::new);
|
||||
public static final DeferredHolder<Item, Crowbar> CROWBAR = ITEMS.register("crowbar", Crowbar::new);
|
||||
public static final DeferredHolder<Item, Defuser> DEFUSER = ITEMS.register("defuser", Defuser::new);
|
||||
public static final DeferredHolder<Item, ArmorPlate> ARMOR_PLATE = ITEMS.register("armor_plate", ArmorPlate::new);
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.atsuishio.superbwarfare.item;
|
||||
|
||||
import com.atsuishio.superbwarfare.tiers.ModItemTier;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
|
||||
public class ElectricBaton extends SwordItem implements EnergyStorageItem {
|
||||
public ElectricBaton() {
|
||||
super(ModItemTier.STEEL, new Properties()
|
||||
.durability(1114)
|
||||
.attributes(SwordItem.createAttributes(ModItemTier.STEEL, 3, -2.5f))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergy() {
|
||||
return 6000;
|
||||
}
|
||||
}
|
|
@ -1,14 +1,10 @@
|
|||
package com.atsuishio.superbwarfare.item;
|
||||
|
||||
import com.atsuishio.superbwarfare.init.ModItems;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
|
||||
|
@ -17,39 +13,11 @@ import org.jetbrains.annotations.NotNull;
|
|||
@EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME)
|
||||
public class Hammer extends SwordItem {
|
||||
|
||||
public static final Tier TIER = new Tier() {
|
||||
public int getUses() {
|
||||
return 400;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return 4f;
|
||||
}
|
||||
|
||||
public float getAttackDamageBonus() {
|
||||
return 8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull TagKey<Block> getIncorrectBlocksForDrops() {
|
||||
return BlockTags.INCORRECT_FOR_IRON_TOOL;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
public @NotNull Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(Items.IRON_INGOT));
|
||||
}
|
||||
};
|
||||
|
||||
public Hammer() {
|
||||
super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -3.2f)).stacksTo(1));
|
||||
super(Tiers.IRON, new Item.Properties()
|
||||
.durability(400)
|
||||
.attributes(SwordItem.createAttributes(Tiers.IRON, 9, -3.2f))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
package com.atsuishio.superbwarfare.item;
|
||||
|
||||
import com.atsuishio.superbwarfare.init.ModItems;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Knife extends SwordItem {
|
||||
|
||||
private static final Tier TIER = new Tier() {
|
||||
public int getUses() {
|
||||
return 1500;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return 7f;
|
||||
}
|
||||
|
||||
public float getAttackDamageBonus() {
|
||||
return 2.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull TagKey<Block> getIncorrectBlocksForDrops() {
|
||||
return BlockTags.INCORRECT_FOR_IRON_TOOL;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public @NotNull Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(ModItems.STEEL_INGOT.get()));
|
||||
}
|
||||
};
|
||||
|
||||
public Knife() {
|
||||
super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -1.8f)).stacksTo(1));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.atsuishio.superbwarfare.tiers;
|
||||
|
||||
import com.atsuishio.superbwarfare.init.ModItems;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum ModItemTier implements Tier {
|
||||
STEEL(400, 6.0f, 5.5f, 15, () -> Ingredient.of(ModItems.STEEL_INGOT.get())),
|
||||
;
|
||||
|
||||
private final int uses;
|
||||
private final float speed;
|
||||
private final float damage;
|
||||
private final int enchantmentValue;
|
||||
private final Supplier<Ingredient> repairIngredient;
|
||||
|
||||
ModItemTier(int uses, float speed, float damage, int enchantmentValue, Supplier<Ingredient> repairIngredient) {
|
||||
this.uses = uses;
|
||||
this.speed = speed;
|
||||
this.damage = damage;
|
||||
this.enchantmentValue = enchantmentValue;
|
||||
this.repairIngredient = repairIngredient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUses() {
|
||||
return uses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAttackDamageBonus() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull TagKey<Block> getIncorrectBlocksForDrops() {
|
||||
return BlockTags.INCORRECT_FOR_IRON_TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnchantmentValue() {
|
||||
return enchantmentValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Ingredient getRepairIngredient() {
|
||||
return repairIngredient.get();
|
||||
}
|
||||
}
|
|
@ -184,6 +184,7 @@
|
|||
"item.superbwarfare.senpai_spawn_egg": "Senpai Spawn Egg",
|
||||
"item.superbwarfare.knife": "Knife",
|
||||
"item.superbwarfare.hammer": "Hammer",
|
||||
"item.superbwarfare.electric_baton": "Electric Baton",
|
||||
"item.superbwarfare.crowbar": "Crowbar",
|
||||
"des.superbwarfare.crowbar": "Right-click to open containers. Pick up vehicles when sneaking",
|
||||
"item.superbwarfare.defuser": "Defuser",
|
||||
|
|
|
@ -184,6 +184,7 @@
|
|||
"item.superbwarfare.senpai_spawn_egg": "野兽先辈刷怪蛋",
|
||||
"item.superbwarfare.knife": "军刀",
|
||||
"item.superbwarfare.hammer": "大锤",
|
||||
"item.superbwarfare.electric_baton": "电棍",
|
||||
"item.superbwarfare.crowbar": "撬棍",
|
||||
"des.superbwarfare.crowbar": "右击以开启集装箱,潜行时右击以回收载具",
|
||||
"item.superbwarfare.defuser": "拆弹器",
|
||||
|
|
File diff suppressed because it is too large
Load diff
Binary file not shown.
After Width: | Height: | Size: 655 B |
Loading…
Add table
Reference in a new issue