diff --git a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/Constants.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/Constants.java index f07c887..1789b8c 100644 --- a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/Constants.java +++ b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/Constants.java @@ -1,11 +1,24 @@ package su.a71.tardim_ic.tardim_ic; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.apache.logging.log4j.LogManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Random; + public class Constants { - public static final String MOD_ID = "tardim_ic"; - public static final String MOD_NAME = "TARDIM: In Control"; - public static final Logger LOG = LoggerFactory.getLogger(MOD_NAME); + public static final String MOD_ID; + public static final String MOD_NAME; + public static final Logger LOG; + public static final Gson GSON; + + static { + MOD_ID = "tardim_ic"; + MOD_NAME = "TARDIM: In Control"; + LOG = LoggerFactory.getLogger(MOD_NAME); + GSON = (new GsonBuilder()).setPrettyPrinting().create(); + } } \ No newline at end of file diff --git a/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_1.png b/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_1.png new file mode 100644 index 0000000..c98028b Binary files /dev/null and b/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_1.png differ diff --git a/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_2.png b/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_2.png new file mode 100644 index 0000000..c98028b Binary files /dev/null and b/Common/src/main/resources/assets/minecraft/textures/models/armor/personal_jammer_layer_2.png differ diff --git a/Common/src/main/resources/assets/tardim_ic/models/item/location_jammer.json b/Common/src/main/resources/assets/tardim_ic/models/item/personal_jammer.json similarity index 53% rename from Common/src/main/resources/assets/tardim_ic/models/item/location_jammer.json rename to Common/src/main/resources/assets/tardim_ic/models/item/personal_jammer.json index 1a1fcc4..d8930c2 100644 --- a/Common/src/main/resources/assets/tardim_ic/models/item/location_jammer.json +++ b/Common/src/main/resources/assets/tardim_ic/models/item/personal_jammer.json @@ -1,6 +1,6 @@ { "parent": "item/generated", "textures": { - "layer0": "tardim_ic:item/location_jammer" + "layer0": "tardim_ic:item/personal_jammer" } } \ No newline at end of file diff --git a/Common/src/main/resources/data/computercraft/lua/premade/NavDash.lua b/Common/src/main/resources/data/computercraft/lua/premade/NavDash.lua new file mode 100644 index 0000000..bbd4d8d --- /dev/null +++ b/Common/src/main/resources/data/computercraft/lua/premade/NavDash.lua @@ -0,0 +1,3 @@ +--[[ + This is source code of my personal TARDIM Navigation Dashboard (NavDash) +] \ No newline at end of file diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java index a4d86bc..3d3be0e 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java @@ -16,7 +16,7 @@ import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import su.a71.tardim_ic.tardim_ic.blocks.food_machine.FoodMachineBlock; import su.a71.tardim_ic.tardim_ic.blocks.food_machine.FoodMachineTileEntity; -import su.a71.tardim_ic.tardim_ic.jammer.LocationJammerMaterial; +import su.a71.tardim_ic.tardim_ic.jammer.PersonalJammerMaterial; import su.a71.tardim_ic.tardim_ic.blocks.redstone_input.RedstoneInputBlock; import su.a71.tardim_ic.tardim_ic.blocks.redstone_input.RedstoneInputTileEntity; import su.a71.tardim_ic.tardim_ic.registration.CommandInit; @@ -51,12 +51,12 @@ public class Registration { public static final ResourceLocation CLOISTER_SOUND = new ResourceLocation("tardim_ic:cloister"); public static SoundEvent CLOISTER_SOUND_EVENT = new SoundEvent(CLOISTER_SOUND); - public static final ArmorMaterial LOCATION_JAMMER_MATERIAL = new LocationJammerMaterial(); - public static final Item LOCATION_JAMMER = new ArmorItem(LOCATION_JAMMER_MATERIAL, EquipmentSlot.CHEST, new Item.Properties().tab(TARDIM_IC_TAB)); + public static final ArmorMaterial PERSONAL_JAMMER_MATERIAL = new PersonalJammerMaterial(); + public static final Item PERSONAL_JAMMER = new ArmorItem(PERSONAL_JAMMER_MATERIAL, EquipmentSlot.CHEST, new Item.Properties().tab(TARDIM_IC_TAB)); // Register our stuff public static void register() { - Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "location_jammer"), LOCATION_JAMMER); + Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "personal_jammer"), PERSONAL_JAMMER); if (FabricLoader.getInstance().isModLoaded("computercraft")) { ComputerCraftCompat.register(); // Register ComputerCraft-related features diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/blocks/food_machine/FoodMachineTileEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/blocks/food_machine/FoodMachineTileEntity.java index 98966b8..272b893 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/blocks/food_machine/FoodMachineTileEntity.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/blocks/food_machine/FoodMachineTileEntity.java @@ -2,6 +2,8 @@ package su.a71.tardim_ic.tardim_ic.blocks.food_machine; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; @@ -10,11 +12,11 @@ import su.a71.tardim_ic.tardim_ic.Registration; import java.util.UUID; public class FoodMachineTileEntity extends BlockEntity { - public boolean isPowered = false; - public UUID lastPlayer = null; + public int curr_food_index; public FoodMachineTileEntity(BlockPos pos, BlockState state) { - super(Registration.REDSTONE_TARDIM_INPUT_TILEENTITY, pos, state); + super(Registration.FOOD_MACHINE_TILEENTITY, pos, state); + this.curr_food_index = 0; } public BlockPos getPos() { @@ -24,17 +26,16 @@ public class FoodMachineTileEntity extends BlockEntity { @Override public void saveAdditional(CompoundTag tag) { - tag.putBoolean("is_powered", isPowered); - if (lastPlayer != null) { - tag.putUUID("last_player", lastPlayer); - } + tag.putInt("curr_food_index", curr_food_index); + //tag.putBoolean("is_powered", isPowered); super.saveAdditional(tag); } @Override public void load(CompoundTag tag) { super.load(tag); - isPowered = tag.getBoolean("is_powered"); - lastPlayer = tag.getUUID("last_player"); + curr_food_index = tag.getInt("curr_food_index"); + //lastPlayer = tag.getUUID("last_player"); + //event.addListener(new FuelMapReloadListener(GSON, "tardim_fuel")); } } diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/computercraft_compat/peripherals/DigitalInterfacePeripheral.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/computercraft_compat/peripherals/DigitalInterfacePeripheral.java index c4d3b70..8825990 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/computercraft_compat/peripherals/DigitalInterfacePeripheral.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/computercraft_compat/peripherals/DigitalInterfacePeripheral.java @@ -37,7 +37,7 @@ import net.minecraft.world.phys.Vec3; import su.a71.tardim_ic.tardim_ic.Registration; import su.a71.tardim_ic.tardim_ic.computercraft_compat.FakeTardimPeripheralTileEntity; import su.a71.tardim_ic.tardim_ic.utils.FakePlayer; -import static su.a71.tardim_ic.tardim_ic.Registration.LOCATION_JAMMER; +import static su.a71.tardim_ic.tardim_ic.Registration.PERSONAL_JAMMER; import javax.annotation.Nonnull; import java.util.*; @@ -326,7 +326,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer } for (ItemStack armour : player.getArmorSlots()) { - if (armour.is(LOCATION_JAMMER)) { + if (armour.is(PERSONAL_JAMMER)) { throw new LuaException("Player location jammed"); }; } diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/LocationJammerMaterial.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/PersonalJammerMaterial.java similarity index 93% rename from Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/LocationJammerMaterial.java rename to Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/PersonalJammerMaterial.java index b0d04bb..e9b6adf 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/LocationJammerMaterial.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/jammer/PersonalJammerMaterial.java @@ -9,7 +9,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import org.jetbrains.annotations.NotNull; -public class LocationJammerMaterial implements ArmorMaterial { +public class PersonalJammerMaterial implements ArmorMaterial { private static final int[] BASE_DURABILITY = new int[] {13, 15, 16, 11}; private static final int[] PROTECTION_VALUES = new int[] {1, 1, 1, 1}; @@ -41,7 +41,7 @@ public class LocationJammerMaterial implements ArmorMaterial { @Override public @NotNull String getName() { // Must be all lowercase - return "location jammer"; + return "personal_jammer"; } @Override diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/mixin/JammerMixin.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/mixin/JammerMixin.java index f32227b..90b4eaf 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/mixin/JammerMixin.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/mixin/JammerMixin.java @@ -18,7 +18,7 @@ import su.a71.tardim_ic.tardim_ic.registration.CommandInit; import static com.swdteam.tardim.common.command.tardim.CommandTardimBase.sendResponse; import static su.a71.tardim_ic.tardim_ic.Constants.LOG; -import static su.a71.tardim_ic.tardim_ic.Registration.LOCATION_JAMMER; +import static su.a71.tardim_ic.tardim_ic.Registration.PERSONAL_JAMMER; @Mixin(value = CommandLocate.class, remap = false) public class JammerMixin { diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index dec8061..ac004f4 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -4,7 +4,7 @@ "version": "${version}", "name": "Tardim: In Control", - "description": "All of time and space, now automated. Control your TARDIM using ComputerCraft: Tweaked.", + "description": "All of time and space, now automated and improved. This mod aims to make TARDIM even better.", "authors": [ "Andrew_7_1" ], diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index e94d668..23b11c1 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -5,12 +5,12 @@ license = "MIT" [[mods]] #mandatory # The modid of the mod modId = "tardim_ic" #mandatory -version = "1.1" #mandatory +version = "1.2" #mandatory # A display name for the mod displayName = "TARDIM: In Control" #mandatory # The description text for the mod (multi line!) (#mandatory) description = ''' - All of time and space, now automated. Control your TARDIM using ComputerCraft: Tweaked. + All of time and space, now automated and improved. This mod aims to make TARDIM even better. ''' logoFile = "icon.png" authors = "Andrew_7_1" diff --git a/README.md b/README.md index 9da4025..23dc7a9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -# TARDIM: In Control ![Modrinth Downloads](https://img.shields.io/modrinth/dt/tardim-in-control?color=00AF5C&label=modrinth&style=flat&logo=modrinth) -### All of time and space, *now automated*. +![TARDIM: IC Banner](./media/banner.png) +### All of time and space, *now automated and improved*. -![Example dashboard](https://cdn.modrinth.com/data/xsv4H3pa/images/a6726a966b6ceb6cbfa81d4886b26375ee500854.png) - -This mod is an addon for the [TARDIM mod](https://www.curseforge.com/minecraft/mc-mods/tardim), and adds a way to control your time (but mostly space) machine with [ComputerCraft: Tweaked](https://tweaked.cc) computers and redstone using new blocks and peripherals. +This mod is an addon for the [TARDIM mod](https://www.curseforge.com/minecraft/mc-mods/tardim), +and adds a way to control your time (but mostly space) machine with new blocks, redstone, +and even other mods like [ComputerCraft: Tweaked](https://tweaked.cc) computers or [Create](https://github.com/Creators-of-Create/Create) ### Features: +TODO: Re-make this for 1.2 * Digital TARDIM interface: ComputerCraft peripheral that lets you control a TARDIM using computers! Full list of methods is available in the [Javadoc](http://andrey71.me/TARDIM-ic-docs/su/a71/tardim_ic/tardim_ic/DigitalInterfacePeripheral.html) (Sorry for that, this is the best auto-generated docs I could find for now). The peripheral supports almost all commands that the TARDIM computer panel has. * Redstone TARDIM Input: New block that lets you execute a TARDIM command with the power of redstone! After saving a command, this block executes it every time it gets powered by redstone * *This is just the beginning, there are more features to come!* @@ -15,7 +16,7 @@ This mod is an addon for the [TARDIM mod](https://www.curseforge.com/minecraft/m * Get refined control over your TARDIM, such as saving and loading locations, or setting a destination in a GUI. * Add visual effects that activate during flight e.g. note blocks or Create mod contraptions. -The possibilities are endless, the only limit is your imagination! (And coding skills) +The possibilities are endless, the only limit is your imagination! ### Note Due to nature of the mod **anyone** inside your TARDIM with access to a computer and this mod's peripheral @@ -31,13 +32,14 @@ And another thing: the method that sets destination dimension can't check if the **Can I use this in my modpack?** : Sure, as long as you don't claim the mod as your own. A link to this mod's page would be appreciated too. -**Will there be a 1.19.3 version and beyond?** -: Right now my focus on 1.19.2, but I will try my best to update to later versions as soon as this mod is fully stable. +**Will there be a 1.20 version and beyond?** +: Right now my focus on 1.19.2, but I will try my best to move to later versions as soon as this mod is fully stable, +and dependencies are out. **I encountered a bug or have a suggestion. What do I do?** : If you have a problem or suggestion, the best way to get them to me is through the project's Discord server. -**I don't know ComputerCraft, will this always be a CC-only mod?** -: Ok fine, nobody actually asked that. But in case you did, good news: No! The mod already adds things like Redstone TARDIM Input, -which let you integrate your TARDIM into good old redstone. Going forward, -I plan to add even more ways to control the TARDIM without computers for those who don't want to code their own implementation. \ No newline at end of file +**Do I need to install ComputerCraft or Create for this mod?** +: Nope! While I highly suggest you do (because digital interface is in my opinion the star of the show), +you can enjoy a lot of TARDIM: In Control's features with only TARDIM installed. +If you ever decide to add other optional dependencies, the relevant blocks will become available! \ No newline at end of file diff --git a/TODO.txt b/TODO.txt index 82778f1..69557d0 100644 --- a/TODO.txt +++ b/TODO.txt @@ -48,4 +48,10 @@ Achievements/Advancements: Crafting recipe for floppy with tardim tutorial installer -Power indicator for redstone interface \ No newline at end of file +Power indicator for redstone interface + +Treasure Disk with pre-installed code that users might enjoy + +Datapack-driven way to control where a TARDIM can travel and at what price (For instance, for liftoff) + +Possibly an enchantment that works same as personal jammer \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index debfa5c..6b170a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -version=1.1 +version=1.2 group=su.a71.tardim_ic # Common diff --git a/media/banner.png b/media/banner.png new file mode 100644 index 0000000..781ece3 Binary files /dev/null and b/media/banner.png differ diff --git a/media/banner_narrow.png b/media/banner_narrow.png new file mode 100644 index 0000000..47118db Binary files /dev/null and b/media/banner_narrow.png differ diff --git a/media/icon.png b/media/icon.png new file mode 100644 index 0000000..c95943c Binary files /dev/null and b/media/icon.png differ