Skip to content

Commit 76f1c10

Browse files
committed
修复服务器无法使用的BUG
1 parent b6e053e commit 76f1c10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1047
-22
lines changed

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ loader_version=0.16.13
1010
fabric_kotlin_version=1.13.2+kotlin.2.1.20
1111

1212
# Mod Properties
13-
mod_version=1.12
13+
mod_version=1.1.3
1414
maven_group=cn.coostack.usefulmagic
1515
archives_base_name=usefulmagic
1616

1717
# Dependencies
18-
fabric_version=0.115.6+1.21.1
18+
fabric_version=0.115.6+1.21.1
19+
235 KB
Binary file not shown.

src/main/kotlin/cn/coostack/usefulmagic/UsefulMagic.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ object UsefulMagic : ModInitializer {
5555
}
5656

5757
private fun loadListeners() {
58+
5859
DefendMagicListener.init()
5960
}
6061

@@ -80,6 +81,7 @@ object UsefulMagic : ModInitializer {
8081
logger.debug("服务器随机刻加载完成")
8182
}
8283

84+
8385
private fun loadFuel() {
8486
FuelRegistry.INSTANCE.add(UsefulMagicItems.WOODEN_WAND, 200)
8587
}

src/main/kotlin/cn/coostack/usefulmagic/blocks/entitiy/AltarEntity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ interface AltarEntity {
7171
)
7272
}
7373
}
74+
7475
fun getDownActiveBlocksMaxMana(): Int
7576

7677
fun getDownActiveBlocksManaReviveSpeed(): Int

src/main/kotlin/cn/coostack/usefulmagic/blocks/entitiy/MagicCoreBlockEntity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ class MagicCoreBlockEntity(pos: BlockPos, state: BlockState) :
189189
if (currentRecipe == null) {
190190
this.currentRecipe = value
191191
}
192+
192193
if (currentRecipe != null && currentRecipe != value) {
193194
this.currentRecipe = value
194195
craftingTick = 0
@@ -255,7 +256,7 @@ class MagicCoreBlockEntity(pos: BlockPos, state: BlockState) :
255256
// 只在服务器调用
256257
if (!world.isClient) {
257258
magicBookSpawner.tick()
258-
if (magicBookSpawner.start){
259+
if (magicBookSpawner.start) {
259260
tick++
260261
return
261262
}

src/main/kotlin/cn/coostack/usefulmagic/datagen/UsefulMagicItemTagProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ class UsefulMagicItemTagProvider(
5757
.add(RED_MANA_STAR)
5858

5959
getOrCreateTagBuilder(UsefulMagicItemTags.CRYSTAL)
60-
.add(RED_MANA_CRYSTAL, PURPLE_MANA_CRYSTAL, RED_MANA_CRYSTAL)
60+
.add(UsefulMagicItems.MANA_CRYSTAL, PURPLE_MANA_CRYSTAL, RED_MANA_CRYSTAL)
6161
}
6262
}

src/main/kotlin/cn/coostack/usefulmagic/datagen/UsefulMagicLangProvider.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class UsefulMagicLangProvider(
4848
add(UsefulMagicItems.RED_MANA_CRYSTAL, "三级聚魔水晶")
4949
add(UsefulMagicItems.DEFEND_CORE, "魔法防御核心")
5050
add(UsefulMagicItems.FLYING_RUNE, "飞行符文")
51+
add(UsefulMagicItems.TUTORIAL_BOOK, "实用魔法手册")
5152
// group
5253
add("item.useful_magic_main", "实用魔法")
5354
// block 信息

src/main/kotlin/cn/coostack/usefulmagic/datagen/UsefulMagicModelProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class UsefulMagicModelProvider(output: FabricDataOutput) : FabricModelProvider(o
1616
}
1717

1818
override fun generateItemModels(gen: ItemModelGenerator) {
19+
1920
gen.register(UsefulMagicItems.DEBUGGER, Models.GENERATED)
2021
gen.register(UsefulMagicItems.SMALL_MANA_REVIVE, Models.GENERATED)
2122
gen.register(UsefulMagicItems.SMALL_MANA_BOTTLE, Models.GENERATED)
@@ -30,6 +31,6 @@ class UsefulMagicModelProvider(output: FabricDataOutput) : FabricModelProvider(o
3031
gen.register(UsefulMagicItems.RED_MANA_CRYSTAL, Models.GENERATED)
3132
gen.register(UsefulMagicItems.DEFEND_CORE, Models.GENERATED)
3233
gen.register(UsefulMagicItems.FLYING_RUNE, Models.GENERATED)
33-
gen.register(UsefulMagicItems.MAGIC_AXE, Models.HANDHELD)
34+
gen.register(UsefulMagicItems.TUTORIAL_BOOK, Models.GENERATED)
3435
}
3536
}

src/main/kotlin/cn/coostack/usefulmagic/datagen/UsefulMagicRecipeProvider.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,26 @@ import net.minecraft.recipe.book.RecipeCategory
1212
import net.minecraft.registry.RegistryWrapper
1313
import net.minecraft.registry.tag.ItemTags
1414
import java.util.concurrent.CompletableFuture
15+
import kotlin.math.exp
1516

1617
class UsefulMagicRecipeProvider(
1718
output: FabricDataOutput,
1819
registriesFuture: CompletableFuture<RegistryWrapper.WrapperLookup>
1920
) :
2021
FabricRecipeProvider(output, registriesFuture) {
2122
override fun generate(exporter: RecipeExporter) {
23+
ShapedRecipeJsonBuilder
24+
.create(RecipeCategory.MISC, UsefulMagicItems.TUTORIAL_BOOK, 1)
25+
.pattern(" T ")
26+
.pattern("YBR")
27+
.pattern(" H ")
28+
.input('T', Items.SUGAR)
29+
.input('Y', Items.GLOWSTONE_DUST)
30+
.input('R', Items.REDSTONE)
31+
.input('H', Items.GUNPOWDER)
32+
.input('B', Items.BOOK)
33+
.criterion("has_item", conditionsFromItem(Items.BOOK))
34+
.offerTo(exporter)
2235
ShapedRecipeJsonBuilder
2336
.create(RecipeCategory.COMBAT, UsefulMagicItems.WOODEN_WAND, 1)
2437
.pattern(" WW")

0 commit comments

Comments
 (0)