Skip to content

Commit

Permalink
Add lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Feb 6, 2020
1 parent 20c930b commit b9ae339
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ buildscript {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath "io.freefair.gradle:lombok-plugin:4.1.6"
}
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: "io.freefair.lombok"

import net.minecraftforge.gradle.common.task.SignJar

Expand Down
2 changes: 2 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file is generated by the 'io.freefair.lombok' Gradle plugin
config.stopBubbling = true
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package slimeknights.tconstruct.library.materials;

import lombok.Getter;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

@Getter
public class Material implements IMaterial {

// todo config
Expand Down Expand Up @@ -56,21 +58,6 @@ public Material(ResourceLocation identifier, Fluid fluid, boolean craftable, Ite
this.shardItem = shardItem;
}

@Override
public MaterialId getIdentifier() {
return identifier;
}

@Override
public boolean isCraftable() {
return this.craftable;
}

@Override
public Fluid getFluid() {
return fluid;
}

@Override
public ItemStack getShard() {
if (shardItem != ItemStack.EMPTY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
import com.google.gson.*;
import lombok.AllArgsConstructor;
import net.minecraft.client.resources.JsonReloadListener;
import net.minecraft.profiler.IProfiler;
import net.minecraft.resources.IResourceManager;
Expand Down Expand Up @@ -169,23 +170,15 @@ private Optional<BaseMaterialStats> deserializeMaterialStat(MaterialStatsId stat
return Optional.ofNullable(GSON.fromJson(statsJson, materialStatClass));
}

@AllArgsConstructor
private static class StatContent {
private final MaterialStatsId statsId;
private final JsonElement json;

public StatContent(MaterialStatsId statsId, JsonElement json) {
this.statsId = statsId;
this.json = json;
}
}

@AllArgsConstructor
private static class StatsFileContent {
private final MaterialId materialId;
private final List<StatContent> stats;

StatsFileContent(MaterialId materialId, List<StatContent> stats) {
this.materialId = materialId;
this.stats = stats;
}
}
}

0 comments on commit b9ae339

Please sign in to comment.