use of net.minecraft.world.entity.item.EntityTNTPrimed in project BedWars1058 by andrei1058.
the class v1_17_R1 method setSource.
@Override
public void setSource(TNTPrimed tnt, Player owner) {
EntityLiving nmsEntityLiving = (((CraftLivingEntity) owner).getHandle());
EntityTNTPrimed nmsTNT = (((CraftTNTPrimed) tnt).getHandle());
try {
// noinspection JavaReflectionMemberAccess
Field sourceField = EntityTNTPrimed.class.getDeclaredField("source");
sourceField.setAccessible(true);
sourceField.set(nmsTNT, nmsEntityLiving);
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of net.minecraft.world.entity.item.EntityTNTPrimed in project BedWars1058 by andrei1058.
the class v1_18_R1 method setSource.
@Override
public void setSource(TNTPrimed tnt, Player owner) {
EntityLiving nmsEntityLiving = (((CraftLivingEntity) owner).getHandle());
EntityTNTPrimed nmsTNT = (((CraftTNTPrimed) tnt).getHandle());
try {
// noinspection JavaReflectionMemberAccess
Field sourceField = EntityTNTPrimed.class.getDeclaredField("source");
sourceField.setAccessible(true);
sourceField.set(nmsTNT, nmsEntityLiving);
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations