Allow the new entity eggs to be created via middle-click

This commit is contained in:
diesieben07 2015-07-16 14:13:48 +02:00
parent 20bf76464a
commit 9f571ff15d

View file

@ -125,7 +125,7 @@
} }
public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_)
@@ -2357,4 +2405,176 @@ @@ -2357,4 +2405,183 @@
EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_); EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_);
} }
@ -201,6 +201,13 @@
+ { + {
+ return new ItemStack(net.minecraft.init.Items.field_151063_bx, 1, id); + return new ItemStack(net.minecraft.init.Items.field_151063_bx, 1, id);
+ } + }
+ String name = EntityList.func_75621_b(this);
+ if (name != null && net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().containsKey(name))
+ {
+ ItemStack stack = new ItemStack(net.minecraft.init.Items.field_151063_bx);
+ stack.func_77983_a("entity_name", new net.minecraft.nbt.NBTTagString(name));
+ return stack;
+ }
+ } + }
+ return null; + return null;
+ } + }