1
0
Fork 0

Prevent TntBlock from creating TntEntity

This commit is contained in:
Ryan Fox (flewkey) 2020-01-14 03:22:44 +00:00 committed by Ryan Fox
parent 7fb945136d
commit 21aedbf935
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 27 additions and 0 deletions

View File

@ -12,6 +12,7 @@ dependencies {
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompile "org.json:json:20190722"
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
include "org.json:json:20190722"
}

View File

@ -0,0 +1,25 @@
package party._2a03.mc.mixin;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.TntBlock;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(TntBlock.class)
public class MixinTntBlock extends Block {
public MixinTntBlock(Block.Settings settings) {
super(settings);
}
/**
* @reason Disable TNT block explosions.
* @author flewkey
*/
@Overwrite
private static void primeTnt(World world, BlockPos pos, @Nullable LivingEntity igniter) {
}
}

View File

@ -4,6 +4,7 @@
"compatibilityLevel": "JAVA_8",
"server": [
"MixinGameModeCommand",
"MixinTntBlock",
"MixinTntEntity"
],
"injectors": {