mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
parent
ee324c77a9
commit
4bda175328
@ -195,7 +195,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
|||||||
/* Materials */
|
/* Materials */
|
||||||
public int getXp(SkillType skill, BlockData data)
|
public int getXp(SkillType skill, BlockData data)
|
||||||
{
|
{
|
||||||
System.out.print(">>YUP>"+skill.toString());
|
|
||||||
String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + ".";
|
String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + ".";
|
||||||
String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data);
|
String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data);
|
||||||
if (config.contains(explicitString))
|
if (config.contains(explicitString))
|
||||||
|
@ -112,22 +112,18 @@ public class HerbalismManager extends SkillManager {
|
|||||||
* @param blockState The {@link BlockState} to check ability activation for
|
* @param blockState The {@link BlockState} to check ability activation for
|
||||||
*/
|
*/
|
||||||
public void herbalismBlockCheck(BlockState blockState) {
|
public void herbalismBlockCheck(BlockState blockState) {
|
||||||
System.out.print(">>1");
|
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
Material material = blockState.getType();
|
Material material = blockState.getType();
|
||||||
boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.CHORUS_PLANT || material == Material.SUGAR_CANE);
|
boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.CHORUS_PLANT || material == Material.SUGAR_CANE);
|
||||||
|
|
||||||
// Prevents placing and immediately breaking blocks for exp
|
// Prevents placing and immediately breaking blocks for exp
|
||||||
if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) {
|
if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||||
System.out.print(">>1.5");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.out.print(">>2");
|
|
||||||
|
|
||||||
if (!canBlockCheck()) {
|
if (!canBlockCheck()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.out.print(">>3");
|
|
||||||
|
|
||||||
Collection<ItemStack> drops = null;
|
Collection<ItemStack> drops = null;
|
||||||
int amount = 1;
|
int amount = 1;
|
||||||
@ -135,7 +131,6 @@ public class HerbalismManager extends SkillManager {
|
|||||||
boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility());
|
boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility());
|
||||||
|
|
||||||
if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) {
|
if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) {
|
||||||
System.out.print(">>4");
|
|
||||||
CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
|
CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
|
||||||
xp = customBlock.getXpGain();
|
xp = customBlock.getXpGain();
|
||||||
|
|
||||||
@ -144,7 +139,6 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
System.out.print(">>5");
|
|
||||||
if(material == Material.CHORUS_FLOWER && blockState.getRawData() != 5) {
|
if(material == Material.CHORUS_FLOWER && blockState.getRawData() != 5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -152,26 +146,21 @@ public class HerbalismManager extends SkillManager {
|
|||||||
|
|
||||||
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS)) {
|
if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS)) {
|
||||||
drops = blockState.getBlock().getDrops();
|
drops = blockState.getBlock().getDrops();
|
||||||
System.out.print(">>6");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!oneBlockPlant) {
|
if (!oneBlockPlant) {
|
||||||
System.out.print(">>7");
|
|
||||||
amount = Herbalism.calculateMultiBlockPlantDrops(blockState);
|
amount = Herbalism.calculateMultiBlockPlantDrops(blockState);
|
||||||
xp *= amount;
|
xp *= amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Permissions.greenThumbPlant(player, material)) {
|
if (Permissions.greenThumbPlant(player, material)) {
|
||||||
System.out.print(">>8");
|
|
||||||
processGreenThumbPlants(blockState, greenTerra);
|
processGreenThumbPlants(blockState, greenTerra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.print(">>9");
|
|
||||||
|
|
||||||
applyXpGain(xp, XPGainReason.PVE);
|
applyXpGain(xp, XPGainReason.PVE);
|
||||||
|
|
||||||
if (drops == null) {
|
if (drops == null) {
|
||||||
System.out.print(">>10");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
* @param blockState Block being broken
|
* @param blockState Block being broken
|
||||||
*/
|
*/
|
||||||
public void woodcuttingBlockCheck(BlockState blockState) {
|
public void woodcuttingBlockCheck(BlockState blockState) {
|
||||||
System.out.print(">>HEYO");
|
|
||||||
int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT);
|
int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT);
|
||||||
|
|
||||||
switch (blockState.getType()) {
|
switch (blockState.getType()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user