-
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.
Merge pull request #5 from Janoeo/3-wish-list-possibilities
Dev Branch for (Wish-list possibilities #3)
- Loading branch information
Showing
8 changed files
with
108 additions
and
40 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
### 2.3.0 | ||
+ Add Immersive Engineering | ||
+ Update loading process | ||
|
||
### 2.2.0 | ||
|
||
+ Add create | ||
|
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
53 changes: 53 additions & 0 deletions
53
...r/alasdiablo/jerintegration/compat/immersiveengineering/ImmersiveEngineeringWorldGen.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,53 @@ | ||
package fr.alasdiablo.jerintegration.compat.immersiveengineering; | ||
|
||
import blusunrize.immersiveengineering.common.config.IEServerConfig; | ||
import blusunrize.immersiveengineering.common.register.IEBlocks; | ||
import blusunrize.immersiveengineering.common.register.IEItems; | ||
import fr.alasdiablo.jerintegration.api.WorldGenIntegration; | ||
import jeresources.api.IWorldGenRegistry; | ||
import jeresources.api.conditionals.Conditional; | ||
import jeresources.api.distributions.DistributionBase; | ||
import jeresources.api.distributions.DistributionSquare; | ||
import jeresources.api.distributions.DistributionTriangular; | ||
import jeresources.api.drop.LootDrop; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
public class ImmersiveEngineeringWorldGen extends WorldGenIntegration { | ||
@Override | ||
public void registerWorldGen(IWorldGenRegistry registry) { | ||
IEServerConfig.ORES.ores.forEach((veinType, oreConfig) -> { | ||
IEBlocks.BlockEntry<Block> ore = IEBlocks.Metals.ORES.get(veinType.metal); | ||
IEItems.ItemRegObject<Item> rawOre = IEItems.Metals.RAW_ORES.get(veinType.metal); | ||
if (ore != null && ore.get() != null) { | ||
DistributionBase distribution; | ||
|
||
try { | ||
if (oreConfig.distribution.get() == IEServerConfig.Ores.OreDistribution.UNIFORM) { | ||
distribution = new DistributionSquare( | ||
oreConfig.veinsPerChunk.get(), oreConfig.veinSize.get(), oreConfig.minY.get(), oreConfig.maxY.get()); | ||
} else { | ||
int range = (oreConfig.maxY.get() - oreConfig.minY.get()) / 2; | ||
int midY = range + oreConfig.minY.get(); | ||
distribution = new DistributionTriangular(oreConfig.veinsPerChunk.get(), oreConfig.veinSize.get(), midY, range); | ||
} | ||
} catch (NullPointerException ignored) { | ||
distribution = new DistributionSquare(oreConfig.veinsPerChunk.get(), oreConfig.veinSize.get(), oreConfig.minY.get(), oreConfig.maxY.get()); | ||
} | ||
|
||
registry.register( | ||
new ItemStack(ore), | ||
distribution, | ||
true, | ||
new LootDrop( | ||
new ItemStack(rawOre.get()), | ||
1, 1, | ||
Conditional.affectedByFortune | ||
) | ||
); | ||
} | ||
|
||
}); | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
src/main/java/fr/alasdiablo/jerintegration/compat/minecraft/MinecraftWorldGen.java
This file was deleted.
Oops, something went wrong.
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