最MC论坛

标题: CustomStuff2-栅栏类方块及陷阱门 [打印本页]

作者: Thiocyanate    时间: 2016-2-2 13:01
标题: CustomStuff2-栅栏类方块及陷阱门
这回会介绍得多一些,这次主要介绍栅栏、栅栏门、墙、陷阱门

栅栏
1.都是先创建JS文件因为都是方块类,所以都要在blocks文件夹里面创建;
2.都是这样的,输入下列代码:
/*DiamondFence.js*/
name = "DiamondFence";
material = "iron";
hardness[0] = 30;
drop[0] = "Creator:DiamondFence";
addToCreative[0] = true;
creativeTab = "decorations";
textureFileXP[0] = "/diamond_block.png";
textureFileXN[0] = "/diamond_block.png";
textureFileYP[0] = "/diamond_block.png";
textureFileYN[0] = "/diamond_block.png";
textureFileZP[0] = "/diamond_block.png";
textureFileZN[0] = "/diamond_block.png";
好像和之前的没什么变化,都是这样子的

栅栏门
1.先创建JS文件;
2.输入下列代码:
/*DiamondFenceGate.js*/
name = "DiamondFenceGate";
material = "iron";
stepSound = "metal";
creativeTab = "decorations";
redstoneOnly = true;


hardness[0] = 2;
resistance[0] = 30;
toolClass[0] = "pickaxe";
harvestLevel[0] = 2;
textureFileXP[0] = "/diamond_block.png";
textureFileXN[0] = "/diamond_block.png";
textureFileYP[0] = "/diamond_block.png";
textureFileYN[0] = "/diamond_block.png";
textureFileZP[0] = "/diamond_block.png";
textureFileZN[0] = "/diamond_block.png";
addToCreative[0] = true;
3.代码讲解:
redstoneOnly
这个属性定义了栅栏门是否能用红石触发选择true或false.


墙,就是像圆石墙、苔石墙那些
1.先创建JS文件;
2.输入下列代码:
/*DiamondWall.js*/
name = "DiamondWall";
material = "iron";
stepSound = "stone";
creativeTab = "decorations";
hardness[0] = 30;
resistance[0] = 20;
toolClass[0] = "pickaxe";
harvestLevel[0] = 3;
textureFileXP[0] = "/diamond_block.png";
textureFileXN[0] = "/diamond_block.png";
textureFileYP[0] = "/diamond_block.png";
textureFileYN[0] = "/diamond_block.png";
textureFileZP[0] = "/diamond_block.png";
textureFileZN[0] = "/diamond_block.png";
addToCreative[0] = true;

陷阱门
1.先创建JS文件;
2.输入代码:
/*DiamondTrapDoor.js*/
name = "DiamondTrapDoor";
material = "iron";
stepSound = "metal";
creativeTab = "buildingBlocks";
redstoneOnly = true;


hardness[0] = 5;
resistance[0] = 30;
toolClass[0] = "pickaxe";
harvestLevel[0] = 2;
textureFileXP[0] = "/diamond_block.png";
textureFileXN[0] = "/diamond_block.png";
textureFileYP[0] = "/diamond_block.png";
textureFileYN[0] = "/diamond_block.png";
textureFileZP[0] = "/diamond_block.png";
textureFileZN[0] = "/diamond_block.png";
addToCreative[0] = true;

总的概括:
[attach]9199[/attach]
注意红框里面的东西,
fence表示栅栏,fenceGate是栅栏门,wall是墙,trapDoor是陷阱门
就这样了,打开游戏看看吧!
[attach]9200[/attach]
栅栏门的材质是这样,是因为我没有用田字形的材质,但是效果都是一样的

下次介绍的是新的玻璃板和地毯,这样就不愁没颜色了
初始页地址,有教程目录http://www.zuimc.com/thread-39587-1-1.html





欢迎光临 最MC论坛 (http://www.zuimc.com/) Powered by Discuz! X3.2