Skip to content

Commit

Permalink
remove old recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed Oct 16, 2024
1 parent 80fb477 commit 3fa5162
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions packages/world/script/Upgrade.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Unstable_CallWithSignatureSystem } from "@latticexyz/world-modules/src/
import { DELEGATION_SYSTEM_ID } from "@latticexyz/world-modules/src/modules/callwithsignature/constants.sol";
import { Recipes } from "../src/codegen/tables/Recipes.sol";
import { ChestMetadata, ChestMetadataData } from "../src/codegen/tables/ChestMetadata.sol";
import { BedrockObjectID, ChestObjectID, AnyReinforcedLumberObjectID, CoalOreObjectID, ChipBatteryObjectID } from "../src/ObjectTypeIds.sol";
import { BedrockObjectID, ChestObjectID, AnyReinforcedLumberObjectID, SandObjectID, CoalOreObjectID, ChipBatteryObjectID, GlassObjectID, StoneObjectID, QuartziteObjectID, LimestoneObjectID, EmberstoneObjectID, MoonstoneObjectID, SunstoneObjectID } from "../src/ObjectTypeIds.sol";

import { IERC165 } from "@latticexyz/store/src/IERC165.sol";

Expand Down Expand Up @@ -46,10 +46,32 @@ contract Upgrade is Script {
// IWorld(worldAddress).initThermoblastObjectTypes();
// IWorld(worldAddress).initThermoblastRecipes();

bytes32 recipeId = keccak256(abi.encodePacked(CoalOreObjectID, uint8(4), ChipBatteryObjectID, uint8(1)));
bytes32 recipeId1 = keccak256(abi.encodePacked(CoalOreObjectID, uint8(1), ChipBatteryObjectID, uint8(1)));
bytes32 recipeId2 = keccak256(
abi.encodePacked(SandObjectID, uint8(2), CoalOreObjectID, uint8(1), GlassObjectID, uint8(1))
);
bytes32 recipeId3 = keccak256(
abi.encodePacked(StoneObjectID, uint8(4), CoalOreObjectID, uint8(4), EmberstoneObjectID, uint8(4))
);
bytes32 recipeId4 = keccak256(
abi.encodePacked(QuartziteObjectID, uint8(4), CoalOreObjectID, uint8(4), MoonstoneObjectID, uint8(4))
);
bytes32 recipeId5 = keccak256(
abi.encodePacked(LimestoneObjectID, uint8(4), CoalOreObjectID, uint8(4), SunstoneObjectID, uint8(4))
);

console.log("recipe");
console.logUint(Recipes.getOutputObjectTypeId(recipeId));
// Recipes.deleteRecord(recipeId);
console.logUint(Recipes.getOutputObjectTypeId(recipeId1));
console.logUint(Recipes.getOutputObjectTypeId(recipeId2));
console.logUint(Recipes.getOutputObjectTypeId(recipeId3));
console.logUint(Recipes.getOutputObjectTypeId(recipeId4));
console.logUint(Recipes.getOutputObjectTypeId(recipeId5));

// Recipes.deleteRecord(recipeId1);
// Recipes.deleteRecord(recipeId2);
// Recipes.deleteRecord(recipeId3);
// Recipes.deleteRecord(recipeId4);
// Recipes.deleteRecord(recipeId5);

// bytes32[] memory entityIds = new bytes32[](2);
// entityIds[0] = 0x00000000000000000000000000000000000000000000000000000000000005fe;
Expand Down

0 comments on commit 3fa5162

Please sign in to comment.