generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
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.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
6 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/com/portingdeadmods/modjam/api/items/IFluidItem.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,7 @@ | ||
package com.portingdeadmods.modjam.api.items; | ||
|
||
/** | ||
* Implement this interface on your item to auto register the capability for it | ||
*/ | ||
public interface IFluidItem { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/portingdeadmods/modjam/api/items/IPowerItem.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,7 @@ | ||
package com.portingdeadmods.modjam.api.items; | ||
|
||
/** | ||
* Implement this interface on your item to auto register the capability for it | ||
*/ | ||
public interface IPowerItem { | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/portingdeadmods/modjam/capabilities/power/ItemPowerWrapper.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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/portingdeadmods/modjam/data/MJDataComponents.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,21 @@ | ||
package com.portingdeadmods.modjam.data; | ||
|
||
import com.portingdeadmods.modjam.ModJam; | ||
import com.portingdeadmods.modjam.data.components.ComponentPowerStorage; | ||
import net.minecraft.core.component.DataComponentType; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import java.util.function.Supplier; | ||
import java.util.function.UnaryOperator; | ||
|
||
public final class MJDataComponents { | ||
public static final DeferredRegister.DataComponents DATA_COMPONENT_TYPES = DeferredRegister.createDataComponents(ModJam.MODID); | ||
|
||
public static final Supplier<DataComponentType<ComponentPowerStorage>> POWER = registerDataComponentType("power", | ||
() -> builder -> builder.persistent(ComponentPowerStorage.CODEC).networkSynchronized(ComponentPowerStorage.STREAM_CODEC)); | ||
|
||
public static <T> Supplier<DataComponentType<T>> registerDataComponentType( | ||
String name, Supplier<UnaryOperator<DataComponentType.Builder<T>>> builderOperator) { | ||
return DATA_COMPONENT_TYPES.register(name, () -> builderOperator.get().apply(DataComponentType.builder()).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