mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 03:04:44 +02:00
Another dupe fix + 1.16 support part 4
This commit is contained in:
@ -136,11 +136,11 @@ public class MiningManager extends SkillManager {
|
||||
|
||||
List<BlockState> ores = new ArrayList<BlockState>();
|
||||
|
||||
List<Block> newYieldList = new ArrayList<>();
|
||||
List<Block> notOres = new ArrayList<>();
|
||||
for (Block targetBlock : event.blockList()) {
|
||||
//Containers usually have 0 XP unless someone edited their config in a very strange way
|
||||
if (ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, targetBlock) == 0 || targetBlock instanceof Container || mcMMO.getPlaceStore().isTrue(targetBlock)) {
|
||||
newYieldList.add(targetBlock);
|
||||
notOres.add(targetBlock);
|
||||
} else {
|
||||
ores.add(targetBlock.getState());
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class MiningManager extends SkillManager {
|
||||
// float debrisYield = yield - debrisReduction;
|
||||
|
||||
for (BlockState blockState : ores) {
|
||||
if (Misc.getRandom().nextFloat() < (newYieldList.size() + oreBonus)) {
|
||||
if (Misc.getRandom().nextFloat() < (notOres.size() + oreBonus)) {
|
||||
xp += Mining.getBlockXp(blockState);
|
||||
|
||||
Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); // Initial block that would have been dropped
|
||||
@ -168,8 +168,9 @@ public class MiningManager extends SkillManager {
|
||||
}
|
||||
|
||||
//Replace the event blocklist with the newYield list
|
||||
event.blockList().clear();
|
||||
event.blockList().addAll(newYieldList);
|
||||
event.setYield(0F);
|
||||
// event.blockList().clear();
|
||||
// event.blockList().addAll(notOres);
|
||||
|
||||
applyXpGain(xp, XPGainReason.PVE);
|
||||
}
|
||||
|
@ -98,6 +98,8 @@ public class SwordsManager extends SkillManager {
|
||||
|
||||
public int getToolTier(ItemStack itemStack)
|
||||
{
|
||||
if(ItemUtils.isNetherriteTool(itemStack))
|
||||
return 5;
|
||||
if(ItemUtils.isDiamondTool(itemStack))
|
||||
return 4;
|
||||
else if(ItemUtils.isIronTool(itemStack) || ItemUtils.isGoldTool(itemStack))
|
||||
|
Reference in New Issue
Block a user