Skip to content

Commit

Permalink
Merge branch 'architectury-1.18.2' into architectury-1.19.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/java/com/unlikepaladin/pfm/config/PaladinFurnitureModConfig.java
#	common/src/main/java/com/unlikepaladin/pfm/mixin/PFMSaveLoaderMixin.java
#	common/src/main/java/com/unlikepaladin/pfm/runtime/PFMDataGen.java
#	forge/src/main/java/com/unlikepaladin/pfm/forge/PaladinFurnitureModForge.java
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
2 parents e805b67 + 5df12b7 commit ef301c2
Show file tree
Hide file tree
Showing 25 changed files with 262 additions and 57 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&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAAXNSR0IArs4c6QAAAUBJREFUOE9jZGBgYGRAA%2FFdKq4gIS5toe0g%2BtvVd54gemHZnd3oakGa4Qaga0RXjM0gsAGENOIzCGxA5lazP%2BiKiOFP9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VHR%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
@@ -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, Predicate<Identifier> allowedPathPredicate) {
return delegate.get().findResources(type, namespace, prefix, allowedPathPredicate);
}

@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,5 +1,6 @@
package com.unlikepaladin.pfm.compat.imm_ptl;

import com.unlikepaladin.pfm.PaladinFurnitureMod;
import com.unlikepaladin.pfm.blocks.MirrorBlock;
import com.unlikepaladin.pfm.compat.imm_ptl.entity.PFMMirrorEntity;
import net.minecraft.block.BlockState;
Expand All @@ -26,26 +27,30 @@ protected PFMMirrorBlockIP(Settings settings) {
@Override
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
super.onPlaced(world, pos, state, placer, itemStack);
if (!world.isClient && world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos)).isEmpty()) {
PFMMirrorEntity.createMirror((ServerWorld) world, pos, state.get(FACING).getOpposite());
if (PaladinFurnitureMod.getPFMConfig().doImmersivePortalsMirrorsSpawn()) {
if (!world.isClient && world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos)).isEmpty()) {
PFMMirrorEntity.createMirror((ServerWorld) world, pos, state.get(FACING).getOpposite());
}
}
}

@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
super.onBreak(world, pos, state, player);
if (PaladinFurnitureMod.getPFMConfig().doImmersivePortalsMirrorsSpawn()) {
List<PFMMirrorEntity> mirrorBlockEntities;
if (!world.isClient && !(mirrorBlockEntities = world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos))).isEmpty()) {
mirrorBlockEntities.forEach(pfmMirrorEntity -> {
pfmMirrorEntity.remove(Entity.RemovalReason.KILLED);
});
world.updateNeighbors(pos, state.getBlock());
if (!world.isClient && !(mirrorBlockEntities = world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos))).isEmpty()) {
mirrorBlockEntities.forEach(pfmMirrorEntity -> {
pfmMirrorEntity.remove(Entity.RemovalReason.KILLED);
});
world.updateNeighbors(pos, state.getBlock());
}
}
}

@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (!world.isClient()) {
if (PaladinFurnitureMod.getPFMConfig().doImmersivePortalsMirrorsSpawn() && !world.isClient()) {
List<PFMMirrorEntity> mirrorBlockEntities = new ArrayList<>();
if (canConnect(neighborState, state)) {
mirrorBlockEntities.addAll(world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(neighborPos)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public PFMModCompatibility getCompatiblity() {

@Override
public void registerEntityRenderer() {
EntityRenderRegistry.registerEntityRender(PFMImmersivePortals.MIRROR, PortalEntityRenderer::new);
EntityRenderRegistry.registerEntityRender(PFMImmersivePortals.MIRROR, PFMMirrorEntityRenderer::new);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.unlikepaladin.pfm.compat.imm_ptl.client;

import com.unlikepaladin.pfm.PaladinFurnitureMod;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import qouteall.imm_ptl.core.portal.Portal;
import qouteall.imm_ptl.core.render.PortalEntityRenderer;

public class PFMMirrorEntityRenderer extends PortalEntityRenderer {
public PFMMirrorEntityRenderer(EntityRendererFactory.Context context) {
super(context);
}

@Override
public void render(Portal portal, float yaw, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light) {
if (PaladinFurnitureMod.getPFMConfig().doImmersivePortalsMirrorsRender())
super.render(portal, yaw, tickDelta, matrixStack, vertexConsumerProvider, light);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static PFMMirrorEntity createMirror(
facing.getAxis()
)
);
pfmMirrorEntity.setPosition(pos.x, pos.y, pos.z);
pfmMirrorEntity.setPosition(pos);
pfmMirrorEntity.setDestination(pos);
pfmMirrorEntity.dimensionTo = world.getRegistryKey();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public PaladinFurnitureModConfig(Path propertiesPath) {
tablesOfDifferentMaterialsConnect = new BooleanConfigOption(Text.translatable("pfm.option.tablesOfDifferentMaterialsConnect"), Text.translatable("pfm.option.tablesOfDifferentMaterialsConnect.tooltip"), GAMEPLAY_OPTIONS, false, Side.SERVER),
differentMirrorsConnect = new BooleanConfigOption(Text.translatable("pfm.option.differentMirrorsConnect"), Text.translatable("pfm.option.differentMirrorsConnect.tooltip"), GAMEPLAY_OPTIONS, false, Side.SERVER),
enableBook = new BooleanConfigOption(Text.translatable("pfm.option.enableBook"), Text.translatable("pfm.option.enableBook.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
mobsSitOnChairs = new BooleanConfigOption(Text.translatable("pfm.option.mobsSitOnChairs"), Text.translatable("pfm.option.mobsSitOnChairs.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER)
mobsSitOnChairs = new BooleanConfigOption(Text.translatable("pfm.option.mobsSitOnChairs"), Text.translatable("pfm.option.mobsSitOnChairs.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
renderImmersivePortalsMirrors = new BooleanConfigOption(Text.translatable("pfm.option.renderImmersivePortalsMirrors"), Text.translatable("pfm.option.renderImmersivePortalsMirrors.tooltip"), GAMEPLAY_OPTIONS, true, Side.SERVER),
spawnImmersivePortalsMirror = new BooleanConfigOption(Text.translatable("pfm.option.spawnImmersivePortalsMirror"), Text.translatable("pfm.option.spawnImmersivePortalsMirror.tooltip"), GAMEPLAY_OPTIONS, true, Side.CLIENT)
);
this.propertiesPath = propertiesPath;
}
Expand Down Expand Up @@ -97,6 +99,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 @@ -114,6 +122,8 @@ public boolean isShaderSolidFixOn() {

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


public Path getPath() {
Expand Down Expand Up @@ -144,6 +154,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 @@ -170,6 +182,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
@@ -1,9 +1,15 @@
package com.unlikepaladin.pfm.mixin;

import com.google.common.base.Suppliers;
import com.mojang.bridge.game.PackType;
import com.unlikepaladin.pfm.client.PathPackRPWrapper;
import com.unlikepaladin.pfm.runtime.PFMRuntimeResources;
import net.minecraft.SharedConstants;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.metadata.PackResourceMetadata;
import net.minecraft.server.SaveLoader;
import net.minecraft.server.SaveLoading;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
Expand All @@ -16,13 +22,11 @@ public class PFMSaveLoaderMixin {

@ModifyArg(method = "load", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/LifecycledResourceManagerImpl;<init>(Lnet/minecraft/resource/ResourceType;Ljava/util/List;)V"), index = 1)
private List<ResourcePack> createReload(List<ResourcePack> packs) {
PFMRuntimeResources.RESOURCE_PACK_LIST = packs;
List<ResourcePack> resourcePacks = new ArrayList<>(packs);
if (PFMRuntimeResources.ready) {
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
//PFMRuntimeResources.runAsyncResourceGen(); No async for anyone, too bad forge won't behave
PFMRuntimeResources.prepareAndRunResourceGen(false);
resourcePacks.add(PFMRuntimeResources.ASSETS_PACK);
}
PackResourceMetadata packResourceMetadata = new PackResourceMetadata(Text.literal("pfm-runtime-resources"), SharedConstants.getGameVersion().getPackVersion(PackType.RESOURCE));
resourcePacks.add(new PathPackRPWrapper(Suppliers.memoize(() -> {
PFMRuntimeResources.prepareAndRunResourceGen(false); return PFMRuntimeResources.ASSETS_PACK;}), packResourceMetadata));
return resourcePacks;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public DefaultedList<Ingredient> getIngredients() {
public boolean matches(PlayerInventory playerInventory, World world) {
List<Ingredient> ingredients = this.getIngredients();
BitSet hasIngredients = new BitSet(ingredients.size());
if (this.output.getItem().equals(PaladinFurnitureModBlocksItems.GLASS_MODERN_PENDANT.asItem())) {
System.out.println("wtf");
}
HashMap<Item, Integer> containedItems = new HashMap<>();
for (int i = 0; i < ingredients.size(); i++) {
Ingredient ingredient = ingredients.get(i);
Expand Down
Loading

0 comments on commit ef301c2

Please sign in to comment.