匿名
未登录
创建账号
登录
Mindustry中文wiki
搜索
查看“官方维基教程-7.0迁移指南”的源代码
来自Mindustry中文wiki
命名空间
页面
讨论
更多
更多
页面操作
阅读
查看源代码
历史
←
官方维基教程-7.0迁移指南
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
管理员
、editor
您可以查看和复制此页面的源代码。
<span id="迁移指南"></span> = 7.0 迁移指南 = == 方块 == * <code>Block#expanded</code> 现在已被弃用,且无操作,使用 <code>Block#clipSize</code>替代。这个字段会保留确保兼容性,但最后一定会删的。 * 所有的 <code>mindustry.world.meta.values.*</code> 类都已经用 lambda 覆盖了。请见于 <code>StatValues</code> 类。 * <code>方块熔炉</code> 已经从实验性功能包移出去,并且出现了重大变化。如果你在 Java 模组里用了这个类,建议你复制粘贴进去以便于保持使用旧版本。其他的实验性方块也可能随时被移出去。 * <code>CacheLayer</code> 现在是一个可以重载方法的类,不是枚举。<code>CacheLayer#add</code> 能被用来注册新的层。 * 更多的字段,比如 <code>variants</code> 和 <code>attributes</code> 是从 <code>Floor</code> 移动到 <code>Block</code>。 * <code>Iconc</code> 以及相关的方法都被移除, 使用 <code>UnlockableContent.uiIcon/fullIcon</code>. * 弃用了 <code>Smelter</code> 和 <code>AttributeSmelter</code> 。 这些类具有硬编码的绘图功能。尽快改为 <code>GenericCrafter</code> 加上 <code>DrawSmelter</code> 。对于属性支持, 使用 <code>AttributeCrafter</code>. * <code>Cultivator</code> 和 <code>Smelter</code>,一样被弃用, 使用<code>AttributeCrafter</code> 代替。 * <code>ExtendingItemBridge</code> 和 <code>LiquidExtendingBridge</code> 合并到了 <code>ItemBridge</code> / <code>LiquidBridge</code>。 * <code>PayloadAcceptor</code> 是一个错误的包里面有误导性的词,使用<code>PayloadBlock</code> 代替。 * 现在生成的图像 '''必须''' 用 <code>createIcons</code> ;试图只用<code>Core.atlas.addRegion</code> 会失效。 * <code>LiquidModule#total()</code> 被弃用,使用 <code>currentAmount()</code> 代替。 == 子弹 == * 任何使用单位弹药的mod代码现在都失效了。 * <code>ResupplyPoint</code> 类被删除了。 * <code>AmmoType</code> 由类变成了接口。 * <code>AmmoTypes</code> 被删除了,用一个引用来代替。 * 子弹类型的类移动到了<code>mindustry.type.ammo</code> 包。 * <code>ContentType.ammo</code> 删了,作为子弹什么也不会做。 <span id="arc"></span> == Arc == * <code>Pixmap</code>的 API 完完全全变化了。 大多数方法都被禁用,颜色/混合/大小参数不再是 <code>Pixmap</code> 的状态机制。大多数与图像有关的方法现在是纯 Java 而不是 JNI + C。 * <code>SettingsDialog</code> (<code>Vars.ui.settings</code>) 已经移入基础代码。 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.这从技术上来讲并没有改变 API ,<u>'''但是'''</u>,6.0的Java模组 * TextureAtlas now uses the smaller, faster <code>aatls</code> binary format. Update your Arc dependencies to read it. * <code>Core.net</code> has been removed, use the static methods in <code>arc.util.Http</code> instead. * <code>RidgedPerlin</code> has been renamed to <code>Ridged</code>. * <code>Simplex</code> and <code>Ridged</code> are now stateless; use static methods to generate noise now. The seed is a parameter. <span id="networking"></span> == Networking == * <code>Registrator</code> for packets has been moved to <code>Net</code>, and registration methods have been made public, for potential use in Java mods. * <code>InvokePacket</code> has been removed, and replaced with generated packet classes that handle events directly. * <code>RemoteRead{Server, Client}</code> have also been removed. * <code>Packet</code> is now an abstract class, not an interface. <span id="misc"></span> == Misc == * <code>BulletType#despawned</code> is no longer called in many cases, use <code>#removed</code> if you need to listen to all removal events * <code>Attribute</code> is now a standard class, not an enum. Use <code>Attribute.add</code> to register a new one. * <code>Vars.miningRange</code> has been moved to <code>UnitType</code>. * All fields in <code>Tex</code> are now <code>Drawable</code>, not <code>NinePatchDrawable</code> or <code>TextureRegionDrawable</code>. Why? These fields are loaded from the atlas, which means mods that change UI sprites or an outdated atlas could previously cause a <code>ClassCastException</code> crash. <span id="sprites"></span> == 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 <code>@Deprecated</code> compatibility methods for most significant changes as needed. Ideally, most 6.0 java mods should still work with 7.0.
返回
官方维基教程-7.0迁移指南
。
导航
导航
塞普罗
-- 战役区块
-- 物品
-- 流体
-- 建筑
-- 单位
埃里克尔
-- 战役区块
-- 物品
-- 流体
-- 建筑
-- 单位
隐藏
-- 物品
-- 液体
-- 建筑
-- 地块介绍
其他
-- 状态效果
-- 天气
-- 星球
教程中心
编辑者
-- 编辑指导
-- 语法指南
-- 表格语法
最近更改
随机页面
MediaWiki帮助
wiki工具
wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志