Skip to content

Commit 424199d

Browse files
committed
Merge branch 'master' into release
2 parents aec1111 + c7fa31a commit 424199d

25 files changed

+3334
-3747
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ jobs:
3838
file: src/MiNET/MiNET.Console/minet.zip
3939
asset_name: MiNET.zip
4040
tag: ${{ github.ref }}
41-
release_name: MiNET-CobwebSMP 1.13.0.9 (1.20.70)
41+
release_name: MiNET-CobwebSMP 1.13.0.10 (1.20.80)
4242
body: ${{ github.event.head_commit.message }}

src/MiNET/MiNET/Blocks/BlockFactory.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,6 @@ public static Block GetBlockById(int blockId)
368368
187 => new AcaciaFenceGate(),
369369
188 => new RepeatingCommandBlock(),
370370
189 => new ChainCommandBlock(),
371-
190 => new HardGlassPane(),
372-
191 => new HardStainedGlassPane(),
373-
192 => new ChemicalHeat(),
374371
193 => new SpruceDoor(),
375372
194 => new BirchDoor(),
376373
195 => new JungleDoor(),
@@ -380,9 +377,7 @@ public static Block GetBlockById(int blockId)
380377
199 => new Frame(),
381378
200 => new ChorusFlower(),
382379
201 => new PurpurBlock(),
383-
202 => new ColoredTorchRg(),
384380
203 => new PurpurStairs(),
385-
204 => new ColoredTorchBp(),
386381
205 => new UndyedShulkerBox(),
387382
206 => new EndBricks(),
388383
207 => new FrostedIce(),
@@ -408,31 +403,24 @@ public static Block GetBlockById(int blockId)
408403
227 => new GrayGlazedTerracotta(),
409404
228 => new SilverGlazedTerracotta(),
410405
229 => new CyanGlazedTerracotta(),
411-
230 => new Chalkboard(),
412406
231 => new BlueGlazedTerracotta(),
413407
232 => new BrownGlazedTerracotta(),
414408
233 => new GreenGlazedTerracotta(),
415409
234 => new RedGlazedTerracotta(),
416410
235 => new BlackGlazedTerracotta(),
417411
236 => new Concrete(),
418412
237 => new ConcretePowder(),
419-
238 => new ChemistryTable(),
420-
239 => new UnderwaterTorch(),
421413
240 => new ChorusPlant(),
422414
241 => new StainedGlass(),
423-
242 => new Camera(),
424415
243 => new Podzol(),
425416
244 => new Beetroot(),
426417
245 => new Stonecutter(),
427418
246 => new Glowingobsidian(),
428419
247 => new Netherreactor(),
429420
248 => new InfoUpdate(),
430421
249 => new InfoUpdate2(),
431-
250 => new MovingBlock(),
432422
251 => new Observer(),
433423
252 => new StructureBlock(),
434-
253 => new HardGlass(),
435-
254 => new HardStainedGlass(),
436424
255 => new Reserved6(),
437425
257 => new PrismarineStairs(),
438426
258 => new DarkPrismarineStairs(),
@@ -522,17 +510,11 @@ public static Block GetBlockById(int blockId)
522510
462 => new SweetBerryBush(),
523511
463 => new Lantern(),
524512
464 => new Campfire(),
525-
466 => new Jigsaw(),
526513
467 => new Wood(),
527514
468 => new Composter(),
528515
469 => new LitBlastFurnace(),
529-
470 => new LightBlock(),
530516
471 => new WitherRose(),
531517
472 => new StickyPistonArmCollision(),
532-
473 => new BeeNest(),
533-
474 => new Beehive(),
534-
475 => new HoneyBlock(),
535-
476 => new HoneycombBlock(),
536518
541 => new Chain(),
537519
_ => new Block(blockId)
538520
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using MiNET.Utils.Vectors;
2+
using MiNET.Worlds;
3+
using System.Numerics;
4+
5+
namespace MiNET.Blocks
6+
{
7+
public partial class CarvedPumpkin : Block
8+
{
9+
public CarvedPumpkin() : base(410)
10+
{
11+
BlastResistance = 5;
12+
Hardness = 1;
13+
}
14+
15+
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
16+
{
17+
Direction = player.GetCardinalDirection();
18+
return false;
19+
}
20+
}
21+
}

src/MiNET/MiNET/Blocks/HayBlock.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
#endregion
2525

26+
using MiNET.Utils.Vectors;
27+
using System.Numerics;
28+
using MiNET.Worlds;
29+
using MiNET.Items;
30+
2631
namespace MiNET.Blocks
2732
{
2833
public partial class HayBlock : Block
@@ -33,5 +38,22 @@ public HayBlock() : base(170)
3338
Hardness = 0.5f;
3439
IsFlammable = true;
3540
}
41+
42+
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
43+
{
44+
switch (ItemBlock.GetPillarAxisFromFace(face))
45+
{
46+
case BlockAxis.X:
47+
PillarAxis = "x";
48+
break;
49+
case BlockAxis.Y:
50+
PillarAxis = "y";
51+
break;
52+
case BlockAxis.Z:
53+
PillarAxis = "z";
54+
break;
55+
}
56+
return false;
57+
}
3658
}
3759
}

src/MiNET/MiNET/Blocks/IronDoor.cs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,10 @@
2929

3030
namespace MiNET.Blocks
3131
{
32-
public partial class IronDoor : Block
32+
public partial class IronDoor : DoorBase
3333
{
3434
public IronDoor() : base(71)
3535
{
36-
IsTransparent = true;
37-
BlastResistance = 25;
38-
Hardness = 5;
39-
}
40-
41-
protected override bool CanPlace(Level world, Player player, BlockCoordinates blockCoordinates, BlockCoordinates targetCoordinates, BlockFace face)
42-
{
43-
return world.GetBlock(blockCoordinates).IsReplaceable && world.GetBlock(blockCoordinates + Level.Up).IsReplaceable;
44-
}
45-
46-
public override void BreakBlock(Level level, BlockFace face, bool silent = false)
47-
{
48-
// Remove door
49-
if (UpperBlockBit) // Is Upper?
50-
{
51-
level.SetAir(Coordinates + Level.Down);
52-
}
53-
else
54-
{
55-
level.SetAir(Coordinates + Level.Up);
56-
}
57-
58-
base.BreakBlock(level, face, silent);
59-
}
60-
61-
public override bool Interact(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoord)
62-
{
63-
return true;
6436
}
6537
}
6638
}

src/MiNET/MiNET/Blocks/IronTrapdoor.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,10 @@
3030

3131
namespace MiNET.Blocks
3232
{
33-
public partial class IronTrapdoor : Block
33+
public partial class IronTrapdoor : TrapdoorBase
3434
{
3535
public IronTrapdoor() : base(167)
3636
{
37-
IsTransparent = true;
38-
BlastResistance = 25;
39-
Hardness = 5;
40-
}
41-
42-
public override bool PlaceBlock(Level world, Player player, BlockCoordinates targetCoordinates, BlockFace face, Vector3 faceCoords)
43-
{
44-
UpsideDownBit = faceCoords.Y > 0.5 && face != BlockFace.Up || face == BlockFace.Down;
45-
46-
return false;
47-
}
48-
49-
public override bool Interact(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoord)
50-
{
51-
OpenBit = !OpenBit;
52-
world.SetBlock(this);
53-
54-
return true;
5537
}
5638
}
5739
}

src/MiNET/MiNET/Blocks/Log.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,44 @@ public Log() : base(17)
4141

4242
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
4343
{
44+
switch (ItemBlock.GetPillarAxisFromFace(face))
45+
{
46+
case BlockAxis.X:
47+
PillarAxis = "x";
48+
break;
49+
case BlockAxis.Y:
50+
PillarAxis = "y";
51+
break;
52+
case BlockAxis.Z:
53+
PillarAxis = "z";
54+
break;
55+
}
56+
return false;
57+
}
58+
59+
public override bool Interact(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoord)
60+
{
61+
var itemInHand = player.Inventory.GetItemInHand();
62+
63+
if (itemInHand is ItemAxe)
64+
{
65+
switch (OldLogType)
66+
{
67+
case "oak":
68+
world.SetBlock(new StrippedOakLog { Coordinates = Coordinates, PillarAxis = PillarAxis});
69+
break;
70+
case "spruce":
71+
world.SetBlock(new StrippedSpruceLog { Coordinates = Coordinates, PillarAxis = PillarAxis });
72+
break;
73+
case "birch":
74+
world.SetBlock(new StrippedBirchLog { Coordinates = Coordinates, PillarAxis = PillarAxis });
75+
break;
76+
case "jungle":
77+
world.SetBlock(new StrippedJungleLog { Coordinates = Coordinates, PillarAxis = PillarAxis });
78+
break;
79+
}
80+
return true;
81+
}
4482
return false;
4583
}
4684

src/MiNET/MiNET/Blocks/Log2.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,40 @@ public Log2() : base(162)
3939
IsFlammable = true;
4040
}
4141

42+
public override bool Interact(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoord)
43+
{
44+
var itemInHand = player.Inventory.GetItemInHand();
45+
46+
if (itemInHand is ItemAxe)
47+
{
48+
switch (NewLogType)
49+
{
50+
case "acacia":
51+
world.SetBlock(new StrippedAcaciaLog { Coordinates = Coordinates, PillarAxis = PillarAxis });
52+
break;
53+
case "dark_oak":
54+
world.SetBlock(new StrippedDarkOakLog { Coordinates = Coordinates, PillarAxis = PillarAxis });
55+
break;
56+
}
57+
return true;
58+
}
59+
return false;
60+
}
61+
4262
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
4363
{
64+
switch (ItemBlock.GetPillarAxisFromFace(face))
65+
{
66+
case BlockAxis.X:
67+
PillarAxis = "x";
68+
break;
69+
case BlockAxis.Y:
70+
PillarAxis = "y";
71+
break;
72+
case BlockAxis.Z:
73+
PillarAxis = "z";
74+
break;
75+
}
4476
return false;
4577
}
4678

src/MiNET/MiNET/Blocks/Observer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public Observer() : base(251)
4141

4242
public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
4343
{
44-
FacingDirection = ItemBlock.GetFacingDirectionFromEntity(player);
44+
FacingDirection = ItemBlock.GetReverseFacingDirectionFromEntity(player);
4545
return false;
4646
}
4747
}

0 commit comments

Comments
 (0)