mirror of
https://github.com/GTNewHorizons/EnderCore.git
synced 2026-11-18 19:29:09 +00:00
Merge pull request #28 from HenryLoenwind/getLessLevels
Round XP the same way vanilla does
This commit is contained in:
commit
c766f55dfd
1 file changed
+5
-6
@@ -62,14 +62,13 @@ public class Util {
|
||||
}
|
||||
|
||||
public static void giveExperience(EntityPlayer thePlayer, float experience) {
|
||||
if (experience < 1.0F) {
|
||||
int rndRound = MathHelper.floor_float(experience);
|
||||
if (rndRound < MathHelper.ceiling_float_int(experience) && (float) Math.random() < experience) {
|
||||
++rndRound;
|
||||
int intExp = (int) experience;
|
||||
float fractional = experience - intExp;
|
||||
if (fractional > 0.0F) {
|
||||
if ((float) Math.random() < fractional) {
|
||||
++intExp;
|
||||
}
|
||||
experience = rndRound;
|
||||
}
|
||||
int intExp = Math.round(experience);
|
||||
while (intExp > 0) {
|
||||
int j = EntityXPOrb.getXPSplit(intExp);
|
||||
intExp -= j;
|
||||
|
||||
Reference in new issue
Block a user