fix: fix the null pointer
This commit is contained in:
Vendored
+156
-156
@@ -330,7 +330,10 @@ export class Minecraft {
|
|||||||
/** 移除所有虚假列表玩家 */
|
/** 移除所有虚假列表玩家 */
|
||||||
static removeAllFakeLists(): boolean;
|
static removeAllFakeLists(): boolean;
|
||||||
|
|
||||||
/** 启用I18n修复 */
|
/**
|
||||||
|
* @deprecated 已删
|
||||||
|
* 启用I18n修复
|
||||||
|
*/
|
||||||
static setFixI18nEnabled(): void;
|
static setFixI18nEnabled(): void;
|
||||||
|
|
||||||
/** 保存NBT至文件 */
|
/** 保存NBT至文件 */
|
||||||
@@ -1378,161 +1381,158 @@ export class GMLIB_BinaryStream {
|
|||||||
|
|
||||||
export enum ActorType {
|
export enum ActorType {
|
||||||
Undefined = 1,
|
Undefined = 1,
|
||||||
TypeMask = 0b11111111,
|
TypeMask = 255,
|
||||||
None = 0,
|
Mob = 256,
|
||||||
Mob = 1 << 8,
|
PathfinderMob = 768,
|
||||||
PathfinderMob = 1 << 9 | Mob,
|
Monster = 2816,
|
||||||
UnknownType = 1 << 10,
|
Animal = 4864,
|
||||||
Monster = 1 << 11 | PathfinderMob,
|
TamableAnimal = 21248,
|
||||||
Animal = 1 << 12 | PathfinderMob,
|
Ambient = 33024,
|
||||||
WaterAnimal = 1 << 13 | PathfinderMob,
|
UndeadMob = 68352,
|
||||||
TamableAnimal = 1 << 14 | Animal,
|
ZombieMonster = 199424,
|
||||||
Ambient = 1 << 15 | Mob,
|
Arthropod = 264960,
|
||||||
UndeadMob = 1 << 16 | Monster,
|
Minecart = 524288,
|
||||||
ZombieMonster = 1 << 17 | UndeadMob,
|
SkeletonMonster = 1116928,
|
||||||
Arthropod = 1 << 18 | Monster,
|
EquineAnimal = 2118400,
|
||||||
Minecart = 1 << 19,
|
Projectile = 4194304,
|
||||||
SkeletonMonster = 1 << 20 | UndeadMob,
|
AbstractArrow = 8388608,
|
||||||
EquineAnimal = 1 << 21 | TamableAnimal,
|
WaterAnimal = 8960,
|
||||||
Projectile = 1 << 22,
|
VillagerBase = 16777984,
|
||||||
AbstractArrow = 1 << 23,
|
Chicken = 4874,
|
||||||
VillagerBase = 1 << 24 | PathfinderMob,
|
Cow = 4875,
|
||||||
|
Pig = 4876,
|
||||||
Chicken = 10 | Animal,
|
Sheep = 4877,
|
||||||
Cow = 11 | Animal,
|
Wolf = 21262,
|
||||||
Pig = 12 | Animal,
|
Villager = 16777999,
|
||||||
Sheep = 13 | Animal,
|
MushroomCow = 4880,
|
||||||
Wolf = 14 | TamableAnimal,
|
Squid = 8977,
|
||||||
Villager = 15 | VillagerBase,
|
Rabbit = 4882,
|
||||||
MushroomCow = 16 | Animal,
|
Bat = 33043,
|
||||||
Squid = 17 | WaterAnimal,
|
IronGolem = 788,
|
||||||
Rabbit = 18 | Animal,
|
SnowGolem = 789,
|
||||||
Bat = 19 | Ambient,
|
Ocelot = 21270,
|
||||||
IronGolem = 20 | PathfinderMob,
|
Horse = 2118423,
|
||||||
SnowGolem = 21 | PathfinderMob,
|
PolarBear = 4892,
|
||||||
Ocelot = 22 | TamableAnimal,
|
Llama = 4893,
|
||||||
Horse = 23 | EquineAnimal,
|
Parrot = 21278,
|
||||||
Donkey = 24 | EquineAnimal,
|
Dolphin = 8991,
|
||||||
Mule = 25 | EquineAnimal,
|
Donkey = 2118424,
|
||||||
SkeletonHorse = 26 | EquineAnimal | UndeadMob,
|
Mule = 2118425,
|
||||||
ZombieHorse = 27 | EquineAnimal | UndeadMob,
|
SkeletonHorse = 2186010,
|
||||||
PolarBear = 28 | Animal,
|
ZombieHorse = 2186011,
|
||||||
Llama = 29 | Animal,
|
Zombie = 199456,
|
||||||
Parrot = 30 | TamableAnimal,
|
Creeper = 2849,
|
||||||
Dolphin = 31 | WaterAnimal,
|
Skeleton = 1116962,
|
||||||
Zombie = 32 | ZombieMonster,
|
Spider = 264995,
|
||||||
Creeper = 33 | Monster,
|
PigZombie = 68388,
|
||||||
Skeleton = 34 | SkeletonMonster,
|
Slime = 2853,
|
||||||
Spider = 35 | Arthropod,
|
EnderMan = 2854,
|
||||||
PigZombie = 36 | UndeadMob,
|
Silverfish = 264999,
|
||||||
Slime = 37 | Monster,
|
CaveSpider = 265000,
|
||||||
EnderMan = 38 | Monster,
|
Ghast = 2857,
|
||||||
Silverfish = 39 | Arthropod,
|
LavaSlime = 2858,
|
||||||
CaveSpider = 40 | Arthropod,
|
Blaze = 2859,
|
||||||
Ghast = 41 | Monster,
|
ZombieVillager = 199468,
|
||||||
LavaSlime = 42 | Monster,
|
Witch = 2861,
|
||||||
Blaze = 43 | Monster,
|
Stray = 1116974,
|
||||||
ZombieVillager = 44 | ZombieMonster,
|
Husk = 199471,
|
||||||
Witch = 45 | Monster,
|
WitherSkeleton = 1116976,
|
||||||
Stray = 46 | SkeletonMonster,
|
Guardian = 2865,
|
||||||
Husk = 47 | ZombieMonster,
|
ElderGuardian = 2866,
|
||||||
WitherSkeleton = 48 | SkeletonMonster,
|
Npc = 307,
|
||||||
Guardian = 49 | Monster,
|
WitherBoss = 68404,
|
||||||
ElderGuardian = 50 | Monster,
|
Dragon = 2869,
|
||||||
Npc = 51 | Mob,
|
Shulker = 2870,
|
||||||
WitherBoss = 52 | UndeadMob,
|
Endermite = 265015,
|
||||||
Dragon = 53 | Monster,
|
Agent = 312,
|
||||||
Shulker = 54 | Monster,
|
Vindicator = 2873,
|
||||||
Endermite = 55 | Arthropod,
|
Phantom = 68410,
|
||||||
Agent = 56 | Mob,
|
IllagerBeast = 2875,
|
||||||
Vindicator = 57 | Monster,
|
ArmorStand = 317,
|
||||||
Phantom = 58 | UndeadMob,
|
TripodCamera = 318,
|
||||||
IllagerBeast = 59 | Monster,
|
Player = 319,
|
||||||
UNUSED60 = 60,
|
ItemEntity = 64,
|
||||||
ArmorStand = 61 | Mob,
|
PrimedTnt = 65,
|
||||||
TripodCamera = 62 | Mob,
|
FallingBlock = 66,
|
||||||
Player = 63 | Mob,
|
MovingBlock = 67,
|
||||||
ItemEntity = 64 | None,
|
ExperiencePotion = 4194372,
|
||||||
PrimedTnt = 65 | None,
|
Experience = 69,
|
||||||
FallingBlock = 66 | None,
|
EyeOfEnder = 70,
|
||||||
MovingBlock = 67 | None,
|
EnderCrystal = 71,
|
||||||
ExperiencePotion = 68 | Projectile,
|
FireworksRocket = 72,
|
||||||
Experience = 69 | None,
|
Trident = 12582985,
|
||||||
EyeOfEnder = 70 | None,
|
Turtle = 4938,
|
||||||
EnderCrystal = 71 | None,
|
Cat = 21323,
|
||||||
FireworksRocket = 72 | None,
|
ShulkerBullet = 4194380,
|
||||||
Trident = 73 | Projectile | AbstractArrow,
|
FishingHook = 77,
|
||||||
Turtle = 74 | Animal,
|
Chalkboard = 78,
|
||||||
Cat = 75 | TamableAnimal,
|
DragonFireball = 4194383,
|
||||||
ShulkerBullet = 76 | Projectile,
|
Arrow = 12582992,
|
||||||
FishingHook = 77 | None,
|
Snowball = 4194385,
|
||||||
Chalkboard = 78 | None,
|
ThrownEgg = 4194386,
|
||||||
DragonFireball = 79 | Projectile,
|
Painting = 83,
|
||||||
Arrow = 80 | Projectile | AbstractArrow,
|
LargeFireball = 4194389,
|
||||||
Snowball = 81 | Projectile,
|
ThrownPotion = 4194390,
|
||||||
ThrownEgg = 82 | Projectile,
|
Enderpearl = 4194391,
|
||||||
Painting = 83 | None,
|
LeashKnot = 88,
|
||||||
MinecartRideable = 84 | Minecart,
|
WitherSkull = 4194393,
|
||||||
LargeFireball = 85 | Projectile,
|
BoatRideable = 90,
|
||||||
ThrownPotion = 86 | Projectile,
|
WitherSkullDangerous = 4194395,
|
||||||
Enderpearl = 87 | Projectile,
|
LightningBolt = 93,
|
||||||
LeashKnot = 88 | None,
|
SmallFireball = 4194398,
|
||||||
WitherSkull = 89 | Projectile,
|
AreaEffectCloud = 95,
|
||||||
BoatRideable = 90 | None,
|
LingeringPotion = 4194405,
|
||||||
WitherSkullDangerous = 91 | Projectile,
|
LlamaSpit = 4194406,
|
||||||
UNUSED92 = 92,
|
EvocationFang = 4194407,
|
||||||
LightningBolt = 93 | None,
|
EvocationIllager = 2920,
|
||||||
SmallFireball = 94 | Projectile,
|
Vex = 2921,
|
||||||
AreaEffectCloud = 95 | None,
|
MinecartRideable = 524372,
|
||||||
MinecartHopper = 96 | Minecart,
|
MinecartHopper = 524384,
|
||||||
MinecartTNT = 97 | Minecart,
|
MinecartTNT = 524385,
|
||||||
MinecartChest = 98 | Minecart,
|
MinecartChest = 524386,
|
||||||
MinecartFurnace = 99 | Minecart,
|
MinecartFurnace = 524387,
|
||||||
MinecartCommandBlock = 100 | Minecart,
|
MinecartCommandBlock = 524388,
|
||||||
LingeringPotion = 101 | Projectile,
|
IceBomb = 4194410,
|
||||||
LlamaSpit = 102 | Projectile,
|
Balloon = 107,
|
||||||
EvocationFang = 103 | Projectile,
|
Pufferfish = 9068,
|
||||||
EvocationIllager = 104 | Monster,
|
Salmon = 9069,
|
||||||
Vex = 105 | Monster,
|
Drowned = 199534,
|
||||||
IceBomb = 106 | Projectile,
|
Tropicalfish = 9071,
|
||||||
Balloon = 107 | None,
|
Fish = 9072,
|
||||||
Pufferfish = 108 | WaterAnimal,
|
Panda = 4977,
|
||||||
Salmon = 109 | WaterAnimal,
|
Pillager = 2930,
|
||||||
Drowned = 110 | ZombieMonster,
|
VillagerV2 = 16778099,
|
||||||
Tropicalfish = 111 | WaterAnimal,
|
ZombieVillagerV2 = 199540,
|
||||||
Fish = 112 | WaterAnimal,
|
Shield = 117,
|
||||||
Panda = 113 | Animal,
|
WanderingTrader = 886,
|
||||||
Pillager = 114 | Monster,
|
Lectern = 119,
|
||||||
VillagerV2 = 115 | VillagerBase,
|
ElderGuardianGhost = 2936,
|
||||||
ZombieVillagerV2 = 116 | ZombieMonster,
|
Fox = 4985,
|
||||||
Shield = 117 | None,
|
Bee = 378,
|
||||||
WanderingTrader = 118 | PathfinderMob,
|
Piglin = 379,
|
||||||
Lectern = 119 | None,
|
Hoglin = 4988,
|
||||||
ElderGuardianGhost = 120 | Monster,
|
Strider = 4989,
|
||||||
Fox = 121 | Animal,
|
Zoglin = 68478,
|
||||||
Bee = 122 | Mob,
|
PiglinBrute = 383,
|
||||||
Piglin = 123 | Mob,
|
Goat = 4992,
|
||||||
Hoglin = 124 | Animal,
|
GlowSquid = 9089,
|
||||||
Strider = 125 | Animal,
|
Axolotl = 4994,
|
||||||
Zoglin = 126 | UndeadMob,
|
Warden = 2947,
|
||||||
PiglinBrute = 127 | Mob,
|
Frog = 4996,
|
||||||
Goat = 128 | Animal,
|
Tadpole = 9093,
|
||||||
GlowSquid = 129 | WaterAnimal,
|
Allay = 390,
|
||||||
Axolotl = 130 | Animal,
|
ChestBoatRideable = 218,
|
||||||
Warden = 131 | Monster,
|
TraderLlama = 5021,
|
||||||
Frog = 132 | Animal,
|
Camel = 5002,
|
||||||
Tadpole = 133 | WaterAnimal,
|
Sniffer = 5003,
|
||||||
Allay = 134 | Mob,
|
Breeze = 2956,
|
||||||
ChestBoatRideable = 136 | BoatRideable,
|
BreezeWindChargeProjectile = 4194445,
|
||||||
TraderLlama = 137 | Llama,
|
Armadillo = 5006,
|
||||||
Camel = 138 | Animal,
|
WindChargeProjectile = 4194447,
|
||||||
Sniffer = 139 | Animal,
|
Bogged = 1117072,
|
||||||
Breeze = 140 | Monster,
|
OminousItemSpawner = 145,
|
||||||
BreezeWindChargeProjectile = 141 | Projectile,
|
Creaking = 2962,
|
||||||
Armadillo = 142 | Animal,
|
HappyGhast = 5011,
|
||||||
WindChargeProjectile = 143 | Projectile,
|
|
||||||
Bogged = 144 | SkeletonMonster,
|
|
||||||
OminousItemSpawner = 145
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Player {
|
interface Player {
|
||||||
|
|||||||
+152
-155
@@ -3130,7 +3130,7 @@ LLSE_Entity.prototype.getAllEffectsInfo =
|
|||||||
* @returns {{Id: number, Amplifier: number, Duration: number, DurationEasy: number, DurationNormal: number, DurationHard: number, Ambient: boolean, ShowParticles: boolean}[]}
|
* @returns {{Id: number, Amplifier: number, Duration: number, DurationEasy: number, DurationNormal: number, DurationHard: number, Ambient: boolean, ShowParticles: boolean}[]}
|
||||||
*/
|
*/
|
||||||
function () {
|
function () {
|
||||||
return this.getAllEffects().map(effectId => this.getEffectInfo(effectId));
|
return this.getAllEffects().map(effectId => this.getEffectInfo(effectId)).filter(effectId => effectId);
|
||||||
};
|
};
|
||||||
|
|
||||||
LLSE_Entity.prototype.isType =
|
LLSE_Entity.prototype.isType =
|
||||||
@@ -3164,161 +3164,158 @@ LLSE_Entity.prototype.getEntityTypeId =
|
|||||||
|
|
||||||
const ActorType = Object.freeze({
|
const ActorType = Object.freeze({
|
||||||
Undefined: 1,
|
Undefined: 1,
|
||||||
TypeMask: 0b11111111,
|
TypeMask: 255,
|
||||||
None: 0,
|
Mob: 256,
|
||||||
Mob: 1 << 8,
|
PathfinderMob: 768,
|
||||||
PathfinderMob: 1 << 9 | this.Mob,
|
Monster: 2816,
|
||||||
UnknownType: 1 << 10,
|
Animal: 4864,
|
||||||
Monster: 1 << 11 | this.PathfinderMob,
|
TamableAnimal: 21248,
|
||||||
Animal: 1 << 12 | this.PathfinderMob,
|
Ambient: 33024,
|
||||||
WaterAnimal: 1 << 13 | this.PathfinderMob,
|
UndeadMob: 68352,
|
||||||
TamableAnimal: 1 << 14 | this.Animal,
|
ZombieMonster: 199424,
|
||||||
Ambient: 1 << 15 | this.Mob,
|
Arthropod: 264960,
|
||||||
UndeadMob: 1 << 16 | this.Monster,
|
Minecart: 524288,
|
||||||
ZombieMonster: 1 << 17 | this.UndeadMob,
|
SkeletonMonster: 1116928,
|
||||||
Arthropod: 1 << 18 | this.Monster,
|
EquineAnimal: 2118400,
|
||||||
Minecart: 1 << 19,
|
Projectile: 4194304,
|
||||||
SkeletonMonster: 1 << 20 | this.UndeadMob,
|
AbstractArrow: 8388608,
|
||||||
EquineAnimal: 1 << 21 | this.TamableAnimal,
|
WaterAnimal: 8960,
|
||||||
Projectile: 1 << 22,
|
VillagerBase: 16777984,
|
||||||
AbstractArrow: 1 << 23,
|
Chicken: 4874,
|
||||||
VillagerBase: 1 << 24 | this.PathfinderMob,
|
Cow: 4875,
|
||||||
|
Pig: 4876,
|
||||||
Chicken: 10 | this.Animal,
|
Sheep: 4877,
|
||||||
Cow: 11 | this.Animal,
|
Wolf: 21262,
|
||||||
Pig: 12 | this.Animal,
|
Villager: 16777999,
|
||||||
Sheep: 13 | this.Animal,
|
MushroomCow: 4880,
|
||||||
Wolf: 14 | this.TamableAnimal,
|
Squid: 8977,
|
||||||
Villager: 15 | this.VillagerBase,
|
Rabbit: 4882,
|
||||||
MushroomCow: 16 | this.Animal,
|
Bat: 33043,
|
||||||
Squid: 17 | this.WaterAnimal,
|
IronGolem: 788,
|
||||||
Rabbit: 18 | this.Animal,
|
SnowGolem: 789,
|
||||||
Bat: 19 | this.Ambient,
|
Ocelot: 21270,
|
||||||
IronGolem: 20 | this.PathfinderMob,
|
Horse: 2118423,
|
||||||
SnowGolem: 21 | this.PathfinderMob,
|
PolarBear: 4892,
|
||||||
Ocelot: 22 | this.TamableAnimal,
|
Llama: 4893,
|
||||||
Horse: 23 | this.EquineAnimal,
|
Parrot: 21278,
|
||||||
Donkey: 24 | this.EquineAnimal,
|
Dolphin: 8991,
|
||||||
Mule: 25 | this.EquineAnimal,
|
Donkey: 2118424,
|
||||||
SkeletonHorse: 26 | this.EquineAnimal | this.UndeadMob,
|
Mule: 2118425,
|
||||||
ZombieHorse: 27 | this.EquineAnimal | this.UndeadMob,
|
SkeletonHorse: 2186010,
|
||||||
PolarBear: 28 | this.Animal,
|
ZombieHorse: 2186011,
|
||||||
Llama: 29 | this.Animal,
|
Zombie: 199456,
|
||||||
Parrot: 30 | this.TamableAnimal,
|
Creeper: 2849,
|
||||||
Dolphin: 31 | this.WaterAnimal,
|
Skeleton: 1116962,
|
||||||
Zombie: 32 | this.ZombieMonster,
|
Spider: 264995,
|
||||||
Creeper: 33 | this.Monster,
|
PigZombie: 68388,
|
||||||
Skeleton: 34 | this.SkeletonMonster,
|
Slime: 2853,
|
||||||
Spider: 35 | this.Arthropod,
|
EnderMan: 2854,
|
||||||
PigZombie: 36 | this.UndeadMob,
|
Silverfish: 264999,
|
||||||
Slime: 37 | this.Monster,
|
CaveSpider: 265000,
|
||||||
EnderMan: 38 | this.Monster,
|
Ghast: 2857,
|
||||||
Silverfish: 39 | this.Arthropod,
|
LavaSlime: 2858,
|
||||||
CaveSpider: 40 | this.Arthropod,
|
Blaze: 2859,
|
||||||
Ghast: 41 | this.Monster,
|
ZombieVillager: 199468,
|
||||||
LavaSlime: 42 | this.Monster,
|
Witch: 2861,
|
||||||
Blaze: 43 | this.Monster,
|
Stray: 1116974,
|
||||||
ZombieVillager: 44 | this.ZombieMonster,
|
Husk: 199471,
|
||||||
Witch: 45 | this.Monster,
|
WitherSkeleton: 1116976,
|
||||||
Stray: 46 | this.SkeletonMonster,
|
Guardian: 2865,
|
||||||
Husk: 47 | this.ZombieMonster,
|
ElderGuardian: 2866,
|
||||||
WitherSkeleton: 48 | this.SkeletonMonster,
|
Npc: 307,
|
||||||
Guardian: 49 | this.Monster,
|
WitherBoss: 68404,
|
||||||
ElderGuardian: 50 | this.Monster,
|
Dragon: 2869,
|
||||||
Npc: 51 | this.Mob,
|
Shulker: 2870,
|
||||||
WitherBoss: 52 | this.UndeadMob,
|
Endermite: 265015,
|
||||||
Dragon: 53 | this.Monster,
|
Agent: 312,
|
||||||
Shulker: 54 | this.Monster,
|
Vindicator: 2873,
|
||||||
Endermite: 55 | this.Arthropod,
|
Phantom: 68410,
|
||||||
Agent: 56 | this.Mob,
|
IllagerBeast: 2875,
|
||||||
Vindicator: 57 | this.Monster,
|
ArmorStand: 317,
|
||||||
Phantom: 58 | this.UndeadMob,
|
TripodCamera: 318,
|
||||||
IllagerBeast: 59 | this.Monster,
|
Player: 319,
|
||||||
UNUSED60: 60,
|
ItemEntity: 64,
|
||||||
ArmorStand: 61 | this.Mob,
|
PrimedTnt: 65,
|
||||||
TripodCamera: 62 | this.Mob,
|
FallingBlock: 66,
|
||||||
Player: 63 | this.Mob,
|
MovingBlock: 67,
|
||||||
ItemEntity: 64 | this.None,
|
ExperiencePotion: 4194372,
|
||||||
PrimedTnt: 65 | this.None,
|
Experience: 69,
|
||||||
FallingBlock: 66 | this.None,
|
EyeOfEnder: 70,
|
||||||
MovingBlock: 67 | this.None,
|
EnderCrystal: 71,
|
||||||
ExperiencePotion: 68 | this.Projectile,
|
FireworksRocket: 72,
|
||||||
Experience: 69 | this.None,
|
Trident: 12582985,
|
||||||
EyeOfEnder: 70 | this.None,
|
Turtle: 4938,
|
||||||
EnderCrystal: 71 | this.None,
|
Cat: 21323,
|
||||||
FireworksRocket: 72 | this.None,
|
ShulkerBullet: 4194380,
|
||||||
Trident: 73 | this.Projectile | this.AbstractArrow,
|
FishingHook: 77,
|
||||||
Turtle: 74 | this.Animal,
|
Chalkboard: 78,
|
||||||
Cat: 75 | this.TamableAnimal,
|
DragonFireball: 4194383,
|
||||||
ShulkerBullet: 76 | this.Projectile,
|
Arrow: 12582992,
|
||||||
FishingHook: 77 | this.None,
|
Snowball: 4194385,
|
||||||
Chalkboard: 78 | this.None,
|
ThrownEgg: 4194386,
|
||||||
DragonFireball: 79 | this.Projectile,
|
Painting: 83,
|
||||||
Arrow: 80 | this.Projectile | this.AbstractArrow,
|
LargeFireball: 4194389,
|
||||||
Snowball: 81 | this.Projectile,
|
ThrownPotion: 4194390,
|
||||||
ThrownEgg: 82 | this.Projectile,
|
Enderpearl: 4194391,
|
||||||
Painting: 83 | this.None,
|
LeashKnot: 88,
|
||||||
MinecartRideable: 84 | this.Minecart,
|
WitherSkull: 4194393,
|
||||||
LargeFireball: 85 | this.Projectile,
|
BoatRideable: 90,
|
||||||
ThrownPotion: 86 | this.Projectile,
|
WitherSkullDangerous: 4194395,
|
||||||
Enderpearl: 87 | this.Projectile,
|
LightningBolt: 93,
|
||||||
LeashKnot: 88 | this.None,
|
SmallFireball: 4194398,
|
||||||
WitherSkull: 89 | this.Projectile,
|
AreaEffectCloud: 95,
|
||||||
BoatRideable: 90 | this.None,
|
LingeringPotion: 4194405,
|
||||||
WitherSkullDangerous: 91 | this.Projectile,
|
LlamaSpit: 4194406,
|
||||||
UNUSED92: 92,
|
EvocationFang: 4194407,
|
||||||
LightningBolt: 93 | this.None,
|
EvocationIllager: 2920,
|
||||||
SmallFireball: 94 | this.Projectile,
|
Vex: 2921,
|
||||||
AreaEffectCloud: 95 | this.None,
|
MinecartRideable: 524372,
|
||||||
MinecartHopper: 96 | this.Minecart,
|
MinecartHopper: 524384,
|
||||||
MinecartTNT: 97 | this.Minecart,
|
MinecartTNT: 524385,
|
||||||
MinecartChest: 98 | this.Minecart,
|
MinecartChest: 524386,
|
||||||
MinecartFurnace: 99 | this.Minecart,
|
MinecartFurnace: 524387,
|
||||||
MinecartCommandBlock: 100 | this.Minecart,
|
MinecartCommandBlock: 524388,
|
||||||
LingeringPotion: 101 | this.Projectile,
|
IceBomb: 4194410,
|
||||||
LlamaSpit: 102 | this.Projectile,
|
Balloon: 107,
|
||||||
EvocationFang: 103 | this.Projectile,
|
Pufferfish: 9068,
|
||||||
EvocationIllager: 104 | this.Monster,
|
Salmon: 9069,
|
||||||
Vex: 105 | this.Monster,
|
Drowned: 199534,
|
||||||
IceBomb: 106 | this.Projectile,
|
Tropicalfish: 9071,
|
||||||
Balloon: 107 | this.None,
|
Fish: 9072,
|
||||||
Pufferfish: 108 | this.WaterAnimal,
|
Panda: 4977,
|
||||||
Salmon: 109 | this.WaterAnimal,
|
Pillager: 2930,
|
||||||
Drowned: 110 | this.ZombieMonster,
|
VillagerV2: 16778099,
|
||||||
Tropicalfish: 111 | this.WaterAnimal,
|
ZombieVillagerV2: 199540,
|
||||||
Fish: 112 | this.WaterAnimal,
|
Shield: 117,
|
||||||
Panda: 113 | this.Animal,
|
WanderingTrader: 886,
|
||||||
Pillager: 114 | this.Monster,
|
Lectern: 119,
|
||||||
VillagerV2: 115 | this.VillagerBase,
|
ElderGuardianGhost: 2936,
|
||||||
ZombieVillagerV2: 116 | this.ZombieMonster,
|
Fox: 4985,
|
||||||
Shield: 117 | this.None,
|
Bee: 378,
|
||||||
WanderingTrader: 118 | this.PathfinderMob,
|
Piglin: 379,
|
||||||
Lectern: 119 | this.None,
|
Hoglin: 4988,
|
||||||
ElderGuardianGhost: 120 | this.Monster,
|
Strider: 4989,
|
||||||
Fox: 121 | this.Animal,
|
Zoglin: 68478,
|
||||||
Bee: 122 | this.Mob,
|
PiglinBrute: 383,
|
||||||
Piglin: 123 | this.Mob,
|
Goat: 4992,
|
||||||
Hoglin: 124 | this.Animal,
|
GlowSquid: 9089,
|
||||||
Strider: 125 | this.Animal,
|
Axolotl: 4994,
|
||||||
Zoglin: 126 | this.UndeadMob,
|
Warden: 2947,
|
||||||
PiglinBrute: 127 | this.Mob,
|
Frog: 4996,
|
||||||
Goat: 128 | this.Animal,
|
Tadpole: 9093,
|
||||||
GlowSquid: 129 | this.WaterAnimal,
|
Allay: 390,
|
||||||
Axolotl: 130 | this.Animal,
|
ChestBoatRideable: 218,
|
||||||
Warden: 131 | this.Monster,
|
TraderLlama: 5021,
|
||||||
Frog: 132 | this.Animal,
|
Camel: 5002,
|
||||||
Tadpole: 133 | this.WaterAnimal,
|
Sniffer: 5003,
|
||||||
Allay: 134 | this.Mob,
|
Breeze: 2956,
|
||||||
ChestBoatRideable: 136 | this.BoatRideable,
|
BreezeWindChargeProjectile: 4194445,
|
||||||
TraderLlama: 137 | this.Llama,
|
Armadillo: 5006,
|
||||||
Camel: 138 | this.Animal,
|
WindChargeProjectile: 4194447,
|
||||||
Sniffer: 139 | this.Animal,
|
Bogged: 1117072,
|
||||||
Breeze: 140 | this.Monster,
|
|
||||||
BreezeWindChargeProjectile: 141 | this.Projectile,
|
|
||||||
Armadillo: 142 | this.Animal,
|
|
||||||
WindChargeProjectile: 143 | this.Projectile,
|
|
||||||
Bogged: 144 | this.SkeletonMonster,
|
|
||||||
OminousItemSpawner: 145,
|
OminousItemSpawner: 145,
|
||||||
|
Creaking: 2962,
|
||||||
|
HappyGhast: 5011,
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
+20
-12
@@ -574,7 +574,7 @@ void Export_Compatibility_API() {
|
|||||||
);
|
);
|
||||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyBlock", [](ItemStack const* item, Block const* block) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyBlock", [](ItemStack const* item, Block const* block) -> bool {
|
||||||
return std::ranges::any_of(item->mCanDestroy, [block](BlockLegacy const* blockLegacy) {
|
return std::ranges::any_of(item->mCanDestroy, [block](BlockLegacy const* blockLegacy) {
|
||||||
return block->getTypeName() == blockLegacy->getTypeName();
|
return blockLegacy && block->getTypeName() == blockLegacy->getTypeName();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyInCreative", [](ItemStack const* item) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "itemCanDestroyInCreative", [](ItemStack const* item) -> bool {
|
||||||
@@ -584,7 +584,10 @@ void Export_Compatibility_API() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "itemCanDestroySpecial", [](ItemStack const* item, Block const* block) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "itemCanDestroySpecial", [](ItemStack const* item, Block const* block) -> bool {
|
||||||
return item->getItem()->canDestroySpecial(*block);
|
if (auto itemDef = item->getItem(); itemDef) {
|
||||||
|
return itemDef->canDestroySpecial(*block);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "blockCanDropWithAnyTool", [](Block const* block) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "blockCanDropWithAnyTool", [](Block const* block) -> bool {
|
||||||
return !block->getLegacyBlock().mRequiresCorrectToolForDrops;
|
return !block->getLegacyBlock().mRequiresCorrectToolForDrops;
|
||||||
@@ -834,36 +837,39 @@ void Export_Compatibility_API() {
|
|||||||
RemoteCall::exportAs("GMLIB_API", "getPlayerDestroyBlockProgress", [](Player* player, Block const* block) -> float {
|
RemoteCall::exportAs("GMLIB_API", "getPlayerDestroyBlockProgress", [](Player* player, Block const* block) -> float {
|
||||||
return player->getDestroyProgress(*block);
|
return player->getDestroyProgress(*block);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
static constexpr size_t effectMaxCount = 36;
|
||||||
|
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectVisible", [](Actor* entity, int effectId) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectVisible", [](Actor* entity, int effectId) -> bool {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mEffectVisible;
|
return effect->mEffectVisible;
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDuration", [](Actor* entity, int effectId) -> int {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDuration", [](Actor* entity, int effectId) -> int {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount|| !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mDuration->mValue;
|
return effect->mDuration->mValue;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationEasy", [](Actor* entity, int effectId) -> int {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationEasy", [](Actor* entity, int effectId) -> int {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mDurationEasy->transform([](auto&& duration) -> int { return duration.mValue; }).value_or(0);
|
return effect->mDurationEasy->transform([](auto&& duration) -> int { return duration.mValue; }).value_or(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationHard", [](Actor* entity, int effectId) -> int {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationHard", [](Actor* entity, int effectId) -> int {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mDurationHard->transform([](auto&& duration) -> int { return duration.mValue; }).value_or(0);
|
return effect->mDurationHard->transform([](auto&& duration) -> int { return duration.mValue; }).value_or(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationNormal", [](Actor* entity, int effectId) -> int {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectDurationNormal", [](Actor* entity, int effectId) -> int {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount|| !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mDurationNormal->transform(
|
return effect->mDurationNormal->transform(
|
||||||
[](auto&& duration) -> int { return duration.mValue; }
|
[](auto&& duration) -> int { return duration.mValue; }
|
||||||
@@ -872,21 +878,23 @@ void Export_Compatibility_API() {
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectAmplifier", [](Actor* entity, int effectId) -> int {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectAmplifier", [](Actor* entity, int effectId) -> int {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mAmplifier;
|
return effect->mAmplifier;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getEntityEffectAmbient", [](Actor* entity, int effectId) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "getEntityEffectAmbient", [](Actor* entity, int effectId) -> bool {
|
||||||
if (effectId < 0 || !MobEffect::mMobEffects()[effectId]) return false;
|
if (effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]) return false;
|
||||||
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
if (auto effect = entity->getEffect(*MobEffect::mMobEffects()[effectId])) {
|
||||||
return effect->mAmbient;
|
return effect->mAmbient;
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "entityHasEffect", [](Actor* entity, int effectId) -> bool {
|
RemoteCall::exportAs("GMLIB_API", "entityHasEffect", [](Actor* entity, int effectId) -> bool {
|
||||||
return effectId > 0x24 ? false : entity->hasEffect(*MobEffect::mMobEffects()[effectId]);
|
return effectId <= 0 || effectId > effectMaxCount || !MobEffect::mMobEffects()[effectId]
|
||||||
|
? false
|
||||||
|
: entity->hasEffect(*MobEffect::mMobEffects()[effectId]);
|
||||||
});
|
});
|
||||||
RemoteCall::exportAs("GMLIB_API", "getGameDifficulty", []() -> int {
|
RemoteCall::exportAs("GMLIB_API", "getGameDifficulty", []() -> int {
|
||||||
return ll::service::getLevel().transform(
|
return ll::service::getLevel().transform(
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4996)
|
||||||
#define GMLIB_GLOBAL_USING
|
#define GMLIB_GLOBAL_USING
|
||||||
#include <gmlib/GlobalUsing.h>
|
#include <gmlib/GlobalUsing.h>
|
||||||
#include <gmlib/include_all.h>
|
#include <gmlib/include_all.h>
|
||||||
#include <ila/include_all.h>
|
#include <ila/include_all.h>
|
||||||
#include <RemoteCallAPI.h>
|
#include <RemoteCallAPI.h>
|
||||||
using namespace gmlib::mod;
|
using namespace gmlib::mod;
|
||||||
|
#pragma warning(pop)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
#define PLUGIN_NAME fmt::format(fg(fmt::color::light_green), "GMLIB-LRCA")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ add_requires("levilamina 1.4.1", {configs = {target_type = "server"}})
|
|||||||
add_requires("legacyremotecall")
|
add_requires("legacyremotecall")
|
||||||
add_requires("levibuildscript")
|
add_requires("levibuildscript")
|
||||||
add_requires("ilistenattentively 0.7.0")
|
add_requires("ilistenattentively 0.7.0")
|
||||||
add_requires("gmlib 1.4.0")
|
add_requires("gmlib 1.4.3")
|
||||||
|
|
||||||
target("GMLIB-LegacyRemoteCallApi")
|
target("GMLIB-LegacyRemoteCallApi")
|
||||||
add_cxflags(
|
add_cxflags(
|
||||||
|
|||||||
Reference in New Issue
Block a user