diff --git a/Common/build.gradle b/Common/build.gradle index ea3a28a..442df8e 100644 --- a/Common/build.gradle +++ b/Common/build.gradle @@ -21,9 +21,25 @@ minecraft { } } +repositories { + maven { + url "https://cursemaven.com" + content { + includeGroup "curse.maven" + } + } +} + dependencies { compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' + + // CC: R and TARDIM + //implementation("curse.maven:cc-restitched-462672:3908334") + compileOnly("org.squiddev:cc-tweaked-1.19.1:${cc_version}") + compileOnly("curse.maven:tardim-531315:4453925") + //implementation ("org.squiddev:cc-tweaked-1.19.1:${cc_version}") + } processResources { diff --git a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandCloisterBell.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandCloisterBell.java new file mode 100644 index 0000000..28359ff --- /dev/null +++ b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandCloisterBell.java @@ -0,0 +1,54 @@ +package su.a71.tardim_ic.tardim_ic.command; + +import com.swdteam.common.command.tardim.CommandTardimBase; +import com.swdteam.common.command.tardim.ICommand; +import com.swdteam.tardim.TardimData; +import com.swdteam.tardim.TardimManager; + + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.entity.player.Player; + +//import static com.swdteam.common.command.tardim.CommandTardimBase.sendResponse; + +public class CommandCloisterBell implements ICommand { + @Override + public void execute(String[] args, Player player, BlockPos pos, CommandTardimBase.CommandSource source) { + if (args.length == 0) { + TardimData data = TardimManager.getFromPos(pos); + if (data != null) { + if (data.hasPermission(player)) { + try { + CommandTardimBase.sendResponse(player, "", CommandTardimBase.ResponseType.COMPLETE, source); + } catch (Exception var9) { + CommandTardimBase.sendResponse(player, "There was an error", CommandTardimBase.ResponseType.FAIL, source); + } + } else { + CommandTardimBase.sendResponse(player, "You do not have permission", CommandTardimBase.ResponseType.FAIL, source); + } + } + } else { + CommandTardimBase.sendResponse(player, this.getUsage(), CommandTardimBase.ResponseType.FAIL, source); + } + } + + @Override + public String getCommandName() { + return "cloisterBell"; + } + + @Override + public String getUsage() { + return "cloisterBell"; + } + + @Override + public CommandTardimBase.CommandSource allowedSource() { + return CommandTardimBase.CommandSource.BOTH; + } +} diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java similarity index 81% rename from Forge/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java rename to Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java index 70f30ab..82912cc 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java +++ b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandModemTransmit.java @@ -1,8 +1,8 @@ package su.a71.tardim_ic.tardim_ic.command; // This will be added whenever I manage to convince TARDIM devs to make CommandManager.register public +// 13.04.23 ITS ALIVE -import com.mojang.brigadier.Command; import com.swdteam.common.command.tardim.CommandTardimBase; import com.swdteam.common.command.tardim.ICommand; import com.swdteam.tardim.TardimData; @@ -19,7 +19,7 @@ import static com.swdteam.common.command.tardim.CommandTardimBase.sendResponse; public class CommandModemTransmit implements ICommand { @Override public void execute(String[] args, Player player, BlockPos pos, CommandTardimBase.CommandSource source) { - if (args.length == 3) { + if (args.length == 3) { // TODO: 3 or 4??? TardimData data = TardimManager.getFromPos(pos); if (data != null) { if (data.hasPermission(player)) { @@ -41,16 +41,16 @@ public class CommandModemTransmit implements ICommand { ComputerCraftAPI.getWirelessNetwork().transmitSameDimension(new Packet(sendChannel, replyChannel, message, new CommandSender(player, data.getTravelLocation().getPos())), 300); } - sendResponse(player, "Sent modem message", CommandTardimBase.ResponseType.COMPLETE, source); + CommandTardimBase.sendResponse(player, "Sent modem message", CommandTardimBase.ResponseType.COMPLETE, source); } catch (Exception var9) { - sendResponse(player, "Invalid coordinates", CommandTardimBase.ResponseType.FAIL, source); + CommandTardimBase.sendResponse(player, "Invalid coordinates", CommandTardimBase.ResponseType.FAIL, source); } } else { - sendResponse(player, "You do not have permission", CommandTardimBase.ResponseType.FAIL, source); + CommandTardimBase.sendResponse(player, "You do not have permission", CommandTardimBase.ResponseType.FAIL, source); } } } else { - sendResponse(player, this.getUsage(), CommandTardimBase.ResponseType.FAIL, source); + CommandTardimBase.sendResponse(player, this.getUsage(), CommandTardimBase.ResponseType.FAIL, source); } } diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandSender.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandSender.java similarity index 100% rename from Forge/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandSender.java rename to Common/src/main/java/su/a71/tardim_ic/tardim_ic/command/CommandSender.java diff --git a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/registration/CommandInit.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/registration/CommandInit.java new file mode 100644 index 0000000..1b25632 --- /dev/null +++ b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/registration/CommandInit.java @@ -0,0 +1,13 @@ +package su.a71.tardim_ic.tardim_ic.registration; + + +import su.a71.tardim_ic.tardim_ic.command.CommandModemTransmit; +import su.a71.tardim_ic.tardim_ic.command.CommandCloisterBell; +import com.swdteam.common.init.CommandManager; + +public class CommandInit { + public static void init() { + CommandManager.register(new CommandModemTransmit()); + CommandManager.register(new CommandCloisterBell()); + } +} diff --git a/Common/src/main/resources/assets/tardim_ic/icon.png b/Common/src/main/resources/icon.png similarity index 100% rename from Common/src/main/resources/assets/tardim_ic/icon.png rename to Common/src/main/resources/icon.png diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java index d928b3f..1677e42 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java @@ -1,6 +1,7 @@ package su.a71.tardim_ic.tardim_ic; import com.google.common.collect.Sets; +import com.swdteam.common.command.tardim.ICommand; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/TardimInControl.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/TardimInControl.java index 6e31198..c0e9ed3 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/TardimInControl.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/TardimInControl.java @@ -5,6 +5,8 @@ import net.minecraftforge.fml.common.Mod; import su.a71.tardim_ic.tardim_ic.Constants; +import su.a71.tardim_ic.tardim_ic.registration.CommandInit; + // The value here should match an entry in the META-INF/mods.toml file @Mod(Constants.MOD_ID) public class TardimInControl { @@ -14,6 +16,8 @@ public class TardimInControl { public TardimInControl() { Registration.register(); + CommandInit.init(); // Register commands + // Register ourselves for server and other game events we are interested in. Currently, we do not use any events MinecraftForge.EVENT_BUS.register(this); } diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index 3133d7a..8482b4b 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -1,7 +1,7 @@ modLoader = "javafml" #mandatory loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. -license = "All rights reserved" +license = "MIT" [[mods]] #mandatory # The modid of the mod modId = "tardim_ic" #mandatory @@ -12,6 +12,8 @@ displayName = "TARDIM: In Control" #mandatory description = ''' All of time and space, now automated. Control your TARDIM using ComputerCraft: Tweaked. ''' +logoFile = "icon.png" +authors = "Andrew_7_1" # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.tardim_ic]] #optional # the modid of the dependency diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7508967 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Andrey Nikitin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/gradle.properties b/gradle.properties index 4c8926d..783e70d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ fabric_version=0.62.0+1.19.2 fabric_loader_version=0.14.9 # Mod options -mod_name="tardim_in_control" +mod_name=tardim_in_control mod_author=Andrew_7_1 mod_id=tardim_ic