diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 000000000..f35ab6fef
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+ko_fi: unlikepaladin
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..2b185361b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,58 @@
+name: Bug Report
+description: "For reporting bugs and other defects"
+labels:
+ - bug
+body:
+ - type: markdown
+ attributes:
+ value: >-
+ **Note: This issue tracker is not intended for support requests!** If you need help with crashes or other issues, then
+ you should [ask on our Discord server](https://discord.gg/zbMDUPB) instead.
+
+ Additionally, please make sure you have done the following:
+
+ - **Have you ensured that all of your mods are up-to-date?** The latest version of Paladin's Furniture Mod
+ can always be found [on Modrinth](https://modrinth.com/mod/paladins-furniture) or [on CurseForge](https://www.curseforge.com/minecraft/mc-mods/paladins-furniture).
+
+ - **Have you used the [search tool](https://github.com/UnlikePaladin/paladins-furniture/issues) to check whether your issue
+ has already been reported?** If it has been, then consider adding more information to the existing issue instead.
+
+ - **Have you determined the minimum set of instructions to reproduce the issue?** If your problem only occurs
+ with other mods installed, then you should narrow down exactly which mods are causing the issue. Please do not
+ provide your entire list of mods to us and expect that we will be able to figure out the problem.
+
+
+ This issue template was based [off of Sodium's](https://github.com/CaffeineMC/sodium-fabric/blob/dev/.github/ISSUE_TEMPLATE/bug_report.yml)
+ - type: textarea
+ id: description
+ attributes:
+ label: Bug Description
+ description: >-
+ Use this section to describe the issue you are experiencing in as much depth as possible. The description should
+ explain what behavior you were expecting, and why you believe the issue to be a bug. If the issue you are reporting
+ only occurs with specific mods installed, then provide the name and version of each mod.
+
+ **Hint:** If you have any screenshots, videos, or other information that you feel is necessary to
+ explain the issue, you can attach them here.
+ - type: textarea
+ id: description-reproduction-steps
+ attributes:
+ label: Reproduction Steps
+ description: >-
+ Provide as much information as possible on how to reproduce this bug. Make sure your instructions are as clear and
+ concise as possible, because other people will need to be able to follow your guide in order to re-create the issue.
+
+ **Hint:** A common way to fill this section out is to write a step-by-step guide.
+ validations:
+ required: true
+ - type: textarea
+ id: log-file
+ attributes:
+ label: Log File
+ description: >-
+ **Hint:** You can usually find the log files within the folder `.minecraft/logs`. Most often, you will want the `latest.log`
+ file, since that file belongs to the last played session of the game.
+ placeholder: >-
+ Drag-and-drop the log file here.
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..4fdf39b79
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,7 @@
+blank_issues_enabled: true
+contact_links:
+ - name: For help with other issues, join the Discord community
+ url: https://discord.gg/zbMDUPB
+ about: This is the best option for getting help with mod installation, performance issues, and any other support inquiries
+ # Copied from https://github.com/CaffeineMC/sodium-fabric#community
+ # Copied from https://github.com/CaffeineMC/sodium-fabric/blob/dev/.github/ISSUE_TEMPLATE/config.yml
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..7de897952
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,26 @@
+name: Feature Request
+description: "For requesting new features or improvements"
+labels:
+ - enhancement
+body:
+ - type: markdown
+ attributes:
+ value: >-
+ This form is for requesting new features or improvements, and should not be used for bug reports or other issues.
+ - type: markdown
+ attributes:
+ value: >-
+ Make sure you have used the [search tool](https://github.com/UnlikePaladin/paladins-furniture/issues) to see if a similar
+ request already exists. If we have previously closed a feature request, then please do not create another request.
+ - type: markdown
+ attributes:
+ value: >-
+ This template was based [off of Sodium's](https://github.com/CaffeineMC/sodium-fabric/blob/dev/.github/ISSUE_TEMPLATE/feature_request.yml)
+ - type: textarea
+ id: description
+ attributes:
+ label: Request Description
+ description: >-
+ Use this section to describe the feature or improvement that you are looking for. The description should explain
+ what you would like to see added, and a clear and concise description
+ of what you would like changed.
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index beb6b1d77..8f83869e1 100755
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
- id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false
+ id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
}
architectury {
diff --git a/common/build.gradle b/common/build.gradle
index 9ea7d9f75..a2a0e82d4 100755
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -21,7 +21,13 @@ dependencies {
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Remove the next line if you don't want to depend on the API
- modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${rootProject.rei_version}"
+ modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.rei_version}"){
+ exclude(group: "net.fabricmc.fabric-api")
+ exclude(group: "me.shedaniel.cloth")
+ }
+ modCompileOnly("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_version}") {
+ exclude(group: "net.fabricmc.fabric-api")
+ }
modCompileOnly("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version_fabric}"){
exclude(group: "net.fabricmc.fabric-api")
diff --git a/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureMod.java b/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureMod.java
index 63004b23c..44235746f 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureMod.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureMod.java
@@ -106,6 +106,14 @@ public static Loader getLoader() {
throw new AssertionError();
}
+ public static boolean isOptifineLoaded() {
+ try {
+ Class.forName("net.optifine.shaders.Shaders");
+ return true;
+ } catch (ClassNotFoundException e) {
+ return false;
+ }
+ }
public enum Loader implements StringIdentifiable {
FORGE("forge"),
FABRIC_LIKE("fabric_like");
diff --git a/common/src/main/java/com/unlikepaladin/pfm/blocks/BasicShowerHandleBlock.java b/common/src/main/java/com/unlikepaladin/pfm/blocks/BasicShowerHandleBlock.java
index 6dce008e7..26098a1fc 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/blocks/BasicShowerHandleBlock.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/blocks/BasicShowerHandleBlock.java
@@ -108,7 +108,8 @@ public BlockState toggleOpen(BlockState state, World world, BlockPos pos, boolea
state = state.cycle(POWERED);}
world.setBlockState(pos, state, Block.NOTIFY_ALL);
this.updateNeighbors(state, world, pos);
- ((ShowerHandleBlockEntity)(world.getBlockEntity(pos))).setState(state.get(POWERED));
+ if (world.getBlockEntity(pos) instanceof ShowerHandleBlockEntity)
+ ((ShowerHandleBlockEntity)(world.getBlockEntity(pos))).setState(state.get(POWERED));
return state;
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/blocks/LightSwitchBlock.java b/common/src/main/java/com/unlikepaladin/pfm/blocks/LightSwitchBlock.java
index 799eca876..95bfa551a 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/blocks/LightSwitchBlock.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/blocks/LightSwitchBlock.java
@@ -113,7 +113,8 @@ public BlockState togglePower(BlockState state, World world, BlockPos pos, boole
state = state.cycle(POWERED);}
world.setBlockState(pos, state, Block.NOTIFY_ALL);
this.updateNeighbors(state, world, pos);
- ((LightSwitchBlockEntity)world.getBlockEntity(pos)).setState(state.get(POWERED));
+ if (world.getBlockEntity(pos) instanceof LightSwitchBlockEntity)
+ ((LightSwitchBlockEntity)world.getBlockEntity(pos)).setState(state.get(POWERED));
return state;
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/LightSwitchBlockEntity.java b/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/LightSwitchBlockEntity.java
index 323f3c154..f4fdaace6 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/LightSwitchBlockEntity.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/LightSwitchBlockEntity.java
@@ -47,18 +47,21 @@ public void addLight(long pos)
}
}
+
+
public void setState(boolean powered)
{
if(!lights.isEmpty()) {
- lights.removeIf(lightPos ->
+ lights.removeIf(offset ->
{
- BlockState state = world.getBlockState(lightPos);
+ BlockState state = world.getBlockState(this.pos.subtract(offset));
return !(state.getBlock() instanceof PowerableBlock);
});
- lights.forEach(lightPos ->
+ lights.forEach(offset ->
{
- BlockState state = world.getBlockState(lightPos);
- ((PowerableBlock) state.getBlock()).setPowered(world, lightPos, powered);
+ BlockPos actualPos = this.pos.subtract(offset);
+ BlockState state = world.getBlockState(actualPos);
+ ((PowerableBlock) state.getBlock()).setPowered(world, actualPos, powered);
});
diff --git a/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/ShowerHandleBlockEntity.java b/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/ShowerHandleBlockEntity.java
index 89c24a078..3c23d5c6b 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/ShowerHandleBlockEntity.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/ShowerHandleBlockEntity.java
@@ -10,17 +10,17 @@
import net.minecraft.util.math.BlockPos;
public class ShowerHandleBlockEntity extends BlockEntity {
- protected BlockPos showerHead;
+ protected BlockPos showerOffset;
public ShowerHandleBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntities.SHOWER_HANDLE_BLOCK_ENTITY, pos, state);
- this.showerHead = null;
+ this.showerOffset = null;
}
@Override
public void writeNbt(NbtCompound nbt) {
super.writeNbt(nbt);
- if (this.showerHead != null) {
- NbtLong showerHeadPos = NbtLong.of(this.showerHead.asLong());
+ if (this.showerOffset != null) {
+ NbtLong showerHeadPos = NbtLong.of(this.showerOffset.asLong());
nbt.put("showerHead", showerHeadPos);
}
}
@@ -29,21 +29,22 @@ public void writeNbt(NbtCompound nbt) {
public void readNbt(NbtCompound nbt) {
super.readNbt(nbt);
if(nbt.contains("showerHead", NbtElement.LONG_TYPE)){
- this.showerHead = BlockPos.fromLong(nbt.getLong("showerHead"));
+ this.showerOffset = BlockPos.fromLong(nbt.getLong("showerHead"));
}
}
public void setState(boolean open)
{
- if (this.showerHead != null) {
- if(this.world.getBlockEntity(this.showerHead) != null) {
+ if (this.showerOffset != null) {
+ BlockPos showerHeadPos = this.pos.subtract(this.showerOffset);
+ if(this.world.getBlockEntity(showerHeadPos) != null) {
- BlockState state = world.getBlockState(this.showerHead);
- ((ShowerHeadBlockEntity)world.getBlockEntity(this.showerHead)).setOpen(open);
+ BlockState state = world.getBlockState(showerHeadPos);
+ ((ShowerHeadBlockEntity)world.getBlockEntity(showerHeadPos)).setOpen(open);
- world.updateListeners(this.showerHead, state, state, Block.NOTIFY_LISTENERS);
- } else if (this.world.getBlockEntity(this.showerHead) == null) {
- this.showerHead = null;
+ world.updateListeners(showerHeadPos, state, state, Block.NOTIFY_LISTENERS);
+ } else if (this.world.getBlockEntity(showerHeadPos) == null) {
+ this.showerOffset = null;
}
}
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/config/PaladinFurnitureModConfig.java b/common/src/main/java/com/unlikepaladin/pfm/config/PaladinFurnitureModConfig.java
index ca42c327e..42f11b5ba 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/config/PaladinFurnitureModConfig.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/config/PaladinFurnitureModConfig.java
@@ -1,14 +1,15 @@
package com.unlikepaladin.pfm.config;
+import com.google.gson.*;
+import com.google.gson.reflect.TypeToken;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.config.option.AbstractConfigOption;
import com.unlikepaladin.pfm.config.option.BooleanConfigOption;
import com.unlikepaladin.pfm.config.option.Side;
import net.minecraft.text.TranslatableText;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
+import java.lang.reflect.Type;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
@@ -21,10 +22,12 @@ public class PaladinFurnitureModConfig {
private static final String COMMENT =
"This file stores configuration options for Paladin's Furniture Mod";
private final Path propertiesPath;
+ private final Path directoryPath;
public HashMap options = new LinkedHashMap<>();
public static final String MOD_OPTIONS = "pfm.config.categories.mod_options";
public static final String GAMEPLAY_OPTIONS = "pfm.config.categories.gameplay_options";
+ static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
public PaladinFurnitureModConfig(Path propertiesPath) {
this.addOptions(
@@ -40,7 +43,8 @@ public PaladinFurnitureModConfig(Path propertiesPath) {
renderImmersivePortalsMirrors = new BooleanConfigOption(new TranslatableText("pfm.option.renderImmersivePortalsMirrors"), new TranslatableText("pfm.option.renderImmersivePortalsMirrors.tooltip"), GAMEPLAY_OPTIONS, true, Side.CLIENT),
spawnImmersivePortalsMirror = new BooleanConfigOption(new TranslatableText("pfm.option.spawnImmersivePortalsMirror"), new TranslatableText("pfm.option.spawnImmersivePortalsMirror.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER)
);
- this.propertiesPath = propertiesPath;
+ this.propertiesPath = propertiesPath.resolve("pfm.json");
+ this.directoryPath = propertiesPath;
}
private void addOptions(AbstractConfigOption>... args) {
@@ -133,17 +137,74 @@ public Path getPath() {
*
* @throws IOException if the file cannot be loaded
*/
-
public void load() throws IOException {
+ Path legacyConfig = directoryPath.resolve("pfm.properties");
+ if (Files.exists(legacyConfig))
+ loadLegacyProperties(legacyConfig);
+
if (!Files.exists(propertiesPath)) {
return;
}
+ JsonObject config = new JsonObject();
+ try (FileReader reader = new FileReader(propertiesPath.toString())) {
+ JsonElement element = new JsonParser().parse(reader);
+ if (element.isJsonObject()) {
+ config = element.getAsJsonObject();
+ }
+ }
+
+ checkForUpdates.setValue(getFromJsonElement(config.get("checkForUpdates"), true));
+ shaderSolidFix.setValue(getFromJsonElement(config.get("shaderSolidFix"), false));
+ doChairsFacePlayer.setValue(getFromJsonElement(config.get("chairsFacePlayer"), true));
+ countersOfDifferentMaterialsConnect.setValue(getFromJsonElement(config.get("countersOfDifferentMaterialsConnect"), false));
+ tablesOfDifferentMaterialsConnect.setValue(getFromJsonElement(config.get("tablesOfDifferentMaterialsConnect"), false));
+ foodPopsOffStove.setValue(getFromJsonElement(config.get("foodPopsOffStove"), false));
+ enableBook.setValue(getFromJsonElement(config.get("enableBook"), false));
+ differentMirrorsConnect.setValue(getFromJsonElement(config.get("differentMirrorsConnect"), false));
+ mobsSitOnChairs.setValue(getFromJsonElement(config.get("mobsSitOnChairs"), false));
+ renderImmersivePortalsMirrors.setValue(getFromJsonElement(config.get("renderImmersivePortalsMirrors"), true));
+ spawnImmersivePortalsMirror.setValue(getFromJsonElement(config.get("spawnImmersivePortalsMirror"), true));
+
+ for (String key : options.keySet()) {
+ if (!config.has(key.replace("pfm.option.", ""))){
+ PaladinFurnitureMod.GENERAL_LOGGER.warn("Missing Config Option: " + key.replace("pfm.option.", "") + ", resetting to default value.");
+ options.get(key).setValue(options.get(key).getDefaultValue());
+ save();
+ }
+ }
+ }
+
+
+ public static T getFromJsonElement(JsonElement element, T defaultValue) {
+ if (element != null && element.isJsonPrimitive()) {
+ JsonPrimitive primitive = element.getAsJsonPrimitive();
+
+ Type targetType;
+
+ if (primitive.isString()) {
+ targetType = new TypeToken() {}.getType();
+ } else if (primitive.isBoolean()) {
+ targetType = new TypeToken() {}.getType();
+ } else if (primitive.isNumber()) {
+ targetType = new TypeToken() {}.getType();
+ } else {
+ // Handle the case where the primitive type is not supported
+ return null;
+ }
+
+ return GSON.fromJson(primitive, targetType);
+ }
+ return defaultValue;
+ }
+
+ public void loadLegacyProperties(Path legacyConfigFile) throws IOException {
Properties properties = new Properties();
// NB: This uses ISO-8859-1 with unicode escapes as the encoding
- try (InputStream is = Files.newInputStream(propertiesPath)) {
+ try (InputStream is = Files.newInputStream(legacyConfigFile)) {
properties.load(is);
}
+
checkForUpdates.setValue("true".equals(properties.getProperty("checkForUpdates")));
shaderSolidFix.setValue(!"false".equals(properties.getProperty("shaderSolidFix")));
doChairsFacePlayer.setValue("true".equals(properties.getProperty("chairsFacePlayer")));
@@ -155,14 +216,9 @@ public void load() throws IOException {
mobsSitOnChairs.setValue("true".equals(properties.getProperty("mobsSitOnChairs")));
renderImmersivePortalsMirrors.setValue("true".equals(properties.getProperty("renderImmersivePortalsMirrors")));
spawnImmersivePortalsMirror.setValue("true".equals(properties.getProperty("spawnImmersivePortalsMirror")));
-
- for (String key : options.keySet()) {
- if (!properties.containsKey(key.replace("pfm.option.", ""))){
- PaladinFurnitureMod.GENERAL_LOGGER.warn("Missing Config Option: " + key.replace("pfm.option.", "") + ", resetting to default value.");
- options.get(key).setValue(options.get(key).getDefaultValue());
- save();
- }
- }
+ save();
+ Files.delete(legacyConfigFile);
+ PaladinFurnitureMod.GENERAL_LOGGER.info("Successfully migrated to new config");
}
/**
@@ -171,22 +227,21 @@ public void load() throws IOException {
* @throws IOException file exceptions
*/
public void save() throws IOException {
- Properties properties = new Properties();
- properties.setProperty("checkForUpdates", checkForUpdates.getValue() ? "true" : "false");
- properties.setProperty("shaderSolidFix", shaderSolidFix.getValue() ? "true" : "false");
- properties.setProperty("chairsFacePlayer", doChairsFacePlayer.getValue() ? "true" : "false");
- properties.setProperty("countersOfDifferentMaterialsConnect", countersOfDifferentMaterialsConnect.getValue() ? "true" : "false");
- properties.setProperty("foodPopsOffStove", foodPopsOffStove.getValue() ? "true" : "false");
- properties.setProperty("tablesOfDifferentMaterialsConnect",tablesOfDifferentMaterialsConnect.getValue() ? "true" : "false");
- properties.setProperty("enableBook",enableBook.getValue() ? "true" : "false");
- properties.setProperty("differentMirrorsConnect", differentMirrorsConnect.getValue() ? "true" : "false");
- properties.setProperty("mobsSitOnChairs", mobsSitOnChairs.getValue() ? "true" : "false");
- properties.setProperty("renderImmersivePortalsMirrors", renderImmersivePortalsMirrors.getValue() ? "true" : "false");
- properties.setProperty("spawnImmersivePortalsMirror", spawnImmersivePortalsMirror.getValue() ? "true" : "false");
-
- // NB: This uses ISO-8859-1 with unicode escapes as the encoding
- try (OutputStream os = Files.newOutputStream(propertiesPath)) {
- properties.store(os, COMMENT);
+ JsonObject object = new JsonObject();
+ object.addProperty("checkForUpdates", checkForUpdates.getValue());
+ object.addProperty("shaderSolidFix", shaderSolidFix.getValue());
+ object.addProperty("chairsFacePlayer", doChairsFacePlayer.getValue());
+ object.addProperty("countersOfDifferentMaterialsConnect", countersOfDifferentMaterialsConnect.getValue());
+ object.addProperty("foodPopsOffStove", foodPopsOffStove.getValue());
+ object.addProperty("tablesOfDifferentMaterialsConnect", tablesOfDifferentMaterialsConnect.getValue());
+ object.addProperty("enableBook", enableBook.getValue());
+ object.addProperty("differentMirrorsConnect", differentMirrorsConnect.getValue());
+ object.addProperty("mobsSitOnChairs", mobsSitOnChairs.getValue());
+ object.addProperty("renderImmersivePortalsMirrors", renderImmersivePortalsMirrors.getValue());
+ object.addProperty("spawnImmersivePortalsMirror", spawnImmersivePortalsMirror.getValue());
+
+ try (FileWriter writer = new FileWriter(propertiesPath.toString())) {
+ GSON.toJson(object, writer);
}
}
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/PFMTags.java b/common/src/main/java/com/unlikepaladin/pfm/data/PFMTags.java
index 02b1fa22b..9b96daf03 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/data/PFMTags.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/data/PFMTags.java
@@ -7,6 +7,7 @@
public class PFMTags {
public static Tag.Identified TUCKABLE_BLOCKS = createTag(new Identifier("pfm", "tuckable_blocks"));
+ public static Tag.Identified FURNITURE = createTag(new Identifier("pfm", "furniture"));
@ExpectPlatform
public static Tag.Identified createTag(Identifier identifier) {
diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraCounterVariant.java b/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraCounterVariant.java
index e8e49f43a..55950f665 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraCounterVariant.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraCounterVariant.java
@@ -16,23 +16,22 @@
public class ExtraCounterVariant extends VariantBase {
public static ExtraCounterVariant DARK_CONCRETE = new ExtraCounterVariant(Blocks.GRAY_CONCRETE, Blocks.WHITE_CONCRETE, "dark_concrete");
- public static ExtraCounterVariant CONCRETE = new ExtraCounterVariant(Blocks.WHITE_CONCRETE, PaladinFurnitureModBlocksItems.RAW_CONCRETE, "concrete");
+ public static ExtraCounterVariant CONCRETE = new ExtraCounterVariant(Blocks.WHITE_CONCRETE, null, "concrete");
public static ExtraCounterVariant SMOOTH_STONE = new ExtraCounterVariant(Blocks.WHITE_CONCRETE, Blocks.SMOOTH_STONE,"smooth_stone");
public static ExtraCounterVariant DEEPSLATE_TILE = new ExtraCounterVariant(Blocks.QUARTZ_BLOCK, Blocks.DEEPSLATE_TILES,"deepslate_tile");
private final String name;
private final Block baseBlock;
static final List DEFAULT_VARIANTS = new ArrayList<>();
- static {
- DEFAULT_VARIANTS.add(DARK_CONCRETE);
- DEFAULT_VARIANTS.add(CONCRETE);
- DEFAULT_VARIANTS.add(SMOOTH_STONE);
- DEFAULT_VARIANTS.add(DEEPSLATE_TILE);
- }
-
private final Block secondaryBlock;
public static List values() {
+ if (DEFAULT_VARIANTS.isEmpty()) {
+ DEFAULT_VARIANTS.add(DARK_CONCRETE);
+ DEFAULT_VARIANTS.add(CONCRETE);
+ DEFAULT_VARIANTS.add(SMOOTH_STONE);
+ DEFAULT_VARIANTS.add(DEEPSLATE_TILE);
+ }
return DEFAULT_VARIANTS;
}
@@ -58,6 +57,9 @@ public Block getBaseBlock() {
@Override
public Block getSecondaryBlock() {
+ if (secondaryBlock == null)
+ return PaladinFurnitureModBlocksItems.RAW_CONCRETE;
+
return secondaryBlock;
}
@@ -100,7 +102,7 @@ public Block mainChild() {
@Override
public Identifier getTexture(BlockType type) {
if (type == BlockType.SECONDARY)
- return ModelHelper.getTextureId(secondaryBlock);
+ return ModelHelper.getTextureId(getSecondaryBlock());
return ModelHelper.getTextureId(baseBlock);
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraStoolVariant.java b/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraStoolVariant.java
index 4bc8dc9c0..404e02a69 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraStoolVariant.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/data/materials/ExtraStoolVariant.java
@@ -25,14 +25,13 @@ public class ExtraStoolVariant extends VariantBase {
private final Block secondaryBlock;
static final List DEFAULT_VARIANTS = new ArrayList<>();
- static {
- DEFAULT_VARIANTS.add(GRAY_DARK_OAK);
- DEFAULT_VARIANTS.add(WHITE);
- DEFAULT_VARIANTS.add(GRAY);
- DEFAULT_VARIANTS.add(LIGHT_GRAY_DARK_OAK);
- }
-
public static List values() {
+ if (DEFAULT_VARIANTS.isEmpty()) {
+ DEFAULT_VARIANTS.add(GRAY_DARK_OAK);
+ DEFAULT_VARIANTS.add(WHITE);
+ DEFAULT_VARIANTS.add(GRAY);
+ DEFAULT_VARIANTS.add(LIGHT_GRAY_DARK_OAK);
+ }
return DEFAULT_VARIANTS;
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/items/LightSwitchItem.java b/common/src/main/java/com/unlikepaladin/pfm/items/LightSwitchItem.java
index fde1c37b0..4fe648344 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/items/LightSwitchItem.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/items/LightSwitchItem.java
@@ -83,20 +83,27 @@ protected boolean canPlace(ItemPlacementContext context, BlockState state) {
WorldView world = context.getWorld();
Direction side = context.getSide();
NbtList lights = getLights(context.getStack());
+ if (!side.getAxis().isHorizontal()) {
+ return false;
+ }
if (lights != null) {
ArrayList removedLights = new ArrayList<>();
- Direction facing = context.getPlayerFacing();
-
+ ArrayList lightOffsets = new ArrayList<>();
for (Iterator iterator = lights.iterator(); iterator.hasNext();) {
NbtElement nbtElement = iterator.next();
BlockPos lightPos = BlockPos.fromLong(((NbtLong) nbtElement).longValue());
- BlockPos placedPos = pos.offset(facing);
- double distance = Math.sqrt(lightPos.getSquaredDistance(placedPos.getX() + 0.5, placedPos.getY() + 0.5, placedPos.getZ() + 0.5, true));
+ double distance = Math.sqrt(lightPos.getSquaredDistance(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, true));
if (distance > 16) {
removedLights.add(BlockPos.fromLong(((NbtLong) nbtElement).longValue()));
iterator.remove();
+ } else {
+ lightOffsets.add(pos.subtract(lightPos));
}
}
+ context.getStack().setNbt(new NbtCompound());
+ for (BlockPos blockPos : lightOffsets) {
+ addLight(context.getStack(), blockPos);
+ }
if (!removedLights.isEmpty() && context.getWorld().isClient){
context.getPlayer().sendMessage(new TranslatableText("message.pfm.light_switch_far", removedLights.toString()), false);
diff --git a/common/src/main/java/com/unlikepaladin/pfm/items/ShowerHandleItem.java b/common/src/main/java/com/unlikepaladin/pfm/items/ShowerHandleItem.java
index e74dbc5ef..42410a61b 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/items/ShowerHandleItem.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/items/ShowerHandleItem.java
@@ -63,20 +63,22 @@ public ActionResult useOnBlock(ItemUsageContext context) {
protected boolean canPlace(ItemPlacementContext context, BlockState state) {
BlockPos pos = context.getBlockPos();
WorldView world = context.getWorld();
- NbtLong showerHeadPos = getShowerHead(context.getStack());
+ NbtLong showerHeadLong = getShowerHead(context.getStack());
Direction playerFacing = context.getPlayerFacing();
Direction placeDirection = context.getSide();
- if (showerHeadPos != null) {
- BlockPos lightPos = BlockPos.fromLong(showerHeadPos.longValue());
+ if (showerHeadLong != null) {
+ BlockPos headPos = BlockPos.fromLong(showerHeadLong.longValue());
BlockPos placedPos = pos.offset(playerFacing);
- double distance = Math.sqrt(lightPos.getSquaredDistance(placedPos.getX() + 0.5, placedPos.getY() + 0.5, placedPos.getZ() + 0.5, true));
+ double distance = Math.sqrt(headPos.getSquaredDistance(placedPos.getX() + 0.5, placedPos.getY() + 0.5, placedPos.getZ() + 0.5, true));
if (distance > 16 && world.isClient()){
- context.getPlayer().sendMessage(new TranslatableText("message.pfm.shower_handle_far", lightPos.toString()), false);
+ context.getPlayer().sendMessage(new TranslatableText("message.pfm.shower_handle_far", headPos.toString()), false);
}
if (distance > 16) {
context.getStack().setNbt(null);
+ } else {
+ setShowerHeadPosNBT(context.getStack(), pos.subtract(headPos));
}
return state.getBlock().canPlaceAt(state, world, pos) && placeDirection.getAxis().isHorizontal();
}
diff --git a/common/src/main/java/com/unlikepaladin/pfm/runtime/data/PFMTagProvider.java b/common/src/main/java/com/unlikepaladin/pfm/runtime/data/PFMTagProvider.java
index 1af42f7ae..b0b0e5c16 100644
--- a/common/src/main/java/com/unlikepaladin/pfm/runtime/data/PFMTagProvider.java
+++ b/common/src/main/java/com/unlikepaladin/pfm/runtime/data/PFMTagProvider.java
@@ -125,7 +125,8 @@ protected void generateTags() {
.add(PaladinFurnitureModBlocksItems.IRON_CHAIN)
.add(sinkBlocks)
.add(PaladinFurnitureModBlocksItems.BASIC_SHOWER_HANDLE)
- .add(PaladinFurnitureModBlocksItems.BASIC_SHOWER_HEAD);
+ .add(PaladinFurnitureModBlocksItems.BASIC_SHOWER_HEAD)
+ .add(PaladinFurnitureModBlocksItems.BASIC_BATHTUB);
KitchenCounterBlock[] woodCounters = KitchenCounterBlock.streamWoodCounters().map(FurnitureBlock::getBlock).toArray(KitchenCounterBlock[]::new);
KitchenWallCounterBlock[] woodWallCounters = KitchenWallCounterBlock.streamWallWoodCounters().map(FurnitureBlock::getBlock).toArray(KitchenWallCounterBlock[]::new);
@@ -221,6 +222,9 @@ protected void generateTags() {
.add(stoneNaturalTables)
.add(logTables);
+ getOrCreateTagBuilder(PFMTags.FURNITURE)
+ .add(PaladinFurnitureModBlocksItems.BLOCKS.toArray(Block[]::new));
+
PaladinFurnitureMod.pfmModCompatibilities.forEach(PFMModCompatibility::generateTags);
}
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom.json
index f35f77904..bd1cee7cd 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom_open.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom_open.json
index cdc88da33..25750f33b 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom_open.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_bottom_open.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_full.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_full.json
index c862e1d28..e397b25fd 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_full.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_full.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle.json
index b77b35db6..0afab21b3 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle_open.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle_open.json
index 85914ac5b..397d07d9a 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle_open.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_middle_open.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single.json
index 9d92cacb6..f09b67a21 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single_open.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single_open.json
index b104b3937..eb47bbc7c 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single_open.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_single_open.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top.json
index 24b70519c..84b7f54be 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top_open.json b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top_open.json
index 95c83f688..34cc68e1f 100644
--- a/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top_open.json
+++ b/common/src/main/resources/assets/pfm/models/block/iron_fridge/iron_fridge_top_open.json
@@ -3,7 +3,8 @@
"textures": {
"2": "pfm:block/fridge/fridge_back",
"legs": "block/light_gray_concrete",
- "base": "block/iron_block"
+ "base": "block/iron_block",
+ "particle": "block/iron_block"
},
"elements": [
{
diff --git a/common/src/main/resources/pfm.accesswidener b/common/src/main/resources/pfm.accesswidener
index 0c0f749cd..bc6e469e2 100644
--- a/common/src/main/resources/pfm.accesswidener
+++ b/common/src/main/resources/pfm.accesswidener
@@ -6,5 +6,4 @@ accessible method net/minecraft/data/server/BlockLootTableGenerator drops (Lnet/
accessible method net/minecraft/data/server/BlockLootTableGenerator dropsWithProperty (Lnet/minecraft/block/Block;Lnet/minecraft/state/property/Property;Ljava/lang/Comparable;)Lnet/minecraft/loot/LootTable$Builder;
accessible class net/minecraft/data/server/AbstractTagProvider$ObjectBuilder
accessible method net/minecraft/client/render/item/ItemRenderer renderBakedItemModel (Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/item/ItemStack;IILnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;)V
-accessible field net/minecraft/client/resource/language/LanguageManager field_25291 Lnet/minecraft/client/resource/language/LanguageDefinition;
accessible field net/minecraft/block/AbstractBlock$Settings material Lnet/minecraft/block/Material;
diff --git a/fabric/build.gradle b/fabric/build.gradle
index 7307bd3b9..ef0977b7c 100755
--- a/fabric/build.gradle
+++ b/fabric/build.gradle
@@ -85,15 +85,15 @@ else {
modCompileOnly("maven.modrinth:sandwichable:${rootProject.sandwichable_version}"){
exclude(group: "net.fabricmc.fabric-api")
}
- modCompileOnly("dev.lambdaurora:spruceui:${rootProject.spruceui_version}"){
- exclude(group: "net.fabricmc.fabric-api")
- }
}
}
if (rootProject.rei_compatibility == "true"){
dependencies {
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${rootProject.rei_version}"){
+ transitive(false)
+ }
+ modRuntimeOnly("me.shedaniel.cloth:cloth-config-api:${rootProject.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}
@@ -114,21 +114,6 @@ else {
}
}
-if (rootProject.arrp_compatibility == "true") {
- dependencies {
- modImplementation("curse.maven:arrp-463113:${rootProject.arrp_version}"){
- exclude(group: "net.fabricmc.fabric-api")
- }
- }
-}
-else {
- dependencies {
- modCompileOnly("curse.maven:arrp-463113:${rootProject.arrp_version}") {
- exclude(group: "net.fabricmc.fabric-api")
- }
- }
-}
-
if (rootProject.immersive_portals_compatibility_fabric == "true"){
dependencies {
modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version_fabric}"){
@@ -156,14 +141,18 @@ dependencies {
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") {
exclude(group: "net.fabricmc.fabric-api")
- transitive = false
+ transitive(false)
}
// modRuntimeOnly("com.terraformersmc:terrestria:${rootProject.terrestria}")
- modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rootProject.rei_version}"
+ modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${rootProject.rei_version}") {
+ transitive(false)
+ }
modCompileOnly("maven.modrinth:iris:${rootProject.iris_version}")
- modCompileOnly("curse.maven:farmers-delight-fabric-482834:${rootProject.farmers_delight_version_fabric}")
+ modCompileOnly("curse.maven:farmers-delight-fabric-482834:${rootProject.farmers_delight_version_fabric}"){
+ transitive(false)
+ }
//modImplementation "curse.maven:balm-fabric-500525:${rootProject.balm_version_fabric}"
//modImplementation "curse.maven:cooking-for-blockheads-fabric-634546:${rootProject.cookingforblockheads_version_fabric}"
diff --git a/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/PFMImmersivePortalsImpl.java b/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/PFMImmersivePortalsImpl.java
index e9e857e04..00e660b03 100644
--- a/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/PFMImmersivePortalsImpl.java
+++ b/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/PFMImmersivePortalsImpl.java
@@ -16,10 +16,11 @@
public class PFMImmersivePortalsImpl implements PFMModCompatibility {
private PFMClientModCompatibility clientModCompatibility;
- public static final EntityType MIRROR = EntityType.Builder.create(PFMMirrorEntity::new, SpawnGroup.MISC).setDimensions(0.0F, 0.0F).makeFireImmune().disableSummon().build("mirror_entity");
+ public static EntityType MIRROR;
@Override
public void registerEntityTypes() {
+ MIRROR = EntityType.Builder.create(PFMMirrorEntity::new, SpawnGroup.MISC).setDimensions(0.0F, 0.0F).makeFireImmune().disableSummon().build("mirror_entity");
EntityRegistry.registerEntityType("mirror_entity", MIRROR);
}
diff --git a/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/entity/PFMMirrorEntity.java b/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/entity/PFMMirrorEntity.java
index 1c5a7cc5d..22c9cb51d 100644
--- a/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/entity/PFMMirrorEntity.java
+++ b/fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/entity/PFMMirrorEntity.java
@@ -24,7 +24,6 @@
import java.util.stream.Stream;
public class PFMMirrorEntity extends Mirror {
- public static EntityType entityType = PFMImmersivePortalsImpl.MIRROR;
@Nullable
public IntBox wallArea;
@Nullable
@@ -34,7 +33,6 @@ public class PFMMirrorEntity extends Mirror {
public PFMMirrorEntity(EntityType entityType, World world) {
super(entityType, world);
- PFMMirrorEntity.entityType = entityType;
}
@Override
@@ -151,7 +149,7 @@ public static void createMirror(ServerWorld world, BlockPos glassPos, Direction
return;
}
- PFMMirrorEntity pfmMirrorEntity = PFMMirrorEntity.entityType.create(world);
+ PFMMirrorEntity pfmMirrorEntity = PFMImmersivePortalsImpl.MIRROR.create(world);
double distanceToCenter = -0.452;
Box wallBox = getWallBox(world, shape.area.stream());
diff --git a/fabric/src/main/java/com/unlikepaladin/pfm/fabric/PaladinFurnitureModFabric.java b/fabric/src/main/java/com/unlikepaladin/pfm/fabric/PaladinFurnitureModFabric.java
index d1ee6b213..82cf67ac7 100644
--- a/fabric/src/main/java/com/unlikepaladin/pfm/fabric/PaladinFurnitureModFabric.java
+++ b/fabric/src/main/java/com/unlikepaladin/pfm/fabric/PaladinFurnitureModFabric.java
@@ -41,7 +41,7 @@ public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
- pfmConfig = new PaladinFurnitureModConfig(FabricLoader.getInstance().getConfigDir().resolve("pfm.properties"));
+ pfmConfig = new PaladinFurnitureModConfig(FabricLoader.getInstance().getConfigDir());
try {
pfmConfig.initialize();
} catch (IOException e) {
diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json
index 9d1dc8dd7..25a02524c 100755
--- a/fabric/src/main/resources/fabric.mod.json
+++ b/fabric/src/main/resources/fabric.mod.json
@@ -48,11 +48,13 @@
"suggests": {
"patchouli": "*"
},
- "modmenu": {
- "links": {
- "modmenu.discord": "https://discord.gg/zbMDUPB",
- "modmenu.kofi": "https://ko-fi.com/unlikepaladin",
- "modmenu.modrinth": "https://modrinth.com/mod/paladins-furniture/"
+ "custom": {
+ "modmenu": {
+ "links": {
+ "modmenu.discord": "https://discord.gg/zbMDUPB",
+ "modmenu.kofi": "https://ko-fi.com/unlikepaladin",
+ "modmenu.modrinth": "https://modrinth.com/mod/paladins-furniture/"
+ }
}
}
}
\ No newline at end of file
diff --git a/forge/build.gradle b/forge/build.gradle
index 9b3495457..6234679fa 100755
--- a/forge/build.gradle
+++ b/forge/build.gradle
@@ -67,7 +67,9 @@ dependencies {
modImplementation("vazkii.patchouli:Patchouli:${rootProject.patchouli_version_forge}")
modCompileOnly(("mezz.jei:jei-${rootProject.minecraft_version}:${rootProject.jei_version}:api"))
- modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-forge:${rootProject.rei_version}"
+ modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-forge:${rootProject.rei_version}") {
+ transitive(false)
+ }
//modRuntimeOnly("curse.maven:biomesop-220318:3562256")
modCompileOnly ("maven.modrinth:oculus:${rootProject.oculus_version}")
@@ -97,6 +99,9 @@ if (rootProject.lazy_dfu_enabled == "true"){
if (rootProject.rei_compatibility == "true"){
dependencies {
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-forge:${rootProject.rei_version}")
+ modRuntimeOnly("me.shedaniel.cloth:cloth-config-forge:${rootProject.cloth_config_version}") {
+ transitive(false)
+ }
}
}
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/FreezerBlockEntityImpl.java b/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/FreezerBlockEntityImpl.java
index 9f84fb0b6..830976aa4 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/FreezerBlockEntityImpl.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/FreezerBlockEntityImpl.java
@@ -3,10 +3,52 @@
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.blocks.blockentities.FreezerBlockEntity;
import com.unlikepaladin.pfm.compat.cookingforblockheads.forge.FreezerBlockEntityBalm;
+import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Direction;
+import net.minecraftforge.common.capabilities.Capability;
+import net.minecraftforge.common.capabilities.CapabilityManager;
+import net.minecraftforge.common.util.LazyOptional;
+import net.minecraftforge.items.CapabilityItemHandler;
+import net.minecraftforge.items.IItemHandler;
+import net.minecraftforge.items.IItemHandlerModifiable;
+import net.minecraftforge.items.wrapper.SidedInvWrapper;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class FreezerBlockEntityImpl extends FreezerBlockEntity {
+
+ private final LazyOptional[] handlers;
+
+ public FreezerBlockEntityImpl(BlockPos pos, BlockState state) {
+ super(pos, state);
+ this.handlers = SidedInvWrapper.create(this, Direction.UP, Direction.DOWN, Direction.NORTH);
+ }
-public class FreezerBlockEntityImpl {
public static BlockEntityType.BlockEntityFactory extends FreezerBlockEntity> getFactory() {
- return PaladinFurnitureMod.getModList().contains("cookingforblockheads") ? FreezerBlockEntityBalm::new : FreezerBlockEntity::new;
+ return PaladinFurnitureMod.getModList().contains("cookingforblockheads") ? FreezerBlockEntityBalm::new : FreezerBlockEntityImpl::new;
+ }
+
+ @Override
+ public @NotNull LazyOptional getCapability(Capability cap, @Nullable Direction side) {
+ if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
+ if (side == Direction.UP)
+ return handlers[0].cast();
+ else if (side == Direction.DOWN) {
+ return handlers[1].cast();
+ } else {
+ return handlers[2].cast();
+ }
+ }
+ return LazyOptional.empty();
+ }
+
+ @Override
+ public void invalidateCaps() {
+ super.invalidateCaps();
+ for (LazyOptional handler : this.handlers) {
+ handler.invalidate();
+ }
}
}
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/MicrowaveBlockEntityImpl.java b/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/MicrowaveBlockEntityImpl.java
index 1c4445fc7..2167b9e1a 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/MicrowaveBlockEntityImpl.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/blocks/blockentities/forge/MicrowaveBlockEntityImpl.java
@@ -23,7 +23,7 @@
import java.util.Objects;
-public class MicrowaveBlockEntityImpl extends MicrowaveBlockEntity {
+public class MicrowaveBlockEntityImpl extends MicrowaveBlockEntity {
public MicrowaveBlockEntityImpl(BlockPos pos, BlockState state) {
super(pos, state);
}
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java b/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java
index 43cd1a489..196b58cb6 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java
@@ -1,5 +1,6 @@
package com.unlikepaladin.pfm.blocks.models.forge;
+import com.google.common.collect.Iterables;
import com.mojang.datafixers.util.Pair;
import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.blocks.models.AbstractBakedModel;
@@ -50,8 +51,13 @@ public List getQuadsWithTexture(List quads, List t
if (quads == null)
return Collections.emptyList();
- if (replacements == null || toReplace == null || toReplace.size() != replacements.size()) {
- PaladinFurnitureMod.GENERAL_LOGGER.warn("Replacement list is not the same size or was null, skipping transformation");
+ if (replacements == null || toReplace == null) {
+ PaladinFurnitureMod.GENERAL_LOGGER.warn("Replacement list was null, skipping transformation");
+ return quads;
+ } else if (toReplace.size() != replacements.size()) {
+ PaladinFurnitureMod.GENERAL_LOGGER.warn("Replacement list was not the same size, skipping transformation, expected {} sprites, got {}", toReplace.size(), replacements.size());
+ PaladinFurnitureMod.GENERAL_LOGGER.debug(toReplace);
+ PaladinFurnitureMod.GENERAL_LOGGER.debug(replacements);
return quads;
}
if (toReplace.equals(replacements))
@@ -81,7 +87,7 @@ public List getQuadsWithTexture(List quads, List t
.orElse(-1);
if (index != -1) {
- Sprite replacement = replacements.get(index);
+ Sprite replacement = Iterables.get(replacements, index, toReplace.get(index));
transformedQuads.addAll(getQuadsWithTexture(entry.getValue().stream().filter(quads::contains).toList(), replacement));
} else {
transformedQuads.addAll(entry.getValue().stream().filter(quads::contains).toList());
@@ -97,13 +103,14 @@ public List getQuadsWithTexture(List quads, Sprite sprite)
// UV Element index
int uvVertexIndx = findVertexElement(VertexFormatElement.Type.UV, 0);
+ // I basically have to disable caching if Optifine is present, otherwise it breaks uvs
quads.forEach(quad -> {
Pair quadKey = new Pair<>(sprite.getId(), quad);
- if (quad.getSprite().getId() == sprite.getId() && !quadToTransformedQuad.containsKey(quadKey)) {
+ if (quad.getSprite().getId() == sprite.getId() && !quadToTransformedQuad.containsKey(quadKey) && !PaladinFurnitureMod.isOptifineLoaded()) {
quadToTransformedQuad.put(quadKey, quad);
transformedQuads.add(quad);
}
- else if (quadToTransformedQuad.containsKey(quadKey)) {
+ else if (quadToTransformedQuad.containsKey(quadKey) && !PaladinFurnitureMod.isOptifineLoaded()) {
transformedQuads.add(quadToTransformedQuad.get(quadKey));
}
else {
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/client/forge/PaladinFurnitureModClientImpl.java b/forge/src/main/java/com/unlikepaladin/pfm/client/forge/PaladinFurnitureModClientImpl.java
index 2253ed1f5..d90e50d64 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/client/forge/PaladinFurnitureModClientImpl.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/client/forge/PaladinFurnitureModClientImpl.java
@@ -7,7 +7,7 @@
public class PaladinFurnitureModClientImpl {
public static boolean areShadersOn() {
- if (PaladinFurnitureMod.getModList().contains("oculus"))
+ if (PaladinFurnitureMod.getModList().contains("oculus") || PaladinFurnitureMod.getModList().contains("iris"))
return IrisApi.getInstance().isShaderPackInUse();
try
{
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/FreezerBlockEntityBalm.java b/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/FreezerBlockEntityBalm.java
index b8cad23a5..977312327 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/FreezerBlockEntityBalm.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/FreezerBlockEntityBalm.java
@@ -5,6 +5,7 @@
import com.google.common.collect.Table;
import com.mojang.datafixers.util.Pair;
import com.unlikepaladin.pfm.blocks.blockentities.FreezerBlockEntity;
+import com.unlikepaladin.pfm.blocks.blockentities.forge.FreezerBlockEntityImpl;
import net.blay09.mods.balm.api.Balm;
import net.blay09.mods.balm.api.block.BalmBlockEntityContract;
import net.blay09.mods.balm.api.container.BalmContainerProvider;
@@ -40,7 +41,7 @@
import java.util.*;
-public class FreezerBlockEntityBalm extends FreezerBlockEntity implements BalmContainerProvider, BalmProviderHolder, BalmBlockEntityContract {
+public class FreezerBlockEntityBalm extends FreezerBlockEntityImpl implements BalmContainerProvider, BalmProviderHolder, BalmBlockEntityContract {
private final DefaultKitchenItemProvider itemProvider;
public FreezerBlockEntityBalm(BlockPos pos, BlockState state) {
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/PFMCookingForBlockheadsImpl.java b/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/PFMCookingForBlockheadsImpl.java
index 1b168b1ed..73379fc9a 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/PFMCookingForBlockheadsImpl.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/compat/cookingforblockheads/forge/PFMCookingForBlockheadsImpl.java
@@ -7,10 +7,12 @@
import com.unlikepaladin.pfm.registry.dynamic.LateBlockRegistry;
import com.unlikepaladin.pfm.runtime.data.FurnitureRecipeJsonFactory;
import com.unlikepaladin.pfm.runtime.data.PFMRecipeProvider;
+import com.unlikepaladin.pfm.runtime.data.PFMTagProvider;
import net.blay09.mods.cookingforblockheads.CookingForBlockheads;
import net.blay09.mods.cookingforblockheads.item.ModItems;
import net.minecraft.block.Blocks;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
+import net.minecraft.tag.BlockTags;
import net.minecraft.util.Identifier;
import java.util.Optional;
@@ -22,6 +24,14 @@ public class PFMCookingForBlockheadsImpl extends PFMCookingForBlockheads {
public PFMCookingForBlockheadsImpl() {
}
+ @Override
+ public void generateTags() {
+ super.generateTags();
+
+ PFMTagProvider.getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE)
+ .add(PFMCookingForBlockHeadsCompat.COOKING_TABLE_BLOCK);
+ }
+
@Override
public void generateRecipes(Consumer exporter) {
FurnitureRecipeJsonFactory.create(PFMCookingForBlockHeadsCompat.COOKING_TABLE_BLOCK, 4).group("kitchen").criterion(PFMRecipeProvider.getCriterionNameFromOutput(PFMCookingForBlockHeadsCompat.COOKING_TABLE_BLOCK), PFMRecipeProvider.conditionsFromItem(ModItems.recipeBook)).input(ModItems.recipeBook).input(Blocks.WHITE_CONCRETE, 2).input(Blocks.GRAY_CONCRETE).offerTo(exporter, new Identifier("pfm", PFMCookingForBlockHeadsCompat.COOKING_TABLE_BLOCK.asItem().getTranslationKey().replace("block.pfm.", "")));
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/PFMImmersivePortalsImpl.java b/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/PFMImmersivePortalsImpl.java
index e682d3433..857cf5011 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/PFMImmersivePortalsImpl.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/PFMImmersivePortalsImpl.java
@@ -16,10 +16,11 @@
public class PFMImmersivePortalsImpl implements PFMModCompatibility {
private PFMClientModCompatibility clientModCompatibility;
- public static final EntityType MIRROR = EntityType.Builder.create(PFMMirrorEntity::new, SpawnGroup.MISC).setDimensions(0.0F, 0.0F).makeFireImmune().disableSummon().build("mirror_entity");
+ public static EntityType MIRROR;
@Override
public void registerEntityTypes() {
+ MIRROR = EntityType.Builder.create(PFMMirrorEntity::new, SpawnGroup.MISC).setDimensions(0.0F, 0.0F).makeFireImmune().disableSummon().build("mirror_entity");
EntityRegistry.registerEntityType("mirror_entity", MIRROR);
}
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/entity/PFMMirrorEntity.java b/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/entity/PFMMirrorEntity.java
index 5bfadffa6..3879677a1 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/entity/PFMMirrorEntity.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/entity/PFMMirrorEntity.java
@@ -24,7 +24,6 @@
import java.util.stream.Stream;
public class PFMMirrorEntity extends Mirror {
- public static EntityType entityType = PFMImmersivePortalsImpl.MIRROR;
@Nullable
public IntBox wallArea;
@Nullable
@@ -34,7 +33,6 @@ public class PFMMirrorEntity extends Mirror {
public PFMMirrorEntity(EntityType entityType, World world) {
super(entityType, world);
- PFMMirrorEntity.entityType = entityType;
}
@Override
@@ -151,7 +149,7 @@ public static void createMirror(ServerWorld world, BlockPos glassPos, Direction
return;
}
- PFMMirrorEntity pfmMirrorEntity = PFMMirrorEntity.entityType.create(world);
+ PFMMirrorEntity pfmMirrorEntity = PFMImmersivePortalsImpl.MIRROR.create(world);
double distanceToCenter = -0.452;
Box wallBox = getWallBox(world, shape.area.stream());
diff --git a/forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java b/forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java
index 6995944cb..41e1ab4a4 100644
--- a/forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java
+++ b/forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java
@@ -33,7 +33,7 @@
public class PaladinFurnitureModForge extends PaladinFurnitureMod {
public static PaladinFurnitureModConfig pfmConfig;
public PaladinFurnitureModForge() {
- pfmConfig = new PaladinFurnitureModConfig(FMLPaths.CONFIGDIR.get().resolve("pfm.properties"));
+ pfmConfig = new PaladinFurnitureModConfig(FMLPaths.CONFIGDIR.get());
try {
pfmConfig.initialize();
} catch (IOException e) {
diff --git a/gradle.properties b/gradle.properties
index 68fc53527..8b407d76d 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,7 +4,7 @@ minecraft_version=1.18.1
enabled_platforms=fabric,forge
archives_base_name=paladin-furniture-mod
-mod_version=1.2.1-rc2
+mod_version=1.2.1-rc.3
maven_group=com.unlikepaladin
architectury_version=3.9.66
@@ -20,13 +20,9 @@ rei_version=7.4.456
patchouli_version_fabric=1.18.1-66-FABRIC-SNAPSHOT
sandwichable_version=1.2+1.18
spruceui_version=3.3.2+1.17
-sandwichable_compatibility=true
-rei_compatibility=true
+sandwichable_compatibility=false
+rei_compatibility=false
patchouli_compatibility=true
-arrp_version=3529149
-arrp_compatibility=true
-cloth_config_compatibility=false
-cloth_config_version=6.2.62
modmenu_version=3.0.1
jei_version=9.4.1.172
patchouli_version_forge=1.18.1-66-SNAPSHOT
@@ -46,4 +42,5 @@ balm_version_fabric=4442618
balm_version_forge=4442615
cookingforblockheads_version_forge=3606191
farmers_delight_version_fabric=3559302
-farmers_delight_version_forge=3739915
\ No newline at end of file
+farmers_delight_version_forge=3739915
+cloth_config_version=6.2.62
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 59bc51a20..db9a6b825 100755
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists