generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
634b096
commit 8384821
Showing
5 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
7 changes: 6 additions & 1 deletion
7
src/main/java/com/leclowndu93150/flightutils/FlightUtilsMain.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
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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/leclowndu93150/flightutils/common/AngelRingModules.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,25 @@ | ||
package com.leclowndu93150.flightutils.common; | ||
|
||
import com.leclowndu93150.flightutils.registry.DataComponentRegistry; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
|
||
public class AngelRingModules { | ||
|
||
public static void setMiningSpeedModifier(ItemStack stack) { | ||
stack.set(DataComponentRegistry.MINING_MODIFIER, true); | ||
} | ||
|
||
public static Boolean getMiningSpeedModifier(ItemStack stack) { | ||
return stack.getOrDefault(DataComponentRegistry.MINING_MODIFIER, false); | ||
} | ||
|
||
public static void setInertiaModifier(ItemStack stack) { | ||
stack.set(DataComponentRegistry.INERTIA_MODIFIER, true); | ||
} | ||
|
||
public static Boolean getInertiaModifier(ItemStack stack) { | ||
return stack.getOrDefault(DataComponentRegistry.INERTIA_MODIFIER, false); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/leclowndu93150/flightutils/registry/DataComponentRegistry.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.leclowndu93150.flightutils.registry; | ||
|
||
import com.mojang.serialization.Codec; | ||
import net.minecraft.core.component.DataComponentType; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import static com.leclowndu93150.flightutils.FlightUtilsMain.MODID; | ||
|
||
public class DataComponentRegistry { | ||
|
||
public static final DeferredRegister.DataComponents COMPONENTS = DeferredRegister.createDataComponents(MODID); | ||
|
||
public static final Supplier<DataComponentType<Boolean>> INERTIA_MODIFIER = COMPONENTS.registerComponentType("inertia_modifier", | ||
builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)); | ||
|
||
public static final Supplier<DataComponentType<Boolean>> MINING_MODIFIER = COMPONENTS.registerComponentType("mining_modifier", | ||
builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)); | ||
} |
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