hogepiyo

かつてはマイクラのModを作っていたがひざに矢を受けた

Minecraft 1.6 Modding, BindTextureについて

BindTextureの変更点

TileEntitySpecialRendererやRenderEngineなどで利用していたBindTextureがリソースパックへの変更により, リソース切り替えになった. 現在ネームテーブルはまだ連番であるが, 対象のメソッドは以下の通り.

TileEntitySpecialRenderer#func_110628_a(ResourceLocation resourceLocation)
TextureManager#func_110577_a(ResourceLocation resourceLocation)

前者は旧TileEntitySpecialRenderer.bindTexture(), 後者は旧RenderEngine.bindTexture()である.

bindTexture("./terrain.png")について

bindTexture("./terrain.png")
bindTexture("./gui/items.png")

従来のこの2つは以下のように変更された.

func_110628_a(TextureMap.field_110575_b)
func_110628_a(TextureMap.field_110576_c)

TextureMapのフィールドに従来のblocks, itemsへの参照がある.

GUIの背景など

GUIの背景などでbindTextureしていたものは, 以下のようにbindする.

ResourceLocation GUI_RESOURCE_LOCATION = new ResourceLocation("domain", "textures/gui/gui.png");
mc.renderEngine.func_110577_a(GUI_RESOURCE_LOCATION);

ResourceLocationのdomainは1.5のテクスチャ仕様変更時に解説したdomainと異なり, /を使って階層を変更することができないことに注意.