Upload from upload_mods.ps1
This commit is contained in:
49
Harmony/Harmony_EntityFactory.cs
Normal file
49
Harmony/Harmony_EntityFactory.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
namespace Harmony.EntityFactoryPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(EntityFactory))]
|
||||
[HarmonyPatch("GetEntityType")]
|
||||
public class GetEntityTypePatch
|
||||
{
|
||||
public static bool Prefix(EntityFactory __instance, ref System.Type __result, string _className)
|
||||
{
|
||||
switch (_className)
|
||||
{
|
||||
case "EntityAnimal":
|
||||
__result = typeof(EntityAnimal);
|
||||
return false;
|
||||
case "EntityAnimalRabbit":
|
||||
__result = typeof(EntityAnimalRabbit);
|
||||
return false;
|
||||
case "EntityAnimalStag":
|
||||
__result = typeof(EntityAnimalStag);
|
||||
return false;
|
||||
case "EntityBandit":
|
||||
__result = typeof(EntityBandit);
|
||||
return false;
|
||||
case "EntityEnemyAnimal":
|
||||
__result = typeof(EntityEnemyAnimal);
|
||||
return false;
|
||||
case "EntityHuman":
|
||||
__result = typeof(EntityHuman);
|
||||
return false;
|
||||
case "EntityNPC":
|
||||
__result = typeof(EntityNPC);
|
||||
return false;
|
||||
case "EntityPlayer":
|
||||
__result = typeof(EntityPlayer);
|
||||
return false;
|
||||
case "EntityZombie":
|
||||
__result = typeof(EntityZombie);
|
||||
return false;
|
||||
case "EntityAlive":
|
||||
__result = typeof(EntityAlive);
|
||||
return false;
|
||||
default:
|
||||
Log.Warning("GetEntityType slow lookup for {0}", (object)_className);
|
||||
__result = System.Type.GetType(_className);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user