-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: AlasDiablo <25723276+AlasDiablo@users.noreply.github.com>
- Loading branch information
1 parent
54fbabc
commit bfbc5e3
Showing
5 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### 1.1.0 | ||
|
||
+ Add Mekanism ore generation | ||
|
||
### 1.0.0 | ||
|
||
+ Init release | ||
+ Add Tinkers' Construct ore generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/main/java/fr/alasdiablo/jerintegration/compat/mekanism/MekanismWorldGen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package fr.alasdiablo.jerintegration.compat.mekanism; | ||
|
||
import fr.alasdiablo.jerintegration.api.WorldGenIntegration; | ||
import jeresources.api.IWorldGenRegistry; | ||
import jeresources.api.distributions.DistributionBase; | ||
import jeresources.api.distributions.DistributionSquare; | ||
import jeresources.api.drop.LootDrop; | ||
import mekanism.common.registries.MekanismBlocks; | ||
import mekanism.common.registries.MekanismItems; | ||
import mekanism.common.resource.OreType; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class MekanismWorldGen extends WorldGenIntegration { | ||
@Override | ||
public void registerWorldGen(IWorldGenRegistry registry) { | ||
// TODO MekanismConfig.world.salt; | ||
|
||
this.register(registry, | ||
MekanismBlocks.ORES.get(OreType.COPPER).getBlock(), | ||
OreType.COPPER.getPerChunk(), | ||
OreType.COPPER.getMaxVeinSize(), | ||
OreType.COPPER.getBottomOffset(), | ||
OreType.COPPER.getMaxHeight() | ||
); | ||
|
||
this.register(registry, | ||
MekanismBlocks.ORES.get(OreType.TIN).getBlock(), | ||
OreType.TIN.getPerChunk(), | ||
OreType.TIN.getMaxVeinSize(), | ||
OreType.TIN.getBottomOffset(), | ||
OreType.TIN.getMaxHeight() | ||
); | ||
|
||
this.register(registry, | ||
MekanismBlocks.ORES.get(OreType.OSMIUM).getBlock(), | ||
OreType.OSMIUM.getPerChunk(), | ||
OreType.OSMIUM.getMaxVeinSize(), | ||
OreType.OSMIUM.getBottomOffset(), | ||
OreType.OSMIUM.getMaxHeight() | ||
); | ||
|
||
this.register(registry, | ||
MekanismBlocks.ORES.get(OreType.URANIUM).getBlock(), | ||
OreType.URANIUM.getPerChunk(), | ||
OreType.URANIUM.getMaxVeinSize(), | ||
OreType.URANIUM.getBottomOffset(), | ||
OreType.URANIUM.getMaxHeight() | ||
); | ||
|
||
this.register(registry, | ||
MekanismBlocks.ORES.get(OreType.LEAD).getBlock(), | ||
OreType.LEAD.getPerChunk(), | ||
OreType.LEAD.getMaxVeinSize(), | ||
OreType.LEAD.getBottomOffset(), | ||
OreType.LEAD.getMaxHeight() | ||
); | ||
|
||
final DistributionBase fluoriteDistribution = new DistributionSquare( | ||
OreType.FLUORITE.getPerChunk(), | ||
OreType.FLUORITE.getMaxVeinSize(), | ||
OreType.FLUORITE.getBottomOffset(), | ||
OreType.FLUORITE.getMaxHeight() | ||
); | ||
final ItemStack fluoriteStack = new ItemStack(MekanismBlocks.ORES.get(OreType.FLUORITE).getBlock()); | ||
final LootDrop fluoriteDrop = new LootDrop(new ItemStack(MekanismItems.FLUORITE_GEM.getItem(), 4)); | ||
registry.register(fluoriteStack, fluoriteDistribution, fluoriteDrop); | ||
} | ||
|
||
|
||
public void register(IWorldGenRegistry registry, Block block, int count, int veinSize, int bottom, int top) { | ||
final DistributionBase distribution = new DistributionSquare( | ||
count, | ||
veinSize, | ||
bottom, | ||
top | ||
); | ||
final ItemStack stack = new ItemStack(block); | ||
final LootDrop drop = new LootDrop(stack); | ||
registry.register(stack, distribution, drop); | ||
} | ||
} |