Skip to content

Commit

Permalink
update to 0.1.6
Browse files Browse the repository at this point in the history
添加了 railNoBrokenByFluid
适配了新的 modmenu 的配置文件格式
  • Loading branch information
plusls committed Feb 18, 2021
1 parent f1f02f0 commit 7e9067f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fabric-api >= 0.28
- [空潜影盒可堆叠](#空潜影盒可堆叠-emptyShulkerBoxStack)
- [潜影贝可再生](#潜影贝可再生-shulkerRenewable)
- [潜影盒快速拆包](#潜影盒快速拆包-shulkerBoxQuickUnpack)
- [铁轨不被液体破坏](#铁轨不被液体破坏-railNoBrokenByFluid)
- [潜影盒使用染料染色](#潜影盒使用染料染色-useDyeOnShulkerBox)
- [不死图腾扳手](#不死图腾扳手-flippingTotemOfUndying)
- [PCA调试模式](#PCA调试模式-pcaDebug)
Expand Down Expand Up @@ -88,14 +89,14 @@ Carpet 默认实现的潜影盒可堆叠只能让潜影盒在地面上堆叠,
- 参考选项: `true`, `false`
- 分类: `PCA`, `feature`, `experimental`

### 潜影盒使用染料染色 (useDyeOnShulkerBox)
### 铁轨不被液体破坏 (railNoBrokenByFluid)

可以使用染料直接对地上的潜影盒染色,用水瓶右键洗去地上潜影盒的颜色
1.17 引入了含水铁轨,考虑到改动可能会比较大,因此只引入了其不被液体破坏的特性

- 类型: `boolean`
- 默认值: `false`
- 参考选项: `true`, `false`
- 分类: `PCA`, `feature`
- 分类: `PCA`, `feature`, `experimental`

### 潜影盒使用染料染色 (useDyeOnShulkerBox)

Expand All @@ -106,6 +107,7 @@ Carpet 默认实现的潜影盒可堆叠只能让潜影盒在地面上堆叠,
- 参考选项: `true`, `false`
- 分类: `PCA`, `feature`


### 不死图腾扳手 (flippingTotemOfUndying)

允许使用不死图腾调整方块朝向,并且不会产生方块更新
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ org.gradle.jvmargs=-Xmx1G
carpet_core_version=1.4.24+v210120

# Mod Properties
mod_version = 0.1.5
mod_version = 0.1.6
maven_group = net.fabricmc
archives_base_name = plusls-carpet-addition

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/plusls/carpet/PcaSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public enum PCA_SYNC_PLAYER_ENTITY_OPTIONS {
)
public static boolean shulkerBoxQuickUnpack = false;

@Rule(
desc = "Rail no broken by fluid; 1.17 feature (backported)",
category = {PCA, RuleCategory.FEATURE, RuleCategory.EXPERIMENTAL}
)
public static boolean railNoBrokenByFluid = false;

@Rule(
desc = "Dyes can be used on shulker boxes, empty potion will clean color",
category = {PCA, RuleCategory.FEATURE}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.plusls.carpet.mixin.rule.railNoBrokenByFluid;

import com.plusls.carpet.PcaSettings;
import net.minecraft.block.AbstractRailBlock;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.FlowableFluid;
import net.minecraft.fluid.Fluid;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(FlowableFluid.class)
public abstract class MixinFlowableFluid extends Fluid {
@Inject(method = "canFill", at=@At(value = "RETURN"), cancellable = true)
private void checkRail(BlockView world, BlockPos pos, BlockState state, Fluid fluid, CallbackInfoReturnable<Boolean> cir) {
if (PcaSettings.railNoBrokenByFluid && cir.getReturnValue() && state.getBlock() instanceof AbstractRailBlock) {
cir.setReturnValue(false);
}
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/pca/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"rule.shulkerBoxQuickUnpack.name": "潜影盒快速拆包",
"rule.shulkerBoxQuickUnpack.desc": "物品状态下的潜影盒在被摧毁时,盒中的物品会自动掉落,来自 1.17",

"rule.railNoBrokenByFluid.name": "铁轨不被液体破坏",
"rule.railNoBrokenByFluid.desc": "铁轨不被液体破坏,来自 1.17",

"rule.useDyeOnShulkerBox.name": "潜影盒使用染料染色",
"rule.useDyeOnShulkerBox.desc": "可以使用染料直接对地上的潜影盒染色,用水瓶可以洗掉潜影盒的颜色",

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"another-mod": "*"
},
"custom": {
"modmenu:parent": "carpet"
"modmenu": {
"parent": "carpet"
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/pca.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"rule.pcaSyncProtocol.entity.MixinHorseBaseEntity",
"rule.pcaSyncProtocol.entity.MixinMerchantEntity",
"rule.pcaSyncProtocol.entity.MixinStorageMinecartEntity",
"rule.railNoBrokenByFluid.MixinFlowableFluid",
"rule.shulkerBoxQuickUnpack.MixinItemEntity",
"rule.shulkerRenewable.MixinShulkerEntity",
"rule.useDyeOnShulkerBox.MixinDyeItem",
Expand Down

0 comments on commit 7e9067f

Please sign in to comment.