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.
- Loading branch information
Showing
5 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/main/java/com/portingdeadmods/modjam/content/augments/Augment.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,12 @@ | ||
package com.portingdeadmods.modjam.content.augments; | ||
|
||
import net.minecraft.world.entity.player.Player; | ||
import net.neoforged.neoforge.event.level.BlockEvent; | ||
|
||
@SuppressWarnings("unused") | ||
public class Augment { | ||
public static void onBreak(BlockEvent.BreakEvent event){ | ||
Player player = event.getPlayer(); | ||
event.setCanceled(true); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/portingdeadmods/modjam/content/augments/Augments.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,10 @@ | ||
package com.portingdeadmods.modjam.content.augments; | ||
|
||
public enum Augments { | ||
TEST_AUGMENT(69); | ||
|
||
public final int id; | ||
Augments(int id){ | ||
this.id = id; | ||
} | ||
} |
26 changes: 19 additions & 7 deletions
26
src/main/java/com/portingdeadmods/modjam/content/items/AugmentDebugItem.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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/portingdeadmods/modjam/events/AugmentEvents.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,23 @@ | ||
package com.portingdeadmods.modjam.events; | ||
|
||
import com.portingdeadmods.modjam.ModJam; | ||
import com.portingdeadmods.modjam.capabilities.augmentation.Slot; | ||
import com.portingdeadmods.modjam.content.augments.Augment; | ||
import com.portingdeadmods.modjam.content.augments.AugmentHelper; | ||
import com.portingdeadmods.modjam.content.augments.Augments; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.EventBusSubscriber; | ||
import net.neoforged.neoforge.event.level.BlockEvent; | ||
|
||
@SuppressWarnings("unused") | ||
@EventBusSubscriber(modid = ModJam.MODID) | ||
public class AugmentEvents { | ||
@SubscribeEvent | ||
public static void breakEvent(BlockEvent.BreakEvent event){ | ||
Player player = event.getPlayer(); | ||
if(AugmentHelper.playerHasAugment(player, Slot.HEAD, Augments.TEST_AUGMENT)){ | ||
Augment.onBreak(event); | ||
} | ||
} | ||
} |