Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Update test mod and Maven artifact in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Apr 29, 2019
1 parent 30533d6 commit b0bc970
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Cotton Client Commands

[![Maven metadata URL](https://img.shields.io/maven-metadata/v/http/server.bbkr.space:8081/artifactory/libs-snapshot/io/github/cottonmc/client-commands/maven-metadata.xml.svg)](http://server.bbkr.space:8081/artifactory/libs-snapshot/io/github/cottonmc/client-commands)
[![Maven metadata URL](https://img.shields.io/maven-metadata/v/http/server.bbkr.space:8081/artifactory/libs-snapshot/io/github/cottonmc/cotton-client-commands/maven-metadata.xml.svg)](http://server.bbkr.space:8081/artifactory/libs-snapshot/io/github/cottonmc/cotton-client-commands)

[>> Downloads <<](https://github.com/CottonMC/ClientCommands/releases)

Expand All @@ -23,7 +23,7 @@ repositories {
}
dependencies {
modCompile "io.github.cottonmc:client-commands:0.3.0+1.14-SNAPSHOT"
modCompile "io.github.cottonmc:cotton-client-commands:0.3.0+1.14-SNAPSHOT"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public abstract class PlayerMixin {
private void onChatMessage(String msg, CallbackInfo info) {
if (msg.length() < 2 || !msg.startsWith("/")) return;
if (!CommandCache.hasCommand(msg.substring(1).split(" ")[0])) return;
// TODO: Test
boolean cancel = false;
try {
// The game freezes when using heavy commands. Run your heavy code somewhere else pls
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.github.cottonmc.clientcommands.test;

import com.mojang.brigadier.CommandDispatcher;
import io.github.cottonmc.clientcommands.ArgumentBuilders;
import io.github.cottonmc.clientcommands.ClientCommandPlugin;
import io.github.cottonmc.clientcommands.Feedback;
import net.minecraft.server.command.CommandSource;
import net.minecraft.text.StringTextComponent;

public class ExampleModCommands implements ClientCommandPlugin {
@Override
public void registerCommands(CommandDispatcher<CommandSource> dispatcher) {
dispatcher.register(ArgumentBuilders.literal("client-commands").executes(
source -> {
Feedback.sendFeedback(new StringTextComponent("Hello, world!"));
return 1;
}
));
}
}
16 changes: 16 additions & 0 deletions src/test/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"schemaVersion": 1,
"id": "cotton-client-commands-test",
"name": "Cotton Client Commands Test",
"version": "1",
"environment": "client",
"license": "MIT",
"requires": {
"cotton-client-commands": ">=0.3.0"
},
"entrypoints": {
"cotton-client-command": [
"io.github.cottonmc.clientcommands.test.ExampleModCommands"
]
}
}

0 comments on commit b0bc970

Please sign in to comment.