Skip to content

Commit 12c2175

Browse files
committed
Merge branch 'mc/1.21.6' into mc/1.21.7
2 parents 2d88fe1 + 9a304c9 commit 12c2175

8 files changed

Lines changed: 32 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
A list of all changes made to the software in reverse chronological order.
44

5+
## 4.5.3
6+
7+
- Gravel, Ore Vein, and Dig Hole effects no longer replace tile entities
8+
59
## 4.5.2
610

711
- Paper: Added support for 26.1.1 and its new _Age Nearby Mobs_ effects

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group = dev.qixils.crowdcontrol.plugin
2-
version = 4.5.2
2+
version = 4.5.3
33

44
# increase available memory
55
org.gradle.jvmargs=-Xmx2G

mojmap/src/main/java/dev/qixils/crowdcontrol/plugin/fabric/commands/DigCommand.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ public void execute(@NotNull Supplier<@NotNull List<@NotNull ServerPlayer>> play
3939
for (double x = -DIG_RADIUS; x <= DIG_RADIUS; ++x) {
4040
for (int y = depth; y <= 0; ++y) {
4141
for (double z = -DIG_RADIUS; z <= DIG_RADIUS; ++z) {
42-
Location block = playerLocation.add(x, y, z);
43-
if (!block.block().isAir())
44-
locations.add(block);
42+
Location loc = playerLocation.add(x, y, z);
43+
var block = loc.block();
44+
if (block.isAir()) continue;
45+
if (block.hasBlockEntity()) continue;
46+
47+
locations.add(loc);
4548
}
4649
}
4750
}

mojmap/src/main/java/dev/qixils/crowdcontrol/plugin/fabric/commands/GravelCommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import live.crowdcontrol.cc4j.websocket.payload.PublicEffectPayload;
1212
import lombok.Getter;
1313
import net.minecraft.server.level.ServerPlayer;
14-
import net.minecraft.tags.BlockTags;
1514
import net.minecraft.world.level.block.Blocks;
1615
import org.jetbrains.annotations.NotNull;
1716

@@ -35,7 +34,7 @@ public void execute(@NotNull Supplier<@NotNull List<@NotNull ServerPlayer>> play
3534
for (ServerPlayer player : playerSupplier.get())
3635
locations.addAll(BlockFinder.builder()
3736
.origin(player)
38-
.locationValidator(loc -> !loc.block().isAir() && !loc.block().is(Blocks.GRAVEL) && !loc.block().liquid())
37+
.locationValidator(loc -> !loc.block().isAir() && !loc.block().is(Blocks.GRAVEL) && !loc.block().liquid() && !loc.block().hasBlockEntity())
3938
.shuffleLocations(false)
4039
.maxRadius(7)
4140
.build().getAll());

mojmap/src/main/java/dev/qixils/crowdcontrol/plugin/fabric/commands/VeinCommand.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ private void addOreVein(List<Location> deepslateBlocks, List<Location> stoneBloc
5353
for (int z = 0; z <= 2; ++z) {
5454
Location loc = base.add(x, y, z);
5555
BlockState block = loc.block();
56+
if (block.isAir()) continue;
57+
if (loc.block().hasBlockEntity()) continue;
58+
5659
if (block.is(ORE_BEARING_GROUND_DEEPSLATE)) {
5760
deepslateBlocks.add(loc);
58-
} else if (!block.isAir()) {
61+
} else {
5962
stoneBlocks.add(loc);
6063
}
6164
}
@@ -80,7 +83,7 @@ public void execute(@NotNull Supplier<@NotNull List<@NotNull ServerPlayer>> play
8083
BlockFinder finder = BlockFinder.builder()
8184
.origin(new Location(player))
8285
.maxRadius(VEIN_RADIUS)
83-
.locationValidator(loc -> !loc.block().isAir())
86+
.locationValidator(loc -> !loc.block().isAir() && !loc.block().hasBlockEntity())
8487
.build();
8588

8689
Registry<Block> registry = player.level().registryAccess().lookupOrThrow(Registries.BLOCK);

paper/src/main/java/dev/qixils/crowdcontrol/plugin/paper/commands/DigCommand.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import lombok.Getter;
1111
import org.bukkit.Location;
1212
import org.bukkit.Material;
13+
import org.bukkit.block.TileState;
1314
import org.bukkit.entity.Player;
1415
import org.jetbrains.annotations.NotNull;
1516

@@ -37,11 +38,12 @@ protected boolean executeRegionallySync(@NotNull Player player, @NotNull PublicE
3738
for (double x = -DIG_RADIUS; x <= DIG_RADIUS; ++x) {
3839
for (int y = depth; y <= 0; ++y) {
3940
for (double z = -DIG_RADIUS; z <= DIG_RADIUS; ++z) {
40-
Location block = playerLocation.clone().add(x, y, z);
41-
if (!block.getBlock().isEmpty()) {
42-
block.getBlock().setType(Material.AIR);
43-
success = true;
44-
}
41+
Location loc = playerLocation.clone().add(x, y, z);
42+
if (loc.getBlock().isEmpty()) continue;
43+
if (loc.getBlock().getState() instanceof TileState) continue;
44+
45+
loc.getBlock().setType(Material.AIR);
46+
success = true;
4547
}
4648
}
4749
}

paper/src/main/java/dev/qixils/crowdcontrol/plugin/paper/commands/GravelCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import lombok.Getter;
1212
import org.bukkit.Location;
1313
import org.bukkit.Material;
14+
import org.bukkit.block.TileState;
1415
import org.bukkit.entity.Player;
1516
import org.jetbrains.annotations.NotNull;
1617

@@ -33,7 +34,7 @@ public GravelCommand(PaperCrowdControlPlugin plugin) {
3334
protected boolean executeRegionallySync(@NotNull Player player, @NotNull PublicEffectPayload request, @NotNull CCPlayer ccPlayer) {
3435
List<Location> locations = BlockUtil.BlockFinder.builder()
3536
.origin(player.getLocation())
36-
.locationValidator(loc -> !loc.getBlock().isEmpty() && loc.getBlock().getType() != Material.GRAVEL && !loc.getBlock().isLiquid())
37+
.locationValidator(loc -> !loc.getBlock().isEmpty() && loc.getBlock().getType() != Material.GRAVEL && !loc.getBlock().isLiquid() && !(loc.getBlock().getState() instanceof TileState))
3738
.shuffleLocations(false)
3839
.maxRadius(7)
3940
.build().getAll();

paper/src/main/java/dev/qixils/crowdcontrol/plugin/paper/commands/VeinCommand.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.bukkit.Location;
1515
import org.bukkit.Material;
1616
import org.bukkit.block.Block;
17+
import org.bukkit.block.TileState;
1718
import org.bukkit.entity.Player;
1819
import org.jetbrains.annotations.Contract;
1920
import org.jetbrains.annotations.NotNull;
@@ -43,9 +44,12 @@ private static void addOreVein(List<Location> deepslateBlocks, List<Location> st
4344
Location loc = base.clone().add(x, y, z);
4445
Block block = loc.getBlock();
4546
Material matType = block.getType();
47+
if (block.isEmpty()) continue;
48+
if (block.getState() instanceof TileState) continue;
49+
4650
if (matType == Material.DEEPSLATE) {
4751
deepslateBlocks.add(loc);
48-
} else if (!block.isEmpty()) {
52+
} else {
4953
stoneBlocks.add(loc);
5054
}
5155
}
@@ -72,7 +76,7 @@ protected boolean executeRegionallySync(@NotNull Player player, @NotNull PublicE
7276
BlockFinder finder = BlockFinder.builder()
7377
.origin(player.getLocation())
7478
.maxRadius(VEIN_RADIUS)
75-
.locationValidator(loc -> !loc.getBlock().isEmpty())
79+
.locationValidator(loc -> !loc.getBlock().isEmpty() && !(loc.getBlock().getState() instanceof TileState))
7680
.build();
7781

7882
boolean success = false;

0 commit comments

Comments
 (0)