Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
Putting items with custom names on an auction is now prohibited
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidius20 committed Oct 6, 2018
1 parent f60b05f commit 92d6f0b
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .idea/artifacts/Trading.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/libraries/EconomyAPI_1_0_1.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/libraries/nukkit_1_0_SNAPSHOT.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Trading.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand All @@ -11,7 +11,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="nukkit-1.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="EconomyAPI-1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: cn.nukkit:nukkit:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: me.onebone:economyapi:1.0.0" level="project" />
</component>
</module>
28 changes: 27 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,33 @@

<groupId>ua.leonidius.trading</groupId>
<artifactId>Trading</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.4</version>

<repositories>
<repository>
<id>nukkitx-repo</id>
<url>https://repo.nukkitx.com/snapshot/</url>
</repository>
<repository>
<id>onebone</id>
<url>http://jenkins.onebone.me/plugin/repository/everything/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>cn.nukkit</groupId>
<artifactId>nukkit</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.onebone</groupId>
<artifactId>economyapi</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public boolean onCommand(CommandSender sender, Command command, String s, String
if (args.length >= 2) item = Item.fromString(args[0]);
else item = player.getInventory().getItemInHand();
if (item.getId() == 0) return false;
if (item.hasCustomName()) {
Message.AUC_CUSTOM_NAME.printError(player);
return true;
}

int amount;

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ua/leonidius/trading/utils/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public enum Message {
AUC_WINNER_NO_SPACE ("Auction winner has no free space in his inventory. The lot and the tax were returned."),
AUC_YOU_WON_NO_SPACE ("You won the auction, but there is not enough space in your inventory. The bid was returned."),
AUC_NO_SPACE_FOR_RETURNING_COMPENSATION ("The lot had to be returned to you, but there is no free space in your inventory. You've been paid a compensation (%1%%2%)."),
AUC_NO_SPACE_FOR_RETURNING ("The lot had to be returned to you, but there is no free space in your inventory.");
AUC_NO_SPACE_FOR_RETURNING ("The lot had to be returned to you, but there is no free space in your inventory."),
AUC_CUSTOM_NAME ("You can't sell an item with a custom name.");

private static String language = "english";
private static char c1; //= 'a';
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lang/rus.lng
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ auc_winner_no_space: У победителя аукциона недостато
auc_you_won_no_space: Вы выиграли аукцион, но у вас недостаточно свободного места в инвентаре. Ставка была возвращена.
auc_no_space_for_returning_compensation: Лот должен был быть возвращён вам, но в вашем инвентаре недостаточно места. Вам была выплачена компенсация (%1%%2%).
auc_no_space_for_returning: Лот должен был быть возвращён вам, но в вашем инвентаре недостаточно места.
auc_custom_name: Вы не можете выставить на аукцион предмет с пользовательским именем.
1 change: 1 addition & 0 deletions src/main/resources/lang/ukr.lng
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ auc_winner_no_space: У переможця аукціону недостатнь
auc_you_won_no_space: Ви перемогли на аукціоні, але у вас недостатньо вільного місця в інвентарі. Ставку було повернено.
auc_no_space_for_returning_compensation: Лот мало бути повернено вам, але у вашому інвентарі недостатньо місця. Вам було сплачено компенсацію (%1%%2%).
auc_no_space_for_returning: Лот мало бути повернено вам, але у вашому інвентарі недостатньо місця.
auc_custom_name: "Ви не можете виставити на аукціон предмет з користувацьким ім'ям."
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Trading Commands
main: ua.leonidius.trading.Main
version: 1.0.3
version: 1.0.4
author: Leonidius20
api: ["1.0.0"]
description: Shop and auction system, based on commands.
Expand Down

0 comments on commit 92d6f0b

Please sign in to comment.