-
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
1 parent
aec349d
commit cd07f5c
Showing
5 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/main/java/pers/cierra_runis/survired/mixin/ExampleMixin.java
This file was deleted.
Oops, something went wrong.
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
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/pers/cierra_runis/survired/common/SurviRedRegister.kt
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,5 @@ | ||
package pers.cierra_runis.survired.common | ||
|
||
interface SurviRedRegister { | ||
fun register() | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/pers/cierra_runis/survired/features/dye/SurviRedDye.kt
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 pers.cierra_runis.survired.features.dye | ||
|
||
import net.fabricmc.fabric.api.event.player.UseBlockCallback | ||
import net.minecraft.block.entity.ShulkerBoxBlockEntity | ||
import net.minecraft.item.DyeItem | ||
import net.minecraft.util.ActionResult | ||
import org.slf4j.LoggerFactory | ||
import pers.cierra_runis.survired.common.SurviRedRegister | ||
|
||
object SurviRedDye : SurviRedRegister { | ||
private val logger = LoggerFactory.getLogger(this.javaClass) | ||
|
||
override fun register() { | ||
UseBlockCallback.EVENT.register(UseBlockCallback { playerEntity, world, hand, blockHitResult -> | ||
if (!playerEntity.isSneaking) return@UseBlockCallback ActionResult.PASS | ||
if (playerEntity.inventory.mainHandStack.item !is DyeItem) return@UseBlockCallback ActionResult.PASS | ||
val block = world.getBlockEntity(blockHitResult.blockPos) | ||
if (block !is ShulkerBoxBlockEntity) return@UseBlockCallback ActionResult.PASS | ||
|
||
logger.info(block.toString()) | ||
|
||
return@UseBlockCallback ActionResult.SUCCESS | ||
}) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
{ | ||
"required": true, | ||
"package": "pers.cierra_runis.survired.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
"ExampleMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
"required": true, | ||
"package": "pers.cierra_runis.survired.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |