Fixed OreGen and Enchanted Apples not Glowing

This commit is contained in:
Steven Tracey 2021-11-08 19:16:21 -05:00
parent f32a1bf5db
commit c1e1065c3b
9 changed files with 59 additions and 12 deletions

View File

@ -1,5 +1,5 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G
#org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
@ -8,7 +8,7 @@ yarn_mappings=1.17.1+build.63
loader_version=0.11.7
# Mod Properties
mod_version = 1.0.0
mod_version = 0.2.0
maven_group = tech.nevets
archives_base_name = vplus

View File

@ -6,6 +6,7 @@ import tech.nevets.vplus.blocks.VPBlocks;
import tech.nevets.vplus.food.VPFood;
import tech.nevets.vplus.items.VPItems;
import tech.nevets.vplus.misc.VPFuels;
import tech.nevets.vplus.misc.VPOreGen;
import tech.nevets.vplus.misc.VPZoom;
import tech.nevets.vplus.tools.VPTools;
@ -18,6 +19,7 @@ public class Main implements ModInitializer {
VPFood.vpFood();
VPTools.vpTools();
VPArmor.vpArmor();
VPOreGen.vpOres();
VPFuels.vpFuels();
VPZoom.vpZoom();
}

View File

@ -4,10 +4,15 @@ 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 EnchantedDiamondApple extends Item {
public EnchantedDiamondApple() {
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(8).saturationModifier(14).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 4),1f).build()));
}
public boolean hasGlint(ItemStack stack) {
return true;
}
}

View File

@ -4,10 +4,15 @@ 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 EnchantedEmeraldApple extends Item {
public EnchantedEmeraldApple() {
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;
}
}

View File

@ -4,10 +4,15 @@ 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 EnchantedIronApple extends Item {
public EnchantedIronApple() {
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(6).saturationModifier(10).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 2),1f).build()));
}
public boolean hasGlint(ItemStack stack) {
return true;
}
}

View File

@ -4,10 +4,15 @@ 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 EnchantedNetheriteApple extends Item {
public EnchantedNetheriteApple() {
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(14).saturationModifier(18).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 8),1f).build()));
}
public boolean hasGlint(ItemStack stack) {
return true;
}
}

View File

@ -4,10 +4,15 @@ 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 EnchantedPlatinumApple extends Item {
public EnchantedPlatinumApple() {
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(16).saturationModifier(20).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 10),1f).build()));
}
public boolean hasGlint(ItemStack stack) {
return true;
}
}

View File

@ -4,10 +4,15 @@ 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 EnchantedRubyApple extends Item {
public EnchantedRubyApple() {
super(new Settings().group(VPItemGroups.FOOD).food(new FoodComponent.Builder().hunger(18).saturationModifier(22).alwaysEdible().statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 20*120, 12),1f).build()));
}
public boolean hasGlint(ItemStack stack) {
return true;
}
}

View File

@ -1,23 +1,30 @@
package tech.nevets.vplus.misc;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
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 tech.nevets.vplus.blocks.VPBlocks;
public class VPOreGen {
/*
private static ConfiguredFeature<?, ?> ORE_PLATINUM_OVERWORLD = Feature.ORE
.configure(new OreFeatureConfig(
OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
VPBlocks.PLATINUMORE.getDefaultState(),
3)) // vein size
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(
0, // bottom offset
0, // min y level
15))) // max y level
.range(new RangeDecoratorConfig(
UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(15))))
.spreadHorizontally()
.repeat(2); // number of veins per chunk
@ -26,12 +33,20 @@ public class VPOreGen {
OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
VPBlocks.RUBYORE.getDefaultState(),
1)) // vein size
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(
0, // bottom offset
0, // min y level
256))) // max y level
.range(new RangeDecoratorConfig(
UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(256))))
.spreadHorizontally()
.repeat(8); // number of veins per chunk
*/
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);
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);
}
}