-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed NeoForge not loading via proper Supplier use
Suppliers can not be provided an already created object instance. It must created within the Supplier.
- Loading branch information
1 parent
a5dc058
commit 8beb42f
Showing
7 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 13 additions & 8 deletions
21
common/src/main/java/com/anthonymendez/items/SimpleTools.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
package com.anthonymendez.items; | ||
|
||
import com.google.common.base.Supplier; | ||
import com.google.common.base.Suppliers; | ||
import com.google.common.collect.ImmutableList; | ||
import java.util.List; | ||
import java.util.function.Supplier; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroup; | ||
|
||
public class SimpleTools { | ||
public static final SimplePickaxeTool EMERALD_PICKAXE = | ||
new SimplePickaxeTool(SimpleToolMaterials.EMERALD); | ||
public static final SimplePickaxeTool NETHER_QUARTZ_PICKAXE = | ||
new SimplePickaxeTool(SimpleToolMaterials.NETHER_QUARTZ); | ||
public static final Supplier<Item> EMERALD_PICKAXE = | ||
Suppliers.memoize(() -> new SimplePickaxeTool(SimpleToolMaterials.EMERALD)); | ||
|
||
/** Contains a list of all {@link SimpleTools}. */ | ||
public static final Item[] ALL_TOOLS = {EMERALD_PICKAXE, NETHER_QUARTZ_PICKAXE}; | ||
public static final Supplier<Item> QUARTZ_PICKAXE = | ||
Suppliers.memoize(() -> new SimplePickaxeTool(SimpleToolMaterials.QUARTZ)); | ||
|
||
/** Contains a list of all {@link SimpleTools}. */ | ||
public static final List<Supplier<Item>> ALL_TOOLS = | ||
ImmutableList.<Supplier<Item>>builder() | ||
.add(EMERALD_PICKAXE) | ||
.add(QUARTZ_PICKAXE) | ||
.build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters