jeremium update

This commit is contained in:
RyanTLG
2022-04-11 14:52:24 +02:00
parent 04c7e396e4
commit 879271705a
16 changed files with 101 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ public class jeremiumBlocks {
public static final Block JEREMIUM_BLOCK = new jeremiumBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f).requiresTool().luminance(16));
public static final Block JEREMIUM_ORE = new jeremiumBlock(FabricBlockSettings.of(Material.STONE).strength(4.0f).requiresTool().luminance(5));
public static final Block DEEPSLATE_JEREMIUM_ORE = new jeremiumBlock(FabricBlockSettings.of(Material.STONE).strength(4.0f).luminance(5));
public static void register() {
Registry.register(Registry.BLOCK, new Identifier("gamermod", "jeremium_ore"), JEREMIUM_ORE);
@@ -22,6 +23,9 @@ public class jeremiumBlocks {
Registry.register(Registry.BLOCK, new Identifier("gamermod", "jeremium_block"), JEREMIUM_BLOCK);
Registry.register(Registry.ITEM, new Identifier("gamermod", "jeremium_block"), new BlockItem(JEREMIUM_BLOCK, new FabricItemSettings().group(gamermod.CHING).fireproof().maxCount(56)));
Registry.register(Registry.BLOCK, new Identifier("gamermod", "deepslate_jeremium_ore"), DEEPSLATE_JEREMIUM_ORE);
Registry.register(Registry.ITEM, new Identifier("gamermod", "deepslate_jeremium_ore"), new BlockItem(DEEPSLATE_JEREMIUM_ORE, new FabricItemSettings().group(gamermod.CHING).fireproof().maxCount(56)));
gamermod.LOGGER.info("jeremiumBlocks loaded");
}

View File

@@ -2,6 +2,10 @@ package net.arcmods.ryantlg.customToolItemClasses.jeremium;
import java.util.List;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.SwordItem;
@@ -18,5 +22,12 @@ public class JeremiumSwordItem extends SwordItem {
@Override
public void appendTooltip(ItemStack itemStack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
tooltip.add( new TranslatableText("item.gamermod.jeremium_sword.tooltip").formatted(Formatting.DARK_PURPLE, Formatting.ITALIC) );
}
}
@Override
public boolean postHit(ItemStack stack, LivingEntity attackee, LivingEntity attacker) {
attackee.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 200, 3), attacker);
return super.postHit(stack, attackee, attacker);
}
}

View File

@@ -18,5 +18,5 @@ public class OmniumSwordItem extends SwordItem {
@Override
public void appendTooltip(ItemStack itemStack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
tooltip.add( new TranslatableText("item.gamermod.omnium_sword.tooltip").formatted(Formatting.DARK_PURPLE, Formatting.ITALIC) );
}
}
}

View File

@@ -20,6 +20,7 @@ import net.arcmods.ryantlg.items.tools.omniumTools;
import net.arcmods.ryantlg.items.tools.oriumTools;
import net.arcmods.ryantlg.lootTables.grassVanillaWeem;
import net.arcmods.ryantlg.statusEffects.GamerEffects;
import net.arcmods.ryantlg.worldGeneration.JeremiumOreGen;
import net.arcmods.ryantlg.worldGeneration.OmniumOreGen;
import net.arcmods.ryantlg.worldGeneration.OriumOreGen;
import net.fabricmc.api.ModInitializer;
@@ -101,6 +102,8 @@ public class gamermod implements ModInitializer {
jeremiumBlocks.register();
jeremiumArmour.register();
jeremiumTools.register();
JeremiumOreGen.register();
}
}

View File

@@ -6,4 +6,5 @@ crafting recipes
advancements
argentine
geranine
jeremium
jeremium
soulium

View File

@@ -0,0 +1,48 @@
package net.arcmods.ryantlg.worldGeneration;
import net.arcmods.ryantlg.gamermod;
import net.arcmods.ryantlg.blocks.jeremiumBlocks;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.decorator.CountPlacementModifier;
import net.minecraft.world.gen.decorator.HeightRangePlacementModifier;
import net.minecraft.world.gen.decorator.SquarePlacementModifier;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreConfiguredFeatures;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.PlacedFeature;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.Identifier;
public class JeremiumOreGen {
private static ConfiguredFeature<?, ?> ORE_CONFIGURED_FEATURE = Feature.ORE.configure(new OreFeatureConfig(
OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES,
jeremiumBlocks.DEEPSLATE_JEREMIUM_ORE.getDefaultState(),
4)); // vein size
public static PlacedFeature ORE_PLACED_FEATURE = ORE_CONFIGURED_FEATURE.withPlacement(
CountPlacementModifier.of(1), // number of veins per chunk
SquarePlacementModifier.of(), // spreading horizontally
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(-4))); // height
public static void register() {
gamermod.LOGGER.info("JeremiumOreGen loaded");
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE,
new Identifier("gamermod", "deepslate_jeremium_ore"), ORE_CONFIGURED_FEATURE);
Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier("gamermod", "deepslate_jeremium_ore"),
ORE_PLACED_FEATURE);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES,
RegistryKey.of(Registry.PLACED_FEATURE_KEY,
new Identifier("gamermod", "deepslate_jeremium_ore")));
}
}