aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World')
-rw-r--r--Minecraft.World/AbstractContainerMenu.cpp2
-rw-r--r--Minecraft.World/ClothDyeRecipes.cpp28
-rw-r--r--Minecraft.World/ItemInstance.cpp30
-rw-r--r--Minecraft.World/PistonBaseTile.cpp3
-rw-r--r--Minecraft.World/Recipes.cpp1
-rw-r--r--Minecraft.World/StructureRecipies.cpp22
-rw-r--r--Minecraft.World/Tile.cpp7
7 files changed, 58 insertions, 35 deletions
diff --git a/Minecraft.World/AbstractContainerMenu.cpp b/Minecraft.World/AbstractContainerMenu.cpp
index c98fc22c..0b2abc23 100644
--- a/Minecraft.World/AbstractContainerMenu.cpp
+++ b/Minecraft.World/AbstractContainerMenu.cpp
@@ -157,7 +157,7 @@ shared_ptr<ItemInstance> AbstractContainerMenu::clicked(int slotIndex, int butto
shared_ptr<ItemInstance> clickedEntity = nullptr;
shared_ptr<Inventory> inventory = player->inventory;
- if (slotIndex < 0 || slotIndex >= (int)slots.size())
+ if ((slotIndex < 0 && slotIndex != SLOT_CLICKED_OUTSIDE) || slotIndex >= (int)slots.size())
return nullptr;
if (clickType == CLICK_QUICK_CRAFT)
diff --git a/Minecraft.World/ClothDyeRecipes.cpp b/Minecraft.World/ClothDyeRecipes.cpp
index c0625d2e..35d0b5b8 100644
--- a/Minecraft.World/ClothDyeRecipes.cpp
+++ b/Minecraft.World/ClothDyeRecipes.cpp
@@ -21,20 +21,20 @@ void ClothDyeRecipes::addRecipes(Recipes *r)
L'#', new ItemInstance(Tile::clayHardened),
L'X', new ItemInstance(Item::dye_powder, 1, i),L'D');
-#if 0
- r->addShapedRecipy(new ItemInstance(Tile::stained_glass, 8, ColoredTile::getItemAuxValueForTileData(i)), //
- L"sssczczg",
- L"###",
- L"#X#",
- L"###",
- L'#', new ItemInstance(Tile::glass),
- L'X', new ItemInstance(Item::dye_powder, 1, i), L'D');
- r->addShapedRecipy(new ItemInstance(Tile::stained_glass_pane, 16, i), //
- L"ssczg",
- L"###",
- L"###",
- L'#', new ItemInstance(Tile::stained_glass, 1, i), L'D');
-#endif
+//#if 0
+// r->addShapedRecipy(new ItemInstance(Tile::stained_glass, 8, ColoredTile::getItemAuxValueForTileData(i)), //
+// L"sssczczg",
+// L"###",
+// L"#X#",
+// L"###",
+// L'#', new ItemInstance(Tile::glass),
+// L'X', new ItemInstance(Item::dye_powder, 1, i), L'D');
+// r->addShapedRecipy(new ItemInstance(Tile::stained_glass_pane, 16, i), //
+// L"ssczg",
+// L"###",
+// L"###",
+// L'#', new ItemInstance(Tile::stained_glass, 1, i), L'D');
+//#endif
}
// some dye recipes
diff --git a/Minecraft.World/ItemInstance.cpp b/Minecraft.World/ItemInstance.cpp
index 4906c22e..e4af60c6 100644
--- a/Minecraft.World/ItemInstance.cpp
+++ b/Minecraft.World/ItemInstance.cpp
@@ -562,34 +562,27 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
title.italics = true;
}
- // 4J: This is for showing aux values, not useful in console version
- /*
if (advanced)
{
wstring suffix = L"";
- if (title.length() > 0)
+ if (title.text.length() > 0)
{
- title += L" (";
+ title.text += L" (";
suffix = L")";
}
+ wchar_t buf[64];
if (isStackedByData())
- {
- title += String.format("#%04d/%d%s", id, auxValue, suffix);
- }
+ swprintf_s(buf, 64, L"#%04d/%d%s", id, auxValue, suffix.c_str());
else
- {
- title += String.format("#%04d%s", id, suffix);
- }
+ swprintf_s(buf, 64, L"#%04d%s", id, suffix.c_str());
+ title.text += buf;
}
else if (!hasCustomHoverName() && id == Item::map_Id)
- */
-
- /*if (!hasCustomHoverName() && id == Item::map_Id)
{
title.text += L" #" + std::to_wstring(auxValue);
- }*/
+ }
lines->push_back(title);
@@ -615,7 +608,7 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
if (tag->contains(L"display"))
{
- //CompoundTag *display = tag->getCompound(L"display");
+ CompoundTag *display = tag->getCompound(L"display");
//if (display->contains(L"color"))
//{
@@ -631,8 +624,7 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
// }
//}
- // 4J: Lore isn't in use in game
- /*if (display->contains(L"Lore"))
+ if (display->contains(L"Lore"))
{
ListTag<StringTag> *lore = (ListTag<StringTag> *) display->getList(L"Lore");
if (lore->size() > 0)
@@ -643,7 +635,7 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
lines->push_back(lore->get(i)->data);
}
}
- }*/
+ }
}
}
@@ -674,7 +666,7 @@ vector<HtmlString> *ItemInstance::getHoverText(shared_ptr<Player> player, bool a
{
if (isDamaged())
{
- wstring damageStr = L"Durability: LOCALISE " + std::to_wstring((getMaxDamage()) - getDamageValue()) + L" / " + std::to_wstring(getMaxDamage());
+ wstring damageStr = L"Durability: " + std::to_wstring((getMaxDamage()) - getDamageValue()) + L" / " + std::to_wstring(getMaxDamage());
lines->push_back(HtmlString(damageStr));
}
}
diff --git a/Minecraft.World/PistonBaseTile.cpp b/Minecraft.World/PistonBaseTile.cpp
index e8e2a713..530cbf73 100644
--- a/Minecraft.World/PistonBaseTile.cpp
+++ b/Minecraft.World/PistonBaseTile.cpp
@@ -218,10 +218,12 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
if (extend && param1 == TRIGGER_CONTRACT)
{
level->setData(x, y, z, facing | EXTENDED_BIT, UPDATE_CLIENTS);
+ ignoreUpdate(false);
return false;
}
else if (!extend && param1 == TRIGGER_EXTEND)
{
+ ignoreUpdate(false);
return false;
}
}
@@ -247,6 +249,7 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
}
else
{
+ ignoreUpdate(false);
return false;
}
PIXEndNamedEvent();
diff --git a/Minecraft.World/Recipes.cpp b/Minecraft.World/Recipes.cpp
index 24faaebe..48a04e15 100644
--- a/Minecraft.World/Recipes.cpp
+++ b/Minecraft.World/Recipes.cpp
@@ -299,6 +299,7 @@ Recipes::Recipes()
pClothDyeRecipes->addRecipes(this);
+
addShapedRecipy(new ItemInstance(Tile::snow, 1), //
L"sscig",
L"##", //
diff --git a/Minecraft.World/StructureRecipies.cpp b/Minecraft.World/StructureRecipies.cpp
index 1706a7ce..652a730c 100644
--- a/Minecraft.World/StructureRecipies.cpp
+++ b/Minecraft.World/StructureRecipies.cpp
@@ -115,6 +115,28 @@ void StructureRecipies::addRecipes(Recipes *r)
L'#', Tile::glass,
L'D');
+
+
+
+
+// Stained Glass block + pane per color
+for (int i = 0; i < 16; i++)
+{
+ r->addShapedRecipy(new ItemInstance(Tile::stained_glass, 8, ColoredTile::getItemAuxValueForTileData(i)),
+ L"sssczczg",
+ L"###",
+ L"#X#",
+ L"###",
+ L'#', new ItemInstance(Tile::glass),
+ L'X', new ItemInstance(Item::dye_powder, 1, i),
+ L'D');
+ r->addShapedRecipy(new ItemInstance(Tile::stained_glass_pane, 16, ColoredTile::getItemAuxValueForTileData(i)),
+ L"ssczg",
+ L"###",
+ L"###",
+ L'#', new ItemInstance(Tile::stained_glass, 1, ColoredTile::getItemAuxValueForTileData(i)),
+ L'D');
+}
r->addShapedRecipy(new ItemInstance(Tile::netherBrick, 1), //
L"sscig",
diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp
index de113714..e80ac108 100644
--- a/Minecraft.World/Tile.cpp
+++ b/Minecraft.World/Tile.cpp
@@ -371,7 +371,12 @@ void Tile::staticCtor()
Tile::ironFence = (new ThinFenceTile(101, L"iron_bars", L"iron_bars", Material::metal, true)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_fence, Item::eMaterial_iron)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(SOUND_METAL)->setDescriptionId(IDS_TILE_IRON_FENCE)->setUseDescriptionId(IDS_DESC_IRON_FENCE);
- Tile::thinGlass = (new ThinFenceTile(102, L"glass", L"glass_pane_top", Material::glass, false)) ->setDestroyTime(0.3f)->setSoundType(SOUND_GLASS)->setDescriptionId(IDS_TILE_THIN_GLASS)->setUseDescriptionId(IDS_DESC_THIN_GLASS);
+ Tile::thinGlass = (new ThinFenceTile(102, L"glass", L"glass_pane_top", Material::glass, false))
+ ->setBaseItemTypeAndMaterial(Item::eBaseItemType_glass, Item::eMaterial_glass)
+ ->setDestroyTime(0.3f)
+ ->setSoundType(SOUND_GLASS)
+ ->setDescriptionId(IDS_TILE_THIN_GLASS)
+ ->setUseDescriptionId(IDS_DESC_THIN_GLASS);
Tile::melon = (new MelonTile(103)) ->setDestroyTime(1.0f)->setSoundType(SOUND_WOOD)->setIconName(L"melon")->setDescriptionId(IDS_TILE_MELON)->setUseDescriptionId(IDS_DESC_MELON_BLOCK);
Tile::pumpkinStem = (new StemTile(104, Tile::pumpkin)) ->setDestroyTime(0.0f)->setSoundType(SOUND_WOOD)->setIconName(L"pumpkin_stem")->setDescriptionId(IDS_TILE_PUMPKIN_STEM)->sendTileData();
Tile::melonStem = (new StemTile(105, Tile::melon)) ->setDestroyTime(0.0f)->setSoundType(SOUND_WOOD)->setIconName(L"melon_stem")->setDescriptionId(IDS_TILE_MELON_STEM)->sendTileData();