Skip to content

Commit

Permalink
togglable bleed fix
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroach committed Oct 23, 2023
1 parent c0d3821 commit 526503f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class DurabilityOverride implements Listener {
public static Map<Material, Integer> DurabilityOverride = null;
public static boolean EnableBleedFix = true;

public static void load(@NotNull FileConfiguration config) {
if (!config.contains("DurabilityOverride"))
Expand All @@ -29,6 +30,7 @@ public static void load(@NotNull FileConfiguration config) {
if (section == null)
return;

EnableBleedFix = config.getBoolean("EnableBleedFix", true);
DurabilityOverride = new HashMap<>();
for (var entry : section.getValues(false).entrySet()) {
EnumSet<Material> materials = Tags.parseMaterials(entry.getKey());
Expand All @@ -55,7 +57,7 @@ public void onEntityExplode(@NotNull EntityExplodeEvent e) {
Set<Block> removeList = new HashSet<>();
for (Block b : e.blockList()) {
// remove the block if no adjacent blocks are air (IE: the explosion skipped a block)
if (!nextToAir(b)) {
if (!nextToAir(b) && EnableBleedFix) {
removeList.add(b);
continue;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ContactExplosivesMaxImpulseFactor: 10.0 # The maximum fraction of its velocity t
ContactExplosivesMinImpulse: 0.35 # Minimum velocity for contact explosives to track a TNT entity

# Durability Override
EnableBleedFix: true # Ensures only surface blocks gets damaged by TNT
DurabilityOverride: # List of block IDs: ignore percent
END_STONE: 80
END_STONE_BRICKS: 80
Expand Down

0 comments on commit 526503f

Please sign in to comment.