Skip to content

Commit

Permalink
Exclude portal blocks from healing features. Bump semver
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkoSammy12 committed Aug 11, 2024
1 parent f5eca77 commit 125116c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ loader_version=0.15.11
fabric_version=0.100.7+1.21

# Mod Properties
mod_version=1.2.1-1.21+
mod_version=1.2.2-1.21+
maven_group=xd.arkosammy
archives_base_name=creeper-healing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public abstract class ExplosionMixin implements ExplosionAccessor {
// Save the affected block states and block entities before the explosion takes effect
@Inject(method = "collectBlocksAndDamageEntities", at = @At("RETURN"))
private void collectAffectedStatesAndBlockEntities(CallbackInfo ci){
if (world.isClient())
if (world.isClient()) {
return;

}
this.checkForIndirectlyAffectedPositions();
this.getAffectedBlocks().forEach(pos -> this.affectedStatesAndBlockEntities.put(pos, new Pair<>(this.world.getBlockState(pos), this.world.getBlockEntity(pos))));
this.indirectlyAffectedPositions.forEach(pos -> this.affectedStatesAndBlockEntities.put(pos, new Pair<>(this.world.getBlockState(pos), this.world.getBlockEntity(pos))));
Expand All @@ -70,9 +70,11 @@ private void collectAffectedStatesAndBlockEntities(CallbackInfo ci){
// Make sure the thread local is reset when entering and exiting Explosion#affectWorld
@Inject(method = "affectWorld", at = @At(value = "HEAD"))
private void setThreadLocals(boolean particles, CallbackInfo ci){
if (world.isClient())
if (world.isClient()) {
ExplosionUtils.DROP_BLOCK_ITEMS.set(true);
ExplosionUtils.DROP_CONTAINER_INVENTORY_ITEMS.set(true);
return;

}
ExplosionUtils.DROP_BLOCK_ITEMS.set(true);
ExplosionUtils.DROP_CONTAINER_INVENTORY_ITEMS.set(true);
}
Expand All @@ -82,9 +84,9 @@ private void setThreadLocals(boolean particles, CallbackInfo ci){
// Emit an ExplosionContext object for ExplosionManagers to receive.
@Inject(method = "affectWorld", at = @At(value = "RETURN"))
private void onExplosion(boolean particles, CallbackInfo ci){
if (world.isClient())
if (world.isClient()) {
return;

}
ExplosionUtils.DROP_BLOCK_ITEMS.set(true);
ExplosionUtils.DROP_CONTAINER_INVENTORY_ITEMS.set(true);
this.indirectlyAffectedPositions.removeIf(pos -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
* or because they are not meant to be healed.
*/
public enum ExcludedBlocks {
SHULKER_BOX(Blocks.SHULKER_BOX, BlockTags.SHULKER_BOXES);
SHULKER_BOX(Blocks.SHULKER_BOX, BlockTags.SHULKER_BOXES),
NETHER_PORTAL(Blocks.NETHER_PORTAL, BlockTags.PORTALS),
END_PORTAL(Blocks.END_PORTAL, BlockTags.PORTALS),
END_GATEWAY(Blocks.END_GATEWAY, BlockTags.PORTALS);

private final Block blockInstance;
@Nullable
Expand Down

0 comments on commit 125116c

Please sign in to comment.