Skip to content

Commit

Permalink
✅ 新增规则:easyWitherSkeletonSkullDrop
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Oct 21, 2023
1 parent 852bcbc commit fc64782
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 0 deletions.
9 changes: 9 additions & 0 deletions readme_folder/en_us/rules_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@ When enabled, Update suppression does not cause the server to crash.
- Categroies: `AMS` , `FEATURE` , `SURVIVAL` , `EXPERIMENTAL`


## easyWitherSkeletonSkullDrop

When enabled, 100% Wither Skeleton Skull Drop.

- Type: `boolean`
- Default: `false`
- Suggested options: `false` , `true`
- Categroies: `AMS` , `FEATURE` , `SURVIVAL`


## movableEnderChest

Expand Down
10 changes: 10 additions & 0 deletions readme_folder/rules_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,16 @@
- 分类: `AMS` , `FEATURE` , `SURVIVAL` , `EXPERIMENTAL`


## 轻松掉落凋零骷髅头 (easyWitherSkeletonSkullDrop)

开启后,击杀凋零骷髅会百分百掉落凋零骷髅头。

- 类型: `boolean`
- 默认值: `false`
- 参考选项: `false` , `true`
- 分类: `AMS` , `FEATURE` , `SURVIVAL`


## 可移动末地传送门框架(movableEndPortalFrame)

开启后,末地传送门框架可以被活塞/黏性活塞推动。
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/club/mcams/carpet/AmsServerSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ public class AmsServerSettings {
public static boolean amsUpdateSuppressionCrashFix = false;
//#endif

@Rule(categories = {AMS, FEATURE, SURVIVAL})
public static boolean easyWitherSkeletonSkullDrop = false;

/**
* 可移动方块规则
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* This file is part of the Carpet AMS Addition project, licensed under the
* GNU Lesser General Public License v3.0
*
* Copyright (C) 2023 A Minecraft Server and contributors
*
* Carpet AMS Addition is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Carpet AMS Addition is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Carpet AMS Addition. If not, see <https://www.gnu.org/licenses/>.
*/

package club.mcams.carpet.mixin.rule.easyWitherSkeletonSkullDrop;

import club.mcams.carpet.AmsServerSettings;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.mob.AbstractSkeletonEntity;
import net.minecraft.entity.mob.WitherSkeletonEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.world.World;

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.CallbackInfo;

@Mixin(WitherSkeletonEntity.class)
public abstract class WitherSkeletonEntityMixin extends AbstractSkeletonEntity {
protected WitherSkeletonEntityMixin(EntityType<? extends AbstractSkeletonEntity> entityType, World world) {
super(entityType, world);
}
@Inject(method = "dropEquipment", at = @At("TAIL"), cancellable = true)
private void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops, CallbackInfo ci) {
if (AmsServerSettings.easyWitherSkeletonSkullDrop && allowDrops) {
this.dropStack(new ItemStack(Items.WITHER_SKELETON_SKULL));
ci.cancel();
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/amscarpet.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"rule.creativeOneHitKill.EntityAccessorMixin",
"rule.creativeOneHitKill.PlayerEntityMixin",
"rule.creativeShulkerBoxDropsDisabled.ShulkerBoxBlockMixin",
"rule.easyWitherSkeletonSkullDrop.WitherSkeletonEntityMixin",
"rule.enderManTeleportRandomlyDisabled.EndermanEntityMixin",
"rule.extinguishedCampfire_campfireSmokeParticleDisabled.GetPlacementStateMixin",
"rule.fakePeace.AbstractBlockStateMixin",
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/carpetamsaddition/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ carpetamsaddition:
amsUpdateSuppressionCrashFix:
name: amsUpdateSuppressionCrashFix
desc: Fixes updates suppression causing server crashes
easyWitherSkeletonSkullDrop:
name: easyWitherSkeletonSkullDrop
desc: 100% Wither Skeleton Skull Drop

# 计划刻催熟规则:
scheduledRandomTickCactus:
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/carpetamsaddition/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ carpetamsaddition:
amsUpdateSuppressionCrashFix:
name: 更新抑制崩溃修复
desc: 防止更新抑制导致服务器崩溃
easyWitherSkeletonSkullDrop:
name: 轻松掉落凋零骷髅头
desc: 击杀凋零骷髅会百分百掉落凋零骷髅头

# 计划刻催熟规则:
scheduledRandomTickCactus:
Expand Down

0 comments on commit fc64782

Please sign in to comment.