I don't know...
This commit is contained in:
@@ -13,10 +13,10 @@ import static io.github.skippyall.minions.module.Modules.register;
|
||||
|
||||
public class ChatModule {
|
||||
public static final SimpleModuleItem CHAT_MODULE = register(Identifier.of(Minions.MOD_ID, "chat_module"),
|
||||
new SimpleModuleItem(new ArrayList<>(), Arrays.asList(
|
||||
new ArrayList<>(), Arrays.asList(
|
||||
new SimpleCommand(Text.of("Message"), Text.of("Send Message in Public Chat"), Items.PAPER, (player, minion) -> minion.getServer().getPlayerManager().broadcast(Text.of("message"), true)),
|
||||
new SimpleCommand(Text.of("Prvt-Message"), Text.of("Send Message to one Person"), Items.TRIAL_KEY, (player, minion) -> {})
|
||||
), Items.PAPER));
|
||||
), Items.PAPER);
|
||||
|
||||
public static void registerMe() {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package io.github.skippyall.minions.module;
|
||||
|
||||
import io.github.skippyall.minions.Minions;
|
||||
import io.github.skippyall.minions.command.SimpleCommand;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static io.github.skippyall.minions.module.Modules.register;
|
||||
|
||||
public class InteractModule {
|
||||
/*public static final SimpleCommand INTERACT_COMMAND =
|
||||
new SimpleCommand(
|
||||
Text.translatable()
|
||||
)
|
||||
|
||||
public static final SimpleModuleItem INTERACT_MODULE = register(
|
||||
Identifier.of(Minions.MOD_ID, "interact_module"),
|
||||
new SimpleModuleItem(
|
||||
List.of(),
|
||||
List.of(),
|
||||
Items.LEVER
|
||||
)
|
||||
);*/
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ public class MobSpawningModule {
|
||||
public static final SimpleModuleItem MOB_SPAWNING_MODULE =
|
||||
register(
|
||||
Identifier.of(Minions.MOD_ID, "mob_spawning_module"),
|
||||
new SimpleModuleItem(List.of(), List.of(), Items.SPAWNER)
|
||||
List.of(),
|
||||
List.of(),
|
||||
Items.SPAWNER
|
||||
);
|
||||
|
||||
public static boolean canMinionSpawnMobs(MinionFakePlayer minion) {
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package io.github.skippyall.minions.module;
|
||||
|
||||
import io.github.skippyall.minions.command.Command;
|
||||
import io.github.skippyall.minions.program.block.CodeBlock;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Modules {
|
||||
public static void register() {
|
||||
ChatModule.registerMe();
|
||||
@@ -16,4 +22,8 @@ public class Modules {
|
||||
public static <T extends Item & ModuleItem> T register(Identifier id, T item) {
|
||||
return Registry.register(Registries.ITEM, id, item);
|
||||
}
|
||||
|
||||
public static SimpleModuleItem register(Identifier id, List<CodeBlock<?,?>> codeBlocks, List<Command> commands, Item vanillaItem) {
|
||||
return Registry.register(Registries.ITEM, id, new SimpleModuleItem(codeBlocks, commands, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id)), vanillaItem));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,14 +27,12 @@ public class MountModule {
|
||||
|
||||
public static final SimpleModuleItem MOUNT_MODULE =
|
||||
register(Identifier.of(Minions.MOD_ID, "mount_module"),
|
||||
new SimpleModuleItem(
|
||||
List.of(),
|
||||
List.of(
|
||||
MOUNT_COMMAND,
|
||||
DISMOUNT_COMMAND
|
||||
),
|
||||
Items.MINECART
|
||||
)
|
||||
List.of(),
|
||||
List.of(
|
||||
MOUNT_COMMAND,
|
||||
DISMOUNT_COMMAND
|
||||
),
|
||||
Items.MINECART
|
||||
);
|
||||
|
||||
public static void registerMe() {
|
||||
|
||||
@@ -41,15 +41,13 @@ public class MoveModule {
|
||||
|
||||
public static final SimpleModuleItem MOVE_MODULE =
|
||||
register(Identifier.of(Minions.MOD_ID, "move_module"),
|
||||
new SimpleModuleItem(
|
||||
List.of(),
|
||||
List.of(
|
||||
WALK_COMMAND,
|
||||
TURN_RIGHT_COMMAND,
|
||||
TURN_LEFT_COMMAND
|
||||
),
|
||||
Items.IRON_BOOTS
|
||||
)
|
||||
List.of(),
|
||||
List.of(
|
||||
WALK_COMMAND,
|
||||
TURN_RIGHT_COMMAND,
|
||||
TURN_LEFT_COMMAND
|
||||
),
|
||||
Items.IRON_BOOTS
|
||||
);
|
||||
|
||||
public static void registerMe() {}
|
||||
|
||||
@@ -14,8 +14,8 @@ public class SimpleModuleItem extends Item implements PolymerItem, ModuleItem {
|
||||
private final List<Command> commands;
|
||||
private final Item vanillaItem;
|
||||
|
||||
public SimpleModuleItem(List<CodeBlock<?,?>> codeBlocks, List<Command> commands, Item vanillaItem) {
|
||||
super(new Item.Settings().maxCount(1));
|
||||
public SimpleModuleItem(List<CodeBlock<?,?>> codeBlocks, List<Command> commands, Settings settings, Item vanillaItem) {
|
||||
super(settings.maxCount(1));
|
||||
this.codeBlocks = codeBlocks;
|
||||
this.commands = commands;
|
||||
this.vanillaItem = vanillaItem;
|
||||
|
||||
Reference in New Issue
Block a user