pull/6/head
parent
0c14e81eac
commit
d77cb08f53
13 changed files with 196 additions and 98 deletions
@ -1,33 +0,0 @@ |
||||
package xyz.soukup.ecoCraftCore.commands; |
||||
|
||||
import com.mojang.brigadier.arguments.FloatArgumentType; |
||||
import com.mojang.brigadier.arguments.StringArgumentType; |
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder; |
||||
import com.mojang.brigadier.context.CommandContext; |
||||
import io.papermc.paper.command.brigadier.CommandSourceStack; |
||||
import io.papermc.paper.command.brigadier.Commands; |
||||
import xyz.soukup.ecoCraftCore.objects.Transaction; |
||||
|
||||
public class TransactionCommand { |
||||
|
||||
public static LiteralArgumentBuilder<CommandSourceStack> createCommand() { |
||||
return Commands.literal("transaction") |
||||
.then(Commands.literal("simulate") |
||||
.then(Commands.argument("sender", StringArgumentType.word()) |
||||
.then(Commands.argument("receiver", StringArgumentType.word()) |
||||
.then(Commands.argument("amount", FloatArgumentType.floatArg(0.1F)) |
||||
.executes(TransactionCommand::simulateTransaction))))); |
||||
} |
||||
|
||||
private static int simulateTransaction(CommandContext<CommandSourceStack> ctx) { |
||||
String sender = StringArgumentType.getString(ctx, "sender"); |
||||
String receiver = StringArgumentType.getString(ctx, "receiver"); |
||||
Float amount = FloatArgumentType.getFloat(ctx, "amount"); |
||||
|
||||
|
||||
Transaction tx = new Transaction(amount, "player", sender, "player", receiver, "command"); |
||||
tx.save(); |
||||
|
||||
return 1; |
||||
} |
||||
} |
||||
@ -0,0 +1,12 @@ |
||||
version: 1.0 |
||||
server: |
||||
name: "test" |
||||
type: "island" |
||||
database: |
||||
host: localhost |
||||
port: 3306 |
||||
user: "ecc" |
||||
password: "ecc" |
||||
database: "ecc" |
||||
cache: |
||||
save-interval: 6000 |
||||
@ -0,0 +1,29 @@ |
||||
generic: |
||||
error: |
||||
no-funds: |
||||
self: "<red>Nemáš dost pěněz" |
||||
shop: "<red>Obchod nemá dost peněz" |
||||
no-space: |
||||
self: "<red>Nemáš ve svém inventáři dostatek místa" |
||||
shop: "<red>V obchodě není dostatek místa" |
||||
no-item: |
||||
self: "<red>Nemáš dostatek itemů" |
||||
shop: "<red>Obchod nemá dostatek itemů" |
||||
shop: |
||||
buy: "<lime>Koupil jsi <count>x <item> za <price>" |
||||
sell: "<lime>Prodal jsi <count>x <item> za <price>" |
||||
create: "<lime>Obchod vytvořen." |
||||
money: |
||||
give: |
||||
self: "<lime>Dal sis <amount>" |
||||
player: "<lime>Dal jsi hráči <receiver> <amount>" |
||||
send: |
||||
player: "<lime>Poslal jsi <amount> hráči <receiver>" |
||||
receive: |
||||
player: "<lime>Obdržel jsi <amount> od hráče <sender>" |
||||
marker: |
||||
marked: |
||||
chest: "<lime>Truhla označena (<x>,<y>,<z>)" |
||||
sign: "<lime>Cedule označena (<x>,<y>,<z>)" |
||||
primary: "<lime>První pozice označena (<x>,<y>,<z>)" |
||||
secondary: "<lime>Druhá pozice označena (<x>,<y>,<z>)" |
||||
Loading…
Reference in new issue