1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Identify unknown upgrades as ComputerCraft instead

When the mod id is null, the namespace is given as "minecraft". This is
not what we want, so use CC there instead.
This commit is contained in:
Jonathan Coates 2021-08-01 08:48:02 +01:00
parent 686c6a4c44
commit 11b40bb6d5
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -11,6 +11,7 @@ import dan200.computercraft.shared.computer.core.ComputerFamily;
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenCustomHashMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Util;
import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.ModLoadingContext;
import javax.annotation.Nonnull;
@ -34,7 +35,8 @@ public final class TurtleUpgrades
{
this.upgrade = upgrade;
id = upgrade.getUpgradeID().toString();
modId = ModLoadingContext.get().getActiveNamespace();
ModContainer mc = ModLoadingContext.get().getActiveContainer();
modId = mc != null && mc.getModId() != null ? mc.getModId() : ComputerCraft.MOD_ID;
enabled = true;
}
}