mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-28 03:27:39 +01:00
Various fixes for Blast Mining.
This commit is contained in:
parent
b4b0bbd081
commit
86e373b493
@ -19,7 +19,6 @@ package com.gmail.nossr50.config;
|
||||
import java.util.*;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -37,7 +36,7 @@ public class Misc
|
||||
public ArrayList<Block> treeFeller = new ArrayList<Block>();
|
||||
public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
|
||||
public ArrayList<LivingEntity> bleedTracker = new ArrayList<LivingEntity>();
|
||||
public HashMap<Location, Integer> tntTracker = new HashMap<Location, Integer>();
|
||||
public HashMap<Block, Integer> tntTracker = new HashMap<Block, Integer>();
|
||||
mcMMO plugin = null;
|
||||
|
||||
//BLEED QUE STUFF
|
||||
|
@ -83,7 +83,7 @@ public class mcBlockListener implements Listener
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int skill = PP.getSkillLevel(SkillType.MINING);
|
||||
plugin.misc.tntTracker.put(block.getLocation(), skill);
|
||||
plugin.misc.tntTracker.put(block, skill);
|
||||
}
|
||||
|
||||
//Check if the blocks placed should be monitored so they do not give out XP in the future
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.gmail.nossr50.listeners;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -217,8 +218,13 @@ public class mcEntityListener implements Listener
|
||||
{
|
||||
if(event.getEntity() instanceof TNTPrimed)
|
||||
{
|
||||
int skillLevel = plugin.misc.tntTracker.get(event.getEntity().getLocation());
|
||||
BlastMining.biggerBombs(skillLevel, event);
|
||||
Block block = event.getEntity().getLocation().getBlock();
|
||||
|
||||
if(plugin.misc.tntTracker.get(block) != null)
|
||||
{
|
||||
int skillLevel = plugin.misc.tntTracker.get(block);
|
||||
BlastMining.biggerBombs(skillLevel, event);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -228,8 +234,13 @@ public class mcEntityListener implements Listener
|
||||
{
|
||||
if(event.getEntity() instanceof TNTPrimed)
|
||||
{
|
||||
int skillLevel = plugin.misc.tntTracker.get(event.getEntity().getLocation());
|
||||
BlastMining.dropProcessing(skillLevel, event, plugin);
|
||||
Block block = event.getLocation().getBlock();;
|
||||
|
||||
if(plugin.misc.tntTracker.get(block) != null)
|
||||
{
|
||||
int skillLevel = plugin.misc.tntTracker.get(block);
|
||||
BlastMining.dropProcessing(skillLevel, event, plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ public class BlastMining{
|
||||
if(skillLevel < 125)
|
||||
return;
|
||||
|
||||
//Drop 10% more ores
|
||||
//+5% ores
|
||||
if(skillLevel >= 125 && skillLevel < 250)
|
||||
{
|
||||
event.setYield(0);
|
||||
@ -160,7 +160,7 @@ public class BlastMining{
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < (yield + 10))
|
||||
if(Math.random() < (yield + .05))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -169,7 +169,7 @@ public class BlastMining{
|
||||
while(iterator3.hasNext())
|
||||
{
|
||||
Block temp = iterator3.next();
|
||||
if(Math.random() * 100 < yield)
|
||||
if(Math.random() < yield)
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -177,7 +177,7 @@ public class BlastMining{
|
||||
}
|
||||
}
|
||||
|
||||
//Drop 20% more ores
|
||||
//+10% ores
|
||||
if(skillLevel >= 250 && skillLevel < 375)
|
||||
{
|
||||
event.setYield(0);
|
||||
@ -186,7 +186,7 @@ public class BlastMining{
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < (yield + 20))
|
||||
if(Math.random() < (yield + .10))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -195,7 +195,7 @@ public class BlastMining{
|
||||
while(iterator3.hasNext())
|
||||
{
|
||||
Block temp = iterator3.next();
|
||||
if(Math.random() * 100 < yield)
|
||||
if(Math.random() < yield)
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -203,8 +203,8 @@ public class BlastMining{
|
||||
}
|
||||
}
|
||||
|
||||
//No debris
|
||||
if(skillLevel >= 375 && skillLevel < 625)
|
||||
//No debris, +15% ores
|
||||
if(skillLevel >= 375 && skillLevel < 500)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
@ -212,7 +212,7 @@ public class BlastMining{
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < yield + 20)
|
||||
if(Math.random() < (yield + .15))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -220,8 +220,8 @@ public class BlastMining{
|
||||
}
|
||||
}
|
||||
|
||||
//Double Drops
|
||||
if(skillLevel >= 625 && skillLevel < 875)
|
||||
//No debris, +20% ores
|
||||
if(skillLevel >= 500 && skillLevel < 625)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
@ -229,7 +229,24 @@ public class BlastMining{
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < yield + 20)
|
||||
if(Math.random() < (yield + .20))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Double Drops, No Debris, +25% ores
|
||||
if(skillLevel >= 625 && skillLevel < 750)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() < (yield + .25))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -242,8 +259,8 @@ public class BlastMining{
|
||||
}
|
||||
}
|
||||
|
||||
//Triple Drops
|
||||
if(skillLevel >= 875)
|
||||
//Double Drops, No Debris, +30% ores
|
||||
if(skillLevel >= 750 && skillLevel < 875)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
@ -251,7 +268,56 @@ public class BlastMining{
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < yield + 20)
|
||||
if(Math.random() < (yield + .30))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
if(Math.random() * 1000 <= skillLevel)
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Triple Drops, No debris, +35% ores
|
||||
if(skillLevel >= 875 && skillLevel < 1000)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < (yield + .35))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
if(Math.random() * 1000 <= skillLevel || skillLevel > 1000)
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
}
|
||||
if(Math.random() * 1000 <= skillLevel || skillLevel > 1000)
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Triple Drops, No debris, +40% ores
|
||||
if(skillLevel >= 1000)
|
||||
{
|
||||
event.setYield(0);
|
||||
Iterator<Block> iterator2 = ores.iterator();
|
||||
|
||||
while(iterator2.hasNext())
|
||||
{
|
||||
Block temp = iterator2.next();
|
||||
if(Math.random() * 100 < (yield + .40))
|
||||
{
|
||||
if(temp.getData() != 5 && plugin.misc.blockWatchList.contains(temp));
|
||||
explosionBlockDrops(temp, event.getLocation());
|
||||
@ -270,7 +336,6 @@ public class BlastMining{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Bigger Bombs (Unlocked at Mining 250)
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user