peytonplayz585-infdev/source/net/minecraft/src/ItemMinecart.java
peytonplayz595 b335840495 Upload src
2023-09-23 01:47:15 -05:00

20 lines
571 B
Java

package net.minecraft.src;
public class ItemMinecart extends Item {
public ItemMinecart(int var1) {
super(var1);
this.maxStackSize = 1;
}
public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
int var8 = var3.getBlockId(var4, var5, var6);
if(var8 == Block.minecartTrack.blockID) {
var3.spawnEntityInWorld(new EntityMinecart(var3, (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F)));
--var1.stackSize;
return true;
} else {
return false;
}
}
}