Skip to content

Commit

Permalink
Merge branch 'architectury-1.17.1' into architectury-1.16.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureMod.java
#	common/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/PFMImmersivePortals.java
#	common/src/main/java/com/unlikepaladin/pfm/runtime/PFMDataGen.java
#	fabric/build.gradle
#	fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/client/PFMImmersivePortalsClient.java
#	fabric/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/fabric/entity/PFMMirrorEntity.java
#	forge/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/forge/PFMMirrorBlockIP.java
#	forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
2 parents b97020b + daf3b5b commit bfc38ad
Show file tree
Hide file tree
Showing 35 changed files with 1,193 additions and 107 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
![Paladin's Furniture Mod Banner](https://github.com/UnlikePaladin/paladin-furniture-mod/blob/main/docs/banner.png?raw=true)
![Paladin's Furniture Mod Banner](./docs/banner.png?raw=true)

<p align="center">
<img alt="fabric" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/fabric_vector.svg">
<img alt="forge" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/forge_vector.svg">
<img alt="quilt" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/quilt_vector.svg">
</p>


## Description
A Brand-New Furniture mod for Modern Minecraft where things are functional! It contains over 1,000 New Pieces of Furniture that you can use to furnish your build, while being functional and nice to look at. Everything is craftable and obtainable in Survival so it's friendly, and nice to look at, it has Compatibility with Sandwichable, REI, EMI and Patchouli. The mod has been in development for roughly 1 year but I don't plan on stopping with new updates, adding new furniture and mod compat with other mods!
A Brand-New Furniture mod for Modern Minecraft where things are functional! It contains over 1,000 New Pieces of Furniture that you can use to furnish your build, while being functional and nice to look at. Everything is craftable and obtainable in Survival so it's friendly, and nice to look at, it has compatibility with Sandwichable, REI, JEI, EMI, Patchouli, CookingForBlockHeads, Farmer's Delight and features modded wood type support. The mod has been in development for roughly 2 years but I don't plan on stopping with new updates, adding new furniture and mod compat with other mods!

![A Kitchen](https://cdn.discordapp.com/attachments/930656475741814804/1010808630683115611/2022-08-18_23.34.12.png)

## Installation

You will need Fabric Loader 0.14.6 or newer installed in your game in order to load this mod. If you haven't installed Fabric mods before, you can find a variety of community guides for doing so [here](https://fabricmc.net/wiki/install).
You will need Fabric Loader, Quilt Loader, NeoForge or MinecraftForge installed in your game in order to load this mod. If you haven't installed mods before, you can find a variety of community guides for doing so [here for Fabric](https://fabricmc.net/wiki/install) and [here for Forge](https://www.wikihow.com/Install-Minecraft-Forge).

You will also need Fabric API installed if you're playing on Fabric to use the mod, you can get it [here](https://modrinth.com/mod/fabric-api). If you're playing with Sodium installed you will need [Indium](https://modrinth.com/mod/indium).

The mod is available for versions 1.16.5 through 1.20.2 find the links further below.

I have a [Discord](https://discord.gg/zbMDUPB) server that you can join if you need help or support with the mod, or if you would like to give me any feedback, I also provide compiled builds for testing new features before they make their way into public releases in it, so join if you'd like to keep up with the latest developments.

You will also need Fabric API and Cloth Config installed to use the mod, you can get that [here](https://modrinth.com/mod/fabric-api) and [here](https://modrinth.com/mod/cloth-config).
## Links
[discord]: https://discord.com/api/guilds/695034549045952592/widget.png
[modrinth]: https://img.shields.io/badge/Modrinth-1bd96a?logo=modrinth&logoColor=ffffff
[curseforge]: https://img.shields.io/badge/CurseForge-f16436?logo=curseforge&logoColor=ffffff
[github]: https://img.shields.io/badge/GitHub-181717?logo=github
[kofi]: https://img.shields.io/badge/Ko--fi-00b9fe?logo=kofi&logoColor=ffffff
[mcforum]: https://img.shields.io/badge/Minecraft-Forum-white?style=flat&log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VgAD4CZgb0Lbt7gimACTlLAQeHy5gdwpqWZY1HUN%2BC5hXZToM6Sud4t9BTw2IwLgH%2FRcAo68BRjTetu1yDY%2FAWts0zrm0oRydpuvqZQiBRQCtIQzaA28rSLlb8MYYi02TVmmbKmFKILJ78H4E1vrcWKO1tV%2BCCADhc%2Bt6AYy%2FBMpMIo8VHR%2BgCo8w93VOAAL5XAZYMgK8RoehYtn4MUkA1WIkb6ajLTUAAAAASUVORK5CYII%3D&labelColor=6fa1ce&color=6fa1ce
### Social: [ ![discord] ](https://discord.gg/zbMDUPB)
### Download: [ ![modrinth] ](https://modrinth.com/mod/paladins-furniture) [ ![curseforge] ](https://www.curseforge.com/minecraft/mc-mods/paladins-furniture) [![pmc]](https://www.planetminecraft.com/mod/paladin-s-furniture-mod/) [ ![mcforum] ](https://www.curseforge.com/minecraft/mc-mods/paladins-furniture)
### Donate: [ ![kofi] ](https://ko-fi.com/unlikepaladin)

The mod is avaialbe for versions 1.16.5 through 1.19.2 and can be downloaded off of [CurseForge](https://www.curseforge.com/minecraft/mc-mods/paladins-furniture), [Modrinth](https://modrinth.com/mod/paladins-furniture), [PlanetMC](https://www.planetminecraft.com/mod/paladin-s-furniture-mod/) and the [Minecraft Forum](https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/3159314-paladins-furniture-mod).

I've made a [Discord](https://discord.gg/zbMDUPB), you can join to ask for help or support, or to give any feedback, I'll also be providing compiled builds for testing new features before they make their way into public releases.

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void commonInit() {
if (getModList().contains("farmersdelight"))
pfmModCompatibilities.add(PFMFarmersDelight.getInstance());
if (getModList().contains("imm_ptl_core") || getModList().contains("immersive_portals"))
pfmModCompatibilities.add(new PFMImmersivePortals());
pfmModCompatibilities.add(PFMImmersivePortals.getInstance());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ public static Identifier getLogId(Block block, String postFix) {
if (idExists(id, ResourceType.CLIENT_RESOURCES, IdLocation.TEXTURES)) {
return id;
}
id = new Identifier(namespace, "block/alpha_oak_log");
if (idExists(id, ResourceType.CLIENT_RESOURCES, IdLocation.TEXTURES)) {
return id;
}
}
return new Identifier(namespace, "block/" + path);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.unlikepaladin.pfm.client;

import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourceType;
import net.minecraft.resource.metadata.PackResourceMetadata;
import net.minecraft.resource.metadata.ResourceMetadataReader;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Set;
import java.util.function.Predicate;
import java.util.function.Supplier;

public class PathPackRPWrapper implements ResourcePack {
private final Supplier<ResourcePack> delegate;
private final PackResourceMetadata packResourceMetadata;

public PathPackRPWrapper(Supplier<ResourcePack> delegate, PackResourceMetadata packResourceMetadata) {
this.delegate = delegate;
this.packResourceMetadata = packResourceMetadata;
}

@Nullable
@Override
public InputStream openRoot(String fileName) throws IOException {
return null;
}

@Override
public InputStream open(ResourceType type, Identifier id) throws IOException {
return delegate.get().open(type, id);
}

@Override
public Collection<Identifier> findResources(ResourceType type, String namespace, String prefix, int maxDepth, Predicate<String> pathFilter) {
return delegate.get().findResources(type, namespace, prefix, maxDepth, pathFilter);
}

@Override
public boolean contains(ResourceType type, Identifier id) {
return delegate.get().contains(type, id);
}

@Override
public Set<String> getNamespaces(ResourceType type) {
return delegate.get().getNamespaces(type);
}

@Nullable
@Override
public <T> T parseMetadata(ResourceMetadataReader<T> metaReader) throws IOException {
if (metaReader.getKey().equals("pack")) {
return (T) packResourceMetadata;
}
return null;
}

@Override
public String getName() {
return "PFM-Runtime-RP";
}

@Override
public void close() {
delegate.get().close();
}
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,11 @@
package com.unlikepaladin.pfm.compat.imm_ptl;

import com.unlikepaladin.pfm.compat.PFMClientModCompatibility;
import com.unlikepaladin.pfm.compat.PFMModCompatibility;
import com.unlikepaladin.pfm.compat.imm_ptl.client.PFMImmersivePortalsClient;
//import com.unlikepaladin.pfm.compat.imm_ptl.entity.PFMMirrorEntity;
import com.unlikepaladin.pfm.compat.imm_ptl.entity.PFMMirrorEntity;
import com.unlikepaladin.pfm.registry.EntityRegistry;
import com.unlikepaladin.pfm.registry.PaladinFurnitureModBlocksItems;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.MapColor;
import net.minecraft.block.Material;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import dev.architectury.injectables.annotations.ExpectPlatform;

import java.util.Optional;

public class PFMImmersivePortals implements PFMModCompatibility {
private PFMClientModCompatibility clientModCompatibility;
public PFMImmersivePortals(){
}
public static final EntityType<PFMMirrorEntity> MIRROR = EntityType.Builder.create(PFMMirrorEntity::new, SpawnGroup.MISC).setDimensions(0.0F, 0.0F).makeFireImmune().disableSummon().build("mirror_entity");

@Override
public void registerEntityTypes() {
EntityRegistry.registerEntityType("mirror_entity", MIRROR);
}

@Override
public void createBlocks() {
PaladinFurnitureModBlocksItems.WHITE_MIRROR = new PFMMirrorBlockIP(AbstractBlock.Settings.of(Material.STONE, MapColor.WHITE).nonOpaque());
PaladinFurnitureModBlocksItems.GRAY_MIRROR = new PFMMirrorBlockIP(AbstractBlock.Settings.of(Material.STONE, MapColor.GRAY).nonOpaque());
}

@Override
public String getModId() {
return "immersive_portals";
}

@Override
public Optional<PFMClientModCompatibility> getClientModCompatiblity() {
if (clientModCompatibility == null)
clientModCompatibility = new PFMImmersivePortalsClient(this);
return Optional.of(clientModCompatibility);
public class PFMImmersivePortals {
@ExpectPlatform
public static PFMModCompatibility getInstance() {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public PaladinFurnitureModConfig(Path propertiesPath) {
tablesOfDifferentMaterialsConnect = new BooleanConfigOption(new TranslatableText("pfm.option.tablesOfDifferentMaterialsConnect"), new TranslatableText("pfm.option.tablesOfDifferentMaterialsConnect.tooltip"), GAMEPLAY_OPTIONS, false, Side.SERVER),
differentMirrorsConnect = new BooleanConfigOption(new TranslatableText("pfm.option.differentMirrorsConnect"), new TranslatableText("pfm.option.differentMirrorsConnect.tooltip"), GAMEPLAY_OPTIONS, false, Side.SERVER),
enableBook = new BooleanConfigOption(new TranslatableText("pfm.option.enableBook"), new TranslatableText("pfm.option.enableBook.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
mobsSitOnChairs = new BooleanConfigOption(new TranslatableText("pfm.option.mobsSitOnChairs"), new TranslatableText("pfm.option.mobsSitOnChairs.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER)
mobsSitOnChairs = new BooleanConfigOption(new TranslatableText("pfm.option.mobsSitOnChairs"), new TranslatableText("pfm.option.mobsSitOnChairs.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
renderImmersivePortalsMirrors = new BooleanConfigOption(new TranslatableText("pfm.option.renderImmersivePortalsMirrors"), new TranslatableText("pfm.option.renderImmersivePortalsMirrors.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
spawnImmersivePortalsMirror = new BooleanConfigOption(new TranslatableText("pfm.option.spawnImmersivePortalsMirror"), new TranslatableText("pfm.option.spawnImmersivePortalsMirror.tooltip"), GAMEPLAY_OPTIONS, true, Side.CLIENT)
);
this.propertiesPath = propertiesPath;
}
Expand Down Expand Up @@ -96,6 +98,12 @@ public boolean doMobsSitOnChairs() {
public boolean isShaderSolidFixOn() {
return shaderSolidFix.getValue();
}
public boolean doImmersivePortalsMirrorsRender() {
return renderImmersivePortalsMirrors.getValue();
}
public boolean doImmersivePortalsMirrorsSpawn() {
return spawnImmersivePortalsMirror.getValue();
}

private BooleanConfigOption checkForUpdates;

Expand All @@ -113,6 +121,8 @@ public boolean isShaderSolidFixOn() {

private BooleanConfigOption enableBook;
private BooleanConfigOption mobsSitOnChairs;
private BooleanConfigOption renderImmersivePortalsMirrors;
private BooleanConfigOption spawnImmersivePortalsMirror;


public Path getPath() {
Expand Down Expand Up @@ -143,6 +153,8 @@ public void load() throws IOException {
enableBook.setValue("true".equals(properties.getProperty("enableBook")));
differentMirrorsConnect.setValue(!"false".equals(properties.getProperty("differentMirrorsConnect")));
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.", ""))){
Expand All @@ -169,6 +181,8 @@ public void save() throws IOException {
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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ public static void compatInit() {
embur.addChild("wood", "embur_pedu_top");
embur.addChild("stripped_wood", "stripped_embur_pedu_top");
addBlockTypeFinder(WoodVariant.class, embur);

WoodVariant.Finder emburOld = WoodVariant.Finder.simple(
"byg", "embur", "embur_planks", "embur_pedu");
emburOld.addChild("stripped_log", "stripped_embur_pedu");
emburOld.addChild("wood", "embur_pedu_hyphae");
emburOld.addChild("stripped_wood", "stripped_embur_pedu_hyphae");
emburOld.addChild("fence", "embur_fence");
emburOld.addChild("slab", "embur_slab");
addBlockTypeFinder(WoodVariant.class, emburOld);

//mcreator mod with typos...
addBlockTypeFinder(WoodVariant.class, WoodVariant.Finder.simple(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Optional<WoodVariant> getVariantFromBlock(Block baseBlock, Identifier blo
}
String namespace = blockId.getNamespace();
if (name != null && !namespace.equals("securitycraft") &&
!namespace.equals("absentbydesign") && !(namespace.equals("terrestria") && path.contains("sakura")) && !(namespace.equals("betternether") && path.contains("nether_mushroom")) && !namespace.equals("chipped")) {
!namespace.equals("absentbydesign") && !(namespace.equals("terrestria") && path.contains("sakura")) && !(namespace.equals("betternether") && path.contains("nether_mushroom")) && !namespace.equals("chipped") && !(namespace.equals("regions_unexplored") && path.contains("alpha"))) {

BlockState state = baseBlock.getDefaultState();
//can't check if the block is a full one, so I do this. Adding some checks here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public static void registerBlocks() throws InvocationTargetException, Instantiat
PaladinFurnitureModBlocksItems.LIGHT_SWITCH_ITEM = new LightSwitchItem(PaladinFurnitureModBlocksItems.LIGHT_SWITCH, new Item.Settings().group(PaladinFurnitureMod.FURNITURE_GROUP));
PaladinFurnitureModBlocksItems.furnitureEntryMap.put(LightSwitchBlock.class, new FurnitureEntry<LightSwitchBlock>() {{
this.addBlock( LateBlockRegistry.registerLateBlock( "light_switch",() -> PaladinFurnitureModBlocksItems.LIGHT_SWITCH, false, PaladinFurnitureMod.FURNITURE_GROUP));
PaladinFurnitureModBlocksItems.BLOCKS.add(PaladinFurnitureModBlocksItems.LIGHT_SWITCH);
LateBlockRegistry.registerLateItem("light_switch",() -> PaladinFurnitureModBlocksItems.LIGHT_SWITCH_ITEM);
}});
PaladinFurnitureModBlocksItems.furnitureEntryMap.put(BasicToiletBlock.class, new FurnitureEntry<BasicToiletBlock>() {{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import com.unlikepaladin.pfm.runtime.data.PFMTagProvider;
import com.unlikepaladin.pfm.utilities.PFMFileUtil;
import net.minecraft.data.DataCache;
import net.minecraft.data.DataProvider;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourceType;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand All @@ -31,12 +35,22 @@ public class PFMDataGen {
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
private final Path output;
private final boolean logOrDebug;
public static boolean running = false;
public PFMDataGen(Path output, boolean logOrDebug) {
this.output = output;
this.logOrDebug = logOrDebug;
}
public void run() throws IOException {
if (!frozen) {
log("Packs:");
for (ResourcePack pack : PFMRuntimeResources.RESOURCE_PACK_LIST) {
log("\tPack {}", pack.getName());
for (String namespace : pack.getNamespaces(ResourceType.CLIENT_RESOURCES)) {
log("\t\tNamespace {}", namespace);
}
}
running = true;
frozen = true;
Path modListPath = PFMRuntimeResources.getPFMDirectory().resolve("modsList");
Path hashPath = PFMRuntimeResources.getPFMDirectory().resolve("dataHash");
if (!modListPath.toFile().isFile()) {
Expand Down Expand Up @@ -113,11 +127,11 @@ public void run() throws IOException {
Files.deleteIfExists(modListPath);
Files.createFile(modListPath);
Files.write(PFMRuntimeResources.createDirIfNeeded(modListPath), PaladinFurnitureMod.getVersionMap().toString().replace("[", "").replace("]", "").getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND);
running = false;
} else {
log("Data Hash and Mod list matched, skipping generation");
}
}
frozen = true;
}

public void log(String s, Object p0) {
Expand Down
Binary file modified common/src/main/resources/assets/pfm/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bfc38ad

Please sign in to comment.