Quick and dirty 1.13 update. I.e. it now compiles for 1.13.

This commit is contained in:
t00thpick1
2018-07-23 22:13:57 -04:00
parent 3d515aab23
commit 0a1559511a
25 changed files with 511 additions and 901 deletions

View File

@@ -1,14 +1,11 @@
package com.gmail.nossr50.skills.mining;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Misc;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
public class Mining {
@@ -36,31 +33,56 @@ public class Mining {
Material blockType = blockState.getType();
switch (blockType) {
case ENDER_STONE:
case GOLD_ORE:
case HARD_CLAY:
case END_STONE:
case TERRACOTTA:
case CLAY:
case IRON_ORE:
case MOSSY_COBBLESTONE:
case NETHERRACK:
case OBSIDIAN:
case SANDSTONE:
case STAINED_CLAY:
case BLACK_GLAZED_TERRACOTTA:
case BLACK_TERRACOTTA:
case BLUE_GLAZED_TERRACOTTA:
case BLUE_TERRACOTTA:
case BROWN_GLAZED_TERRACOTTA:
case BROWN_TERRACOTTA:
case CYAN_GLAZED_TERRACOTTA:
case CYAN_TERRACOTTA:
case GRAY_GLAZED_TERRACOTTA:
case GRAY_TERRACOTTA:
case GREEN_GLAZED_TERRACOTTA:
case GREEN_TERRACOTTA:
case LIGHT_BLUE_GLAZED_TERRACOTTA:
case LIGHT_BLUE_TERRACOTTA:
case LIGHT_GRAY_GLAZED_TERRACOTTA:
case LIGHT_GRAY_TERRACOTTA:
case LIME_GLAZED_TERRACOTTA:
case LIME_TERRACOTTA:
case MAGENTA_GLAZED_TERRACOTTA:
case MAGENTA_TERRACOTTA:
case ORANGE_GLAZED_TERRACOTTA:
case ORANGE_TERRACOTTA:
case PINK_GLAZED_TERRACOTTA:
case PINK_TERRACOTTA:
case PURPLE_GLAZED_TERRACOTTA:
case PURPLE_TERRACOTTA:
case RED_GLAZED_TERRACOTTA:
case RED_TERRACOTTA:
case WHITE_GLAZED_TERRACOTTA:
case WHITE_TERRACOTTA:
case YELLOW_GLAZED_TERRACOTTA:
case YELLOW_TERRACOTTA:
handleMiningDrops(blockState);
return;
case GLOWING_REDSTONE_ORE:
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(Material.REDSTONE_ORE));
}
return;
case COAL_ORE:
case DIAMOND_ORE:
case EMERALD_ORE:
case GLOWSTONE:
case LAPIS_ORE:
case PACKED_ICE:
case QUARTZ_ORE:
case NETHER_QUARTZ_ORE:
case REDSTONE_ORE:
case STONE:
case PRISMARINE:
@@ -85,10 +107,10 @@ public class Mining {
case COAL_ORE:
case DIAMOND_ORE:
case EMERALD_ORE:
case ENDER_STONE:
case END_STONE:
case GLOWSTONE:
case GOLD_ORE:
case HARD_CLAY:
case TERRACOTTA:
case IRON_ORE:
case LAPIS_ORE:
case MOSSY_COBBLESTONE:
@@ -97,18 +119,43 @@ public class Mining {
case PACKED_ICE:
case REDSTONE_ORE:
case SANDSTONE:
case STAINED_CLAY:
case BLACK_GLAZED_TERRACOTTA:
case BLACK_TERRACOTTA:
case BLUE_GLAZED_TERRACOTTA:
case BLUE_TERRACOTTA:
case BROWN_GLAZED_TERRACOTTA:
case BROWN_TERRACOTTA:
case CYAN_GLAZED_TERRACOTTA:
case CYAN_TERRACOTTA:
case GRAY_GLAZED_TERRACOTTA:
case GRAY_TERRACOTTA:
case GREEN_GLAZED_TERRACOTTA:
case GREEN_TERRACOTTA:
case LIGHT_BLUE_GLAZED_TERRACOTTA:
case LIGHT_BLUE_TERRACOTTA:
case LIGHT_GRAY_GLAZED_TERRACOTTA:
case LIGHT_GRAY_TERRACOTTA:
case LIME_GLAZED_TERRACOTTA:
case LIME_TERRACOTTA:
case MAGENTA_GLAZED_TERRACOTTA:
case MAGENTA_TERRACOTTA:
case ORANGE_GLAZED_TERRACOTTA:
case ORANGE_TERRACOTTA:
case PINK_GLAZED_TERRACOTTA:
case PINK_TERRACOTTA:
case PURPLE_GLAZED_TERRACOTTA:
case PURPLE_TERRACOTTA:
case RED_GLAZED_TERRACOTTA:
case RED_TERRACOTTA:
case WHITE_GLAZED_TERRACOTTA:
case WHITE_TERRACOTTA:
case YELLOW_GLAZED_TERRACOTTA:
case YELLOW_TERRACOTTA:
case STONE:
case QUARTZ_ORE:
case NETHER_QUARTZ_ORE:
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
return;
case GLOWING_REDSTONE_ORE:
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
}
return;
default:
if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());

View File

@@ -1,17 +1,5 @@
package com.gmail.nossr50.skills.mining;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.AbilityType;
@@ -19,6 +7,7 @@ import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.XPGainReason;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.mining.BlastMining.Tier;
@@ -27,6 +16,15 @@ import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import java.util.ArrayList;
import java.util.List;
public class MiningManager extends SkillManager {
public MiningManager(McMMOPlayer mcMMOPlayer) {
@@ -71,7 +69,7 @@ public class MiningManager extends SkillManager {
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), Config.getInstance().getAbilityToolDamage());
}
if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || material != Material.GLOWING_REDSTONE_ORE && !Config.getInstance().getDoubleDropsEnabled(skill, material)) {
if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !Config.getInstance().getDoubleDropsEnabled(skill, material)) {
return;
}
@@ -94,7 +92,7 @@ public class MiningManager extends SkillManager {
*/
public void remoteDetonation() {
Player player = getPlayer();
Block targetBlock = player.getTargetBlock((HashSet<Material>) BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
if (targetBlock.getType() != Material.TNT || !EventUtils.simulateBlockBreak(targetBlock, player, true) || !blastMiningCooldownOver()) {
return;