refactor: 优化代码结构和日志输出
- 注释掉未使用的 FabricLoader 和 EnvType导包 - 注释掉 PlayerTombstoneData 类的相关代码- 注释掉 TombstoneStorage 中的日志输出语句
This commit is contained in:
parent
dbe0c05a5f
commit
8d9a01d407
@ -2,8 +2,8 @@ package com.simpletombstone;
|
|||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
|
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
//import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.fabricmc.api.EnvType;
|
//import net.fabricmc.api.EnvType;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
@ -20,7 +20,7 @@ public class TombstoneStorage extends PersistentState {
|
|||||||
private final Map<BlockPos, SimpleTombstone.PlayerTombstoneData> tombstoneData = new HashMap<>();
|
private final Map<BlockPos, SimpleTombstone.PlayerTombstoneData> tombstoneData = new HashMap<>();
|
||||||
|
|
||||||
public static TombstoneStorage load(ServerWorld world) {
|
public static TombstoneStorage load(ServerWorld world) {
|
||||||
LOGGER.info("[TombstoneStorage] 加载墓碑数据...");
|
//LOGGER.info("[TombstoneStorage] 加载墓碑数据...");
|
||||||
TombstoneStorage storage = world.getPersistentStateManager().getOrCreate(
|
TombstoneStorage storage = world.getPersistentStateManager().getOrCreate(
|
||||||
new PersistentState.Type<>(
|
new PersistentState.Type<>(
|
||||||
TombstoneStorage::new, // Supplier
|
TombstoneStorage::new, // Supplier
|
||||||
@ -29,7 +29,7 @@ public class TombstoneStorage extends PersistentState {
|
|||||||
),
|
),
|
||||||
"simple_tombstone" // 存储名称
|
"simple_tombstone" // 存储名称
|
||||||
);
|
);
|
||||||
LOGGER.info("[TombstoneStorage] 成功加载墓碑数据.");
|
//LOGGER.info("[TombstoneStorage] 成功加载墓碑数据.");
|
||||||
return storage;
|
return storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user