Skip to content

Commit 4c8d346

Browse files
committed
Trying to add custom block mining speed
1 parent 0816c29 commit 4c8d346

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/java/xyz/prismenetwork/kelpmodloader/Block/RegisterBlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ public class RegisterBlock {
88
* @param name The name that will be used to refer to this block.
99
* @param texture The name of the texture that will be displayed on this block.
1010
*/
11-
public void Register(String name, String texture) {
11+
public void Register(String name, String texture, int BreakTime) {
1212
int id = Constant.blockCount;
1313
Constant.blockCount++;
1414
ModdedBlock block = new ModdedBlock();
1515
block.setID(id);
1616
block.TextureName = texture;
1717
block.name = name;
18+
block.setBreakTime(BreakTime);
1819
Constant.Blocks.add(block);
1920

2021
}

src/main/java/xyz/prismenetwork/kelpmodloader/Mods/ModsLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void load() {
105105
});
106106

107107
mods.Blocks.forEach(b -> {
108-
new RegisterBlock().Register((String) b.get(0),(String) b.get(1));
108+
new RegisterBlock().Register((String) b.get(0),(String) b.get(1), (Integer) b.get(2));
109109
});
110110

111111
mods.Textures.forEach(t -> {

src/main/java/xyz/prismenetwork/kelpmodloader/ModsAPI/Mods.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ public void addItem(String name, String lore, String texture, Material material,
6969
* @param name The name that will be used to refer to this block.
7070
* @param texture The name of the texture that will be displayed on this block.
7171
*/
72-
public void addBlock(String name, String texture) {
72+
public void addBlock(String name, String texture, int BreakTime) {
7373
ArrayList Block = new ArrayList<>();
7474
Block.add(name);
7575
Block.add(texture);
76+
Block.add(BreakTime);
7677
Blocks.add(Block);
7778
}
7879
/**

0 commit comments

Comments
 (0)