Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation Code Cleanup #1932

Merged
merged 7 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@
public abstract class AbstractCriterionBuilder<T extends AdvancementCriterion, B extends AdvancementCriterion.BaseBuilder<T, B>>
implements ScoreAdvancementCriterion.BaseBuilder<T, B> {

@Nullable protected FilteredTrigger trigger;
protected String name;
@Nullable protected FilteredTrigger<?> trigger;
@Nullable protected String name;

@Override
@SuppressWarnings("unchecked")
public B trigger(FilteredTrigger<?> trigger) {
checkNotNull(trigger, "trigger");
this.trigger = trigger;
return (B) this;
}

@Override
@SuppressWarnings("unchecked")
public B name(String name) {
checkNotNull(name, "name");
this.name = name;
Expand All @@ -62,13 +64,15 @@ public T build() {
abstract T build0();

@Override
@SuppressWarnings("unchecked")
public B from(T value) {
this.trigger = value.getTrigger().orElse(null);
this.name = value.getName();
return (B) this;
}

@Override
@SuppressWarnings("unchecked")
public B reset() {
this.trigger = null;
this.name = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.spongepowered.api.advancement.criteria.trigger.FilteredTriggerConfiguration;
import org.spongepowered.api.advancement.criteria.trigger.Trigger;

@SuppressWarnings("rawtypes")
public class SpongeFilteredTrigger implements ICriterionInstance, FilteredTrigger {

private final SpongeTrigger triggerType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

import javax.annotation.Nullable;

@SuppressWarnings("rawtypes")
public class SpongeTrigger implements ICriterionTrigger<SpongeFilteredTrigger>, ITrigger {

private final Class<FilteredTriggerConfiguration> triggerConfigurationClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public class SpongeTriggerBuilder<C extends FilteredTriggerConfiguration> implem
private final static Function<JsonObject, FilteredTriggerConfiguration.Empty> EMPTY_TRIGGER_CONFIGURATION_CONSTRUCTOR =
jsonObject -> EMPTY_TRIGGER_CONFIGURATION;

private Class<C> configType;
private Function<JsonObject, C> constructor;
@Nullable private Class<C> configType;
@Nullable private Function<JsonObject, C> constructor;
@Nullable private Consumer<CriterionEvent.Trigger<C>> eventHandler;
private String id;
@Nullable private String id;
@Nullable private String name;

@Override
Expand Down Expand Up @@ -193,6 +193,7 @@ public Trigger.Builder<C> name(String name) {
return this;
}

@SuppressWarnings("rawtypes")
@Override
public Trigger<C> build() {
checkState(this.id != null, "The id must be set");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/spongepowered/common/ban/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.ban;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.ban;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.block;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.block;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.command;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.command;
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean flush(SpongeConfig<?> config) {
public void flush() {
if (!this.stagedConfigs.isEmpty()) {
synchronized (this) {
for (SpongeConfig spongeConfig : this.stagedConfigs) {
for (SpongeConfig<?> spongeConfig : this.stagedConfigs) {
spongeConfig.saveNow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.config;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.config;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.authlib;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.authlib;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.block.tileentity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.block.tileentity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.manipulator.immutable.block;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.manipulator.immutable.block;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.manipulator.immutable.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.manipulator.immutable.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.manipulator.immutable;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.manipulator.immutable;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.manipulator;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.manipulator;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.meta;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.meta;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.util.weighted;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.util.weighted;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.builder.world;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.world;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.block;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.block;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.common;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.common;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.entity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.entity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.extra;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.extra;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.immutable.tileentity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.immutable.tileentity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.block;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.block;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.common;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.common;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.entity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.entity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.extra;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.extra;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator.mutable.tileentity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator.mutable.tileentity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.manipulator;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.manipulator;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.meta;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.meta;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.persistence;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.persistence;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data.block;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data.block;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data.entity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data.entity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data.extra;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data.extra;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.data.tileentity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.data.tileentity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.multi.entity;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.multi.entity;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor.multi.item;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor.multi.item;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
@org.spongepowered.api.util.annotation.NonnullByDefault package org.spongepowered.common.data.processor;
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.processor;
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected ImmutableValue<Boolean> constructImmutableValue(Boolean value) {
}

@Override
public DataTransactionResult removeFrom(ValueContainer container) {
public DataTransactionResult removeFrom(ValueContainer<?> container) {
return DataTransactionResult.failNoData();
}
}
Loading