File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
src/main/java/us/thezircon/play/autopickup/listeners Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 66
77 <groupId >us.thezircon.play</groupId >
88 <artifactId >AutoPickup</artifactId >
9- <version >1.3.0-DEVBUILD.1 </version >
9+ <version >1.3.0-DEVBUILD.2 </version >
1010 <packaging >jar</packaging >
1111
1212 <name >AutoPickup</name >
Original file line number Diff line number Diff line change 77import org .bukkit .event .entity .ItemSpawnEvent ;
88import org .bukkit .inventory .ItemStack ;
99import us .thezircon .play .autopickup .AutoPickup ;
10+ import us .thezircon .play .autopickup .utils .AutoSmelt ;
1011import us .thezircon .play .autopickup .utils .PickupObjective ;
1112
1213public class ItemSpawnEventListener implements Listener {
1314
15+ private static final AutoPickup PLUGIN = AutoPickup .getPlugin (AutoPickup .class );
16+
1417 ///////////////////////////////////// Custom items \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
1518
1619 @ EventHandler
@@ -21,9 +24,14 @@ public void onSpawn(ItemSpawnEvent e) {
2124 PickupObjective po = AutoPickup .customItemPatch .get (key );
2225 ItemStack item = e .getEntity ().getItemStack ();
2326 Player player = po .getPlayer ();
27+ boolean doSmelt = PLUGIN .auto_smelt_blocks .contains (player );
2428 if (player .getInventory ().firstEmpty ()!=-1 ) {
2529 e .getEntity ().remove ();
26- player .getInventory ().addItem (item );
30+ if (doSmelt ) {
31+ player .getInventory ().addItem (AutoSmelt .smelt (item , player ));
32+ } else {
33+ player .getInventory ().addItem (item );
34+ }
2735 }
2836 }
2937 }
Original file line number Diff line number Diff line change 11name : AutoPickup
2- version : 1.3.0-DEVBUILD.1
2+ version : 1.3.0-DEVBUILD.2
33main : us.thezircon.play.autopickup.AutoPickup
44prefix : AutoPickup
55authors : [BUTTERFIELD8]
You can’t perform that action at this time.
0 commit comments