Skip to content

Commit

Permalink
updating vein miner to work on tool type blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarstonConnell committed Sep 11, 2023
1 parent 4337dc7 commit f87d3a0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 22 deletions.
40 changes: 20 additions & 20 deletions MODIFIERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 9 additions & 1 deletion src/main/java/dev/marston/randomloot/GenWiki.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,7 +25,12 @@ private static void writeMod(Modifier m, FileWriter f) throws IOException {
}

private static void writeMods(Set<Modifier> mods, FileWriter f) throws IOException {
for (Iterator<Modifier> iterator = mods.iterator(); iterator.hasNext();) {
List<Modifier> sortedList = new ArrayList<>(mods);
sortedList.sort((o1, o2) -> {
return o1.tagName().compareTo(o2.name());
});

for (Iterator<Modifier> iterator = sortedList.iterator(); iterator.hasNext();) {
Modifier modifier = iterator.next();
writeMod(modifier, f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<BlockPos> toBreak = new HashSet<BlockPos>();

Expand Down

0 comments on commit f87d3a0

Please sign in to comment.