mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
a bit more
This commit is contained in:
@@ -12,11 +12,17 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Config class, defines config values.
|
||||
*/
|
||||
public class Config {
|
||||
public boolean lecternToggle = true;
|
||||
public int scale = 10;
|
||||
public boolean useRoman = false;
|
||||
|
||||
/**
|
||||
* Loads the config file in to mod
|
||||
*/
|
||||
public void loadConfig(){
|
||||
Path configPath = Services.PLATFORM.getConfigPath("bookshelfinspector-config.yml");
|
||||
if(!Files.exists(configPath))createConfig(configPath);
|
||||
@@ -47,6 +53,9 @@ public class Config {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves config settings to config file
|
||||
*/
|
||||
public void saveConfig(){
|
||||
Path configPath = Services.PLATFORM.getConfigPath("bookshelfinspector-config.yml");
|
||||
if(!Files.exists(configPath)) createConfig(configPath);
|
||||
|
||||
@@ -3,17 +3,26 @@ package com.lukasabbe.bookshelfinspector.data;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Data for a slot in a chiseled bookshelf
|
||||
*/
|
||||
public class BookData {
|
||||
public ItemStack itemStack;
|
||||
public BlockPos pos;
|
||||
public int slotId;
|
||||
|
||||
/**
|
||||
* Creates data object with its data
|
||||
*/
|
||||
public BookData(ItemStack itemStack, BlockPos pos, int slotId) {
|
||||
this.itemStack = itemStack;
|
||||
this.pos = pos;
|
||||
this.slotId = slotId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an empty BookData
|
||||
*/
|
||||
public static BookData empty(){
|
||||
return new BookData(ItemStack.EMPTY, null, -1);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.lukasabbe.bookshelfinspector.data;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
/**
|
||||
* Data for bookshelf
|
||||
*/
|
||||
public class BookShelfData {
|
||||
public boolean isCurrentBookDataToggled = false;
|
||||
public BlockPos latestPos = null;
|
||||
|
||||
@@ -5,6 +5,9 @@ import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
/**
|
||||
* Tags for blocks used in the mod
|
||||
*/
|
||||
public class Tags {
|
||||
public static final TagKey<Block> CHISELED_BOOKSHELVES = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("c", "chiseled_bookshelves"));
|
||||
public static final TagKey<Block> LECTERNS = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("c", "lectern"));
|
||||
|
||||
Reference in New Issue
Block a user