mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-24 05:54:49 +00:00
Pick effect, also a quick change to the cleanup profile.
This commit is contained in:
1 parent
77fcadd7ea
commit
ada7235ab0
3 files changed
+37
-6
No files matched your search
@@ -34,9 +34,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem {
|
||||
|
||||
private static final int COST_PER = 55;
|
||||
|
||||
static final List<Block> validBlocks = new ArrayList() {
|
||||
private static final long serialVersionUID = 1378413169035169782L;
|
||||
{
|
||||
static final List<Block> validBlocks = new ArrayList() {{
|
||||
add(Blocks.stone);
|
||||
add(Blocks.dirt);
|
||||
add(Blocks.grass);
|
||||
|
||||
+35
-2
@@ -1,14 +1,47 @@
|
||||
package vazkii.botania.common.item.equipment.tool.elementium;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelPick;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemElementiumPick extends ItemManasteelPick {
|
||||
|
||||
static final List<Block> validBlocks = new ArrayList() {{
|
||||
add(Blocks.dirt);
|
||||
add(Blocks.sand);
|
||||
add(Blocks.gravel);
|
||||
add(Blocks.cobblestone);
|
||||
add(Blocks.netherrack);
|
||||
}};
|
||||
|
||||
public ItemElementiumPick() {
|
||||
super(BotaniaAPI.elementiumToolMaterial, LibItemNames.ELEMENTIUM_PICK);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHarvestDrops(HarvestDropsEvent event) {
|
||||
if(event.harvester != null) {
|
||||
ItemStack stack = event.harvester.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() == this)
|
||||
for(int i = 0; i < event.drops.size(); i++) {
|
||||
ItemStack drop = event.drops.get(i);
|
||||
if(drop != null) {
|
||||
Block block = Block.getBlockFromItem(drop.getItem());
|
||||
if(block != null && validBlocks.contains(block))
|
||||
event.drops.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
|
||||
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
|
||||
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
|
||||
<setting id="cleanup.add_serial_version_id" value="true"/>
|
||||
<setting id="cleanup.add_serial_version_id" value="false"/>
|
||||
<setting id="cleanup.format_source_code_changes_only" value="false"/>
|
||||
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
|
||||
<setting id="cleanup.always_use_blocks" value="true"/>
|
||||
|
||||
Reference in new issue
Block a user