修改perk问题,添加物品栏
This commit is contained in:
parent
787403d8a8
commit
1563257a31
5 changed files with 26 additions and 17 deletions
|
@ -17,6 +17,6 @@ public class ModBlocks {
|
||||||
public static final RegistryObject<Block> DEEPSLATE_GALENA_ORE = REGISTRY.register("deepslate_galena_ore", DeepslateGalenaOreBlock::new);
|
public static final RegistryObject<Block> DEEPSLATE_GALENA_ORE = REGISTRY.register("deepslate_galena_ore", DeepslateGalenaOreBlock::new);
|
||||||
public static final RegistryObject<Block> SCHEELITE_ORE = REGISTRY.register("scheelite_ore", ScheeliteOreBlock::new);
|
public static final RegistryObject<Block> SCHEELITE_ORE = REGISTRY.register("scheelite_ore", ScheeliteOreBlock::new);
|
||||||
public static final RegistryObject<Block> DEEPSLATE_SCHEELITE_ORE = REGISTRY.register("deepslate_scheelite_ore", DeepslateScheeliteOreBlock::new);
|
public static final RegistryObject<Block> DEEPSLATE_SCHEELITE_ORE = REGISTRY.register("deepslate_scheelite_ore", DeepslateScheeliteOreBlock::new);
|
||||||
public static final RegistryObject<Block> DRAGON_TEETH = REGISTRY.register("dragon_teeth", () -> new DragonTeethBlock());
|
public static final RegistryObject<Block> DRAGON_TEETH = REGISTRY.register("dragon_teeth", DragonTeethBlock::new);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,6 @@ public class ModItems {
|
||||||
public static final RegistryObject<Item> MONITOR = ITEMS.register("monitor", Monitor::new);
|
public static final RegistryObject<Item> MONITOR = ITEMS.register("monitor", Monitor::new);
|
||||||
public static final RegistryObject<Item> TARGET_DEPLOYER = ITEMS.register("target_deployer", TargetDeployer::new);
|
public static final RegistryObject<Item> TARGET_DEPLOYER = ITEMS.register("target_deployer", TargetDeployer::new);
|
||||||
public static final RegistryObject<Item> CLAYMORE_MINE = ITEMS.register("claymore_mine", ClaymoreMine::new);
|
public static final RegistryObject<Item> CLAYMORE_MINE = ITEMS.register("claymore_mine", ClaymoreMine::new);
|
||||||
public static final RegistryObject<Item> JUMP_PAD = block(ModBlocks.JUMP_PAD);
|
|
||||||
public static final RegistryObject<Item> LIGHT_SABER = ITEMS.register("light_saber", LightSaber::new);
|
public static final RegistryObject<Item> LIGHT_SABER = ITEMS.register("light_saber", LightSaber::new);
|
||||||
public static final RegistryObject<Item> HAMMER = ITEMS.register("hammer", Hammer::new);
|
public static final RegistryObject<Item> HAMMER = ITEMS.register("hammer", Hammer::new);
|
||||||
public static final RegistryObject<Item> MORTAR_DEPLOYER = ITEMS.register("mortar_deployer", MortarDeployer::new);
|
public static final RegistryObject<Item> MORTAR_DEPLOYER = ITEMS.register("mortar_deployer", MortarDeployer::new);
|
||||||
|
@ -113,16 +112,10 @@ public class ModItems {
|
||||||
public static final RegistryObject<Item> COAL_POWDER = ITEMS.register("coal_powder", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> COAL_POWDER = ITEMS.register("coal_powder", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> COAL_IRON_POWDER = ITEMS.register("coal_iron_powder", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> COAL_IRON_POWDER = ITEMS.register("coal_iron_powder", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> RAW_CEMENTED_CARBIDE_POWDER = ITEMS.register("raw_cemented_carbide_powder", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> RAW_CEMENTED_CARBIDE_POWDER = ITEMS.register("raw_cemented_carbide_powder", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> GALENA_ORE = block(ModBlocks.GALENA_ORE);
|
|
||||||
public static final RegistryObject<Item> DEEPSLATE_GALENA_ORE = block(ModBlocks.DEEPSLATE_GALENA_ORE);
|
|
||||||
public static final RegistryObject<Item> SCHEELITE_ORE = block(ModBlocks.SCHEELITE_ORE);
|
|
||||||
public static final RegistryObject<Item> DEEPSLATE_SCHEELITE_ORE = block(ModBlocks.DEEPSLATE_SCHEELITE_ORE);
|
|
||||||
public static final RegistryObject<Item> GALENA = ITEMS.register("galena", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> GALENA = ITEMS.register("galena", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> SCHEELITE = ITEMS.register("scheelite", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> SCHEELITE = ITEMS.register("scheelite", () -> new Item(new Item.Properties()));
|
||||||
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> SHIELD_CELL = ITEMS.register("shield_cell", () -> new Item(new Item.Properties().rarity(Rarity.RARE)));
|
public static final RegistryObject<Item> SHIELD_CELL = ITEMS.register("shield_cell", () -> new Item(new Item.Properties().rarity(Rarity.RARE)));
|
||||||
public static final RegistryObject<Item> DRAGON_TEETH = block(ModBlocks.DRAGON_TEETH);
|
|
||||||
|
|
||||||
|
|
||||||
public static final RegistryObject<Item> TUNGSTEN_ROD = ITEMS.register("tungsten_rod", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> TUNGSTEN_ROD = ITEMS.register("tungsten_rod", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> IRON_BARREL = ITEMS.register("iron_barrel", () -> new Item(new Item.Properties()));
|
public static final RegistryObject<Item> IRON_BARREL = ITEMS.register("iron_barrel", () -> new Item(new Item.Properties()));
|
||||||
|
@ -179,12 +172,18 @@ public class ModItems {
|
||||||
* Block
|
* Block
|
||||||
*/
|
*/
|
||||||
public static final DeferredRegister<Item> BLOCKS = DeferredRegister.create(ForgeRegistries.ITEMS, ModUtils.MODID);
|
public static final DeferredRegister<Item> BLOCKS = DeferredRegister.create(ForgeRegistries.ITEMS, ModUtils.MODID);
|
||||||
|
|
||||||
|
public static final RegistryObject<Item> GALENA_ORE = block(ModBlocks.GALENA_ORE);
|
||||||
|
public static final RegistryObject<Item> DEEPSLATE_GALENA_ORE = block(ModBlocks.DEEPSLATE_GALENA_ORE);
|
||||||
|
public static final RegistryObject<Item> SCHEELITE_ORE = block(ModBlocks.SCHEELITE_ORE);
|
||||||
|
public static final RegistryObject<Item> DEEPSLATE_SCHEELITE_ORE = block(ModBlocks.DEEPSLATE_SCHEELITE_ORE);
|
||||||
|
public static final RegistryObject<Item> JUMP_PAD = block(ModBlocks.JUMP_PAD);
|
||||||
public static final RegistryObject<Item> SANDBAG = block(ModBlocks.SANDBAG);
|
public static final RegistryObject<Item> SANDBAG = block(ModBlocks.SANDBAG);
|
||||||
public static final RegistryObject<Item> BARBED_WIRE = block(ModBlocks.BARBED_WIRE);
|
public static final RegistryObject<Item> BARBED_WIRE = block(ModBlocks.BARBED_WIRE);
|
||||||
|
public static final RegistryObject<Item> DRAGON_TEETH = block(ModBlocks.DRAGON_TEETH);
|
||||||
|
|
||||||
private static RegistryObject<Item> block(RegistryObject<Block> block) {
|
private static RegistryObject<Item> block(RegistryObject<Block> block) {
|
||||||
return ITEMS.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties()));
|
return BLOCKS.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register(IEventBus bus) {
|
public static void register(IEventBus bus) {
|
||||||
|
|
|
@ -20,15 +20,10 @@ public class ModPerks {
|
||||||
|
|
||||||
public static final DeferredRegister<Perk> PERKS = DeferredRegister.create(new ResourceLocation(ModUtils.MODID, "perk"), ModUtils.MODID);
|
public static final DeferredRegister<Perk> PERKS = DeferredRegister.create(new ResourceLocation(ModUtils.MODID, "perk"), ModUtils.MODID);
|
||||||
|
|
||||||
|
|
||||||
public static final RegistryObject<Perk> FOURTH_TIMES_CHARM = PERKS.register("fourth_times_charm", () -> new Perk(Perk.Type.FUNCTIONAL));
|
public static final RegistryObject<Perk> FOURTH_TIMES_CHARM = PERKS.register("fourth_times_charm", () -> new Perk(Perk.Type.FUNCTIONAL));
|
||||||
public static final RegistryObject<Perk> GUTSHOT_STRAIGHT = PERKS.register("gutshot_straight", () -> new Perk(Perk.Type.DAMAGE));
|
public static final RegistryObject<Perk> GUTSHOT_STRAIGHT = PERKS.register("gutshot_straight", () -> new Perk(Perk.Type.DAMAGE));
|
||||||
public static final RegistryObject<Perk> HEAL_CLIP = PERKS.register("heal_clip", () -> new Perk(Perk.Type.FUNCTIONAL));
|
public static final RegistryObject<Perk> HEAL_CLIP = PERKS.register("heal_clip", () -> new Perk(Perk.Type.FUNCTIONAL));
|
||||||
public static final RegistryObject<Perk> KILL_CLIP = PERKS.register("kill_clip", () -> new Perk(Perk.Type.DAMAGE));
|
public static final RegistryObject<Perk> KILL_CLIP = PERKS.register("kill_clip", () -> new Perk(Perk.Type.DAMAGE));
|
||||||
public static final RegistryObject<Perk> KILLING_TALLY = PERKS.register("killing_tally", () -> new Perk(Perk.Type.DAMAGE));
|
public static final RegistryObject<Perk> KILLING_TALLY = PERKS.register("killing_tally", () -> new Perk(Perk.Type.DAMAGE));
|
||||||
public static final RegistryObject<Perk> LONGER_WIRE = PERKS.register("longer_wire", () -> new Perk(Perk.Type.DAMAGE));
|
public static final RegistryObject<Perk> MONSTER_HUNTER = PERKS.register("monster_hunter", () -> new Perk(Perk.Type.DAMAGE));
|
||||||
public static final RegistryObject<Perk> MONSTER_HUNTER = PERKS.register("monster_hunter", () -> new Perk(Perk.Type.FUNCTIONAL));
|
|
||||||
public static final RegistryObject<Perk> SUPER_RECHARGE = PERKS.register("super_recharge", () -> new Perk(Perk.Type.DAMAGE));
|
|
||||||
public static final RegistryObject<Perk> VOLT_OVERLOAD = PERKS.register("volt_overload", () -> new Perk(Perk.Type.DAMAGE));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
10
src/main/java/net/mcreator/superbwarfare/item/PerkItem.java
Normal file
10
src/main/java/net/mcreator/superbwarfare/item/PerkItem.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package net.mcreator.superbwarfare.item;
|
||||||
|
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
|
||||||
|
public class PerkItem extends Item {
|
||||||
|
|
||||||
|
public PerkItem(Properties pProperties) {
|
||||||
|
super(pProperties);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,11 @@
|
||||||
package net.mcreator.superbwarfare.perk;
|
package net.mcreator.superbwarfare.perk;
|
||||||
|
|
||||||
public record Perk(net.mcreator.superbwarfare.perk.Perk.Type type) {
|
public class Perk {
|
||||||
|
public Type type;
|
||||||
|
|
||||||
|
public Perk(Type type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
AMMO(0),
|
AMMO(0),
|
||||||
|
|
Loading…
Add table
Reference in a new issue