generated from SmushyTaco/Example-Mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add shift to pickup & log chest content
fix crash with dimension
- Loading branch information
Showing
8 changed files
with
161 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package net.usbwire.usbplus.features | ||
|
||
import gg.essential.universal.wrappers.message.* | ||
import gg.essential.universal.wrappers.UPlayer | ||
import gg.essential.universal.UChat | ||
import net.minecraft.entity.Entity | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.entity.decoration.ArmorStandEntity | ||
import net.minecraft.entity.passive.VillagerEntity | ||
import net.usbwire.usbplus.USBPlus | ||
import net.usbwire.usbplus.config.Config | ||
import net.usbwire.usbplus.util.Util | ||
|
||
/** | ||
* Pickup Filter toggle when sneaking like RLCraft | ||
*/ | ||
object Pickup { | ||
var ticksSneaking = 0 | ||
var isSneaking = false; | ||
fun onWorldTick() { | ||
val player = USBPlus.mc.player; | ||
if (player == null || !Config.pickupEnabled) return | ||
if (player.isSpectator || player.isCreative) return | ||
if (player.isSneaking) { | ||
ticksSneaking++ | ||
if (isSneaking == false && ticksSneaking > Config.pickupDelay) { | ||
UChat.say("/pu") | ||
isSneaking = true | ||
} | ||
} else if (isSneaking == true) { | ||
if (ticksSneaking > Config.pickupDelay) { | ||
UChat.say("/pu") | ||
} | ||
isSneaking = false | ||
ticksSneaking = 0 | ||
} | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/kotlin/net/usbwire/usbplus/util/chat/Clipboard.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,23 @@ | ||
package net.usbwire.usbplus.util.chat | ||
|
||
import gg.essential.universal.wrappers.message.* | ||
import kotlinx.serialization.Serializable | ||
import net.minecraft.text.* | ||
import net.usbwire.usbplus.USBPlus | ||
import net.usbwire.usbplus.util.Util | ||
|
||
object ChatUtil { | ||
fun clipboardBuilder( | ||
name: String, | ||
clipboard: String, | ||
message: UMessage = UMessage() | ||
): UMessage { | ||
// copy | ||
val copyCompoment = UTextComponent("${name}") | ||
copyCompoment.clickAction = ClickEvent.Action.COPY_TO_CLIPBOARD | ||
copyCompoment.clickValue = clipboard | ||
message.addTextComponent(copyCompoment) | ||
|
||
return message | ||
} | ||
} |