public static new MobHurtEvent getFrom(Events e) { var le = createHead(e, EventType.onMobHurt, typeof(MobHurtEvent)) as MobHurtEvent; if (le == null) { return(null); } IntPtr s = e.data; le.loadData(s); le.mdmtype = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 72)); le.mhealth = StrTool.itof(Marshal.ReadInt32(s, 80)); le.mdmcount = Marshal.ReadInt32(s, 84); return(le); }
public static new LevelExplodeEvent getFrom(Events e) { var le = createHead(e, EventType.onLevelExplode, typeof(LevelExplodeEvent)) as LevelExplodeEvent; if (le == null) { return(null); } IntPtr s = e.data; // 此处为转换过程 le.mentity = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0)); le.mblockname = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8)); le.mdimension = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16)); le.mposition = (Vec3)Marshal.PtrToStructure(s + 24, typeof(Vec3)); le.mentityid = Marshal.ReadInt32(s, 36); le.mdimensionid = Marshal.ReadInt32(s, 40); le.mexplodepower = StrTool.itof(Marshal.ReadInt32(s, 44)); le.mblockid = Marshal.ReadInt16(s, 48); return(le); }