mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-19 10:22:58 +01:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
716dd02b3f | ||
|
|
5e93a4c9d3 | ||
|
|
cbeb994b69 | ||
|
|
43e3dd7977 | ||
|
|
598c507849 | ||
|
|
0b30920edd | ||
|
|
6cfd81faf9 | ||
|
|
cc9a6aa9b9 | ||
|
|
c8ff58bb6c | ||
|
|
dc77d9f434 | ||
|
|
7c87fc8316 | ||
|
|
0068a3f07a | ||
|
|
bb70289cb3 | ||
|
|
80abd0db91 | ||
|
|
bbef731be5 | ||
|
|
897f4d3694 | ||
|
|
2c380f609e | ||
|
|
aa9fe544a2 | ||
|
|
230435c29d | ||
|
|
4a2325f244 | ||
|
|
d920702389 | ||
|
|
16d56a45f2 | ||
|
|
3e62697567 | ||
|
|
219372212e | ||
|
|
3d401ac4cb | ||
|
|
20adf4674a |
@@ -1,6 +1,17 @@
|
||||
Changelog:
|
||||
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
|
||||
|
||||
Version 1.2.10
|
||||
- Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103)
|
||||
- Fixed issue with Spout images & sounds not working (Issue #93)
|
||||
- Fixed typo with repairing Leather Armor & Bows
|
||||
- Fixed issue with Silk Touch & Double/Triple drops not working properly
|
||||
- Fixed conflict with NoCheat plugin & Super Breaker/Giga Drill Breaker/Berserk/Leaf Blower (Issue #104)
|
||||
- Fixed counter-attacking non-LivingEntity (Issue #100 & Issue #107)
|
||||
- Fixed various bugs with Leaf Blower
|
||||
- Added Monitor & ignoreCancelledEvents to onBlockPlace
|
||||
- Made Anvil ID configurable
|
||||
|
||||
Version 1.2.09
|
||||
- Fixed issue with Repair Mastery (Issue #47)
|
||||
- Made Arcane Forging fully configurable (Pull Request #52)
|
||||
|
||||
10
pom.xml
10
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>1.2.09</version>
|
||||
<version>1.2.10</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/TheYeti/mcMMO</url>
|
||||
<issueManagement>
|
||||
@@ -23,7 +23,7 @@
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/xpbar/</directory>
|
||||
<includes>
|
||||
<include>xpbar*.png</include>
|
||||
@@ -31,7 +31,7 @@
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/healthbar/</directory>
|
||||
<includes>
|
||||
<include>health*.png</include>
|
||||
@@ -39,7 +39,7 @@
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/skillicon/</directory>
|
||||
<includes>
|
||||
<include>*.png</include>
|
||||
@@ -47,7 +47,7 @@
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/sound/</directory>
|
||||
<includes>
|
||||
<include>*.wav</include>
|
||||
|
||||
@@ -51,33 +51,6 @@ public class McmmoCommand implements CommandExecutor {
|
||||
player.sendMessage(ChatColor.GREEN + "If you like my work you can donate via Paypal: theno1yeti@gmail.com");
|
||||
}
|
||||
|
||||
GregorianCalendar cakedayStart = new GregorianCalendar(2012, Calendar.FEBRUARY, 3);
|
||||
GregorianCalendar cakedayEnd = new GregorianCalendar(2012, Calendar.FEBRUARY, 6);
|
||||
GregorianCalendar day = new GregorianCalendar();
|
||||
int cakeCheck = 0;
|
||||
|
||||
for (String cake : mcMMO.gotCake)
|
||||
{
|
||||
if (player.getName().equalsIgnoreCase(cake)) {
|
||||
cakeCheck = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (cakeCheck == 0) {
|
||||
if (getDateRange(day.getTime(), cakedayStart.getTime(), cakedayEnd.getTime()))
|
||||
{
|
||||
player.sendMessage(ChatColor.BLUE + "Happy 1 Year Anniversary! In honor of all of");
|
||||
player.sendMessage(ChatColor.BLUE + "nossr50's work and all the devs, have some cake!");
|
||||
}
|
||||
mcMMO.gotCake.add(player.getName());
|
||||
player.getInventory().addItem(new ItemStack(Material.CAKE_BLOCK, 1));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean getDateRange(Date date, Date start, Date end)
|
||||
{
|
||||
return !(date.before(start) || date.after(end));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,8 @@ public class LoadProperties {
|
||||
mvines, mlilypad, mnetherbrick, mendstone, mmossstone, mstonebrick,
|
||||
levelCapAcrobatics, levelCapArchery, levelCapAxes, levelCapExcavation,
|
||||
levelCapFishing, levelCapHerbalism, levelCapMining, levelCapRepair,
|
||||
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting;
|
||||
levelCapSwords, levelCapTaming, levelCapUnarmed, levelCapWoodcutting,
|
||||
anvilID;
|
||||
|
||||
public static double xpbackground_r, xpbackground_g, xpbackground_b,
|
||||
xpborder_r, xpborder_g, xpborder_b, fishing_r, fishing_g,
|
||||
@@ -255,7 +256,7 @@ public class LoadProperties {
|
||||
mdiamond = readInteger("Experience.Mining.Diamond", 750);
|
||||
miron = readInteger("Experience.Mining.Iron", 250);
|
||||
mredstone = readInteger("Experience.Mining.Redstone", 150);
|
||||
mlapis = readInteger("Experience.Mining.lapis", 400);
|
||||
mlapis = readInteger("Experience.Mining.Lapis", 400);
|
||||
mobsidian = readInteger("Experience.Mining.Obsidian", 150);
|
||||
mnetherrack = readInteger("Experience.Mining.Netherrack", 30);
|
||||
mglowstone = readInteger("Experience.Mining.Glowstone", 30);
|
||||
@@ -327,6 +328,7 @@ public class LoadProperties {
|
||||
acrobaticsxpmodifier = readDouble("Experience.Formula.Multiplier.Acrobatics", 1.0);
|
||||
|
||||
anvilmessages = readBoolean("Skills.Repair.Anvil_Messages", true);
|
||||
anvilID = readInteger("Skills.Repair.Anvil_ID", 42);
|
||||
|
||||
rGold = readInteger("Skills.Repair.Gold.ID", 266);
|
||||
nGold = readString("Skills.Repair.Gold.Name", "Gold Bars");
|
||||
@@ -341,7 +343,7 @@ public class LoadProperties {
|
||||
rString = readInteger("Skills.Repair.String.ID", 287);
|
||||
nString = readString("Skills.Repair.String.Name", "String");
|
||||
rLeather = readInteger("Skills.Repair.Leather.ID", 334);
|
||||
nLeather = readString("Skills.Repair.String.Name", "Leather");
|
||||
nLeather = readString("Skills.Repair.Leather.Name", "Leather");
|
||||
|
||||
levelCapAcrobatics = readInteger("Skills.Acrobatics.Level_Cap", 0);
|
||||
levelCapArchery = readInteger("Skills.Archery.Level_Cap", 0);
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -36,6 +37,7 @@ import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.getspout.spoutapi.SpoutManager;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
@@ -56,9 +58,11 @@ public class mcBlockListener implements Listener
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onBlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
{
|
||||
if(event.isCancelled()) return;
|
||||
|
||||
//Setup some basic vars
|
||||
Block block;
|
||||
Player player = event.getPlayer();
|
||||
@@ -90,7 +94,7 @@ public class mcBlockListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
if(block.getTypeId() == 42 && LoadProperties.anvilmessages)
|
||||
if(block.getTypeId() == LoadProperties.anvilID && LoadProperties.anvilmessages)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
if(LoadProperties.spoutEnabled)
|
||||
@@ -157,6 +161,7 @@ public class mcBlockListener implements Listener
|
||||
/*
|
||||
* MINING
|
||||
*/
|
||||
|
||||
if(mcPermissions.getInstance().mining(player))
|
||||
{
|
||||
if(LoadProperties.miningrequirespickaxe)
|
||||
@@ -170,47 +175,24 @@ public class mcBlockListener implements Listener
|
||||
Mining.miningBlockCheck(player, block, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* WOOD CUTTING
|
||||
*/
|
||||
|
||||
if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player))
|
||||
if(mcPermissions.getInstance().woodcutting(player))
|
||||
{
|
||||
if(LoadProperties.woodcuttingrequiresaxe)
|
||||
{
|
||||
if(m.isAxes(inhand))
|
||||
{
|
||||
if(!plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
//Default
|
||||
if(block.getData() == (byte)0)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
|
||||
//Spruce
|
||||
if(block.getData() == (byte)1)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
|
||||
//Birch
|
||||
if(block.getData() == (byte)2)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
|
||||
}
|
||||
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(!plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
//Default
|
||||
if(block.getData() == (byte)0)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
|
||||
//Spruce
|
||||
if(block.getData() == (byte)1)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
|
||||
//Birch
|
||||
if(block.getData() == (byte)2)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
|
||||
}
|
||||
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
||||
}
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
|
||||
/*
|
||||
* IF PLAYER IS USING TREEFELLER
|
||||
@@ -259,7 +241,7 @@ public class mcBlockListener implements Listener
|
||||
}
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
if(!inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
plugin.misc.treeFeller.clear();
|
||||
@@ -269,7 +251,7 @@ public class mcBlockListener implements Listener
|
||||
* EXCAVATION
|
||||
*/
|
||||
if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
|
||||
Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
/*
|
||||
* HERBALISM
|
||||
*/
|
||||
@@ -334,54 +316,21 @@ public class mcBlockListener implements Listener
|
||||
/*
|
||||
* GIGA DRILL BREAKER CHECKS
|
||||
*/
|
||||
if(PP.getGigaDrillBreakerMode() && m.blockBreakSimulate(block, player)
|
||||
&& Excavation.canBeGigaDrillBroken(block) && m.isShovel(inhand))
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
while(x < 3)
|
||||
if(PP.getGigaDrillBreakerMode()
|
||||
&& Excavation.canBeGigaDrillBroken(block)
|
||||
&& m.blockBreakSimulate(block, player)
|
||||
&& mcPermissions.getInstance().excavationAbility(player))
|
||||
{
|
||||
if(LoadProperties.excavationRequiresShovel)
|
||||
{
|
||||
if(block.getData() != (byte)5)
|
||||
Excavation.excavationProcCheck(block.getData(), block.getType(), block.getLocation(), player);
|
||||
x++;
|
||||
if(m.isShovel(inhand)){
|
||||
event.setInstaBreak(true);
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
}
|
||||
} else {
|
||||
event.setInstaBreak(true);
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
}
|
||||
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
|
||||
if(block.getType() == Material.GRASS)
|
||||
mat = Material.DIRT;
|
||||
if(block.getType() == Material.CLAY)
|
||||
mat = Material.CLAY_BALL;
|
||||
if(block.getType() == Material.MYCEL)
|
||||
mat = Material.DIRT;
|
||||
|
||||
byte type = block.getData();
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
|
||||
|
||||
block.setType(Material.AIR);
|
||||
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(item.getType() == Material.CLAY_BALL)
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
} else
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
}
|
||||
|
||||
//Spout stuff
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
/*
|
||||
* BERSERK MODE CHECKS
|
||||
@@ -389,80 +338,59 @@ public class mcBlockListener implements Listener
|
||||
if(PP.getBerserkMode()
|
||||
&& m.blockBreakSimulate(block, player)
|
||||
&& player.getItemInHand().getTypeId() == 0
|
||||
&& (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78))
|
||||
&& (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78)
|
||||
&& mcPermissions.getInstance().unarmedAbility(player))
|
||||
{
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
|
||||
if(block.getTypeId() == 2)
|
||||
mat = Material.DIRT;
|
||||
if(block.getTypeId() == 78)
|
||||
mat = Material.SNOW_BALL;
|
||||
if(block.getTypeId() == 82)
|
||||
mat = Material.CLAY_BALL;
|
||||
if(block.getTypeId() == 110)
|
||||
mat = Material.DIRT;
|
||||
|
||||
byte type = block.getData();
|
||||
event.setInstaBreak(true);
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, type);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
|
||||
|
||||
block.setType(Material.AIR);
|
||||
|
||||
if(item.getType() == Material.CLAY_BALL)
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
} else
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
}
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
|
||||
/*
|
||||
* SUPER BREAKER CHECKS
|
||||
*/
|
||||
if(PP.getSuperBreakerMode()
|
||||
&& Mining.canBeSuperBroken(block)
|
||||
&& m.blockBreakSimulate(block, player))
|
||||
&& Mining.canBeSuperBroken(block)
|
||||
&& m.blockBreakSimulate(block, player)
|
||||
&& mcPermissions.getInstance().miningAbility(player))
|
||||
{
|
||||
|
||||
if(LoadProperties.miningrequirespickaxe)
|
||||
{
|
||||
if(m.isMiningPick(inhand))
|
||||
if(m.isMiningPick(inhand)){
|
||||
event.setInstaBreak(true);
|
||||
Mining.SuperBreakerBlockCheck(player, block, plugin);
|
||||
}
|
||||
} else {
|
||||
event.setInstaBreak(true);
|
||||
Mining.SuperBreakerBlockCheck(player, block, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* LEAF BLOWER
|
||||
* LEAF BLOWER CHECKS
|
||||
*/
|
||||
if(block.getTypeId() == 18 && mcPermissions.getInstance().woodcutting(player) && PP.getSkillLevel(SkillType.WOODCUTTING) >= 100 && m.isAxes(player.getItemInHand()) && m.blockBreakSimulate(block, player))
|
||||
if(block.getTypeId() == 18
|
||||
&& mcPermissions.getInstance().woodCuttingAbility(player)
|
||||
&& PP.getSkillLevel(SkillType.WOODCUTTING) >= 100
|
||||
&& m.blockBreakSimulate(block, player))
|
||||
{
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(inhand.getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(Math.random() * 10 > 9)
|
||||
if(LoadProperties.woodcuttingrequiresaxe)
|
||||
{
|
||||
ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, (byte)(block.getData()-8));
|
||||
m.mcDropItem(block.getLocation(), x);
|
||||
if(m.isAxes(inhand)){
|
||||
event.setInstaBreak(true);
|
||||
WoodCutting.leafBlower(player, block);
|
||||
}
|
||||
}
|
||||
block.setType(Material.AIR);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
else{
|
||||
event.setInstaBreak(true);
|
||||
WoodCutting.leafBlower(player, block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(block.getType() == Material.AIR && plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
plugin.misc.blockWatchList.remove(block);
|
||||
|
||||
@@ -199,7 +199,7 @@ public class mcPlayerListener implements Listener
|
||||
}
|
||||
|
||||
if(block != null && player != null && mcPermissions.getInstance().repair(player)
|
||||
&& event.getClickedBlock().getTypeId() == 42 && (Repair.isTools(player.getItemInHand()) || Repair.isArmor(player.getItemInHand())))
|
||||
&& event.getClickedBlock().getTypeId() == LoadProperties.anvilID && (Repair.isTools(player.getItemInHand()) || Repair.isArmor(player.getItemInHand())))
|
||||
{
|
||||
Repair.repairCheck(player, is, event.getClickedBlock());
|
||||
event.setCancelled(true);
|
||||
|
||||
@@ -95,7 +95,7 @@ public class m
|
||||
return id == 2 || id == 3 || id == 12 || id == 13 || id == 82 || //Excavation
|
||||
id == 1 || id == 14 || id == 15 || id == 16 || id == 21 || id == 24 || id == 49 || id == 56 || id == 73 || id == 74 || id == 87 || id == 89 || id == 112 || id == 121 || id == 48 || id == 98 || //Mining
|
||||
id == 17 || id == 37 || id == 38 || id == 39 || id == 40 || id == 81 || id == 83 || id == 86 || id == 91 || id == 103 || id == 106 || id == 111 || //Woodcutting & Herbalism
|
||||
id == 42; //Anvil
|
||||
id == LoadProperties.anvilID; //Anvil
|
||||
}
|
||||
|
||||
public static int getPowerLevel(Player player)
|
||||
@@ -210,7 +210,7 @@ public class m
|
||||
public static boolean abilityBlockCheck(Block block)
|
||||
{
|
||||
int i = block.getTypeId();
|
||||
if(i == 107 ||i == 117 || i == 116 || i == 96 || i == 68 || i == 355 || i == 26 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){
|
||||
if(i == 107 ||i == 117 || i == 116 || i == 96 || i == 68 || i == 355 || i == 26 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == LoadProperties.anvilID || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
||||
@@ -96,8 +96,6 @@ public class mcMMO extends JavaPlugin
|
||||
public static Database database = null;
|
||||
public Misc misc = new Misc(this);
|
||||
|
||||
public static ArrayList<String> gotCake;
|
||||
|
||||
//Config file stuff
|
||||
LoadProperties config;
|
||||
//Jar stuff
|
||||
@@ -126,36 +124,6 @@ public class mcMMO extends JavaPlugin
|
||||
//Catch all for versions not matching and no specific code being needed
|
||||
else if(!vnum.equalsIgnoreCase(this.getDescription().getVersion())) updateFrom(-1);
|
||||
}
|
||||
File cakeFile = new File(getDataFolder().getAbsolutePath() + File.separator + "cake");
|
||||
|
||||
if (!cakeFile.exists()) {
|
||||
try {
|
||||
cakeFile.createNewFile();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
}
|
||||
|
||||
gotCake = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
gotCake.clear();
|
||||
BufferedReader reader = new BufferedReader(new FileReader(getDataFolder().getAbsolutePath() + File.separator + "players"));
|
||||
String line = reader.readLine();
|
||||
|
||||
while(line != null) {
|
||||
gotCake.add(line);
|
||||
line = reader.readLine();
|
||||
}
|
||||
|
||||
reader.close();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
|
||||
mcPermissions.initialize(getServer());
|
||||
|
||||
this.config = new LoadProperties(this);
|
||||
this.config.load();
|
||||
@@ -170,7 +138,7 @@ public class mcMMO extends JavaPlugin
|
||||
*/
|
||||
|
||||
PluginManager pm = getServer().getPluginManager();
|
||||
|
||||
|
||||
if(pm.getPlugin("Spout") != null)
|
||||
LoadProperties.spoutEnabled = true;
|
||||
else
|
||||
@@ -285,18 +253,6 @@ public class mcMMO extends JavaPlugin
|
||||
return permissions;
|
||||
}
|
||||
public void onDisable() {
|
||||
try {
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(getDataFolder().getAbsolutePath() + File.separator + "cake"));
|
||||
for (String player : gotCake) {
|
||||
writer.write(player);
|
||||
writer.newLine();
|
||||
}
|
||||
writer.close();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().cancelTasks(this);
|
||||
System.out.println("mcMMO was disabled.");
|
||||
}
|
||||
|
||||
@@ -17,18 +17,24 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
|
||||
public class Excavation
|
||||
{
|
||||
@@ -74,7 +80,7 @@ public class Excavation
|
||||
Material t = block.getType();
|
||||
return t == Material.DIRT || t == Material.GRASS || t == Material.SAND || t == Material.GRAVEL || t == Material.CLAY || t == Material.MYCEL || t == Material.SOUL_SAND;
|
||||
}
|
||||
public static void excavationProcCheck(byte data, Material type, Location loc, Player player)
|
||||
public static void excavationProcCheck(Material type, Location loc, Player player)
|
||||
{
|
||||
if(LoadProperties.excavationRequiresShovel && !m.isShovel(player.getItemInHand()))
|
||||
return;
|
||||
@@ -253,4 +259,25 @@ public class Excavation
|
||||
PP.addXP(SkillType.EXCAVATION, xp, player);
|
||||
Skills.XpCheckSkill(SkillType.EXCAVATION, player);
|
||||
}
|
||||
|
||||
public static void gigaDrillBreaker(Player player, Block block)
|
||||
{
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(block.getData() != (byte)5)
|
||||
{
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
}
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import net.minecraft.server.Enchantment;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Statistic;
|
||||
@@ -25,6 +24,8 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
@@ -90,7 +91,7 @@ public class Mining
|
||||
}
|
||||
|
||||
//Drop natural block with Silk Touch
|
||||
if(player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH)){
|
||||
if(player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)){
|
||||
m.mcDropItem(loc, item);
|
||||
return;
|
||||
}
|
||||
@@ -271,260 +272,134 @@ public class Mining
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
//Pre-processing
|
||||
Location loc = block.getLocation();
|
||||
int id = block.getTypeId();
|
||||
Material mat = Material.getMaterial(id);
|
||||
int xp = 0;
|
||||
byte damage = 0;
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
boolean silkTouch = player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH);
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
|
||||
//STONE
|
||||
if(id == 1)
|
||||
if(id == 1 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5)
|
||||
{
|
||||
xp += LoadProperties.mstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(4);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//SANDSTONE
|
||||
else if(id == 24)
|
||||
else if(id == 24 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5)
|
||||
{
|
||||
xp += LoadProperties.msandstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.msandstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//NETHERRACK
|
||||
else if(id == 87)
|
||||
else if(id == 87 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mnetherrack;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mnetherrack;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//GLOWSTONE
|
||||
else if(id == 89)
|
||||
else if(id == 89 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mglowstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(348);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mglowstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//COAL
|
||||
else if(id == 16)
|
||||
else if(id == 16 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mcoal;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(263);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mcoal;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//GOLD
|
||||
else if(id == 14 && m.getTier(player) >= 3)
|
||||
else if(id == 14 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mgold;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mgold;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//OBSIDIAN
|
||||
else if(id == 49 && m.getTier(player) >= 4)
|
||||
else if(id == 49 && m.getTier(player) >= 4 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mobsidian;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mobsidian;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//DIAMOND
|
||||
else if(id == 56 && m.getTier(player) >= 3)
|
||||
else if(id == 56 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mdiamond;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(264);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mdiamond;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//IRON
|
||||
else if(id == 15 && m.getTier(player) >= 2)
|
||||
else if(id == 15 && m.getTier(player) >= 2 && block.getData() != (byte) 5)
|
||||
{
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.miron;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.miron;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//REDSTONE
|
||||
else if((id == 73 || id == 74) && m.getTier(player) >= 3)
|
||||
else if((id == 73 || id == 74) && m.getTier(player) >= 3 && !plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
if(!plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
xp += LoadProperties.mredstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(331);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mredstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//LAPIS
|
||||
else if(id == 21 && m.getTier(player) >= 3){
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mlapis;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(351);
|
||||
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
else if(id == 21 && m.getTier(player) >= 3 && block.getData() != (byte) 5)
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mlapis;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//NETHER BRICK
|
||||
else if(id == 112){
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mnetherbrick;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
else if(id == 112 && block.getData() != (byte) 5)
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mnetherbrick;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//END STONE
|
||||
else if(id == 121){
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mendstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
else if(id == 121 && block.getData() != (byte) 5)
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mendstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//MOSS STONE
|
||||
else if(id == 48){
|
||||
if(block.getData() != (byte) 5){
|
||||
xp += LoadProperties.mmossstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
else if(id == 48 && block.getData() != (byte) 5)
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mmossstone;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
//STONE BRICK
|
||||
else if(id == 98){
|
||||
if(!plugin.misc.blockWatchList.contains(block)){
|
||||
xp += LoadProperties.mstonebrick;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
else if(id == 98 && !plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
xp += LoadProperties.mstonebrick;
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!plugin.misc.blockWatchList.contains(block) && block.getData() != (byte) 5)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -175,11 +174,11 @@ public class Swords
|
||||
|
||||
public static void counterAttackChecks(EntityDamageByEntityEvent event)
|
||||
{
|
||||
//Don't want to counter attack arrows
|
||||
//Don't want to counter attack stuff not alive
|
||||
|
||||
if(event.getDamager() instanceof Arrow)
|
||||
if(!(event.getDamager() instanceof LivingEntity))
|
||||
return;
|
||||
|
||||
|
||||
if(event instanceof EntityDamageByEntityEvent)
|
||||
{
|
||||
Entity f = ((EntityDamageByEntityEvent) event).getDamager();
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.gmail.nossr50.skills;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import com.gmail.nossr50.Users;
|
||||
|
||||
@@ -17,20 +17,25 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.config.*;
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
|
||||
|
||||
public class WoodCutting
|
||||
@@ -166,4 +171,49 @@ public class WoodCutting
|
||||
isdone = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void woodcuttingBlockCheck(Player player, Block block, mcMMO plugin)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int xp = 0;
|
||||
byte data = block.getData();
|
||||
|
||||
if(plugin.misc.blockWatchList.contains(block))
|
||||
return;
|
||||
|
||||
switch(data)
|
||||
{
|
||||
case 0:
|
||||
xp += LoadProperties.mpine;
|
||||
break;
|
||||
case 1:
|
||||
xp += LoadProperties.mspruce;
|
||||
break;
|
||||
case 2:
|
||||
xp += LoadProperties.mbirch;
|
||||
break;
|
||||
}
|
||||
|
||||
if(block.getTypeId() == 17)
|
||||
{
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void leafBlower(Player player, Block block){
|
||||
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ Spout:
|
||||
Show_Faces: true
|
||||
Enabled: true
|
||||
Show_Display_Name: false
|
||||
Images:
|
||||
URL_DIR: http://mcmmo.rycochet.net/mcmmo/
|
||||
HUD:
|
||||
Default: STANDARD
|
||||
Retro:
|
||||
@@ -127,9 +125,10 @@ Skills:
|
||||
Repair:
|
||||
Level_Cap: 0
|
||||
Leather:
|
||||
Name: Leather
|
||||
ID: 334
|
||||
String:
|
||||
Name: Leather
|
||||
Name: String
|
||||
ID: 287
|
||||
Stone:
|
||||
Name: Cobblestone
|
||||
@@ -141,6 +140,7 @@ Skills:
|
||||
Name: Gold Bars
|
||||
ID: 266
|
||||
Anvil_Messages: true
|
||||
Anvil_ID: 42
|
||||
Diamond:
|
||||
Name: Diamond
|
||||
Level_Required: 50
|
||||
@@ -229,7 +229,6 @@ Experience:
|
||||
Redstone: 150
|
||||
Coal: 100
|
||||
Diamond: 750
|
||||
lapis: 400
|
||||
Iron: 250
|
||||
MySQL:
|
||||
Enabled: false
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
name: mcMMO
|
||||
main: com.gmail.nossr50.mcMMO
|
||||
version: 1.2.09
|
||||
main: com.gmail.nossr50.mcMMO
|
||||
version: ${project.version}-b${BUILD_NUMBER}
|
||||
softdepend: [Spout]
|
||||
author: TheYeti
|
||||
authors:
|
||||
- TheYeti
|
||||
- NuclearW
|
||||
- gmcferrin
|
||||
description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience.
|
||||
commands:
|
||||
mchud:
|
||||
|
||||
Reference in New Issue
Block a user