From 7d4dcc3e4bb35c12bf53c5b58025237fa95b321b Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Wed, 28 Jun 2017 11:08:26 +0200 Subject: [PATCH] Allow changing of a source after creation of a contextbuilder --- .../mojang/brigadier/context/CommandContextBuilder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java b/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java index 066451e..3ed4aa9 100644 --- a/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java +++ b/src/main/java/com/mojang/brigadier/context/CommandContextBuilder.java @@ -9,13 +9,18 @@ import java.util.Map; public class CommandContextBuilder { private final Map> arguments = Maps.newHashMap(); private final Map, String> nodes = Maps.newLinkedHashMap(); - private final S source; + private S source; private Command command; public CommandContextBuilder(S source) { this.source = source; } + public CommandContextBuilder withSource(S source) { + this.source = source; + return this; + } + public S getSource() { return source; }