7.0 Migration Guide
7.0 Migration Guide
Blocks
Block#expandedis now deprecated and a no-op, useBlock#clipSizeinstead. The field is kept to ensure compatibility, but will be removed eventually.All
mindustry.world.meta.values.*classes have been replaced with lambdas. See theStatValuesclass.BlockForgehas been moved out of the experimental package, and will likely undergo significant changes. If you were using this class in a Java mod, I recommend copy-pasting it in so you can keep using the old version. Other experimental blocks may be moved as well.CacheLayeris now a class with methods that can be overridden - not an enum.CacheLayer#addcan be used to register new layers.Various fields, like
variantsandattributeshave been moved fromFloortoBlock.Iconcand related methods have been removed; useUnlockableContent.uiIcon/fullIcon.SmelterandAttributeSmelterhave been deprecated. These classes had hard-coded drawing functionality. Transition toGenericCrafterwith aDrawSmelteras quickly as possible. For attribute support, useAttributeCrafter.Cultivatoris deprecated for the same reasons asSmelter, useAttributeCrafterinstead.ExtendingItemBridgeandLiquidExtendingBridgehave been merged withItemBridge/LiquidBridge, use those instead.PayloadAcceptorwas a misleading name in the wrong package, usePayloadBlockinstead.Generated icons must be created in
createIconsnow; attempting to useCore.atlas.addRegionsimply will not work.LiquidModule#total()has been deprecated; usecurrentAmount()instead.
Ammo
Any mod code that worked with unit ammo is now broken.
The
ResupplyPointclass has been removed.AmmoTypeis now an interface, not a class.AmmoTypeshas been removed, make new instances instead.Ammo type classes have been moved into the
mindustry.type.ammopackage.ContentType.ammohas been "removed", as ammo is no longer content.
Arc
Pixmap's API has been completely changed. Most methods now have blending disabled, and color/blending/scaling parameters are no longer part of thePixmapstate machine. Most image-related methods are now pure Java instead of JNI + C.SettingsDialog(Vars.ui.settings) has been moved into Mindustry's codebase. This technically doesn't change the API; however, Java mods compiled with 6.0 source will try to access non-existent fields of a non-existent class, leading to crashes. Recompiling with v7 Mindustry/arc dependencies should be enough to fix this.TextureAtlas now uses the smaller, faster
aatlsbinary format. Update your Arc dependencies to read it.Core.nethas been removed, use the static methods inarc.util.Httpinstead.RidgedPerlinhas been renamed toRidged.SimplexandRidgedare now stateless; use static methods to generate noise now. The seed is a parameter.
Networking
Registratorfor packets has been moved toNet, and registration methods have been made public, for potential use in Java mods.InvokePackethas been removed, and replaced with generated packet classes that handle events directly.RemoteRead{Server, Client}have also been removed.Packetis now an abstract class, not an interface.
Misc
BulletType#despawnedis no longer called in many cases, use#removedif you need to listen to all removal eventsAttributeis now a standard class, not an enum. UseAttribute.addto register a new one.Vars.miningRangehas been moved toUnitType.All fields in
Texare nowDrawable, notNinePatchDrawableorTextureRegionDrawable. Why? These fields are loaded from the atlas, which means mods that change UI sprites or an outdated atlas could previously cause aClassCastExceptioncrash.
Sprites
Outlines are now automatically generated for unit & weapon sprites. Leg regions are currently exempt.
All mod sprites are now automatically alpha-bled at load time when linear filtering is enabled - there is no need to do so manually.