Skip to content

Commit

Permalink
Add new some blocks (#47)
Browse files Browse the repository at this point in the history
* Add Support 1.20.4 & Add SWEET_BERRY_BUSH

* Add Messages & Fix typo

* Add Decorated Pot

* Update FlowerRegistry.java

* Update zh_tw.yml

* Fix bug & Add something

Add:
- Attached Pumpkin Stem
- Pumpkin Stem
- Attached Melon Stem
- Melon Stem

* Add Beetroot

* Update zh_tw.yml

* Update zh_tw.yml
  • Loading branch information
TWME-TW authored Dec 21, 2023
1 parent b92d470 commit a7503e5
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:1.6.25")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.7.0")
implementation("fr.minuskube.inv:smart-invs:1.2.7") {
Expand Down
53 changes: 52 additions & 1 deletion src/main/java/cm/ptks/craftflowers/flower/FlowerRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ public class FlowerRegistry {
}

registerFlower(new Flower(Material.DEAD_BUSH, Messages.FLOWER.DEAD_BUSH));
registerFlower(new Flower(Material.GRASS, Messages.FLOWER.GRASS));

if (isValidMaterial("GRASS")){
registerFlower(new Flower(Material.getMaterial("GRASS"), Messages.FLOWER.GRASS));
} else { /* 1.20.3+ */
registerFlower(new Flower(Material.getMaterial("SHORT_GRASS"),Messages.FLOWER.GRASS));
}
registerFlower(new Flower(Material.FERN, Messages.FLOWER.FERN));
registerFlower(new Flower(Material.NETHER_BRICK_FENCE, Messages.FLOWER.NETHER_BRICK_FENCE));

Expand Down Expand Up @@ -183,6 +188,10 @@ public class FlowerRegistry {
registerFlower(new Flower(Material.CHERRY_LEAVES, Messages.FLOWER.CHERRY_FENCE));
}

if (isValidMaterial("DECORATED_POT") /* 1.20.3+ */) {
registerFlower(new Flower(Material.DECORATED_POT, Messages.FLOWER.DECORATED_POT));
}

if(isValidMaterial("AZALEA")) {
registerFlower(new Flower(Material.AZALEA_LEAVES, Messages.FLOWER.AZALEA_LEAVES));
registerFlower(new Flower(Material.FLOWERING_AZALEA_LEAVES, Messages.FLOWER.FLOWERING_AZALEA_LEAVES));
Expand Down Expand Up @@ -262,6 +271,48 @@ public class FlowerRegistry {
new AgingFlower(Material.CARROT, Messages.FLOWER.CARROT, Material.CARROTS, 6),
new AgingFlower(Material.CARROT, Messages.FLOWER.CARROT, Material.CARROTS, 7)
)));

registerFlower(new FlowerGroup(Material.BEETROOT,Messages.FLOWER.BEETROOT, Arrays.asList(
new AgingFlower(Material.BEETROOT,Messages.FLOWER.BEETROOT,Material.BEETROOTS,0),
new AgingFlower(Material.BEETROOT,Messages.FLOWER.BEETROOT,Material.BEETROOTS,1),
new AgingFlower(Material.BEETROOT,Messages.FLOWER.BEETROOT,Material.BEETROOTS,2),
new AgingFlower(Material.BEETROOT,Messages.FLOWER.BEETROOT,Material.BEETROOTS,3)
)));

registerFlower(new Flower(Material.PUMPKIN_SEEDS,Messages.FLOWER.ATTACHED_PUMPKIN_STEM,Material.ATTACHED_PUMPKIN_STEM));

registerFlower(new FlowerGroup(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Arrays.asList(
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,0),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,1),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,2),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,3),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,4),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,5),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,6),
new AgingFlower(Material.PUMPKIN_SEEDS,Messages.FLOWER.PUMPKIN_STEM,Material.PUMPKIN_STEM,7)
)));

registerFlower(new Flower(Material.MELON_SEEDS,Messages.FLOWER.ATTACHED_MELON_STEM,Material.ATTACHED_MELON_STEM));

registerFlower(new FlowerGroup(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Arrays.asList(
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,0),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,1),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,2),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,3),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,4),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,5),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,6),
new AgingFlower(Material.MELON_SEEDS,Messages.FLOWER.MELON_STEM,Material.MELON_STEM,7)
)));

if (isValidMaterial("SWEET_BERRY_BUSH")){
registerFlower(new FlowerGroup(Material.SWEET_BERRIES,Messages.FLOWER.SWEET_BERRY_BUSH, Arrays.asList(
new AgingFlower(Material.SWEET_BERRIES, Messages.FLOWER.SWEET_BERRY_BUSH, Material.SWEET_BERRY_BUSH,0),
new AgingFlower(Material.SWEET_BERRIES, Messages.FLOWER.SWEET_BERRY_BUSH, Material.SWEET_BERRY_BUSH,1),
new AgingFlower(Material.SWEET_BERRIES, Messages.FLOWER.SWEET_BERRY_BUSH, Material.SWEET_BERRY_BUSH,2),
new AgingFlower(Material.SWEET_BERRIES, Messages.FLOWER.SWEET_BERRY_BUSH, Material.SWEET_BERRY_BUSH,3)
)));
}
registerFlower(new Flower(Material.BARRIER, Messages.FLOWER.AIR, Material.AIR));
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/cm/ptks/craftflowers/languages/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public final static class FLOWER {
public static final String AZALEA_LEAVES = "FLOWER.AZALEA_LEAVES";
public static final String CHERRY_LEAVES = "FLOWER.CHERRY_LEAVES";
public static final String FLOWERING_AZALEA_LEAVES = "FLOWER.FLOWERING_AZALEA_LEAVES";

public static final String GLOW_BERRIES = "FLOWER.GLOW_BERRIES";
public static final String BIG_DRIPLEAF = "FLOWER.BIG_DRIPLEAF";
public static final String BIG_DRIPLEAF_STEM = "FLOWER.BIG_DRIPLEAF_STEM";
Expand All @@ -147,6 +148,8 @@ public final static class FLOWER {
public static final String MANGROVE_LEAVES = "FLOWER.MANGROVE_LEAVES";
public static final String MANGROVE_PROPAGULE = "FLOWER.MANGROVE_PROPAGULE";

public static final String DECORATED_POT = "FLOWER.DECORATED_POT";

public static final String OAK_LEAVES = "FLOWER.OAK_LEAVES";
public static final String SPRUCE_LEAVES = "FLOWER.SPRUCE_LEAVES";
public static final String BIRCH_LEAVES = "FLOWER.BIRCH_LEAVES";
Expand Down Expand Up @@ -185,6 +188,13 @@ public final static class FLOWER {
public static final String WHEAT = "FLOWER.WHEAT";
public static final String POTATO = "FLOWER.POTATO";
public static final String CARROT = "FLOWER.CARROT";
public static final String BEETROOT = "FLOWER.BEETROOT";
public static final String ATTACHED_PUMPKIN_STEM = "FLOWER.ATTACHED_PUMPKIN_STEM";
public static final String PUMPKIN_STEM = "FLOWER.PUMPKIN_STEM";
public static final String ATTACHED_MELON_STEM = "FLOWER.ATTACHED_MELON_STEM";
public static final String MELON_STEM = "FLOWER.MELON_STEM";

public static final String SWEET_BERRY_BUSH = "FLOWER.SWEET_BERRY_BUSH";

public static final String AIR = "FLOWER.AIR";

Expand Down
44 changes: 44 additions & 0 deletions src/main/resources/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ FLOWER:
MANGROVE_ROOTS: "§2Mangrove Roots"
MANGROVE_LEAVES: "§2Mangrove Leaves"
MANGROVE_PROPAGULE: "§2Mangrove Propagule"

# 1.20.3+
DECORATED_POT: "§2Decorated Pot"

OAK_LEAVES: "§2Oak Leaves"
SPRUCE_LEAVES: "§2Spruce Leaves"
Expand Down Expand Up @@ -201,6 +204,47 @@ FLOWER:
CARROT_6: "§2Carrot"
CARROT_7: "§2Carrot"

BEETROOT: "§2Beetroot"
BEETROOT_AGE:
BEETROOT_0: "§2Beetroot"
BEETROOT_1: "§2Beetroot"
BEETROOT_2: "§2Beetroot"
BEETROOT_3: "§2Beetroot"

ATTACHED_PUMPKIN_STEM: "§2Attached Pumpkin Stem"

PUMPKIN_STEM: "§2Pumpkin Stem"
PUMPKIN_STEM_AGE:
PUMPKIN_STEM_0: "§2Pumpkin Stem"
PUMPKIN_STEM_1: "§2Pumpkin Stem"
PUMPKIN_STEM_2: "§2Pumpkin Stem"
PUMPKIN_STEM_3: "§2Pumpkin Stem"
PUMPKIN_STEM_4: "§2Pumpkin Stem"
PUMPKIN_STEM_5: "§2Pumpkin Stem"
PUMPKIN_STEM_6: "§2Pumpkin Stem"
PUMPKIN_STEM_7: "§2Pumpkin Stem"

ATTACHED_MELON_STEM: "§2Attached Melon Stem"

MELON_STEM: "§2Melon Stem"
MELON_STEM_AGE:
MELOM_STEM_0: "§2Melon Stem"
MELOM_STEM_1: "§2Melon Stem"
MELOM_STEM_2: "§2Melon Stem"
MELOM_STEM_3: "§2Melon Stem"
MELON_STEM_4: "§2Melon Stem"
MELON_STEM_5: "§2Melon Stem"
MELON_STEM_6: "§2Melon Stem"
MELON_STEM_7: "§2Melon Stem"

SWEET_BERRY_BUSH: "§2Sweet Berry Bush"
SWEET_BERRY_BUSH_AGE:
SWEET_BERRY_BUSH_0: "§2Sweet Berry Bush"
SWEET_BERRY_BUSH_1: "§2Sweet Berry Bush"
SWEET_BERRY_BUSH_2: "§2Sweet Berry Bush"
SWEET_BERRY_BUSH_3: "§2Sweet Berry Bush"
SWEET_BERRY_BUSH_4: "§2Sweet Berry Bush"

AIR: "§2Air Block"

CANDLE:
Expand Down
44 changes: 44 additions & 0 deletions src/main/resources/lang/zh_tw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ FLOWER:
MANGROVE_ROOTS: "§2紅樹林木根"
MANGROVE_LEAVES: "§2紅樹林木樹葉"
MANGROVE_PROPAGULE: "§2紅樹林木胎生苗"

# 1.20.3+
DECORATED_POT: "§2裝飾陶罐"

OAK_LEAVES: "§2橡木樹葉"
SPRUCE_LEAVES: "§2杉木樹葉"
Expand Down Expand Up @@ -204,6 +207,47 @@ FLOWER:
CARROT_6: "§2胡蘿蔔"
CARROT_7: "§2胡蘿蔔"

BEETROOT: "§2甜菜根"
BEETROOT_AGE:
BEETROOT_0: "§2甜菜根"
BEETROOT_1: "§2甜菜根"
BEETROOT_2: "§2甜菜根"
BEETROOT_3: "§2甜菜根"

ATTACHED_PUMPKIN_STEM: "§2連接的南瓜梗"

PUMPKIN_STEM: "§2南瓜梗"
PUMPKIN_STEM_AGE:
PUMPKIN_STEM_0: "§2南瓜梗"
PUMPKIN_STEM_1: "§2南瓜梗"
PUMPKIN_STEM_2: "§2南瓜梗"
PUMPKIN_STEM_3: "§2南瓜梗"
PUMPKIN_STEM_4: "§2南瓜梗"
PUMPKIN_STEM_5: "§2南瓜梗"
PUMPKIN_STEM_6: "§2南瓜梗"
PUMPKIN_STEM_7: "§2南瓜梗"

ATTACHED_MELON_STEM: "§2連接的西瓜梗"

ELON_STEM: "§2西瓜梗"
MELON_STEM_AGE:
MELON_STEM_0: "§2西瓜梗"
MELON_STEM_1: "§2西瓜梗"
MELON_STEM_2: "§2西瓜梗"
MELON_STEM_3: "§2西瓜梗"
MELON_STEM_4: "§2西瓜梗"
MELON_STEM_5: "§2西瓜梗"
MELON_STEM_6: "§2西瓜梗"
MELON_STEM_7: "§2西瓜梗"

SWEET_BERRY_BUSH: "§2甜莓灌木叢"
SWEET_BERRY_BUSH_AGE:
SWEET_BERRY_BUSH_0: "§2甜莓灌木叢"
SWEET_BERRY_BUSH_1: "§2甜莓灌木叢"
SWEET_BERRY_BUSH_2: "§2甜莓灌木叢"
SWEET_BERRY_BUSH_3: "§2甜莓灌木叢"
SWEET_BERRY_BUSH_4: "§2甜莓灌木叢"

AIR: "§2空氣方塊"

CANDLE:
Expand Down

0 comments on commit a7503e5

Please sign in to comment.