提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
1行目: | 1行目: | ||
− | + | このページは<br/> | |
+ | ModLoaderを前提としています。 | ||
1.種ブロックの追加<br/> | 1.種ブロックの追加<br/> | ||
6行目: | 7行目: | ||
4.ドロップさせるアイテム設定<br/> | 4.ドロップさせるアイテム設定<br/> | ||
概要はこんな感じです。 | 概要はこんな感じです。 | ||
− | |||
− | |||
==ソース解説== | ==ソース解説== | ||
95行目: | 94行目: | ||
super(i, j); | super(i, j); | ||
blockIndexInTexture = j; | blockIndexInTexture = j; | ||
− | + | setTickOnLoad(true); | |
float f = 0.5F; | float f = 0.5F; | ||
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); | setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); | ||
113行目: | 112行目: | ||
* world.getBlockLightValueが光度判定 | * world.getBlockLightValueが光度判定 | ||
* 9以上なら成長するよという記述 最大15(太陽が一番照っているとき) | * 9以上なら成長するよという記述 最大15(太陽が一番照っているとき) | ||
+ | * getGrowthRateで成長速度を変更できます。 | ||
*/ | */ | ||
public void updateTick(World world, int i, int j, int k, Random random) | public void updateTick(World world, int i, int j, int k, Random random) | ||
141行目: | 141行目: | ||
/* | /* | ||
− | * | + | * 未確認ですが、ここで成長処理判定 |
− | |||
− | |||
*/ | */ | ||
private float getGrowthRate(World world, int i, int j, int k) | private float getGrowthRate(World world, int i, int j, int k) | ||
242行目: | 240行目: | ||
/* | /* | ||
− | * | + | * 鍬ないしエンチャントアイテム(フォーチュン)使用時の設定はここ。 |
− | |||
*/ | */ | ||
@Override | @Override | ||
249行目: | 246行目: | ||
{ | { | ||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); | ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); | ||
− | if (meta == | + | if (meta == 7) |
{ | { | ||
ret.add(new ItemStack(Item.wheat)); | ret.add(new ItemStack(Item.wheat)); | ||
265行目: | 262行目: | ||
/* | /* | ||
− | |||
− | |||
* ここの return Item.wheat.shiftedIndexで破壊時小麦をドロップさせていますが | * ここの return Item.wheat.shiftedIndexで破壊時小麦をドロップさせていますが | ||
* オリジナルの作物を入れる場合はここで設定します。 | * オリジナルの作物を入れる場合はここで設定します。 | ||
344行目: | 339行目: | ||
<comments /> | <comments /> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |