|
@@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
|
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
|
|
|
|
+import com.gmail.nossr50.events.McMMOReplaceVanillaTreasureEvent;
|
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
import com.gmail.nossr50.mcMMO;
|
|
import com.gmail.nossr50.mcMMO;
|
|
@@ -291,12 +292,20 @@ public class PlayerListener implements Listener {
|
|
if(event.getCaught() != null) {
|
|
if(event.getCaught() != null) {
|
|
Item fishingCatch = (Item) event.getCaught();
|
|
Item fishingCatch = (Item) event.getCaught();
|
|
|
|
|
|
- if (Config.getInstance(). getFishingOverrideTreasures() &&
|
|
|
|
|
|
+ if (Config.getInstance().getFishingOverrideTreasures() &&
|
|
fishingCatch.getItemStack().getType() != Material.SALMON &&
|
|
fishingCatch.getItemStack().getType() != Material.SALMON &&
|
|
fishingCatch.getItemStack().getType() != Material.COD &&
|
|
fishingCatch.getItemStack().getType() != Material.COD &&
|
|
fishingCatch.getItemStack().getType() != Material.TROPICAL_FISH &&
|
|
fishingCatch.getItemStack().getType() != Material.TROPICAL_FISH &&
|
|
fishingCatch.getItemStack().getType() != Material.PUFFERFISH) {
|
|
fishingCatch.getItemStack().getType() != Material.PUFFERFISH) {
|
|
- fishingCatch.setItemStack(new ItemStack(Material.SALMON, 1));
|
|
|
|
|
|
+
|
|
|
|
+ ItemStack replacementCatch = new ItemStack(Material.AIR);
|
|
|
|
+
|
|
|
|
+ McMMOReplaceVanillaTreasureEvent replaceVanillaTreasureEvent = new McMMOReplaceVanillaTreasureEvent(fishingCatch, replacementCatch);
|
|
|
|
+ Bukkit.getPluginManager().callEvent(replaceVanillaTreasureEvent);
|
|
|
|
+
|
|
|
|
+ //Replace
|
|
|
|
+ replacementCatch = replaceVanillaTreasureEvent.getReplacementItemStack();
|
|
|
|
+ fishingCatch.setItemStack(replacementCatch);
|
|
}
|
|
}
|
|
|
|
|
|
if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) {
|
|
if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) {
|