Spiders now drop Cobweb rarely

This commit is contained in:
Ellpeck 2015-07-17 07:38:55 +02:00
parent 50c8f3991f
commit a50f409b60
5 changed files with 17 additions and 2 deletions

View file

@ -37,6 +37,8 @@ public enum ConfigBoolValues{
DO_COFFEE_GEN("Coffee Gen", ConfigCategories.WORLD_GEN, true, "If Coffee should generate in the World"), DO_COFFEE_GEN("Coffee Gen", ConfigCategories.WORLD_GEN, true, "If Coffee should generate in the World"),
DO_TREASURE_CHEST_GEN("Treasure Chest Gen", ConfigCategories.WORLD_GEN, true, "If Treasure Chests should generate in the World"), DO_TREASURE_CHEST_GEN("Treasure Chest Gen", ConfigCategories.WORLD_GEN, true, "If Treasure Chests should generate in the World"),
DO_SPIDER_DROPS("Spider Cobweb Drop", ConfigCategories.MOB_DROPS, true, "If Cobwebs should sometimes drop from Spiders"),
PREVENT_OIL_OVERRIDE("Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Oil Fluids from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), PREVENT_OIL_OVERRIDE("Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Oil Fluids from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),
PREVENT_CANOLA_OVERRIDE("Canola Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Fluids from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), PREVENT_CANOLA_OVERRIDE("Canola Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Fluids from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),
PREVENT_OIL_BLOCK_OVERRIDE("Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Oil Blocks from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), PREVENT_OIL_BLOCK_OVERRIDE("Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Oil Blocks from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),

View file

@ -70,6 +70,7 @@ public enum ConfigIntValues{
DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"), DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"),
CAT_DROP_CHANCE("Cat Drops: Chance", ConfigCategories.OTHER, 5000, 5, 10000000, "The 1 in X chance for a Hairy Ball to Drop from a Cat with X being this value"), CAT_DROP_CHANCE("Cat Drops: Chance", ConfigCategories.OTHER, 5000, 5, 10000000, "The 1 in X chance for a Hairy Ball to Drop from a Cat with X being this value"),
SPIDER_DROP_CHANCE("Cobweb Drop from Spider: Chance", ConfigCategories.MOB_DROPS, 300, 1, 1000000000, "The 1 in X chance for a Cobweb to drop from a Spider"),
RICE_AMOUNT("Rice Amount", ConfigCategories.WORLD_GEN, 15, 1, 100, "The Chance of Rice generating"), RICE_AMOUNT("Rice Amount", ConfigCategories.WORLD_GEN, 15, 1, 100, "The Chance of Rice generating"),
CANOLA_AMOUNT("Canola Amount", ConfigCategories.WORLD_GEN, 10, 1, 50, "The Chance of Canola generating"), CANOLA_AMOUNT("Canola Amount", ConfigCategories.WORLD_GEN, 10, 1, 50, "The Chance of Canola generating"),

View file

@ -1,9 +1,13 @@
package ellpeck.actuallyadditions.event; package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent;
@ -14,6 +18,7 @@ public class LivingDropEvent{
@SubscribeEvent @SubscribeEvent
public void onEntityDropEvent(LivingDropsEvent event){ public void onEntityDropEvent(LivingDropsEvent event){
if(event.source.getEntity() instanceof EntityPlayer){ if(event.source.getEntity() instanceof EntityPlayer){
//Drop Special Items (Solidified Experience, Pearl Shards etc.)
for(int i = 0; i < TheSpecialDrops.values().length; i++){ for(int i = 0; i < TheSpecialDrops.values().length; i++){
TheSpecialDrops theDrop = TheSpecialDrops.values()[i]; TheSpecialDrops theDrop = TheSpecialDrops.values()[i];
if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){ if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){
@ -22,6 +27,13 @@ public class LivingDropEvent{
} }
} }
} }
//Drop Cobwebs from Spiders
if(ConfigBoolValues.DO_SPIDER_DROPS.isEnabled() && event.entityLiving instanceof EntitySpider){
if(new Random().nextInt(ConfigIntValues.SPIDER_DROP_CHANCE.getValue()) <= 0){
event.entityLiving.entityDropItem(new ItemStack(Blocks.web, new Random().nextInt(2)+1), 0);
}
}
} }
} }
} }

View file

@ -55,7 +55,7 @@ public class ItemLeafBlower extends Item implements INameableItem{
if(block != null && (block instanceof BlockBush || (this.isAdvanced && block instanceof BlockLeavesBase))){ if(block != null && (block instanceof BlockBush || (this.isAdvanced && block instanceof BlockLeavesBase))){
WorldPos theCoord = new WorldPos(world, x+reachX, y+reachY, z+reachZ); WorldPos theCoord = new WorldPos(world, x+reachX, y+reachY, z+reachZ);
Block theBlock = world.getBlock(theCoord.getX(), theCoord.getY(), theCoord.getZ()); Block theBlock = world.getBlock(theCoord.getX(), theCoord.getY(), theCoord.getZ());
ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); ArrayList<ItemStack> drops = new ArrayList<>();
int meta = world.getBlockMetadata(theCoord.getX(), theCoord.getY(), theCoord.getZ()); int meta = world.getBlockMetadata(theCoord.getX(), theCoord.getY(), theCoord.getZ());
drops.addAll(theBlock.getDrops(world, theCoord.getX(), theCoord.getY(), theCoord.getZ(), meta, 0)); drops.addAll(theBlock.getDrops(world, theCoord.getX(), theCoord.getY(), theCoord.getZ(), meta, 0));

View file

@ -399,7 +399,7 @@ tooltip.actuallyadditions.itemJamChApCi.desc=Cherry, Apple and Cinnamon
tooltip.actuallyadditions.itemJamHoMeKi.desc=Honeydew Melon and Kiwi tooltip.actuallyadditions.itemJamHoMeKi.desc=Honeydew Melon and Kiwi
tooltip.actuallyadditions.itemJamPiCo.desc=Pineapple and Coconut tooltip.actuallyadditions.itemJamPiCo.desc=Pineapple and Coconut
tooltip.actuallyadditions.itemHairyBall.desc.1=A Ball of Hair dropped from a Cat... tooltip.actuallyadditions.itemHairyBall.desc.1=A Ball of Hair dropped from a (LIVING!) Cat...
tooltip.actuallyadditions.itemHairyBall.desc.2=Maybe you can get something from it by using it... tooltip.actuallyadditions.itemHairyBall.desc.2=Maybe you can get something from it by using it...
tooltip.actuallyadditions.blockPhantomRange.desc=Range tooltip.actuallyadditions.blockPhantomRange.desc=Range