License, commands, AND STILL NOT GINGER
This commit is contained in:
parent
dcd820a10f
commit
c3a67bb2e6
11 changed files with 119 additions and 8 deletions
|
@ -21,9 +21,25 @@ minecraft {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "https://cursemaven.com"
|
||||||
|
content {
|
||||||
|
includeGroup "curse.maven"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
|
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
|
||||||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
|
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 {
|
processResources {
|
||||||
|
|
|
@ -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, "<Insert Cloister bell>", 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
package su.a71.tardim_ic.tardim_ic.command;
|
package su.a71.tardim_ic.tardim_ic.command;
|
||||||
|
|
||||||
// This will be added whenever I manage to convince TARDIM devs to make CommandManager.register public
|
// 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.CommandTardimBase;
|
||||||
import com.swdteam.common.command.tardim.ICommand;
|
import com.swdteam.common.command.tardim.ICommand;
|
||||||
import com.swdteam.tardim.TardimData;
|
import com.swdteam.tardim.TardimData;
|
||||||
|
@ -19,7 +19,7 @@ import static com.swdteam.common.command.tardim.CommandTardimBase.sendResponse;
|
||||||
public class CommandModemTransmit implements ICommand {
|
public class CommandModemTransmit implements ICommand {
|
||||||
@Override
|
@Override
|
||||||
public void execute(String[] args, Player player, BlockPos pos, CommandTardimBase.CommandSource source) {
|
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);
|
TardimData data = TardimManager.getFromPos(pos);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (data.hasPermission(player)) {
|
if (data.hasPermission(player)) {
|
||||||
|
@ -41,16 +41,16 @@ public class CommandModemTransmit implements ICommand {
|
||||||
ComputerCraftAPI.getWirelessNetwork().transmitSameDimension(new Packet(sendChannel, replyChannel, message,
|
ComputerCraftAPI.getWirelessNetwork().transmitSameDimension(new Packet(sendChannel, replyChannel, message,
|
||||||
new CommandSender(player, data.getTravelLocation().getPos())), 300);
|
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) {
|
} catch (Exception var9) {
|
||||||
sendResponse(player, "Invalid coordinates", CommandTardimBase.ResponseType.FAIL, source);
|
CommandTardimBase.sendResponse(player, "Invalid coordinates", CommandTardimBase.ResponseType.FAIL, source);
|
||||||
}
|
}
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
sendResponse(player, this.getUsage(), CommandTardimBase.ResponseType.FAIL, source);
|
CommandTardimBase.sendResponse(player, this.getUsage(), CommandTardimBase.ResponseType.FAIL, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
@ -1,6 +1,7 @@
|
||||||
package su.a71.tardim_ic.tardim_ic;
|
package su.a71.tardim_ic.tardim_ic;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import com.swdteam.common.command.tardim.ICommand;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.CreativeModeTab;
|
import net.minecraft.world.item.CreativeModeTab;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
|
|
@ -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.Constants;
|
||||||
|
|
||||||
|
import su.a71.tardim_ic.tardim_ic.registration.CommandInit;
|
||||||
|
|
||||||
// The value here should match an entry in the META-INF/mods.toml file
|
// The value here should match an entry in the META-INF/mods.toml file
|
||||||
@Mod(Constants.MOD_ID)
|
@Mod(Constants.MOD_ID)
|
||||||
public class TardimInControl {
|
public class TardimInControl {
|
||||||
|
@ -14,6 +16,8 @@ public class TardimInControl {
|
||||||
|
|
||||||
public TardimInControl() {
|
public TardimInControl() {
|
||||||
Registration.register();
|
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
|
// Register ourselves for server and other game events we are interested in. Currently, we do not use any events
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
modLoader = "javafml" #mandatory
|
modLoader = "javafml" #mandatory
|
||||||
loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
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
|
[[mods]] #mandatory
|
||||||
# The modid of the mod
|
# The modid of the mod
|
||||||
modId = "tardim_ic" #mandatory
|
modId = "tardim_ic" #mandatory
|
||||||
|
@ -12,6 +12,8 @@ displayName = "TARDIM: In Control" #mandatory
|
||||||
description = '''
|
description = '''
|
||||||
All of time and space, now automated. Control your TARDIM using ComputerCraft: Tweaked.
|
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.
|
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||||
[[dependencies.tardim_ic]] #optional
|
[[dependencies.tardim_ic]] #optional
|
||||||
# the modid of the dependency
|
# the modid of the dependency
|
||||||
|
|
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -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.
|
|
@ -17,7 +17,7 @@ fabric_version=0.62.0+1.19.2
|
||||||
fabric_loader_version=0.14.9
|
fabric_loader_version=0.14.9
|
||||||
|
|
||||||
# Mod options
|
# Mod options
|
||||||
mod_name="tardim_in_control"
|
mod_name=tardim_in_control
|
||||||
mod_author=Andrew_7_1
|
mod_author=Andrew_7_1
|
||||||
mod_id=tardim_ic
|
mod_id=tardim_ic
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue