-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #93
- Loading branch information
Showing
4 changed files
with
47 additions
and
9 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
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,27 @@ | ||
package com.aether.mixin.block; | ||
|
||
import com.aether.blocks.AetherBlocks; | ||
import net.minecraft.block.OreBlock; | ||
import net.minecraft.util.math.MathHelper; | ||
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.CallbackInfoReturnable; | ||
|
||
import java.util.Random; | ||
|
||
@SuppressWarnings("ConstantConditions") | ||
@Mixin(OreBlock.class) | ||
public abstract class OreBlockMixin { | ||
//TODO: Tweak the xp values | ||
@Inject(method = "getExperienceWhenMined", at = @At("HEAD"), cancellable = true) | ||
protected void getExperience(Random random, CallbackInfoReturnable<Integer> cir) { | ||
if ((Object) this == AetherBlocks.ZANITE_ORE) { | ||
cir.setReturnValue(MathHelper.nextInt(random, 0, 2)); | ||
} else if ((Object) this == AetherBlocks.AMBROSIUM_ORE) { | ||
cir.setReturnValue(MathHelper.nextInt(random, 0, 2)); | ||
} else if ((Object) this == AetherBlocks.GRAVITITE_ORE) { | ||
cir.setReturnValue(MathHelper.nextInt(random, 0, 2)); | ||
} | ||
} | ||
} |
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