aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/CarrotTile.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/CarrotTile.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/CarrotTile.cpp')
-rw-r--r--Minecraft.World/CarrotTile.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/Minecraft.World/CarrotTile.cpp b/Minecraft.World/CarrotTile.cpp
new file mode 100644
index 00000000..3eba830b
--- /dev/null
+++ b/Minecraft.World/CarrotTile.cpp
@@ -0,0 +1,42 @@
+#include "stdafx.h"
+#include "net.minecraft.world.h"
+#include "net.minecraft.world.item.h"
+#include "CarrotTile.h"
+
+CarrotTile::CarrotTile(int id) : CropTile(id)
+{
+}
+
+Icon *CarrotTile::getTexture(int face, int data)
+{
+ if (data < 7)
+ {
+ if (data == 6)
+ {
+ data = 5;
+ }
+ return icons[data >> 1];
+ }
+ else
+ {
+ return icons[3];
+ }
+}
+
+int CarrotTile::getBaseSeedId()
+{
+ return Item::carrots_Id;
+}
+
+int CarrotTile::getBasePlantId()
+{
+ return Item::carrots_Id;
+}
+
+void CarrotTile::registerIcons(IconRegister *iconRegister)
+{
+ for (int i = 0; i < 4; i++)
+ {
+ icons[i] = iconRegister->registerIcon(L"carrots_" + _toString(i));
+ }
+} \ No newline at end of file