Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyyid committed Feb 21, 2016
1 parent ec8da30 commit 32626c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'eclipse'

sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.3'
version = '1.4'
group = "io.github.hsyyid"
archivesBaseName = "AdminShop"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/hsyyid/adminshop/AdminShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.ArrayList;
import java.util.Optional;

@Plugin(id = "AdminShop", name = "AdminShop", version = "1.3")
@Plugin(id = "AdminShop", name = "AdminShop", version = "1.4")
public class AdminShop
{
protected AdminShop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.spongepowered.api.event.block.InteractBlockEvent;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.filter.cause.First;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.service.economy.account.UniqueAccount;
import org.spongepowered.api.service.economy.transaction.ResultType;
import org.spongepowered.api.text.Text;
Expand Down Expand Up @@ -117,6 +118,7 @@ else if (result == ResultType.FAILED)
if (thisBuyShop != null)
{
AdminShopModifierObject shopModifier = null;

for (AdminShopModifierObject i : AdminShop.adminShopModifiers)
{
if (i.getPlayer().getUniqueId() == player.getUniqueId())
Expand Down Expand Up @@ -181,7 +183,9 @@ else if (player.getItemInHand().isPresent() && player.getItemInHand().get().getI
if (result == ResultType.SUCCESS)
{
quantityInHand = player.getItemInHand().get().getQuantity() - itemAmount;
player.getItemInHand().get().setQuantity(quantityInHand);
ItemStack stack = player.getItemInHand().get();
stack.setQuantity(quantityInHand);
player.setItemInHand(stack);
player.sendMessage(Text.builder().append(Text.of(TextColors.DARK_RED, "[AdminShop]: ", TextColors.GOLD, "You have just sold " + itemAmount + " " + itemName + " for " + price + " ")).append(AdminShop.economyService.getDefaultCurrency().getPluralDisplayName()).build());
}
else if (result == ResultType.ACCOUNT_NO_SPACE)
Expand Down Expand Up @@ -225,8 +229,9 @@ else if (player.getItemInHand().isPresent() && player.getItemInHand().get().getI
if (result == ResultType.SUCCESS)
{
quantityInHand = player.getItemInHand().get().getQuantity() - itemAmount;
player.setItemInHand(null);
ItemUtil.givePlayerItem(player, itemName, quantityInHand);
ItemStack stack = player.getItemInHand().get();
stack.setQuantity(quantityInHand);
player.setItemInHand(stack);
player.sendMessage(Text.builder().append(Text.of(TextColors.DARK_RED, "[AdminShop]: ", TextColors.GOLD, "You have just sold " + itemAmount + " " + itemName + " for " + price + " ")).append(AdminShop.economyService.getDefaultCurrency().getPluralDisplayName()).build());
}
else if (result == ResultType.ACCOUNT_NO_SPACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ public void write(JsonWriter out, Location<World> location) throws IOException

out.beginObject();

if (location.getExtent() instanceof World)
{
out.name("world");
out.value(location.getExtent().getUniqueId().toString());
}
out.name("world");
out.value(location.getExtent().getUniqueId().toString());

out.name("x");
out.value(location.getX());

Expand All @@ -41,7 +39,6 @@ public void write(JsonWriter out, Location<World> location) throws IOException
out.value(location.getZ());

out.endObject();

}

@Override
Expand Down

0 comments on commit 32626c9

Please sign in to comment.