7.0 Migration Guide
Blocks
Block#expanded
is now deprecated and a no-op, useBlock#clipSize
instead. The field is kept to ensure compatibility, but will be removed eventually.- All
mindustry.world.meta.values.*
classes have been replaced with lambdas. See theStatValues
class. BlockForge
has 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.CacheLayer
is now a class with methods that can be overridden - not an enum.CacheLayer#add
can be used to register new layers.- Various fields, like
variants
andattributes
have been moved fromFloor
toBlock
. Iconc
and related methods have been removed; useUnlockableContent.uiIcon/fullIcon
.Smelter
andAttributeSmelter
have been deprecated. These classes had hard-coded drawing functionality. Transition toGenericCrafter
with aDrawSmelter
as quickly as possible. For attribute support, useAttributeCrafter
.Cultivator
is deprecated for the same reasons asSmelter
, useAttributeCrafter
instead.ExtendingItemBridge
andLiquidExtendingBridge
have been merged withItemBridge
/LiquidBridge
, use those instead.PayloadAcceptor
was a misleading name in the wrong package, usePayloadBlock
instead.- Generated icons must be created in
createIcons
now; attempting to useCore.atlas.addRegion
simply will not work. LiquidModule#total()
has been deprecated; usecurrentAmount()
instead.
Ammo
- Any mod code that worked with unit ammo is now broken.
- The
ResupplyPoint
class has been removed. AmmoType
is now an interface, not a class.AmmoTypes
has been removed, make new instances instead.- Ammo type classes have been moved into the
mindustry.type.ammo
package. ContentType.ammo
has 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 thePixmap
state 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
aatls
binary format. Update your Arc dependencies to read it. Core.net
has been removed, use the static methods inarc.util.Http
instead.RidgedPerlin
has been renamed toRidged
.Simplex
andRidged
are now stateless; use static methods to generate noise now. The seed is a parameter.
Networking
Registrator
for packets has been moved toNet
, and registration methods have been made public, for potential use in Java mods.InvokePacket
has been removed, and replaced with generated packet classes that handle events directly.RemoteRead{Server, Client}
have also been removed.Packet
is now an abstract class, not an interface.
Misc
BulletType#despawned
is no longer called in many cases, use#removed
if you need to listen to all removal eventsAttribute
is now a standard class, not an enum. UseAttribute.add
to register a new one.Vars.miningRange
has been moved toUnitType
.- All fields in
Tex
are nowDrawable
, notNinePatchDrawable
orTextureRegionDrawable
. Why? These fields are loaded from the atlas, which means mods that change UI sprites or an outdated atlas could previously cause aClassCastException
crash.
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.
More changes to come.
I will be introducing @Deprecated
compatibility methods for most significant changes as needed. Ideally, most 6.0 java mods should still work with 7.0.