-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent Massive World Destroying Sacred Rubber Tree Generation (#442)
- Loading branch information
1 parent
641d70b
commit faecb72
Showing
3 changed files
with
44 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
...va/com/mitchej123/hodgepodge/mixins/late/minefactoryreloaded/MixinBlockRubberSapling.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,32 @@ | ||
package com.mitchej123.hodgepodge.mixins.late.minefactoryreloaded; | ||
|
||
import java.util.Random; | ||
|
||
import net.minecraft.world.World; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import powercrystals.minefactoryreloaded.block.BlockRubberSapling; | ||
import powercrystals.minefactoryreloaded.world.MineFactoryReloadedWorldGen; | ||
import powercrystals.minefactoryreloaded.world.WorldGenMassiveTree; | ||
|
||
@Mixin(BlockRubberSapling.class) | ||
public class MixinBlockRubberSapling { | ||
|
||
/** | ||
* @author DrParadox7 | ||
* @reason Swap Massive world-breaking tree to Mega, a still reasonably large but safe tree, should it still be | ||
* obtained by chance. | ||
*/ | ||
@Redirect( | ||
method = "func_149878_d", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lpowercrystals/minefactoryreloaded/world/WorldGenMassiveTree;generate(Lnet/minecraft/world/World;Ljava/util/Random;III)Z")) | ||
private boolean hodgepodge$generateMassiveRubberTree(WorldGenMassiveTree instance, World world, Random random, | ||
int x, int y, int z) { | ||
return MineFactoryReloadedWorldGen.generateMegaRubberTree(world, random, x, y, z, true); | ||
} | ||
} |