Помогите Кто может починить плагин Instant Smelt с Umod

PashaCherniy

3 Фев 2022
201
9
16
Всем привет. Помогите адаптировать плагин с юмода. Там полетели хуки
Сам плагин тут:
https://umod.org/plugins/instant-smelt
Ошибка:
Failed to call hook 'OnDispenserGather' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.OnGather (BasePlayer player, Item item, System.Boolean bonus, System.Boolean pickup) [0x0002b] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.InstantSmelt.OnDispenserGather (ResourceDispenser dispenser, BasePlayer player, Item item) [0x00000] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001c6] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0
 
Failed to call hook 'cmdToggleChat' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.cmdToggleChat (BasePlayer player) [0x00021] in <28c0d4aeeb8444adb5072a6fc967342d>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0028b] in <28c0d4aeeb8444adb5072a6fc967342d>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0
 
Failed to call hook 'cmdToggleChat' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.cmdToggleChat (BasePlayer player) [0x00021] in <28c0d4aeeb8444adb5072a6fc967342d>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0028b] in <28c0d4aeeb8444adb5072a6fc967342d>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0
Команду я не трогал, так что тут безсилен
 
Всем привет. Помогите адаптировать плагин с юмода. Там полетели хуки
Сам плагин тут:
https://umod.org/plugins/instant-smelt
Ошибка:
Failed to call hook 'OnDispenserGather' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.OnGather (BasePlayer player, Item item, System.Boolean bonus, System.Boolean pickup) [0x0002b] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.InstantSmelt.OnDispenserGather (ResourceDispenser dispenser, BasePlayer player, Item item) [0x00000] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001c6] in <d420ea42000c47ea9af63d97b8e73586>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0
1698648665563.png

У меня все работает. Удали старый конфиг и попробуй загрузи плагин.
 

Вложения

  • InstantSmelt.cs
    6.8 KB · Просмотры: 15
1698648665563.png

У меня все работает. Удали старый конфиг и попробуй загрузи плагин.
Failed to call hook 'cmdToggleChat' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.cmdToggleChat (BasePlayer player) [0x00021] in <0dff102e0ad143d6a70be9a407a1000b>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0028b] in <0dff102e0ad143d6a70be9a407a1000b>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0

Странно я удалил все файлы с этим плагином и все равно ошибка((((
 
скинь свой плагин
Failed to call hook 'cmdToggleChat' on plugin 'InstantSmelt v2.0.5' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.InstantSmelt.cmdToggleChat (BasePlayer player) [0x00021] in <0dff102e0ad143d6a70be9a407a1000b>:0
at Oxide.Plugins.InstantSmelt.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0028b] in <0dff102e0ad143d6a70be9a407a1000b>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <cd9a02fd331347bd82d550bb1a9c8e9f>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b76ec77c47d1449e92b2baab8603843d>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <b76ec77c47d1449e92b2baab8603843d>:0

Странно я удалил все файлы с этим плагином и все равно ошибка((((
 
скинь свой плагин
Я и твой ставил, с полным удалением плагина и всех файлов от него. И Drop Dead то что скидывал так же пробовал, не работает одна и таже ошибка)
 
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;

namespace Oxide.Plugins
{
[Info("Instant Smelt", "Orange", "2.0.5")]
[Description("Smelt resources as soon as they are mined")]
public class InstantSmelt : RustPlugin
{
#region Vars

private const string permUse = "instantsmelt.use";
private const string charcoalItemName = "charcoal";
private const string woodItemName = "wood";

#endregion

#region Oxide Hooks

private void Init()
{
permission.RegisterPermission(permUse, this);
cmd.AddChatCommand(config.command, this, nameof(cmdToggleChat));
LoadData();
}

private void Unload()
{
SaveData();
}

private object OnCollectiblePickup(Item item, BasePlayer player)
{
return OnGather(player, item, false, true);
}

private object OnDispenserGather(ResourceDispenser dispenser, BasePlayer player, Item item)
{
return OnGather(player, item);
}

private object OnDispenserBonus(ResourceDispenser dispenser, BasePlayer player, Item item)
{
return OnGather(player, item, true);
}

#endregion

#region Commands

private void cmdToggleChat(BasePlayer player)
{
if (HasPermission(player) == false)
{
Message(player, "Permission");
return;
}

var key = string.Empty;

if (data.Contains(player.userID))
{
key = "Enabled";
data.Remove(player.userID);
}
else
{
key = "Disabled";
data.Add(player.userID);
}

Message(player, key);
}

#endregion

#region Core

private object OnGather(BasePlayer player, Item item, bool bonus = false, bool pickup = false)
{
var perm = HasPermission(player);
if (perm == false)
{
return null;
}

if (data.Contains(player.userID))
{
return null;
}

var shortname = item.info.shortname;
if (config.blackList.Contains(shortname))
{
return null;
}

var newItem = (Item) null;

if (shortname == woodItemName)
{
newItem = ItemManager.CreateByName(charcoalItemName, item.amount);
}
else
{
var cookable = item.info.GetComponent<ItemModCookable>();
if (cookable == null) {return null;}
newItem = ItemManager.Create(cookable.becomeOnCooked, item.amount);
}

NextTick(() =>
{
newItem.amount = item.amount;
item.GetHeldEntity()?.Kill();
item.DoRemove();

if (bonus == false)
{
player.GiveItem(newItem, BaseEntity.GiveItemReason.ResourceHarvested);
}
});

return pickup ? null : newItem;
}

private bool HasPermission(BasePlayer player)
{
return permission.UserHasPermission(player.UserIDString, permUse);
}

#endregion

#region Configuration 1.1.0

private static ConfigData config;

private class ConfigData
{
[JsonProperty(PropertyName = "Command")]
public string command;

[JsonProperty(PropertyName = "A. Blacklist")]
public List<string> blackList;
}

private ConfigData GetDefaultConfig()
{
return new ConfigData
{
command = "ismelt",
blackList = new List<string>
{
"shortname here",
"another shortname"
}
};
}

protected override void LoadConfig()
{
base.LoadConfig();

try
{
config = Config.ReadObject<ConfigData>();

if (config == null)
{
LoadDefaultConfig();
}
}
catch
{
PrintError("Configuration file is corrupt! Unloading plugin...");
Interface.Oxide.RootPluginManager.RemovePlugin(this);
return;
}

SaveConfig();
}

protected override void LoadDefaultConfig()
{
config = GetDefaultConfig();
}

protected override void SaveConfig()
{
Config.WriteObject(config);
}

#endregion

#region Data 1.0.0

private const string filename = "Temp/InstantSmelt/Playes";
private List<ulong> data = new List<ulong>();

private void LoadData()
{
try
{
data = Interface.Oxide.DataFileSystem.ReadObject<List<ulong>>(filename);
}
catch (Exception e)
{
PrintWarning(e.Message);
}

SaveData();
timer.Every(Core.Random.Range(500, 700f), SaveData);
}

private void SaveData()
{
Interface.Oxide.DataFileSystem.WriteObject(filename, data);
}

#endregion

#region Localization 1.1.1

protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
{"Permission", "You don't have permission to use that!"},
{"Enabled", "You enabled instant smelt!"},
{"Disabled", "You disabled instant smelt!"},
}, this);
}

private void Message(BasePlayer player, string messageKey, params object[] args)
{
if (player == null)
{
return;
}

var message = GetMessage(messageKey, player.UserIDString, args);
player.ChatMessage(message);
}

private string GetMessage(string messageKey, string playerID, params object[] args)
{
return string.Format(lang.GetMessage(messageKey, this, playerID), args);
}

#endregion
}
}
 
Я ещё заметил что теперь при загрузки плагина с Umod точно такая же ошибка вылетает. Возможно нужно полностью выключить сервер и загрузить плагин заново... буду пробовать...
 
Я ещё заметил что теперь при загрузки плагина с Umod точно такая же ошибка вылетает. Возможно нужно полностью выключить сервер и загрузить плагин заново... буду пробовать...
других плагинов с такой же командой нет? это очень странно. А что за хост?
 
Активность
Пока никто не печатает сообщение