Skip to content

Commit b2ab000

Browse files
committed
enhancement
Renamed `/endermanBlockList type disabled` to `/endermanBlockList type vanilla` & Added `/endermanBlockList type disable_all`
1 parent 37e6a2a commit b2ab000

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ Mostly based on [Fallen-Breath's template](https://github.com/Fallen-Breath/fabr
8484
- *Any blocks not listed in the blacklist can be picked up*
8585
- whitelist
8686
- *Only blocks listed in the whitelist can be picked up*
87-
- disabled
87+
- disable_all
88+
- *No blocks can be moved*
89+
- vanilla
8890
- *Default state, with no actual impact to the game*
8991
- whitelist & blacklist
9092
- add \<block>

README_zh.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
8484
- *任何不在黑名单中的方块均可被捡起*
8585
- whitelist
8686
- *在白名单里的方块可被捡起*
87-
- disabled
87+
- disable_all
88+
- *阻止末影人拿起任何方块*
89+
- vanilla
8890
- *默认模式,对游戏机制无影响*
8991
- whitelist & blacklist
9092
- add \<block>

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### General
2+
3+
- Renamed `/endermanBlockList type disabled` to `/endermanBlockList type vanilla`
4+
- Added `/endermanBlockList type disable_all`
5+
- Support for 26.1-snapshot-3

src/main/java/com/ayakacraft/carpetayakaaddition/commands/endermanblocklist/EndermanBlockListCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private static int removeFromWhitelist(CommandContext<CommandSourceStack> contex
167167
private static int get(CommandContext<CommandSourceStack> context) {
168168
CommandSourceStack source = context.getSource();
169169
EndermanBlockListConfig config = getConfig(source.getServer());
170-
EndermanBlockListConfig.Type type = config == null ? EndermanBlockListConfig.Type.DISABLED : config.getType();
170+
EndermanBlockListConfig.Type type = config == null ? EndermanBlockListConfig.Type.VANILLA : config.getType();
171171
sendFeedback(
172172
source,
173173
TR.tr("type", type.name().toLowerCase(Locale.ROOT)),

src/main/java/com/ayakacraft/carpetayakaaddition/commands/endermanblocklist/EndermanBlockListConfig.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.ayakacraft.carpetayakaaddition.utils.IdentifierUtils;
2525
import com.google.common.collect.Maps;
2626
import com.google.common.collect.Sets;
27+
import com.google.gson.annotations.SerializedName;
2728
import net.minecraft.server.MinecraftServer;
2829
import net.minecraft.world.level.block.Block;
2930
import org.jetbrains.annotations.Contract;
@@ -92,14 +93,14 @@ public static void remove(MinecraftServer server) {
9293
private TreeSet<String> whitelist;
9394

9495
private EndermanBlockListConfig() {
95-
this.type = Type.DISABLED;
96+
this.type = Type.VANILLA;
9697
this.blacklist = Sets.newTreeSet();
9798
this.whitelist = Sets.newTreeSet();
9899
}
99100

100101
private void ensureNullSafety() {
101102
if (this.type == null) {
102-
this.type = Type.DISABLED;
103+
this.type = Type.VANILLA;
103104
}
104105
if (this.blacklist == null) {
105106
this.blacklist = Sets.newTreeSet();
@@ -114,7 +115,7 @@ public Type getType() {
114115
}
115116

116117
public void setType(Type type) {
117-
this.type = type == null ? Type.DISABLED : type;
118+
this.type = type == null ? Type.VANILLA : type;
118119
}
119120

120121
public TreeSet<String> getWhitelist() {
@@ -128,11 +129,13 @@ public TreeSet<String> getBlacklist() {
128129
public boolean verifyBlock(Block block) {
129130
String s = IdentifierUtils.ofBlock(block).toString();
130131
switch (type) {
132+
case DISABLE_ALL:
133+
return false;
134+
case WHITELIST:
135+
return getWhitelist().contains(s);
131136
case BLACKLIST:
132137
case BLACKLIST_LOOSE:
133138
return !getBlacklist().contains(s);
134-
case WHITELIST:
135-
return getWhitelist().contains(s);
136139
default:
137140
return true;
138141
}
@@ -142,7 +145,9 @@ public enum Type {
142145
BLACKLIST,
143146
BLACKLIST_LOOSE,
144147
WHITELIST,
145-
DISABLED
148+
DISABLE_ALL,
149+
@SerializedName(value = "VANILLA", alternate = "DISABLED")
150+
VANILLA
146151
}
147152

148153
}

versions/1.21.11/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ parchment=2025.12.20
1212
# Mod Dependency
1313
# check available versions on maven for the given minecraft version you are using
1414
# https://masa.dy.fi/maven/carpet/fabric-carpet/
15-
carpet_core_version=1.21.11-1.4.194+v260107
15+
carpet_core_version=1.21.11-1.4.193+v251211
1616
carpet_dependency=>=1.4.193
1717
# https://maven.fallenbreath.me/#/releases/carpettisaddition/carpet-tis-addition
1818
tis_version=1.74.3-mc1.21.11

0 commit comments

Comments
 (0)