Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:44:53 +09:30
commit f1fbbe67bb
1722 changed files with 165268 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using Platform;
namespace Harmony.TEFeatureSignablePatches
{
[HarmonyPatch(typeof(TEFeatureSignable))]
[HarmonyPatch("InitBlockActivationCommands")]
public class InitBlockActivationCommandsPatch
{
public static void Postfix(TEFeatureSignable __instance, Action<BlockActivationCommand, TileEntityComposite.EBlockCommandOrder, TileEntityFeatureData> _addCallback)
{
_addCallback(new BlockActivationCommand("take", "hand", false), TileEntityComposite.EBlockCommandOrder.Normal, __instance.FeatureData);
}
}
[HarmonyPatch(typeof(TEFeatureSignable))]
[HarmonyPatch("UpdateBlockActivationCommands")]
public class UpdateBlockActivationCommandsPatch
{
public static void Postfix(TEFeatureSignable __instance, ref BlockActivationCommand _command, ReadOnlySpan<char> _commandName, WorldBase _world, Vector3i _blockPos, BlockValue _blockValue, EntityAlive _entityFocusing)
{
if (__instance.CommandIs(_commandName, "take"))
{
if (__instance.lockFeature != null && __instance.TryGetSelfOrFeature(out ITileEntityLootable storage))
{
_command.enabled = storage.IsEmpty() && __instance.lockFeature.IsOwner(PlatformManager.InternalLocalUserIdentifier);
}
}
}
}
[HarmonyPatch(typeof(TEFeatureSignable))]
[HarmonyPatch("OnBlockActivated")]
public class OnBlockActivatedPatch
{
public static void Postfix(TEFeatureSignable __instance, ReadOnlySpan<char> _commandName, WorldBase _world, Vector3i _blockPos, BlockValue _blockValue, EntityPlayerLocal _player)
{
if (__instance.CommandIs(_commandName, "take"))
{
RebirthUtilities.TakeItemWithTimer(_world, 0, _blockPos, _blockValue, _player, 2f, null, "", 1, false);
}
}
}
}