-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
331 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
src/main/java/net/touhou/mystiasizakaya/command/Addcurrency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
package net.touhou.mystiasizakaya.command; | ||
|
||
import net.touhou.mystiasizakaya.command.sub.Set; | ||
import net.touhou.mystiasizakaya.command.sub.Add; | ||
import net.touhou.mystiasizakaya.command.sub.Qurey; | ||
|
||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.event.RegisterCommandsEvent; | ||
|
||
import net.minecraft.commands.arguments.EntityArgument; | ||
import net.minecraft.commands.Commands; | ||
|
||
import java.util.HashMap; | ||
|
||
import com.mojang.brigadier.arguments.StringArgumentType; | ||
import com.mojang.brigadier.arguments.DoubleArgumentType; | ||
|
||
@Mod.EventBusSubscriber | ||
public class Addcurrency { | ||
@SubscribeEvent | ||
public static void registerCommand(RegisterCommandsEvent event) { | ||
event.getDispatcher().register(Commands.literal("mi_currency").requires(s -> s.hasPermission(3)).then(Commands.literal("add") | ||
.then(Commands.argument("player", EntityArgument.player()).then(Commands.argument("number", DoubleArgumentType.doubleArg(0)).then(Commands.argument("arguments", StringArgumentType.greedyString()).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
|
||
Add.execute(arguments); | ||
return 0; | ||
})).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
Add.execute(arguments); | ||
return 0; | ||
})))).then(Commands.literal("query") | ||
.then(Commands.argument("player", EntityArgument.player()).then(Commands.argument("number", DoubleArgumentType.doubleArg(0)).then(Commands.argument("arguments", StringArgumentType.greedyString()).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
|
||
Qurey.execute(arguments); | ||
return 0; | ||
})).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
|
||
Qurey.execute(arguments); | ||
return 0; | ||
})))) | ||
.then(Commands.literal("set") | ||
.then(Commands.argument("player", EntityArgument.player()).then(Commands.argument("number", DoubleArgumentType.doubleArg(0)).then(Commands.argument("arguments", StringArgumentType.greedyString()).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
|
||
Set.execute(arguments); | ||
return 0; | ||
})).executes(arguments -> { | ||
HashMap<String, String> cmdparams = new HashMap<>(); | ||
int index = -1; | ||
for (String param : arguments.getInput().split("\\s+")) { | ||
if (index >= 0) | ||
cmdparams.put(Integer.toString(index), param); | ||
index++; | ||
} | ||
|
||
Set.execute(arguments); | ||
return 0; | ||
}))))); | ||
} | ||
} |
163 changes: 0 additions & 163 deletions
163
src/main/java/net/touhou/mystiasizakaya/command/AddcurrencycommandCommand.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.