Code cleanup
This commit is contained in:
@ -7,10 +7,10 @@ import wtf.hak.survivalfabric.features.RemoveDarknessEffect;
|
||||
|
||||
public class SurvivalFabricClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ClientConfigManager.getConfig();
|
||||
AngleViewer.register();
|
||||
RemoveDarknessEffect.register();
|
||||
}
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ClientConfigManager.getConfig();
|
||||
AngleViewer.register();
|
||||
RemoveDarknessEffect.register();
|
||||
}
|
||||
}
|
@ -4,8 +4,8 @@ import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
|
||||
public class SurvivalFabricDataGenerator implements DataGeneratorEntrypoint {
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||
@Override
|
||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class ClientConfigManager {
|
||||
}
|
||||
|
||||
public static ClientConfig load() {
|
||||
try(FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||
try (FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||
INSTANCE = GSON.fromJson(reader, ClientConfig.class);
|
||||
if (INSTANCE.configVersion.equalsIgnoreCase(new Config().configVersion)) {
|
||||
return INSTANCE;
|
||||
@ -41,12 +41,12 @@ public class ClientConfigManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static void save(){
|
||||
public static void save() {
|
||||
save(INSTANCE);
|
||||
}
|
||||
|
||||
public static void save(ClientConfig config) {
|
||||
try(FileWriter writer = new FileWriter(CONFIG_FILE)) {
|
||||
try (FileWriter writer = new FileWriter(CONFIG_FILE)) {
|
||||
GSON.toJson(config, writer);
|
||||
} catch (IOException e) {
|
||||
System.out.println("Error saving config: " + e.getMessage());
|
||||
|
@ -17,7 +17,7 @@ public class AngleViewer {
|
||||
public static boolean PREVENT_HEAD_MOVEMENT = false;
|
||||
|
||||
public static void register() {
|
||||
for(Angle angle : Angle.values()) {
|
||||
for (Angle angle : Angle.values()) {
|
||||
KeyBinding keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||
"key.survivalfabric." + angle.name().toLowerCase(),
|
||||
InputUtil.Type.KEYSYM,
|
||||
@ -28,14 +28,14 @@ public class AngleViewer {
|
||||
ClientTickEvents.END_CLIENT_TICK.register(mc -> {
|
||||
while (keyBinding.wasPressed()) {
|
||||
ClientPlayerEntity player = mc.player;
|
||||
if(player == null) return;
|
||||
if (player == null) return;
|
||||
player.setYaw(angle.yaw);
|
||||
player.setPitch(angle.pitch);
|
||||
|
||||
PREVENT_HEAD_MOVEMENT = true;
|
||||
|
||||
scheduler.schedule(() -> {
|
||||
if(player == null) return;
|
||||
if (player == null) return;
|
||||
PREVENT_HEAD_MOVEMENT = false;
|
||||
player.setPitch(-90);
|
||||
PREVENT_HEAD_MOVEMENT = true;
|
||||
|
@ -9,9 +9,9 @@ public class RemoveDarknessEffect {
|
||||
|
||||
public static void register() {
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
if(client.player != null && ClientConfigManager.getConfig().removeDarknessEffect){
|
||||
if (client.player != null && ClientConfigManager.getConfig().removeDarknessEffect) {
|
||||
StatusEffectInstance darknessEffect = client.player.getStatusEffect(StatusEffects.DARKNESS);
|
||||
if(darknessEffect != null)
|
||||
if (darknessEffect != null)
|
||||
client.player.removeStatusEffect(darknessEffect.getEffectType());
|
||||
}
|
||||
});
|
||||
|
@ -19,28 +19,28 @@ import static wtf.hak.survivalfabric.config.client.ClientConfigManager.getConfig
|
||||
public abstract class BackgroundRendererMixin {
|
||||
|
||||
@Unique
|
||||
private static final Fog EMPTY_FOG = new Fog(-8.0f, 1_000_000.0F, FogShape.CYLINDER, 0,0,0,0);
|
||||
private static final Fog EMPTY_FOG = new Fog(-8.0f, 1_000_000.0F, FogShape.CYLINDER, 0, 0, 0, 0);
|
||||
|
||||
@Inject(method = "applyFog", at = @At("RETURN"), cancellable = true)
|
||||
private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType, Vector4f color, float viewDistance, boolean thickenFog, float tickProgress, CallbackInfoReturnable<Fog> cir) {
|
||||
boolean renderFog = true;
|
||||
CameraSubmersionType subType = camera.getSubmersionType();
|
||||
if(subType == CameraSubmersionType.NONE) {
|
||||
if (subType == CameraSubmersionType.NONE) {
|
||||
World world = camera.getFocusedEntity().getWorld();
|
||||
if(world.getRegistryKey() == World.OVERWORLD && !getConfig().renderOverworldFog)
|
||||
if (world.getRegistryKey() == World.OVERWORLD && !getConfig().renderOverworldFog)
|
||||
renderFog = false;
|
||||
else if(world.getRegistryKey() == World.NETHER && !getConfig().renderNetherFog)
|
||||
else if (world.getRegistryKey() == World.NETHER && !getConfig().renderNetherFog)
|
||||
renderFog = false;
|
||||
else if(world.getRegistryKey() == World.END && !getConfig().renderEndFog)
|
||||
else if (world.getRegistryKey() == World.END && !getConfig().renderEndFog)
|
||||
renderFog = false;
|
||||
} else if(subType == CameraSubmersionType.WATER && !getConfig().renderWaterFog)
|
||||
} else if (subType == CameraSubmersionType.WATER && !getConfig().renderWaterFog)
|
||||
renderFog = false;
|
||||
else if(subType == CameraSubmersionType.LAVA && !getConfig().renderLavaFog)
|
||||
else if (subType == CameraSubmersionType.LAVA && !getConfig().renderLavaFog)
|
||||
renderFog = false;
|
||||
else if(subType == CameraSubmersionType.POWDER_SNOW && !getConfig().renderSnowFog)
|
||||
else if (subType == CameraSubmersionType.POWDER_SNOW && !getConfig().renderSnowFog)
|
||||
renderFog = false;
|
||||
|
||||
if(!renderFog)
|
||||
if (!renderFog)
|
||||
cir.setReturnValue(EMPTY_FOG);
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ public abstract class EntityMixin {
|
||||
|
||||
@Inject(method = "setYaw", at = @At("HEAD"), cancellable = true)
|
||||
private void preventYawChange(float yaw, CallbackInfo ci) {
|
||||
if((Object) this instanceof ClientPlayerEntity player) {
|
||||
if(player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||
if ((Object) this instanceof ClientPlayerEntity player) {
|
||||
if (player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
@ -22,8 +22,8 @@ public abstract class EntityMixin {
|
||||
|
||||
@Inject(method = "setPitch", at = @At("HEAD"), cancellable = true)
|
||||
private void preventPitchChange(float pitch, CallbackInfo ci) {
|
||||
if((Object) this instanceof ClientPlayerEntity player) {
|
||||
if(player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||
if ((Object) this instanceof ClientPlayerEntity player) {
|
||||
if (player.isMainPlayer() && AngleViewer.PREVENT_HEAD_MOVEMENT) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,5 @@
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package wtf.hak.survivalfabric;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents;
|
||||
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
|
||||
@ -18,30 +17,29 @@ import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
public class SurvivalFabric implements ModInitializer {
|
||||
|
||||
public static final String MOD_ID = "survivalfabric";
|
||||
public static final String MOD_ID = "survivalfabric";
|
||||
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> SpectatorCommand.register(dispatcher, new String[] { "spectator", "s", "S", "camera", "c", "C", }));
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> ReloadConfigCommand.register(dispatcher, new String[] { "reloadsurvivalconfig" }));
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> SlimeChunkCommand.register(dispatcher, new String[] { "slimechunk", "sc" }));
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> SpectatorCommand.register(dispatcher, "spectator", "s", "S", "camera", "c", "C"));
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> ReloadConfigCommand.register(dispatcher, "reloadsurvivalconfig"));
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> SlimeChunkCommand.register(dispatcher, "slimechunk", "sc"));
|
||||
|
||||
if(getConfig().sharedEnderChestEnabled)
|
||||
new SharedEnderChest().onInitialize();
|
||||
if (getConfig().sharedEnderChestEnabled)
|
||||
new SharedEnderChest().onInitialize();
|
||||
|
||||
if(getConfig().veinMinerEnabled) {
|
||||
PlayerBlockBreakEvents.BEFORE.register((world, player, pos, state, blockEntity) -> {
|
||||
if (player instanceof ServerPlayerEntity serverPlayer) {
|
||||
return VeinMinerEvents.beforeBlockBreak(world, serverPlayer, pos, state);
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (getConfig().veinMinerEnabled) {
|
||||
PlayerBlockBreakEvents.BEFORE.register((world, player, pos, state, blockEntity) -> {
|
||||
if (player instanceof ServerPlayerEntity serverPlayer) {
|
||||
return VeinMinerEvents.beforeBlockBreak(world, serverPlayer, pos, state);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
ServerEntityEvents.ENTITY_LOAD.register(VeinMinerEvents::onEntityLoad);
|
||||
}
|
||||
}
|
||||
ServerEntityEvents.ENTITY_LOAD.register(VeinMinerEvents::onEntityLoad);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,11 +6,9 @@ import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.random.CheckedRandom;
|
||||
import net.minecraft.util.math.random.ChunkRandom;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import wtf.hak.survivalfabric.config.ConfigManager;
|
||||
|
||||
import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
@ -31,7 +29,7 @@ public class SlimeChunkCommand {
|
||||
ServerPlayerEntity p = (ServerPlayerEntity) source.getEntity();
|
||||
Chunk chunk = p.getServerWorld().getChunk(p.getBlockPos());
|
||||
Random slimeRandom = ChunkRandom.getSlimeRandom(chunk.getPos().x, chunk.getPos().z, p.getServerWorld().getSeed(), 987234911L);
|
||||
if(slimeRandom.nextInt(10) == 0) {
|
||||
if (slimeRandom.nextInt(10) == 0) {
|
||||
p.sendMessage(Text.literal(getConfig().inSlimeChunkMessage));
|
||||
} else
|
||||
p.sendMessage(Text.literal(getConfig().notInSlimeChunkMessage));
|
||||
|
@ -24,7 +24,7 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
public static Config load() {
|
||||
try(FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||
try (FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||
INSTANCE = GSON.fromJson(reader, Config.class);
|
||||
if (INSTANCE.configVersion.equalsIgnoreCase(new Config().configVersion)) {
|
||||
return INSTANCE;
|
||||
@ -41,7 +41,7 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
public static void save(Config config) {
|
||||
try(FileWriter writer = new FileWriter(CONFIG_FILE)) {
|
||||
try (FileWriter writer = new FileWriter(CONFIG_FILE)) {
|
||||
GSON.toJson(config, writer);
|
||||
} catch (IOException e) {
|
||||
System.out.println("Error saving config: " + e.getMessage());
|
||||
|
@ -1,15 +1,8 @@
|
||||
package wtf.hak.survivalfabric.features.sharedenderchest;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
||||
|
||||
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.EnderChestBlock;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@ -24,11 +17,14 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.WorldSavePath;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import static wtf.hak.survivalfabric.SurvivalFabric.LOGGER;
|
||||
import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
@ -38,24 +34,6 @@ public class SharedEnderChest implements ServerLifecycleEvents.ServerStopping, S
|
||||
|
||||
private long ticksUntilSave = -20;
|
||||
|
||||
public void onServerStarted(MinecraftServer server) {
|
||||
File inventoryFile = getFile(server);
|
||||
if (inventoryFile.exists()) {
|
||||
try (FileInputStream inventoryFileInputStream = new FileInputStream(inventoryFile);
|
||||
DataInputStream inventoryFileDataInput = new DataInputStream(inventoryFileInputStream)) {
|
||||
NbtCompound nbt = NbtIo.readCompressed(inventoryFileDataInput, NbtSizeTracker.ofUnlimitedBytes());
|
||||
DefaultedList<ItemStack> inventoryItemStacks = DefaultedList.ofSize(getConfig().sharedEnderChestRows * 9, ItemStack.EMPTY);
|
||||
Inventories.readNbt(nbt, inventoryItemStacks, server.getRegistryManager());
|
||||
sharedInventory = new SharedInventory(inventoryItemStacks);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error while loading Shared Ender Chest: " + e);
|
||||
sharedInventory = new SharedInventory(getConfig().sharedEnderChestRows);
|
||||
}
|
||||
} else {
|
||||
sharedInventory = new SharedInventory(getConfig().sharedEnderChestRows);
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveInventory(MinecraftServer server) {
|
||||
File inventoryFile = getFile(server);
|
||||
NbtCompound nbt = new NbtCompound();
|
||||
@ -69,48 +47,6 @@ public class SharedEnderChest implements ServerLifecycleEvents.ServerStopping, S
|
||||
LOGGER.error("Error while saving Shared Ender Chest: " + e);
|
||||
}
|
||||
}
|
||||
public void onServerStopping(MinecraftServer server) {
|
||||
saveInventory(server);
|
||||
}
|
||||
|
||||
public void onEndTick(MinecraftServer server) {
|
||||
if (ticksUntilSave != -20 && --ticksUntilSave <= 0L) {
|
||||
saveInventory(server);
|
||||
ticksUntilSave = 20L;
|
||||
}
|
||||
}
|
||||
|
||||
public void onInitialize() {
|
||||
ticksUntilSave = 20L;
|
||||
|
||||
UseBlockCallback listenerUseBlock = (player, world, hand, hitResult) -> {
|
||||
|
||||
if (world.getBlockState(hitResult.getBlockPos()).getBlock() instanceof EnderChestBlock) {
|
||||
if (!player.isSpectator()) {
|
||||
if(!getConfig().sharedEnderChestLimitedAccess) {
|
||||
if (world.isClient()) return ActionResult.SUCCESS;
|
||||
openSharedEnderChest(player, world, hitResult.getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
} else {
|
||||
for(String name : getConfig().sharedEnderChestNames) {
|
||||
if(name.toLowerCase().strip().equalsIgnoreCase(player.getNameForScoreboard().toLowerCase())) {
|
||||
if (world.isClient()) return ActionResult.SUCCESS;
|
||||
openSharedEnderChest(player, world, hitResult.getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ActionResult.PASS;
|
||||
};
|
||||
|
||||
UseBlockCallback.EVENT.register(listenerUseBlock);
|
||||
ServerLifecycleEvents.SERVER_STARTED.register(this);
|
||||
ServerLifecycleEvents.SERVER_STOPPING.register(this);
|
||||
ServerTickEvents.END_SERVER_TICK.register(this);
|
||||
|
||||
}
|
||||
|
||||
public static void openSharedEnderChest(PlayerEntity player, World world, BlockPos pos) {
|
||||
fakeEnderChestOpen(world, pos, true);
|
||||
@ -132,16 +68,76 @@ public class SharedEnderChest implements ServerLifecycleEvents.ServerStopping, S
|
||||
return;
|
||||
}
|
||||
|
||||
if(open)
|
||||
if (open)
|
||||
playEnderChestOpenSound(world, pos);
|
||||
else
|
||||
playEnderChestCloseSound(world, pos);
|
||||
world.addSyncedBlockEvent(pos, Blocks.ENDER_CHEST, 1, open ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
private static File getFile(MinecraftServer server) {
|
||||
return server.getSavePath(WorldSavePath.ROOT).resolve("sharedenderchest.sav").toFile();
|
||||
}
|
||||
|
||||
public void onServerStarted(MinecraftServer server) {
|
||||
File inventoryFile = getFile(server);
|
||||
if (inventoryFile.exists()) {
|
||||
try (FileInputStream inventoryFileInputStream = new FileInputStream(inventoryFile);
|
||||
DataInputStream inventoryFileDataInput = new DataInputStream(inventoryFileInputStream)) {
|
||||
NbtCompound nbt = NbtIo.readCompressed(inventoryFileDataInput, NbtSizeTracker.ofUnlimitedBytes());
|
||||
DefaultedList<ItemStack> inventoryItemStacks = DefaultedList.ofSize(getConfig().sharedEnderChestRows * 9, ItemStack.EMPTY);
|
||||
Inventories.readNbt(nbt, inventoryItemStacks, server.getRegistryManager());
|
||||
sharedInventory = new SharedInventory(inventoryItemStacks);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error while loading Shared Ender Chest: " + e);
|
||||
sharedInventory = new SharedInventory(getConfig().sharedEnderChestRows);
|
||||
}
|
||||
} else {
|
||||
sharedInventory = new SharedInventory(getConfig().sharedEnderChestRows);
|
||||
}
|
||||
}
|
||||
|
||||
public void onServerStopping(MinecraftServer server) {
|
||||
saveInventory(server);
|
||||
}
|
||||
|
||||
public void onEndTick(MinecraftServer server) {
|
||||
if (ticksUntilSave != -20 && --ticksUntilSave <= 0L) {
|
||||
saveInventory(server);
|
||||
ticksUntilSave = 20L;
|
||||
}
|
||||
}
|
||||
|
||||
public void onInitialize() {
|
||||
ticksUntilSave = 20L;
|
||||
|
||||
UseBlockCallback listenerUseBlock = (player, world, hand, hitResult) -> {
|
||||
|
||||
if (world.getBlockState(hitResult.getBlockPos()).getBlock() instanceof EnderChestBlock) {
|
||||
if (!player.isSpectator()) {
|
||||
if (!getConfig().sharedEnderChestLimitedAccess) {
|
||||
if (world.isClient()) return ActionResult.SUCCESS;
|
||||
openSharedEnderChest(player, world, hitResult.getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
} else {
|
||||
for (String name : getConfig().sharedEnderChestNames) {
|
||||
if (name.toLowerCase().strip().equalsIgnoreCase(player.getNameForScoreboard().toLowerCase())) {
|
||||
if (world.isClient()) return ActionResult.SUCCESS;
|
||||
openSharedEnderChest(player, world, hitResult.getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ActionResult.PASS;
|
||||
};
|
||||
|
||||
UseBlockCallback.EVENT.register(listenerUseBlock);
|
||||
ServerLifecycleEvents.SERVER_STARTED.register(this);
|
||||
ServerLifecycleEvents.SERVER_STOPPING.register(this);
|
||||
ServerTickEvents.END_SERVER_TICK.register(this);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -12,8 +12,8 @@ import java.util.Map;
|
||||
|
||||
public class SharedInventory implements Inventory {
|
||||
|
||||
private final DefaultedList<ItemStack> stacks;
|
||||
public final Map<PlayerEntity, BlockPos> openedEnderChests = new HashMap<>();
|
||||
private final DefaultedList<ItemStack> stacks;
|
||||
|
||||
public SharedInventory(int inventoryRows) {
|
||||
this.stacks = DefaultedList.ofSize(inventoryRows * 9, ItemStack.EMPTY);
|
||||
@ -45,7 +45,7 @@ public class SharedInventory implements Inventory {
|
||||
}
|
||||
|
||||
itemStack_1 = var1.next();
|
||||
} while(itemStack_1.isEmpty());
|
||||
} while (itemStack_1.isEmpty());
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class SharedInventory implements Inventory {
|
||||
@Override
|
||||
public void onClose(PlayerEntity player) {
|
||||
BlockPos pos = openedEnderChests.remove(player);
|
||||
if(openedEnderChests.containsValue(pos))
|
||||
if (openedEnderChests.containsValue(pos))
|
||||
return;
|
||||
SharedEnderChest.fakeEnderChestOpen(player.getWorld(), pos, false);
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface Drill {
|
||||
boolean canHandle(BlockState blockState);
|
||||
|
||||
boolean isRightTool(BlockPos pos);
|
||||
|
||||
boolean drill(BlockPos blockPos);
|
||||
}
|
@ -20,26 +20,25 @@ public class VeinMinerEvents {
|
||||
boolean isVeinMining = VeinMinerSession.sessionForPlayer(player) != null;
|
||||
boolean canVeinMine = player.isInSneakingPose();
|
||||
if (canVeinMine && !isVeinMining) {
|
||||
VeinMinerSession session = VeinMinerSession.start(player, (ServerWorld)world, pos);
|
||||
VeinMinerSession session = VeinMinerSession.start(player, (ServerWorld) world, pos);
|
||||
boolean shouldContinue = !mine(session);
|
||||
session.finish();
|
||||
return shouldContinue;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void onEntityLoad(Entity entity, ServerWorld world) {
|
||||
BlockPos pos = entity.getBlockPos();
|
||||
VeinMinerSession session = VeinMinerSession.sessionForPosition(pos);
|
||||
if (session != null) {
|
||||
entity.setPos(session.initialPos.getX(), session.initialPos.getY(), session.initialPos.getZ());
|
||||
}
|
||||
BlockPos pos = entity.getBlockPos();
|
||||
VeinMinerSession session = VeinMinerSession.sessionForPosition(pos);
|
||||
if (session != null) {
|
||||
entity.setPos(session.initialPos.getX(), session.initialPos.getY(), session.initialPos.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean mine(VeinMinerSession session) {
|
||||
Drill[] drills = new Drill[] {
|
||||
Drill[] drills = new Drill[]{
|
||||
new OreDrill(session),
|
||||
new WoodDrill(session),
|
||||
new LeavesDrill(session)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package wtf.hak.survivalfabric.features.veinminer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class VeinMinerSession {
|
||||
private static final ArrayList<VeinMinerSession> sessions = new ArrayList<>();
|
||||
|
||||
@ -16,8 +16,16 @@ public class VeinMinerSession {
|
||||
public Set<BlockPos> positions;
|
||||
public BlockPos initialPos;
|
||||
|
||||
private VeinMinerSession(ServerPlayerEntity player, ServerWorld world, BlockPos initialPos) {
|
||||
this.player = player;
|
||||
this.world = world;
|
||||
this.initialPos = initialPos;
|
||||
this.positions = new HashSet<>();
|
||||
positions.add(initialPos);
|
||||
}
|
||||
|
||||
public static VeinMinerSession sessionForPlayer(ServerPlayerEntity player) {
|
||||
for (var session: sessions) {
|
||||
for (var session : sessions) {
|
||||
if (session.player == player) {
|
||||
return session;
|
||||
}
|
||||
@ -26,7 +34,7 @@ public class VeinMinerSession {
|
||||
}
|
||||
|
||||
public static VeinMinerSession sessionForPosition(BlockPos position) {
|
||||
for (var session: sessions) {
|
||||
for (var session : sessions) {
|
||||
if (session.positions.contains(position)) {
|
||||
return session;
|
||||
}
|
||||
@ -44,14 +52,6 @@ public class VeinMinerSession {
|
||||
sessions.remove(session);
|
||||
}
|
||||
|
||||
private VeinMinerSession(ServerPlayerEntity player, ServerWorld world, BlockPos initialPos) {
|
||||
this.player = player;
|
||||
this.world = world;
|
||||
this.initialPos = initialPos;
|
||||
this.positions = new HashSet<>();
|
||||
positions.add(initialPos);
|
||||
}
|
||||
|
||||
public void addPosition(BlockPos pos) {
|
||||
positions.add(pos);
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
package wtf.hak.survivalfabric.features.veinminer.drills;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.PlainTextContent;
|
||||
@ -11,6 +9,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import wtf.hak.survivalfabric.features.veinminer.Drill;
|
||||
import wtf.hak.survivalfabric.features.veinminer.VeinMinerSession;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static wtf.hak.survivalfabric.SurvivalFabric.LOGGER;
|
||||
|
||||
public class DrillBase implements Drill {
|
||||
@ -37,14 +37,6 @@ public class DrillBase implements Drill {
|
||||
return session.player.getMainHandStack().isSuitableFor(blockState);
|
||||
}
|
||||
|
||||
protected interface ForXYZHandler {
|
||||
public void handle(BlockPos pos);
|
||||
}
|
||||
|
||||
protected interface ForXYZCounter {
|
||||
public int handle(BlockPos pos);
|
||||
}
|
||||
|
||||
protected void forXYZ(BlockPos pos, int max, ForXYZHandler handler) {
|
||||
forXYZ(pos, max, handlerPos -> {
|
||||
handler.handle(handlerPos);
|
||||
@ -72,33 +64,30 @@ public class DrillBase implements Drill {
|
||||
}
|
||||
}
|
||||
|
||||
String[] order = new String[] { "x", "y", "z" };
|
||||
String[] order = new String[]{"x", "y", "z"};
|
||||
if (forceVertical) {
|
||||
order = new String[] { "y", "x", "z" };
|
||||
}
|
||||
else {
|
||||
order = new String[]{"y", "x", "z"};
|
||||
} else {
|
||||
ServerPlayerEntity player = session.player;
|
||||
boolean majorPitchChange = player.getPitch() < -45.0 || player.getPitch() > 45.0;
|
||||
boolean majorYawChange = (player.getYaw() > 45.0 && player.getYaw() < 135.0) || (player.getYaw() < -45.0 && player.getYaw() > -135.0);
|
||||
if (majorPitchChange) {
|
||||
if (majorYawChange) {
|
||||
order = new String[] { "y", "z", "x" };
|
||||
order = new String[]{"y", "z", "x"};
|
||||
} else {
|
||||
order = new String[]{"y", "x", "z"};
|
||||
}
|
||||
else {
|
||||
order = new String[] { "y", "x", "z" };
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (majorYawChange) {
|
||||
order = new String[] { "z", "y", "x" };
|
||||
order = new String[]{"z", "y", "x"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
for (int i1: offsets) {
|
||||
for (int i2: offsets) {
|
||||
for (int i3: offsets) {
|
||||
for (int i1 : offsets) {
|
||||
for (int i2 : offsets) {
|
||||
for (int i3 : offsets) {
|
||||
int ix = order[0] == "x" ? i1 : order[1] == "x" ? i2 : i3;
|
||||
int iy = order[0] == "y" ? i1 : order[1] == "y" ? i2 : i3;
|
||||
int iz = order[0] == "z" ? i1 : order[1] == "z" ? i2 : i3;
|
||||
@ -130,4 +119,12 @@ public class DrillBase implements Drill {
|
||||
session.player.sendMessage(text);
|
||||
LOGGER.info(message);
|
||||
}
|
||||
|
||||
protected interface ForXYZHandler {
|
||||
void handle(BlockPos pos);
|
||||
}
|
||||
|
||||
protected interface ForXYZCounter {
|
||||
int handle(BlockPos pos);
|
||||
}
|
||||
}
|
@ -15,12 +15,12 @@ import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
public class LeavesDrill extends DrillBase {
|
||||
|
||||
public static final TagKey<Block> leavesTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "leaves"));
|
||||
|
||||
public LeavesDrill(VeinMinerSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
public static final TagKey<Block> leavesTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "leaves"));
|
||||
|
||||
@Override
|
||||
public boolean canHandle(BlockState blockState) {
|
||||
return blockState.isIn(leavesTag);
|
||||
|
@ -6,22 +6,21 @@ import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import wtf.hak.survivalfabric.features.veinminer.VeinMinerSession;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
public class OreDrill extends DrillBase {
|
||||
|
||||
public static final TagKey<Block> oreTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "ore"));
|
||||
|
||||
public OreDrill(VeinMinerSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
public static final TagKey<Block> oreTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "ore"));
|
||||
|
||||
@Override
|
||||
public boolean canHandle(BlockState blockState) {
|
||||
return blockState.isIn(oreTag);
|
||||
|
@ -1,29 +1,27 @@
|
||||
package wtf.hak.survivalfabric.features.veinminer.drills;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import wtf.hak.survivalfabric.features.veinminer.VeinMinerSession;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
import static wtf.hak.survivalfabric.config.ConfigManager.getConfig;
|
||||
|
||||
public class WoodDrill extends DrillBase {
|
||||
|
||||
public static final TagKey<Block> woodTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "wood"));
|
||||
|
||||
public WoodDrill(VeinMinerSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
public static final TagKey<Block> woodTag = TagKey.of(RegistryKeys.BLOCK, Identifier.of("survivalfabric", "wood"));
|
||||
|
||||
@Override
|
||||
public boolean canHandle(BlockState blockState) {
|
||||
return blockState.isIn(woodTag);
|
||||
|
@ -1,10 +1,8 @@
|
||||
package wtf.hak.survivalfabric.mixin;
|
||||
|
||||
import com.mojang.authlib.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.message.MessageType;
|
||||
import net.minecraft.network.message.SignedMessage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.PlayerManager;
|
||||
import net.minecraft.server.network.ConnectedClientData;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
@ -18,9 +16,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import wtf.hak.survivalfabric.commands.SpectatorCommand;
|
||||
import wtf.hak.survivalfabric.config.ConfigManager;
|
||||
|
||||
import java.awt.*;
|
||||
import java.beans.Expression;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@Mixin(PlayerManager.class)
|
||||
@ -28,7 +23,7 @@ public abstract class PlayerManagerMixin {
|
||||
|
||||
@Inject(method = {"onPlayerConnect"}, at = {@At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;broadcast(Lnet/minecraft/text/Text;Z)V")})
|
||||
public void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData clientData, CallbackInfo ci) {
|
||||
if(ConfigManager.getConfig().joinMessageEnabled && !player.getServer().isSingleplayer()) {
|
||||
if (ConfigManager.getConfig().joinMessageEnabled && !player.getServer().isSingleplayer()) {
|
||||
Text text = Text.literal(String.format(ConfigManager.getConfig().joinMessage, player.getName().getString()));
|
||||
player.sendMessage(text, false);
|
||||
}
|
||||
@ -36,7 +31,7 @@ public abstract class PlayerManagerMixin {
|
||||
|
||||
@ModifyArg(method = {"onPlayerConnect"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;broadcast(Lnet/minecraft/text/Text;Z)V"))
|
||||
private Text onPlayerConnect(Text text) {
|
||||
if(ConfigManager.getConfig().joinMessageEnabled) {
|
||||
if (ConfigManager.getConfig().joinMessageEnabled) {
|
||||
String name = text.getString().split(" ")[0];
|
||||
return Text.literal(String.format(ConfigManager.getConfig().joinMessage, name));
|
||||
} else
|
||||
@ -45,24 +40,25 @@ public abstract class PlayerManagerMixin {
|
||||
|
||||
@Inject(method = {"remove"}, at = {@At("HEAD")})
|
||||
public void onPlayerLeave(ServerPlayerEntity player, CallbackInfo ci) {
|
||||
if(SpectatorCommand.spectating.containsKey(player)) {
|
||||
if (SpectatorCommand.spectating.containsKey(player)) {
|
||||
SpectatorCommand.LocationData loc = SpectatorCommand.spectating.remove(player);
|
||||
player.teleport(loc.world, loc.x,loc.y,loc.z, Set.of(), loc.yaw, loc.pitch, false);
|
||||
player.teleport(loc.world, loc.x, loc.y, loc.z, Set.of(), loc.yaw, loc.pitch, false);
|
||||
player.changeGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = {"broadcast(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/network/message/MessageType$Parameters;)V"}, at = {@At("HEAD")}, cancellable = true)
|
||||
private void onBroadcast(SignedMessage message, ServerPlayerEntity sender, MessageType.Parameters parameters, CallbackInfo ci) {
|
||||
if(sender != null && ConfigManager.getConfig().chatMessageEnabled) {
|
||||
if (sender != null && ConfigManager.getConfig().chatMessageEnabled) {
|
||||
String rawMessage = message.getContent().getString().trim();
|
||||
if(sender != null && ConfigManager.getConfig().chatCalcEnabled && rawMessage.endsWith("=")) {
|
||||
if (sender != null && ConfigManager.getConfig().chatCalcEnabled && rawMessage.endsWith("=")) {
|
||||
String expression = rawMessage.substring(0, rawMessage.length() - 1).trim();
|
||||
try {
|
||||
String result = String.valueOf(evaluateExpression(expression));
|
||||
if(rawMessage.contains(" ")) rawMessage += " ";
|
||||
if (rawMessage.contains(" ")) rawMessage += " ";
|
||||
rawMessage += (result.endsWith(".0")) ? result.substring(0, result.length() - 2) : result;
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
Text text = Text.literal(String.format(ConfigManager.getConfig().chatMessage, sender.getName().getString(), rawMessage));
|
||||
sender.getServer().getPlayerManager().broadcast(text, false);
|
||||
@ -73,12 +69,13 @@ public abstract class PlayerManagerMixin {
|
||||
String expression = rawMessage.substring(0, rawMessage.length() - 1).trim();
|
||||
try {
|
||||
String result = String.valueOf(evaluateExpression(expression));
|
||||
if(rawMessage.contains(" ")) rawMessage += " ";
|
||||
if (rawMessage.contains(" ")) rawMessage += " ";
|
||||
rawMessage += (result.endsWith(".0")) ? result.substring(0, result.length() - 2) : result;
|
||||
Text formattedMessage = Text.literal("<" + sender.getName().getString() + "> " + rawMessage);
|
||||
sender.getServer().getPlayerManager().broadcast(formattedMessage, false);
|
||||
ci.cancel();
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public abstract class ServerPlayNetworkHandlerMixin {
|
||||
|
||||
@ModifyArg(method = {"cleanUp"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;broadcast(Lnet/minecraft/text/Text;Z)V"))
|
||||
private Text quitMessage(Text text) {
|
||||
if(ConfigManager.getConfig().quitMessageEnabled) {
|
||||
if (ConfigManager.getConfig().quitMessageEnabled) {
|
||||
String name = text.getString().split(" ")[0];
|
||||
return Text.literal(String.format(ConfigManager.getConfig().quitMessage, name));
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public abstract class ServerPlayerEntityMixin {
|
||||
|
||||
@Inject(method = "getPlayerListName", at = @At("HEAD"), cancellable = true)
|
||||
private void changePlayerListName(CallbackInfoReturnable<Text> cir) {
|
||||
if(ConfigManager.getConfig().dimensionIndicatorEnabled) {
|
||||
if (ConfigManager.getConfig().dimensionIndicatorEnabled) {
|
||||
ServerPlayerEntity p = (ServerPlayerEntity) (Object) this;
|
||||
String world = p.getServerWorld().getRegistryKey().getValue().toTranslationKey();
|
||||
String finalName;
|
||||
|
@ -14,8 +14,8 @@ public class ServerWorldMixin {
|
||||
|
||||
@Inject(method = "onDimensionChanged", at = {@At("HEAD")})
|
||||
public void onDimensionChange(Entity entity, CallbackInfo ci) {
|
||||
if(entity instanceof ServerPlayerEntity) {
|
||||
PacketUtils.updateListNames((ServerPlayerEntity)entity);
|
||||
if (entity instanceof ServerPlayerEntity) {
|
||||
PacketUtils.updateListNames((ServerPlayerEntity) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import java.util.Objects;
|
||||
public class PacketUtils {
|
||||
|
||||
public static void updateListNames(ServerPlayerEntity p) {
|
||||
for(ServerPlayerEntity sp : Objects.requireNonNull(p.getServer()).getPlayerManager().getPlayerList()) {
|
||||
for (ServerPlayerEntity sp : Objects.requireNonNull(p.getServer()).getPlayerManager().getPlayerList()) {
|
||||
sp.networkHandler.sendPacket(new PlayerListS2CPacket(PlayerListS2CPacket.Action.UPDATE_DISPLAY_NAME, p));
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +1,48 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "survivalfabric",
|
||||
"version": "${version}",
|
||||
"name": "SurvivalFabric",
|
||||
"description": "Adds a few QOL features to your Survival!",
|
||||
"authors": [
|
||||
"AlwaysHAK"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://hak.wtf",
|
||||
"sources": "https://git.hak.wtf/hkuijlman/SurvivalFabric",
|
||||
"issues": "https://git.hak.wtf/hkuijlman/SurvivalFabric/issues"
|
||||
},
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/survivalfabric/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabric"
|
||||
],
|
||||
"client": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabricClient"
|
||||
],
|
||||
"fabric-datagen": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabricDataGenerator"
|
||||
],
|
||||
"modmenu": [
|
||||
"wtf.hak.survivalfabric.modmenu.ModMenuIntegration"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"survivalfabric.mixins.json",
|
||||
{
|
||||
"config": "survivalfabric.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.16.10",
|
||||
"minecraft": "~1.21.5",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
"optional": {
|
||||
"modmenu": "*"
|
||||
}
|
||||
"schemaVersion": 1,
|
||||
"id": "survivalfabric",
|
||||
"version": "${version}",
|
||||
"name": "SurvivalFabric",
|
||||
"description": "Adds a few QOL features to your Survival!",
|
||||
"authors": [
|
||||
"AlwaysHAK"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://hak.wtf",
|
||||
"sources": "https://git.hak.wtf/hkuijlman/SurvivalFabric",
|
||||
"issues": "https://git.hak.wtf/hkuijlman/SurvivalFabric/issues"
|
||||
},
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/survivalfabric/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabric"
|
||||
],
|
||||
"client": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabricClient"
|
||||
],
|
||||
"fabric-datagen": [
|
||||
"wtf.hak.survivalfabric.SurvivalFabricDataGenerator"
|
||||
],
|
||||
"modmenu": [
|
||||
"wtf.hak.survivalfabric.modmenu.ModMenuIntegration"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"survivalfabric.mixins.json",
|
||||
{
|
||||
"config": "survivalfabric.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.16.10",
|
||||
"minecraft": "~1.21.5",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
"optional": {
|
||||
"modmenu": "*"
|
||||
}
|
||||
}
|
@ -10,5 +10,5 @@
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user