Skip to content

Commit

Permalink
Updated docs, fixed some warnings
Browse files Browse the repository at this point in the history
Updated the readme to reflect recent changes.

Bumped the version number from 1.0 to 1.1

Fixed or suppressed some minor warnings.
  • Loading branch information
c-massie committed Mar 17, 2022
1 parent 521cc34 commit 1333bae
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.0'
version = '1.1'
group = 'scot.massie.mc.itemcopy' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'itemcopy'

Expand Down
12 changes: 11 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Itemcopy

This mod adds two commands: `/copyitem` and `/pasteitem`.
This mod adds the ability to copy, paste, and share items with NBT data.

The intent of this mod is to give players the ability to copy items they may have created in a way that doesn't give them the ability to create new items. It was inspired by the desire to easily store, recall, and share Chisels & Bits patterns.

## Commands

`/copyitem <name>` lets you copy the current item in your hand, with a given name, to a file. (see below) This name may be multiple words long. You can use the same name for copies of different items. (e.g. for a book and for a banner)

`/pasteitem <name>` lets you paste a previously copied item onto the item in your hand, as long as it's an item of the same type. As you type, possible copies will be suggested. This allows you to copy and paste items between worlds and even onto servers.

`/shareitem <recipient name>` shares the item in your hand with another player. If they accept, they will have access to it as though they had copied it themselves.

`/shareitem <recipient name> <copy name>` shares an already made copy of an item with another player, where "copy name" is the name an item was copied as. (e.g. with `/copyitem`)

`/acceptshareditem <sender name> <copy name>` accepts an offer to share a copy of an item from another player. "Copy name" is the name the copy will be saved as. If no "copy name" is provided, it will be saved with the name the person sharing the item gave it, unless they're sharing the item in their hand and not a saved copy, in which case it will be saved as "shareditem".

## Whitelist

On first run, a whitelist file is created in the config folder (`config/itemcopy-whitelist.txt`) where each line is an item ID that's whitelisted for this mod. You can add or remove whitelisted items by adding them to, or removing them from, this file.
Expand Down Expand Up @@ -35,3 +43,5 @@ Some items that seem conceptually variants of the same item may be entirely sepa
## Technical

Built against Forge 39.1.0 for Minecraft 1.18.1.

This mod is required on both the server and client sides.
3 changes: 2 additions & 1 deletion src/main/java/scot/massie/mc/itemcopy/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ public static int cmdShare(CommandContext<CommandSourceStack> context)
return 1;
}

public static int cmdShare_itemInHand(CommandContext<CommandSourceStack> context)
public static int cmdShare_itemInHand(
@SuppressWarnings("BoundedWildcard") CommandContext<CommandSourceStack> context)
{
CommandSourceStack src = context.getSource();

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/scot/massie/mc/itemcopy/CopyPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

Expand All @@ -15,8 +14,8 @@ public final class CopyPath implements Iterable<String>

private final List<String> steps;

public CopyPath(List<String> steps)
{ this.steps = Collections.unmodifiableList(new ArrayList<>(steps)); }
public CopyPath(@SuppressWarnings("TypeMayBeWeakened") List<String> steps)
{ this.steps = List.copyOf(steps); }

public CopyPath(String... steps)
{ this(Arrays.asList(steps)); }
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/scot/massie/mc/itemcopy/Paster.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ modId="itemcopy" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="1.0 for Minecraft 1.18" #mandatory
version="1.1 for Minecraft 1.18" #mandatory
# A display name for the mod
displayName="ItemCopy" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
Expand Down

0 comments on commit 1333bae

Please sign in to comment.