Skip to content

Commit 25aae60

Browse files
author
Devan-Kerman
committed
a
1 parent 1dfe064 commit 25aae60

38 files changed

+39
-64
lines changed
-17 Bytes
Binary file not shown.
-17 Bytes
Binary file not shown.
-20.2 KB
Binary file not shown.
-41.7 KB
Binary file not shown.
-17 Bytes
Binary file not shown.
Binary file not shown.
17 Bytes
Binary file not shown.
Binary file not shown.
17 Bytes
Binary file not shown.

.gradle/5.2.1/gc.properties

Whitespace-only changes.
Binary file not shown.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Wed Aug 14 17:00:37 CDT 2019
2-
gradle.version=4.4
1+
#Sun Dec 08 19:07:12 CST 2019
2+
gradle.version=5.2.1
-54 Bytes
Binary file not shown.

.gradle/vcs-1/gc.properties

Whitespace-only changes.

build.gradle

+2-16
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,8 @@ repositories {
1515
maven { url "http://repo.dmulloy2.net/nexus/repository/public/" }
1616
}
1717

18-
tasks.withType(Jar) {
19-
destinationDir = file("$rootDir.parentFile/output")
20-
}
21-
22-
configurations { extraLibs }
23-
2418
dependencies {
25-
compile 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
19+
compileOnly 'org.spigotmc:spigot-api:1.14.4-R0.1-SNAPSHOT'
2620
testCompile group: 'junit', name: 'junit', version: '4.12'
27-
28-
compile group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.4.0"
29-
compile fileTree(dir: "$rootDir.parentFile/output", include: ['*.jar'])
30-
}
31-
32-
jar {
33-
from {
34-
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
35-
}
21+
implementation project(':EpiCore-Utilities')
3622
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12.6 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.jar

861 Bytes
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Wed Aug 14 17:00:44 CDT 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

gradlew

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"

gradlew.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
1414
set APP_HOME=%DIRNAME%
1515

1616
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
17+
set DEFAULT_JVM_OPTS="-Xmx64m"
1818

1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome

libs/CustomBrewing-1.0.jar

-8.14 KB
Binary file not shown.

settings.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
rootProject.name = 'EpiCore-Crafting'
2-
1+
rootProject.name = 'EpiCore-1.14'
2+
include ':EpiCore-Utilities'

src/main/java/net/epicorp/crafting/AbstractRecipeManager.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
public abstract class AbstractRecipeManager<R> implements Listener {
1212
protected final Set<UUID> restricted = Collections.newSetFromMap(new ConcurrentHashMap<>());
1313
protected final List<R> recipes = new Vector<>();
14-
protected final Plugin plugin;
15-
16-
public AbstractRecipeManager(Plugin plugin) {
17-
this.plugin = plugin;
18-
}
14+
protected Plugin plugin;
1915

2016
public void register(R recipe) {
21-
recipes.add(recipe);
17+
this.recipes.add(recipe);
2218
}
2319

2420
@EventHandler(priority = EventPriority.MONITOR)
2521
public void quit(PlayerQuitEvent event) {
26-
restricted.remove(event.getPlayer().getUniqueId());
22+
this.restricted.remove(event.getPlayer().getUniqueId());
23+
}
24+
25+
public void setPlugin(Plugin plugin) {
26+
this.plugin = plugin;
2727
}
2828
}

src/main/java/net/epicorp/crafting/anvil/AnvilManager.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
import java.util.stream.Stream;
1818

1919
public class AnvilManager extends AbstractRecipeManager<AnvilRecipe> {
20-
public AnvilManager(Plugin plugin) {
21-
super(plugin);
22-
}
2320

2421
@EventHandler (priority = EventPriority.MONITOR)
2522
public void offer(PrepareAnvilEvent event) {
2623
AnvilInventory inventory = event.getInventory();
2724
Player player = (Player) event.getView().getPlayer();
28-
ItemStack result = result(player, inventory.getContents(), inventory, event.getResult());
25+
ItemStack result = this.result(player, inventory.getContents(), inventory, event.getResult());
2926
if(result != null) {
3027
event.setResult(result);
3128
this.restricted.add(player.getUniqueId());
@@ -37,17 +34,17 @@ public void craft(InventoryClickEvent event) {
3734
Player player = (Player) event.getView().getPlayer();
3835
Inventory inv = event.getClickedInventory();
3936
int slot = event.getSlot();
40-
if(inv instanceof AnvilInventory && restricted.contains(player.getUniqueId()) && slot == 2) {
37+
if(inv instanceof AnvilInventory && this.restricted.contains(player.getUniqueId()) && slot == 2) {
4138
ItemStack[] contents = inv.getContents();
42-
ItemStack result = result(player, contents, (AnvilInventory) inv, null);
39+
ItemStack result = this.result(player, contents, (AnvilInventory) inv, null);
4340
inv.setContents(contents);
4441
if(!Inventories.empty(result))
4542
event.getView().setCursor(result);
4643
}
4744
}
4845

4946
private ItemStack result(Player player, ItemStack[] grid, AnvilInventory inventory, ItemStack result) {
50-
Stream<AnvilRecipe> recipe = recipes.stream();
47+
Stream<AnvilRecipe> recipe = this.recipes.stream();
5148
if (!Inventories.empty(result)) recipe = recipe.filter(AnvilRecipe::override);
5249

5350
ItemStack[] astack = new ItemStack[1];
@@ -69,6 +66,6 @@ private ItemStack result(Player player, ItemStack[] grid, AnvilInventory invento
6966

7067
@EventHandler (priority = EventPriority.MONITOR)
7168
public void close(InventoryCloseEvent event) {
72-
restricted.remove(event.getPlayer().getUniqueId());
69+
this.restricted.remove(event.getPlayer().getUniqueId());
7370
}
7471
}

src/main/java/net/epicorp/crafting/anvil/AnvilResult.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public AnvilResult(ItemStack output, int xp) {
2323
}
2424

2525
public ItemStack getOutput() {
26-
return output;
26+
return this.output;
2727
}
2828

2929
public int getXp() {
30-
return xp;
30+
return this.xp;
3131
}
3232

3333
public boolean isRename() {
34-
return rename;
34+
return this.rename;
3535
}
3636
}

src/main/java/net/epicorp/crafting/brewingstand/BrewManager.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import net.epicorp.crafting.AbstractRecipeManager;
44
import org.bukkit.plugin.Plugin;
55

6+
@Deprecated
67
public class BrewManager extends AbstractRecipeManager<BrewingRecipe> {
7-
8-
public BrewManager(Plugin plugin) {
9-
super(plugin);
10-
}
8+
// TODO not implemented
119
}

src/main/java/net/epicorp/crafting/craftingtable/CShaped.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public CShaped(ItemStack output, ItemStack...inputs) {
3030

3131
@Override
3232
public ItemStack output(ItemStack[] matrix, boolean craftAll) {
33-
if(matrix.length != inputs.length)
33+
if(matrix.length != this.inputs.length)
3434
return null;
3535
int lowest = Integer.MAX_VALUE;
3636
for (int x = 0; x < matrix.length; x++)
37-
if (isSimilar.test(matrix[x], inputs[x])) {
38-
int inps = Inventories.getAmount(inputs[x]);
37+
if (this.isSimilar.test(matrix[x], this.inputs[x])) {
38+
int inps = Inventories.getAmount(this.inputs[x]);
3939
int div;
4040
if (inps != 0) div = Inventories.getAmount(matrix[x]) / inps;
4141
else div = Integer.MAX_VALUE;
@@ -47,7 +47,7 @@ public ItemStack output(ItemStack[] matrix, boolean craftAll) {
4747

4848
for (int x = 0; x < matrix.length; x++)
4949
if (matrix[x] != null)
50-
matrix[x].setAmount((matrix[x].getAmount() - inputs[x].getAmount() * lowest));
50+
matrix[x].setAmount((matrix[x].getAmount() - this.inputs[x].getAmount() * lowest));
5151
ItemStack output = this.ouput.get();
5252
output.setAmount(output.getAmount() * lowest);
5353
return output;

src/main/java/net/epicorp/crafting/craftingtable/CraftingManager.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
import java.util.UUID;
1818

1919
public class CraftingManager extends AbstractRecipeManager<CraftingRecipe> {
20-
public CraftingManager(Plugin plugin) {
21-
super(plugin);
22-
}
23-
2420
@EventHandler(priority = EventPriority.MONITOR)
2521
public void craftEvent(InventoryClickEvent event) { // here, we are setting the item in the user's hand
2622
Inventory inv = event.getClickedInventory();
@@ -31,20 +27,20 @@ public void craftEvent(InventoryClickEvent event) { // here, we are setting the
3127
final boolean craft = craftAll;
3228
ItemStack[] matrix = Inventories.clone(((CraftingInventory) inv).getMatrix());
3329
Inventories.clean(matrix);
34-
recipes.stream().map(c -> c.output(matrix, craft)).filter(Objects::nonNull).findFirst().ifPresent(i -> {
30+
this.recipes.stream().map(c -> c.output(matrix, craft)).filter(Objects::nonNull).findFirst().ifPresent(i -> {
3531
if (craft && !Inventories.canAddStack(i, event.getView().getBottomInventory())) // if shiftclick and inventory is full
3632
return;
3733
UUID uuid = event.getView().getPlayer().getUniqueId();
38-
restricted.add(uuid);
34+
this.restricted.add(uuid);
3935
event.setCurrentItem(i);
40-
Bukkit.getScheduler().runTaskLater(plugin, () -> {
36+
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
4137
try {
4238
Inventories.clean(matrix);
4339
((CraftingInventory) inv).setMatrix(matrix);
44-
display((CraftingInventory) inv);
40+
this.display((CraftingInventory) inv);
4541
((Player) event.getWhoClicked()).updateInventory();
4642
} finally {
47-
restricted.remove(uuid);
43+
this.restricted.remove(uuid);
4844
}
4945
}, 0);
5046
});
@@ -54,13 +50,12 @@ public void craftEvent(InventoryClickEvent event) { // here, we are setting the
5450

5551
@EventHandler(priority = EventPriority.MONITOR)
5652
public void prep(PrepareItemCraftEvent event) { // only thing that happens here, is that we are DISPLAYING the result item
57-
if (!restricted.contains(event.getView().getPlayer().getUniqueId()))
58-
display(event.getInventory());
53+
if (!this.restricted.contains(event.getView().getPlayer().getUniqueId())) this.display(event.getInventory());
5954
}
6055

6156
private void display(CraftingInventory inventory) {
6257
ItemStack[] matrix = Inventories.clone(inventory.getMatrix());
6358
Inventories.clean(matrix);
64-
recipes.stream().map(c -> c.output(matrix, false)).filter(Objects::nonNull).findFirst().ifPresent(inventory::setResult);
59+
this.recipes.stream().map(c -> c.output(matrix, false)).filter(Objects::nonNull).findFirst().ifPresent(inventory::setResult);
6560
}
6661
}

src/main/java/net/epicorp/crafting/craftingtable/FunctionalRecipe.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public FunctionalRecipe(Supplier<ItemStack> output, Function<ItemStack, Integer>
2020

2121
@Override
2222
public ItemStack output(ItemStack[] matrix, boolean craftAll) {
23-
if(matrix.length != functions.length)
23+
if(matrix.length != this.functions.length)
2424
return null;
2525
int lowest = Integer.MAX_VALUE;
2626
int[] inputs = new int[matrix.length];
2727
for (int x = 0; x < matrix.length; x++) {
28-
int test = functions[x].apply(matrix[x]);
28+
int test = this.functions[x].apply(matrix[x]);
2929
inputs[x] = test;
3030
if (test != -1) {
3131
int div;

0 commit comments

Comments
 (0)