Skip to content

Commit

Permalink
Trying to add custom block mining speed
Browse files Browse the repository at this point in the history
  • Loading branch information
tbvns committed Jan 29, 2024
1 parent 0816c29 commit 4c8d346
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ public class RegisterBlock {
* @param name The name that will be used to refer to this block.
* @param texture The name of the texture that will be displayed on this block.
*/
public void Register(String name, String texture) {
public void Register(String name, String texture, int BreakTime) {
int id = Constant.blockCount;
Constant.blockCount++;
ModdedBlock block = new ModdedBlock();
block.setID(id);
block.TextureName = texture;
block.name = name;
block.setBreakTime(BreakTime);
Constant.Blocks.add(block);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void load() {
});

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

mods.Textures.forEach(t -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ public void addItem(String name, String lore, String texture, Material material,
* @param name The name that will be used to refer to this block.
* @param texture The name of the texture that will be displayed on this block.
*/
public void addBlock(String name, String texture) {
public void addBlock(String name, String texture, int BreakTime) {
ArrayList Block = new ArrayList<>();
Block.add(name);
Block.add(texture);
Block.add(BreakTime);
Blocks.add(Block);
}
/**
Expand Down

0 comments on commit 4c8d346

Please sign in to comment.