9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-22 16:39:36 +00:00
This commit is contained in:
Xiao-MoMi
2022-08-25 13:18:21 +08:00
parent 0117b9b056
commit c225cb4d84
37 changed files with 1001 additions and 1146 deletions

View File

@@ -1,138 +0,0 @@
info:
namespace: customcrops
items:
cabbage_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: cabbage/stage_1
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
cabbage_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: cabbage/stage_2
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
cabbage_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: cabbage/stage_3
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
cabbage_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: cabbage/stage_4
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
cabbage_seeds:
display_name: "卷心菜种子"
resource:
generate: false
material: PAPER
model_path: cabbage/cabbage_seeds
cabbage:
display_name: "卷心菜"
resource:
generate: false
material: APPLE
model_path: cabbage/cabbage
cabbage_silver_star:
display_name: "卷心菜"
resource:
generate: false
material: APPLE
model_path: cabbage/cabbage_silver_star
cabbage_golden_star:
display_name: "卷心菜"
resource:
generate: false
material: APPLE
model_path: cabbage/cabbage_golden_star
gigantic_cabbage:
display_name: "巨型卷心菜"
resource:
generate: false
material: PAPER
model_path: cabbage/gigantic_cabbage
specific_properties:
block:
placed_model:
type: REAL_TRANSPARENT
loots:
blocks:
cabbage_stage_1:
type: customcrops:cabbage_stage_1
items:
result_1:
item: customcrops:cabbage_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
cabbage_stage_2:
type: customcrops:cabbage_stage_2
items:
result_1:
item: customcrops:cabbage_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
cabbage_stage_3:
type: customcrops:cabbage_stage_3
items:
result_1:
item: customcrops:cabbage_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
# cabbage_stage_4:
# type: customcrops:cabbage_stage_4
# items:
# result_1:
# item: customcrops:cabbage
# min_amount: 1
# max_amount: 3
# chance: 100

View File

@@ -1,80 +0,0 @@
info:
namespace: customcrops
categories:
customcrops:
enabled: true
icon: customcrops:tomato_seeds
name: '自定义农作物'
items:
- customcrops:pot
- customcrops:watered_pot
- customcrops:sprinkler_1_item
- customcrops:sprinkler_2_item
- customcrops:greenhouse_glass
- customcrops:soil_detector
- customcrops:watering_can_1
- customcrops:watering_can_2
- customcrops:watering_can_3
- customcrops:watering_can_4
- customcrops:speed_1
- customcrops:speed_2
- customcrops:speed_3
- customcrops:retaining_1
- customcrops:retaining_2
- customcrops:retaining_3
- customcrops:quality_1
- customcrops:quality_2
- customcrops:quality_3
- customcrops:tomato
- customcrops:tomato_silver_star
- customcrops:tomato_golden_star
- customcrops:tomato_seeds
- customcrops:tomato_stage_1
- customcrops:tomato_stage_2
- customcrops:tomato_stage_3
- customcrops:tomato_stage_4
- customcrops:gigantic_tomato
- customcrops:cabbage
- customcrops:cabbage_silver_star
- customcrops:cabbage_golden_star
- customcrops:cabbage_seeds
- customcrops:cabbage_stage_1
- customcrops:cabbage_stage_2
- customcrops:cabbage_stage_3
- customcrops:cabbage_stage_4
- customcrops:gigantic_cabbage
- customcrops:grape
- customcrops:grape_silver_star
- customcrops:grape_golden_star
- customcrops:grape_seeds
- customcrops:grape_stage_1
- customcrops:grape_stage_2
- customcrops:grape_stage_3
- customcrops:grape_stage_4
- customcrops:grape_stage_5
- customcrops:grape_stage_6
- customcrops:corn
- customcrops:corn_silver_star
- customcrops:corn_golden_star
- customcrops:corn_seeds
- customcrops:corn_stage_1
- customcrops:corn_stage_2
- customcrops:corn_stage_3
- customcrops:corn_stage_4
- customcrops:pepper
- customcrops:pepper_silver_star
- customcrops:pepper_golden_star
- customcrops:pepper_seeds
- customcrops:pepper_stage_1
- customcrops:pepper_stage_2
- customcrops:pepper_stage_3
- customcrops:pepper_stage_4
- customcrops:pepper_stage_5
- customcrops:garlic
- customcrops:garlic_silver_star
- customcrops:garlic_golden_star
- customcrops:garlic_seeds
- customcrops:garlic_stage_1
- customcrops:garlic_stage_2
- customcrops:garlic_stage_3
- customcrops:garlic_stage_4

View File

@@ -1,129 +0,0 @@
info:
namespace: customcrops
items:
corn_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: corn/stage_1
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
corn_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: corn/stage_2
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
corn_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: corn/stage_3
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
corn_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: corn/stage_4
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
corn_seeds:
display_name: "玉米种子"
resource:
generate: false
material: PAPER
model_path: corn/corn_seeds
corn:
display_name: "玉米"
resource:
generate: false
material: APPLE
model_path: corn/corn
corn_silver_star:
display_name: "玉米"
resource:
generate: false
material: APPLE
model_path: corn/corn_silver_star
corn_golden_star:
display_name: "玉米"
resource:
generate: false
material: APPLE
model_path: corn/corn_golden_star
loots:
blocks:
corn_stage_1:
type: customcrops:corn_stage_1
items:
result_1:
item: customcrops:corn_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
corn_stage_2:
type: customcrops:corn_stage_2
items:
result_1:
item: customcrops:corn_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
corn_stage_3:
type: customcrops:corn_stage_3
items:
result_1:
item: customcrops:corn_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
# corn_stage_4:
# type: customcrops:corn_stage_4
# items:
# result_1:
# item: customcrops:corn
# min_amount: 1
# max_amount: 1
# chance: 100
# ignore_fortune: true

View File

@@ -1,128 +0,0 @@
info:
namespace: customcrops
items:
garlic_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: garlic/stage_1
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
garlic_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: garlic/stage_2
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
garlic_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: garlic/stage_3
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
garlic_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: garlic/stage_4
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
garlic_seeds:
display_name: "大蒜种子"
resource:
generate: false
material: PAPER
model_path: garlic/garlic_seeds
garlic:
display_name: "大蒜"
resource:
generate: false
material: APPLE
model_path: garlic/garlic
garlic_silver_star:
display_name: "大蒜"
resource:
generate: false
material: APPLE
model_path: garlic/garlic_silver_star
garlic_golden_star:
display_name: "大蒜"
resource:
generate: false
material: APPLE
model_path: garlic/garlic_golden_star
loots:
blocks:
garlic_stage_1:
type: customcrops:garlic_stage_1
items:
result_1:
item: customcrops:garlic_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
garlic_stage_2:
type: customcrops:garlic_stage_2
items:
result_1:
item: customcrops:garlic_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
garlic_stage_3:
type: customcrops:garlic_stage_3
items:
result_1:
item: customcrops:garlic_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
# garlic_stage_4:
# type: customcrops:garlic_stage_4
# items:
# result_1:
# item: customcrops:garlic
# min_amount: 1
# max_amount: 3
# chance: 100

View File

@@ -1,186 +0,0 @@
#############################################
#############################################
## ##
## 本配置文件为范例 ##
## 仅作为参考测试用 ##
## ##
#############################################
#############################################
info:
namespace: customcrops
items:
grape_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_1
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_2
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_3
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_4
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_stage_5:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_5
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_stage_6:
display_name: ""
resource:
generate: false
material: PAPER
model_path: grape/stage_6
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
grape_seeds:
display_name: "葡萄种子"
resource:
generate: false
material: PAPER
model_path: grape/grape_seeds
grape:
display_name: "葡萄"
resource:
generate: false
material: APPLE
model_path: grape/grape
grape_silver_star:
display_name: "葡萄"
resource:
generate: false
material: APPLE
model_path: grape/grape_silver_star
grape_golden_star:
display_name: "葡萄"
resource:
generate: false
material: APPLE
model_path: grape/grape_golden_star
loots:
blocks:
grape_stage_1:
type: customcrops:grape_stage_1
items:
result_1:
item: customcrops:grape_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
grape_stage_2:
type: customcrops:grape_stage_2
items:
result_1:
item: customcrops:grape_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
grape_stage_3:
type: customcrops:grape_stage_3
items:
result_1:
item: customcrops:grape_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
grape_stage_4:
type: customcrops:grape_stage_4
items:
result_1:
item: customcrops:grape_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
grape_stage_5:
type: customcrops:grape_stage_5
items:
result_1:
item: customcrops:grape_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
# grape_stage_6:
# type: customcrops:grape_stage_6
# items:
# result_1:
# item: customcrops:grape
# min_amount: 1
# max_amount: 3
# chance: 100

View File

@@ -0,0 +1,313 @@
info:
namespace: customcrops
items:
######################
# Pot #
######################
pot:
display_name: Pot
#display_name: 种植盆
resource:
material: PAPER
generate: false
model_path: 'base/pot'
specific_properties:
block:
placed_model:
type: REAL_NOTE
break_particles: ITEM
sound:
place:
name: block.wood.place
break:
name: block.wood.break
watered_pot:
display_name: Watered Pot
#display_name: 湿润的种植盆
resource:
material: PAPER
generate: false
model_path: 'base/watered_pot'
specific_properties:
block:
placed_model:
type: REAL_NOTE
break_particles: ITEM
cancel_drop: true
sound:
place:
name: block.wood.place
break:
name: block.wood.break
############################################
# #
# ItemFrame / ArmorStand #
# Recommend using armor_stand because #
# it's easier for player to interact #
# #
############################################
sprinkler_1:
display_name: Sprinkler3D
#display_name: 洒水器
resource:
material: PAPER
generate: false
model_path: 'base/sprinkler_1'
behaviours:
furniture:
entity: armor_stand
fixed_rotation: true
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 0.6
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_armorstand:
break:
drop_item:
item: sprinkler_1_item
sprinkler_1_item:
display_name: Sprinkler
#display_name: 洒水器
resource:
generate: false
material: PAPER
model_path: base/sprinkler_1_item
sprinkler_2:
display_name: Sprinkler3D
#display_name: 优质洒水器
resource:
material: PAPER
generate: false
model_path: 'base/sprinkler_2'
behaviours:
furniture:
entity: armor_stand
fixed_rotation: true
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 0.6
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_armorstand:
break:
drop_item:
item: sprinkler_2_item
sprinkler_2_item:
display_name: Sprinkler
#display_name: 优质洒水器
resource:
generate: false
material: PAPER
model_path: base/sprinkler_2_item
####################
# GreenHouse #
####################
greenhouse_glass:
display_name: Greenhouse Glass
#display_name: 温室玻璃
resource:
material: PAPER
generate: false
model_path: 'base/greenhouse_glass'
specific_properties:
block:
placed_model:
type: REAL_TRANSPARENT
break_particles: ITEM
sound:
place:
name: block.glass.place
break:
name: block.glass.break
####################
# Stage #
####################
crop_stage_death:
display_name: Dead Crops
#display_name: 枯萎的农作物
resource:
generate: false
material: PAPER
model_path: base/death_crop
behaviours:
furniture:
entity: item_frame
fixed_rotation: false
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 1
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_itemframe:
break:
play_sound:
name: block.azalea.break
volume: 1
pitch: 1
####################
# Watering Can #
####################
watering_can_1:
display_name: Copper Watering Can
#display_name: 铜水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_1
watering_can_2:
display_name: Steel Watering Can
#display_name: 钢水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_2
watering_can_3:
display_name: Golden Watering Can
#display_name: 金水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_3
watering_can_4:
display_name: Iridium Watering Can
#display_name: 铱金水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_4
####################
# Fertilizer #
####################
speed_1:
display_name: Speed-Gro
#display_name: 生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_1
speed_2:
display_name: Deluxe Speed-Gro
#display_name: 高级生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_2
speed_3:
display_name: Hyper Speed-Gro
#display_name: 超级生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_3
retaining_1:
display_name: Basic Retaining Soil
#display_name: 基础保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_1
retaining_2:
display_name: Quality Retaining Soil
#display_name: 品质保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_2
retaining_3:
display_name: Deluxe Retaining Soil
#display_name: 高级保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_3
quality_1:
display_name: Basic Fertilizer
#display_name: 基础肥料
resource:
generate: false
material: PAPER
model_path: base/quality_1
quality_2:
display_name: Quality Fertilizer
#display_name: 优质肥料
resource:
generate: false
material: PAPER
model_path: base/quality_2
quality_3:
display_name: Deluxe Fertilizer
#display_name: 高级肥料
resource:
generate: false
material: PAPER
model_path: base/quality_3
quantity_1:
display_name: Basic Yield Increasing
#display_name: 基础增产
resource:
generate: false
material: PAPER
model_path: base/quantity_1
quantity_2:
display_name: Quality Yield Increasing
#display_name: 优质增产
resource:
generate: false
material: PAPER
model_path: base/quantity_2
quantity_3:
display_name: Deluxe Yield Increasing
#display_name: 高级增产
resource:
generate: false
material: PAPER
model_path: base/quantity_3
soil_detector:
display_name: Soil Surveyor
#display_name: 肥料勘测器
resource:
generate: false
material: PAPER
model_path: base/soil_detector
loots:
blocks:
watered_pot:
type: customcrops:watered_pot
items:
result_1:
item: customcrops:pot
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true

View File

@@ -0,0 +1,156 @@
info:
namespace: customcrops
items:
tomato_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: tomato/stage_1
behaviours:
furniture:
entity: item_frame
fixed_rotation: false
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 1
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_itemframe:
break:
play_sound:
name: block.azalea.break
volume: 1
pitch: 1
drop_item:
item: tomato_seeds
tomato_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: tomato/stage_2
behaviours:
furniture:
entity: item_frame
fixed_rotation: false
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 1
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_itemframe:
break:
play_sound:
name: block.azalea.break
volume: 1
pitch: 1
drop_item:
item: tomato_seeds
tomato_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: tomato/stage_3
behaviours:
furniture:
entity: item_frame
fixed_rotation: false
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 1
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_itemframe:
break:
play_sound:
name: block.azalea.break
volume: 1
pitch: 1
drop_item:
item: tomato_seeds
tomato_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: tomato/stage_4
behaviours:
furniture:
entity: item_frame
fixed_rotation: false
solid: false
cancel_drop: true
hitbox:
length: 1
width: 1
height: 1
placeable_on:
walls: false
ceiling: false
floor: true
events:
placed_itemframe:
break:
play_sound:
name: block.azalea.break
volume: 1
pitch: 1
tomato_seeds:
display_name: "Tomato Seeds"
#display_name: 番茄种子
resource:
generate: false
material: PAPER
model_path: tomato/tomato_seeds
tomato:
display_name: "Tomato"
#display_name: 番茄
resource:
generate: false
material: APPLE
model_path: tomato/tomato
tomato_silver_star:
display_name: "Tomato (Silver Star)"
#display_name: 番茄(银星)
resource:
generate: false
material: APPLE
model_path: tomato/tomato_silver_star
tomato_golden_star:
display_name: "Tomato (Golden Star)"
#display_name: 番茄(金星)
resource:
generate: false
material: APPLE
model_path: tomato/tomato_golden_star
gigantic_tomato:
display_name: "Overgrown Tomato"
#display_name: 巨型番茄
resource:
generate: false
material: PAPER
model_path: tomato/gigantic_tomato
specific_properties:
block:
placed_model:
type: REAL_TRANSPARENT

View File

@@ -1,153 +0,0 @@
info:
namespace: customcrops
items:
pepper_stage_1:
display_name: ""
resource:
generate: false
material: PAPER
model_path: pepper/stage_1
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
pepper_stage_2:
display_name: ""
resource:
generate: false
material: PAPER
model_path: pepper/stage_2
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
pepper_stage_3:
display_name: ""
resource:
generate: false
material: PAPER
model_path: pepper/stage_3
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
pepper_stage_4:
display_name: ""
resource:
generate: false
material: PAPER
model_path: pepper/stage_4
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
pepper_stage_5:
display_name: ""
resource:
generate: false
material: PAPER
model_path: pepper/stage_5
specific_properties:
block:
placed_model:
type: REAL_WIRE
cancel_drop: true
sound:
place:
name: block.azalea.place
break:
name: block.azalea.break
pepper_seeds:
display_name: "辣椒种子"
resource:
generate: false
material: PAPER
model_path: pepper/pepper_seeds
pepper:
display_name: "辣椒"
resource:
generate: false
material: APPLE
model_path: pepper/pepper
pepper_silver_star:
display_name: "辣椒"
resource:
generate: false
material: APPLE
model_path: pepper/pepper_silver_star
pepper_golden_star:
display_name: "辣椒"
resource:
generate: false
material: APPLE
model_path: pepper/pepper_golden_star
loots:
blocks:
pepper_stage_1:
type: customcrops:pepper_stage_1
items:
result_1:
item: customcrops:pepper_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
pepper_stage_2:
type: customcrops:pepper_stage_2
items:
result_1:
item: customcrops:pepper_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
pepper_stage_3:
type: customcrops:pepper_stage_3
items:
result_1:
item: customcrops:pepper_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
pepper_stage_4:
type: customcrops:pepper_stage_4
items:
result_1:
item: customcrops:pepper_seeds
min_amount: 1
max_amount: 1
chance: 100
ignore_fortune: true
# pepper_stage_5:
# type: customcrops:pepper_stage_5
# items:
# result_1:
# item: customcrops:pepper
# min_amount: 1
# max_amount: 3
# chance: 100

View File

@@ -2,13 +2,11 @@ info:
namespace: customcrops
items:
######################
# 种植盆 #
# Pot #
######################
pot:
item_flags:
- HIDE_ATTRIBUTES
- HIDE_ENCHANTS
display_name: 种植盆
display_name: Pot
#display_name: 种植盆
resource:
material: PAPER
generate: false
@@ -24,7 +22,8 @@ items:
break:
name: block.wood.break
watered_pot:
display_name: 湿润的种植盆
display_name: Watered Pot
#display_name: 湿润的种植盆
resource:
material: PAPER
generate: false
@@ -41,11 +40,16 @@ items:
break:
name: block.wood.break
######################
# 洒水器 #
######################
############################################
# #
# ItemFrame / ArmorStand #
# Recommend using armor_stand because #
# it's easier for player to interact #
# #
############################################
sprinkler_1:
display_name: 洒水器3D
display_name: Sprinkler3D
#display_name: 洒水器
resource:
material: PAPER
generate: false
@@ -70,13 +74,15 @@ items:
drop_item:
item: sprinkler_1_item
sprinkler_1_item:
display_name: 洒水器
display_name: Sprinkler
#display_name: 洒水器
resource:
generate: false
material: PAPER
model_path: base/sprinkler_1_item
sprinkler_2:
display_name: 优质洒水器3D
display_name: Sprinkler3D
#display_name: 优质洒水器
resource:
material: PAPER
generate: false
@@ -101,17 +107,19 @@ items:
drop_item:
item: sprinkler_2_item
sprinkler_2_item:
display_name: 优质洒水器
display_name: Sprinkler
#display_name: 优质洒水器
resource:
generate: false
material: PAPER
model_path: base/sprinkler_2_item
####################
# 温室 #
# GreenHouse #
####################
greenhouse_glass:
display_name: 温室玻璃
display_name: Greenhouse Glass
#display_name: 温室玻璃
resource:
material: PAPER
generate: false
@@ -129,10 +137,11 @@ items:
####################
# 状态 #
# Stage #
####################
crop_stage_death:
display_name: 死去的植物
display_name: Dead Crops
#display_name: 枯萎的农作物
resource:
generate: false
material: PAPER
@@ -149,28 +158,32 @@ items:
name: block.azalea.break
####################
# 水壶 #
# Watering Can #
####################
watering_can_1:
display_name: 铜制水壶
display_name: Copper Watering Can
#display_name: 铜水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_1
watering_can_2:
display_name: 铁制水壶
display_name: Steel Watering Can
#display_name: 钢水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_2
watering_can_3:
display_name: 金制水壶
display_name: Golden Watering Can
#display_name: 金水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
model_path: base/watering_can_3
watering_can_4:
display_name: 铱金水壶
display_name: Iridium Watering Can
#display_name: 铱金水壶
resource:
generate: false
material: GOLDEN_HORSE_ARMOR
@@ -178,73 +191,99 @@ items:
####################
# 肥料 #
# Fertilizer #
####################
speed_1:
display_name: 生长激素
display_name: Speed-Gro
#display_name: 生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_1
speed_2:
display_name: 高级生长激素
display_name: Deluxe Speed-Gro
#display_name: 高级生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_2
speed_3:
display_name: 顶级生长激素
display_name: Hyper Speed-Gro
#display_name: 超级生长激素
resource:
generate: false
material: PAPER
model_path: base/speed_3
retaining_1:
display_name: 初级保湿土壤
display_name: Basic Retaining Soil
#display_name: 基础保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_1
retaining_2:
display_name: 高级保湿土壤
display_name: Quality Retaining Soil
#display_name: 品质保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_2
retaining_3:
display_name: 顶级保湿土壤
display_name: Deluxe Retaining Soil
#display_name: 高级保湿土壤
resource:
generate: false
material: PAPER
model_path: base/retaining_3
quality_1:
display_name: 初级肥料
display_name: Basic Fertilizer
#display_name: 基础肥料
resource:
generate: false
material: PAPER
model_path: base/quality_1
quality_2:
display_name: 高级肥料
display_name: Quality Fertilizer
#display_name: 优质肥料
resource:
generate: false
material: PAPER
model_path: base/quality_2
quality_3:
display_name: 顶级肥料
display_name: Deluxe Fertilizer
#display_name: 高级肥料
resource:
generate: false
material: PAPER
model_path: base/quality_3
quantity_1:
display_name: Basic Yield Increasing
#display_name: 基础增产
resource:
generate: false
material: PAPER
model_path: base/quantity_1
quantity_2:
display_name: Quality Yield Increasing
#display_name: 优质增产
resource:
generate: false
material: PAPER
model_path: base/quantity_2
quantity_3:
display_name: Deluxe Yield Increasing
#display_name: 高级增产
resource:
generate: false
material: PAPER
model_path: base/quantity_3
####################
# 土质探测器 #
####################
soil_detector:
display_name: 土质探测器
lore:
- '&7用于查看使用的肥料种类和残余量'
display_name: Soil Surveyor
#display_name: 肥料勘测器
resource:
generate: false
material: PAPER

View File

@@ -66,31 +66,36 @@ items:
break:
name: block.azalea.break
tomato_seeds:
display_name: "番茄种子"
display_name: "Tomato Seeds"
#display_name: 番茄种子
resource:
generate: false
material: PAPER
model_path: tomato/tomato_seeds
tomato:
display_name: "番茄"
display_name: "Tomato"
#display_name: 番茄
resource:
generate: false
material: APPLE
model_path: tomato/tomato
tomato_silver_star:
display_name: "番茄"
display_name: "Tomato (Silver Star)"
#display_name: 番茄(银星)
resource:
generate: false
material: APPLE
model_path: tomato/tomato_silver_star
tomato_golden_star:
display_name: "番茄"
display_name: "Tomato (Golden Star)"
#display_name: 番茄(金星)
resource:
generate: false
material: APPLE
model_path: tomato/tomato_golden_star
gigantic_tomato:
display_name: "巨型番茄"
display_name: "Overgrown Tomato"
#display_name: 巨型番茄
resource:
generate: false
material: PAPER

View File

@@ -5,7 +5,7 @@ plugins {
group = 'net.momirealms'
version = '1.6.0'
version = '1.6.1.0'
repositories {
mavenCentral()
@@ -57,15 +57,16 @@ dependencies {
compileOnly 'com.github.Archy-X:AureliumSkills:Beta1.3.6'
compileOnly 'com.github.angeschossen:LandsAPI:6.5.1'
compileOnly 'com.github.TechFortress:GriefPrevention:16.18'
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT'
compileOnly 'com.comphenix.protocol:ProtocolLib:4.8.0'
compileOnly 'me.clip:placeholderapi:2.11.2'
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7'
compileOnly 'com.github.LoneDev6:api-itemsadder:3.2.3c'
compileOnly 'com.palmergames.bukkit.towny:towny:0.98.2.0'
compileOnly fileTree(dir:'libs',includes:['*.jar'])
compileOnly 'com.github.Zrips:Jobs:4.17.2'
implementation("net.kyori:adventure-api:4.11.0")
implementation("net.kyori:adventure-platform-bukkit:4.1.1")
implementation('net.kyori:adventure-platform-bukkit:4.1.2')
implementation("net.kyori:adventure-text-minimessage:4.11.0")
implementation("de.tr7zw:item-nbt-api:2.10.0")
}
@@ -100,8 +101,8 @@ tasks.withType(JavaCompile) {
}
shadowJar {
relocate ('de.tr7zw', 'net.momirealms.customcrops.libs.tr7zw')
relocate ('net.kyori', 'net.momirealms.customcrops.libs.kyori')
relocate ('de.tr7zw', 'net.momirealms.customcrops.libs')
relocate ('net.kyori', 'net.momirealms.customcrops.libs')
}
tasks.register("delete", Delete).get().delete("build/libs/"+project.name+"-"+project.version+".jar")

View File

@@ -19,16 +19,13 @@ package net.momirealms.customcrops;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.fertilizer.RetainingSoil;
import net.momirealms.customcrops.fertilizer.SpeedGrow;
import net.momirealms.customcrops.helper.Log;
import net.momirealms.customcrops.integrations.protection.*;
import net.momirealms.customcrops.integrations.skill.*;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.Sprinkler;
import net.momirealms.customcrops.objects.WateringCan;
import net.momirealms.customcrops.objects.fertilizer.*;
import net.momirealms.customcrops.requirements.Biome;
import net.momirealms.customcrops.requirements.Permission;
import net.momirealms.customcrops.requirements.Requirement;
@@ -492,8 +489,10 @@ public class ConfigReader {
if (config.contains("speed")){
config.getConfigurationSection("speed").getKeys(false).forEach(key -> {
String id = StringUtils.split(config.getString("speed." + key + ".item"), ":")[1];
SpeedGrow speedGrow = new SpeedGrow(id, config.getInt("speed." + key + ".times"), config.getDouble("speed." + key + ".chance"), config.getBoolean("speed." + key + ".before-plant"));
speedGrow.setName(config.getString("speed." + key + ".name"));
SpeedGrow speedGrow = new SpeedGrow(id, config.getInt("speed." + key + ".times"));
speedGrow.setName(config.getString("speed." + key + ".name",""));
speedGrow.setBefore(config.getBoolean("speed." + key + ".before-plant",false));
speedGrow.setChance(config.getDouble("speed." + key + ".chance"));
if (config.contains("speed." + key + ".particle"))
speedGrow.setParticle(Particle.valueOf(config.getString("speed." + key + ".particle").toUpperCase()));
FERTILIZERS.put(id, speedGrow);
@@ -502,8 +501,10 @@ public class ConfigReader {
if (config.contains("retaining")){
config.getConfigurationSection("retaining").getKeys(false).forEach(key -> {
String id = StringUtils.split(config.getString("retaining." + key + ".item"), ":")[1];
RetainingSoil retainingSoil = new RetainingSoil(id, config.getInt("retaining." + key + ".times"), config.getDouble("retaining." + key + ".chance"), config.getBoolean("retaining." + key + ".before-plant"));
retainingSoil.setName(config.getString("retaining." + key + ".name"));
RetainingSoil retainingSoil = new RetainingSoil(id, config.getInt("retaining." + key + ".times"));
retainingSoil.setBefore(config.getBoolean("retaining." + key + ".before-plant",false));
retainingSoil.setChance(config.getDouble("retaining." + key + ".chance"));
retainingSoil.setName(config.getString("retaining." + key + ".name",""));
if (config.contains("retaining." + key + ".particle"))
retainingSoil.setParticle(Particle.valueOf(config.getString("retaining." + key + ".particle").toUpperCase()));
FERTILIZERS.put(id, retainingSoil);
@@ -517,13 +518,28 @@ public class ConfigReader {
weight[0] = Integer.parseInt(split[0]);
weight[1] = Integer.parseInt(split[1]);
weight[2] = Integer.parseInt(split[2]);
QualityCrop qualityCrop = new QualityCrop(key, config.getInt("quality." + key + ".times"), weight, config.getBoolean("quality." + key + ".before-plant"));
qualityCrop.setName(config.getString("quality." + key + ".name"));
QualityCrop qualityCrop = new QualityCrop(key, config.getInt("quality." + key + ".times"));
qualityCrop.setChance(weight);
qualityCrop.setName(config.getString("quality." + key + ".name",""));
qualityCrop.setBefore(config.getBoolean("quality." + key + ".before-plant",false));
if (config.contains("quality." + key + ".particle"))
qualityCrop.setParticle(Particle.valueOf(config.getString("quality." + key + ".particle").toUpperCase()));
FERTILIZERS.put(id, qualityCrop);
});
}
if (config.contains("quantity")){
config.getConfigurationSection("quantity").getKeys(false).forEach(key -> {
String id = StringUtils.split(config.getString("quantity." + key + ".item"), ":")[1];
YieldIncreasing yieldIncreasing = new YieldIncreasing(key, config.getInt("quantity." + key + ".times",14));
yieldIncreasing.setBonus(config.getInt("quantity." + key + ".bonus",1));
yieldIncreasing.setName(config.getString("quantity." + key + ".name",""));
yieldIncreasing.setBefore(config.getBoolean("quantity." + key + ".before-plant",false));
yieldIncreasing.setChance(config.getDouble("quantity." + key + ".chance"));
if (config.contains("quantity." + key + ".particle"))
yieldIncreasing.setParticle(Particle.valueOf(config.getString("quantity." + key + ".particle").toUpperCase()));
FERTILIZERS.put(id, yieldIncreasing);
});
}
AdventureManager.consoleMessage("<gradient:#ff206c:#fdee55>[CustomCrops] </gradient><white>" + FERTILIZERS.size() + " <color:#FFEBCD>fertilizers loaded!");
}

View File

@@ -60,12 +60,6 @@ public class Executor implements CommandExecutor {
}
return true;
}
case "test" -> {
CustomCrops.plugin.getCropManager().testData();
}
case "test2" -> {
CustomCrops.plugin.getCropManager().testData2();
}
case "forcegrow" -> {
if (args.length < 2) {
lackArgs(sender);

View File

@@ -19,14 +19,11 @@ package net.momirealms.customcrops.datamanager;
import dev.lone.itemsadder.api.CustomBlock;
import dev.lone.itemsadder.api.CustomFurniture;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.listener.JoinAndQuit;
import net.momirealms.customcrops.objects.fertilizer.*;
import net.momirealms.customcrops.utils.AdventureManager;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.RetainingSoil;
import net.momirealms.customcrops.fertilizer.SpeedGrow;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.utils.FurnitureUtil;
import net.momirealms.customcrops.utils.JedisUtil;
@@ -108,25 +105,6 @@ public class CropManager{
RemoveCache.clear();
}
public void testData(){
for (int i = -100; i <= 100; i++){
for (int j = -100; j <= 100; j++){
SimpleLocation simpleLocation = new SimpleLocation("world",i,128,j);
Cache.put(simpleLocation, "XiaoMoMi");
}
}
}
public void testData2(){
World world = Bukkit.getWorld("world");
for (int i = -100; i <= 100; i++){
for (int j = -100; j <= 100; j++){
Location location = new Location(world, i, 128,j);
FurnitureUtil.placeCrop("customcrops:tomato_stage_1", location);
}
}
}
/**
* 清除无用数据
*/
@@ -417,8 +395,10 @@ public class CropManager{
int times = fertilizer.getTimes();
if (times > 0){
fertilizer.setTimes(times - 1);
Fertilizer fertilizerConfig = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
//生长激素
if (fertilizer instanceof SpeedGrow speedGrow){
if (fertilizerConfig instanceof SpeedGrow speedGrow){
if (cropInstance.getGrowChance() > Math.random()){
//农作物存在下两个阶段
if (Math.random() < speedGrow.getChance() && CustomBlock.getInstance(StringUtils.chop(namespacedID) + (nextStage + 1)) != null){
@@ -431,7 +411,7 @@ public class CropManager{
}
}
//保湿土壤
else if(fertilizer instanceof RetainingSoil retainingSoil){
else if(fertilizerConfig instanceof RetainingSoil retainingSoil){
if (Math.random() < retainingSoil.getChance()){
if (cropInstance.getGrowChance() > Math.random()){
addStage(seedLocation, namespacedID, nextStage);
@@ -445,7 +425,7 @@ public class CropManager{
}
}
//品质肥料
else if(fertilizer instanceof QualityCrop){
else if(fertilizerConfig instanceof QualityCrop || fertilizerConfig instanceof YieldIncreasing){
if (cropInstance.getGrowChance() > Math.random()){
addStage(potLocation, seedLocation, namespacedID, nextStage);
}else {
@@ -643,9 +623,12 @@ public class CropManager{
//查询剩余使用次数
int times = fertilizer.getTimes();
if (times > 0){
fertilizer.setTimes(times - 1);
Fertilizer fertilizerConfig = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
//生长激素
if (fertilizer instanceof SpeedGrow speedGrow){
if (fertilizerConfig instanceof SpeedGrow speedGrow){
if (cropInstance.getGrowChance() > Math.random()){
//农作物存在下两个阶段
if (Math.random() < speedGrow.getChance() && CustomBlock.getInstance(StringUtils.chop(namespacedID) + (nextStage + 1)) != null){
@@ -653,13 +636,14 @@ public class CropManager{
}else {
addStageEntity(potLocation, seedLocation, crop.getArmorstand(), StringUtils.chop(namespacedID) + nextStage);
}
}else {
}
else {
CustomBlock.remove(potLocation);
CustomBlock.place(ConfigReader.Basic.pot, potLocation);
}
}
//保湿土壤
else if(fertilizer instanceof RetainingSoil retainingSoil){
else if(fertilizerConfig instanceof RetainingSoil retainingSoil){
if (Math.random() < retainingSoil.getChance()){
if (cropInstance.getGrowChance() > Math.random()){
addStageEntity(seedLocation, crop.getArmorstand(), StringUtils.chop(namespacedID) + nextStage);
@@ -674,7 +658,7 @@ public class CropManager{
}
}
//品质肥料
else if(fertilizer instanceof QualityCrop){
else if(fertilizerConfig instanceof QualityCrop || fertilizerConfig instanceof YieldIncreasing){
if (cropInstance.getGrowChance() > Math.random()){
addStageEntity(potLocation, seedLocation, crop.getArmorstand(), StringUtils.chop(namespacedID) + nextStage);
}else {

View File

@@ -17,13 +17,10 @@
package net.momirealms.customcrops.datamanager;
import net.momirealms.customcrops.utils.AdventureManager;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.objects.fertilizer.*;
import net.momirealms.customcrops.utils.AdventureManager;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.fertilizer.RetainingSoil;
import net.momirealms.customcrops.fertilizer.SpeedGrow;
import net.momirealms.customcrops.objects.SimpleLocation;
import org.apache.commons.lang.StringUtils;
import org.bukkit.configuration.MemorySection;
@@ -53,18 +50,24 @@ public class PotManager {
}
YamlConfiguration data = YamlConfiguration.loadConfiguration(file);
data.getKeys(false).forEach(worldName -> {
data.getConfigurationSection(worldName).getValues(false).forEach((key, value) ->{
String[] split = StringUtils.split(key, ",");
data.getConfigurationSection(worldName).getValues(false).forEach((keys, value) ->{
String[] split = StringUtils.split(keys, ",");
if (value instanceof MemorySection map){
String name = (String) map.get("fertilizer");
Fertilizer fertilizer = ConfigReader.FERTILIZERS.get(name);
String key = map.getString("fertilizer");
Fertilizer fertilizer = ConfigReader.FERTILIZERS.get(key);
if (fertilizer == null) return;
if (fertilizer instanceof SpeedGrow speedGrow){
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), new SpeedGrow(name, (int) map.get("times"), speedGrow.getChance(), speedGrow.isBefore()));
}else if (fertilizer instanceof QualityCrop qualityCrop){
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), new QualityCrop(name, (int) map.get("times"), qualityCrop.getChance(), qualityCrop.isBefore()));
}else if (fertilizer instanceof RetainingSoil retainingSoil){
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), new RetainingSoil(name, (int) map.get("times"), retainingSoil.getChance(), retainingSoil.isBefore()));
if (fertilizer instanceof SpeedGrow){
SpeedGrow speedGrow = new SpeedGrow(key, map.getInt("times"));
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), speedGrow);
}else if (fertilizer instanceof QualityCrop){
QualityCrop qualityCrop = new QualityCrop(key, map.getInt("times"));
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), qualityCrop);
}else if (fertilizer instanceof RetainingSoil){
RetainingSoil retainingSoil = new RetainingSoil(key, map.getInt("times"));
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), retainingSoil);
}else if(fertilizer instanceof YieldIncreasing){
YieldIncreasing yieldIncreasing = new YieldIncreasing(key, map.getInt("times"));
Cache.put(new SimpleLocation(worldName, Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])), yieldIncreasing);
}else {
AdventureManager.consoleMessage("<red>[CustomCrops] 未知肥料类型错误!</red>");
}

View File

@@ -1,56 +0,0 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.fertilizer;
import org.bukkit.Particle;
public class QualityCrop implements Fertilizer{
private int[] chance;
private String key;
private int times;
private final boolean before;
private String name;
private Particle particle;
public QualityCrop(String key, int times, int[] chance, boolean before) {
this.chance = chance;
this.times = times;
this.before = before;
this.key = key;
}
@Override
public String getKey() {return this.key;}
@Override
public int getTimes() {return this.times;}
@Override
public void setTimes(int times) {this.times = times;}
@Override
public boolean isBefore() {return this.before;}
@Override
public String getName() {return this.name;}
@Override
public Particle getParticle() {return this.particle;}
public int[] getChance() {return chance;}
public void setName(String name) {this.name = name;}
public void setChance(int[] chance) {this.chance = chance;}
public void setKey(String key) {this.key = key;}
public void setParticle(Particle particle) {this.particle = particle;}
}

View File

@@ -1,56 +0,0 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.fertilizer;
import org.bukkit.Particle;
public class RetainingSoil implements Fertilizer{
private double chance;
private String key;
private int times;
private final boolean before;
private String name;
private Particle particle;
public RetainingSoil(String key, int times, double chance, boolean before){
this.times = times;
this.chance = chance;
this.before = before;
this.key = key;
}
@Override
public String getKey() {return this.key;}
@Override
public int getTimes() {return this.times;}
@Override
public void setTimes(int times) {this.times = times;}
@Override
public boolean isBefore() {return this.before;}
@Override
public String getName() {return this.name;}
@Override
public Particle getParticle() {return this.particle;}
public double getChance() {return chance;}
public void setName(String name) {this.name = name;}
public void setChance(double chance) {this.chance = chance;}
public void setKey(String key) {this.key = key;}
public void setParticle(Particle particle) {this.particle = particle;}
}

View File

@@ -1,56 +0,0 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.fertilizer;
import org.bukkit.Particle;
public class SpeedGrow implements Fertilizer{
private double chance;
private String key;
private int times;
private final boolean before;
private String name;
private Particle particle;
public SpeedGrow(String key, int times, double chance, boolean before){
this.chance = chance;
this.times = times;
this.before = before;
this.key = key;
}
@Override
public String getKey() {return this.key;}
@Override
public int getTimes() {return this.times;}
@Override
public void setTimes(int times) {this.times = times;}
@Override
public boolean isBefore() {return this.before;}
@Override
public String getName() {return this.name;}
@Override
public Particle getParticle() {return this.particle;}
public double getChance() {return chance;}
public void setName(String name) {this.name = name;}
public void setParticle(Particle particle) {this.particle = particle;}
public void setChance(double chance) {this.chance = chance;}
public void setKey(String key) {this.key = key;}
}

View File

@@ -0,0 +1,9 @@
package net.momirealms.customcrops.integrations.skill;
import org.bukkit.entity.Player;
public class JobsReborn implements SkillXP{
@Override
public void addXp(Player player, double amount) {
}
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.limits;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.utils.FurnitureUtil;
import org.bukkit.Location;
public class CropsPerChunkEntity {
public static boolean isLimited(Location location){
if (!ConfigReader.Config.enableLimit) return false;
int n = 1;
Location chunkLocation = new Location(location.getWorld(),location.getChunk().getX()*16+0.5,ConfigReader.Config.yMin+0.1,location.getChunk().getZ()*16+0.5);
Label_out:
for (int i = 0; i < 16; ++i)
for (int j = 0; j < 16; ++j) {
Location square = chunkLocation.clone().add(i, 0, j);
for (int k = ConfigReader.Config.yMin; k <= ConfigReader.Config.yMax; ++k) {
square.add(0.0, 1.0, 0.0);
String namespacedID = FurnitureUtil.getNamespacedID(square);
if(namespacedID != null && namespacedID.contains("_stage_")){
if (n++ > ConfigReader.Config.cropLimit)
break Label_out;
}
}
}
return n > ConfigReader.Config.cropLimit;
}
}

View File

@@ -6,8 +6,8 @@ import dev.lone.itemsadder.api.Events.CustomBlockBreakEvent;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.SimpleLocation;

View File

@@ -7,12 +7,13 @@ import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.datamanager.SprinklerManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.SimpleLocation;
import net.momirealms.customcrops.objects.Sprinkler;
import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
import net.momirealms.customcrops.utils.DropUtil;
import net.momirealms.customcrops.utils.LocUtil;
import org.apache.commons.lang.StringUtils;
@@ -73,6 +74,11 @@ public class BreakFurnitureI implements Listener {
else if(ran > 1 - weights[1]/(weightTotal)) world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_2()).getItemStack());
else world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_3()).getItemStack());
}
}else if (fertilizer instanceof YieldIncreasing yieldIncreasing){
if (Math.random() < yieldIncreasing.getChance()){
random += yieldIncreasing.getBonus();
}
DropUtil.normalDrop(cropInstance, random , itemLoc, world);
}
else DropUtil.normalDrop(cropInstance, random, itemLoc, world);
}

View File

@@ -11,14 +11,15 @@ import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.datamanager.SprinklerManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.listener.JoinAndQuit;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.SimpleLocation;
import net.momirealms.customcrops.objects.Sprinkler;
import net.momirealms.customcrops.objects.WateringCan;
import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
import net.momirealms.customcrops.utils.*;
import org.apache.commons.lang.StringUtils;
import org.bukkit.*;
@@ -196,13 +197,16 @@ public class InteractFurnitureI implements Listener {
if (ConfigReader.Message.hasCropInfo && nsID.equals(ConfigReader.Basic.soilDetector)){
Fertilizer fertilizer = PotManager.Cache.get(LocUtil.fromLocation(location.subtract(0,1,0)));
if (fertilizer != null){
Fertilizer fertilizer1 = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
if (fertilizer1 == null) return;
Fertilizer fConfig = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
if (fConfig == null) {
PotManager.Cache.remove(LocUtil.fromLocation(location));
return;
}
HoloUtil.showHolo(
ConfigReader.Message.cropText
.replace("{fertilizer}", fertilizer1.getName())
.replace("{fertilizer}", fConfig.getName())
.replace("{times}", String.valueOf(fertilizer.getTimes()))
.replace("{max_times}", String.valueOf(fertilizer1.getTimes())),
.replace("{max_times}", String.valueOf(fConfig.getTimes())),
player,
location.add(0, ConfigReader.Message.cropOffset, 0),
ConfigReader.Message.cropTime);
@@ -267,7 +271,9 @@ public class InteractFurnitureI implements Listener {
if (ConfigReader.Config.skillXP != null && cropInstance.getSkillXP() != 0) ConfigReader.Config.skillXP.addXp(player, cropInstance.getSkillXP());
if (cropInstance.getOtherLoots() != null) cropInstance.getOtherLoots().forEach(s -> location.getWorld().dropItem(itemLoc, CustomStack.getInstance(s).getItemStack()));
if (fertilizer != null){
if (fertilizer instanceof QualityCrop qualityCrop){
Fertilizer fConfig = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
if (fConfig == null) return;
if (fConfig instanceof QualityCrop qualityCrop){
int[] weights = qualityCrop.getChance();
double weightTotal = weights[0] + weights[1] + weights[2];
for (int i = 0; i < random; i++){
@@ -276,6 +282,11 @@ public class InteractFurnitureI implements Listener {
else if(ran > 1 - weights[1]/(weightTotal)) world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_2()).getItemStack());
else world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_3()).getItemStack());
}
}else if (fConfig instanceof YieldIncreasing yieldIncreasing){
if (Math.random() < yieldIncreasing.getChance()){
random += yieldIncreasing.getBonus();
}
DropUtil.normalDrop(cropInstance, random , itemLoc, world);
}
else DropUtil.normalDrop(cropInstance, random, itemLoc, world);
}

View File

@@ -10,9 +10,9 @@ import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.datamanager.SeasonManager;
import net.momirealms.customcrops.datamanager.SprinklerManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.limits.CropsPerChunk;
import net.momirealms.customcrops.limits.CropsPerChunkEntity;
import net.momirealms.customcrops.limits.SprinklersPerChunk;
import net.momirealms.customcrops.listener.JoinAndQuit;
import net.momirealms.customcrops.objects.Crop;
@@ -94,7 +94,7 @@ public class RightClickI implements Listener {
}
if (location.getBlock().getType() != Material.AIR) return;
if (player.getGameMode() != GameMode.CREATIVE) itemStack.setAmount(itemStack.getAmount() - 1);
if (CropsPerChunk.isLimited(location)){
if (CropsPerChunkEntity.isLimited(location)){
AdventureManager.playerMessage(player,ConfigReader.Message.prefix + ConfigReader.Message.crop_limit.replace("{max}", String.valueOf(ConfigReader.Config.cropLimit)));
return;
}
@@ -237,16 +237,18 @@ public class RightClickI implements Listener {
String namespacedID = customBlock.getNamespacedID();
if(namespacedID.equals(ConfigReader.Basic.pot) || namespacedID.equals(ConfigReader.Basic.watered_pot)){
Location location = block.getLocation();
Fertilizer fertilizer = PotManager.Cache.get(LocUtil.fromLocation(block.getLocation()));
Fertilizer fertilizer = PotManager.Cache.get(LocUtil.fromLocation(location));
if (fertilizer != null){
Fertilizer config = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
String name = config.getName();
int max_times = config.getTimes();
if (config == null){
PotManager.Cache.remove(LocUtil.fromLocation(location));
return;
}
HoloUtil.showHolo(
ConfigReader.Message.cropText
.replace("{fertilizer}", name)
.replace("{fertilizer}", config.getName())
.replace("{times}", String.valueOf(fertilizer.getTimes()))
.replace("{max_times}", String.valueOf(max_times)),
.replace("{max_times}", String.valueOf(config.getTimes())),
player,
location.add(0.5,ConfigReader.Message.cropOffset,0.5),
ConfigReader.Message.cropTime);

View File

@@ -24,11 +24,12 @@ import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.SimpleLocation;
import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
import net.momirealms.customcrops.utils.DropUtil;
import net.momirealms.customcrops.utils.LocUtil;
import org.apache.commons.lang.StringUtils;
@@ -142,6 +143,11 @@ public class BreakBlockT implements Listener {
else if(ran > 1 - weights[1]/(weightTotal)) world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_2()).getItemStack());
else world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_3()).getItemStack());
}
}else if (fertilizer instanceof YieldIncreasing yieldIncreasing){
if (Math.random() < yieldIncreasing.getChance()){
random += yieldIncreasing.getBonus();
}
DropUtil.normalDrop(cropInstance, random , itemLoc, world);
}
}
else DropUtil.normalDrop(cropInstance, random, itemLoc, world);

View File

@@ -28,8 +28,8 @@ import net.momirealms.customcrops.datamanager.CropManager;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.datamanager.SeasonManager;
import net.momirealms.customcrops.datamanager.SprinklerManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.objects.fertilizer.Fertilizer;
import net.momirealms.customcrops.objects.fertilizer.QualityCrop;
import net.momirealms.customcrops.integrations.protection.Integration;
import net.momirealms.customcrops.limits.CropsPerChunk;
import net.momirealms.customcrops.limits.SprinklersPerChunk;
@@ -38,6 +38,7 @@ import net.momirealms.customcrops.objects.Crop;
import net.momirealms.customcrops.objects.SimpleLocation;
import net.momirealms.customcrops.objects.Sprinkler;
import net.momirealms.customcrops.objects.WateringCan;
import net.momirealms.customcrops.objects.fertilizer.YieldIncreasing;
import net.momirealms.customcrops.requirements.PlantingCondition;
import net.momirealms.customcrops.requirements.Requirement;
import net.momirealms.customcrops.utils.*;
@@ -297,7 +298,10 @@ public class RightClickT implements Listener {
Fertilizer fertilizer = PotManager.Cache.get(LocUtil.fromLocation(location));
if (fertilizer != null){
Fertilizer config = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
if (config == null) return;
if (config == null){
PotManager.Cache.remove(LocUtil.fromLocation(location));
return;
}
HoloUtil.showHolo(
ConfigReader.Message.cropText
.replace("{fertilizer}", config.getName())
@@ -307,18 +311,21 @@ public class RightClickT implements Listener {
location.add(0.5, ConfigReader.Message.cropOffset, 0.5),
ConfigReader.Message.cropTime);
}
}else if(namespacedID.equals(ConfigReader.Basic.pot) || namespacedID.equals(ConfigReader.Basic.watered_pot)){
}
else if(namespacedID.equals(ConfigReader.Basic.pot) || namespacedID.equals(ConfigReader.Basic.watered_pot)){
Location location = block.getLocation();
Fertilizer fertilizer = PotManager.Cache.get(LocUtil.fromLocation(block.getLocation()));
if (fertilizer != null){
Fertilizer config = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
String name = config.getName();
int max_times = config.getTimes();
if (config == null){
PotManager.Cache.remove(LocUtil.fromLocation(location));
return;
}
HoloUtil.showHolo(
ConfigReader.Message.cropText
.replace("{fertilizer}", name)
.replace("{fertilizer}", config.getName())
.replace("{times}", String.valueOf(fertilizer.getTimes()))
.replace("{max_times}", String.valueOf(max_times)),
.replace("{max_times}", String.valueOf(config.getTimes())),
player,
location.add(0.5,ConfigReader.Message.cropOffset,0.5),
ConfigReader.Message.cropTime);
@@ -388,7 +395,9 @@ public class RightClickT implements Listener {
if (cropInstance.doesDropIALoot()) customBlock.getLoot().forEach(itemStack -> location.getWorld().dropItem(location.clone().add(0.5,0.2,0.5), itemStack));
if (cropInstance.getOtherLoots() != null) cropInstance.getOtherLoots().forEach(s -> location.getWorld().dropItem(location.clone().add(0.5,0.2,0.5), CustomStack.getInstance(s).getItemStack()));
if (fertilizer != null){
if (fertilizer instanceof QualityCrop qualityCrop){
Fertilizer fConfig = ConfigReader.FERTILIZERS.get(fertilizer.getKey());
if (fConfig == null) return;
if (fConfig instanceof QualityCrop qualityCrop){
int[] weights = qualityCrop.getChance();
double weightTotal = weights[0] + weights[1] + weights[2];
for (int i = 0; i < random; i++){
@@ -397,6 +406,11 @@ public class RightClickT implements Listener {
else if(ran > 1 - weights[1]/(weightTotal)) world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_2()).getItemStack());
else world.dropItem(itemLoc, CustomStack.getInstance(cropInstance.getQuality_3()).getItemStack());
}
}else if (fConfig instanceof YieldIncreasing yieldIncreasing){
if (Math.random() < yieldIncreasing.getChance()){
random += yieldIncreasing.getBonus();
}
DropUtil.normalDrop(cropInstance, random, itemLoc, world);
}
else DropUtil.normalDrop(cropInstance, random, itemLoc, world);
}

View File

@@ -0,0 +1,57 @@
package net.momirealms.customcrops.objects.fertilizer;
import org.bukkit.Particle;
public class Fertilizer {
String key;
int times;
boolean before;
String name;
Particle particle;
protected Fertilizer(String key, int times) {
this.key = key;
this.times = times;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getTimes() {
return times;
}
public void setTimes(int times) {
this.times = times;
}
public boolean isBefore() {
return before;
}
public void setBefore(boolean before) {
this.before = before;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Particle getParticle() {
return particle;
}
public void setParticle(Particle particle) {
this.particle = particle;
}
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.objects.fertilizer;
public class QualityCrop extends Fertilizer {
private int[] chance;
public QualityCrop(String key, int times) {
super(key, times);
}
public int[] getChance() {
return chance;
}
public void setChance(int[] chance) {
this.chance = chance;
}
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.objects.fertilizer;
public class RetainingSoil extends Fertilizer {
double chance;
public double getChance() {
return chance;
}
public void setChance(double chance) {
this.chance = chance;
}
public RetainingSoil(String key, int times){
super(key, times);
}
}

View File

@@ -15,15 +15,21 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.fertilizer;
package net.momirealms.customcrops.objects.fertilizer;
import org.bukkit.Particle;
public class SpeedGrow extends Fertilizer {
public interface Fertilizer {
String getKey();
int getTimes();
void setTimes(int times);
boolean isBefore();
String getName();
Particle getParticle();
private double chance;
public SpeedGrow(String key, int times){
super(key, times);
}
public double getChance() {
return chance;
}
public void setChance(double chance) {
this.chance = chance;
}
}

View File

@@ -0,0 +1,27 @@
package net.momirealms.customcrops.objects.fertilizer;
public class YieldIncreasing extends Fertilizer {
private int bonus;
private double chance;
public YieldIncreasing(String key, int times) {
super(key, times);
}
public double getChance() {
return chance;
}
public void setChance(double chance) {
this.chance = chance;
}
public int getBonus() {
return bonus;
}
public void setBonus(int bonus) {
this.bonus = bonus;
}
}

View File

@@ -3,11 +3,7 @@ package net.momirealms.customcrops.utils;
import dev.lone.itemsadder.api.CustomBlock;
import net.momirealms.customcrops.ConfigReader;
import net.momirealms.customcrops.datamanager.PotManager;
import net.momirealms.customcrops.fertilizer.Fertilizer;
import net.momirealms.customcrops.fertilizer.QualityCrop;
import net.momirealms.customcrops.fertilizer.RetainingSoil;
import net.momirealms.customcrops.fertilizer.SpeedGrow;
import net.momirealms.customcrops.objects.SimpleLocation;
import net.momirealms.customcrops.objects.fertilizer.*;
import org.bukkit.Location;
import org.bukkit.Particle;
@@ -97,14 +93,17 @@ public class PotUtil {
*/
public static void addFertilizer(Fertilizer fertilizerConfig, Location location) {
if (fertilizerConfig instanceof QualityCrop config){
QualityCrop qualityCrop = new QualityCrop(config.getKey(), config.getTimes(), config.getChance(), config.isBefore());
QualityCrop qualityCrop = new QualityCrop(config.getKey(), config.getTimes());
PotManager.Cache.put(LocUtil.fromLocation(location), qualityCrop);
}else if (fertilizerConfig instanceof SpeedGrow config){
SpeedGrow speedGrow = new SpeedGrow(config.getKey(), config.getTimes(),config.getChance(), config.isBefore());
SpeedGrow speedGrow = new SpeedGrow(config.getKey(), config.getTimes());
PotManager.Cache.put(LocUtil.fromLocation(location), speedGrow);
}else if (fertilizerConfig instanceof RetainingSoil config){
RetainingSoil retainingSoil = new RetainingSoil(config.getKey(), config.getTimes(),config.getChance(), config.isBefore());
RetainingSoil retainingSoil = new RetainingSoil(config.getKey(), config.getTimes());
PotManager.Cache.put(LocUtil.fromLocation(location), retainingSoil);
}else if (fertilizerConfig instanceof YieldIncreasing config){
YieldIncreasing yieldIncreasing = new YieldIncreasing(config.getKey(), config.getTimes());
PotManager.Cache.put(LocUtil.fromLocation(location), yieldIncreasing);
}
if (fertilizerConfig.getParticle() != null) location.getWorld().spawnParticle(fertilizerConfig.getParticle(), location.add(0.5,1.3,0.5), 5,0.2,0.2,0.2);
}

View File

@@ -19,21 +19,23 @@ config:
# ● Real block hitbox like vanilla
#
# Disadvantage:
# ● limited amount
# ● limited amount(127) /iainfo to see how many slots available
# ● visual problem when breaking crops
# ● Can't remove tripwire break sound
#
# ------------ item_frame ------------
# Advantage:
# ● unlimited amount
# ● unlimited amount, create as many as crop types as you want
# ● No tripwire break sound
# ● Rotation
#
# Disadvantage:
# ● entities are very laggy(loading every 5 item frames need 0.01 mspt)
# ● entities are very laggy(loading every 5~8 item frames need 0.01 mspt)
# ● spigot optimized the view distance of entities
# ● crops would go missing if server is lagging
# ● crops would go missing if there's a large amount of furniture replacing in the same tick(128 crops/tick)
# ● And I can't fix this in my plugin because furniture replacing is handled by ItemsAdder.
# ● No real block hitbox
# ● ItemsAdder furniture breaking sound
# ● itemsAdder loot system doesn't apply to furnitures.
#
crop-mode: tripwire
@@ -79,6 +81,8 @@ config:
# Mode 4:
# ● Please disable season in this mode!
# ● All the crops will grow
# ● If season not disabled, your server would be lagging when there's a lot of data
# ● Crop data would be removed as soon as they are ripe when season disabled, so it would not cause lag!
grow-mode: 3
# The time to start growing(ticks)
# 1000ticks is 7am in game. (0-23999)
@@ -126,6 +130,10 @@ config:
water-particles: true
# Should the pot be dry even there's no crop on it
# This would cost addition performance
pot-dry-always-dry: false
# Will bone meal accelerate the growth of crop
bone-meal:

View File

@@ -85,7 +85,7 @@ crops:
2: customcrops:grape_silver_star
3: customcrops:grape_golden_star
#optional
#The stage to return when havesting with empty hands
#The stage to return when harvesting with a single right click
return: customcrops:grape_stage_4
season:
- autumn
@@ -117,3 +117,10 @@ crops:
1: customcrops:garlic
2: customcrops:garlic_silver_star
3: customcrops:garlic_golden_star
redpacket:
amount: 3~4
quality:
1: customcrops:redpacket
2: customcrops:redpacket
3: customcrops:redpacket

View File

@@ -77,3 +77,29 @@ quality:
chance: 2/2/1
item: customcrops:quality_3
before-plant: true
#When haveresting, players have a higher chance to get more crops.
quantity:
quantity_1:
name: '뀆'
times: 14
chance: 0.5
bonus: 1
item: customcrops:quantity_1
before-plant: true
quantity_2:
name: '뀐'
times: 14
chance: 0.5
bonus: 2
item: customcrops:quantity_2
before-plant: true
quantity_3:
name: '뀑'
times: 14
chance: 0.8
bonus: 2
item: customcrops:quantity_3
before-plant: true

View File

@@ -123,3 +123,10 @@ crops:
1: customcrops:garlic
2: customcrops:garlic_silver_star
3: customcrops:garlic_golden_star
redpacket:
amount: 3~4
quality:
1: customcrops:redpacket
2: customcrops:redpacket
3: customcrops:redpacket

View File

@@ -75,3 +75,27 @@ quality:
chance: 2/2/1
item: customcrops:quality_3
before-plant: true
#增加农作物的产量
quantity:
quantity_1:
name: '뀏'
times: 14
chance: 0.5
bonus: 1
item: customcrops:quantity_1
before-plant: true
quantity_2:
name: '뀐'
times: 14
chance: 0.5
bonus: 2
item: customcrops:quantity_2
before-plant: true
quantity_3:
name: '뀑'
times: 14
chance: 0.8
bonus: 2
item: customcrops:quantity_3
before-plant: true