This commit is contained in:
Shadows_of_Fire 2018-01-29 03:28:12 -05:00
parent 00e99d3611
commit 4412c62503
3 changed files with 12 additions and 14 deletions

View file

@ -50,7 +50,7 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer<TileEntityEmpower
AssetUtil.renderItemInWorld(stack);
}
catch(Exception e){
ModUtil.LOGGER.error("Something went wrong trying to render an item in an empowerer! The item is "+stack.getItem().getRegistryName()+"!", e);
ModUtil.LOGGER.error("Something went wrong trying to render an item in an empowerer! The item is " + stack.getItem().getRegistryName() + ":" + stack.getMetadata() + "!", e);
}
GlStateManager.popMatrix();

View file

@ -28,8 +28,9 @@ public enum ConfigIntValues{
FONT_SIZE_SMALL("Booklet Small Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's small font in percent. Set to 0 to use defaults from the lang file."),
FONT_SIZE_MEDIUM("Booklet Medium Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's medium font in percent. Set to 0 to use defaults from the lang file."),
FONT_SIZE_LARGE("Booklet Large Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's large font in percent. Set to 0 to use defaults from the lang file."),
ELEVEN("What is 11", ConfigCategories.OTHER, 11, 0, 12, "11?");
ELEVEN("What is 11", ConfigCategories.OTHER, 11, 0, 12, "11?"),
FUR_CHANCE("Fur Drop Chance", ConfigCategories.OTHER, 5000, 1, Integer.MAX_VALUE, "The 1/n drop chance, per tick, for a fur ball to be dropped.");
public final String name;
public final String category;

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.entity.item.EntityItem;
@ -40,17 +41,13 @@ public class ItemHairyBall extends ItemBase{
@SubscribeEvent
public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){
//Ocelots dropping Hair Balls
if(event.getEntityLiving() != null){
if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote){
if((event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed()) || (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled()){
if(event.getEntityLiving().world.rand.nextInt(5000)+1 == 1){
EntityItem item = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall));
event.getEntityLiving().world.spawnEntity(item);
}
}
}
}
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && event.getEntityLiving() != null && event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote){
if((event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed()) || (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){
if(event.getEntityLiving().world.rand.nextInt(ConfigIntValues.FUR_CHANCE.getValue()) == 0){
EntityItem item = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall));
event.getEntityLiving().world.spawnEntity(item);
}
}
}
}