-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linear XP Scaling for AA and EIO Machines
- Loading branch information
1 parent
3b59535
commit 63256bf
Showing
10 changed files
with
114 additions
and
3 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
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
src/main/java/com/nomiceu/nomilabs/mixin/actuallyadditions/TileEntityXPSolidifierMixin.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.nomiceu.nomilabs.mixin.actuallyadditions; | ||
|
||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; | ||
|
||
@Mixin(value = TileEntityXPSolidifier.class, remap = false) | ||
public abstract class TileEntityXPSolidifierMixin { | ||
|
||
@Inject(method = "getExperienceForLevel", at = @At("HEAD"), cancellable = true) | ||
private static void getLinearXpAmountLevel(int level, CallbackInfoReturnable<Integer> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) | ||
cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp * level); | ||
} | ||
|
||
@Inject(method = "getLevelForExperience", at = @At("HEAD"), cancellable = true) | ||
private static void getLinearXPAmountXp(int experience, CallbackInfoReturnable<Integer> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && experience >= 0) | ||
cir.setReturnValue(experience / LabsConfig.advanced.aaEioLinearXp); | ||
} | ||
|
||
@Inject(method = "getXpBarCapacity", at = @At("HEAD"), cancellable = true) | ||
private static void getLinearXPAmount(int level, CallbackInfoReturnable<Integer> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) | ||
cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/nomiceu/nomilabs/mixin/enderio/XPUtilMixin.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.nomiceu.nomilabs.mixin.enderio; | ||
|
||
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 com.nomiceu.nomilabs.config.LabsConfig; | ||
|
||
import crazypants.enderio.base.xp.XpUtil; | ||
|
||
@Mixin(value = XpUtil.class, remap = false) | ||
public class XPUtilMixin { | ||
|
||
@Inject(method = "calculateXPfromLevel", at = @At("HEAD"), cancellable = true) | ||
private static void calculateXpFromLevelLinear(int level, CallbackInfoReturnable<Long> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) | ||
cir.setReturnValue(((long) LabsConfig.advanced.aaEioLinearXp * level)); | ||
} | ||
|
||
@Inject(method = "getLevelFromExp", at = @At("HEAD"), cancellable = true) | ||
private static void getLevelFromXpLinear(long exp, CallbackInfoReturnable<Integer> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && exp >= 0) | ||
cir.setReturnValue((int) (exp / LabsConfig.advanced.aaEioLinearXp)); | ||
} | ||
|
||
@Inject(method = "getXpBarCapacity", at = @At("HEAD"), cancellable = true) | ||
private static void getLinearXPAmount(int level, CallbackInfoReturnable<Integer> cir) { | ||
if (LabsConfig.advanced.aaEioLinearXp != 0 && level >= 0) | ||
cir.setReturnValue(LabsConfig.advanced.aaEioLinearXp); | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"package": "com.nomiceu.nomilabs.mixin.actuallyadditions", | ||
"refmap": "mixins.nomilabs.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"TileEntityXPSolidifierMixin" | ||
], | ||
"client": [], | ||
"server": [] | ||
} |
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,12 @@ | ||
{ | ||
"package": "com.nomiceu.nomilabs.mixin.enderio", | ||
"refmap": "mixins.nomilabs.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"XPUtilMixin" | ||
], | ||
"client": [], | ||
"server": [] | ||
} |