summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/DispenseBehaviorTNT.java
blob: 724a2eef47dc956fa44936f2b42d5cb50712fc8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package net.minecraft.server;

final class DispenseBehaviorTNT extends DispenseBehaviorItem {

    DispenseBehaviorTNT() {}

    protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
        EnumFacing enumfacing = BlockDispenser.j_(isourceblock.h());
        World world = isourceblock.k();
        int i = isourceblock.getBlockX() + enumfacing.c();
        int j = isourceblock.getBlockY() + enumfacing.d();
        int k = isourceblock.getBlockZ() + enumfacing.e();
        EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), (EntityLiving) null);

        world.addEntity(entitytntprimed);
        --itemstack.count;
        return itemstack;
    }
}