generated from NeoForgeMDKs/MDK-1.21.1-ModDevGradle
-
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.
1 parent
c81e01d
commit 4f224e3
Showing
19 changed files
with
247 additions
and
41 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/generated/resources/data/researchd/researchd/research/coal.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:coal", | ||
"parents": [ | ||
"researchd:wooden_pickaxe" | ||
], | ||
"requires_parent": true, | ||
"research_points": { | ||
"researchd:end": 4, | ||
"researchd:nether": 7 | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/generated/resources/data/researchd/researchd/research/copper.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:raw_copper", | ||
"parents": [ | ||
"researchd:wooden_pickaxe" | ||
], | ||
"requires_parent": true, | ||
"research_points": { | ||
"researchd:nether": 5 | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/generated/resources/data/researchd/researchd/research/stick.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:stick", | ||
"parents": [ | ||
"researchd:wood" | ||
], | ||
"requires_parent": false, | ||
"research_points": { | ||
"researchd:overworld": 5 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/generated/resources/data/researchd/researchd/research/stone.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:stone", | ||
"parents": [ | ||
"researchd:wooden_pickaxe" | ||
], | ||
"requires_parent": true, | ||
"research_points": { | ||
"researchd:end": 4, | ||
"researchd:overworld": 3 | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/generated/resources/data/researchd/researchd/research/wood.json
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:oak_log", | ||
"parents": [], | ||
"requires_parent": false, | ||
"research_points": { | ||
"researchd:overworld": 3 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/generated/resources/data/researchd/researchd/research/wooden_pickaxe.json
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "researchd:simple", | ||
"icon": "minecraft:wooden_pickaxe", | ||
"parents": [ | ||
"researchd:wood", | ||
"researchd:stick" | ||
], | ||
"requires_parent": true, | ||
"research_points": { | ||
"researchd:nether": 3, | ||
"researchd:overworld": 6 | ||
} | ||
} |
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
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/portingdeadmods/researchd/content/items/ResearchPackItem.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.portingdeadmods.researchd.content.items; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public class ResearchPackItem extends Item { | ||
public ResearchPackItem(Properties properties) { | ||
super(properties); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/com/portingdeadmods/researchd/registries/ResearchdDataComponents.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.portingdeadmods.researchd.registries; | ||
|
||
import com.portingdeadmods.researchd.Researchd; | ||
import com.portingdeadmods.researchd.api.research.ResearchPack; | ||
import net.minecraft.core.component.DataComponentType; | ||
import net.minecraft.core.registries.Registries; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public final class ResearchdDataComponents { | ||
public static final DeferredRegister.DataComponents COMPONENTS = DeferredRegister.createDataComponents(Registries.DATA_COMPONENT_TYPE, Researchd.MODID); | ||
|
||
// TODO: Sync component | ||
public static final Supplier<DataComponentType<ResearchPack>> RESEARCH_PACK = COMPONENTS.registerComponentType("research_pack", builder -> builder | ||
.persistent(ResearchPack.CODEC)); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/portingdeadmods/researchd/registries/ResearchdItems.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.portingdeadmods.researchd.registries; | ||
|
||
import com.portingdeadmods.researchd.Researchd; | ||
import com.portingdeadmods.researchd.content.items.ResearchPackItem; | ||
import com.portingdeadmods.researchd.impl.research.SimpleResearchPack; | ||
import net.minecraft.world.item.Item; | ||
import net.neoforged.neoforge.registries.DeferredItem; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
public final class ResearchdItems { | ||
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(Researchd.MODID); | ||
|
||
public static final DeferredItem<ResearchPackItem> RESEARCH_PACK = ITEMS.register("research_pack", | ||
() -> new ResearchPackItem(new Item.Properties().component(ResearchdDataComponents.RESEARCH_PACK, SimpleResearchPack.EMPTY))); | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/portingdeadmods/researchd/registries/ResearchdTab.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.portingdeadmods.researchd.registries; | ||
|
||
import com.portingdeadmods.researchd.Researchd; | ||
import com.portingdeadmods.researchd.ResearchdRegistries; | ||
import com.portingdeadmods.researchd.api.research.Research; | ||
import com.portingdeadmods.researchd.api.research.ResearchPack; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import java.util.Optional; | ||
import java.util.function.Supplier; | ||
import java.util.stream.Stream; | ||
|
||
public class ResearchdTab { | ||
public static final DeferredRegister<CreativeModeTab> TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Researchd.MODID); | ||
|
||
static { | ||
TABS.register("main", () -> CreativeModeTab.builder() | ||
.icon(Items.DIAMOND::getDefaultInstance) | ||
.title(Component.literal(Researchd.MODID)) | ||
.displayItems((params, output) -> { | ||
Optional<HolderLookup.RegistryLookup<ResearchPack>> lookup = params.holders().lookup(ResearchdRegistries.RESEARCH_PACK_KEY); | ||
if (lookup.isPresent()) { | ||
Stream<ResourceKey<ResearchPack>> resourceKeyStream = lookup.get().listElementIds(); | ||
resourceKeyStream.forEach(researchPack -> { | ||
addResearchPack(output, params.holders(), researchPack); | ||
}); | ||
} | ||
}) | ||
.build()); | ||
} | ||
|
||
@SuppressWarnings("OptionalIsPresent") | ||
private static void addResearchPack(CreativeModeTab.Output output, HolderLookup.Provider lookup, ResourceKey<ResearchPack> elem) { | ||
ItemStack stack = ResearchdItems.RESEARCH_PACK.toStack(); | ||
|
||
Optional<Holder.Reference<ResearchPack>> holder = lookup.holder(elem); | ||
if (holder.isPresent()) { | ||
stack.set(ResearchdDataComponents.RESEARCH_PACK.get(), holder.get().value()); | ||
} | ||
output.accept(stack); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/researchd/models/item/research_pack.json
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "researchd:item/research_pack_empty", | ||
"layer1": "researchd:item/research_pack_fluid" | ||
} | ||
} |
Binary file added
BIN
+200 Bytes
src/main/resources/assets/researchd/textures/item/research_pack_fluid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.