generated from neoforged/MDK
-
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.
Made it where swords set item on fire
- Loading branch information
1 parent
723eff6
commit 2fb9c6a
Showing
10 changed files
with
101 additions
and
67 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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/io/github/realyusufismail/tutorialmod/items/ModSwordItem.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 io.github.realyusufismail.tutorialmod.items; | ||
|
||
import net.minecraft.world.item.SwordItem; | ||
import net.minecraft.world.item.Tier; | ||
|
||
public class ModSwordItem extends SwordItem { | ||
public ModSwordItem(Tier pTier, Properties pProperties) { | ||
super(pTier, pProperties); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/io/github/realyusufismail/tutorialmod/util/TutorialModUtils.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,24 @@ | ||
package io.github.realyusufismail.tutorialmod.util; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class TutorialModUtils { | ||
private TutorialModUtils() { | ||
throw new IllegalStateException("Utility class"); | ||
} | ||
|
||
private static final int TICKS_PER_SECOND = 20; | ||
private static final int TICKS_PER_MINUTE = TICKS_PER_SECOND * 60; | ||
|
||
public static int getTimeInTicks(int time, @NotNull TimeUnit unit) { | ||
return switch (unit) { | ||
case MINUTES -> time * TICKS_PER_MINUTE; | ||
case SECONDS -> time * TICKS_PER_SECOND; | ||
}; | ||
} | ||
|
||
public enum TimeUnit { | ||
MINUTES, | ||
SECONDS | ||
} | ||
} |