From 768194ffcc6973fbc1af0159f609867e73671f96 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 2 Jul 2015 19:03:44 +0200 Subject: [PATCH] Fixed a Bug with the ESD --- build.gradle | 2 +- .../config/ConfigValues.java | 2 +- .../actuallyadditions/event/InitEvents.java | 3 ++- ...{KilledEvent.java => LivingDropEvent.java} | 3 +-- .../event/LivingKillEvent.java | 20 +++++++++++++++++++ .../tile/TileEntityInputter.java | 4 ++-- .../actuallyadditions/util/ModUtil.java | 2 +- .../assets/actuallyadditions/lang/en_US.lang | 4 ++++ 8 files changed, 32 insertions(+), 8 deletions(-) rename src/main/java/ellpeck/actuallyadditions/event/{KilledEvent.java => LivingDropEvent.java} (97%) create mode 100644 src/main/java/ellpeck/actuallyadditions/event/LivingKillEvent.java diff --git a/build.gradle b/build.gradle index 0e4a9f207..f654b0a8c 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { apply plugin: 'forge' apply plugin: 'maven' -version = "1.7.10-0.0.6.3" +version = "1.7.10-0.0.6.4" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java index f6358d6ef..25d8c9a38 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java @@ -30,6 +30,6 @@ public class ConfigValues{ currConf.currentValue = config.getBoolean(currConf.name, currConf.category, currConf.defaultValue, currConf.desc); } - crusherRecipeExceptions = config.getStringList("Crusher Recipe Exceptions", ConfigCategories.CRUSHER_RECIPES.name, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered by the Crusher. This list uses OreDictionary Names of the Inputs only."); + crusherRecipeExceptions = config.getStringList("Crusher Recipe Exceptions", ConfigCategories.CRUSHER_RECIPES.name, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only."); } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java index e558b3cc1..82be3f69f 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java +++ b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java @@ -10,11 +10,12 @@ public class InitEvents{ Util.registerEvent(new SmeltEvent()); Util.registerEvent(new CraftEvent()); - Util.registerEvent(new KilledEvent()); + Util.registerEvent(new LivingDropEvent()); Util.registerEvent(new PickupEvent()); Util.registerEvent(new TooltipEvent()); Util.registerEvent(new EntityLivingEvent()); Util.registerEvent(new WorldDecorationEvent()); + //Util.registerEvent(new LivingKillEvent()); Util.registerEvent(new BucketFillEvent()); } diff --git a/src/main/java/ellpeck/actuallyadditions/event/KilledEvent.java b/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java similarity index 97% rename from src/main/java/ellpeck/actuallyadditions/event/KilledEvent.java rename to src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java index b7e1534b4..fb3739d34 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/KilledEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java @@ -9,7 +9,7 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent; import java.util.Random; -public class KilledEvent{ +public class LivingDropEvent{ @SubscribeEvent public void onEntityDropEvent(LivingDropsEvent event){ @@ -23,6 +23,5 @@ public class KilledEvent{ } } } - } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/LivingKillEvent.java b/src/main/java/ellpeck/actuallyadditions/event/LivingKillEvent.java new file mode 100644 index 000000000..7b95f5a22 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/event/LivingKillEvent.java @@ -0,0 +1,20 @@ +package ellpeck.actuallyadditions.event; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; + +public class LivingKillEvent{ + + private static final int SQUID_MESSAGES = 3; + + @SubscribeEvent + public void onDeathEvent(LivingDeathEvent event){ + /*if(event.source.getEntity() instanceof EntityPlayer){ + if(event.entity instanceof EntitySquid){ + String message = StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".squidKilled.desc."+(new Random().nextInt(SQUID_MESSAGES)+1)); + ((EntityPlayer)event.source.getEntity()).addChatComponentMessage(new ChatComponentText(message)); + event.source.getEntity().worldObj.playSoundAtEntity(event.source.getEntity(), "mob.wither.death", 0.3F, 0.001F); + } + }*/ + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index 66d0652aa..f9b675686 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -139,7 +139,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt ItemStack theStack = null; for(int i = theSlotToPull; i < this.slotToPullEnd; i++){ - if(i >= theInventory.getSizeInventory()) return; + if(i < 0 || i >= theInventory.getSizeInventory()) return; ItemStack tempStack = theInventory.getStackInSlot(i); if(tempStack != null){ @@ -201,7 +201,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt if(this.slots[0] != null){ ItemStack theStack = null; for(int i = theSlotToPut; i < this.slotToPutEnd; i++){ - if(i >= theInventory.getSizeInventory()) return; + if(i < 0 || i >= theInventory.getSizeInventory()) return; ItemStack tempStack = theInventory.getStackInSlot(i); if(tempStack != null){ diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index 228441c60..a5b51720a 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger; public class ModUtil{ - public static final String VERSION = "1.7.10-0.0.6.3"; + public static final String VERSION = "1.7.10-0.0.6.4"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 5eef799ed..695e353a3 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -554,6 +554,10 @@ info.actuallyadditions.update.download.desc=[{"text":"Download the newest Versio info.actuallyadditions.update.failed.desc=[{"text":"The Update Check for "},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"failed! Check your Internet Connection and the Logs for more Info!","color":"none"}] info.actuallyadditions.update.changelog.desc=Updates: %s +info.actuallyadditions.squidKilled.desc.1=You just killed a squid, am I right!? +info.actuallyadditions.squidKilled.desc.2=YOU DIDN'T JUST DO THAT! +info.actuallyadditions.squidKilled.desc.3=The thing you just did... someone's gonna be pissed about that! + achievement.actuallyadditions.pickUpSolidXP=Square and yummy! achievement.actuallyadditions.pickUpSolidXP.desc=Pick up some Solidified Experience achievement.actuallyadditions.craftKnifeBlade=Sharp! So Sharp!