Skip to content

Commit

Permalink
Backport for Sponge API 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthick committed Aug 27, 2016
1 parent 41daaa8 commit 8f518d5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ repositories {
}

dependencies {
compile 'org.spongepowered:spongeapi:5.0.0-SNAPSHOT'
compile 'org.spongepowered:spongeapi:4.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

@Plugin(id = "playershopsrpg",
name = "PlayerShopsRPG",
version = "0.4.0",
version = "0.4.1",
description = "A region-based player shop plugin.")
public class PlayerShopsRPG {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.data.type.HandTypes;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.plugin.PluginContainer;

Expand All @@ -42,7 +41,7 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm

return super.executeTransaction(src, args, (player, arg, shop) -> {

Optional<ItemStack> itemStackOptional = player.getItemInHand(HandTypes.MAIN_HAND);
Optional<ItemStack> itemStackOptional = player.getItemInHand();

if (itemStackOptional.isPresent()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.data.type.HandTypes;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.text.Text;
Expand All @@ -44,9 +43,9 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm

return super.executeTransaction(src, args, (player, arg, shop) -> {

if (player.getItemInHand(HandTypes.MAIN_HAND).isPresent()) {
if (player.getItemInHand().isPresent()) {

ItemStack item = player.getItemInHand(HandTypes.MAIN_HAND).get();
ItemStack item = player.getItemInHand().get();
ShopTransactionResult transactionResult = ShopTransactionResult.EMPTY;

//Check if this shop is allowed to hold this item
Expand Down

0 comments on commit 8f518d5

Please sign in to comment.