mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 11:29:29 +00:00
Initial test of Gradle (not working yet)
This commit is contained in:
1 parent
e8b7378831
commit
cb87c836c8
519 files changed
+351
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import tconstruct.items.TitleIcon;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class TDispenserBehaviorSpawnEgg extends BehaviorDefaultDispenseItem
|
||||
{
|
||||
/**
|
||||
* Dispense the specified stack, play the dispense sound and spawn particles.
|
||||
*/
|
||||
public ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack)
|
||||
{
|
||||
EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
|
||||
double d0 = par1IBlockSource.getX() + (double) enumfacing.getFrontOffsetX();
|
||||
double d1 = (double) ((float) par1IBlockSource.getYInt() + 0.2F);
|
||||
double d2 = par1IBlockSource.getZ() + (double) enumfacing.getFrontOffsetZ();
|
||||
EntityLiving entity = TitleIcon.activateSpawnEgg(par2ItemStack, par1IBlockSource.getWorld(), d0, d1, d2, 0);
|
||||
|
||||
if (par2ItemStack.hasDisplayName())
|
||||
{
|
||||
((EntityLiving) entity).setCustomNameTag(par2ItemStack.getDisplayName());
|
||||
}
|
||||
|
||||
par2ItemStack.splitStack(1);
|
||||
return par2ItemStack;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user