added explosionNoBlockDamage
This commit is contained in:
1 parent
83d834de60
commit
2f6483196b
2 files changed
+34
-1
No files matched your search
@@ -0,0 +1,32 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.explosion.Explosion;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mixin(Explosion.class)
|
||||||
|
public abstract class ExplosionMixin
|
||||||
|
{
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private List<BlockPos> affectedBlocks;
|
||||||
|
|
||||||
|
@Inject(method = "collectBlocksAndDamageEntities", at = @At(value = "INVOKE", shift = At.Shift.AFTER,
|
||||||
|
target = "Ljava/util/List;addAll(Ljava/util/Collection;)Z"))
|
||||||
|
private void clearList(CallbackInfo ci)
|
||||||
|
{
|
||||||
|
if (CarpetSettings.getBool("explosionNoBlockDamage"))
|
||||||
|
{
|
||||||
|
this.affectedBlocks.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
"ContainerMixin",
|
"ContainerMixin",
|
||||||
"ClientConnectionMixin",
|
"ClientConnectionMixin",
|
||||||
"ItemEntityMixin",
|
"ItemEntityMixin",
|
||||||
"TntBlockMixin"
|
"TntBlockMixin",
|
||||||
|
"ExplosionMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"MinecraftClientMixin",
|
"MinecraftClientMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user