本帖最后由 贰逼 于 2015-4-11 21:20 编辑
源码和补充:这篇新闻题目错了,不是给萝卜钓竿特性,而是材质制作者的便利。
物品加入了一些可自定义属性和标签,被确认添加在了1.9的物品json中。
关于物品stack_size属性和/me指令:
Grum:So @Dinnerbone suggested to add "stack_size" as a property too. /me types code. Done!
Grum : Dinnerbone建议添加"stack_size"也作为一种属性。/me 类型 代码。完成了!
关于物品json加入的damaged和damage:
_carrot_on_a_stick_files_on_disk- assets/minecraft/
- models/item/
- carrot_on_a_stick.json
- carrot_on_a_stick_01.json
- carrot_on_a_stick_02.json
- carrot_on_a_stick_03.json
- carrot_on_a_stick_04.json
- textures/items/
- carrot_on_a_stick.png
- carrot_on_a_stick_01.png
- carrot_on_a_stick_02.png
- carrot_on_a_stick_03.png
- carrot_on_a_stick_04.png
复制代码
_carrot_on_a_stick_files_on_disk: 声明添加了四个新添加的状态的model和png。
carrot_on_a_stick.json
- {
- "parent": "builtin/generated",
- "textures": {
- "layer0": "items/carrot_on_a_stick"
- },
- "display": {
- "thirdperson": {
- "rotation": [ 180, 90, -35 ],
- "translation": [ 0, 0, -3.5 ],
- "scale": [ 0.85, 0.85, 0.85 ]
- },
- "firstperson": {
- "rotation": [ 0, 45, 25 ],
- "translation": [ 0, 4, 2 ],
- "scale": [ 1.7, 1.7, 1.7 ]
- }
- },
- "overrides": [
- {
- "predicate": {
- "damaged": 1
- },
- "model": "item/carrot_on_a_stick_01"
- },
- {
- "predicate": {
- "damaged": 1,
- "damage": 0.3
- },
- "model": "item/carrot_on_a_stick_02"
- },
- {
- "predicate": {
- "damaged": 1,
- "damage": 0.6
- },
- "model": "item/carrot_on_a_stick_03"
- },
- {
- "predicate": {
- "damaged": 1,
- "damage": 0.9
- },
- "model": "item/carrot_on_a_stick_04"
- }
- ]
- }
复制代码
carrot_on_a_stick.json: 前面display部分不多说了,是物品基本的base。 "overrides"后面damage(损坏值)内容才是更新的:(damaged使原有的,表示正在被使用)
分别在萝卜钓竿damage(损坏值)为0,0.3,0.6,0.9调用前面对应声明的model。
这个damage作为控制模型更新的变量,是访问游戏所得的。(0代表没有,所以没有填,下面的也一样)
other_uses.json:
- # bow
- {
- "parent": "builtin/generated",
- "textures": {
- "layer0": "items/bow_standby"
- },
- "display": {
- "thirdperson": {
- "rotation": [ 5, 80, -45 ],
- "translation": [ 0.75, 0, 0.25 ],
- "scale": [ 1, 1, 1 ]
- },
- "firstperson": {
- "rotation": [ 0, -135, 25 ],
- "translation": [ 0, 4, 2 ],
- "scale": [ 1.7, 1.7, 1.7 ]
- }
- },
- "overrides": [
- {
- "predicate": {
- "pulling": 1
- },
- "model": "item/bow_pulling_0"
- },
- {
- "predicate": {
- "pulling": 1,
- "pull": 0.65
- },
- "model": "item/bow_pulling_1"
- },
- {
- "predicate": {
- "pulling": 1,
- "pull": 0.9
- },
- "model": "item/bow_pulling_2"
- }
- ]
- }
-
- # fishing rod
- {
- "parent": "builtin/generated",
- "textures": {
- "layer0": "items/fishing_rod_uncast"
- },
- "display": {
- "thirdperson": {
- "rotation": [ 180, 90, -35 ],
- "translation": [ 0, 0, -3.5 ],
- "scale": [ 0.85, 0.85, 0.85 ]
- },
- "firstperson": {
- "rotation": [ 0, 45, 25 ],
- "translation": [ 0, 4, 2 ],
- "scale": [ 1.7, 1.7, 1.7 ]
- }
- },
- "overrides": [
- {
- "predicate": {
- "cast": 1
- },
- "model": "item/fishing_rod_cast"
- }
- ]
- }
-
- # compass
- {
- "parent": "builtin/generated",
- "textures": {
- "layer0": "items/compass_16"
- },
- "display": {
- "thirdperson": {
- "rotation": [ -90, 0, 0 ],
- "translation": [ 0, 1, -3 ],
- "scale": [ 0.55, 0.55, 0.55 ]
- },
- "firstperson": {
- "rotation": [ 0, -135, 25 ],
- "translation": [ 0, 4, 2 ],
- "scale": [ 1.7, 1.7, 1.7 ]
- }
- },
- "overrides": [
- { "predicate": { "angle": 0.000000 }, "model": "item/compass" },
- { "predicate": { "angle": 0.015625 }, "model": "item/compass_17" },
- { "predicate": { "angle": 0.046875 }, "model": "item/compass_18" },
- { "predicate": { "angle": 0.078125 }, "model": "item/compass_19" },
- { "predicate": { "angle": 0.109375 }, "model": "item/compass_20" },
- { "predicate": { "angle": 0.140625 }, "model": "item/compass_21" },
- { "predicate": { "angle": 0.171875 }, "model": "item/compass_22" },
- { "predicate": { "angle": 0.203125 }, "model": "item/compass_23" },
- { "predicate": { "angle": 0.234375 }, "model": "item/compass_24" },
- { "predicate": { "angle": 0.265625 }, "model": "item/compass_25" },
- { "predicate": { "angle": 0.296875 }, "model": "item/compass_26" },
- { "predicate": { "angle": 0.328125 }, "model": "item/compass_27" },
- { "predicate": { "angle": 0.359375 }, "model": "item/compass_28" },
- { "predicate": { "angle": 0.390625 }, "model": "item/compass_29" },
- { "predicate": { "angle": 0.421875 }, "model": "item/compass_30" },
- { "predicate": { "angle": 0.453125 }, "model": "item/compass_31" },
- { "predicate": { "angle": 0.484375 }, "model": "item/compass_00" },
- { "predicate": { "angle": 0.515625 }, "model": "item/compass_01" },
- { "predicate": { "angle": 0.546875 }, "model": "item/compass_02" },
- { "predicate": { "angle": 0.578125 }, "model": "item/compass_03" },
- { "predicate": { "angle": 0.609375 }, "model": "item/compass_04" },
- { "predicate": { "angle": 0.640625 }, "model": "item/compass_05" },
- { "predicate": { "angle": 0.671875 }, "model": "item/compass_06" },
- { "predicate": { "angle": 0.703125 }, "model": "item/compass_07" },
- { "predicate": { "angle": 0.734375 }, "model": "item/compass_08" },
- { "predicate": { "angle": 0.765625 }, "model": "item/compass_09" },
- { "predicate": { "angle": 0.796875 }, "model": "item/compass_10" },
- { "predicate": { "angle": 0.828125 }, "model": "item/compass_11" },
- { "predicate": { "angle": 0.859375 }, "model": "item/compass_12" },
- { "predicate": { "angle": 0.890625 }, "model": "item/compass_13" },
- { "predicate": { "angle": 0.921875 }, "model": "item/compass_14" },
- { "predicate": { "angle": 0.953125 }, "model": "item/compass_15" },
- { "predicate": { "angle": 0.984375 }, "model": "item/compass" }
- ]
- }
-
- # clock
- {
- "parent": "builtin/generated",
- "textures": {
- "layer0": "items/clock_00"
- },
- "display": {
- "thirdperson": {
- "rotation": [ -90, 0, 0 ],
- "translation": [ 0, 1, -3 ],
- "scale": [ 0.55, 0.55, 0.55 ]
- },
- "firstperson": {
- "rotation": [ 0, -135, 25 ],
- "translation": [ 0, 4, 2 ],
- "scale": [ 1.7, 1.7, 1.7 ]
- }
- },
- "overrides": [
- { "predicate": { "time": 0.0000000 }, "model": "item/clock" },
- { "predicate": { "time": 0.0078125 }, "model": "item/clock_01" },
- { "predicate": { "time": 0.0234375 }, "model": "item/clock_02" },
- { "predicate": { "time": 0.0390625 }, "model": "item/clock_03" },
- { "predicate": { "time": 0.0546875 }, "model": "item/clock_04" },
- { "predicate": { "time": 0.0703125 }, "model": "item/clock_05" },
- { "predicate": { "time": 0.0859375 }, "model": "item/clock_06" },
- { "predicate": { "time": 0.1015625 }, "model": "item/clock_07" },
- { "predicate": { "time": 0.1171875 }, "model": "item/clock_08" },
- { "predicate": { "time": 0.1328125 }, "model": "item/clock_09" },
- { "predicate": { "time": 0.1484375 }, "model": "item/clock_10" },
- { "predicate": { "time": 0.1640625 }, "model": "item/clock_11" },
- { "predicate": { "time": 0.1796875 }, "model": "item/clock_12" },
- { "predicate": { "time": 0.1953125 }, "model": "item/clock_13" },
- { "predicate": { "time": 0.2109375 }, "model": "item/clock_14" },
- { "predicate": { "time": 0.2265625 }, "model": "item/clock_15" },
- { "predicate": { "time": 0.2421875 }, "model": "item/clock_16" },
- { "predicate": { "time": 0.2578125 }, "model": "item/clock_17" },
- { "predicate": { "time": 0.2734375 }, "model": "item/clock_18" },
- { "predicate": { "time": 0.2890625 }, "model": "item/clock_19" },
- { "predicate": { "time": 0.3046875 }, "model": "item/clock_20" },
- { "predicate": { "time": 0.3203125 }, "model": "item/clock_21" },
- { "predicate": { "time": 0.3359375 }, "model": "item/clock_22" },
- { "predicate": { "time": 0.3515625 }, "model": "item/clock_23" },
- { "predicate": { "time": 0.3671875 }, "model": "item/clock_24" },
- { "predicate": { "time": 0.3828125 }, "model": "item/clock_25" },
- { "predicate": { "time": 0.3984375 }, "model": "item/clock_26" },
- { "predicate": { "time": 0.4140625 }, "model": "item/clock_27" },
- { "predicate": { "time": 0.4296875 }, "model": "item/clock_28" },
- { "predicate": { "time": 0.4453125 }, "model": "item/clock_29" },
- { "predicate": { "time": 0.4609375 }, "model": "item/clock_30" },
- { "predicate": { "time": 0.4765625 }, "model": "item/clock_31" },
- { "predicate": { "time": 0.4921875 }, "model": "item/clock_32" },
- { "predicate": { "time": 0.5078125 }, "model": "item/clock_33" },
- { "predicate": { "time": 0.5234375 }, "model": "item/clock_34" },
- { "predicate": { "time": 0.5390625 }, "model": "item/clock_35" },
- { "predicate": { "time": 0.5546875 }, "model": "item/clock_36" },
- { "predicate": { "time": 0.5703125 }, "model": "item/clock_37" },
- { "predicate": { "time": 0.5859375 }, "model": "item/clock_38" },
- { "predicate": { "time": 0.6015625 }, "model": "item/clock_39" },
- { "predicate": { "time": 0.6171875 }, "model": "item/clock_40" },
- { "predicate": { "time": 0.6328125 }, "model": "item/clock_41" },
- { "predicate": { "time": 0.6484375 }, "model": "item/clock_42" },
- { "predicate": { "time": 0.6640625 }, "model": "item/clock_43" },
- { "predicate": { "time": 0.6796875 }, "model": "item/clock_44" },
- { "predicate": { "time": 0.6953125 }, "model": "item/clock_45" },
- { "predicate": { "time": 0.7109375 }, "model": "item/clock_46" },
- { "predicate": { "time": 0.7265625 }, "model": "item/clock_47" },
- { "predicate": { "time": 0.7421875 }, "model": "item/clock_48" },
- { "predicate": { "time": 0.7578125 }, "model": "item/clock_49" },
- { "predicate": { "time": 0.7734375 }, "model": "item/clock_50" },
- { "predicate": { "time": 0.7890625 }, "model": "item/clock_51" },
- { "predicate": { "time": 0.8046875 }, "model": "item/clock_52" },
- { "predicate": { "time": 0.8203125 }, "model": "item/clock_53" },
- { "predicate": { "time": 0.8359375 }, "model": "item/clock_54" },
- { "predicate": { "time": 0.8515625 }, "model": "item/clock_55" },
- { "predicate": { "time": 0.8671875 }, "model": "item/clock_56" },
- { "predicate": { "time": 0.8828125 }, "model": "item/clock_57" },
- { "predicate": { "time": 0.8984375 }, "model": "item/clock_58" },
- { "predicate": { "time": 0.9140625 }, "model": "item/clock_59" },
- { "predicate": { "time": 0.9296875 }, "model": "item/clock_60" },
- { "predicate": { "time": 0.9453125 }, "model": "item/clock_61" },
- { "predicate": { "time": 0.9609375 }, "model": "item/clock_62" },
- { "predicate": { "time": 0.9765625 }, "model": "item/clock_63" },
- { "predicate": { "time": 0.9921875 }, "model": "item/clock" }
- ]
复制代码other_uses.json:
像其他的物品,弓、鱼竿、指南针、钟,也像萝卜钓竿都在不同状态时启用不同模型。
源码中挖掘出的更新的几个控制模型更新的变量:
弓:
pulling(弓弦正在被拉动,1表示true,则启用,表示正在拉动与pull相连)
pull(拉动弓弦程度):0,0.65,0.9调用模型
鱼竿:
cast(正在投掷,1表示true,则启用,表示正在投掷)
指南针:
angle(角度,若符合则调用模型)
钟:
time(表示事件,符合则启用模型)
最后重中之重:
x_last
- The properties that exist now:
-
- fishing_rod: cast
- clock: time
- compass: angle
- bow: pulling & pull
-
- Any item that can take damage gets: damaged & damage
- And on all items: stack_size
-
- All properties are mapped to a float range 0-1.
-
- Nothing of this is final! =D (And the carrot on a stick is just a demo!)
复制代码现在(1.9之前)存在的性质
上面提到的:
弓:
pulling(弓弦正在被拉动,1表示true,则启用,表示正在拉动与pull相连)
pull(拉动弓弦程度):0,0.65,0.9调用模型
鱼竿:
cast(正在投掷,1表示true,则启用,表示正在投掷)
指南针:
angle(角度,若符合则调用模型)
钟:
time(表示事件,符合则启用模型)
(1.9后)所有物品都可以(从游戏中)得到访问的到damaged和damage变量
还给所有物品添加了个stack_size
所有属性都映射为0-1范围内的浮点数
最后没有什么了(萝卜钓竿仅仅是个demo演示)
@a20001017 @sjjklh 请求设为置顶回复
也请楼主更改