1.10.2 modding ブロックの描画について

Modding・サーバPlugin制作・ツール制作など、開発関連の質問があればこちらにお願い致します。
フォーラムルール
質問関連フォーラムで質問する時は、必ず次のトピックを一読/厳守お願い致します。
viewtopic.php?f=5&t=999
  • (PostNo.317192)

1.10.2 modding ブロックの描画について

投稿記事by Kotta//コッタ » 2018年6月06日(水) 20:32

1.10.2でmodを作っているのですが、3dモデルを使ったブロックを設置すると描画が省略されてしまう部分があります。
どのように修正すればいいか教えてください。
環境
・forge-1.10.2-12.18.3.2511
・windows10
コード
package com.kotta.backmod.init;

import com.kotta.backmod.BackMod;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class BackModBlocks {
public static Block PLUTONIUMBLOCK;
public static Block PLUTONIUMORE;
public static Block PLUTONIUMBOX;


public static void init() {
PLUTONIUMBLOCK = new Block(Material.IRON).setUnlocalizedName("plutoniumblock").setCreativeTab(BackModTabs.tabBackMod).setHardness(2.5F);
PLUTONIUMORE = new Block(Material.IRON).setUnlocalizedName("plutoniumore").setCreativeTab(BackModTabs.tabBackMod).setHardness(2.5F);
PLUTONIUMBOX = new Block(Material.IRON).setUnlocalizedName("plutoniumbox").setCreativeTab(BackModTabs.tabBackMod).setHardness(1.5F);
}

public static void register() {
registerBlock(PLUTONIUMBLOCK, "BlockPlutoniumBlock");
registerBlock(PLUTONIUMORE, "BlockPlutoniumOre");
registerBlock(PLUTONIUMBOX, "BlockPlutoniumBox");
}

private static void registerBlock(Block block, String registryName) {
GameRegistry.register(block, new ResourceLocation(BackMod.MOD_ID, registryName));
ItemBlock item = new ItemBlock(block);
item.setRegistryName(block.getRegistryName());
GameRegistry.register(item);
}

public static void registerRenders() {
registerRender(PLUTONIUMBLOCK);
registerRender(PLUTONIUMORE);
registerRender(PLUTONIUMBOX);
}

private static void registerRender(Block block) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
}


}
添付ファイル
2018-06-06_20.30.28.png
Kotta//コッタ
ID:c6237c3b
 

  • (PostNo.317201)

Re: 1.10.2 modding ブロックの描画について

投稿記事by elise_blacklab » 2018年6月06日(水) 21:46

jsonモデルとBlockクラスの内容を提示してください.
Modクラスでは基本的に登録作業しかしないので,これだけではアドバイスができませぬ
メイドつくってたりします.http://6docvc.net/
アバター
elise_blacklab
ID:f98581b7
掘り廃人
 
記事: 2513
登録日時: 2014年6月25日(水) 18:30

  • (PostNo.317223)

Re: 1.10.2 modding ブロックの描画について

投稿記事by Kotta//コッタ » 2018年6月07日(木) 19:01

すみません。今書きます。
blockstates
{
"variants": {
"normal": [
{ "model": "backmod:BlockPlutoniumBox" },
{ "model": "backmod:BlockPlutoniumBox", "y": 90 },
{ "model": "backmod:BlockPlutoniumBox", "y": 180 },
{ "model": "backmod:BlockPlutoniumBox", "y": 270 }
]
}
}
models(block)
{
"textures": {
"0": "backmod:blocks/plutoniumbox",
"particle": "backmod:blocks/plutoniumbox"
},
"elements": [
{
"from": [2, 6, 1],
"to": [4, 7, 3],
"faces": {
"north": {"uv": [8.75, 8.75, 9.25, 10], "texture": "#0", "rotation": 270},
"east": {"uv": [2, 3.5, 4.25, 4], "texture": "#0"},
"south": {"uv": [1.25, 3.5, 3.25, 4], "texture": "#0"},
"west": {"uv": [2, 3.5, 4, 4], "texture": "#0"},
"up": {"uv": [0, 7.25, 1.75, 7.75], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [2, 6, 5],
"to": [4, 7, 7],
"faces": {
"north": {"uv": [2.25, 3.5, 4.25, 4], "texture": "#0"},
"east": {"uv": [1.5, 3.5, 3.5, 4], "texture": "#0"},
"south": {"uv": [1.75, 3.5, 4.25, 4], "texture": "#0"},
"west": {"uv": [3.25, 3.5, 4.5, 4], "texture": "#0"},
"up": {"uv": [7.75, 3.5, 8.5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [2, 6, 9],
"to": [4, 7, 11],
"faces": {
"north": {"uv": [2.25, 3.5, 5, 4], "texture": "#0"},
"east": {"uv": [1.25, 3.5, 3.25, 4], "texture": "#0"},
"south": {"uv": [2.5, 3.5, 5.25, 4], "texture": "#0"},
"west": {"uv": [5, 3.5, 5.5, 4], "texture": "#0"},
"up": {"uv": [6.25, 3.5, 7, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [10, 6, 1],
"to": [12, 7, 3],
"faces": {
"north": {"uv": [1.5, 3.5, 3.5, 4], "texture": "#0"},
"east": {"uv": [1.5, 3.5, 3.5, 4], "texture": "#0"},
"south": {"uv": [2.5, 3.5, 5, 4], "texture": "#0"},
"west": {"uv": [3.5, 3.5, 5, 4], "texture": "#0"},
"up": {"uv": [3.75, 3.5, 4.25, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [6, 6, 1],
"to": [8, 7, 3],
"faces": {
"north": {"uv": [1.5, 3.5, 3.5, 4], "texture": "#0"},
"east": {"uv": [0.75, 3.5, 2.75, 4], "texture": "#0"},
"south": {"uv": [1.25, 3.5, 4, 4], "texture": "#0"},
"west": {"uv": [3.75, 3.5, 4.75, 4], "texture": "#0"},
"up": {"uv": [5, 3.5, 5.5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [2, 6, 13],
"to": [4, 7, 15],
"faces": {
"north": {"uv": [1.75, 3.5, 4.25, 4], "texture": "#0"},
"east": {"uv": [0.5, 3.5, 2.5, 4], "texture": "#0"},
"south": {"uv": [2, 3.5, 4.5, 4], "texture": "#0"},
"west": {"uv": [5.25, 3.5, 5.75, 4], "texture": "#0"},
"up": {"uv": [4.25, 3.5, 4.75, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [10, 6, 13],
"to": [12, 7, 15],
"faces": {
"north": {"uv": [2.25, 3.5, 4.75, 4], "texture": "#0"},
"east": {"uv": [1, 3.5, 3.25, 4], "texture": "#0"},
"south": {"uv": [2.25, 3.5, 4.5, 4], "texture": "#0"},
"west": {"uv": [2.5, 3.5, 4.5, 4], "texture": "#0"},
"up": {"uv": [3.5, 3.5, 4, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [10, 6, 9],
"to": [12, 7, 11],
"faces": {
"north": {"uv": [2.25, 3.5, 4.5, 4], "texture": "#0"},
"east": {"uv": [1, 3.5, 3, 4], "texture": "#0"},
"south": {"uv": [1.5, 3.5, 4.25, 4], "texture": "#0"},
"west": {"uv": [4.75, 3.5, 6, 4], "texture": "#0"},
"up": {"uv": [4.5, 3.5, 5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [10, 6, 5],
"to": [12, 7, 7],
"faces": {
"north": {"uv": [5, 3.5, 7.25, 4], "texture": "#0"},
"east": {"uv": [1.25, 3.5, 3.25, 4], "texture": "#0"},
"south": {"uv": [1.75, 3.5, 4.25, 4], "texture": "#0"},
"west": {"uv": [4.25, 3.5, 6.25, 4], "texture": "#0"},
"up": {"uv": [4, 3.5, 4.5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [6, 6, 5],
"to": [8, 7, 7],
"faces": {
"north": {"uv": [3.5, 3.5, 5.5, 4], "texture": "#0"},
"east": {"uv": [1, 3.5, 3, 4], "texture": "#0"},
"south": {"uv": [1.75, 3.5, 4.25, 4], "texture": "#0"},
"west": {"uv": [5.5, 3.5, 6, 4], "texture": "#0"},
"up": {"uv": [4.25, 3.5, 4.75, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [6, 6, 13],
"to": [8, 7, 15],
"faces": {
"north": {"uv": [2, 3.5, 5.25, 4], "texture": "#0"},
"east": {"uv": [1.25, 3.5, 3.25, 4], "texture": "#0"},
"south": {"uv": [1, 3.5, 4, 4], "texture": "#0"},
"west": {"uv": [4, 3.5, 5.75, 4], "texture": "#0"},
"up": {"uv": [4.25, 3.5, 5, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [6, 6, 9],
"to": [8, 7, 11],
"faces": {
"north": {"uv": [2.75, 3.5, 4.75, 4], "texture": "#0"},
"east": {"uv": [0.75, 3.5, 2.75, 4], "texture": "#0"},
"south": {"uv": [1.5, 3.5, 4.25, 4], "texture": "#0"},
"west": {"uv": [4.75, 3.5, 6, 4], "texture": "#0"},
"up": {"uv": [5.5, 3.5, 6, 4], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#missing"}
}
},
{
"from": [14, 6, 0],
"to": [15, 18, 16],
"faces": {
"north": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 90},
"east": {"uv": [0, 3.75, 9, 7.5], "texture": "#0"},
"south": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 270},
"west": {"uv": [0.25, 7.75, 8.75, 11], "texture": "#0"},
"up": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 270},
"down": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 270}
}
},
{
"from": [13, 6, 0],
"to": [14, 18, 1],
"faces": {
"north": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 270},
"east": {"uv": [0, 0, 1, 12], "texture": "#missing"},
"south": {"uv": [0, 7.25, 9.25, 7.75], "texture": "#0"},
"west": {"uv": [0.5, 3.5, 8.5, 4], "texture": "#0"},
"up": {"uv": [0, 0, 0.5, 0.5], "texture": "#0"},
"down": {"uv": [0, 0, 0.5, 0.5], "texture": "#0", "rotation": 270}
}
},
{
"from": [13, 6, 1],
"to": [14, 7, 15],
"faces": {
"north": {"uv": [0, 0, 1, 1], "texture": "#missing"},
"east": {"uv": [0, 0, 14, 1], "texture": "#missing"},
"south": {"uv": [0, 0, 1, 1], "texture": "#missing"},
"west": {"uv": [0.5, 3.5, 8.5, 4], "texture": "#0"},
"up": {"uv": [0, 7.25, 9.5, 7.75], "texture": "#0"},
"down": {"uv": [0.25, 7, 8.75, 7.5], "texture": "#0", "rotation": 90}
}
},
{
"from": [13, 17, 1],
"to": [14, 18, 15],
"faces": {
"north": {"uv": [0, 0, 1, 1], "texture": "#missing"},
"east": {"uv": [0, 0, 14, 1], "texture": "#missing"},
"south": {"uv": [0, 0, 1, 1], "texture": "#missing"},
"west": {"uv": [0.5, 3.5, 8.5, 4], "texture": "#0"},
"up": {"uv": [0.5, 7, 8.75, 7.5], "texture": "#0", "rotation": 90},
"down": {"uv": [0, 7.25, 9.25, 7.75], "texture": "#0"}
}
},
{
"from": [13, 6, 15],
"to": [14, 18, 16],
"faces": {
"north": {"uv": [0, 7.25, 9.25, 7.75], "texture": "#0"},
"east": {"uv": [0, 0, 1, 12], "texture": "#missing"},
"south": {"uv": [0, 7, 9, 7.5], "texture": "#0", "rotation": 90},
"west": {"uv": [0, 7.25, 9.25, 7.75], "texture": "#0"},
"up": {"uv": [0, 0, 0.5, 0.5], "texture": "#0", "rotation": 270},
"down": {"uv": [0, 0, 0.5, 0.5], "texture": "#0"}
}
},
{
"from": [1, 1, 0],
"to": [13, 6, 16],
"faces": {
"north": {"uv": [0, 0, 9, 3.75], "texture": "#0"},
"east": {"uv": [12.75, 0, 16, 12], "texture": "#0", "rotation": 270},
"south": {"uv": [0, 0, 9, 3.75], "texture": "#0"},
"west": {"uv": [9, 0, 12.75, 12], "texture": "#0", "rotation": 90},
"up": {"uv": [0, 7.5, 9, 11.25], "texture": "#0", "rotation": 270},
"down": {"uv": [0, 3.75, 9, 7.5], "texture": "#0", "rotation": 270}
}
},
{
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [0, 15, 16, 16], "texture": "#0"},
"east": {"uv": [0, 15, 16, 16], "texture": "#0"},
"south": {"uv": [0, 15, 16, 16], "texture": "#0"},
"west": {"uv": [0, 15, 16, 16], "texture": "#0"},
"up": {"uv": [0, 12, 16, 16], "texture": "#0"},
"down": {"uv": [0, 12.75, 16, 16], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [88, -90, 26],
"translation": [-6, 7.5, 3]
},
"thirdperson_lefthand": {
"rotation": [88, -90, 26],
"translation": [-6, 7.5, 3]
},
"firstperson_righthand": {
"scale": [0.55, 0.55, 0.55],
"translation": [1, 3, -1],
"rotation": [0, -69, 0]
},
"firstperson_lefthand": {
"scale": [0.55, 0.55, 0.55],
"rotation": [0, 107, 0],
"translation": [0, 3, -0.5]
},
"head": {
"rotation": [0, -90, 0],
"translation": [0, 12, 0]
},
"ground": {
"scale": [0.675, 0.675, 0.675],
"translation": [0, 3, 0]
},
"fixed": {
"translation": [0, 0, -8.5],
"rotation": [0, -90, 0]
},
"gui": {
"scale": [0.85, 0.85, 0.85],
"rotation": [0, 90, 0]
}
}
}
models(items)
{
"parent": "backmod:block/BlockPlutoniumBox"
}
このブロックに関係のあるファイルはこれだけです。
Kotta//コッタ
ID:c6237c3b
 

  • (PostNo.317256)

Re: 1.10.2 modding ブロックの描画について

投稿記事by Kotta//コッタ » 2018年6月09日(土) 11:19

個別クラスを作ることで解決しました。
申し訳ありません。
Kotta//コッタ
ID:c6237c3b
 


Return to 質問:開発・制作関連

x