2
0
Эх сурвалжийг харах

Partially reverted my previous fix
ItemStack constructor actually worked,
the issue was about double drops using
the original data, not about TreeFeller.

bm01 12 жил өмнө
parent
commit
29d796b6af

+ 1 - 2
src/main/java/com/gmail/nossr50/skills/woodcutting/TreeFeller.java

@@ -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);

+ 1 - 2
src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java

@@ -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: