-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3989a37
commit a00b062
Showing
4 changed files
with
99 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
51 changes: 51 additions & 0 deletions
51
src/main/java/org/alvindimas05/lagassist/stacker/StackExp.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,51 @@ | ||
package org.alvindimas05.lagassist.stacker; | ||
|
||
|
||
import org.bukkit.entity.Entity; | ||
import org.bukkit.entity.EntityType; | ||
|
||
import java.util.Arrays; | ||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
// Sorry, the exp is hard coded here | ||
// Based on https://minecraft.wiki/w/Experience | ||
public class StackExp { | ||
static String[] commonFarmMobs = { | ||
"CREEPER", "DROWNED", "ENDERMEN", "HOGLIN", "HUSK", "PHANTOM", "PILLAGER", | ||
"SILVERFISH", "SKELETON", "STRAY", "VEX", "VINDICATOR", "WITCH", | ||
"WITHER_SKELETON", "ZOMBIE", "ZOMBIE_VILLAGER", "ZOGLIN", "ZOMBIFIED_PIGLIN", | ||
}; | ||
static int commonFarmExp = 5; | ||
|
||
static String[] uncommonFarmMobs = { | ||
"BLAZE", "ELDER_GUARDIAN", "EVOKER", "GUARDIAN" | ||
}; | ||
static int uncommonFarmExp = 10; | ||
|
||
static String[] rareFarmMobs = { | ||
"RAVAGER", "PIGLIN_BRUTE" | ||
}; | ||
static int rareFarmExp = 20; | ||
|
||
static String[] commonFarmAnimals = { | ||
"CHICKEN", "COD", "COW", "MOOSHROOM", "PIG", "RABBIT", "SALMON", "SHEEP" | ||
}; | ||
static int minCommonFarmAnimalExp = 1; | ||
static int maxCommonFarmAnimalExp = 3; | ||
|
||
public static int getExp(Entity ent){ | ||
String type = ent.getType().toString().toUpperCase(); | ||
|
||
if(Arrays.asList(commonFarmMobs).contains(type)){ | ||
return commonFarmExp; | ||
} else if(Arrays.asList(uncommonFarmMobs).contains(type)){ | ||
return uncommonFarmExp; | ||
} else if(Arrays.asList(rareFarmMobs).contains(type)){ | ||
return rareFarmExp; | ||
} else if(Arrays.asList(commonFarmAnimals).contains(type)){ | ||
return ThreadLocalRandom.current().nextInt(minCommonFarmAnimalExp, maxCommonFarmAnimalExp); | ||
} | ||
|
||
return 0; | ||
} | ||
} |
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