Giter VIP home page Giter VIP logo

Comments (3)

Majrusz avatar Majrusz commented on September 8, 2024 1

You are right, I replaced that code as it has the exact same meaning but it becomes compatible with Vitalize mod 6d588d2 (it still should be fixed in Vitalize mod to avoid compatibility issues with other mods). Anyway thanks for the report, I will release 4.1.0 version within few days and once it is released I will close this report

from majruszlibrary.

Majrusz avatar Majrusz commented on September 8, 2024

Hi, thanks for the report but I am afraid that there is no reason to fix it in my mod. All parameters are checked before I access them over here:

return this.context.hasParam( parameter ) ? this.context.getParam( parameter ) : null;
and for some reason Vitalize mod always returns true for minecraft:last_damage_player even if it is undefined over here:
https://github.com/terrarium-earth/Vitalize/blob/1.19/common/src/main/java/earth/terrarium/vitalize/api/ModifiedLootContext.java#L60

from majruszlibrary.

SiverDX avatar SiverDX commented on September 8, 2024

Might be to make certain loot drop, not sure

Apotheosis is doing this, had no issues with it so far:
https://github.com/Shadows-of-Fire/Apotheosis/blob/0ad17e2c2b47eb94967e29019c987ddc0d9d240d/src/main/java/shadows/apotheosis/adventure/loot/GemLootPoolEntry.java#L92

See:

public <T> T getParam(LootContextParam<T> lootContextParam) {
    T object = this.params.get(lootContextParam);
    if (object == null) {
        throw new NoSuchElementException(lootContextParam.getName().toString());
    } else {
        return object;
    }
}
@Nullable
public <T> T getParamOrNull(LootContextParam<T> lootContextParam) {
    return this.params.get(lootContextParam);
}

from majruszlibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.