Skip to content

Commit

Permalink
Added Document to some more types, and ZCT.Method to BEP methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kindlich committed Apr 26, 2020
1 parent b95bddc commit 978811b
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 2 deletions.
@@ -1,7 +1,6 @@
package com.blamejared.crafttweaker.api;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class ScriptLoadingOptions {
private boolean format;
Expand Down
Expand Up @@ -39,6 +39,7 @@
public class BracketHandlers {

@BracketResolver("item")
@ZenCodeType.Method
public static IItemStack getItem(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
CraftTweakerAPI.logWarning("Item BEP <item:%s> does not seem to be lower-cased!", tokens);
Expand All @@ -55,6 +56,7 @@ public static IItemStack getItem(String tokens) {
}

@BracketResolver("potion")
@ZenCodeType.Method
public static MCPotion getPotion(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
CraftTweakerAPI.logWarning("Potion BEP <potion:%s> does not seem to be lower-cased!", tokens);
Expand All @@ -71,6 +73,7 @@ public static MCPotion getPotion(String tokens) {
}

@BracketResolver("effect")
@ZenCodeType.Method
public static MCEffect getEffect(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
CraftTweakerAPI.logWarning("Effect BEP <effect:%s> does not seem to be lower-cased!", tokens);
Expand All @@ -96,7 +99,7 @@ public static Collection<String> getItemBracketDump() {
return result;
}


@ZenCodeType.Method
@BracketResolver("tag")
public static MCTag getTag(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
Expand Down Expand Up @@ -125,6 +128,7 @@ public static IRecipeManager getRecipeManager(String tokens) {
}
}

@ZenCodeType.Method
@BracketResolver("resource")
public static MCResourceLocation getResourceLocation(String tokens) {
return new MCResourceLocation(new ResourceLocation(tokens));
Expand All @@ -137,6 +141,7 @@ public static Collection<String> getRecipeTypeDump() {
return result;
}

@ZenCodeType.Method
@BracketResolver("blockstate")
public static MCBlockState getBlockState(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
Expand Down Expand Up @@ -178,6 +183,7 @@ public static MCBlockState getBlockState(String name, String properties) {
return blockState;
}

@ZenCodeType.Method
@BracketResolver("entitytype")
public static MCEntityType getEntityType(String tokens) {
final int length = tokens.split(":").length;
Expand All @@ -201,6 +207,7 @@ public static Collection<String> getEntityTypeDump() {
return ForgeRegistries.ENTITIES.getKeys().stream().map(key -> "<entitytype:" + key + ">").collect(Collectors.toList());
}

@ZenCodeType.Method
@BracketResolver("entityclassification")
public static MCEntityClassification getEntityClassification(String tokens) {
final int length = tokens.split(":").length;
Expand All @@ -221,6 +228,7 @@ public static Collection<String> getEntityClassificationDump() {
return Arrays.stream(EntityClassification.values()).map(key -> "<entityclassification:" + key.name().toLowerCase() + ">").collect(Collectors.toList());
}

@ZenCodeType.Method
@BracketResolver("directionaxis")
public static MCDirectionAxis getDirectionAxis(String tokens) {
if(!tokens.toLowerCase(Locale.ENGLISH).equals(tokens))
Expand Down
@@ -1,13 +1,15 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import org.openzen.zencode.java.ZenCodeType;

import java.util.Collection;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCAmbiguityConsumer")
@FunctionalInterface
@Document("crafttweaker/api/commands/custom/MCAmbiguityConsumer")
public interface MCAmbiguityConsumer {

@ZenCodeType.Method
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.builder.ArgumentBuilder;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
Expand All @@ -13,6 +14,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCArgumentBuilder")
@Document("crafttweaker/api/commands/custom/MCArgumentBuilder")
public class MCArgumentBuilder {

private final ArgumentBuilder<CommandSource, ?> internal;
Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.tree.ArgumentCommandNode;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCArgumentCommandNode")
@Document("crafttweaker/api/commands/custom/MCArgumentCommandNode")
public class MCArgumentCommandNode extends MCCommandNode {

private final ArgumentCommandNode<CommandSource, ?> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.Command;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -9,6 +10,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCCommand")
@Document("crafttweaker/api/commands/custom/MCCommand")
public class MCCommand {

private final Command<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -10,6 +11,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCCommandContext")
@Document("crafttweaker/api/commands/custom/MCCommandContext")
public class MCCommandContext {

private final CommandContext<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.context.CommandContextBuilder;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -11,6 +12,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCCommandContextBuilder")
@Document("crafttweaker/api/commands/custom/MCCommandContextBuilder")
public class MCCommandContextBuilder {

private final CommandContextBuilder<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.StringReader;
import net.minecraft.command.CommandSource;
Expand All @@ -12,6 +13,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCCommandDispatcher")
@Document("crafttweaker/api/commands/custom/MCCommandDispatcher")
public class MCCommandDispatcher {

private final CommandDispatcher<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.tree.CommandNode;
import com.mojang.brigadier.tree.LiteralCommandNode;
Expand All @@ -14,6 +15,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCCommandNode")
@Document("crafttweaker/api/commands/custom/MCCommandNode")
public class MCCommandNode {

public static MCCommandNode convert(CommandNode<CommandSource> internal) {
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -9,6 +10,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCLiteralArgumentBuilder")
@Document("crafttweaker/api/commands/custom/MCLiteralArgumentBuilder")
public class MCLiteralArgumentBuilder extends MCArgumentBuilder {

private final LiteralArgumentBuilder<CommandSource> internal;
Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.tree.LiteralCommandNode;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCLiteralCommandNode")
@Document("crafttweaker/api/commands/custom/MCLiteralCommandNode")
public class MCLiteralCommandNode extends MCCommandNode {
private final LiteralCommandNode<CommandSource> internal;

Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.ParseResults;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -10,6 +11,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCParseResults")
@Document("crafttweaker/api/commands/custom/MCParseResults")
public class MCParseResults {

private final ParseResults<CommandSource> internal;
Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.context.ParsedArgument;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCParsedArgument")
@Document("crafttweaker/api/commands/custom/MCParsedArgument")
public class MCParsedArgument {

private final ParsedArgument<CommandSource, ?> internal;
Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.context.ParsedCommandNode;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCParsedCommandNode")
@Document("crafttweaker/api/commands/custom/MCParsedCommandNode")
public class MCParsedCommandNode {

private final ParsedCommandNode<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.RedirectModifier;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -12,6 +13,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCRedirectModifier")
@Document("crafttweaker/api/commands/custom/MCRedirectModifier")
public class MCRedirectModifier {

private final RedirectModifier<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.suggestion.SuggestionProvider;
import net.minecraft.command.CommandSource;
Expand All @@ -12,6 +13,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCRequiredArgumentBuilder")
@Document("crafttweaker/api/commands/custom/MCRequiredArgumentBuilder")
public class MCRequiredArgumentBuilder extends MCArgumentBuilder {

private final RequiredArgumentBuilder<CommandSource, ?> internal;
Expand Down
@@ -1,10 +1,12 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCResultConsumer")
@Document("crafttweaker/api/commands/custom/MCResultConsumer")
@FunctionalInterface
public interface MCResultConsumer {

Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.tree.RootCommandNode;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCRootCommandNode")
@Document("crafttweaker/api/commands/custom/MCRootCommandNode")
public class MCRootCommandNode extends MCCommandNode {

private final RootCommandNode<CommandSource> internal;
Expand Down
@@ -1,6 +1,7 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.SingleRedirectModifier;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;
Expand All @@ -9,6 +10,7 @@

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCSingleRedirectModifier")
@Document("crafttweaker/api/commands/custom/MCSingleRedirectModifier")
public class MCSingleRedirectModifier {

private final SingleRedirectModifier<CommandSource> internal;
Expand Down
@@ -1,11 +1,13 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.suggestion.Suggestion;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCSuggestion")
@Document("crafttweaker/api/commands/custom/MCSuggestion")
public class MCSuggestion {

private final Suggestion internal;
Expand Down
@@ -1,12 +1,14 @@
package com.blamejared.crafttweaker.impl.commands.custom;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker_annotations.annotations.*;
import com.mojang.brigadier.context.SuggestionContext;
import net.minecraft.command.CommandSource;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("crafttweaker.api.commands.custom.MCSuggestionContext")
@Document("crafttweaker/api/commands/custom/MCSuggestionContext")
public class MCSuggestionContext {

private final SuggestionContext<CommandSource> internal;
Expand Down

0 comments on commit 978811b

Please sign in to comment.