Compare commits

...

38 Commits

Author SHA1 Message Date
Mamadou Elaphi ARAFA e59183b0b3 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA cb1a1878be Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA 8c5f59fdb6 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA 975b6a2dc9 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 6240db0a8d fin3
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant ce63cd60e7 fin2
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 180af8196f fin
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA c5c3c0a905 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA 68468f2edf Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 06a8fdc268 moddernier
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant caa26269b9 supnav
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 089d1e147f Navmod
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA dfe09e5450 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA 50c5b174bf Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 2c8f7e210c last
continuous-integration/drone/push Build is failing Details
2 years ago
Mamadou Elaphi ARAFA 70ff4f2fd7 Mise à jour de 'README.md'
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant c66a7a11f1 ffds
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant cea86f4ab0 erer
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant ef9298e38d modreadme
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 0a9801aed6 fin de validation
continuous-integration/drone/push Build is failing Details
2 years ago
etudiant 61ec6f1498 validation
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 708da417fc Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 57b8f05862 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
etudiant 6a20490444 langue
continuous-integration/drone/push Build is passing Details
2 years ago
etudiant c5bf3c4eed modif22
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA a5888a90b1 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 7b793f55d1 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA f6d3817187 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 1fd8d3306c Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 94864ed3a6 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA e0951605d7 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 07c7df9274 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 13f61350dd Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA 1821158119 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA aa2ef5c2e5 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
Mamadou Elaphi ARAFA faeb9d9162 Mise à jour de 'README.md'
continuous-integration/drone/push Build is passing Details
2 years ago
etudiant 40915f179e Mise à jour des fichiers d'images
continuous-integration/drone/push Build is passing Details
2 years ago
etudiant 5306c7c3a5 modif3
continuous-integration/drone/push Build is passing Details
2 years ago

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -44,9 +44,6 @@ namespace Minecraft.Crafting.Api.Controllers
throw new Exception("Unable to get the items.");
}
// Simulate the Id
item.Id = data.Max(s => s.Id) + 1;
data.Add(item);
System.IO.File.WriteAllText("Data/items.json", JsonSerializer.Serialize(data, _jsonSerializerOptions));
@ -54,24 +51,6 @@ namespace Minecraft.Crafting.Api.Controllers
return Task.CompletedTask;
}
/// <summary>
/// Get all items.
/// </summary>
/// <returns>All items.</returns>
[HttpGet]
[Route("all")]
public Task<List<Item>> All()
{
var data = JsonSerializer.Deserialize<List<Item>>(System.IO.File.ReadAllText("Data/items.json"), _jsonSerializerOptions);
if (data == null)
{
throw new Exception("Unable to get the items.");
}
return Task.FromResult(data.ToList());
}
/// <summary>
/// Count the number of items.
/// </summary>
@ -146,34 +125,6 @@ namespace Minecraft.Crafting.Api.Controllers
return Task.FromResult(item);
}
/// <summary>
/// Gets the item by name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>
/// The item.
/// </returns>
[HttpGet]
[Route("by-name/{name}")]
public Task<Item> GetByName(string name)
{
var data = JsonSerializer.Deserialize<List<Item>>(System.IO.File.ReadAllText("Data/items.json"), _jsonSerializerOptions);
if (data == null)
{
throw new Exception("Unable to get the items.");
}
var item = data.FirstOrDefault(w => w.Name.ToLowerInvariant() == name.ToLowerInvariant());
if (item == null)
{
throw new Exception($"Unable to found the item with name: {name}");
}
return Task.FromResult(item);
}
/// <summary>
/// Gets the recipes.
/// </summary>
@ -239,15 +190,6 @@ namespace Minecraft.Crafting.Api.Controllers
var defaultImage = Convert.ToBase64String(System.IO.File.ReadAllBytes("Images/default.png"));
var imageTranslation = new Dictionary<string, string>
{
{ "stone_slab", "smooth_stone_slab_side" },
{ "sticky_piston", "piston_top_sticky" },
{ "mob_spawner", "spawner" },
{ "chest", "chest_minecart" },
{ "stone_stairs", "stairs" },
};
foreach (var item in data)
{
var imageFilepath = defaultImage;
@ -257,36 +199,6 @@ namespace Minecraft.Crafting.Api.Controllers
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/{item.Name}.png"));
}
if (imageFilepath == defaultImage && System.IO.File.Exists($"Images/{item.Name}_top.png"))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/{item.Name}_top.png"));
}
if (imageFilepath == defaultImage && System.IO.File.Exists($"Images/{item.Name}_front.png"))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/{item.Name}_front.png"));
}
if (imageFilepath == defaultImage && System.IO.File.Exists($"Images/white_{item.Name}.png"))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/white_{item.Name}.png"));
}
if (imageFilepath == defaultImage && System.IO.File.Exists($"Images/oak_{item.Name}.png"))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/oak_{item.Name}.png"));
}
if (imageFilepath == defaultImage && System.IO.File.Exists($"Images/{item.DisplayName.ToLower().Replace(" ", "_")}.png"))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/{item.DisplayName.ToLower().Replace(" ", "_")}.png"));
}
if (imageFilepath == defaultImage && imageTranslation.ContainsKey(item.Name))
{
imageFilepath = Convert.ToBase64String(System.IO.File.ReadAllBytes($"Images/{imageTranslation[item.Name]}.png"));
}
item.ImageBase64 = imageFilepath;
}
@ -341,7 +253,6 @@ namespace Minecraft.Crafting.Api.Controllers
itemOriginal.RepairWith = item.RepairWith;
itemOriginal.StackSize = item.StackSize;
itemOriginal.UpdatedDate = item.UpdatedDate;
itemOriginal.ImageBase64 = item.ImageBase64;
System.IO.File.WriteAllText("Data/items.json", JsonSerializer.Serialize(data, _jsonSerializerOptions));
@ -422,7 +333,7 @@ namespace Minecraft.Crafting.Api.Controllers
items.Add(new Recipe
{
Give = giveItem,
Give = new Item { DisplayName = giveItem.DisplayName, Name = giveItem.Name },
Have = new List<List<string>>
{
new()

@ -112,11 +112,11 @@ namespace Minecraft.Crafting.Api.Controllers
/// <summary>
/// Updates the inventory.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="infos">The infos about the item (name, position, number, stacksize).</param>
/// <returns>The async task.</returns>
[HttpPut]
[Route("")]
public Task UpdateInventory(InventoryModel item)
public Task UpdateInventory(string[] infos)
{
var data = JsonSerializer.Deserialize<List<InventoryModel>>(System.IO.File.ReadAllText("Data/inventory.json"), _jsonSerializerOptions);
@ -125,15 +125,10 @@ namespace Minecraft.Crafting.Api.Controllers
throw new Exception("Unable to get the inventory.");
}
var inventoryItem = data.FirstOrDefault(w => w.ItemName == item.ItemName && w.Position == item.Position);
if (inventoryItem == null)
{
throw new Exception($"Unable to found the item with name: {item.ItemName} at position: {item.Position}");
}
inventoryItem.ItemName = item.ItemName;
inventoryItem.Position = item.Position;
data.ToArray()[Int32.Parse(infos[1]) - 1].ItemName = infos[0];
data.ToArray()[Int32.Parse(infos[1]) - 1].Position = Int32.Parse(infos[1]);
data.ToArray()[Int32.Parse(infos[1]) - 1].Number = Int32.Parse(infos[2]);
data.ToArray()[Int32.Parse(infos[1]) - 1].StackSize = Int32.Parse(infos[3]);
System.IO.File.WriteAllText("Data/inventory.json", JsonSerializer.Serialize(data, _jsonSerializerOptions));

File diff suppressed because it is too large Load Diff

@ -0,0 +1,82 @@
[
{
"itemName": "Grass Block",
"position": 1,
"number": 1,
"stackSize": 64
},
{
"itemName": "Sapling",
"position": 2,
"number": 1,
"stackSize": 64
},
{
"itemName": "Sand",
"position": 3,
"number": 1,
"stackSize": 64
},
{
"itemName": "null",
"position": 4
},
{
"itemName": "null",
"position": 5
},
{
"itemName": "null",
"position": 6
},
{
"itemName": "null",
"position": 7
},
{
"itemName": "null",
"position": 8
},
{
"itemName": "null",
"position": 9
},
{
"itemName": "Bedrock",
"position": 10,
"number": 1,
"stackSize": 64
},
{
"itemName": "null",
"position": 11
},
{
"itemName": "null",
"position": 12
},
{
"itemName": "null",
"position": 13
},
{
"itemName": "null",
"position": 14
},
{
"itemName": "null",
"position": 15
},
{
"itemName": "null",
"position": 16
},
{
"itemName": "null",
"position": 17
},
{
"itemName": "null",
"position": 18
}
]

@ -122,7 +122,7 @@
{
"id": 25,
"displayName": "Note Block",
"name": "note_block",
"name": "noteblock",
"stackSize": 64
},
{

File diff suppressed because one or more lines are too long

@ -1,3 +1,5 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
@ -5,9 +7,9 @@ EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj", "Minecraft.Crafting.Api/"]
COPY ["Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj", "Minecraft.Crafting.Api/"]
RUN dotnet restore "Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj"
COPY src/. .
COPY . .
WORKDIR "/src/Minecraft.Crafting.Api"
RUN dotnet build "Minecraft.Crafting.Api.csproj" -c Release -o /app/build

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save