Skip to content

Commit

Permalink
Updated to gabizou's darn changes..
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyyid committed Dec 5, 2015
1 parent 7dfff7b commit 60f2746
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
3 changes: 2 additions & 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 = '0.9'
version = '1.0'
group = "io.github.hsyyid"
archivesBaseName = "AdminShop"

Expand All @@ -25,6 +25,7 @@ repositories {
dependencies {
compile "org.spongepowered:spongeapi:2.1-SNAPSHOT"
compile files('libs/TotalEconomy.jar')
compile files('libs/gson.jar')
}

test {
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/io/github/hsyyid/adminshop/AdminShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.spongepowered.api.block.BlockSnapshot;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.block.tileentity.Sign;
import org.spongepowered.api.command.args.GenericArguments;
import org.spongepowered.api.command.spec.CommandSpec;
import org.spongepowered.api.config.DefaultConfig;
import org.spongepowered.api.data.DataQuery;
import org.spongepowered.api.data.Transaction;
import org.spongepowered.api.data.key.Keys;
Expand All @@ -29,11 +32,8 @@
import org.spongepowered.api.event.game.state.GameStoppingServerEvent;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.service.config.DefaultConfig;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.util.command.args.GenericArguments;
import org.spongepowered.api.util.command.spec.CommandSpec;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.TeleportHelper;
import org.spongepowered.api.world.World;
Expand All @@ -43,7 +43,7 @@
import java.math.BigDecimal;
import java.util.ArrayList;

@Plugin(id = "AdminShop", name = "AdminShop", version = "0.9", dependencies = "required-after:TotalEconomy")
@Plugin(id = "AdminShop", name = "AdminShop", version = "1.0", dependencies = "required-after:TotalEconomy")
public class AdminShop
{
public static Game game = null;
Expand Down Expand Up @@ -104,7 +104,7 @@ public void onServerInit(GameInitializationEvent event)
.executor(new SetItemShopExecutor())
.build();

game.getCommandDispatcher().register(this, setItemShopCommandSpec, "setitem");
game.getCommandManager().register(this, setItemShopCommandSpec, "setitem");

getLogger().info("-----------------------------");
getLogger().info("AdminShop was made by HassanS6000!");
Expand Down Expand Up @@ -199,7 +199,9 @@ public void onPlayerBreakBlock(ChangeBlockEvent.Break event)
AdminShopObject thisShop = null;
for (AdminShopObject shop : adminShops)
{
if (shop.getSignLocation().getX() == transaction.getOriginal().getLocation().get().getX() && shop.getSignLocation().getY() == transaction.getOriginal().getLocation().get().getY() && shop.getSignLocation().getZ() == transaction.getOriginal().getLocation().get().getZ())
if (shop.getSignLocation().getX() == transaction.getOriginal().getLocation().get().getX() &&
shop.getSignLocation().getY() == transaction.getOriginal().getLocation().get().getY() &&
shop.getSignLocation().getZ() == transaction.getOriginal().getLocation().get().getZ())
{
thisShop = shop;
}
Expand Down Expand Up @@ -305,9 +307,9 @@ public void onPlayerInteractBlock(InteractBlockEvent event)
player.sendMessage(Texts.of(TextColors.DARK_RED, "[AdminShop]: ", TextColors.GOLD, "You have just bought " + itemAmount + " " + itemName + " for " + price + " dollars."));

if (thisShop.getMeta() != -1)
game.getCommandDispatcher().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + itemAmount + " " + thisShop.getMeta());
game.getCommandManager().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + itemAmount + " " + thisShop.getMeta());
else
game.getCommandDispatcher().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + itemAmount);
game.getCommandManager().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + itemAmount);
}
else
{
Expand Down Expand Up @@ -399,7 +401,7 @@ else if (player.getItemInHand().isPresent() && player.getItemInHand().get().getI
{
quantityInHand = player.getItemInHand().get().getQuantity() - itemAmount;
player.setItemInHand(null);
game.getCommandDispatcher().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + quantityInHand);
game.getCommandManager().process(game.getServer().getConsole(), "minecraft:give" + " " + player.getName() + " " + itemName + " " + quantityInHand);
accountManager.addToBalance(player.getUniqueId(), amount, true);
player.sendMessage(Texts.of(TextColors.DARK_RED, "[AdminShop]: ", TextColors.GOLD, "You have just sold " + itemAmount + " " + itemName + " for " + price + " dollars."));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import io.github.hsyyid.adminshop.AdminShop;
import io.github.hsyyid.adminshop.utils.AdminShopModifierObject;
import org.spongepowered.api.command.CommandException;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.source.CommandBlockSource;
import org.spongepowered.api.command.source.ConsoleSource;
import org.spongepowered.api.command.spec.CommandExecutor;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.util.command.CommandException;
import org.spongepowered.api.util.command.CommandResult;
import org.spongepowered.api.util.command.CommandSource;
import org.spongepowered.api.util.command.args.CommandContext;
import org.spongepowered.api.util.command.source.CommandBlockSource;
import org.spongepowered.api.util.command.source.ConsoleSource;
import org.spongepowered.api.util.command.spec.CommandExecutor;

import java.util.Optional;

Expand Down

0 comments on commit 60f2746

Please sign in to comment.