Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new data #291

Open
wants to merge 10 commits into
base: revised-data
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: composer make-server

- name: Archive generated Phar file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: BetterAltay
path: BetterAltay.phar
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ memory_dumps/*
resource_packs/
server.lock
/phpstan.neon
start_dev.sh

# Common IDEs
.idea/*
Expand All @@ -40,6 +41,7 @@ Desktop.ini

# Composer
vendor/*
pm_composer.sh

# Travis files
test_data/*
Expand All @@ -54,3 +56,5 @@ Documentation/*
/.php_cs.cache
/.php-cs-fixer.cache

# Vscode
/.vscode
34 changes: 17 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@ public function handlePlayerAction(PlayerActionPacket $packet) : bool{
break;
case PlayerActionPacket::ACTION_CRACK_BREAK:
$block = $this->level->getBlock($pos);
$this->level->broadcastLevelEvent($pos, LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, $block->getRuntimeId() | ($packet->face << 24));
$this->level->broadcastLevelEvent($pos, LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, $block->getNetworkId() | ($packet->face << 24));
//TODO: destroy-progress level event
break;
case PlayerActionPacket::ACTION_START_SWIMMING:
Expand All @@ -3398,8 +3398,16 @@ public function handlePlayerAction(PlayerActionPacket $packet) : bool{
case PlayerActionPacket::ACTION_DIMENSION_CHANGE_ACK:
$this->sendPlayStatus(PlayStatusPacket::PLAYER_SPAWN);
break;
case PlayerActionPacket::ACTION_START_CRAWLING:
case PlayerActionPacket::ACTION_STOP_CRAWLING:
//TODO
break;
case PlayerActionPacket::ACTION_START_FLYING:
case PlayerActionPacket::ACTION_STOP_FLYING:
//TODO: ignored for now
break;
case PlayerActionPacket::ACTION_MISSED_SWING:
//ignored
break;
default:
$this->server->getLogger()->debug("Unhandled/unknown player action type " . $packet->action . " from " . $this->getName());
Expand Down
1 change: 0 additions & 1 deletion src/pocketmine/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
use pocketmine\network\mcpe\protocol\DataPacket;
use pocketmine\network\mcpe\protocol\PlayerListPacket;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\network\mcpe\protocol\types\LegacySkinAdapter;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\network\mcpe\protocol\types\SkinAdapterSingleton;
use pocketmine\network\mcpe\RakLibInterface;
Expand Down
6 changes: 3 additions & 3 deletions src/pocketmine/block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
use pocketmine\math\Vector3;
use pocketmine\metadata\Metadatable;
use pocketmine\metadata\MetadataValue;
use pocketmine\network\mcpe\convert\RuntimeBlockMapping;
use pocketmine\network\mcpe\convert\NetworkBlockMapping;
use pocketmine\Player;
use pocketmine\plugin\Plugin;
use function array_merge;
Expand Down Expand Up @@ -104,8 +104,8 @@ public function getItemId() : int{
/**
* @internal
*/
public function getRuntimeId() : int{
return RuntimeBlockMapping::toStaticRuntimeId($this->getId(), $this->getDamage());
public function getNetworkId() : int{
return NetworkBlockMapping::toStaticNetworkId($this->getId(), $this->getDamage());
}

final public function getDamage() : int{
Expand Down
19 changes: 0 additions & 19 deletions src/pocketmine/block/BlockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use InvalidArgumentException;
use pocketmine\item\Item;
use pocketmine\level\Position;
use pocketmine\network\mcpe\convert\RuntimeBlockMapping;
use RuntimeException;
use SplFixedArray;
use function min;
Expand Down Expand Up @@ -431,22 +430,4 @@ public static function isRegistered(int $id) : bool{
$b = self::$fullList[$id << 4];
return $b !== null and !($b instanceof UnknownBlock);
}

/**
* @internal
* @deprecated
*/
public static function toStaticRuntimeId(int $id, int $meta = 0) : int{
return RuntimeBlockMapping::toStaticRuntimeId($id, $meta);
}

/**
* @return int[] [id, meta]
* @internal
*
* @deprecated
*/
public static function fromStaticRuntimeId(int $runtimeId) : array{
return RuntimeBlockMapping::fromStaticRuntimeId($runtimeId);
}
}
2 changes: 1 addition & 1 deletion src/pocketmine/block/Cauldron.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private function updateLiquid() : void{
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->blockRuntimeId = $this->getRuntimeId();
$pk->blockNetworkId = $this->getNetworkId();
$pk->dataLayerId = UpdateBlockPacket::DATA_LAYER_LIQUID;
$pk->flags = UpdateBlockPacket::FLAG_ALL_PRIORITY;

Expand Down
Loading
Loading