Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/com/tacz/guns/entity/EntityKineticBullet.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ public boolean isTracerAmmo() {
return isTracerAmmo;
}

public int getPierce() {
return this.pierce;
}

public RandomSource getRandom() {
return this.random;
}
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/com/tacz/guns/event/ammo/DestroyGlassBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ public static void onAmmoHitBlock(AmmoHitBlockEvent event) {
EntityKineticBullet ammo = event.getAmmo();
Block stateBlock = state.getBlock();
NoteBlockInstrument instrument = state.instrument();
if (AmmoConfig.DESTROY_GLASS.get() && (stateBlock instanceof AbstractGlassBlock ||
stateBlock instanceof StainedGlassPaneBlock ||
(stateBlock instanceof IronBarsBlock && instrument.equals(NoteBlockInstrument.HAT)))) {
if (AmmoConfig.DESTROY_GLASS.get() &&
!(stateBlock instanceof TintedGlassBlock) &&
(stateBlock instanceof AbstractGlassBlock ||
stateBlock instanceof StainedGlassPaneBlock ||
(stateBlock instanceof IronBarsBlock && instrument.equals(NoteBlockInstrument.HAT)))) {
level.destroyBlock(pos, false, ammo.getOwner());
}
// Break tinted glass if bullet pierce value is 5 or more
if (stateBlock instanceof TintedGlassBlock && ammo.getPierce() >= 5) {
level.destroyBlock(pos, false, ammo.getOwner());
}
}
Expand Down