2020-04-15 14:22:03 +02:00
|
|
|
package com.minelittlepony.unicopia;
|
2019-02-17 00:08:19 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2020-04-15 19:06:45 +02:00
|
|
|
import com.minelittlepony.unicopia.block.UBlocks;
|
2020-04-15 14:22:03 +02:00
|
|
|
import com.minelittlepony.unicopia.item.UItems;
|
|
|
|
import com.minelittlepony.unicopia.magic.spell.SpellRegistry;
|
2019-02-17 00:08:19 +01:00
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2020-01-16 12:35:46 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.block.Blocks;
|
|
|
|
import net.minecraft.block.GrassBlock;
|
2019-02-17 00:08:19 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2020-04-15 17:22:29 +02:00
|
|
|
@Deprecated
|
|
|
|
public class CustomDrops {
|
2020-04-23 23:44:31 +02:00
|
|
|
// XXX: loot table
|
2020-01-16 12:35:46 +01:00
|
|
|
public void addAuxiliaryDrops(World world, BlockState state, BlockPos pos, List<ItemStack> drops, int fortune) {
|
2019-02-17 00:08:19 +01:00
|
|
|
Block block = state.getBlock();
|
|
|
|
|
|
|
|
int fortuneFactor = 1 + fortune * 15;
|
|
|
|
|
|
|
|
if (block == Blocks.STONE) {
|
2020-01-16 12:35:46 +01:00
|
|
|
if (world.random.nextInt(500 / fortuneFactor) == 0) {
|
2019-02-17 00:08:19 +01:00
|
|
|
for (int i = 0; i < 1 + fortune; i++) {
|
2020-01-16 12:35:46 +01:00
|
|
|
if (world.random.nextInt(10) > 3) {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.CORRUPTED_GEM));
|
2019-02-17 00:08:19 +01:00
|
|
|
} else {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.GEM));
|
2019-02-17 00:08:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-16 12:35:46 +01:00
|
|
|
if (world.random.nextInt(5000) == 0) {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(SpellRegistry.instance().enchantStack(new ItemStack(UItems.GEM), "awkward"));
|
2019-02-17 00:08:19 +01:00
|
|
|
}
|
2020-04-24 15:23:36 +02:00
|
|
|
} else if (block == Blocks.DIRT || block == Blocks.CLAY || block == Blocks.GRASS_PATH || block == Blocks.GRASS || block == UBlocks.HIVE_WALL_BLOCK) {
|
2020-01-16 12:35:46 +01:00
|
|
|
if (world.random.nextInt(25 / fortuneFactor) == 0) {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.WHEAT_WORMS, 1 + fortune));
|
2019-03-05 12:11:33 +01:00
|
|
|
}
|
2020-01-16 12:35:46 +01:00
|
|
|
} else if (block instanceof GrassBlock) {
|
|
|
|
if (world.random.nextInt(25 / fortuneFactor) == 0) {
|
2019-02-17 00:08:19 +01:00
|
|
|
for (int i = 0; i < 1 + fortune; i++) {
|
2020-01-16 12:35:46 +01:00
|
|
|
int chance = world.random.nextInt(3);
|
2019-02-17 00:08:19 +01:00
|
|
|
|
|
|
|
if (chance == 0) {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.ALFALFA_SEEDS));
|
2019-02-17 00:08:19 +01:00
|
|
|
} else if (chance == 1) {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.APPLE_SEEDS));
|
2019-02-17 00:08:19 +01:00
|
|
|
} else {
|
2020-04-24 15:23:36 +02:00
|
|
|
drops.add(new ItemStack(UItems.TOMATO_SEEDS));
|
2019-02-17 00:08:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|