Skip to content

Commit ab5e83c

Browse files
authored
Merge pull request Sefiraat#228 from balugaq/master
spotless
2 parents 9249387 + 6d0f4a9 commit ab5e83c

File tree

136 files changed

+865
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+865
-779
lines changed

src/main/java/com/balugaq/netex/api/data/AdvancedMachineRecipe.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44
import com.ytdd9527.networksexpansion.utils.itemstacks.CompareUtil;
5+
import lombok.Getter;
6+
import org.jetbrains.annotations.NotNull;
57

68
import javax.annotation.Nonnull;
79

@@ -14,7 +16,8 @@ public class AdvancedMachineRecipe {
1416
private final ItemAmountWrapper[] inputs;
1517
@Nonnull
1618
private final AdvancedRandomOutput[] randomOutputs;
17-
private final int[] weightBeginValues;
19+
private final int @NotNull [] weightBeginValues;
20+
@Getter
1821
private int weightSum = 0;
1922

2023
public AdvancedMachineRecipe(@Nonnull ItemAmountWrapper[] inputs, @Nonnull AdvancedRandomOutput[] randomOutputs) {
@@ -47,15 +50,7 @@ public boolean isRandomOutput() {
4750
return this.randomOutputs.length > 1;
4851
}
4952

50-
public int getWeightSum() {
51-
return this.weightSum;
52-
}
53-
5453
public record AdvancedRandomOutput(@Nonnull ItemAmountWrapper[] outputItem, int weight) {
55-
public AdvancedRandomOutput(@Nonnull ItemAmountWrapper[] outputItem, int weight) {
56-
this.outputItem = outputItem;
57-
this.weight = weight;
58-
}
5954

6055
@Nonnull
6156
public ItemAmountWrapper[] getOutputItem() {

src/main/java/com/balugaq/netex/api/data/ItemAmountWrapper.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import com.ytdd9527.networksexpansion.utils.itemstacks.ItemStackUtil;
55
import io.github.sefiraat.networks.utils.StackUtils;
6+
import lombok.Getter;
7+
import lombok.Setter;
68
import org.bukkit.inventory.ItemStack;
79
import org.bukkit.inventory.meta.ItemMeta;
810

@@ -14,6 +16,8 @@
1416
* @author Final_ROOT
1517
* @since 2.0
1618
*/
19+
@Setter
20+
@Getter
1721
public class ItemAmountWrapper extends ItemWrapper {
1822
private int amount;
1923

@@ -72,14 +76,6 @@ public static void addToList(@Nonnull List<ItemAmountWrapper> list, @Nonnull Ite
7276
list.add(new ItemAmountWrapper(item.getItemStack(), item.getItemMeta(), item.amount * mul));
7377
}
7478

75-
public int getAmount() {
76-
return this.amount;
77-
}
78-
79-
public void setAmount(int amount) {
80-
this.amount = amount;
81-
}
82-
8379
public void addAmount(int amount) {
8480
this.amount += amount;
8581
}

src/main/java/com/balugaq/netex/api/data/ItemContainer.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,37 @@
33
import io.github.sefiraat.networks.utils.StackUtils;
44
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
55
import lombok.Getter;
6+
import lombok.Setter;
67
import org.bukkit.inventory.ItemStack;
8+
import org.jetbrains.annotations.NotNull;
79

810
@Getter
911
public class ItemContainer {
1012

1113
private final int id;
12-
private final ItemStack sample;
14+
private final @NotNull ItemStack sample;
1315
@Getter
14-
private final ItemStackWrapper wrapper;
16+
private final @NotNull ItemStackWrapper wrapper;
17+
@Setter
1518
@Getter
1619
private int amount;
1720

18-
public ItemContainer(int id, ItemStack item, int amount) {
21+
public ItemContainer(int id, @NotNull ItemStack item, int amount) {
1922
this.id = id;
2023
this.sample = item.clone();
2124
sample.setAmount(1);
2225
this.wrapper = ItemStackWrapper.wrap(sample);
2326
this.amount = amount;
2427
}
2528

26-
public ItemStack getSample() {
29+
public @NotNull ItemStack getSample() {
2730
return sample.clone();
2831
}
2932

33+
public ItemStack getSampleDirectly() {
34+
return sample;
35+
}
36+
3037
public boolean isSimilar(ItemStack other) {
3138
return StackUtils.itemsMatch(wrapper, other);
3239
}
@@ -52,11 +59,7 @@ public int removeAmount(int amount) {
5259
}
5360
}
5461

55-
public void setAmount(int amount) {
56-
this.amount = amount;
57-
}
58-
59-
public String toString() {
62+
public @NotNull String toString() {
6063
return "ItemContainer{" +
6164
"id=" + id +
6265
", sample=" + sample +

src/main/java/com/balugaq/netex/api/data/Language.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
import com.google.common.base.Preconditions;
44
import org.bukkit.configuration.file.FileConfiguration;
55
import org.bukkit.configuration.file.YamlConfiguration;
6+
import org.jetbrains.annotations.NotNull;
67

78
import javax.annotation.Nonnull;
89
import javax.annotation.ParametersAreNonnullByDefault;
910
import java.io.File;
1011
import java.io.IOException;
11-
import java.util.Iterator;
1212

1313
public final class Language {
14-
private final String lang;
15-
private final File currentFile;
16-
private final FileConfiguration currentConfig;
14+
private final @NotNull String lang;
15+
private final @NotNull File currentFile;
16+
private final @NotNull FileConfiguration currentConfig;
1717

1818
@ParametersAreNonnullByDefault
1919
public Language(String lang, File currentFile, FileConfiguration defaultConfig) {
@@ -24,10 +24,8 @@ public Language(String lang, File currentFile, FileConfiguration defaultConfig)
2424
this.currentFile = currentFile;
2525
this.currentConfig = YamlConfiguration.loadConfiguration(currentFile);
2626
this.currentConfig.setDefaults(defaultConfig);
27-
Iterator var4 = defaultConfig.getKeys(true).iterator();
2827

29-
while (var4.hasNext()) {
30-
String key = (String) var4.next();
28+
for (String key : defaultConfig.getKeys(true)) {
3129
if (!this.currentConfig.contains(key)) {
3230
this.currentConfig.set(key, defaultConfig.get(key));
3331
}

src/main/java/com/balugaq/netex/api/data/RandomMachineRecipe.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.ytdd9527.networksexpansion.utils.itemstacks.CompareUtil;
55
import com.ytdd9527.networksexpansion.utils.itemstacks.ItemStackUtil;
6+
import lombok.Getter;
67
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe;
78
import org.bukkit.Material;
89
import org.bukkit.inventory.ItemStack;
@@ -111,8 +112,9 @@ public RandomMachineRecipe addRandomOutput(@Nonnull RandomOutput... randomOutput
111112
*/
112113
public static class RandomOutput {
113114
@Nonnull
114-
private ItemStack[] outputItem;
115-
private int weight;
115+
private final ItemStack[] outputItem;
116+
@Getter
117+
private final int weight;
116118

117119
public RandomOutput(@Nonnull List<ItemStack> outputItem, int weight) {
118120
this.outputItem = outputItem.toArray(new ItemStack[0]);
@@ -139,8 +141,5 @@ public ItemStack[] getOutputItem() {
139141
return outputItem;
140142
}
141143

142-
public int getWeight() {
143-
return weight;
144-
}
145144
}
146145
}

0 commit comments

Comments
 (0)