Partially reverted my previous fix

ItemStack constructor actually worked,
the issue was about double drops using
the original data, not about TreeFeller.
This commit is contained in:
bm01 2013-01-24 16:14:15 +01:00
parent 276800f999
commit 29d796b6af
2 changed files with 2 additions and 4 deletions

View File

@ -10,7 +10,6 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.mods.CustomBlock; import com.gmail.nossr50.datatypes.mods.CustomBlock;
@ -185,7 +184,7 @@ public abstract class TreeFeller {
// TODO: Nerf XP from jungle trees, as it was done previously // TODO: Nerf XP from jungle trees, as it was done previously
Misc.dropItem(block.getLocation(), new MaterialData(Material.LOG, Woodcutting.extractLogItemData(block.getData())).toItemStack(1)); Misc.dropItem(block.getLocation(), new ItemStack(Material.LOG, 1, Woodcutting.extractLogItemData(block.getData())));
break; break;
case LEAVES: case LEAVES:
Misc.randomDropItem(block.getLocation(), new ItemStack(Material.SAPLING, 1, Woodcutting.extractLogItemData(block.getData())), 10); Misc.randomDropItem(block.getLocation(), new ItemStack(Material.SAPLING, 1, Woodcutting.extractLogItemData(block.getData())), 10);

View File

@ -7,7 +7,6 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundEffect;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@ -146,7 +145,7 @@ public abstract class Woodcutting {
else { else {
byte itemData = extractLogItemData(block.getData()); byte itemData = extractLogItemData(block.getData());
Location location = block.getLocation(); Location location = block.getLocation();
ItemStack item = new MaterialData(Material.LOG, itemData).toItemStack(1); ItemStack item = new ItemStack(Material.LOG, 1, itemData);
switch (TreeSpecies.getByData(itemData)) { switch (TreeSpecies.getByData(itemData)) {
case GENERIC: case GENERIC: