mirror of
https://github.com/GTNewHorizons/Nodal-Mechanics.git
synced 2026-11-14 01:04:03 +00:00
Fix crashes and odd behavior from renamed Node Matricies (#12)
This commit is contained in:
1 parent
ec63a19f48
commit
71c771b5ad
2 files changed
+19
-9
No files matched your search
+11
-1
@@ -8,5 +8,15 @@ dependencies {
|
||||
api("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
|
||||
|
||||
runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev")
|
||||
runtimeOnly("com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev")
|
||||
}
|
||||
|
||||
project.getConfigurations()
|
||||
.all(c -> {
|
||||
final DependencySubstitutions ds = c.getResolutionStrategy()
|
||||
.getDependencySubstitution();
|
||||
ds.substitute(ds.module("com.github.GTNewHorizons:Baubles"))
|
||||
.using(ds.module("com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH"))
|
||||
.withClassifier("dev")
|
||||
.because("Baubles-Expanded replaces Baubles");
|
||||
});
|
||||
@@ -35,13 +35,13 @@ public class ItemMatrix extends Item {
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
public static boolean isAttuned(ItemStack stack) {
|
||||
return stack.hasTagCompound() && stack.getTagCompound().hasKey("Aspects");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
if (stack.hasTagCompound()) {
|
||||
return this.getUnlocalizedName() + ".attuned";
|
||||
} else {
|
||||
return this.getUnlocalizedName() + ".unattuned";
|
||||
}
|
||||
return this.getUnlocalizedName() + (isAttuned(stack) ? ".attuned" : ".unattuned");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,20 +74,20 @@ public class ItemMatrix extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack itemStack) {
|
||||
return itemStack.hasTagCompound() ? EnumRarity.uncommon : EnumRarity.common;
|
||||
return isAttuned(itemStack) ? EnumRarity.uncommon : EnumRarity.common;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack itemStack, int pass) {
|
||||
return itemStack.hasTagCompound();
|
||||
return isAttuned(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean advancedTooltips) {
|
||||
if (itemStack.hasTagCompound()) {
|
||||
if (isAttuned(itemStack)) {
|
||||
NBTTagCompound tagCompound = itemStack.getTagCompound();
|
||||
AspectList aspectList = new AspectList();
|
||||
aspectList.readFromNBT(tagCompound);
|
||||
|
||||
Reference in new issue
Block a user