Code Style Changes

This commit is contained in:
TheBrokenRail 2024-01-07 03:23:43 -05:00
parent d32fa2d265
commit e4d9ee4f20
36 changed files with 256 additions and 256 deletions

View File

@ -19,6 +19,6 @@ HOOK(chat_handle_packet_send, void, (Minecraft *minecraft, ChatPacket *packet))
} else { } else {
// Call Original Method // Call Original Method
ensure_chat_handle_packet_send(); ensure_chat_handle_packet_send();
(*real_chat_handle_packet_send)(minecraft, packet); real_chat_handle_packet_send(minecraft, packet);
} }
} }

View File

@ -10,623 +10,623 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
fire_instance->count = 255; fire_instance->count = 255;
fire_instance->auxiliary = 0; fire_instance->auxiliary = 0;
fire_instance->id = 51; fire_instance->id = 51;
(*FillingContainer_addItem)(filling_container, fire_instance); FillingContainer_addItem(filling_container, fire_instance);
ItemInstance *mushroomStew_instance = new ItemInstance; ItemInstance *mushroomStew_instance = new ItemInstance;
ALLOC_CHECK(mushroomStew_instance); ALLOC_CHECK(mushroomStew_instance);
mushroomStew_instance->count = 255; mushroomStew_instance->count = 255;
mushroomStew_instance->auxiliary = 0; mushroomStew_instance->auxiliary = 0;
mushroomStew_instance->id = 282; mushroomStew_instance->id = 282;
(*FillingContainer_addItem)(filling_container, mushroomStew_instance); FillingContainer_addItem(filling_container, mushroomStew_instance);
ItemInstance *steak_instance = new ItemInstance; ItemInstance *steak_instance = new ItemInstance;
ALLOC_CHECK(steak_instance); ALLOC_CHECK(steak_instance);
steak_instance->count = 255; steak_instance->count = 255;
steak_instance->auxiliary = 0; steak_instance->auxiliary = 0;
steak_instance->id = 364; steak_instance->id = 364;
(*FillingContainer_addItem)(filling_container, steak_instance); FillingContainer_addItem(filling_container, steak_instance);
ItemInstance *cookedChicken_instance = new ItemInstance; ItemInstance *cookedChicken_instance = new ItemInstance;
ALLOC_CHECK(cookedChicken_instance); ALLOC_CHECK(cookedChicken_instance);
cookedChicken_instance->count = 255; cookedChicken_instance->count = 255;
cookedChicken_instance->auxiliary = 0; cookedChicken_instance->auxiliary = 0;
cookedChicken_instance->id = 366; cookedChicken_instance->id = 366;
(*FillingContainer_addItem)(filling_container, cookedChicken_instance); FillingContainer_addItem(filling_container, cookedChicken_instance);
ItemInstance *porkCooked_instance = new ItemInstance; ItemInstance *porkCooked_instance = new ItemInstance;
ALLOC_CHECK(porkCooked_instance); ALLOC_CHECK(porkCooked_instance);
porkCooked_instance->count = 255; porkCooked_instance->count = 255;
porkCooked_instance->auxiliary = 0; porkCooked_instance->auxiliary = 0;
porkCooked_instance->id = 320; porkCooked_instance->id = 320;
(*FillingContainer_addItem)(filling_container, porkCooked_instance); FillingContainer_addItem(filling_container, porkCooked_instance);
ItemInstance *apple_instance = new ItemInstance; ItemInstance *apple_instance = new ItemInstance;
ALLOC_CHECK(apple_instance); ALLOC_CHECK(apple_instance);
apple_instance->count = 255; apple_instance->count = 255;
apple_instance->auxiliary = 0; apple_instance->auxiliary = 0;
apple_instance->id = 260; apple_instance->id = 260;
(*FillingContainer_addItem)(filling_container, apple_instance); FillingContainer_addItem(filling_container, apple_instance);
ItemInstance *tallGrass_instance = new ItemInstance; ItemInstance *tallGrass_instance = new ItemInstance;
ALLOC_CHECK(tallGrass_instance); ALLOC_CHECK(tallGrass_instance);
tallGrass_instance->count = 255; tallGrass_instance->count = 255;
tallGrass_instance->auxiliary = 0; tallGrass_instance->auxiliary = 0;
tallGrass_instance->id = 31; tallGrass_instance->id = 31;
(*FillingContainer_addItem)(filling_container, tallGrass_instance); FillingContainer_addItem(filling_container, tallGrass_instance);
ItemInstance *crops_instance = new ItemInstance; ItemInstance *crops_instance = new ItemInstance;
ALLOC_CHECK(crops_instance); ALLOC_CHECK(crops_instance);
crops_instance->count = 255; crops_instance->count = 255;
crops_instance->auxiliary = 0; crops_instance->auxiliary = 0;
crops_instance->id = 59; crops_instance->id = 59;
(*FillingContainer_addItem)(filling_container, crops_instance); FillingContainer_addItem(filling_container, crops_instance);
ItemInstance *farmland_instance = new ItemInstance; ItemInstance *farmland_instance = new ItemInstance;
ALLOC_CHECK(farmland_instance); ALLOC_CHECK(farmland_instance);
farmland_instance->count = 255; farmland_instance->count = 255;
farmland_instance->auxiliary = 0; farmland_instance->auxiliary = 0;
farmland_instance->id = 60; farmland_instance->id = 60;
(*FillingContainer_addItem)(filling_container, farmland_instance); FillingContainer_addItem(filling_container, farmland_instance);
ItemInstance *activeFurnace_instance = new ItemInstance; ItemInstance *activeFurnace_instance = new ItemInstance;
ALLOC_CHECK(activeFurnace_instance); ALLOC_CHECK(activeFurnace_instance);
activeFurnace_instance->count = 255; activeFurnace_instance->count = 255;
activeFurnace_instance->auxiliary = 0; activeFurnace_instance->auxiliary = 0;
activeFurnace_instance->id = 62; activeFurnace_instance->id = 62;
(*FillingContainer_addItem)(filling_container, activeFurnace_instance); FillingContainer_addItem(filling_container, activeFurnace_instance);
ItemInstance *ironDoor_instance = new ItemInstance; ItemInstance *ironDoor_instance = new ItemInstance;
ALLOC_CHECK(ironDoor_instance); ALLOC_CHECK(ironDoor_instance);
ironDoor_instance->count = 255; ironDoor_instance->count = 255;
ironDoor_instance->auxiliary = 0; ironDoor_instance->auxiliary = 0;
ironDoor_instance->id = 330; ironDoor_instance->id = 330;
(*FillingContainer_addItem)(filling_container, ironDoor_instance); FillingContainer_addItem(filling_container, ironDoor_instance);
ItemInstance *activeRedstoneOre_instance = new ItemInstance; ItemInstance *activeRedstoneOre_instance = new ItemInstance;
ALLOC_CHECK(activeRedstoneOre_instance); ALLOC_CHECK(activeRedstoneOre_instance);
activeRedstoneOre_instance->count = 255; activeRedstoneOre_instance->count = 255;
activeRedstoneOre_instance->auxiliary = 0; activeRedstoneOre_instance->auxiliary = 0;
activeRedstoneOre_instance->id = 74; activeRedstoneOre_instance->id = 74;
(*FillingContainer_addItem)(filling_container, activeRedstoneOre_instance); FillingContainer_addItem(filling_container, activeRedstoneOre_instance);
ItemInstance *pumkinStem_instance = new ItemInstance; ItemInstance *pumkinStem_instance = new ItemInstance;
ALLOC_CHECK(pumkinStem_instance); ALLOC_CHECK(pumkinStem_instance);
pumkinStem_instance->count = 255; pumkinStem_instance->count = 255;
pumkinStem_instance->auxiliary = 0; pumkinStem_instance->auxiliary = 0;
pumkinStem_instance->id = 105; pumkinStem_instance->id = 105;
(*FillingContainer_addItem)(filling_container, pumkinStem_instance); FillingContainer_addItem(filling_container, pumkinStem_instance);
ItemInstance *newGrass_instance = new ItemInstance; ItemInstance *newGrass_instance = new ItemInstance;
ALLOC_CHECK(newGrass_instance); ALLOC_CHECK(newGrass_instance);
newGrass_instance->count = 255; newGrass_instance->count = 255;
newGrass_instance->auxiliary = 0; newGrass_instance->auxiliary = 0;
newGrass_instance->id = 253; newGrass_instance->id = 253;
(*FillingContainer_addItem)(filling_container, newGrass_instance); FillingContainer_addItem(filling_container, newGrass_instance);
ItemInstance *reserved6_instance = new ItemInstance; ItemInstance *reserved6_instance = new ItemInstance;
ALLOC_CHECK(reserved6_instance); ALLOC_CHECK(reserved6_instance);
reserved6_instance->count = 255; reserved6_instance->count = 255;
reserved6_instance->auxiliary = 0; reserved6_instance->auxiliary = 0;
reserved6_instance->id = 1; reserved6_instance->id = 1;
(*FillingContainer_addItem)(filling_container, reserved6_instance); FillingContainer_addItem(filling_container, reserved6_instance);
ItemInstance *doubleStoneSlab_instance = new ItemInstance; ItemInstance *doubleStoneSlab_instance = new ItemInstance;
ALLOC_CHECK(doubleStoneSlab_instance); ALLOC_CHECK(doubleStoneSlab_instance);
doubleStoneSlab_instance->count = 255; doubleStoneSlab_instance->count = 255;
doubleStoneSlab_instance->auxiliary = 0; doubleStoneSlab_instance->auxiliary = 0;
doubleStoneSlab_instance->id = 43; doubleStoneSlab_instance->id = 43;
(*FillingContainer_addItem)(filling_container, doubleStoneSlab_instance); FillingContainer_addItem(filling_container, doubleStoneSlab_instance);
ItemInstance *arrow_instance = new ItemInstance; ItemInstance *arrow_instance = new ItemInstance;
ALLOC_CHECK(arrow_instance); ALLOC_CHECK(arrow_instance);
arrow_instance->count = 255; arrow_instance->count = 255;
arrow_instance->auxiliary = 0; arrow_instance->auxiliary = 0;
arrow_instance->id = 262; arrow_instance->id = 262;
(*FillingContainer_addItem)(filling_container, arrow_instance); FillingContainer_addItem(filling_container, arrow_instance);
ItemInstance *coal_instance = new ItemInstance; ItemInstance *coal_instance = new ItemInstance;
ALLOC_CHECK(coal_instance); ALLOC_CHECK(coal_instance);
coal_instance->count = 255; coal_instance->count = 255;
coal_instance->auxiliary = 0; coal_instance->auxiliary = 0;
coal_instance->id = 263; coal_instance->id = 263;
(*FillingContainer_addItem)(filling_container, coal_instance); FillingContainer_addItem(filling_container, coal_instance);
ItemInstance *diamond_instance = new ItemInstance; ItemInstance *diamond_instance = new ItemInstance;
ALLOC_CHECK(diamond_instance); ALLOC_CHECK(diamond_instance);
diamond_instance->count = 255; diamond_instance->count = 255;
diamond_instance->auxiliary = 0; diamond_instance->auxiliary = 0;
diamond_instance->id = 264; diamond_instance->id = 264;
(*FillingContainer_addItem)(filling_container, diamond_instance); FillingContainer_addItem(filling_container, diamond_instance);
ItemInstance *ironIngot_instance = new ItemInstance; ItemInstance *ironIngot_instance = new ItemInstance;
ALLOC_CHECK(ironIngot_instance); ALLOC_CHECK(ironIngot_instance);
ironIngot_instance->count = 255; ironIngot_instance->count = 255;
ironIngot_instance->auxiliary = 0; ironIngot_instance->auxiliary = 0;
ironIngot_instance->id = 265; ironIngot_instance->id = 265;
(*FillingContainer_addItem)(filling_container, ironIngot_instance); FillingContainer_addItem(filling_container, ironIngot_instance);
ItemInstance *goldIngot_instance = new ItemInstance; ItemInstance *goldIngot_instance = new ItemInstance;
ALLOC_CHECK(goldIngot_instance); ALLOC_CHECK(goldIngot_instance);
goldIngot_instance->count = 255; goldIngot_instance->count = 255;
goldIngot_instance->auxiliary = 0; goldIngot_instance->auxiliary = 0;
goldIngot_instance->id = 266; goldIngot_instance->id = 266;
(*FillingContainer_addItem)(filling_container, goldIngot_instance); FillingContainer_addItem(filling_container, goldIngot_instance);
ItemInstance *woodSword_instance = new ItemInstance; ItemInstance *woodSword_instance = new ItemInstance;
ALLOC_CHECK(woodSword_instance); ALLOC_CHECK(woodSword_instance);
woodSword_instance->count = 255; woodSword_instance->count = 255;
woodSword_instance->auxiliary = 0; woodSword_instance->auxiliary = 0;
woodSword_instance->id = 268; woodSword_instance->id = 268;
(*FillingContainer_addItem)(filling_container, woodSword_instance); FillingContainer_addItem(filling_container, woodSword_instance);
ItemInstance *woodShovel_instance = new ItemInstance; ItemInstance *woodShovel_instance = new ItemInstance;
ALLOC_CHECK(woodShovel_instance); ALLOC_CHECK(woodShovel_instance);
woodShovel_instance->count = 255; woodShovel_instance->count = 255;
woodShovel_instance->auxiliary = 0; woodShovel_instance->auxiliary = 0;
woodShovel_instance->id = 269; woodShovel_instance->id = 269;
(*FillingContainer_addItem)(filling_container, woodShovel_instance); FillingContainer_addItem(filling_container, woodShovel_instance);
ItemInstance *woodPickaxe_instance = new ItemInstance; ItemInstance *woodPickaxe_instance = new ItemInstance;
ALLOC_CHECK(woodPickaxe_instance); ALLOC_CHECK(woodPickaxe_instance);
woodPickaxe_instance->count = 255; woodPickaxe_instance->count = 255;
woodPickaxe_instance->auxiliary = 0; woodPickaxe_instance->auxiliary = 0;
woodPickaxe_instance->id = 270; woodPickaxe_instance->id = 270;
(*FillingContainer_addItem)(filling_container, woodPickaxe_instance); FillingContainer_addItem(filling_container, woodPickaxe_instance);
ItemInstance *woodAxe_instance = new ItemInstance; ItemInstance *woodAxe_instance = new ItemInstance;
ALLOC_CHECK(woodAxe_instance); ALLOC_CHECK(woodAxe_instance);
woodAxe_instance->count = 255; woodAxe_instance->count = 255;
woodAxe_instance->auxiliary = 0; woodAxe_instance->auxiliary = 0;
woodAxe_instance->id = 271; woodAxe_instance->id = 271;
(*FillingContainer_addItem)(filling_container, woodAxe_instance); FillingContainer_addItem(filling_container, woodAxe_instance);
ItemInstance *stoneSword_instance = new ItemInstance; ItemInstance *stoneSword_instance = new ItemInstance;
ALLOC_CHECK(stoneSword_instance); ALLOC_CHECK(stoneSword_instance);
stoneSword_instance->count = 255; stoneSword_instance->count = 255;
stoneSword_instance->auxiliary = 0; stoneSword_instance->auxiliary = 0;
stoneSword_instance->id = 272; stoneSword_instance->id = 272;
(*FillingContainer_addItem)(filling_container, stoneSword_instance); FillingContainer_addItem(filling_container, stoneSword_instance);
ItemInstance *stoneShovel_instance = new ItemInstance; ItemInstance *stoneShovel_instance = new ItemInstance;
ALLOC_CHECK(stoneShovel_instance); ALLOC_CHECK(stoneShovel_instance);
stoneShovel_instance->count = 255; stoneShovel_instance->count = 255;
stoneShovel_instance->auxiliary = 0; stoneShovel_instance->auxiliary = 0;
stoneShovel_instance->id = 273; stoneShovel_instance->id = 273;
(*FillingContainer_addItem)(filling_container, stoneShovel_instance); FillingContainer_addItem(filling_container, stoneShovel_instance);
ItemInstance *stonePickaxe_instance = new ItemInstance; ItemInstance *stonePickaxe_instance = new ItemInstance;
ALLOC_CHECK(stonePickaxe_instance); ALLOC_CHECK(stonePickaxe_instance);
stonePickaxe_instance->count = 255; stonePickaxe_instance->count = 255;
stonePickaxe_instance->auxiliary = 0; stonePickaxe_instance->auxiliary = 0;
stonePickaxe_instance->id = 274; stonePickaxe_instance->id = 274;
(*FillingContainer_addItem)(filling_container, stonePickaxe_instance); FillingContainer_addItem(filling_container, stonePickaxe_instance);
ItemInstance *stoneAxe_instance = new ItemInstance; ItemInstance *stoneAxe_instance = new ItemInstance;
ALLOC_CHECK(stoneAxe_instance); ALLOC_CHECK(stoneAxe_instance);
stoneAxe_instance->count = 255; stoneAxe_instance->count = 255;
stoneAxe_instance->auxiliary = 0; stoneAxe_instance->auxiliary = 0;
stoneAxe_instance->id = 275; stoneAxe_instance->id = 275;
(*FillingContainer_addItem)(filling_container, stoneAxe_instance); FillingContainer_addItem(filling_container, stoneAxe_instance);
ItemInstance *shovelIron_instance = new ItemInstance; ItemInstance *shovelIron_instance = new ItemInstance;
ALLOC_CHECK(shovelIron_instance); ALLOC_CHECK(shovelIron_instance);
shovelIron_instance->count = 255; shovelIron_instance->count = 255;
shovelIron_instance->auxiliary = 0; shovelIron_instance->auxiliary = 0;
shovelIron_instance->id = 256; shovelIron_instance->id = 256;
(*FillingContainer_addItem)(filling_container, shovelIron_instance); FillingContainer_addItem(filling_container, shovelIron_instance);
ItemInstance *ironPick_instance = new ItemInstance; ItemInstance *ironPick_instance = new ItemInstance;
ALLOC_CHECK(ironPick_instance); ALLOC_CHECK(ironPick_instance);
ironPick_instance->count = 255; ironPick_instance->count = 255;
ironPick_instance->auxiliary = 0; ironPick_instance->auxiliary = 0;
ironPick_instance->id = 257; ironPick_instance->id = 257;
(*FillingContainer_addItem)(filling_container, ironPick_instance); FillingContainer_addItem(filling_container, ironPick_instance);
ItemInstance *ironAxe_instance = new ItemInstance; ItemInstance *ironAxe_instance = new ItemInstance;
ALLOC_CHECK(ironAxe_instance); ALLOC_CHECK(ironAxe_instance);
ironAxe_instance->count = 255; ironAxe_instance->count = 255;
ironAxe_instance->auxiliary = 0; ironAxe_instance->auxiliary = 0;
ironAxe_instance->id = 258; ironAxe_instance->id = 258;
(*FillingContainer_addItem)(filling_container, ironAxe_instance); FillingContainer_addItem(filling_container, ironAxe_instance);
ItemInstance *diamondSword_instance = new ItemInstance; ItemInstance *diamondSword_instance = new ItemInstance;
ALLOC_CHECK(diamondSword_instance); ALLOC_CHECK(diamondSword_instance);
diamondSword_instance->count = 255; diamondSword_instance->count = 255;
diamondSword_instance->auxiliary = 0; diamondSword_instance->auxiliary = 0;
diamondSword_instance->id = 276; diamondSword_instance->id = 276;
(*FillingContainer_addItem)(filling_container, diamondSword_instance); FillingContainer_addItem(filling_container, diamondSword_instance);
ItemInstance *diamondShovel_instance = new ItemInstance; ItemInstance *diamondShovel_instance = new ItemInstance;
ALLOC_CHECK(diamondShovel_instance); ALLOC_CHECK(diamondShovel_instance);
diamondShovel_instance->count = 255; diamondShovel_instance->count = 255;
diamondShovel_instance->auxiliary = 0; diamondShovel_instance->auxiliary = 0;
diamondShovel_instance->id = 277; diamondShovel_instance->id = 277;
(*FillingContainer_addItem)(filling_container, diamondShovel_instance); FillingContainer_addItem(filling_container, diamondShovel_instance);
ItemInstance *diamondPickaxe_instance = new ItemInstance; ItemInstance *diamondPickaxe_instance = new ItemInstance;
ALLOC_CHECK(diamondPickaxe_instance); ALLOC_CHECK(diamondPickaxe_instance);
diamondPickaxe_instance->count = 255; diamondPickaxe_instance->count = 255;
diamondPickaxe_instance->auxiliary = 0; diamondPickaxe_instance->auxiliary = 0;
diamondPickaxe_instance->id = 278; diamondPickaxe_instance->id = 278;
(*FillingContainer_addItem)(filling_container, diamondPickaxe_instance); FillingContainer_addItem(filling_container, diamondPickaxe_instance);
ItemInstance *diamondAxe_instance = new ItemInstance; ItemInstance *diamondAxe_instance = new ItemInstance;
ALLOC_CHECK(diamondAxe_instance); ALLOC_CHECK(diamondAxe_instance);
diamondAxe_instance->count = 255; diamondAxe_instance->count = 255;
diamondAxe_instance->auxiliary = 0; diamondAxe_instance->auxiliary = 0;
diamondAxe_instance->id = 279; diamondAxe_instance->id = 279;
(*FillingContainer_addItem)(filling_container, diamondAxe_instance); FillingContainer_addItem(filling_container, diamondAxe_instance);
ItemInstance *magicWand_instance = new ItemInstance; ItemInstance *magicWand_instance = new ItemInstance;
ALLOC_CHECK(magicWand_instance); ALLOC_CHECK(magicWand_instance);
magicWand_instance->count = 255; magicWand_instance->count = 255;
magicWand_instance->auxiliary = 0; magicWand_instance->auxiliary = 0;
magicWand_instance->id = 280; magicWand_instance->id = 280;
(*FillingContainer_addItem)(filling_container, magicWand_instance); FillingContainer_addItem(filling_container, magicWand_instance);
ItemInstance *bowl_instance = new ItemInstance; ItemInstance *bowl_instance = new ItemInstance;
ALLOC_CHECK(bowl_instance); ALLOC_CHECK(bowl_instance);
bowl_instance->count = 255; bowl_instance->count = 255;
bowl_instance->auxiliary = 0; bowl_instance->auxiliary = 0;
bowl_instance->id = 281; bowl_instance->id = 281;
(*FillingContainer_addItem)(filling_container, bowl_instance); FillingContainer_addItem(filling_container, bowl_instance);
ItemInstance *goldSword_instance = new ItemInstance; ItemInstance *goldSword_instance = new ItemInstance;
ALLOC_CHECK(goldSword_instance); ALLOC_CHECK(goldSword_instance);
goldSword_instance->count = 255; goldSword_instance->count = 255;
goldSword_instance->auxiliary = 0; goldSword_instance->auxiliary = 0;
goldSword_instance->id = 283; goldSword_instance->id = 283;
(*FillingContainer_addItem)(filling_container, goldSword_instance); FillingContainer_addItem(filling_container, goldSword_instance);
ItemInstance *goldShovel_instance = new ItemInstance; ItemInstance *goldShovel_instance = new ItemInstance;
ALLOC_CHECK(goldShovel_instance); ALLOC_CHECK(goldShovel_instance);
goldShovel_instance->count = 255; goldShovel_instance->count = 255;
goldShovel_instance->auxiliary = 0; goldShovel_instance->auxiliary = 0;
goldShovel_instance->id = 284; goldShovel_instance->id = 284;
(*FillingContainer_addItem)(filling_container, goldShovel_instance); FillingContainer_addItem(filling_container, goldShovel_instance);
ItemInstance *goldPickaxe_instance = new ItemInstance; ItemInstance *goldPickaxe_instance = new ItemInstance;
ALLOC_CHECK(goldPickaxe_instance); ALLOC_CHECK(goldPickaxe_instance);
goldPickaxe_instance->count = 255; goldPickaxe_instance->count = 255;
goldPickaxe_instance->auxiliary = 0; goldPickaxe_instance->auxiliary = 0;
goldPickaxe_instance->id = 285; goldPickaxe_instance->id = 285;
(*FillingContainer_addItem)(filling_container, goldPickaxe_instance); FillingContainer_addItem(filling_container, goldPickaxe_instance);
ItemInstance *goldAxe_instance = new ItemInstance; ItemInstance *goldAxe_instance = new ItemInstance;
ALLOC_CHECK(goldAxe_instance); ALLOC_CHECK(goldAxe_instance);
goldAxe_instance->count = 255; goldAxe_instance->count = 255;
goldAxe_instance->auxiliary = 0; goldAxe_instance->auxiliary = 0;
goldAxe_instance->id = 286; goldAxe_instance->id = 286;
(*FillingContainer_addItem)(filling_container, goldAxe_instance); FillingContainer_addItem(filling_container, goldAxe_instance);
ItemInstance *string_instance = new ItemInstance; ItemInstance *string_instance = new ItemInstance;
ALLOC_CHECK(string_instance); ALLOC_CHECK(string_instance);
string_instance->count = 255; string_instance->count = 255;
string_instance->auxiliary = 0; string_instance->auxiliary = 0;
string_instance->id = 287; string_instance->id = 287;
(*FillingContainer_addItem)(filling_container, string_instance); FillingContainer_addItem(filling_container, string_instance);
ItemInstance *feather_instance = new ItemInstance; ItemInstance *feather_instance = new ItemInstance;
ALLOC_CHECK(feather_instance); ALLOC_CHECK(feather_instance);
feather_instance->count = 255; feather_instance->count = 255;
feather_instance->auxiliary = 0; feather_instance->auxiliary = 0;
feather_instance->id = 288; feather_instance->id = 288;
(*FillingContainer_addItem)(filling_container, feather_instance); FillingContainer_addItem(filling_container, feather_instance);
ItemInstance *gunpowder_instance = new ItemInstance; ItemInstance *gunpowder_instance = new ItemInstance;
ALLOC_CHECK(gunpowder_instance); ALLOC_CHECK(gunpowder_instance);
gunpowder_instance->count = 255; gunpowder_instance->count = 255;
gunpowder_instance->auxiliary = 0; gunpowder_instance->auxiliary = 0;
gunpowder_instance->id = 289; gunpowder_instance->id = 289;
(*FillingContainer_addItem)(filling_container, gunpowder_instance); FillingContainer_addItem(filling_container, gunpowder_instance);
ItemInstance *woodHoe_instance = new ItemInstance; ItemInstance *woodHoe_instance = new ItemInstance;
ALLOC_CHECK(woodHoe_instance); ALLOC_CHECK(woodHoe_instance);
woodHoe_instance->count = 255; woodHoe_instance->count = 255;
woodHoe_instance->auxiliary = 0; woodHoe_instance->auxiliary = 0;
woodHoe_instance->id = 290; woodHoe_instance->id = 290;
(*FillingContainer_addItem)(filling_container, woodHoe_instance); FillingContainer_addItem(filling_container, woodHoe_instance);
ItemInstance *stoneHoe_instance = new ItemInstance; ItemInstance *stoneHoe_instance = new ItemInstance;
ALLOC_CHECK(stoneHoe_instance); ALLOC_CHECK(stoneHoe_instance);
stoneHoe_instance->count = 255; stoneHoe_instance->count = 255;
stoneHoe_instance->auxiliary = 0; stoneHoe_instance->auxiliary = 0;
stoneHoe_instance->id = 291; stoneHoe_instance->id = 291;
(*FillingContainer_addItem)(filling_container, stoneHoe_instance); FillingContainer_addItem(filling_container, stoneHoe_instance);
ItemInstance *flint1_instance = new ItemInstance; ItemInstance *flint1_instance = new ItemInstance;
ALLOC_CHECK(flint1_instance); ALLOC_CHECK(flint1_instance);
flint1_instance->count = 255; flint1_instance->count = 255;
flint1_instance->auxiliary = 0; flint1_instance->auxiliary = 0;
flint1_instance->id = 292; flint1_instance->id = 292;
(*FillingContainer_addItem)(filling_container, flint1_instance); FillingContainer_addItem(filling_container, flint1_instance);
ItemInstance *diamondHoe_instance = new ItemInstance; ItemInstance *diamondHoe_instance = new ItemInstance;
ALLOC_CHECK(diamondHoe_instance); ALLOC_CHECK(diamondHoe_instance);
diamondHoe_instance->count = 255; diamondHoe_instance->count = 255;
diamondHoe_instance->auxiliary = 0; diamondHoe_instance->auxiliary = 0;
diamondHoe_instance->id = 293; diamondHoe_instance->id = 293;
(*FillingContainer_addItem)(filling_container, diamondHoe_instance); FillingContainer_addItem(filling_container, diamondHoe_instance);
ItemInstance *goldHoe_instance = new ItemInstance; ItemInstance *goldHoe_instance = new ItemInstance;
ALLOC_CHECK(goldHoe_instance); ALLOC_CHECK(goldHoe_instance);
goldHoe_instance->count = 255; goldHoe_instance->count = 255;
goldHoe_instance->auxiliary = 0; goldHoe_instance->auxiliary = 0;
goldHoe_instance->id = 294; goldHoe_instance->id = 294;
(*FillingContainer_addItem)(filling_container, goldHoe_instance); FillingContainer_addItem(filling_container, goldHoe_instance);
ItemInstance *seeds_instance = new ItemInstance; ItemInstance *seeds_instance = new ItemInstance;
ALLOC_CHECK(seeds_instance); ALLOC_CHECK(seeds_instance);
seeds_instance->count = 255; seeds_instance->count = 255;
seeds_instance->auxiliary = 0; seeds_instance->auxiliary = 0;
seeds_instance->id = 295; seeds_instance->id = 295;
(*FillingContainer_addItem)(filling_container, seeds_instance); FillingContainer_addItem(filling_container, seeds_instance);
ItemInstance *wheat_instance = new ItemInstance; ItemInstance *wheat_instance = new ItemInstance;
ALLOC_CHECK(wheat_instance); ALLOC_CHECK(wheat_instance);
wheat_instance->count = 255; wheat_instance->count = 255;
wheat_instance->auxiliary = 0; wheat_instance->auxiliary = 0;
wheat_instance->id = 296; wheat_instance->id = 296;
(*FillingContainer_addItem)(filling_container, wheat_instance); FillingContainer_addItem(filling_container, wheat_instance);
ItemInstance *bread_instance = new ItemInstance; ItemInstance *bread_instance = new ItemInstance;
ALLOC_CHECK(bread_instance); ALLOC_CHECK(bread_instance);
bread_instance->count = 255; bread_instance->count = 255;
bread_instance->auxiliary = 0; bread_instance->auxiliary = 0;
bread_instance->id = 297; bread_instance->id = 297;
(*FillingContainer_addItem)(filling_container, bread_instance); FillingContainer_addItem(filling_container, bread_instance);
ItemInstance *diamondHelm_instance = new ItemInstance; ItemInstance *diamondHelm_instance = new ItemInstance;
ALLOC_CHECK(diamondHelm_instance); ALLOC_CHECK(diamondHelm_instance);
diamondHelm_instance->count = 255; diamondHelm_instance->count = 255;
diamondHelm_instance->auxiliary = 0; diamondHelm_instance->auxiliary = 0;
diamondHelm_instance->id = 310; diamondHelm_instance->id = 310;
(*FillingContainer_addItem)(filling_container, diamondHelm_instance); FillingContainer_addItem(filling_container, diamondHelm_instance);
ItemInstance *diamondChest_instance = new ItemInstance; ItemInstance *diamondChest_instance = new ItemInstance;
ALLOC_CHECK(diamondChest_instance); ALLOC_CHECK(diamondChest_instance);
diamondChest_instance->count = 255; diamondChest_instance->count = 255;
diamondChest_instance->auxiliary = 0; diamondChest_instance->auxiliary = 0;
diamondChest_instance->id = 311; diamondChest_instance->id = 311;
(*FillingContainer_addItem)(filling_container, diamondChest_instance); FillingContainer_addItem(filling_container, diamondChest_instance);
ItemInstance *diamondLeg_instance = new ItemInstance; ItemInstance *diamondLeg_instance = new ItemInstance;
ALLOC_CHECK(diamondLeg_instance); ALLOC_CHECK(diamondLeg_instance);
diamondLeg_instance->count = 255; diamondLeg_instance->count = 255;
diamondLeg_instance->auxiliary = 0; diamondLeg_instance->auxiliary = 0;
diamondLeg_instance->id = 312; diamondLeg_instance->id = 312;
(*FillingContainer_addItem)(filling_container, diamondLeg_instance); FillingContainer_addItem(filling_container, diamondLeg_instance);
ItemInstance *diamondBoot_instance = new ItemInstance; ItemInstance *diamondBoot_instance = new ItemInstance;
ALLOC_CHECK(diamondBoot_instance); ALLOC_CHECK(diamondBoot_instance);
diamondBoot_instance->count = 255; diamondBoot_instance->count = 255;
diamondBoot_instance->auxiliary = 0; diamondBoot_instance->auxiliary = 0;
diamondBoot_instance->id = 313; diamondBoot_instance->id = 313;
(*FillingContainer_addItem)(filling_container, diamondBoot_instance); FillingContainer_addItem(filling_container, diamondBoot_instance);
ItemInstance *leatherCap_instance = new ItemInstance; ItemInstance *leatherCap_instance = new ItemInstance;
ALLOC_CHECK(leatherCap_instance); ALLOC_CHECK(leatherCap_instance);
leatherCap_instance->count = 255; leatherCap_instance->count = 255;
leatherCap_instance->auxiliary = 0; leatherCap_instance->auxiliary = 0;
leatherCap_instance->id = 298; leatherCap_instance->id = 298;
(*FillingContainer_addItem)(filling_container, leatherCap_instance); FillingContainer_addItem(filling_container, leatherCap_instance);
ItemInstance *leatherShirt_instance = new ItemInstance; ItemInstance *leatherShirt_instance = new ItemInstance;
ALLOC_CHECK(leatherShirt_instance); ALLOC_CHECK(leatherShirt_instance);
leatherShirt_instance->count = 255; leatherShirt_instance->count = 255;
leatherShirt_instance->auxiliary = 0; leatherShirt_instance->auxiliary = 0;
leatherShirt_instance->id = 299; leatherShirt_instance->id = 299;
(*FillingContainer_addItem)(filling_container, leatherShirt_instance); FillingContainer_addItem(filling_container, leatherShirt_instance);
ItemInstance *leatherPants_instance = new ItemInstance; ItemInstance *leatherPants_instance = new ItemInstance;
ALLOC_CHECK(leatherPants_instance); ALLOC_CHECK(leatherPants_instance);
leatherPants_instance->count = 255; leatherPants_instance->count = 255;
leatherPants_instance->auxiliary = 0; leatherPants_instance->auxiliary = 0;
leatherPants_instance->id = 300; leatherPants_instance->id = 300;
(*FillingContainer_addItem)(filling_container, leatherPants_instance); FillingContainer_addItem(filling_container, leatherPants_instance);
ItemInstance *leatherBoots_instance = new ItemInstance; ItemInstance *leatherBoots_instance = new ItemInstance;
ALLOC_CHECK(leatherBoots_instance); ALLOC_CHECK(leatherBoots_instance);
leatherBoots_instance->count = 255; leatherBoots_instance->count = 255;
leatherBoots_instance->auxiliary = 0; leatherBoots_instance->auxiliary = 0;
leatherBoots_instance->id = 301; leatherBoots_instance->id = 301;
(*FillingContainer_addItem)(filling_container, leatherBoots_instance); FillingContainer_addItem(filling_container, leatherBoots_instance);
ItemInstance *chainHelm_instance = new ItemInstance; ItemInstance *chainHelm_instance = new ItemInstance;
ALLOC_CHECK(chainHelm_instance); ALLOC_CHECK(chainHelm_instance);
chainHelm_instance->count = 255; chainHelm_instance->count = 255;
chainHelm_instance->auxiliary = 0; chainHelm_instance->auxiliary = 0;
chainHelm_instance->id = 302; chainHelm_instance->id = 302;
(*FillingContainer_addItem)(filling_container, chainHelm_instance); FillingContainer_addItem(filling_container, chainHelm_instance);
ItemInstance *chainShirt_instance = new ItemInstance; ItemInstance *chainShirt_instance = new ItemInstance;
ALLOC_CHECK(chainShirt_instance); ALLOC_CHECK(chainShirt_instance);
chainShirt_instance->count = 255; chainShirt_instance->count = 255;
chainShirt_instance->auxiliary = 0; chainShirt_instance->auxiliary = 0;
chainShirt_instance->id = 303; chainShirt_instance->id = 303;
(*FillingContainer_addItem)(filling_container, chainShirt_instance); FillingContainer_addItem(filling_container, chainShirt_instance);
ItemInstance *chainLegs_instance = new ItemInstance; ItemInstance *chainLegs_instance = new ItemInstance;
ALLOC_CHECK(chainLegs_instance); ALLOC_CHECK(chainLegs_instance);
chainLegs_instance->count = 255; chainLegs_instance->count = 255;
chainLegs_instance->auxiliary = 0; chainLegs_instance->auxiliary = 0;
chainLegs_instance->id = 304; chainLegs_instance->id = 304;
(*FillingContainer_addItem)(filling_container, chainLegs_instance); FillingContainer_addItem(filling_container, chainLegs_instance);
ItemInstance *chainBoots_instance = new ItemInstance; ItemInstance *chainBoots_instance = new ItemInstance;
ALLOC_CHECK(chainBoots_instance); ALLOC_CHECK(chainBoots_instance);
chainBoots_instance->count = 255; chainBoots_instance->count = 255;
chainBoots_instance->auxiliary = 0; chainBoots_instance->auxiliary = 0;
chainBoots_instance->id = 305; chainBoots_instance->id = 305;
(*FillingContainer_addItem)(filling_container, chainBoots_instance); FillingContainer_addItem(filling_container, chainBoots_instance);
ItemInstance *goldHelm_instance = new ItemInstance; ItemInstance *goldHelm_instance = new ItemInstance;
ALLOC_CHECK(goldHelm_instance); ALLOC_CHECK(goldHelm_instance);
goldHelm_instance->count = 255; goldHelm_instance->count = 255;
goldHelm_instance->auxiliary = 0; goldHelm_instance->auxiliary = 0;
goldHelm_instance->id = 314; goldHelm_instance->id = 314;
(*FillingContainer_addItem)(filling_container, goldHelm_instance); FillingContainer_addItem(filling_container, goldHelm_instance);
ItemInstance *goldChest_instance = new ItemInstance; ItemInstance *goldChest_instance = new ItemInstance;
ALLOC_CHECK(goldChest_instance); ALLOC_CHECK(goldChest_instance);
goldChest_instance->count = 255; goldChest_instance->count = 255;
goldChest_instance->auxiliary = 0; goldChest_instance->auxiliary = 0;
goldChest_instance->id = 315; goldChest_instance->id = 315;
(*FillingContainer_addItem)(filling_container, goldChest_instance); FillingContainer_addItem(filling_container, goldChest_instance);
ItemInstance *goldLegs_instance = new ItemInstance; ItemInstance *goldLegs_instance = new ItemInstance;
ALLOC_CHECK(goldLegs_instance); ALLOC_CHECK(goldLegs_instance);
goldLegs_instance->count = 255; goldLegs_instance->count = 255;
goldLegs_instance->auxiliary = 0; goldLegs_instance->auxiliary = 0;
goldLegs_instance->id = 316; goldLegs_instance->id = 316;
(*FillingContainer_addItem)(filling_container, goldLegs_instance); FillingContainer_addItem(filling_container, goldLegs_instance);
ItemInstance *goldBoots_instance = new ItemInstance; ItemInstance *goldBoots_instance = new ItemInstance;
ALLOC_CHECK(goldBoots_instance); ALLOC_CHECK(goldBoots_instance);
goldBoots_instance->count = 255; goldBoots_instance->count = 255;
goldBoots_instance->auxiliary = 0; goldBoots_instance->auxiliary = 0;
goldBoots_instance->id = 317; goldBoots_instance->id = 317;
(*FillingContainer_addItem)(filling_container, goldBoots_instance); FillingContainer_addItem(filling_container, goldBoots_instance);
ItemInstance *ironHelm_instance = new ItemInstance; ItemInstance *ironHelm_instance = new ItemInstance;
ALLOC_CHECK(ironHelm_instance); ALLOC_CHECK(ironHelm_instance);
ironHelm_instance->count = 255; ironHelm_instance->count = 255;
ironHelm_instance->auxiliary = 0; ironHelm_instance->auxiliary = 0;
ironHelm_instance->id = 306; ironHelm_instance->id = 306;
(*FillingContainer_addItem)(filling_container, ironHelm_instance); FillingContainer_addItem(filling_container, ironHelm_instance);
ItemInstance *ironChest_instance = new ItemInstance; ItemInstance *ironChest_instance = new ItemInstance;
ALLOC_CHECK(ironChest_instance); ALLOC_CHECK(ironChest_instance);
ironChest_instance->count = 255; ironChest_instance->count = 255;
ironChest_instance->auxiliary = 0; ironChest_instance->auxiliary = 0;
ironChest_instance->id = 307; ironChest_instance->id = 307;
(*FillingContainer_addItem)(filling_container, ironChest_instance); FillingContainer_addItem(filling_container, ironChest_instance);
ItemInstance *ironLegs_instance = new ItemInstance; ItemInstance *ironLegs_instance = new ItemInstance;
ALLOC_CHECK(ironLegs_instance); ALLOC_CHECK(ironLegs_instance);
ironLegs_instance->count = 255; ironLegs_instance->count = 255;
ironLegs_instance->auxiliary = 0; ironLegs_instance->auxiliary = 0;
ironLegs_instance->id = 308; ironLegs_instance->id = 308;
(*FillingContainer_addItem)(filling_container, ironLegs_instance); FillingContainer_addItem(filling_container, ironLegs_instance);
ItemInstance *ironBoots_instance = new ItemInstance; ItemInstance *ironBoots_instance = new ItemInstance;
ALLOC_CHECK(ironBoots_instance); ALLOC_CHECK(ironBoots_instance);
ironBoots_instance->count = 255; ironBoots_instance->count = 255;
ironBoots_instance->auxiliary = 0; ironBoots_instance->auxiliary = 0;
ironBoots_instance->id = 309; ironBoots_instance->id = 309;
(*FillingContainer_addItem)(filling_container, ironBoots_instance); FillingContainer_addItem(filling_container, ironBoots_instance);
ItemInstance *flint2_instance = new ItemInstance; ItemInstance *flint2_instance = new ItemInstance;
ALLOC_CHECK(flint2_instance); ALLOC_CHECK(flint2_instance);
flint2_instance->count = 255; flint2_instance->count = 255;
flint2_instance->auxiliary = 0; flint2_instance->auxiliary = 0;
flint2_instance->id = 318; flint2_instance->id = 318;
(*FillingContainer_addItem)(filling_container, flint2_instance); FillingContainer_addItem(filling_container, flint2_instance);
ItemInstance *porkRaw_instance = new ItemInstance; ItemInstance *porkRaw_instance = new ItemInstance;
ALLOC_CHECK(porkRaw_instance); ALLOC_CHECK(porkRaw_instance);
porkRaw_instance->count = 255; porkRaw_instance->count = 255;
porkRaw_instance->auxiliary = 0; porkRaw_instance->auxiliary = 0;
porkRaw_instance->id = 319; porkRaw_instance->id = 319;
(*FillingContainer_addItem)(filling_container, porkRaw_instance); FillingContainer_addItem(filling_container, porkRaw_instance);
ItemInstance *leather_instance = new ItemInstance; ItemInstance *leather_instance = new ItemInstance;
ALLOC_CHECK(leather_instance); ALLOC_CHECK(leather_instance);
leather_instance->count = 255; leather_instance->count = 255;
leather_instance->auxiliary = 0; leather_instance->auxiliary = 0;
leather_instance->id = 334; leather_instance->id = 334;
(*FillingContainer_addItem)(filling_container, leather_instance); FillingContainer_addItem(filling_container, leather_instance);
ItemInstance *clayBrick_instance = new ItemInstance; ItemInstance *clayBrick_instance = new ItemInstance;
ALLOC_CHECK(clayBrick_instance); ALLOC_CHECK(clayBrick_instance);
clayBrick_instance->count = 255; clayBrick_instance->count = 255;
clayBrick_instance->auxiliary = 0; clayBrick_instance->auxiliary = 0;
clayBrick_instance->id = 336; clayBrick_instance->id = 336;
(*FillingContainer_addItem)(filling_container, clayBrick_instance); FillingContainer_addItem(filling_container, clayBrick_instance);
ItemInstance *clay_instance = new ItemInstance; ItemInstance *clay_instance = new ItemInstance;
ALLOC_CHECK(clay_instance); ALLOC_CHECK(clay_instance);
clay_instance->count = 255; clay_instance->count = 255;
clay_instance->auxiliary = 0; clay_instance->auxiliary = 0;
clay_instance->id = 337; clay_instance->id = 337;
(*FillingContainer_addItem)(filling_container, clay_instance); FillingContainer_addItem(filling_container, clay_instance);
ItemInstance *notepad_instance = new ItemInstance; ItemInstance *notepad_instance = new ItemInstance;
ALLOC_CHECK(notepad_instance); ALLOC_CHECK(notepad_instance);
notepad_instance->count = 255; notepad_instance->count = 255;
notepad_instance->auxiliary = 0; notepad_instance->auxiliary = 0;
notepad_instance->id = 339; notepad_instance->id = 339;
(*FillingContainer_addItem)(filling_container, notepad_instance); FillingContainer_addItem(filling_container, notepad_instance);
ItemInstance *book_instance = new ItemInstance; ItemInstance *book_instance = new ItemInstance;
ALLOC_CHECK(book_instance); ALLOC_CHECK(book_instance);
book_instance->count = 255; book_instance->count = 255;
book_instance->auxiliary = 0; book_instance->auxiliary = 0;
book_instance->id = 340; book_instance->id = 340;
(*FillingContainer_addItem)(filling_container, book_instance); FillingContainer_addItem(filling_container, book_instance);
ItemInstance *slimeball_instance = new ItemInstance; ItemInstance *slimeball_instance = new ItemInstance;
ALLOC_CHECK(slimeball_instance); ALLOC_CHECK(slimeball_instance);
slimeball_instance->count = 255; slimeball_instance->count = 255;
slimeball_instance->auxiliary = 0; slimeball_instance->auxiliary = 0;
slimeball_instance->id = 341; slimeball_instance->id = 341;
(*FillingContainer_addItem)(filling_container, slimeball_instance); FillingContainer_addItem(filling_container, slimeball_instance);
ItemInstance *compass_instance = new ItemInstance; ItemInstance *compass_instance = new ItemInstance;
ALLOC_CHECK(compass_instance); ALLOC_CHECK(compass_instance);
compass_instance->count = 255; compass_instance->count = 255;
compass_instance->auxiliary = 0; compass_instance->auxiliary = 0;
compass_instance->id = 345; compass_instance->id = 345;
(*FillingContainer_addItem)(filling_container, compass_instance); FillingContainer_addItem(filling_container, compass_instance);
ItemInstance *clock_instance = new ItemInstance; ItemInstance *clock_instance = new ItemInstance;
ALLOC_CHECK(clock_instance); ALLOC_CHECK(clock_instance);
clock_instance->count = 255; clock_instance->count = 255;
clock_instance->auxiliary = 0; clock_instance->auxiliary = 0;
clock_instance->id = 347; clock_instance->id = 347;
(*FillingContainer_addItem)(filling_container, clock_instance); FillingContainer_addItem(filling_container, clock_instance);
ItemInstance *glowDust_instance = new ItemInstance; ItemInstance *glowDust_instance = new ItemInstance;
ALLOC_CHECK(glowDust_instance); ALLOC_CHECK(glowDust_instance);
glowDust_instance->count = 255; glowDust_instance->count = 255;
glowDust_instance->auxiliary = 0; glowDust_instance->auxiliary = 0;
glowDust_instance->id = 348; glowDust_instance->id = 348;
(*FillingContainer_addItem)(filling_container, glowDust_instance); FillingContainer_addItem(filling_container, glowDust_instance);
ItemInstance *bone_instance = new ItemInstance; ItemInstance *bone_instance = new ItemInstance;
ALLOC_CHECK(bone_instance); ALLOC_CHECK(bone_instance);
bone_instance->count = 255; bone_instance->count = 255;
bone_instance->auxiliary = 0; bone_instance->auxiliary = 0;
bone_instance->id = 352; bone_instance->id = 352;
(*FillingContainer_addItem)(filling_container, bone_instance); FillingContainer_addItem(filling_container, bone_instance);
ItemInstance *sugar_instance = new ItemInstance; ItemInstance *sugar_instance = new ItemInstance;
ALLOC_CHECK(sugar_instance); ALLOC_CHECK(sugar_instance);
sugar_instance->count = 255; sugar_instance->count = 255;
sugar_instance->auxiliary = 0; sugar_instance->auxiliary = 0;
sugar_instance->id = 353; sugar_instance->id = 353;
(*FillingContainer_addItem)(filling_container, sugar_instance); FillingContainer_addItem(filling_container, sugar_instance);
ItemInstance *melon_instance = new ItemInstance; ItemInstance *melon_instance = new ItemInstance;
ALLOC_CHECK(melon_instance); ALLOC_CHECK(melon_instance);
melon_instance->count = 255; melon_instance->count = 255;
melon_instance->auxiliary = 0; melon_instance->auxiliary = 0;
melon_instance->id = 360; melon_instance->id = 360;
(*FillingContainer_addItem)(filling_container, melon_instance); FillingContainer_addItem(filling_container, melon_instance);
ItemInstance *beefRaw_instance = new ItemInstance; ItemInstance *beefRaw_instance = new ItemInstance;
ALLOC_CHECK(beefRaw_instance); ALLOC_CHECK(beefRaw_instance);
beefRaw_instance->count = 255; beefRaw_instance->count = 255;
beefRaw_instance->auxiliary = 0; beefRaw_instance->auxiliary = 0;
beefRaw_instance->id = 363; beefRaw_instance->id = 363;
(*FillingContainer_addItem)(filling_container, beefRaw_instance); FillingContainer_addItem(filling_container, beefRaw_instance);
ItemInstance *chickenRaw_instance = new ItemInstance; ItemInstance *chickenRaw_instance = new ItemInstance;
ALLOC_CHECK(chickenRaw_instance); ALLOC_CHECK(chickenRaw_instance);
chickenRaw_instance->count = 255; chickenRaw_instance->count = 255;
chickenRaw_instance->auxiliary = 0; chickenRaw_instance->auxiliary = 0;
chickenRaw_instance->id = 365; chickenRaw_instance->id = 365;
(*FillingContainer_addItem)(filling_container, chickenRaw_instance); FillingContainer_addItem(filling_container, chickenRaw_instance);
} }
// Init // Init

View File

@ -32,7 +32,7 @@ static void Recipes_injection(Recipes *recipes) {
.auxiliary = 0 .auxiliary = 0
}; };
std::vector<Recipes_Type> types = {type1, type2}; std::vector<Recipes_Type> types = {type1, type2};
(*Recipes_addShapelessRecipe)(recipes, &result, &types); Recipes_addShapelessRecipe(recipes, &result, &types);
} }
// Custom Furnace Recipes // Custom Furnace Recipes
@ -43,7 +43,7 @@ static void FurnaceRecipes_injection(FurnaceRecipes *recipes) {
.id = 246, .id = 246,
.auxiliary = 0 .auxiliary = 0
}; };
(*FurnaceRecipes_addFurnaceRecipe)(recipes, 49, &result); FurnaceRecipes_addFurnaceRecipe(recipes, 49, &result);
} }
// Init // Init

View File

@ -15,10 +15,10 @@ static void ItemRenderer_renderGuiItemCorrect_injection(Font *font, Textures *te
bool use_carried = false; bool use_carried = false;
if (item_instance != NULL) { if (item_instance != NULL) {
if (item_instance->id == leaves_id) { if (item_instance->id == leaves_id) {
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, Tile_leaves_carried, item_instance->count, item_instance->auxiliary); ItemInstance_constructor_tile_extra(&carried_item_instance, Tile_leaves_carried, item_instance->count, item_instance->auxiliary);
use_carried = true; use_carried = true;
} else if (item_instance->id == grass_id) { } else if (item_instance->id == grass_id) {
(*ItemInstance_constructor_tile_extra)(&carried_item_instance, Tile_grass_carried, item_instance->count, item_instance->auxiliary); ItemInstance_constructor_tile_extra(&carried_item_instance, Tile_grass_carried, item_instance->count, item_instance->auxiliary);
use_carried = true; use_carried = true;
} }
} }
@ -28,7 +28,7 @@ static void ItemRenderer_renderGuiItemCorrect_injection(Font *font, Textures *te
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
// Call Original Method // Call Original Method
(*ItemRenderer_renderGuiItemCorrect)(font, textures, use_carried ? &carried_item_instance : item_instance, param_1, param_2); ItemRenderer_renderGuiItemCorrect(font, textures, use_carried ? &carried_item_instance : item_instance, param_1, param_2);
// Revert GL State Changes // Revert GL State Changes
if (depth_test_was_enabled) { if (depth_test_was_enabled) {
@ -55,28 +55,28 @@ static void Tesselator_color_injection(Tesselator *tesselator, int32_t r, int32_
} }
// Call Original Method // Call Original Method
(*Tesselator_color)(tesselator, r, g, b, a); Tesselator_color(tesselator, r, g, b, a);
} }
static void Tesselator_begin_injection(Tesselator *tesselator, int32_t mode) { static void Tesselator_begin_injection(Tesselator *tesselator, int32_t mode) {
// Call Original Method // Call Original Method
(*Tesselator_begin)(tesselator, mode); Tesselator_begin(tesselator, mode);
// Fix Furnace UI // Fix Furnace UI
if (item_color_fix_mode != 0) { if (item_color_fix_mode != 0) {
// Implict Translucent // Implict Translucent
(*Tesselator_color_injection)(tesselator, 0xff, 0xff, 0xff, 0xff); Tesselator_color_injection(tesselator, 0xff, 0xff, 0xff, 0xff);
} }
} }
static void InventoryPane_renderBatch_Tesselator_color_injection(Tesselator *tesselator, int32_t r, int32_t g, int32_t b) { static void InventoryPane_renderBatch_Tesselator_color_injection(Tesselator *tesselator, int32_t r, int32_t g, int32_t b) {
// Call Original Method // Call Original Method
(*Tesselator_color)(tesselator, r, g, b, 0xff); Tesselator_color(tesselator, r, g, b, 0xff);
// Enable Item Color Fix // Enable Item Color Fix
item_color_fix_mode = 2; item_color_fix_mode = 2;
} }
static void ItemRenderer_renderGuiItem_two_injection(Font *font, Textures *textures, ItemInstance *item_instance, float param_1, float param_2, float param_3, float param_4, bool param_5) { static void ItemRenderer_renderGuiItem_two_injection(Font *font, Textures *textures, ItemInstance *item_instance, float param_1, float param_2, float param_3, float param_4, bool param_5) {
// Call Original Method // Call Original Method
(*ItemRenderer_renderGuiItem_two)(font, textures, item_instance, param_1, param_2, param_3, param_4, param_5); ItemRenderer_renderGuiItem_two(font, textures, item_instance, param_1, param_2, param_3, param_4, param_5);
// Disable Item Color Fix // Disable Item Color Fix
item_color_fix_mode = 0; item_color_fix_mode = 0;
@ -86,7 +86,7 @@ static void FurnaceScreen_render_ItemRenderer_renderGuiItem_one_injection(Font *
item_color_fix_mode = 1; item_color_fix_mode = 1;
// Call Original Method // Call Original Method
(*ItemRenderer_renderGuiItem_one)(font, textures, item_instance, param_1, param_2, param_3); ItemRenderer_renderGuiItem_one(font, textures, item_instance, param_1, param_2, param_3);
} }
// Init // Init

View File

@ -46,7 +46,7 @@ static void start_world(Minecraft *minecraft) {
settings.seed = BENCHMARK_SEED; settings.seed = BENCHMARK_SEED;
// Delete World If It Already Exists // Delete World If It Already Exists
LevelStorageSource *level_source = (*Minecraft_getLevelSource)(minecraft); LevelStorageSource *level_source = Minecraft_getLevelSource(minecraft);
std::string name = BENCHMARK_WORLD_NAME; std::string name = BENCHMARK_WORLD_NAME;
level_source->vtable->deleteLevel(level_source, &name); level_source->vtable->deleteLevel(level_source, &name);
@ -56,8 +56,8 @@ static void start_world(Minecraft *minecraft) {
// Open ProgressScreen // Open ProgressScreen
ProgressScreen *screen = alloc_ProgressScreen(); ProgressScreen *screen = alloc_ProgressScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);
screen = (*ProgressScreen_constructor)(screen); screen = ProgressScreen_constructor(screen);
(*Minecraft_setScreen)(minecraft, (Screen *) screen); Minecraft_setScreen(minecraft, (Screen *) screen);
} }
// Track Frames // Track Frames
@ -65,7 +65,7 @@ static void start_world(Minecraft *minecraft) {
static unsigned long long int frames = 0; static unsigned long long int frames = 0;
HOOK(media_swap_buffers, void, ()) { HOOK(media_swap_buffers, void, ()) {
ensure_media_swap_buffers(); ensure_media_swap_buffers();
(*real_media_swap_buffers)(); real_media_swap_buffers();
frames++; frames++;
} }
#endif #endif
@ -107,7 +107,7 @@ static void Minecraft_update_injection(Minecraft *minecraft) {
} }
// Detect World Loaded // Detect World Loaded
if (!world_loaded && (*Minecraft_isLevelGenerated)(minecraft)) { if (!world_loaded && Minecraft_isLevelGenerated(minecraft)) {
world_loaded = 1; world_loaded = 1;
world_loaded_time = get_time(); world_loaded_time = get_time();
#ifndef MCPI_HEADLESS_MODE #ifndef MCPI_HEADLESS_MODE

View File

@ -60,7 +60,7 @@ static int32_t BucketItem_useOn(__attribute__((unused)) Item *item, ItemInstance
} }
} }
if (success) { if (success) {
(*Level_setTileAndData)(level, x, y, z, 0, 0); Level_setTileAndData(level, x, y, z, 0, 0);
return 1; return 1;
} else { } else {
return 0; return 0;
@ -107,7 +107,7 @@ static int32_t BucketItem_useOn(__attribute__((unused)) Item *item, ItemInstance
valid = false; valid = false;
} }
if (valid) { if (valid) {
(*Level_setTileAndData)(level, x, y, z, item_instance->auxiliary, 0); Level_setTileAndData(level, x, y, z, item_instance->auxiliary, 0);
item_instance->auxiliary = 0; item_instance->auxiliary = 0;
return 1; return 1;
} else { } else {
@ -137,7 +137,7 @@ static Item *create_bucket(int32_t id, int32_t texture_x, int32_t texture_y, std
// Construct // Construct
Item *item = alloc_Item(); Item *item = alloc_Item();
ALLOC_CHECK(item); ALLOC_CHECK(item);
(*Item_constructor)(item, id); Item_constructor(item, id);
// Set VTable // Set VTable
item->vtable = get_bucket_vtable(); item->vtable = get_bucket_vtable();
@ -164,7 +164,7 @@ static int32_t ItemInstance_getMaxStackSize_injection(ItemInstance *item_instanc
return 16; return 16;
} else { } else {
// Call Original Method // Call Original Method
return (*ItemInstance_getMaxStackSize)(item_instance); return ItemInstance_getMaxStackSize(item_instance);
} }
} }
@ -172,8 +172,8 @@ static int32_t ItemInstance_getMaxStackSize_injection(ItemInstance *item_instanc
static void inventory_add_item(FillingContainer *inventory, Item *item, int32_t auxiliary) { static void inventory_add_item(FillingContainer *inventory, Item *item, int32_t auxiliary) {
ItemInstance *item_instance = new ItemInstance; ItemInstance *item_instance = new ItemInstance;
ALLOC_CHECK(item_instance); ALLOC_CHECK(item_instance);
item_instance = (*ItemInstance_constructor_item_extra)(item_instance, item, 1, auxiliary); item_instance = ItemInstance_constructor_item_extra(item_instance, item, 1, auxiliary);
(*FillingContainer_addItem)(inventory, item_instance); FillingContainer_addItem(inventory, item_instance);
} }
static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container) { static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container) {
inventory_add_item(filling_container, bucket, 0); inventory_add_item(filling_container, bucket, 0);
@ -185,7 +185,7 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
static bool is_holding_bucket = false; static bool is_holding_bucket = false;
static HitResult Mob_pick_Level_clip_injection(Level *level, unsigned char *param_1, unsigned char *param_2, __attribute__((unused)) bool clip_liquids, bool param_3) { static HitResult Mob_pick_Level_clip_injection(Level *level, unsigned char *param_1, unsigned char *param_2, __attribute__((unused)) bool clip_liquids, bool param_3) {
// Call Original Method // Call Original Method
return (*Level_clip)(level, param_1, param_2, is_holding_bucket, param_3); return Level_clip(level, param_1, param_2, is_holding_bucket, param_3);
} }
static void handle_tick(Minecraft *minecraft) { static void handle_tick(Minecraft *minecraft) {
LocalPlayer *player = minecraft->player; LocalPlayer *player = minecraft->player;
@ -225,7 +225,7 @@ static void Minecraft_handleMouseDown_injection(Minecraft *minecraft, int param_
} }
// Call Original Method // Call Original Method
(*Minecraft_handleMouseDown)(minecraft, param_1, can_destroy); Minecraft_handleMouseDown(minecraft, param_1, can_destroy);
} }
// Custom Crafting Recipes // Custom Crafting Recipes
@ -249,7 +249,7 @@ static void Recipes_injection(Recipes *recipes) {
std::string line1 = "# #"; std::string line1 = "# #";
std::string line2 = " # "; std::string line2 = " # ";
std::vector<Recipes_Type> types = {type1}; std::vector<Recipes_Type> types = {type1};
(*Recipes_addShapedRecipe_2)(recipes, &result, &line1, &line2, &types); Recipes_addShapedRecipe_2(recipes, &result, &line1, &line2, &types);
} }
// Custom Furnace Fuel // Custom Furnace Fuel
@ -258,7 +258,7 @@ static int32_t FurnaceTileEntity_getBurnDuration_injection(ItemInstance *item_in
return 20000; return 20000;
} else { } else {
// Call Original Method // Call Original Method
return (*FurnaceTileEntity_getBurnDuration)(item_instance); return FurnaceTileEntity_getBurnDuration(item_instance);
} }
} }
static void FurnaceTileEntity_tick_ItemInstance_setNull_injection(ItemInstance *item_instance) { static void FurnaceTileEntity_tick_ItemInstance_setNull_injection(ItemInstance *item_instance) {

View File

@ -16,13 +16,13 @@ static void AppPlatform_linux_saveScreenshot_injection(__attribute__((unused)) A
// Enable TripodCameraRenderer // Enable TripodCameraRenderer
static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDispatcher *dispatcher) { static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDispatcher *dispatcher) {
// Call Original Method // Call Original Method
(*EntityRenderDispatcher_constructor)(dispatcher); EntityRenderDispatcher_constructor(dispatcher);
// Register TripodCameraRenderer // Register TripodCameraRenderer
TripodCameraRenderer *renderer = alloc_TripodCameraRenderer(); TripodCameraRenderer *renderer = alloc_TripodCameraRenderer();
ALLOC_CHECK(renderer); ALLOC_CHECK(renderer);
(*TripodCameraRenderer_constructor)(renderer); TripodCameraRenderer_constructor(renderer);
(*EntityRenderDispatcher_assign)(dispatcher, (unsigned char) 0x5, (EntityRenderer *) renderer); EntityRenderDispatcher_assign(dispatcher, (unsigned char) 0x5, (EntityRenderer *) renderer);
return dispatcher; return dispatcher;
} }
@ -30,7 +30,7 @@ static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDisp
// Display Smoke From TripodCamera Higher // Display Smoke From TripodCamera Higher
static void TripodCamera_tick_Level_addParticle_call_injection(Level *level, std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) { static void TripodCamera_tick_Level_addParticle_call_injection(Level *level, std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) {
// Call Original Method // Call Original Method
(*Level_addParticle)(level, particle, x, y + 0.5, z, deltaX, deltaY, deltaZ, count); Level_addParticle(level, particle, x, y + 0.5, z, deltaX, deltaY, deltaZ, count);
} }
// Init // Init

View File

@ -36,7 +36,7 @@ std::string chat_send_api_command(Minecraft *minecraft, std::string str) {
client.time = 0; client.time = 0;
CommandServer *command_server = minecraft->command_server; CommandServer *command_server = minecraft->command_server;
if (command_server != NULL) { if (command_server != NULL) {
return (*CommandServer_parse)(command_server, &client, &str); return CommandServer_parse(command_server, &client, &str);
} else { } else {
return ""; return "";
} }
@ -59,7 +59,7 @@ void chat_send_message(ServerSideNetworkHandler *server_side_network_handler, ch
sanitize_string(&full_message, MAX_CHAT_MESSAGE_LENGTH, 0); sanitize_string(&full_message, MAX_CHAT_MESSAGE_LENGTH, 0);
std::string cpp_string = full_message; std::string cpp_string = full_message;
free(full_message); free(full_message);
(*ServerSideNetworkHandler_displayGameMessage)(server_side_network_handler, &cpp_string); ServerSideNetworkHandler_displayGameMessage(server_side_network_handler, &cpp_string);
} }
// Handle Chat packet Send // Handle Chat packet Send
void chat_handle_packet_send(Minecraft *minecraft, ChatPacket *packet) { void chat_handle_packet_send(Minecraft *minecraft, ChatPacket *packet) {
@ -85,7 +85,7 @@ static void CommandServer_parse_CommandServer_dispatchPacket_injection(CommandSe
// Handle ChatPacket Server-Side // Handle ChatPacket Server-Side
static void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *rak_net_guid, ChatPacket *chat_packet) { static void ServerSideNetworkHandler_handle_ChatPacket_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *rak_net_guid, ChatPacket *chat_packet) {
Player *player = (*ServerSideNetworkHandler_getPlayer)(server_side_network_handler, rak_net_guid); Player *player = ServerSideNetworkHandler_getPlayer(server_side_network_handler, rak_net_guid);
if (player != NULL) { if (player != NULL) {
const char *username = player->username.c_str(); const char *username = player->username.c_str();
char *message = chat_packet->message; char *message = chat_packet->message;

View File

@ -22,14 +22,14 @@
// Custom Title // Custom Title
HOOK(SDL_WM_SetCaption, void, (__attribute__((unused)) const char *title, const char *icon)) { HOOK(SDL_WM_SetCaption, void, (__attribute__((unused)) const char *title, const char *icon)) {
ensure_SDL_WM_SetCaption(); ensure_SDL_WM_SetCaption();
(*real_SDL_WM_SetCaption)(MCPI_APP_TITLE, icon); real_SDL_WM_SetCaption(MCPI_APP_TITLE, icon);
} }
// Mouse Cursor Is Always Invisible In Vanilla MCPI // Mouse Cursor Is Always Invisible In Vanilla MCPI
// Because In Vanilla MCPI, The GPU Overlay Covered The Normal Mouse Cursor // Because In Vanilla MCPI, The GPU Overlay Covered The Normal Mouse Cursor
HOOK(SDL_ShowCursor, int, (int toggle)) { HOOK(SDL_ShowCursor, int, (int toggle)) {
ensure_SDL_ShowCursor(); ensure_SDL_ShowCursor();
return (*real_SDL_ShowCursor)(toggle == SDL_QUERY ? SDL_QUERY : SDL_DISABLE); return real_SDL_ShowCursor(toggle == SDL_QUERY ? SDL_QUERY : SDL_DISABLE);
} }
// Intercept SDL Events // Intercept SDL Events
@ -47,7 +47,7 @@ HOOK(SDL_PollEvent, int, (SDL_Event *event)) {
// Poll Events // Poll Events
ensure_SDL_PollEvent(); ensure_SDL_PollEvent();
int ret = (*real_SDL_PollEvent)(event); int ret = real_SDL_PollEvent(event);
// Handle Events // Handle Events
if (ret == 1 && event != NULL) { if (ret == 1 && event != NULL) {

View File

@ -11,14 +11,14 @@
static void inventory_add_item(FillingContainer *inventory, Item *item) { static void inventory_add_item(FillingContainer *inventory, Item *item) {
ItemInstance *item_instance = new ItemInstance; ItemInstance *item_instance = new ItemInstance;
ALLOC_CHECK(item_instance); ALLOC_CHECK(item_instance);
item_instance = (*ItemInstance_constructor_item)(item_instance, item); item_instance = ItemInstance_constructor_item(item_instance, item);
(*FillingContainer_addItem)(inventory, item_instance); FillingContainer_addItem(inventory, item_instance);
} }
static void inventory_add_item(FillingContainer *inventory, Tile *item) { static void inventory_add_item(FillingContainer *inventory, Tile *item) {
ItemInstance *item_instance = new ItemInstance; ItemInstance *item_instance = new ItemInstance;
ALLOC_CHECK(item_instance); ALLOC_CHECK(item_instance);
item_instance = (*ItemInstance_constructor_tile)(item_instance, item); item_instance = ItemInstance_constructor_tile(item_instance, item);
(*FillingContainer_addItem)(inventory, item_instance); FillingContainer_addItem(inventory, item_instance);
} }
// Expand Creative Inventory // Expand Creative Inventory
@ -36,8 +36,8 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
} }
ItemInstance *new_item_instance = new ItemInstance; ItemInstance *new_item_instance = new ItemInstance;
ALLOC_CHECK(new_item_instance); ALLOC_CHECK(new_item_instance);
new_item_instance = (*ItemInstance_constructor_item_extra)(new_item_instance, Item_dye_powder, 1, i); new_item_instance = ItemInstance_constructor_item_extra(new_item_instance, Item_dye_powder, 1, i);
(*FillingContainer_addItem)(filling_container, new_item_instance); FillingContainer_addItem(filling_container, new_item_instance);
} }
inventory_add_item(filling_container, Item_camera); inventory_add_item(filling_container, Item_camera);
// Add Tiles // Add Tiles
@ -61,8 +61,8 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
} }
ItemInstance *new_item_instance = new ItemInstance; ItemInstance *new_item_instance = new ItemInstance;
ALLOC_CHECK(new_item_instance); ALLOC_CHECK(new_item_instance);
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_netherReactor, 1, i); new_item_instance = ItemInstance_constructor_tile_extra(new_item_instance, Tile_netherReactor, 1, i);
(*FillingContainer_addItem)(filling_container, new_item_instance); FillingContainer_addItem(filling_container, new_item_instance);
} }
// Tall Grass // Tall Grass
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -72,15 +72,15 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
} }
ItemInstance *new_item_instance = new ItemInstance; ItemInstance *new_item_instance = new ItemInstance;
ALLOC_CHECK(new_item_instance); ALLOC_CHECK(new_item_instance);
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_tallgrass, 1, i); new_item_instance = ItemInstance_constructor_tile_extra(new_item_instance, Tile_tallgrass, 1, i);
(*FillingContainer_addItem)(filling_container, new_item_instance); FillingContainer_addItem(filling_container, new_item_instance);
} }
// Smooth Stone Slab // Smooth Stone Slab
{ {
ItemInstance *new_item_instance = new ItemInstance; ItemInstance *new_item_instance = new ItemInstance;
ALLOC_CHECK(new_item_instance); ALLOC_CHECK(new_item_instance);
new_item_instance = (*ItemInstance_constructor_tile_extra)(new_item_instance, Tile_stoneSlab, 1, 6); new_item_instance = ItemInstance_constructor_tile_extra(new_item_instance, Tile_stoneSlab, 1, 6);
(*FillingContainer_addItem)(filling_container, new_item_instance); FillingContainer_addItem(filling_container, new_item_instance);
} }
} }
#endif #endif
@ -88,7 +88,7 @@ static void Inventory_setupDefault_FillingContainer_addItem_call_injection(Filli
// Hook Specific TileItem Constructor // Hook Specific TileItem Constructor
static TileItem *Tile_initTiles_TileItem_injection(TileItem *tile_item, int32_t id) { static TileItem *Tile_initTiles_TileItem_injection(TileItem *tile_item, int32_t id) {
// Call Original Method // Call Original Method
(*TileItem_constructor)(tile_item, id); TileItem_constructor(tile_item, id);
// Switch VTable // Switch VTable
tile_item->vtable = (TileItem_vtable *) AuxDataTileItem_vtable_base; tile_item->vtable = (TileItem_vtable *) AuxDataTileItem_vtable_base;

View File

@ -27,7 +27,7 @@ static std::string get_death_message(Player *player) {
int32_t old_health = player->health; \ int32_t old_health = player->health; \
\ \
/* Call Original Method */ \ /* Call Original Method */ \
(*type##Player_actuallyHurt_non_virtual)(player, damage); \ type##Player_actuallyHurt_non_virtual(player, damage); \
\ \
/* Store New Health */ \ /* Store New Health */ \
int32_t new_health = player->health; \ int32_t new_health = player->health; \
@ -44,7 +44,7 @@ static std::string get_death_message(Player *player) {
\ \
/* Post Death Message */ \ /* Post Death Message */ \
ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) minecraft->network_handler; \ ServerSideNetworkHandler *server_side_network_handler = (ServerSideNetworkHandler *) minecraft->network_handler; \
(*ServerSideNetworkHandler_displayGameMessage)(server_side_network_handler, &message); \ ServerSideNetworkHandler_displayGameMessage(server_side_network_handler, &message); \
} \ } \
} \ } \
} }

View File

@ -32,7 +32,7 @@ static void Minecraft_setIsCreativeMode_injection(Minecraft *this, int32_t new_g
set_is_survival(!new_game_mode); set_is_survival(!new_game_mode);
// Call Original Method // Call Original Method
(*Minecraft_setIsCreativeMode)(this, new_game_mode); Minecraft_setIsCreativeMode(this, new_game_mode);
} }
// Disable CreatorMode-Specific API Features (Polling Block Hits) In SurvivalMode, This Is Preferable To Crashing // Disable CreatorMode-Specific API Features (Polling Block Hits) In SurvivalMode, This Is Preferable To Crashing
@ -42,7 +42,7 @@ static unsigned char *Minecraft_getCreator_injection(Minecraft *minecraft) {
return NULL; return NULL;
} else { } else {
// CreatorMode, Call Original Method // CreatorMode, Call Original Method
return (*Minecraft_getCreator)(minecraft); return Minecraft_getCreator(minecraft);
} }
} }

View File

@ -230,13 +230,13 @@ static void create_world(Screen *host_screen, std::string folder_name) {
minecraft->vtable->selectLevel(minecraft, &folder_name, &world_name, &settings); minecraft->vtable->selectLevel(minecraft, &folder_name, &world_name, &settings);
// Multiplayer // Multiplayer
(*Minecraft_hostMultiplayer)(minecraft, 19132); Minecraft_hostMultiplayer(minecraft, 19132);
// Open ProgressScreen // Open ProgressScreen
ProgressScreen *screen = alloc_ProgressScreen(); ProgressScreen *screen = alloc_ProgressScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);
screen = (*ProgressScreen_constructor)(screen); screen = ProgressScreen_constructor(screen);
(*Minecraft_setScreen)(minecraft, (Screen *) screen); Minecraft_setScreen(minecraft, (Screen *) screen);
// Reset // Reset
reset_create_world_state(); reset_create_world_state();
@ -260,7 +260,7 @@ static void create_world(Screen *host_screen, std::string folder_name) {
*should_create_world = false; \ *should_create_world = false; \
} else { \ } else { \
/* Call Original Method */ \ /* Call Original Method */ \
(*prefix##SelectWorldScreen_tick_non_virtual)(screen); \ prefix##SelectWorldScreen_tick_non_virtual(screen); \
} \ } \
\ \
/* Create World If Dialog Succeeded */ \ /* Create World If Dialog Succeeded */ \
@ -269,7 +269,7 @@ static void create_world(Screen *host_screen, std::string folder_name) {
\ \
/* Get New World Name */ \ /* Get New World Name */ \
std::string name = (char *) create_world_state.name; \ std::string name = (char *) create_world_state.name; \
std::string new_name = (*prefix##SelectWorldScreen_getUniqueLevelName)(screen, &name); \ std::string new_name = prefix##SelectWorldScreen_getUniqueLevelName(screen, &name); \
\ \
/* Create World */ \ /* Create World */ \
create_world((Screen *) screen, new_name); \ create_world((Screen *) screen, new_name); \

View File

@ -16,7 +16,7 @@ void input_set_is_left_click(int val) {
// Add Attacking To MouseBuildInput // Add Attacking To MouseBuildInput
static int32_t MouseBuildInput_tickBuild_injection(MouseBuildInput *mouse_build_input, Player *local_player, uint32_t *build_action_intention_return) { static int32_t MouseBuildInput_tickBuild_injection(MouseBuildInput *mouse_build_input, Player *local_player, uint32_t *build_action_intention_return) {
// Call Original Method // Call Original Method
int32_t ret = (*MouseBuildInput_tickBuild_non_virtual)(mouse_build_input, local_player, build_action_intention_return); int32_t ret = MouseBuildInput_tickBuild_non_virtual(mouse_build_input, local_player, build_action_intention_return);
// Use Attack/Place BuildActionIntention If No Other Valid BuildActionIntention Was Selected And This Was Not A Repeated Left Click // Use Attack/Place BuildActionIntention If No Other Valid BuildActionIntention Was Selected And This Was Not A Repeated Left Click
if (ret != 0 && is_left_click == 1 && *build_action_intention_return == 0xa) { if (ret != 0 && is_left_click == 1 && *build_action_intention_return == 0xa) {
@ -49,7 +49,7 @@ static ItemInstance *Player_attack_Inventory_getSelected_injection(Inventory *in
} }
// Call Original Method // Call Original Method
return (*Inventory_getSelected)(inventory); return Inventory_getSelected(inventory);
} }
// Init // Init

View File

@ -19,7 +19,7 @@ static void _handle_bow(Minecraft *minecraft) {
if (fix_bow && !is_right_click) { if (fix_bow && !is_right_click) {
GameMode *game_mode = minecraft->game_mode; GameMode *game_mode = minecraft->game_mode;
LocalPlayer *player = minecraft->player; LocalPlayer *player = minecraft->player;
if (player != NULL && game_mode != NULL && (*LocalPlayer_isUsingItem)(player)) { if (player != NULL && game_mode != NULL && LocalPlayer_isUsingItem(player)) {
game_mode->vtable->releaseUsingItem(game_mode, (Player *) player); game_mode->vtable->releaseUsingItem(game_mode, (Player *) player);
} }
} }

View File

@ -15,11 +15,11 @@ static void _handle_open_crafting(Minecraft *minecraft) {
should_open_crafting = 0; should_open_crafting = 0;
// Set Screen // Set Screen
if (!creative_is_restricted() || !(*Minecraft_isCreativeMode)(minecraft)) { if (!creative_is_restricted() || !Minecraft_isCreativeMode(minecraft)) {
WorkbenchScreen *screen = alloc_WorkbenchScreen(); WorkbenchScreen *screen = alloc_WorkbenchScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);
screen = (*WorkbenchScreen_constructor)(screen, 0); screen = WorkbenchScreen_constructor(screen, 0);
(*Minecraft_setScreen)(minecraft, (Screen *) screen); Minecraft_setScreen(minecraft, (Screen *) screen);
} }
} }
} }

View File

@ -25,7 +25,7 @@ void input_drop(int drop_slot) {
// Handle Drop Item Presses // Handle Drop Item Presses
static void _handle_drop(Minecraft *minecraft) { static void _handle_drop(Minecraft *minecraft) {
if ((minecraft->screen == NULL) && (!creative_is_restricted() || !(*Minecraft_isCreativeMode)(minecraft)) && (drop_item_presses > 0 || drop_slot_pressed)) { if ((minecraft->screen == NULL) && (!creative_is_restricted() || !Minecraft_isCreativeMode(minecraft)) && (drop_item_presses > 0 || drop_slot_pressed)) {
// Get Player // Get Player
LocalPlayer *player = minecraft->player; LocalPlayer *player = minecraft->player;
if (player != NULL) { if (player != NULL) {
@ -59,8 +59,8 @@ static void _handle_drop(Minecraft *minecraft) {
// Empty Slot If Needed // Empty Slot If Needed
if (inventory_item->count < 1) { if (inventory_item->count < 1) {
(*Inventory_release)(inventory, selected_slot); Inventory_release(inventory, selected_slot);
(*Inventory_compressLinkedSlotList)(inventory, selected_slot); Inventory_compressLinkedSlotList(inventory, selected_slot);
} }
// Drop // Drop

View File

@ -21,11 +21,11 @@ void input_run_on_tick(input_tick_function_t function) {
// Handle Input Fixes // Handle Input Fixes
static void Minecraft_tickInput_injection(Minecraft *minecraft) { static void Minecraft_tickInput_injection(Minecraft *minecraft) {
// Call Original Method // Call Original Method
(*Minecraft_tickInput)(minecraft); Minecraft_tickInput(minecraft);
// Run Input Tick Functions // Run Input Tick Functions
for (input_tick_function_t function : get_input_tick_functions()) { for (input_tick_function_t function : get_input_tick_functions()) {
(*function)(minecraft); function(minecraft);
} }
} }

View File

@ -38,7 +38,7 @@ static void _handle_back(Minecraft *minecraft) {
static int32_t OptionsScreen_handleBackEvent_injection(OptionsScreen *screen, bool do_nothing) { static int32_t OptionsScreen_handleBackEvent_injection(OptionsScreen *screen, bool do_nothing) {
if (!do_nothing) { if (!do_nothing) {
Minecraft *minecraft = screen->minecraft; Minecraft *minecraft = screen->minecraft;
(*Minecraft_setScreen)(minecraft, NULL); Minecraft_setScreen(minecraft, NULL);
} }
return 1; return 1;
} }
@ -48,7 +48,7 @@ static int32_t InBedScreen_handleBackEvent_injection(InBedScreen *screen, bool d
if (!do_nothing) { if (!do_nothing) {
// Close Screen // Close Screen
Minecraft *minecraft = screen->minecraft; Minecraft *minecraft = screen->minecraft;
(*Minecraft_setScreen)(minecraft, NULL); Minecraft_setScreen(minecraft, NULL);
// Stop Sleeping // Stop Sleeping
LocalPlayer *player = minecraft->player; LocalPlayer *player = minecraft->player;
if (player != NULL) { if (player != NULL) {
@ -68,10 +68,10 @@ void input_set_mouse_grab_state(int state) {
static void _handle_mouse_grab(Minecraft *minecraft) { static void _handle_mouse_grab(Minecraft *minecraft) {
if (mouse_grab_state == -1) { if (mouse_grab_state == -1) {
// Grab // Grab
(*Minecraft_grabMouse)(minecraft); Minecraft_grabMouse(minecraft);
} else if (mouse_grab_state == 1) { } else if (mouse_grab_state == 1) {
// Un-Grab // Un-Grab
(*Minecraft_releaseMouse)(minecraft); Minecraft_releaseMouse(minecraft);
} }
mouse_grab_state = 0; mouse_grab_state = 0;
} }
@ -82,7 +82,7 @@ static void _handle_mouse_grab(Minecraft *minecraft) {
static bool Gui_tickItemDrop_Minecraft_isCreativeMode_call_injection(Minecraft *minecraft) { static bool Gui_tickItemDrop_Minecraft_isCreativeMode_call_injection(Minecraft *minecraft) {
if (!enable_misc || SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) { if (!enable_misc || SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) {
// Call Original Method // Call Original Method
return creative_is_restricted() && (*Minecraft_isCreativeMode)(minecraft); return creative_is_restricted() && Minecraft_isCreativeMode(minecraft);
} else { } else {
// Disable Item Drop Ticking // Disable Item Drop Ticking
return 1; return 1;
@ -93,7 +93,7 @@ static bool Gui_tickItemDrop_Minecraft_isCreativeMode_call_injection(Minecraft *
static void Gui_handleClick_injection(Gui *gui, int32_t param_2, int32_t param_3, int32_t param_4) { static void Gui_handleClick_injection(Gui *gui, int32_t param_2, int32_t param_3, int32_t param_4) {
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) { if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) {
// Call Original Method // Call Original Method
(*Gui_handleClick)(gui, param_2, param_3, param_4); Gui_handleClick(gui, param_2, param_3, param_4);
} }
} }

View File

@ -75,7 +75,7 @@ static void GameRenderer_setupCamera_injection(GameRenderer *game_renderer, floa
} }
// Call Original Method // Call Original Method
(*GameRenderer_setupCamera)(game_renderer, param_1, param_2); GameRenderer_setupCamera(game_renderer, param_1, param_2);
// Revert // Revert
if (is_front_facing) { if (is_front_facing) {
@ -89,7 +89,7 @@ static void ParticleEngine_render_injection(ParticleEngine *particle_engine, Ent
} }
// Call Original Method // Call Original Method
(*ParticleEngine_render)(particle_engine, entity, param_2); ParticleEngine_render(particle_engine, entity, param_2);
// Revert // Revert
if (is_front_facing && (Entity *) stored_player == entity) { if (is_front_facing && (Entity *) stored_player == entity) {

View File

@ -14,7 +14,7 @@ static std::vector<misc_update_function_##type##_t> &get_misc_##name##_functions
} \ } \
static void handle_misc_##name(type *obj) { \ static void handle_misc_##name(type *obj) { \
for (misc_update_function_##type##_t function : get_misc_##name##_functions()) { \ for (misc_update_function_##type##_t function : get_misc_##name##_functions()) { \
(*function)(obj); \ function(obj); \
} \ } \
} \ } \
void misc_run_on_##name(misc_update_function_##type##_t function) { \ void misc_run_on_##name(misc_update_function_##type##_t function) { \
@ -26,7 +26,7 @@ SETUP_CALLBACK(update, Minecraft);
// Handle Custom Update Behavior // Handle Custom Update Behavior
static void Minecraft_update_injection(Minecraft *minecraft) { static void Minecraft_update_injection(Minecraft *minecraft) {
// Call Original Method // Call Original Method
(*Minecraft_update_non_virtual)(minecraft); Minecraft_update_non_virtual(minecraft);
// Run Functions // Run Functions
handle_misc_update(minecraft); handle_misc_update(minecraft);
@ -37,7 +37,7 @@ SETUP_CALLBACK(tick, Minecraft);
// Handle Custom Tick Behavior // Handle Custom Tick Behavior
static void Minecraft_tick_injection(Minecraft *minecraft, int32_t param_1, int32_t param_2) { static void Minecraft_tick_injection(Minecraft *minecraft, int32_t param_1, int32_t param_2) {
// Call Original Method // Call Original Method
(*Minecraft_tick)(minecraft, param_1, param_2); Minecraft_tick(minecraft, param_1, param_2);
// Run Functions // Run Functions
handle_misc_tick(minecraft); handle_misc_tick(minecraft);
@ -48,7 +48,7 @@ SETUP_CALLBACK(recipes_setup, Recipes);
// Handle Custom Recipes Setup Behavior // Handle Custom Recipes Setup Behavior
static Recipes *Recipes_injection(Recipes *recipes) { static Recipes *Recipes_injection(Recipes *recipes) {
// Call Original Method // Call Original Method
(*Recipes_constructor)(recipes); Recipes_constructor(recipes);
// Run Functions // Run Functions
handle_misc_recipes_setup(recipes); handle_misc_recipes_setup(recipes);
@ -62,7 +62,7 @@ SETUP_CALLBACK(furnace_recipes_setup, FurnaceRecipes);
// Handle Custom Furnace Recipes Setup Behavior // Handle Custom Furnace Recipes Setup Behavior
static FurnaceRecipes *FurnaceRecipes_injection(FurnaceRecipes *recipes) { static FurnaceRecipes *FurnaceRecipes_injection(FurnaceRecipes *recipes) {
// Call Original Method // Call Original Method
(*FurnaceRecipes_constructor)(recipes); FurnaceRecipes_constructor(recipes);
// Run Functions // Run Functions
handle_misc_furnace_recipes_setup(recipes); handle_misc_furnace_recipes_setup(recipes);
@ -76,7 +76,7 @@ SETUP_CALLBACK(creative_inventory_setup, FillingContainer);
// Handle Custom Creative Inventory Setup Behavior // Handle Custom Creative Inventory Setup Behavior
static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container, ItemInstance *item_instance) { static void Inventory_setupDefault_FillingContainer_addItem_call_injection(FillingContainer *filling_container, ItemInstance *item_instance) {
// Call Original Method // Call Original Method
(*FillingContainer_addItem)(filling_container, item_instance); FillingContainer_addItem(filling_container, item_instance);
// Run Functions // Run Functions
handle_misc_creative_inventory_setup(filling_container); handle_misc_creative_inventory_setup(filling_container);
} }
@ -89,7 +89,7 @@ static void Tile_initTiles_injection() {
handle_misc_tiles_setup(NULL); handle_misc_tiles_setup(NULL);
// Call Original Method // Call Original Method
(*Tile_initTiles)(); Tile_initTiles();
} }
// Run Functions On Items Setup // Run Functions On Items Setup
@ -100,7 +100,7 @@ static void Item_initItems_injection() {
handle_misc_items_setup(NULL); handle_misc_items_setup(NULL);
// Call Original Method // Call Original Method
(*Item_initItems)(); Item_initItems();
} }
// Init // Init

View File

@ -26,13 +26,13 @@ static void Gui_addMessage_injection(Gui *gui, std::string *text) {
free(safe_message); free(safe_message);
// Call Original Method // Call Original Method
(*Gui_addMessage)(gui, &cpp_str); Gui_addMessage(gui, &cpp_str);
// End Recursing // End Recursing
Gui_addMessage_recursing = false; Gui_addMessage_recursing = false;
} else { } else {
// Call Original Method // Call Original Method
(*Gui_addMessage)(gui, &cpp_str); Gui_addMessage(gui, &cpp_str);
} }
// Free // Free
@ -47,9 +47,9 @@ void misc_add_message(Gui *gui, const char *text) {
static int last_progress = -1; static int last_progress = -1;
static const char *last_message = NULL; static const char *last_message = NULL;
static void print_progress(Minecraft *minecraft) { static void print_progress(Minecraft *minecraft) {
const char *message = (*Minecraft_getProgressMessage)(minecraft); const char *message = Minecraft_getProgressMessage(minecraft);
int32_t progress = minecraft->progress; int32_t progress = minecraft->progress;
if ((*Minecraft_isLevelGenerated)(minecraft)) { if (Minecraft_isLevelGenerated(minecraft)) {
message = "Ready"; message = "Ready";
progress = -1; progress = -1;
} }
@ -84,7 +84,7 @@ void Level_saveLevelData_injection(Level *level) {
DEBUG("Saving Game"); DEBUG("Saving Game");
// Call Original Method // Call Original Method
(*Level_saveLevelData)(level); Level_saveLevelData(level);
} }
// Init // Init

View File

@ -38,7 +38,7 @@ static void Gui_renderHearts_GuiComponent_blit_hearts_injection(Gui *component,
y_dest -= DEFAULT_HUD_PADDING; y_dest -= DEFAULT_HUD_PADDING;
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING; y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING;
// Call Original Method // Call Original Method
(*Gui_blit)(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src); Gui_blit(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src);
} }
static void Gui_renderHearts_GuiComponent_blit_armor_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) { static void Gui_renderHearts_GuiComponent_blit_armor_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) {
Minecraft *minecraft = component->minecraft; Minecraft *minecraft = component->minecraft;
@ -49,7 +49,7 @@ static void Gui_renderHearts_GuiComponent_blit_armor_injection(Gui *component, i
y_dest -= DEFAULT_HUD_PADDING; y_dest -= DEFAULT_HUD_PADDING;
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING; y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - NEW_HUD_PADDING;
// Call Original Method // Call Original Method
(*Gui_blit)(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src); Gui_blit(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src);
} }
static void Gui_renderBubbles_GuiComponent_blit_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) { static void Gui_renderBubbles_GuiComponent_blit_injection(Gui *component, int32_t x_dest, int32_t y_dest, int32_t x_src, int32_t y_src, int32_t width_dest, int32_t height_dest, int32_t width_src, int32_t height_src) {
Minecraft *minecraft = component->minecraft; Minecraft *minecraft = component->minecraft;
@ -60,7 +60,7 @@ static void Gui_renderBubbles_GuiComponent_blit_injection(Gui *component, int32_
y_dest -= DEFAULT_HUD_PADDING + DEFAULT_BUBBLES_PADDING + HUD_ELEMENT_HEIGHT; y_dest -= DEFAULT_HUD_PADDING + DEFAULT_BUBBLES_PADDING + HUD_ELEMENT_HEIGHT;
y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - HUD_ELEMENT_HEIGHT - NEW_HUD_PADDING; y_dest += height - HUD_ELEMENT_HEIGHT - TOOLBAR_HEIGHT - HUD_ELEMENT_HEIGHT - NEW_HUD_PADDING;
// Call Original Method // Call Original Method
(*Gui_blit)(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src); Gui_blit(component, x_dest, y_dest, x_src, y_src, width_dest, height_dest, width_src, height_src);
} }
// Additional GUI Rendering // Additional GUI Rendering
@ -70,14 +70,14 @@ static void Gui_renderChatMessages_injection(Gui *gui, int32_t y_offset, uint32_
// Handle Classic HUD // Handle Classic HUD
if (use_classic_hud) { if (use_classic_hud) {
Minecraft *minecraft = gui->minecraft; Minecraft *minecraft = gui->minecraft;
if (!(*Minecraft_isCreativeMode)(minecraft)) { if (!Minecraft_isCreativeMode(minecraft)) {
y_offset -= (HUD_ELEMENT_HEIGHT * 2) + NEW_HUD_PADDING; y_offset -= (HUD_ELEMENT_HEIGHT * 2) + NEW_HUD_PADDING;
} }
} }
// Call Original Method // Call Original Method
if (!hide_chat_messages) { if (!hide_chat_messages) {
(*Gui_renderChatMessages)(gui, y_offset, max_messages, disable_fading, font); Gui_renderChatMessages(gui, y_offset, max_messages, disable_fading, font);
} }
// Render Selected Item Text // Render Selected Item Text
@ -89,14 +89,14 @@ static void Gui_renderChatMessages_injection(Gui *gui, int32_t y_offset, uint32_
int32_t screen_width = minecraft->screen_width; int32_t screen_width = minecraft->screen_width;
float scale = ((float) screen_width) * Gui_InvGuiScale; float scale = ((float) screen_width) * Gui_InvGuiScale;
// Render Selected Item Text // Render Selected Item Text
(*Gui_renderOnSelectItemNameText)(gui, (int32_t) scale, font, y_offset - 0x13); Gui_renderOnSelectItemNameText(gui, (int32_t) scale, font, y_offset - 0x13);
} }
} }
// Reset Selected Item Text Timer On Slot Select // Reset Selected Item Text Timer On Slot Select
static uint32_t reset_selected_item_text_timer = 0; static uint32_t reset_selected_item_text_timer = 0;
static void Gui_tick_injection(Gui *gui) { static void Gui_tick_injection(Gui *gui) {
// Call Original Method // Call Original Method
(*Gui_tick)(gui); Gui_tick(gui);
// Handle Reset // Handle Reset
if (render_selected_item_text) { if (render_selected_item_text) {
@ -111,7 +111,7 @@ static void Gui_tick_injection(Gui *gui) {
// Trigger Reset Selected Item Text Timer On Slot Select // Trigger Reset Selected Item Text Timer On Slot Select
static void Inventory_selectSlot_injection(Inventory *inventory, int32_t slot) { static void Inventory_selectSlot_injection(Inventory *inventory, int32_t slot) {
// Call Original Method // Call Original Method
(*Inventory_selectSlot)(inventory, slot); Inventory_selectSlot(inventory, slot);
// Trigger Reset Selected Item Text Timer // Trigger Reset Selected Item Text Timer
if (render_selected_item_text) { if (render_selected_item_text) {
@ -127,7 +127,7 @@ static void Gui_renderToolBar_injection(Gui *gui, float param_1, int32_t param_2
glEnable(GL_BLEND); glEnable(GL_BLEND);
} }
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
(*Gui_renderToolBar)(gui, param_1, param_2, param_3); Gui_renderToolBar(gui, param_1, param_2, param_3);
if (!was_blend_enabled) { if (!was_blend_enabled) {
glDisable(GL_BLEND); glDisable(GL_BLEND);
} }
@ -142,14 +142,14 @@ static void Screen_render_injection(Screen *screen, int32_t param_1, int32_t par
// Fix // Fix
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Call Original Method // Call Original Method
(*Screen_render_non_virtual)(screen, param_1, param_2, param_3); Screen_render_non_virtual(screen, param_1, param_2, param_3);
} }
// Sanitize Username // Sanitize Username
#define MAX_USERNAME_LENGTH 16 #define MAX_USERNAME_LENGTH 16
static void LoginPacket_read_injection(LoginPacket *packet, unsigned char *bit_stream) { static void LoginPacket_read_injection(LoginPacket *packet, unsigned char *bit_stream) {
// Call Original Method // Call Original Method
(*LoginPacket_read_non_virtual)(packet, bit_stream); LoginPacket_read_non_virtual(packet, bit_stream);
// Prepare // Prepare
RakNet_RakString *rak_string = &packet->username; RakNet_RakString *rak_string = &packet->username;
@ -161,7 +161,7 @@ static void LoginPacket_read_injection(LoginPacket *packet, unsigned char *bit_s
ALLOC_CHECK(new_username); ALLOC_CHECK(new_username);
sanitize_string(&new_username, MAX_USERNAME_LENGTH, 0); sanitize_string(&new_username, MAX_USERNAME_LENGTH, 0);
// Set New Username // Set New Username
(*RakNet_RakString_Assign)(rak_string, new_username); RakNet_RakString_Assign(rak_string, new_username);
// Free // Free
free(new_username); free(new_username);
} }
@ -173,7 +173,7 @@ static void LoginPacket_read_injection(LoginPacket *packet, unsigned char *bit_s
// formatting functionality. // formatting functionality.
static RakNet_RakString *RakNet_RakString_injection(RakNet_RakString *rak_string, const char *format, ...) { static RakNet_RakString *RakNet_RakString_injection(RakNet_RakString *rak_string, const char *format, ...) {
// Call Original Method // Call Original Method
return (*RakNet_RakString_constructor)(rak_string, "%s", format); return RakNet_RakString_constructor(rak_string, "%s", format);
} }
// Print Error Message If RakNet Startup Fails // Print Error Message If RakNet Startup Fails
@ -212,7 +212,7 @@ static RakNet_StartupResult RakNetInstance_host_RakNet_RakPeer_Startup_injection
// Fix Bug Where RakNetInstance Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened // Fix Bug Where RakNetInstance Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened
static RakNetInstance *RakNetInstance_injection(RakNetInstance *rak_net_instance) { static RakNetInstance *RakNetInstance_injection(RakNetInstance *rak_net_instance) {
// Call Original Method // Call Original Method
RakNetInstance *result = (*RakNetInstance_constructor)(rak_net_instance); RakNetInstance *result = RakNetInstance_constructor(rak_net_instance);
// Fix // Fix
rak_net_instance->pinging_for_hosts = 0; rak_net_instance->pinging_for_hosts = 0;
// Return // Return
@ -223,10 +223,10 @@ static RakNetInstance *RakNetInstance_injection(RakNetInstance *rak_net_instance
static void LocalPlayer_die_injection(LocalPlayer *entity, Entity *cause) { static void LocalPlayer_die_injection(LocalPlayer *entity, Entity *cause) {
// Close Screen // Close Screen
Minecraft *minecraft = entity->minecraft; Minecraft *minecraft = entity->minecraft;
(*Minecraft_setScreen)(minecraft, NULL); Minecraft_setScreen(minecraft, NULL);
// Call Original Method // Call Original Method
(*LocalPlayer_die_non_virtual)(entity, cause); LocalPlayer_die_non_virtual(entity, cause);
} }
// Fix Furnace Not Checking Item Auxiliary When Inserting New Item // Fix Furnace Not Checking Item Auxiliary When Inserting New Item
@ -254,7 +254,7 @@ static int32_t FurnaceScreen_handleAddItem_injection(FurnaceScreen *furnace_scre
// Call Original Method // Call Original Method
if (valid) { if (valid) {
// Valid // Valid
return (*FurnaceScreen_handleAddItem)(furnace_screen, slot, item); return FurnaceScreen_handleAddItem(furnace_screen, slot, item);
} else { } else {
// Invalid // Invalid
return 0; return 0;
@ -268,18 +268,18 @@ static int32_t FurnaceScreen_handleAddItem_injection(FurnaceScreen *furnace_scre
#ifndef MCPI_HEADLESS_MODE #ifndef MCPI_HEADLESS_MODE
static void GameRenderer_render_injection(GameRenderer *game_renderer, float param_1) { static void GameRenderer_render_injection(GameRenderer *game_renderer, float param_1) {
// Call Original Method // Call Original Method
(*GameRenderer_render)(game_renderer, param_1); GameRenderer_render(game_renderer, param_1);
// Check If Cursor Should Render // Check If Cursor Should Render
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) { if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) {
// Fix GL Mode // Fix GL Mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Get X And Y // Get X And Y
float x = (*Mouse_getX)() * Gui_InvGuiScale; float x = Mouse_getX() * Gui_InvGuiScale;
float y = (*Mouse_getY)() * Gui_InvGuiScale; float y = Mouse_getY() * Gui_InvGuiScale;
// Render Cursor // Render Cursor
Minecraft *minecraft = game_renderer->minecraft; Minecraft *minecraft = game_renderer->minecraft;
(*Common_renderCursor)(x, y, minecraft); Common_renderCursor(x, y, minecraft);
} }
} }
#endif #endif
@ -310,7 +310,7 @@ static void anGenBuffers_injection(int32_t count, uint32_t *buffers) {
// Fix Graphics Bug When Switching To First-Person While Sneaking // Fix Graphics Bug When Switching To First-Person While Sneaking
static void HumanoidMobRenderer_render_injection(HumanoidMobRenderer *model_renderer, Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) { static void HumanoidMobRenderer_render_injection(HumanoidMobRenderer *model_renderer, Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) {
(*HumanoidMobRenderer_render_non_virtual)(model_renderer, entity, param_2, param_3, param_4, param_5, param_6); HumanoidMobRenderer_render_non_virtual(model_renderer, entity, param_2, param_3, param_4, param_5, param_6);
HumanoidModel *model = model_renderer->model; HumanoidModel *model = model_renderer->model;
model->is_sneaking = 0; model->is_sneaking = 0;
} }
@ -331,7 +331,7 @@ HOOK(bind, int, (int sockfd, const struct sockaddr *addr, socklen_t addrlen)) {
new_addr = (const struct sockaddr *) &in_addr; new_addr = (const struct sockaddr *) &in_addr;
} }
ensure_bind(); ensure_bind();
return (*real_bind)(sockfd, new_addr, addrlen); return real_bind(sockfd, new_addr, addrlen);
} }
// Change Grass Color // Change Grass Color
@ -365,7 +365,7 @@ static int32_t GrassTile_getColor_injection(__attribute__((unused)) Tile *tile,
return (r_avg << 16) | (g_avg << 8) | b_avg; return (r_avg << 16) | (g_avg << 8) | b_avg;
} }
static int32_t TallGrass_getColor_injection(TallGrass *tile, LevelSource *level_source, int32_t x, int32_t y, int32_t z) { static int32_t TallGrass_getColor_injection(TallGrass *tile, LevelSource *level_source, int32_t x, int32_t y, int32_t z) {
int32_t original_color = (*TallGrass_getColor_non_virtual)(tile, level_source, x, y, z); int32_t original_color = TallGrass_getColor_non_virtual(tile, level_source, x, y, z);
if (original_color == 0x339933) { if (original_color == 0x339933) {
return GrassTile_getColor_injection((Tile *) tile, level_source, x, y, z); return GrassTile_getColor_injection((Tile *) tile, level_source, x, y, z);
} else { } else {
@ -376,7 +376,7 @@ static int32_t TallGrass_getColor_injection(TallGrass *tile, LevelSource *level_
// Generate Caves // Generate Caves
static void RandomLevelSource_buildSurface_injection(RandomLevelSource *random_level_source, int32_t chunk_x, int32_t chunk_y, unsigned char *chunk_data, Biome **biomes) { static void RandomLevelSource_buildSurface_injection(RandomLevelSource *random_level_source, int32_t chunk_x, int32_t chunk_y, unsigned char *chunk_data, Biome **biomes) {
// Call Original Method // Call Original Method
(*RandomLevelSource_buildSurface)(random_level_source, chunk_x, chunk_y, chunk_data, biomes); RandomLevelSource_buildSurface(random_level_source, chunk_x, chunk_y, chunk_data, biomes);
// Get Level // Get Level
Level *level = random_level_source->level; Level *level = random_level_source->level;
@ -428,7 +428,7 @@ static int32_t Tile_getRenderShape_injection(Tile *tile) {
} }
static ChestTileEntity *ChestTileEntity_injection(ChestTileEntity *tile_entity) { static ChestTileEntity *ChestTileEntity_injection(ChestTileEntity *tile_entity) {
// Call Original Method // Call Original Method
(*ChestTileEntity_constructor)(tile_entity); ChestTileEntity_constructor(tile_entity);
// Enable Renderer // Enable Renderer
tile_entity->renderer_id = 1; tile_entity->renderer_id = 1;
@ -442,7 +442,7 @@ static void ModelPart_render_injection(ModelPart *model_part, float scale) {
is_rendering_chest = 1; is_rendering_chest = 1;
// Call Original Method // Call Original Method
(*ModelPart_render)(model_part, scale); ModelPart_render(model_part, scale);
// Stop // Stop
is_rendering_chest = 0; is_rendering_chest = 0;
@ -454,7 +454,7 @@ static void Tesselator_vertexUV_injection(Tesselator *tesselator, float x, float
} }
// Call Original Method // Call Original Method
(*Tesselator_vertexUV)(tesselator, x, y, z, u, v); Tesselator_vertexUV(tesselator, x, y, z, u, v);
} }
static bool ChestTileEntity_shouldSave_injection(__attribute__((unused)) unsigned char *tile_entity) { static bool ChestTileEntity_shouldSave_injection(__attribute__((unused)) unsigned char *tile_entity) {
return 1; return 1;
@ -463,7 +463,7 @@ static bool ChestTileEntity_shouldSave_injection(__attribute__((unused)) unsigne
// Animated 3D Chest // Animated 3D Chest
static ContainerMenu *ContainerMenu_injection(ContainerMenu *container_menu, Container *container, int32_t param_1) { static ContainerMenu *ContainerMenu_injection(ContainerMenu *container_menu, Container *container, int32_t param_1) {
// Call Original Method // Call Original Method
(*ContainerMenu_constructor)(container_menu, container, param_1); ContainerMenu_constructor(container_menu, container, param_1);
// Play Animation // Play Animation
ChestTileEntity *tile_entity = (ChestTileEntity *) (((unsigned char *) container) - offsetof(ChestTileEntity, container)); ChestTileEntity *tile_entity = (ChestTileEntity *) (((unsigned char *) container) - offsetof(ChestTileEntity, container));
@ -485,7 +485,7 @@ static unsigned char *ContainerMenu_destructor_injection(ContainerMenu *containe
} }
// Call Original Method // Call Original Method
return (*ContainerMenu_destructor_non_virtual)(container_menu); return ContainerMenu_destructor_non_virtual(container_menu);
} }
#ifndef MCPI_HEADLESS_MODE #ifndef MCPI_HEADLESS_MODE

View File

@ -38,7 +38,7 @@ static AppPlatform_readAssetFile_return_value AppPlatform_readAssetFile_injectio
// Add Missing Buttons To Pause Menu // Add Missing Buttons To Pause Menu
static void PauseScreen_init_injection(PauseScreen *screen) { static void PauseScreen_init_injection(PauseScreen *screen) {
// Call Original Method // Call Original Method
(*PauseScreen_init_non_virtual)(screen); PauseScreen_init_non_virtual(screen);
// Check If Server // Check If Server
Minecraft *minecraft = screen->minecraft; Minecraft *minecraft = screen->minecraft;
@ -53,7 +53,7 @@ static void PauseScreen_init_injection(PauseScreen *screen) {
selectable_buttons->push_back(button); selectable_buttons->push_back(button);
// Update Button Text // Update Button Text
(*PauseScreen_updateServerVisibilityText)(screen); PauseScreen_updateServerVisibilityText(screen);
} }
} }
} }

View File

@ -115,7 +115,7 @@ static void iterate_servers(std::function<void(const char *address, int port)> c
// Ping External Servers // Ping External Servers
static void RakNetInstance_pingForHosts_injection(RakNetInstance *rak_net_instance, int32_t base_port) { static void RakNetInstance_pingForHosts_injection(RakNetInstance *rak_net_instance, int32_t base_port) {
// Call Original Method // Call Original Method
(*RakNetInstance_pingForHosts_non_virtual)(rak_net_instance, base_port); RakNetInstance_pingForHosts_non_virtual(rak_net_instance, base_port);
// Get RakNet::RakPeer // Get RakNet::RakPeer
RakNet_RakPeer *rak_peer = rak_net_instance->peer; RakNet_RakPeer *rak_peer = rak_net_instance->peer;

View File

@ -49,7 +49,7 @@ static int render_distance;
Options *stored_options = NULL; Options *stored_options = NULL;
static void Options_initDefaultValue_injection(Options *options) { static void Options_initDefaultValue_injection(Options *options) {
// Call Original Method // Call Original Method
(*Options_initDefaultValue)(options); Options_initDefaultValue(options);
// Default Graphics Settings // Default Graphics Settings
#ifndef MCPI_SERVER_MODE #ifndef MCPI_SERVER_MODE
@ -62,7 +62,7 @@ static void Options_initDefaultValue_injection(Options *options) {
} }
static void Minecraft_init_injection(Minecraft *minecraft) { static void Minecraft_init_injection(Minecraft *minecraft) {
// Call Original Method // Call Original Method
(*Minecraft_init_non_virtual)(minecraft); Minecraft_init_non_virtual(minecraft);
Options *options = &minecraft->options; Options *options = &minecraft->options;
// Enable Crosshair In Touch GUI // Enable Crosshair In Touch GUI
@ -77,7 +77,7 @@ static void TileRenderer_tesselateBlockInWorld_injection(TileRenderer *tile_rend
Minecraft_useAmbientOcclusion = stored_options->ambient_occlusion; Minecraft_useAmbientOcclusion = stored_options->ambient_occlusion;
// Call Original Method // Call Original Method
(*TileRenderer_tesselateBlockInWorld)(tile_renderer, tile, x, y, z); TileRenderer_tesselateBlockInWorld(tile_renderer, tile, x, y, z);
} }
// Init // Init

View File

@ -15,10 +15,10 @@
// The calling function doesn't exist in MCPE v0.6.1, so its name is unknown. // The calling function doesn't exist in MCPE v0.6.1, so its name is unknown.
static OptionButton *OptionsPane_unknown_toggle_creating_function_OptionButton_injection(OptionButton *option_button, Options_Option *option) { static OptionButton *OptionsPane_unknown_toggle_creating_function_OptionButton_injection(OptionButton *option_button, Options_Option *option) {
// Call Original Method // Call Original Method
OptionButton *ret = (*OptionButton_constructor)(option_button, option); OptionButton *ret = OptionButton_constructor(option_button, option);
// Setup Image // Setup Image
(*OptionButton_updateImage)(option_button, stored_options); OptionButton_updateImage(option_button, stored_options);
// Return // Return
return ret; return ret;
@ -28,17 +28,17 @@ static OptionButton *OptionsPane_unknown_toggle_creating_function_OptionButton_i
// Hook Last Options::addOptionToSaveOutput Call // Hook Last Options::addOptionToSaveOutput Call
static void Options_save_Options_addOptionToSaveOutput_injection(Options *options, std::vector<std::string> *data, std::string option, int32_t value) { static void Options_save_Options_addOptionToSaveOutput_injection(Options *options, std::vector<std::string> *data, std::string option, int32_t value) {
// Call Original Method // Call Original Method
(*Options_addOptionToSaveOutput)(options, data, option, value); Options_addOptionToSaveOutput(options, data, option, value);
// Save Fancy Graphics // Save Fancy Graphics
(*Options_addOptionToSaveOutput)(options, data, "gfx_fancygraphics", options->fancy_graphics); Options_addOptionToSaveOutput(options, data, "gfx_fancygraphics", options->fancy_graphics);
// Save 3D Anaglyph // Save 3D Anaglyph
(*Options_addOptionToSaveOutput)(options, data, "gfx_anaglyph", options->anaglyph_3d); Options_addOptionToSaveOutput(options, data, "gfx_anaglyph", options->anaglyph_3d);
// Save File // Save File
OptionsFile *options_file = &options->options_file; OptionsFile *options_file = &options->options_file;
(*OptionsFile_save)(options_file, data); OptionsFile_save(options_file, data);
} }
// MCPI's OptionsFile::getOptionStrings is broken, this is the version in v0.7.0 // MCPI's OptionsFile::getOptionStrings is broken, this is the version in v0.7.0
@ -120,12 +120,12 @@ static void OptionsPane_unknown_toggle_creating_function_injection(OptionsPane *
} }
// Call Original Method // Call Original Method
(*OptionsPane_unknown_toggle_creating_function)(options_pane, group_id, &new_name, option); OptionsPane_unknown_toggle_creating_function(options_pane, group_id, &new_name, option);
// Add 3D Anaglyph // Add 3D Anaglyph
if (option == &Options_Option_GRAPHICS) { if (option == &Options_Option_GRAPHICS) {
std::string cpp_string = "3D Anaglyph"; std::string cpp_string = "3D Anaglyph";
(*OptionsPane_unknown_toggle_creating_function)(options_pane, group_id, &cpp_string, &Options_Option_ANAGLYPH); OptionsPane_unknown_toggle_creating_function(options_pane, group_id, &cpp_string, &Options_Option_ANAGLYPH);
} }
} }
@ -136,7 +136,7 @@ static bool Options_getBooleanValue_injection(Options *options, Options_Option *
return options->fancy_graphics; return options->fancy_graphics;
} else { } else {
// Call Original Method // Call Original Method
return (*Options_getBooleanValue)(options, option); return Options_getBooleanValue(options, option);
} }
} }

View File

@ -16,7 +16,7 @@ HOOK(access, int, (const char *pathname, int mode)) {
char *new_path = override_get_path(pathname); char *new_path = override_get_path(pathname);
// Open File // Open File
ensure_access(); ensure_access();
int ret = (*real_access)(new_path != NULL ? new_path : pathname, mode); int ret = real_access(new_path != NULL ? new_path : pathname, mode);
// Free Data // Free Data
if (new_path != NULL) { if (new_path != NULL) {
free(new_path); free(new_path);
@ -58,7 +58,7 @@ char *override_get_path(const char *filename) {
for (int i = 0; asset_folders[i] != NULL; i++) { for (int i = 0; asset_folders[i] != NULL; i++) {
safe_asprintf(&new_path, "%s/%s", asset_folders[i], &filename[data_prefix_length]); safe_asprintf(&new_path, "%s/%s", asset_folders[i], &filename[data_prefix_length]);
ensure_access(); ensure_access();
if ((*real_access)(new_path, F_OK) == -1) { if (real_access(new_path, F_OK) == -1) {
// Not Found In Asset Folder // Not Found In Asset Folder
free(new_path); free(new_path);
new_path = NULL; new_path = NULL;
@ -82,7 +82,7 @@ HOOK(fopen, FILE *, (const char *filename, const char *mode)) {
char *new_path = override_get_path(filename); char *new_path = override_get_path(filename);
// Open File // Open File
ensure_fopen(); ensure_fopen();
FILE *file = (*real_fopen)(new_path != NULL ? new_path : filename, mode); FILE *file = real_fopen(new_path != NULL ? new_path : filename, mode);
// Free Data // Free Data
if (new_path != NULL) { if (new_path != NULL) {
free(new_path); free(new_path);
@ -96,7 +96,7 @@ HOOK(fopen64, FILE *, (const char *filename, const char *mode)) {
char *new_path = override_get_path(filename); char *new_path = override_get_path(filename);
// Open File // Open File
ensure_fopen64(); ensure_fopen64();
FILE *file = (*real_fopen64)(new_path != NULL ? new_path : filename, mode); FILE *file = real_fopen64(new_path != NULL ? new_path : filename, mode);
// Free Data // Free Data
if (new_path != NULL) { if (new_path != NULL) {
free(new_path); free(new_path);

View File

@ -99,14 +99,14 @@ static void start_world(Minecraft *minecraft) {
// Open Port // Open Port
int port = get_server_properties().get_int("port", DEFAULT_PORT); int port = get_server_properties().get_int("port", DEFAULT_PORT);
INFO("Listening On: %i", port); INFO("Listening On: %i", port);
(*Minecraft_hostMultiplayer)(minecraft, port); Minecraft_hostMultiplayer(minecraft, port);
} }
// Open ProgressScreen // Open ProgressScreen
ProgressScreen *screen = alloc_ProgressScreen(); ProgressScreen *screen = alloc_ProgressScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);
screen = (*ProgressScreen_constructor)(screen); screen = ProgressScreen_constructor(screen);
(*Minecraft_setScreen)(minecraft, (Screen *) screen); Minecraft_setScreen(minecraft, (Screen *) screen);
} }
// Check If Running In Whitelist Mode // Check If Running In Whitelist Mode
@ -149,7 +149,7 @@ static void find_players(Minecraft *minecraft, std::string target_username, play
std::string username = get_player_username(player); std::string username = get_player_username(player);
if (all_players || username == target_username) { if (all_players || username == target_username) {
// Run Callback // Run Callback
(*callback)(minecraft, username, player); callback(minecraft, username, player);
found_player = true; found_player = true;
} }
} }
@ -172,7 +172,7 @@ static RakNet_RakPeer *get_rak_peer(Minecraft *minecraft) {
static char *get_rak_net_guid_ip(RakNet_RakPeer *rak_peer, RakNet_RakNetGUID guid) { static char *get_rak_net_guid_ip(RakNet_RakPeer *rak_peer, RakNet_RakNetGUID guid) {
RakNet_SystemAddress address = get_system_address(rak_peer, guid); RakNet_SystemAddress address = get_system_address(rak_peer, guid);
// Get IP // Get IP
return (*RakNet_SystemAddress_ToString)(&address, false, '|'); return RakNet_SystemAddress_ToString(&address, false, '|');
} }
// Get IP From Player // Get IP From Player
@ -225,7 +225,7 @@ static void handle_server_stop(Minecraft *minecraft) {
if (level != NULL) { if (level != NULL) {
Level_saveLevelData_injection(level); Level_saveLevelData_injection(level);
} }
(*Minecraft_leaveGame)(minecraft, false); Minecraft_leaveGame(minecraft, false);
// Stop Game // Stop Game
SDL_Event event; SDL_Event event;
event.type = SDL_QUIT; event.type = SDL_QUIT;
@ -301,7 +301,7 @@ __attribute__((destructor)) static void _free_stdin_buffer() {
// Handle Commands // Handle Commands
static void handle_commands(Minecraft *minecraft) { static void handle_commands(Minecraft *minecraft) {
// Check If Level Is Generated // Check If Level Is Generated
if ((*Minecraft_isLevelGenerated)(minecraft) && stdin_buffer_complete) { if (Minecraft_isLevelGenerated(minecraft) && stdin_buffer_complete) {
// Command Ready; Run It // Command Ready; Run It
if (stdin_buffer != NULL) { if (stdin_buffer != NULL) {
ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft); ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft);
@ -333,7 +333,7 @@ static void handle_commands(Minecraft *minecraft) {
char *safe_message = to_cp437(message.c_str()); char *safe_message = to_cp437(message.c_str());
std::string cpp_string = safe_message; std::string cpp_string = safe_message;
// Post Message To Chat // Post Message To Chat
(*ServerSideNetworkHandler_displayGameMessage)(server_side_network_handler, &cpp_string); ServerSideNetworkHandler_displayGameMessage(server_side_network_handler, &cpp_string);
// Free // Free
free(safe_message); free(safe_message);
} else if (data == list_command) { } else if (data == list_command) {
@ -381,7 +381,7 @@ static void Minecraft_update_injection(Minecraft *minecraft) {
} }
// Handle --only-generate // Handle --only-generate
if (only_generate && (*Minecraft_isLevelGenerated)(minecraft)) { if (only_generate && Minecraft_isLevelGenerated(minecraft)) {
// Request Exit // Request Exit
compat_request_exit(); compat_request_exit();
// Disable Special Behavior After Requesting Exit // Disable Special Behavior After Requesting Exit
@ -446,7 +446,7 @@ static bool RakNet_RakPeer_IsBanned_injection(__attribute__((unused)) unsigned c
// Log IPs // Log IPs
static Player *ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *guid) { static Player *ServerSideNetworkHandler_onReady_ClientGeneration_ServerSideNetworkHandler_popPendingPlayer_injection(ServerSideNetworkHandler *server_side_network_handler, RakNet_RakNetGUID *guid) {
// Call Original Method // Call Original Method
Player *player = (*ServerSideNetworkHandler_popPendingPlayer)(server_side_network_handler, guid); Player *player = ServerSideNetworkHandler_popPendingPlayer(server_side_network_handler, guid);
// Check If Player Is Null // Check If Player Is Null
if (player != NULL) { if (player != NULL) {

View File

@ -15,7 +15,7 @@ static int32_t sdl_key_to_minecraft_key_injection(int32_t sdl_key) {
return 8; return 8;
} else { } else {
// Call Original Method // Call Original Method
return (*Common_sdl_key_to_minecraft_key)(sdl_key); return Common_sdl_key_to_minecraft_key(sdl_key);
} }
} }
@ -25,8 +25,8 @@ static void LocalPlayer_openTextEdit_injection(LocalPlayer *local_player, TileEn
Minecraft *minecraft = local_player->minecraft; Minecraft *minecraft = local_player->minecraft;
TextEditScreen *screen = alloc_TextEditScreen(); TextEditScreen *screen = alloc_TextEditScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);
screen = (*TextEditScreen_constructor)(screen, (SignTileEntity *) sign); screen = TextEditScreen_constructor(screen, (SignTileEntity *) sign);
(*Minecraft_setScreen)(minecraft, (Screen *) screen); Minecraft_setScreen(minecraft, (Screen *) screen);
} }
} }
@ -42,7 +42,7 @@ static void clear_input(__attribute__((unused)) Minecraft *minecraft) {
// Handle Text Input // Handle Text Input
static void TextEditScreen_updateEvents_injection(TextEditScreen *screen) { static void TextEditScreen_updateEvents_injection(TextEditScreen *screen) {
// Call Original Method // Call Original Method
(*TextEditScreen_updateEvents_non_virtual)(screen); TextEditScreen_updateEvents_non_virtual(screen);
if (!screen->passthrough_input) { if (!screen->passthrough_input) {
for (char key : input) { for (char key : input) {

View File

@ -116,7 +116,7 @@ static void *loader_thread(void *user_data) {
// Intercept Texture Creation // Intercept Texture Creation
static int32_t Textures_assignTexture_injection(Textures *textures, std::string *name, unsigned char *data) { static int32_t Textures_assignTexture_injection(Textures *textures, std::string *name, unsigned char *data) {
// Call Original Method // Call Original Method
int32_t id = (*Textures_assignTexture)(textures, name, data); int32_t id = Textures_assignTexture(textures, name, data);
// Load Skin // Load Skin
if (starts_with(name->c_str(), "$")) { if (starts_with(name->c_str(), "$")) {

View File

@ -74,7 +74,7 @@ static int32_t Textures_loadAndBindTexture_injection(Textures *textures, __attri
} }
// Call Original Method // Call Original Method
return (*Textures_loadAndBindTexture)(textures, &new_texture); return Textures_loadAndBindTexture(textures, &new_texture);
} }
// Init // Init

View File

@ -106,7 +106,7 @@ static void SoundEngine_update_injection(SoundEngine *sound_engine, Mob *listene
// SoundEngine::init Is Called After The Audio Engine Has Been Loaded // SoundEngine::init Is Called After The Audio Engine Has Been Loaded
static void SoundEngine_init_injection(SoundEngine *sound_engine, Minecraft *minecraft, Options *options) { static void SoundEngine_init_injection(SoundEngine *sound_engine, Minecraft *minecraft, Options *options) {
// Call Original Method // Call Original Method
(*SoundEngine_init)(sound_engine, minecraft, options); SoundEngine_init(sound_engine, minecraft, options);
// Resolve Sounds // Resolve Sounds
_sound_resolve_all(); _sound_resolve_all();

View File

@ -19,7 +19,7 @@ static void Minecraft_tick_injection(Minecraft *minecraft) {
// Tick Dynamic Textures // Tick Dynamic Textures
Textures *textures = minecraft->textures; Textures *textures = minecraft->textures;
if (textures != NULL) { if (textures != NULL) {
(*Textures_tick)(textures, true); Textures_tick(textures, true);
} }
} }
@ -43,7 +43,7 @@ HOOK(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsi
// Call Original Method // Call Original Method
ensure_glTexImage2D(); ensure_glTexImage2D();
(*real_glTexImage2D)(target, level, internalformat, width, height, border, format, type, pixels); real_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
} }
HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) { HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) {
// Remove Old Data // Remove Old Data
@ -62,7 +62,7 @@ HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) {
// Call Original Method // Call Original Method
ensure_glDeleteTextures(); ensure_glDeleteTextures();
(*real_glDeleteTextures)(n, textures); real_glDeleteTextures(n, textures);
} }
static void get_texture_size(GLint id, GLsizei *width, GLsizei *height) { static void get_texture_size(GLint id, GLsizei *width, GLsizei *height) {
// Iterate // Iterate

View File

@ -11,14 +11,14 @@ static void StartMenuScreen_render_Screen_renderBackground_injection(StartMenuSc
Minecraft *minecraft = screen->minecraft; Minecraft *minecraft = screen->minecraft;
Textures *textures = minecraft->textures; Textures *textures = minecraft->textures;
std::string texture = "gui/titleBG.png"; std::string texture = "gui/titleBG.png";
(*Textures_loadAndBindTexture)(textures, &texture); Textures_loadAndBindTexture(textures, &texture);
(*StartMenuScreen_blit)(screen, 0, 0, 0, 0, screen->width, screen->height, 0x100, 0x100); StartMenuScreen_blit(screen, 0, 0, 0, 0, screen->width, screen->height, 0x100, 0x100);
} }
// Add Buttons Back To Classic Start Screen // Add Buttons Back To Classic Start Screen
static void StartMenuScreen_init_injection(StartMenuScreen *screen) { static void StartMenuScreen_init_injection(StartMenuScreen *screen) {
// Call Original Method // Call Original Method
(*StartMenuScreen_init_non_virtual)(screen); StartMenuScreen_init_non_virtual(screen);
// Add Button // Add Button
std::vector<Button *> *rendered_buttons = &screen->rendered_buttons; std::vector<Button *> *rendered_buttons = &screen->rendered_buttons;
@ -39,7 +39,7 @@ static void StartMenuScreen_buttonClicked_injection(StartMenuScreen *screen, But
compat_request_exit(); compat_request_exit();
} else { } else {
// Call Original Method // Call Original Method
(*StartMenuScreen_buttonClicked_non_virtual)(screen, button); StartMenuScreen_buttonClicked_non_virtual(screen, button);
} }
} }

View File

@ -18,8 +18,8 @@ static unsigned char *operator_new_IngameBlockSelectionScreen_injection(__attrib
// Improved Button Hover Behavior // Improved Button Hover Behavior
static int32_t Button_hovered_injection(__attribute__((unused)) Button *button, __attribute__((unused)) Minecraft *minecraft, __attribute__((unused)) int32_t click_x, __attribute__((unused)) int32_t click_y) { static int32_t Button_hovered_injection(__attribute__((unused)) Button *button, __attribute__((unused)) Minecraft *minecraft, __attribute__((unused)) int32_t click_x, __attribute__((unused)) int32_t click_y) {
// Get Mouse Position // Get Mouse Position
int32_t x = (*Mouse_getX)() * Gui_InvGuiScale; int32_t x = Mouse_getX() * Gui_InvGuiScale;
int32_t y = (*Mouse_getY)() * Gui_InvGuiScale; int32_t y = Mouse_getY() * Gui_InvGuiScale;
// Get Button Position // Get Button Position
int32_t button_x1 = button->x; int32_t button_x1 = button->x;
@ -37,7 +37,7 @@ static void LargeImageButton_render_GuiComponent_drawCenteredString_injection(Gu
} }
// Call Original Method // Call Original Method
(*GuiComponent_drawCenteredString)(component, font, text, x, y, color); GuiComponent_drawCenteredString(component, font, text, x, y, color);
} }
// Init // Init