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/items/ShowerHandleItem.java
#	common/src/main/resources/pfm.accesswidener
#	forge/build.gradle
#	forge/src/main/java/com/unlikepaladin/pfm/blocks/models/forge/PFMForgeBakedModel.java
#	gradle.properties
  • Loading branch information
UnlikePaladin committed Feb 19, 2024
2 parents 7cc605f + d856408 commit b651371
Show file tree
Hide file tree
Showing 45 changed files with 392 additions and 139 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: unlikepaladin
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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.
<br><br>
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.
<br>
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
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
modImplementation "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")
}
modCompileOnlyApi("mezz.jei:jei-${rootProject.minecraft_version}-fabric:${rootProject.jei_version}") {
exclude group: "mezz.jei"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
}
}
}
Expand Down
Loading

0 comments on commit b651371

Please sign in to comment.