Fix tags
This commit is contained in:
parent
38eca7b3e8
commit
f64229efb4
2 changed files with 9 additions and 10 deletions
|
@ -29,6 +29,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
@ -39,8 +40,6 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import reborncore.common.util.OreDrop;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.utils.TagUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -66,23 +65,24 @@ public class BlockBreakHandler {
|
|||
IBlockState state = event.getState();
|
||||
List<ItemStack> drops = event.getDrops();
|
||||
Random random = new Random();
|
||||
if (TagUtils.isOre(state, "oreRuby")) {
|
||||
//TODO: fix tags
|
||||
if (state.getBlock().isIn(new BlockTags.Wrapper(new ResourceLocation(TechReborn.MOD_ID, "ruby_ore")))) {
|
||||
OreDrop redGarnet = new OreDrop(TRContent.Gems.RED_GARNET.getStack(), redGarnetDropChance, 1);
|
||||
drops.add(redGarnet.getDrops(event.getFortuneLevel(), random));
|
||||
}
|
||||
else if (TagUtils.isOre(state, "oreSapphire")) {
|
||||
else if (state.getBlock().isIn(new BlockTags.Wrapper(new ResourceLocation(TechReborn.MOD_ID, "sapphire_ore")))) {
|
||||
OreDrop peridot = new OreDrop(TRContent.Gems.PERIDOT.getStack(), peridotDropChance, 1);
|
||||
drops.add(peridot.getDrops(event.getFortuneLevel(), random));
|
||||
}
|
||||
else if (TagUtils.isOre(state, "oreSodalite")) {
|
||||
else if (state.getBlock().isIn(new BlockTags.Wrapper(new ResourceLocation(TechReborn.MOD_ID, "sodalite_ore")))) {
|
||||
OreDrop aluminium = new OreDrop(TRContent.Dusts.ALUMINUM.getStack(), aluminiumDropChance, 1);
|
||||
drops.add(aluminium.getDrops(event.getFortuneLevel(), random));
|
||||
}
|
||||
else if (TagUtils.isOre(state, "oreCinnabar")) {
|
||||
else if (state.getBlock().isIn(new BlockTags.Wrapper(new ResourceLocation(TechReborn.MOD_ID, "cinnabar_ore")))) {
|
||||
OreDrop redstone = new OreDrop(new ItemStack(Items.REDSTONE), redstoneDropChance, 1);
|
||||
drops.add(redstone.getDrops(event.getFortuneLevel(), random));
|
||||
}
|
||||
else if (TagUtils.isOre(state, "oreSphalerite")) {
|
||||
else if (state.getBlock().isIn(new BlockTags.Wrapper(new ResourceLocation(TechReborn.MOD_ID, "sphalerite_ore")))) {
|
||||
OreDrop yellowGarnet = new OreDrop(TRContent.Gems.YELLOW_GARNET.getStack(), yellowGarnetDropChance, 1);
|
||||
drops.add(yellowGarnet.getDrops(event.getFortuneLevel(), random));
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTier;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import reborncore.common.powerSystem.ExternalPowerSystems;
|
||||
import reborncore.common.powerSystem.forge.ForgePowerItemManager;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
@ -73,8 +73,7 @@ public class ItemIndustrialChainsaw extends ItemChainsaw {
|
|||
for (int i = 1; i < 10; i++) {
|
||||
BlockPos nextPos = pos.up(i);
|
||||
IBlockState nextState = worldIn.getBlockState(nextPos);
|
||||
//TODO 1.13 use wood tag
|
||||
if(TagUtils.hasTag(nextState.getBlock(), Tags.Blocks.STORAGE_BLOCKS)){
|
||||
if(TagUtils.hasTag(nextState.getBlock(), BlockTags.LOGS)){
|
||||
breakBlock(nextPos, stack, worldIn, entityLiving, pos);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue