cyclopsmc / commoncapabilitiesapi Goto Github PK
View Code? Open in Web Editor NEWThe public API for CommonCapabilities
License: MIT License
The public API for CommonCapabilities
License: MIT License
When org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch.areItemStackTagsEqual
is 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.
This should invert the complete matcher semantics.
CommonCapabilitiesAPI/capability/inventorystate/IInventoryState.java
Lines 14 to 16 in 6fb398a
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.)
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:
Cause now it doesn't even matter what I pass :p
@Override
public ItemStack extractItem(@Nonnull ItemStack matchStack, int matchFlags, boolean simulate) {
int slot = getNonEmptySlotWithItemStack(matchStack, ItemMatch.DAMAGE | ItemMatch.NBT);
if (slot < 0) return null;
return itemHandler.extractItem(slot, matchStack.stackSize, simulate);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.