Skip to content

Commit ffd5370

Browse files
committed
Merge pull request #3 from MinecraftModderJapan/basic-interfaces
Create Interfaces Book interface from #10
2 parents 901bc55 + c4cbf8e commit ffd5370

File tree

10 files changed

+397
-0
lines changed

10 files changed

+397
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.block;
2+
3+
/**
4+
* 着色可能Blockのインターフェースです。
5+
* <p/>
6+
* Colorable Block Interface.
7+
*
8+
* @author CrafterKina
9+
* @version 1.0
10+
* @since 1.0
11+
*/
12+
public interface IColorable{}
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.block;
2+
3+
import net.minecraft.entity.player.EntityPlayer;
4+
import net.minecraft.item.ItemStack;
5+
import net.minecraft.world.World;
6+
7+
import java.util.Random;
8+
9+
/**
10+
* 作物のインターフェースです。
11+
* <p/>
12+
* Crop interface.
13+
*
14+
* @author CrafterKina
15+
* @version 1.0
16+
* @since 1.0
17+
*/
18+
public interface ICrop{
19+
/**
20+
* 作物が完熟している場合、trueを返します。 他の成長段階で収穫が異なっても、完熟した段階でのみtrueを返します。
21+
* <p/>
22+
* When the crop has grew completely, return true. Even If harvest-result changes by growth stage, only true in
23+
* final stage.
24+
*
25+
* @param world
26+
* Nonnull
27+
* <p/>
28+
* the World
29+
* @param x
30+
* X
31+
* @param y
32+
* Y
33+
* @param z
34+
* Z
35+
* @since 1.0
36+
*/
37+
boolean isMature(World world, int x, int y, int z);
38+
39+
/**
40+
* 作物から何らかの収穫が得られるときは、trueを返します。
41+
* <p/>
42+
* Whenever this crop drops any harvest-results, return true.
43+
*
44+
* @param world
45+
* Nonnull
46+
* <p/>
47+
* the World
48+
* @param x
49+
* X
50+
* @param y
51+
* Y
52+
* @param z
53+
* Z
54+
* @since 1.0
55+
*/
56+
boolean isHarvestable(World world, int x, int y, int z);
57+
58+
/**
59+
* 収穫者がこの作物を収穫できるか判定します。
60+
* <p/>
61+
* The harvester can harvest.
62+
*
63+
* @param player
64+
* Nonnull
65+
* <p/>
66+
* the Harvester
67+
* @param world
68+
* Nonnull
69+
* <p/>
70+
* the World
71+
* @param x
72+
* X
73+
* @param y
74+
* Y
75+
* @param z
76+
* Z
77+
* @since 1.0
78+
*/
79+
boolean canHarvestCrop(EntityPlayer player, World world, int x, int y, int z);
80+
81+
/**
82+
* 成長段階を一つ進めます。 それ以上成長できない場合、falseを返し何も行いません。
83+
* <p/>
84+
* Force raise up the growth-stage. If this crop can't grow more, return false and do not anything.
85+
*
86+
* @param world
87+
* Nonnull
88+
* <p/>
89+
* the World
90+
* @param x
91+
* X
92+
* @param y
93+
* Y
94+
* @param z
95+
* Z
96+
* @since 1.0
97+
*/
98+
boolean grow(World world, int x, int y, int z);
99+
100+
/**
101+
* 作物の種を返します。
102+
* <p/>
103+
* Seed of Crop.
104+
*
105+
* @param world
106+
* Nonnull
107+
* <p/>
108+
* the World
109+
* @param x
110+
* X
111+
* @param y
112+
* Y
113+
* @param z
114+
* Z
115+
* @since 1.0
116+
*/
117+
ItemStack getSeed(World world, int x, int y, int z);
118+
119+
/**
120+
* 期待されるすべての収穫物を返します。
121+
* <p/>
122+
* All excepted harvest-results.
123+
*
124+
* @param world
125+
* Nonnull
126+
* <p/>
127+
* the World
128+
* @param x
129+
* X
130+
* @param y
131+
* Y
132+
* @param z
133+
* Z
134+
* @since 1.0
135+
*/
136+
ItemStack[] getAllExceptedResult(World world, int x, int y, int z);
137+
138+
/**
139+
* 収穫結果を返します。ドロップ処理等は行いません。
140+
* <p/>
141+
* Return harvest-result items and do not any more.
142+
*
143+
* @param player
144+
* Nonnull
145+
* <p/>
146+
* the Harvester
147+
* @param random
148+
* Nonnull
149+
* <p/>
150+
* Randomize
151+
* @param world
152+
* Nonnull
153+
* <p/>
154+
* the World
155+
* @param x
156+
* X
157+
* @param y
158+
* Y
159+
* @param z
160+
* Z
161+
* @since 1.0
162+
*/
163+
ItemStack[] harvest(EntityPlayer player, Random random, World world, int x, int y, int z);
164+
165+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.block;
2+
3+
/**
4+
* 鉱石ブロックのインターフェースです。
5+
* <p/>
6+
* Ore Block Interface.
7+
*
8+
* @author CrafterKina
9+
* @version 1.0
10+
* @since 1.0
11+
*/
12+
public interface IOre{}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@API(apiVersion = "1.0", owner = "jp.MinecraftModderJapan.ModCooperationAPI", provides = "jp.MinecraftModderJapan.ModCooperationAPI.api.block")
2+
package jp.MinecraftModderJapan.ModCooperationAPI.api.block;
3+
4+
import cpw.mods.fml.common.API;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.entity;
2+
3+
import net.minecraft.item.ItemStack;
4+
5+
/**
6+
* 繁殖可能なEntityのインターフェース
7+
* <p/>
8+
* Breedable mobs interface.
9+
*
10+
* @author CrafterKina
11+
* @version 1.0
12+
* @since 1.0
13+
*/
14+
public interface IBreedable{
15+
/**
16+
* @param stack
17+
* CheckForNull
18+
* <p/>
19+
* the Item
20+
* @see net.minecraft.entity.passive.EntityAnimal#isBreedingItem(ItemStack) it is same.
21+
* @since 1.0
22+
*/
23+
boolean canBreedBy(ItemStack stack);
24+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.entity;
2+
3+
import net.minecraft.entity.Entity;
4+
5+
/**
6+
* 乗れるEntityのインターフェース。
7+
* <p/>
8+
* Rideable entity interface.
9+
*
10+
* @author CrafterKina
11+
* @version 1.0
12+
* @since 1.0
13+
*/
14+
public interface IRidden{
15+
/**
16+
* 乗る。
17+
* <p/>
18+
* ride.
19+
*
20+
* @param entity
21+
* Nonnull
22+
* <p/>
23+
* to ride
24+
* @return success
25+
* @since 1.0
26+
*/
27+
boolean ride(Entity entity);
28+
29+
30+
/**
31+
* 降ろす。
32+
* <p/>
33+
* unload.
34+
*
35+
* @param entity
36+
* Nonnull
37+
* <p/>
38+
* to unload
39+
* @return success
40+
* @since 1.0
41+
*/
42+
boolean unload(Entity entity);
43+
44+
/**
45+
* 乗っているすべてのEntityを返す。
46+
* <p/>
47+
* All the riding on this.
48+
*
49+
* @since 1.0
50+
*/
51+
Entity[] getRiddenBy();
52+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@API(apiVersion = "1.0", owner = "jp.MinecraftModderJapan.ModCooperationAPI", provides = "jp.MinecraftModderJapan.ModCooperationAPI.api.entity")
2+
package jp.MinecraftModderJapan.ModCooperationAPI.api.entity;
3+
4+
import cpw.mods.fml.common.API;
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package jp.MinecraftModderJapan.ModCooperationAPI.api.item;
2+
3+
import net.minecraft.entity.player.EntityPlayer;
4+
import net.minecraft.item.ItemStack;
5+
6+
/**
7+
* 本のためのインターフェイス。
8+
* <p/>
9+
* Interface for the book.
10+
*
11+
* @author Shift02
12+
* @version 1.0
13+
* @since 1.0
14+
*/
15+
public interface IBook{
16+
17+
/**
18+
* GUIを持っているか。
19+
* <p/>
20+
* the book has gui.
21+
*
22+
* @param book
23+
* Nonnull
24+
* <p/>
25+
* Instance of the book stack.
26+
* @return 持っている場合はtrue If the book has, "true"
27+
* @since 1.0
28+
*/
29+
boolean hasGUI(ItemStack book);
30+
31+
/**
32+
* GUIを開けることができるか。
33+
* <p/>
34+
* player can open gui.
35+
*
36+
* @param player
37+
* Nonnull
38+
* <p/>
39+
* the Player
40+
* @param book
41+
* Nonnull
42+
* <p/>
43+
* Instance of the book stack.
44+
* @return 開くことができるならtrue。 If player can open gui, true.
45+
* @since 1.0
46+
*/
47+
boolean canOpenGUI(EntityPlayer player, ItemStack book);
48+
49+
/**
50+
* GUIを開く。
51+
* <p/>
52+
* Open the GUI.
53+
*
54+
* @param player
55+
* Nonnull
56+
* <p/>
57+
* the Player
58+
* @param book
59+
* Nonnull
60+
* <p/>
61+
* Instance of the book stack.
62+
* @since 1.0
63+
*/
64+
ItemStack openGUI(EntityPlayer player, ItemStack book);
65+
66+
}

0 commit comments

Comments
 (0)