Skip to content

Commit

Permalink
Merge pull request #187 from Thorfusion/185-enhancement-deepslate-var…
Browse files Browse the repository at this point in the history
…iant-of-osmium-ore-when-efr-is-installed

Add deepslate ores and support for efr #185
  • Loading branch information
maggi373 authored Oct 17, 2024
2 parents 6a41ee5 + 86d1b00 commit 423a97c
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 12 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ FMP_version=1.2.0.345
CCLIB_version=1.1.3.141
NEI_version=1.0.5.120
CCC_version=1.0.7.48
mod_version=9.10.38
alt_version=9, 10, 38
mod_version=9.10.39
alt_version=9, 10, 39
Binary file added libs/Et_Futurum_Requiem-2.6.0-dev-nomixin.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main/java/mekanism/api/MekanismConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public static class general

}
public static class mekce {

public static boolean enableoregen;
public static boolean enableBoPProgression;
public static boolean enabledeepslateosmium;
public static boolean EnableQuartzCompat;
public static boolean EnableDiamondCompat;
public static boolean EnablePoorOresCompat;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/mekanism/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public int getArmorIndex(String string)
public void loadConfiguration()
{
general.updateNotifications = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpdateNotificationsv2", true).getBoolean();
mekce.enableoregen = Mekanism.configuration.get("mekce", "EnableOreGen", true, "disables completely the oregen").getBoolean();
general.controlCircuitOreDict = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true).getBoolean();
general.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean();
general.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean();
Expand All @@ -262,6 +263,7 @@ public void loadConfiguration()
general.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
general.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();
general.osmiumPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OsmiumPerChunk", 12).getInt();
mekce.enabledeepslateosmium = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableDeepslateOsmiumOreInEFR", true, "adds deepslate osmium ore entry to efr if et futurum requiem is present").getBoolean();
general.copperPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CopperPerChunk", 16).getInt();
general.tinPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "TinPerChunk", 14).getInt();
general.saltPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SaltPerChunk", 2).getInt();
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/mekanism/common/Mekanism.java
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,9 @@ public void addRecipes()
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.OreBlock, 1, 0), new ItemStack(MekanismItems.Ingot, 1, 1), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.OreBlock, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 5), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.OreBlock, 1, 2), new ItemStack(MekanismItems.Ingot, 1, 6), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 0), new ItemStack(MekanismItems.Ingot, 1, 1), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 5), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 2), new ItemStack(MekanismItems.Ingot, 1, 6), 1.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismItems.Dust, 1, Resource.OSMIUM.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 1), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismItems.Dust, 1, Resource.IRON.ordinal()), new ItemStack(Items.iron_ingot), 0.0F);
FurnaceRecipes.smelting().func_151394_a(new ItemStack(MekanismItems.Dust, 1, Resource.GOLD.ordinal()), new ItemStack(Items.gold_ingot), 0.0F);
Expand Down Expand Up @@ -1280,6 +1283,12 @@ public void registerOreDict()
OreDictionary.registerOre("ore" + mekanismMaterial, new ItemStack(MekanismBlocks.OreBlock, 1, 0));
OreDictionary.registerOre("oreCopper", new ItemStack(MekanismBlocks.OreBlock, 1, 1));
OreDictionary.registerOre("oreTin", new ItemStack(MekanismBlocks.OreBlock, 1, 2));
OreDictionary.registerOre("ore" + mekanismMaterial, new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 0));
OreDictionary.registerOre("oreDeepslateOsmium", new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 0));
OreDictionary.registerOre("oreCopper", new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 1));
OreDictionary.registerOre("oreDeepslateCopper", new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 1));
OreDictionary.registerOre("oreTin", new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 2));
OreDictionary.registerOre("oreDeepslateTin", new ItemStack(MekanismBlocks.DeepslateOreBlock, 1, 2));

if(general.controlCircuitOreDict)
{
Expand Down Expand Up @@ -1452,7 +1461,9 @@ public void init(FMLInitializationEvent event)
Mekanism.proxy.Cape();

//Register the mod's world generators
GameRegistry.registerWorldGenerator(genHandler, 1);
if (MekanismConfig.mekce.enableoregen) {
GameRegistry.registerWorldGenerator(genHandler, 1);
}

//Register the mod's GUI handler
NetworkRegistry.INSTANCE.registerGuiHandler(this, new CoreGuiHandler());
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/mekanism/common/MekanismBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class MekanismBlocks
public static final Block MachineBlock = new BlockMachine(MACHINE_BLOCK_1).setBlockName("MachineBlock");
public static final Block MachineBlock2 = new BlockMachine(MACHINE_BLOCK_2).setBlockName("MachineBlock2");
public static final Block MachineBlock3 = new BlockMachine(MACHINE_BLOCK_3).setBlockName("MachineBlock3");
public static final Block OreBlock = new BlockOre().setBlockName("OreBlock");
public static final Block OreBlock = new BlockOre("stone").setBlockName("OreBlock");
public static final Block DeepslateOreBlock = new BlockOre("deepslate").setBlockName("DeepslateOreBlock");
public static final Block ObsidianTNT = new BlockObsidianTNT().setBlockName("ObsidianTNT").setCreativeTab(Mekanism.tabMekanism);
public static final Block EnergyCube = new BlockEnergyCube().setBlockName("EnergyCube");
public static final Block BoundingBlock = (BlockBounding)new BlockBounding().setBlockName("BoundingBlock");
Expand All @@ -60,6 +61,7 @@ public static void register()
GameRegistry.registerBlock(MachineBlock2, ItemBlockMachine.class, "MachineBlock2");
GameRegistry.registerBlock(MachineBlock3, ItemBlockMachine.class, "MachineBlock3");
GameRegistry.registerBlock(OreBlock, ItemBlockOre.class, "OreBlock");
GameRegistry.registerBlock(DeepslateOreBlock, ItemBlockOre.class, "DeepslateOreBlock");
GameRegistry.registerBlock(EnergyCube, ItemBlockEnergyCube.class, "EnergyCube");
GameRegistry.registerBlock(ObsidianTNT, "ObsidianTNT");
GameRegistry.registerBlock(BoundingBlock, "BoundingBlock");
Expand Down
19 changes: 14 additions & 5 deletions src/main/java/mekanism/common/block/BlockOre.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand All @@ -25,10 +26,10 @@ public class BlockOre extends Block
{
public IIcon[] icons = new IIcon[256];

public BlockOre()
public BlockOre(String type)
{
super(Material.rock);
setHardness(3F);
setHardness(type == "deepslate" ? 4.5F : 3F);
setResistance(5F);
setCreativeTab(Mekanism.tabMekanism);
}
Expand All @@ -37,9 +38,17 @@ public BlockOre()
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register)
{
icons[0] = register.registerIcon("mekanism:OsmiumOre");
icons[1] = register.registerIcon("mekanism:CopperOre");
icons[2] = register.registerIcon("mekanism:TinOre");
if(this == MekanismBlocks.OreBlock)
{
icons[0] = register.registerIcon("mekanism:OsmiumOre");
icons[1] = register.registerIcon("mekanism:CopperOre");
icons[2] = register.registerIcon("mekanism:TinOre");
}
if(this == MekanismBlocks.DeepslateOreBlock) {
icons[0] = register.registerIcon("mekanism:DeepslateOsmiumOre");
icons[1] = register.registerIcon("mekanism:DeepslateCopperOre");
icons[2] = register.registerIcon("mekanism:DeepslateTinOre");
}
}

@Override
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/mekanism/common/integration/MekanismHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import li.cil.oc.api.Driver;
import mekanism.api.transmitters.TransmissionType;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import mekanism.common.MekanismItems;
import mekanism.common.Resource;
import mekanism.common.multipart.TransmitterType;
Expand All @@ -24,6 +25,8 @@
import cpw.mods.fml.common.Optional.Method;
import cpw.mods.fml.common.event.FMLInterModComms;
import dan200.computercraft.api.ComputerCraftAPI;
import ganymedes01.etfuturum.api.DeepslateOreRegistry;
import mekanism.api.MekanismConfig.mekce;

/**
* Hooks for Mekanism. Use to grab items or blocks out of different mods.
Expand All @@ -41,6 +44,7 @@ public final class MekanismHooks
public boolean CCLoaded = false;
public boolean AE2Loaded = false;
public boolean RRLoaded = false;
public boolean EFRLoaded = false;

public void hook()
{
Expand All @@ -51,6 +55,12 @@ public void hook()
if(Loader.isModLoaded("ComputerCraft")) CCLoaded = true;
if(Loader.isModLoaded("appliedenergistics2")) AE2Loaded = true;
if(Loader.isModLoaded("RefinedRelocation")) RRLoaded = true;
if(Loader.isModLoaded("etfuturum")) EFRLoaded = true;

if(EFRLoaded && mekce.enabledeepslateosmium){
hookEFRRecipes();
Mekanism.logger.info("Hooked into EFR api successfully.");
}

if(IC2Loaded)
{
Expand All @@ -63,9 +73,14 @@ public void hook()
loadCCPeripheralProviders();
}



}

@Method(modid = "etfuturum")
public void hookEFRRecipes() {
DeepslateOreRegistry.addOre(MekanismBlocks.OreBlock, 0, MekanismBlocks.DeepslateOreBlock, 0);
}
@Method(modid = "IC2")
public void hookIC2Recipes()
{
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/mekanism/common/item/ItemBlockOre.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public String getUnlocalizedName(ItemStack itemstack)
case 2:
name = "TinOre";
break;
case 3:
name = "DeepslateOsmiumOre";
break;
default:
name = "Unknown";
break;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mekanism/common/network/PacketConfigSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ public void toBytes(ByteBuf dataStream)
dataStream.writeBoolean(recipes.enableFlamethrower);
dataStream.writeBoolean(recipes.enableGaugeDropper);
dataStream.writeBoolean(recipes.enableTierInstaller);
mekce.atomicDisassemblerPoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerUnpoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerAttackPowerCost = dataStream.readInt();

Tier.writeConfig(dataStream);

Expand Down Expand Up @@ -289,6 +286,9 @@ public void fromBytes(ByteBuf dataStream)
mekce.digitalMinerMaxRadius = dataStream.readInt();
mekce.enableSingleUseCardboxes = dataStream.readBoolean();
mekce.enablePersonalChestPocketAccess = dataStream.readBoolean();
mekce.atomicDisassemblerPoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerUnpoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerAttackPowerCost = dataStream.readInt();

for(MachineType type : MachineType.getValidMachines())
{
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/mekanism/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ infuse.lead=Lead
tile.OreBlock.OsmiumOre.name=Osmium Ore
tile.OreBlock.CopperOre.name=Copper Ore
tile.OreBlock.TinOre.name=Tin Ore
tile.DeepslateOreBlock.OsmiumOre.name=Deepslate Osmium Ore
tile.DeepslateOreBlock.CopperOre.name=Deepslate Copper Ore
tile.DeepslateOreBlock.TinOre.name=Deepslate Tin Ore

//Transmitters
item.MultipartTransmitter.BasicPressurizedTube.name=Basic Pressurized Tube
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 423a97c

Please sign in to comment.