forked from CustomiesDevs/Customies
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into pm5
# Conflicts: # src/item/component/IconComponent.php
- Loading branch information
Showing
5 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace customiesdevs\customies\item\component; | ||
|
||
final class AttackDamageComponent implements ItemComponent { | ||
|
||
private int $damage; | ||
|
||
public function __construct(int $damage) { | ||
$this->damage = $damage; | ||
} | ||
|
||
public function getName(): string { | ||
return "damage"; | ||
} | ||
|
||
public function getValue(): int { | ||
return $this->damage; | ||
} | ||
|
||
public function isProperty(): bool { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace customiesdevs\customies\item\component; | ||
|
||
final class RarityComponent implements ItemComponent { | ||
|
||
public const COMMON = "common"; | ||
public const UNCOMMON = "uncommon"; | ||
public const RARE = "rare"; | ||
public const EPIC = "epic"; | ||
|
||
private string $rarity; | ||
|
||
public function __construct(string $rarity) { | ||
$this->rarity = $rarity; | ||
} | ||
|
||
public function getName(): string { | ||
return "minecraft:rarity"; | ||
} | ||
|
||
public function getValue(): array { | ||
return [ | ||
"value" => $this->rarity | ||
]; | ||
} | ||
|
||
public function isProperty(): bool { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace customiesdevs\customies\item\component; | ||
|
||
final class UseModifiersComponent implements ItemComponent { | ||
|
||
public function __construct(private float $movementModifier, private float $useDuration) {} | ||
|
||
public function getName(): string { | ||
return "minecraft:use_modifiers"; | ||
} | ||
|
||
public function getValue(): array { | ||
return [ | ||
"movement_modifier" => $this->movementModifier, | ||
"use_duration" => $this->useDuration | ||
]; | ||
} | ||
|
||
public function isProperty(): bool { | ||
return false; | ||
} | ||
} |