mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Updates to Blast Mining.
This commit is contained in:
parent
fadbaf429d
commit
8254a8ab0f
@ -60,7 +60,8 @@ public class LoadProperties {
|
|||||||
levelCapFishing, levelCapHerbalism, levelCapMining, levelCapRepair,
|
levelCapFishing, levelCapHerbalism, levelCapMining, levelCapRepair,
|
||||||
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting,
|
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting,
|
||||||
anvilID, saveInterval, fishingTier1, fishingTier2, fishingTier3, fishingTier4, fishingTier5,
|
anvilID, saveInterval, fishingTier1, fishingTier2, fishingTier3, fishingTier4, fishingTier5,
|
||||||
repairStoneLevel, repairIronLevel, repairGoldLevel, arcaneRank1, arcaneRank2, arcaneRank3, arcaneRank4;
|
repairStoneLevel, repairIronLevel, repairGoldLevel, arcaneRank1, arcaneRank2, arcaneRank3, arcaneRank4,
|
||||||
|
detonatorID;
|
||||||
|
|
||||||
public static double xpbackground_r, xpbackground_g, xpbackground_b,
|
public static double xpbackground_r, xpbackground_g, xpbackground_b,
|
||||||
xpborder_r, xpborder_g, xpborder_b, fishing_r, fishing_g,
|
xpborder_r, xpborder_g, xpborder_b, fishing_r, fishing_g,
|
||||||
@ -403,5 +404,7 @@ public class LoadProperties {
|
|||||||
blazeXP = readDouble("Experience.Combat.Multiplier.Blaze", 3.0);
|
blazeXP = readDouble("Experience.Combat.Multiplier.Blaze", 3.0);
|
||||||
magmacubeXP = readDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0);
|
magmacubeXP = readDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0);
|
||||||
enderdragonXP = readDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0);
|
enderdragonXP = readDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0);
|
||||||
|
|
||||||
|
detonatorID = readInteger("Skills.Mining.Detonator_ID", 259);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -73,10 +73,7 @@ public class mcBlockListener implements Listener
|
|||||||
|
|
||||||
//TNT placement checks - needed for Blast Mining
|
//TNT placement checks - needed for Blast Mining
|
||||||
if(id == 46 && mcPermissions.getInstance().blastMining(player))
|
if(id == 46 && mcPermissions.getInstance().blastMining(player))
|
||||||
{
|
|
||||||
int skill = Users.getProfile(player).getSkillLevel(SkillType.MINING);
|
|
||||||
plugin.misc.tntTracker.put(block.getLocation(), player);
|
plugin.misc.tntTracker.put(block.getLocation(), player);
|
||||||
}
|
|
||||||
|
|
||||||
//Check if the blocks placed should be monitored so they do not give out XP in the future
|
//Check if the blocks placed should be monitored so they do not give out XP in the future
|
||||||
if(m.shouldBeWatched(mat))
|
if(m.shouldBeWatched(mat))
|
||||||
@ -159,6 +156,9 @@ public class mcBlockListener implements Listener
|
|||||||
/*
|
/*
|
||||||
* MINING
|
* MINING
|
||||||
*/
|
*/
|
||||||
|
//TNT removal checks - needed for Blast Mining
|
||||||
|
if(id == 46 && plugin.misc.tntTracker.containsKey(block.getLocation()))
|
||||||
|
plugin.misc.tntTracker.remove(block.getLocation());
|
||||||
|
|
||||||
if(mcPermissions.getInstance().mining(player))
|
if(mcPermissions.getInstance().mining(player))
|
||||||
{
|
{
|
||||||
|
@ -181,19 +181,15 @@ public class mcEntityListener implements Listener
|
|||||||
if(event.getEntity() instanceof TNTPrimed)
|
if(event.getEntity() instanceof TNTPrimed)
|
||||||
{
|
{
|
||||||
Location location = event.getEntity().getLocation();
|
Location location = event.getEntity().getLocation();
|
||||||
System.out.println("TNT Primed.");
|
|
||||||
|
|
||||||
//Ugly code to make it recognize the location
|
//Ugly code to make it recognize the location
|
||||||
location.setX(location.getBlockX()+1);
|
location.setX(location.getBlockX()+1);
|
||||||
location.setY(location.getBlockY());
|
location.setY(location.getBlockY());
|
||||||
location.setZ(location.getBlockZ()+1);
|
location.setZ(location.getBlockZ()+1);
|
||||||
System.out.println(location.toString());
|
|
||||||
|
|
||||||
if(plugin.misc.tntTracker.get(location) != null)
|
if(plugin.misc.tntTracker.containsKey(location))
|
||||||
{
|
{
|
||||||
System.out.println("Being Tracked.");
|
|
||||||
Player player = plugin.misc.tntTracker.get(location);
|
Player player = plugin.misc.tntTracker.get(location);
|
||||||
|
|
||||||
BlastMining.biggerBombs(Users.getProfile(player).getSkillLevel(SkillType.MINING), event);
|
BlastMining.biggerBombs(Users.getProfile(player).getSkillLevel(SkillType.MINING), event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,19 +201,17 @@ public class mcEntityListener implements Listener
|
|||||||
if(event.getEntity() instanceof TNTPrimed)
|
if(event.getEntity() instanceof TNTPrimed)
|
||||||
{
|
{
|
||||||
Location location = event.getEntity().getLocation();
|
Location location = event.getEntity().getLocation();
|
||||||
System.out.println("TNT Explode.");
|
|
||||||
|
|
||||||
//Ugly code to make it recognize the location
|
//Ugly code to make it recognize the location
|
||||||
location.setX(location.getBlockX()+1);
|
location.setX(location.getBlockX()+1);
|
||||||
location.setY(location.getBlockY());
|
location.setY(location.getBlockY());
|
||||||
location.setZ(location.getBlockZ()+1);
|
location.setZ(location.getBlockZ()+1);
|
||||||
System.out.println(location.toString());
|
|
||||||
|
|
||||||
if(plugin.misc.tntTracker.get(location) != null)
|
if(plugin.misc.tntTracker.containsKey(location))
|
||||||
{
|
{
|
||||||
System.out.println("Being Tracked.");
|
|
||||||
Player player = plugin.misc.tntTracker.get(location);
|
Player player = plugin.misc.tntTracker.get(location);
|
||||||
BlastMining.dropProcessing(Users.getProfile(player).getSkillLevel(SkillType.MINING), event, plugin);
|
BlastMining.dropProcessing(Users.getProfile(player).getSkillLevel(SkillType.MINING), event, plugin);
|
||||||
|
plugin.misc.tntTracker.remove(location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ public class mcPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(action == Action.RIGHT_CLICK_AIR)
|
if(action == Action.RIGHT_CLICK_AIR && is.getTypeId() == LoadProperties.detonatorID)
|
||||||
{
|
{
|
||||||
Block b = player.getTargetBlock(null, 100);
|
Block b = player.getTargetBlock(null, 100);
|
||||||
if(b.getType().equals(Material.TNT))
|
if(b.getType().equals(Material.TNT))
|
||||||
@ -290,8 +290,6 @@ public class mcPlayerListener implements Listener
|
|||||||
TNTPrimed tnt = player.getWorld().spawn(b.getLocation(), TNTPrimed.class);
|
TNTPrimed tnt = player.getWorld().spawn(b.getLocation(), TNTPrimed.class);
|
||||||
b.setType(Material.AIR);
|
b.setType(Material.AIR);
|
||||||
tnt.setFuseTicks(0);
|
tnt.setFuseTicks(0);
|
||||||
if(plugin.misc.tntTracker.get(tnt.getLocation()) != null)
|
|
||||||
System.out.println(tnt.getLocation().toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,7 @@ Skills:
|
|||||||
Mining:
|
Mining:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Requires_Pickaxe: true
|
Requires_Pickaxe: true
|
||||||
|
Detonator_ID: 259
|
||||||
Repair:
|
Repair:
|
||||||
Level_Cap: 0
|
Level_Cap: 0
|
||||||
Anvil_Messages: true
|
Anvil_Messages: true
|
||||||
|
Loading…
Reference in New Issue
Block a user