Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perlin Lib not compatible with MUD2 #935

Closed
bitzoic opened this issue May 20, 2023 · 2 comments · Fixed by #934
Closed

Perlin Lib not compatible with MUD2 #935

bitzoic opened this issue May 20, 2023 · 2 comments · Fixed by #934

Comments

@bitzoic
Copy link

bitzoic commented May 20, 2023

Description

Currently, MUD2 does not play nicely with public libraries. The functions in the Perlin.sol file all have public modifiers.

Motivation

Inability to use Perlin noise in systems.

Minimal Repro

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import { System } from "@latticexyz/world/src/System.sol";
import { Perlin } from "@latticexyz/noise/contracts/Perlin.sol";

contract MySystem is System {

    function callsPerlin(int256 positionX, int256 positionY) public pure returns (uint256) {
        int128 perlinNoise = Perlin.noise2d(positionX, positionY, 0, 0);
    }
}
@alvrs
Copy link
Member

alvrs commented May 20, 2023

fixed in #934, you can update your project to the latest MUD with pnpm mud:up (assuming you started from a template)

@bitzoic
Copy link
Author

bitzoic commented May 20, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants