Add Veridium Ore World Generation
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-07-13 19:33:38 -04:00
parent dd47468f00
commit 34b5cb01ba
6 changed files with 78 additions and 7 deletions

View File

@ -23,7 +23,11 @@ import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
public class EnergonRelics implements ModInitializer {
public static final String NAMESPACE = "energonrelics";
@ -47,9 +51,10 @@ public class EnergonRelics implements ModInitializer {
public static final ReactorInputBlock REACTOR_INPUT_BLOCK = new ReactorInputBlock();
public static final ReactorControllerBlock REACTOR_CONTROLLER_BLOCK = new ReactorControllerBlock();
public static final Item VERIDIUM_INGOT = new Item(new Item.Settings().group(ITEM_GROUP));
public static final SimpleBlock VERIDIUM_ORE = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3.0F, 3.0F));
public static final SimpleBlock VERIDIUM_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.METAL, MaterialColor.GOLD).requiresTool().strength(3.0F, 6.0F).sounds(BlockSoundGroup.METAL));
public static final Item VERIDIUM_INGOT_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
public static final SimpleBlock VERIDIUM_ORE_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3.0F, 3.0F));
public static final SimpleBlock VERIDIUM_BLOCK_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.METAL, MaterialColor.GOLD).requiresTool().strength(3.0F, 6.0F).sounds(BlockSoundGroup.METAL));
public static final ConfiguredFeature<?, ?> VERIDIUM_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.class_5436.field_25845, EnergonRelics.VERIDIUM_ORE_BLOCK.getDefaultState(), 9)).method_30377(32).method_30371().method_30375(2);
public static final Item CIRCUIT_BOARD_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
@ -73,8 +78,9 @@ public class EnergonRelics implements ModInitializer {
REACTOR_INPUT_BLOCK.register("reactor_input");
REACTOR_CONTROLLER_BLOCK.register("reactor_controller");
Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "veridium_ingot"), VERIDIUM_INGOT);
VERIDIUM_ORE.register("veridium_ore");
VERIDIUM_BLOCK.register("veridium_block");
Registry.register(Registry.ITEM, new Identifier(NAMESPACE, "veridium_ingot"), VERIDIUM_INGOT_ITEM);
VERIDIUM_ORE_BLOCK.register("veridium_ore");
VERIDIUM_BLOCK_BLOCK.register("veridium_block");
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(NAMESPACE, "veridium_ore"), VERIDIUM_ORE_FEATURE);
}
}

View File

@ -37,7 +37,7 @@ public class ReactorControllerBlockEntity extends EnergyGeneratorBlockEntity {
boolean foundFuel = false;
for (ReactorInputBlockEntity input : reactor.inputs) {
for (int i = 0; i < input.size(); i++) {
if (input.getStack(i).getItem() == EnergonRelics.VERIDIUM_INGOT) {
if (input.getStack(i).getItem() == EnergonRelics.VERIDIUM_INGOT_ITEM) {
foundFuel = true;
input.removeStack(i, 1);
}

View File

@ -0,0 +1,18 @@
package com.thebrokenrail.energonrelics.mixin;
import com.thebrokenrail.energonrelics.EnergonRelics;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(DefaultBiomeFeatures.class)
public class MixinDefaultBiomeFeatures {
@Inject(at = @At("RETURN"), method = "addDefaultOres")
private static void addDefaultOres(Biome biome, CallbackInfo info) {
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, EnergonRelics.VERIDIUM_ORE_FEATURE);
}
}

View File

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#E#",
"EWE",
"#E#"
],
"key": {
"#": {
"item": "energonrelics:circuit_board"
},
"E": {
"item": "energonrelics:thermal_casing"
},
"W": {
"item": "minecraft:water_bucket"
}
},
"result": {
"item": "energonrelics:battery_core",
"count": 1
}
}

View File

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#E#",
"ELE",
"#E#"
],
"key": {
"#": {
"item": "energonrelics:circuit_board"
},
"E": {
"item": "energonrelics:thermal_casing"
},
"L": {
"item": "minecraft:lava_bucket"
}
},
"result": {
"item": "energonrelics:reactor_core",
"count": 1
}
}

View File

@ -5,6 +5,7 @@
"client": [
],
"mixins": [
"MixinDefaultBiomeFeatures",
"MixinWorld",
"RenderPhaseAccessor"
],