Updates!
Updated to 1.18.1, added copper items, new recipes
This commit is contained in:
@@ -21,6 +21,5 @@ public class Main implements ModInitializer {
|
||||
VPArmor.vpArmor();
|
||||
VPOreGen.vpOres();
|
||||
VPFuels.vpFuels();
|
||||
VPZoom.vpZoom();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import tech.nevets.vplus.items.VPItems;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum ArmorMaterials implements ArmorMaterial {
|
||||
COPPER("copper", 13, new int[]{2, 4, 5, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> {
|
||||
return Ingredient.ofItems(new ItemConvertible[]{Items.COPPER_INGOT});
|
||||
}),
|
||||
EMERALD("emerald", 30, new int[]{2, 6, 8, 2}, 30, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F, 0.0F, () -> {
|
||||
return Ingredient.ofItems(new ItemConvertible[]{Items.EMERALD});
|
||||
}),
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.util.registry.Registry;
|
||||
|
||||
public class VPArmor {
|
||||
|
||||
public static final ArmorMaterial COPPER_ARMOR = ArmorMaterials.COPPER;
|
||||
public static final ArmorMaterial EMERALD_ARMOR = ArmorMaterials.EMERALD;
|
||||
public static final ArmorMaterial PLATINUM_ARMOR = ArmorMaterials.PLATINUM;
|
||||
public static final ArmorMaterial RUBY_ARMOR = ArmorMaterials.RUBY;
|
||||
@@ -19,24 +20,28 @@ public class VPArmor {
|
||||
}
|
||||
|
||||
public static void initializeHelmet() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_helmet"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.HEAD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_helmet"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.HEAD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_helmet"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.HEAD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_helmet"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.HEAD));
|
||||
}
|
||||
|
||||
public static void initializeChestplates() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_chestplate"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.CHEST));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_chestplate"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.CHEST));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_chestplate"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.CHEST));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_chestplate"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.CHEST));
|
||||
}
|
||||
|
||||
public static void initialzeLeggings() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_leggings"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.LEGS));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_leggings"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.LEGS));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_leggings"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.LEGS));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_leggings"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.LEGS));
|
||||
}
|
||||
|
||||
public static void initializeBoots() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_boots"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.FEET));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_boots"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.FEET));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_boots"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.FEET));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_boots"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.FEET));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package tech.nevets.vplus.mixin;
|
||||
package tech.nevets.vplus.clientmixin;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
@@ -13,7 +13,7 @@ import tech.nevets.vplus.misc.VPZoom;
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Mixin(GameRenderer.class)
|
||||
public class ZoomMixin {
|
||||
@Inject(method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D", at = @At("HEAD"), cancellable = true)
|
||||
@Inject(method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D", at = @At("RETURN"), cancellable = true)
|
||||
public void getZoomLevel(CallbackInfoReturnable<Double> callbackInfo) {
|
||||
if(ZoomInit.isZooming()) {
|
||||
callbackInfo.setReturnValue(VPZoom.zoomLevel);
|
||||
13
src/main/java/tech/nevets/vplus/food/CopperApple.java
Normal file
13
src/main/java/tech/nevets/vplus/food/CopperApple.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package tech.nevets.vplus.food;
|
||||
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.item.FoodComponent;
|
||||
import net.minecraft.item.Item;
|
||||
import tech.nevets.vplus.items.VPItemGroups;
|
||||
|
||||
public class CopperApple extends Item {
|
||||
public CopperApple() {
|
||||
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(12).saturationModifier(16).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 5),1f).build()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package tech.nevets.vplus.food;
|
||||
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.item.FoodComponent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tech.nevets.vplus.items.VPItemGroups;
|
||||
|
||||
public class EnchantedCopperApple extends Item {
|
||||
public EnchantedCopperApple() {
|
||||
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(12).saturationModifier(16).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 6),1f).build()));
|
||||
}
|
||||
|
||||
public boolean hasGlint(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ public class VPFood {
|
||||
|
||||
public static final Item IRONAPPLE = new IronApple();
|
||||
public static final Item ENCHANTEDIRONAPPLE = new EnchantedIronApple();
|
||||
public static final Item COPPERAPPLE = new CopperApple();
|
||||
public static final Item ENCHANTEDCOPPERAPPLE = new EnchantedCopperApple();
|
||||
public static final Item DIAMONDAPPLE = new DiamondApple();
|
||||
public static final Item ENCHANTEDDIAMONDAPPLE = new EnchantedDiamondApple();
|
||||
public static final Item EMERALDAPPLE = new EmeraldApple();
|
||||
@@ -27,6 +29,8 @@ public class VPFood {
|
||||
public static void initializeApples() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "iron_apple"), IRONAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_iron_apple"), ENCHANTEDIRONAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_apple"), COPPERAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_copper_apple"), ENCHANTEDCOPPERAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "diamond_apple"), DIAMONDAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_diamond_apple"), ENCHANTEDDIAMONDAPPLE);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_apple"), EMERALDAPPLE);
|
||||
|
||||
12
src/main/java/tech/nevets/vplus/init/ClientInit.java
Normal file
12
src/main/java/tech/nevets/vplus/init/ClientInit.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package tech.nevets.vplus.init;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import tech.nevets.vplus.misc.VPZoom;
|
||||
|
||||
public class ClientInit implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
VPZoom.vpZoom();
|
||||
}
|
||||
}
|
||||
@@ -8,45 +8,41 @@ import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.YOffset;
|
||||
import net.minecraft.world.gen.decorator.Decorator;
|
||||
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
||||
import net.minecraft.world.gen.heightprovider.UniformHeightProvider;
|
||||
import net.minecraft.world.gen.decorator.*;
|
||||
import net.minecraft.world.gen.feature.*;
|
||||
import tech.nevets.vplus.blocks.VPBlocks;
|
||||
|
||||
public class VPOreGen {
|
||||
|
||||
private static ConfiguredFeature<?, ?> ORE_PLATINUM_OVERWORLD = Feature.ORE
|
||||
private static ConfiguredFeature<?, ?> ORE_PLATINUM_OVERWORLD_CONFIGURED = Feature.ORE
|
||||
.configure(new OreFeatureConfig(
|
||||
OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
|
||||
OreConfiguredFeatures.BASE_STONE_OVERWORLD,
|
||||
VPBlocks.PLATINUMORE.getDefaultState(),
|
||||
3)) // vein size
|
||||
.range(new RangeDecoratorConfig(
|
||||
UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(15))))
|
||||
.spreadHorizontally()
|
||||
.repeat(2); // number of veins per chunk
|
||||
3)); // vein size
|
||||
public static PlacedFeature ORE_PLATINUM_OVERWORLD_PLACED = ORE_PLATINUM_OVERWORLD_CONFIGURED.withPlacement(
|
||||
CountPlacementModifier.of(2), // number of veins per chunk
|
||||
SquarePlacementModifier.of(),
|
||||
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15))
|
||||
);
|
||||
|
||||
private static ConfiguredFeature<?, ?> ORE_RUBY_OVERWORLD = Feature.ORE
|
||||
private static ConfiguredFeature<?, ?> ORE_RUBY_OVERWORLD_CONFIGURED = Feature.ORE
|
||||
.configure(new OreFeatureConfig(
|
||||
OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
|
||||
VPBlocks.RUBYORE.getDefaultState(),
|
||||
1)) // vein size
|
||||
.range(new RangeDecoratorConfig(
|
||||
UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(256))))
|
||||
.spreadHorizontally()
|
||||
.repeat(8); // number of veins per chunk
|
||||
OreConfiguredFeatures.BASE_STONE_OVERWORLD,
|
||||
VPBlocks.PLATINUMORE.getDefaultState(),
|
||||
1)); // vein size
|
||||
public static PlacedFeature ORE_RUBY_OVERWORLD_PLACED = ORE_PLATINUM_OVERWORLD_CONFIGURED.withPlacement(
|
||||
CountPlacementModifier.of(8), // number of veins per chunk
|
||||
SquarePlacementModifier.of(),
|
||||
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15))
|
||||
);
|
||||
|
||||
public static void vpOres() {
|
||||
RegistryKey<ConfiguredFeature<?, ?>> platinumOreOverworld = RegistryKey.of(Registry.CONFIGURED_FEATURE_KEY,
|
||||
new Identifier("vplus", "platinum_ore"));
|
||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, platinumOreOverworld.getValue(), ORE_PLATINUM_OVERWORLD);
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, platinumOreOverworld);
|
||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("vplus", "platinum_ore"), ORE_PLATINUM_OVERWORLD_CONFIGURED);
|
||||
Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier("vplus", "platinum_ore"), ORE_PLATINUM_OVERWORLD_PLACED);
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier("vplus", "platinum_ore")));
|
||||
|
||||
RegistryKey<ConfiguredFeature<?, ?>> rubyOreOverworld = RegistryKey.of(Registry.CONFIGURED_FEATURE_KEY,
|
||||
new Identifier("vplus", "ruby_ore"));
|
||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, rubyOreOverworld.getValue(), ORE_RUBY_OVERWORLD);
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, rubyOreOverworld);
|
||||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("vplus", "ruby_ore"), ORE_RUBY_OVERWORLD_CONFIGURED);
|
||||
Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier("vplus", "ruby_ore"), ORE_RUBY_OVERWORLD_PLACED);
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier("vplus", "ruby_ore")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ import net.minecraft.util.Lazy;
|
||||
import tech.nevets.vplus.items.VPItems;
|
||||
|
||||
public enum ToolMaterials implements ToolMaterial {
|
||||
COPPER (2, 200, 5.0F, 3.0F, 20, () -> {
|
||||
return Ingredient.ofItems(new ItemConvertible[]{Items.COPPER_INGOT});
|
||||
}),
|
||||
EMERALD(3, 750, 7.0F, 4.0F, 30, () -> {
|
||||
return Ingredient.ofItems(new ItemConvertible[]{Items.EMERALD});
|
||||
}),
|
||||
|
||||
@@ -14,30 +14,35 @@ public class VPTools {
|
||||
}
|
||||
|
||||
public static void initializeAxes() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_axe"), new AxeBase(ToolMaterials.COPPER));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_axe"), new AxeBase(ToolMaterials.EMERALD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_axe"), new AxeBase(ToolMaterials.PLATINUM));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_axe"), new AxeBase(ToolMaterials.RUBY));
|
||||
}
|
||||
|
||||
public static void initializeHoes() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_hoe"), new HoeBase(ToolMaterials.COPPER));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_hoe"), new HoeBase(ToolMaterials.EMERALD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_hoe"), new HoeBase(ToolMaterials.PLATINUM));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_hoe"), new HoeBase(ToolMaterials.RUBY));
|
||||
}
|
||||
|
||||
public static void initializePickaxes() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_pickaxe"), new PickaxeBase(ToolMaterials.COPPER));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_pickaxe"), new PickaxeBase(ToolMaterials.EMERALD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_pickaxe"), new PickaxeBase(ToolMaterials.PLATINUM));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_pickaxe"), new PickaxeBase(ToolMaterials.RUBY));
|
||||
}
|
||||
|
||||
public static void initializeShovels() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_shovel"), new ShovelBase(ToolMaterials.COPPER));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_shovel"), new ShovelBase(ToolMaterials.EMERALD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_shovel"), new ShovelBase(ToolMaterials.PLATINUM));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_shovel"), new ShovelBase(ToolMaterials.RUBY));
|
||||
}
|
||||
|
||||
public static void initializeSwords() {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_sword"), new SwordBase(ToolMaterials.COPPER));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_sword"), new SwordBase(ToolMaterials.EMERALD));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_sword"), new SwordBase(ToolMaterials.PLATINUM));
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_sword"), new SwordBase(ToolMaterials.RUBY));
|
||||
|
||||
Reference in New Issue
Block a user