ParticleType implements WordType<Particle> { @Override public Particle parse(StringReader reader) throws CommandSyntaxException { var name = reader.readUnquotedString().toLowerCase(); var particles = PARTICLES.get(name); if (particles == null) { throw EXCEPTION.createWithContext(reader, name); } return particles; }  @Override Particle parse(StringReader reader); @Override CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder); @Override List<String> getExamples();  }
@Test void parse() throws CommandSyntaxException { assertEquals(Particle.BLOCK_CRACK, type.parse(new StringReader("BLOCK_CRACK"))); }
@Test void parse_throws_exception() throws CommandSyntaxException { assertEquals( "Unknown particle: invalid", assertThrows(CommandSyntaxException.class, () -> type.parse(new StringReader("invalid"))).getRawMessage().toString() ); }