-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'architectury-1.17.1' into architectury-1.16.5
# 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
Showing
35 changed files
with
1,193 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
45 changes: 5 additions & 40 deletions
45
common/src/main/java/com/unlikepaladin/pfm/compat/imm_ptl/PFMImmersivePortals.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.