Giter VIP home page Giter VIP logo

commoncapabilitiesapi's People

Contributors

josephcsible avatar rubensworks avatar tomylobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

commoncapabilitiesapi's Issues

Null pointer exception in ItemMatch.java

When org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch.areItemStackTagsEqualis passed arguments such that a.getTagCompound() != null && b.getTagCompound() == null this results in NBT_COMPARATOR.compare being called with a null argument, which it does not support and leads to a null pointer exception followed by a crash.

Name "hash" is misleading

* If inventory contents change, this method is guaranteed to return a different result.
* A different hash does however not necessarily guarantee an inventory change
* but it should in most cases since callers might gate expensive logic behind hash changes.

In general, hashes are guaranteed to be the same if the underlying state is the same, but not guaranteed to be different if the underlying state is different. We're asking for the exact opposite of this here. To avoid confusion, we should probably rename this to "nonce" or "revision ID" or something else that's not "hash". (Obviously, changing the method name is a breaking change that needs to wait for 1.13, but the comment can be reworded any time.)

Freshly built Energy Batteries aren't handled very well

  1. Sometimes the Storage Terminal doesn't show them
  2. If it does show them, it doesn't allow extracting them
  3. When creating a recipe for them using the JEI recipe transfer feature (the little "+" button), that recipe cannot be crafted:
    image
  4. When crafting a manually created recipe, the system doesn't recognize the result
  5. Crafting chains involving those batteries are nearly impossible to make due to this

I did some analysis with CraftTweaker's "/ct nbt" command and the difference between the recipes created manually and using JEI recipe transfer is this:
JEI recipe transfer:

{
    _type: "valuetype",
     typeName: "valuetype.valuetypes.integrateddynamics.recipe.name",
     _id: 256,
     value: "{output:{\"minecraft:itemstack\":[{id:\"integrateddynamics:energy_battery\",Count:1b,Damage:0s}]},input:{\"minecraft:itemstack\":[{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"minecraft:redstone_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b}]}}"
}

manually created:

{
    _type: "valuetype",
     typeName: "valuetype.valuetypes.integrateddynamics.recipe.name",
     _id: 759,
     value: "{output:{\"minecraft:itemstack\":[{id:\"integrateddynamics:energy_battery\",Count:1b,tag:{},Damage:0s}]},input:{\"minecraft:itemstack\":[{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"minecraft:redstone_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_block\",Count:1b,Damage:0s}}],type:0b},{val:[{condition:3,prototype:{id:\"integrateddynamics:crystalized_menril_chunk\",Count:1b,Damage:0s}}],type:0b}]}}"
}

The only difference between them is the tag:{}, in the output.

I think JEI just enters what it sees in the actual recipe definition as the output, whereas any actually existing battery would already have the empty tag in place.

Proposed solution:

  1. Make the recipe create a battery with the "energy" tag already initialized to 0, thus avoiding confusing between having an empty tag container and no tag container
  2. For good measure, ensure that JEI-cheated items also contain that tag

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.