
Patch for including help text, and dimension list.
Tokeli opened this issue ยท 3 comments
Was frustrated that it was so hard to find all the dimensions, so quickly added a few things. Don't know if this patchfile itself will work but it's really simple to just put it in by hand. Wasn't remotely a big enough change to fork and do a pull request for.
--- CommandTPP.java 2018-05-16 18:21:16.213810700 -0400
+++ CommandTPP.java 2018-05-16 18:21:11.426496200 -0400
@@ -10,6 +10,7 @@
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.WorldServer;
+import net.minecraftforge.common.DimensionManager;
import javax.annotation.Nullable;
import java.util.ArrayList;
@@ -24,7 +25,20 @@
}
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException{
- if(args.length < 1){return;}
+
+ if(args.length == 0) {
+ ITextComponent component = new TextComponentString("/tpp [<player>] <dimension> <x> <y> <z> | /tpp list");
+ sender.sendMessage(component);
+ return;
+ }
+ if(args[0].equals("list")) {
+ for(int i: DimensionManager.getIDs()) {
+ String name = DimensionManager.getProviderType(i).getName();
+ ITextComponent component = new TextComponentString(Integer.toString(i)+": "+name);
+ sender.sendMessage(component);
+ }
+ return;
+ }
int dimensionid;
EntityPlayer target;
W o o p s, that DimensionManager.getIDs
should be a DimensionManager.getStaticDimensionIDs
, otherwise it'll only show currently-loaded dimensions.