mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Solid XP drop config
This commit is contained in:
parent
b4decddd4b
commit
01909c9787
2 changed files with 9 additions and 5 deletions
|
@ -37,6 +37,7 @@ public enum ConfigBoolValues{
|
|||
|
||||
DO_SPIDER_DROPS("Spider Cobweb Drop", ConfigCategories.MOB_DROPS, true, "If Cobwebs should sometimes drop from Spiders"),
|
||||
DO_BAT_DROPS("Bat Wing Drop", ConfigCategories.MOB_DROPS, true, "If Wings should sometimes drop from Bats"),
|
||||
DO_XP_DROPS("Solidified XP Drop", ConfigCategories.MOB_DROPS, true, "If Mobs should randomly drop solidified XP occasionally"),
|
||||
|
||||
CTRL_EXTRA_INFO("Advanced Info", ConfigCategories.OTHER, true, "Show Advanced Item Info when holding Control on every Item"),
|
||||
CTRL_INFO_FOR_EXTRA_INFO("Advanced Info Tooltips", ConfigCategories.OTHER, true, "Show the 'Press Control for more Info'-Text on Item Tooltips"),
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.items;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
|
@ -37,11 +38,13 @@ public class ItemSolidifiedExperience extends ItemBase{
|
|||
|
||||
@SubscribeEvent
|
||||
public void onEntityDropEvent(LivingDropsEvent event){
|
||||
if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){
|
||||
//Drop Solidified XP
|
||||
if(event.getEntityLiving() instanceof EntityCreature){
|
||||
if(Util.RANDOM.nextInt(10) <= event.getLootingLevel()*2){
|
||||
event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0);
|
||||
if(ConfigBoolValues.DO_XP_DROPS.isEnabled()){
|
||||
if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){
|
||||
//Drop Solidified XP
|
||||
if(event.getEntityLiving() instanceof EntityCreature){
|
||||
if(Util.RANDOM.nextInt(10) <= event.getLootingLevel()*2){
|
||||
event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue