MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / dispenseStack

Method dispenseStack

src/main/java/net/minecraft/init/Bootstrap.java:135–150  ·  view source on GitHub ↗
(IBlockSource source, ItemStack stack)

Source from the content-addressed store, hash-verified

133 BlockDispenser.dispenseBehaviorRegistry.putObject(Items.spawn_egg, new BehaviorDefaultDispenseItem()
134 {
135 public ItemStack dispenseStack(IBlockSource source, ItemStack stack)
136 {
137 EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata());
138 double d0 = source.getX() + (double)enumfacing.getFrontOffsetX();
139 double d1 = (float)source.getBlockPos().getY() + 0.2F;
140 double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ();
141 Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), d0, d1, d2);
142
143 if (entity instanceof EntityLivingBase && stack.hasDisplayName())
144 {
145 entity.setCustomNameTag(stack.getDisplayName());
146 }
147
148 stack.splitStack(1);
149 return stack;
150 }
151 });
152 BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fireworks, new BehaviorDefaultDispenseItem()
153 {

Callers

nothing calls this directly

Calls 15

getFacingMethod · 0.95
getXMethod · 0.95
getFrontOffsetXMethod · 0.95
getYMethod · 0.95
getZMethod · 0.95
getFrontOffsetZMethod · 0.95
spawnCreatureMethod · 0.95
setCustomNameTagMethod · 0.95
spawnEntityInWorldMethod · 0.95
getDispensePositionMethod · 0.95
getFrontOffsetYMethod · 0.95
getMaterialMethod · 0.95

Tested by

no test coverage detected