diff --git a/MODIFIERS.md b/MODIFIERS.md index d17cc13..df07ba6 100644 --- a/MODIFIERS.md +++ b/MODIFIERS.md @@ -4,47 +4,47 @@ This is a full list of modifiers in the game and a description of what they do. These effects are applied when breaking blocks. ### Magnetic Upon breaking a block (allowed by tool type), all items at that block's position will teleport to you. -### Veiny -Breaking any block while crouching will cause all blocks of the same type adjacent to it to break up to 5 in each direction. ### Learning After breaking 10 blocks as allowed by this tool, gain 3 experience points. +### Veiny +Breaking any block while crouching will cause all blocks of the same type adjacent to it to break up to 5 in each direction. ## Holders These effects are applied when holding the tool. -### Filling -While holding the tool, get the saturation effect. -### Rainy -While holding the tool in the rain, mine faster! ### Detecting While holding the tool, ores around you will glow. -### Appley -While holding the tool, get the absorption effect. -### Tomb Raider -While holding the spawners around you will glow. +### Rainy +While holding the tool in the rain, mine faster! +### Filling +While holding the tool, get the saturation effect. ### Hasty While holding the tool, get the Haste effect. +### Tomb Raider +While holding the spawners around you will glow. +### Appley +While holding the tool, get the absorption effect. ## Users These effects are applied when right clicking. -### Fire Starter -Right clicking on the top of a block while crouching with the tool in hand will start a fire and use 2 durability points. ### Heartha's Grace Right clicking on the top of a block with the tool in hand will place a dirt block and use 1 durability points. ### Spelunking Right clicking on the top of a block with the tool in hand will place a torch and use 10 durability points. +### Fire Starter +Right clicking on the top of a block while crouching with the tool in hand will start a fire and use 2 durability points. ## Hurters These effects are applied when hurting enemies. +### Withering +When attacking with tool, apply the wither effect to the target. +### Charged +After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. +### Poisonous +When attacking with tool, apply the poison effect to the target. ### Necrotic Heals 10% of damage dealt to target. ### Dexterous Hitting enemies within 2 seconds after hitting them deals an extra 25% damage. -### Critical -Always critically strikes enemy. -### Withering -When attacking with tool, apply the wither effect to the target. ### Flaming Sets enemy on fire for 2 seconds. -### Charged -After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. ### Blinding When attacking with tool, apply the blindness effect to the target. -### Poisonous -When attacking with tool, apply the poison effect to the target. +### Critical +Always critically strikes enemy. diff --git a/src/main/java/dev/marston/randomloot/GenWiki.java b/src/main/java/dev/marston/randomloot/GenWiki.java index 756fb78..08439c2 100644 --- a/src/main/java/dev/marston/randomloot/GenWiki.java +++ b/src/main/java/dev/marston/randomloot/GenWiki.java @@ -3,7 +3,10 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; +import java.util.List; import java.util.Set; import dev.marston.randomloot.loot.modifiers.Modifier; @@ -22,7 +25,12 @@ private static void writeMod(Modifier m, FileWriter f) throws IOException { } private static void writeMods(Set mods, FileWriter f) throws IOException { - for (Iterator iterator = mods.iterator(); iterator.hasNext();) { + List sortedList = new ArrayList<>(mods); + sortedList.sort((o1, o2) -> { + return o1.tagName().compareTo(o2.name()); + }); + + for (Iterator iterator = sortedList.iterator(); iterator.hasNext();) { Modifier modifier = iterator.next(); writeMod(modifier, f); } diff --git a/src/main/java/dev/marston/randomloot/loot/modifiers/breakers/Veiny.java b/src/main/java/dev/marston/randomloot/loot/modifiers/breakers/Veiny.java index 5bfde02..f7c0f43 100644 --- a/src/main/java/dev/marston/randomloot/loot/modifiers/breakers/Veiny.java +++ b/src/main/java/dev/marston/randomloot/loot/modifiers/breakers/Veiny.java @@ -8,6 +8,8 @@ import javax.annotation.Nullable; import dev.marston.randomloot.RandomLootMod; +import dev.marston.randomloot.loot.LootItem; +import dev.marston.randomloot.loot.LootUtils; import dev.marston.randomloot.loot.LootItem.ToolType; import dev.marston.randomloot.loot.modifiers.BlockBreakModifier; import dev.marston.randomloot.loot.modifiers.Modifier; @@ -104,8 +106,18 @@ public void startBreak(ItemStack itemstack, BlockPos pos, LivingEntity p) { if (l.isClientSide) { return; } + + BlockState state = l.getBlockState(pos); + + LootItem li = (LootItem) itemstack.getItem(); + + + + if (!li.isCorrectToolForDrops(itemstack, state)) { + return; + } - Block b = l.getBlockState(pos).getBlock(); + Block b = state.getBlock(); Set toBreak = new HashSet();