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

Pallet error, UpdateBlockPacket not working #1052

Open
wants to merge 128 commits into
base: patch/items1.16_with_support_old_versions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
805c5ae
invenory problem
dexdurable Aug 31, 2020
e3c329d
check equals
dexdurable Aug 31, 2020
a1b3dd7
enebled compaction
dexdurable Sep 1, 2020
2a6841d
clean code
dexdurable Sep 1, 2020
2b29a10
task for inventory transactions
dexdurable Sep 2, 2020
7004c03
Revert "check equals"
dexdurable Sep 22, 2020
1e744eb
Revert "invenory problem"
dexdurable Sep 22, 2020
a1b6d42
Revert "task for inventory transactions"
dexdurable Sep 22, 2020
99e6618
no send slot to holder
dexdurable Sep 22, 2020
499b76d
solution for problem with quick craft
dexdurable Sep 28, 2020
c0cc3ad
change number to const
dexdurable Sep 29, 2020
14ccfc7
Merge pull request #981 from Hydreon/no_send_slot_to_holder
vchibikov Sep 29, 2020
b147764
fix slot send problem
dexdurable Sep 30, 2020
60bf081
Merge pull request #988 from Hydreon/protocol_409
vchibikov Nov 11, 2020
f331f2b
Merge pull request #989 from Hydreon/no_send_slot_to_holder
vchibikov Nov 11, 2020
94e8950
Merge pull request #991 from Hydreon/protocol_409
vchibikov Nov 12, 2020
5819423
Merge pull request #993 from Hydreon/protocol_409
vchibikov Nov 17, 2020
8c028c1
Merge pull request #996 from Hydreon/protocol_409
vchibikov Nov 17, 2020
c8fbcf1
protocol 422 start
dexdurable Nov 30, 2020
70f7de1
ItemStackResponsePacket
dexdurable Dec 1, 2020
97a0c51
changes from proxy branch
dexdurable Dec 2, 2020
bf57873
fix use problem
dexdurable Dec 2, 2020
e60eb17
Merge branch 'master' into protocol_422
dexdurable Dec 2, 2020
8383d35
revert recipes
dexdurable Dec 4, 2020
ba81b92
Merge branch 'master' into protocol_422
dexdurable Dec 4, 2020
92d5db1
no crash inventory
dexdurable Dec 4, 2020
2059ae0
temporally solution in CreativeContentPacket
dexdurable Dec 7, 2020
56f474b
Merge pull request #1003 from Hydreon/protocol_422
vchibikov Dec 7, 2020
9255fb7
creative content packet
dexdurable Dec 8, 2020
1a74089
423 start
dexdurable Dec 8, 2020
e18e8b7
Fixing entity unique IDs encoding mess
dktapps Dec 8, 2020
047cd31
Merge pull request #1004 from dktapps/entity-ids-fix
dishrex Dec 9, 2020
3584486
ResourcePacksInfoPacket
dexdurable Dec 9, 2020
9661ebf
Merge branch 'master' of https://github.com/Hydreon/Steadfast2
dexdurable Dec 9, 2020
836d07f
Merge pull request #1005 from Hydreon/protocol_423
vchibikov Dec 9, 2020
a547bae
add const RECORD_MELLOHI
dexdurable Dec 14, 2020
beaf79c
add const FIRE_CHARGE
dexdurable Dec 14, 2020
6a2508d
start buckets
dexdurable Jan 10, 2021
6b68b8c
solution for water bucket and lava bucket
dexdurable Jan 11, 2021
8bbeef5
Merge pull request #1009 from Hydreon/bucketsProblem
vchibikov Jan 11, 2021
6f2ecf0
add still water and still lava
dexdurable Jan 11, 2021
33fdc8a
delete test code
dexdurable Jan 11, 2021
efc3604
Merge pull request #1011 from Hydreon/bucketsProblem
vchibikov Jan 12, 2021
a415e3c
start 428
dexdurable Feb 18, 2021
c92f607
movements settings
dexdurable Feb 20, 2021
1163891
add fabid
dexdurable Feb 24, 2021
9d77650
support old version
dexdurable Mar 2, 2021
88d8cff
refactoring StartGamePacket
dexdurable Mar 2, 2021
7963666
new pallet
dexdurable Mar 2, 2021
549e648
remove pallet
dexdurable Mar 5, 2021
3d20354
Merge pull request #1014 from Hydreon/protocol_428
vchibikov Mar 5, 2021
bbb6193
pallet 428
dexdurable Mar 9, 2021
33db61b
platFabId
dexdurable Mar 9, 2021
2f1e2b2
Merge pull request #1016 from Hydreon/protocol_428
vchibikov Mar 9, 2021
370468e
playFabId changes
dexdurable Mar 10, 2021
e09a4c3
Revert "playFabId changes"
dexdurable Mar 22, 2021
feb308d
some changes in BinaryStream
dexdurable Mar 22, 2021
49c16d5
refactor Start game packet
dexdurable Mar 22, 2021
5293c1d
Merge branch 'protocol_428'
dexdurable Mar 22, 2021
4e5d61c
disable persona
dexdurable Mar 24, 2021
a31dd13
start 431
dexdurable Mar 29, 2021
0ddd307
refactoring CreativeContentPacket
dexdurable Apr 6, 2021
844f2be
getSlot or putSlot
dexdurable Apr 6, 2021
a6bb54c
inventory transaction packet
dexdurable Apr 6, 2021
33bafa7
some changes in BinaryStream
dexdurable Apr 7, 2021
444b101
progress
dexdurable Apr 8, 2021
9351a8f
new data CreativeContentPacket.php
dexdurable Apr 8, 2021
8d07828
Fixed curly braces deprecation warnings on PHP 7.4
dktapps Apr 8, 2021
7125d6c
Merge branch 'master' into protocol_431
dktapps Apr 8, 2021
ef6f26d
fix some encoding issues
dktapps Apr 8, 2021
f18d4b2
Spawn working on 1.16.220
dktapps Apr 9, 2021
818825b
wtf is this
dktapps Apr 9, 2021
30d4328
fixing itemstack asserts
dktapps Apr 9, 2021
843989c
log exception traces
dktapps Apr 9, 2021
c12d545
bail on unknown protocol in switches
dktapps Apr 9, 2021
fb62c1f
Merge pull request #1021 from Hydreon/protocol_431
vchibikov Apr 9, 2021
607f6d2
fix decoding network item NBT
dktapps Apr 9, 2021
bea9588
assume protocol 419 as baseline
dktapps Apr 9, 2021
1a05745
fixed undefined variable
dktapps Apr 9, 2021
2ec9960
log stack traces .......
dktapps Apr 9, 2021
bee9bba
fix item NBT encoding on .220
dktapps Apr 9, 2021
7c24c20
chunk: assume generated if TerrainGenerated tag is not present
dktapps Apr 11, 2021
49c9d2e
added a hack for 220 blockitem meta similar to PM
dktapps Apr 12, 2021
6f80f5f
start protocol_440
dexdurable May 20, 2021
113bd7e
Merge pull request #1031 from Hydreon/protocol_440
vchibikov May 21, 2021
69a97db
Game rules
dexdurable Jun 2, 2021
c3a847c
add pallete
dexdurable Jun 2, 2021
ea48d7c
Merge pull request #1034 from Hydreon/protocol_440
vchibikov Jun 2, 2021
2cfa90a
change items
dexdurable Jun 8, 2021
7119215
change items ids
dexdurable Jun 9, 2021
ce7ff2b
Merge pull request #1037 from Hydreon/protocol_440
vchibikov Jun 9, 2021
2e64a3e
First shot at scrubbing older versions (#1027)
dktapps Jun 9, 2021
31ca4a8
protocol 448 start
dexdurable Jun 30, 2021
6d9d3a5
change some packets
dexdurable Jul 1, 2021
08d72ab
AvailableCommandsPacket
dexdurable Jul 1, 2021
f825d9f
some fix
dexdurable Jul 1, 2021
cbe7a98
AvailableCommandsPacket adaptation
dexdurable Jul 2, 2021
bc30d68
delete comment
dexdurable Jul 5, 2021
ea0e3ab
Merge pull request #1041 from Hydreon/protocol_448
vchibikov Jul 5, 2021
6c5094b
new pallete
dexdurable Jul 5, 2021
36c3388
Merge pull request #1045 from Hydreon/protocol_448
vchibikov Jul 5, 2021
718c6b2
bug with buckets
dexdurable Jul 8, 2021
8a0f27c
1.17.30 support
dktapps Sep 21, 2021
9859bde
Drop homegrown random bytes impl
dktapps Sep 21, 2021
107303e
RakLibServer: fixed crash on PHP 8.0
dktapps Oct 18, 2021
d17e1bb
1.17.40 support
dktapps Oct 18, 2021
b2c44bb
fix /give crash when asking for an item by name that doesn't have a d…
dktapps Oct 18, 2021
e2552d5
Fixed inconsistent chunk encoding (and writing bogus heightmap for mc…
dktapps Nov 29, 2021
e40cc1d
Support for 1.18.0
dktapps Nov 29, 2021
7a353f5
Bare minimum for 1.18.10
dktapps Jan 27, 2022
aea8516
Update README.md
dktapps Feb 6, 2022
bd84310
Support for 1.18.30
dktapps Apr 15, 2022
9fac03c
Added new palette for 1.18.30
dktapps Apr 20, 2022
39695e5
Very broken spawn of 1.19.0
dktapps May 30, 2022
756f8aa
Accept connections from 1.19.0 release
dktapps Jul 7, 2022
322a31c
Protocol changes for 1.19.10
dktapps Jul 7, 2022
0dab64b
1.19.20
dktapps Aug 9, 2022
80ca862
Duct tape to make it run on PHP 8.1
dktapps Aug 25, 2022
9499502
Fixed stack trace collecting when xdebug is enabled, but not in devel…
dktapps Aug 25, 2022
29385b7
Fixed terrain not loading on 8.1
dktapps Aug 25, 2022
3767760
Accept 1.19.21
dktapps Aug 25, 2022
706299a
Awful hacks to support 1.19.30
dktapps Sep 19, 2022
7a9262a
...
dktapps Sep 20, 2022
d81743a
1.19.40 support
dktapps Oct 25, 2022
e9daa6d
Player: fix debug spam on PHP 8.1
dktapps Nov 29, 2022
212c996
1.19.50
dktapps Nov 29, 2022
598288d
1.19.60
dktapps Feb 7, 2023
290fe9d
Update README.md
dktapps Mar 9, 2023
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# <img src="https://lbsg.net/wp-content/themes/lifeboat/images/lbsg-logo-sm.png" alt="LBSG logo" title="Aimeos" align="center" height="120" />
# DEPRECATED

**Steadfast2 is no longer supported as of Minecraft: Bedrock Edition 1.19.70 and will receive no further updates.**

Lifeboat Survival Games has now migrated to [PocketMine-MP](https://github.com/pmmp/PocketMine-MP).

# Steadfast2 Minecraft PE Server Software

## Introduction
Expand Down
1 change: 1 addition & 0 deletions src/pocketmine/ChunkMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function sendData($identifier, $buffer) {
$pk = new EncapsulatedPacket();
$pk->buffer = $buffer;
$pk->reliability = 3;
$pk->orderChannel = 0;
$enBuffer = chr(RakLib::PACKET_ENCAPSULATED) . chr(strlen($identifier)) . $identifier . chr(RakLib::PRIORITY_NORMAL) . $pk->toBinary(true);
$this->raklib->pushMainToThreadPacket($enBuffer);
}
Expand Down
58 changes: 43 additions & 15 deletions src/pocketmine/ChunkStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

namespace pocketmine;

use pocketmine\utils\Binary;
use pocketmine\level\generator\biome\Biome;
use pocketmine\level\Level;
use pocketmine\network\protocol\FullChunkDataPacket;
use pocketmine\network\protocol\Info;
use pocketmine\level\Level;
use pocketmine\utils\Binary;
use function chr;
use function count;
use function implode;

class ChunkStorage {

protected $cache = [];
/** @var ChunkMaker */
protected $server;

/**
* @param ChunkMaker $server
*/
public function __construct($server) {
$this->server = $server;
$this->tickProcessor();
Expand Down Expand Up @@ -56,8 +64,21 @@ protected function sendFromCache($data) {

protected function doChunk($data) {
$protocol = $data['protocol'];
if (isset($data['isAnvil']) && $data['isAnvil'] == true) {
$chunkData = chr(count($data['chunk']['sections']));
$isAnvil = isset($data['isAnvil']) && $data['isAnvil'] == true;

$subChunkCount = $isAnvil ? count($data['chunk']['sections']) : 8;

$chunkData = "";

if($protocol >= Info::PROTOCOL_475){
//TODO: HACK! fill in fake subchunks to make up for the new negative space client-side
for($y = 0; $y < 4; $y++){
$subChunkCount++;
$chunkData .= chr(8); //subchunk version 8
$chunkData .= chr(0); //0 layers - client will treat this as all-air
}
}
if ($isAnvil) {
foreach ($data['chunk']['sections'] as $y => $sections) {
if ($sections['empty'] == true) {
$blockData = "\x00" . str_repeat("\x00", 6144);
Expand All @@ -71,15 +92,11 @@ protected function doChunk($data) {
$chunkData .= $blockData;
}
}
if ($protocol < Info::PROTOCOL_360) {
$chunkData .= $data['chunk']['heightMap'];
}
$chunkData .= $data['chunk']['biomeColor'] . Binary::writeByte(0) . Binary::writeSignedVarInt(0) . implode('', $data['tiles']);
$biomes = $data["chunk"]["biomeColor"];
} else {
$blockIdArray = $data['blocks'];
$blockDataArray = $data['data'];
$countBlocksInChunk = 8;
$chunkData = chr($countBlocksInChunk);
for ($blockIndex = 0; $blockIndex < $countBlocksInChunk; $blockIndex++) {
$blockIdData = '';
$blockDataData = '';
Expand All @@ -91,13 +108,24 @@ protected function doChunk($data) {
$blockData = "\x00" . $blockIdData . $blockDataData;
$chunkData .= $blockData;
}
$chunkData .= $data['heightMap'] . $data['biomeColor'] . Binary::writeLInt(0) . implode('', $data['tiles']);
$biomes = $data["biomeColor"];
}
if($protocol >= Info::PROTOCOL_475){
$count = $protocol >= Info::PROTOCOL_503 ? 24 : 25;
for($i = 0; $i < $count; ++$i){
$chunkData .= chr(0); //fake biome palette - 0 bpb, non-persistent
$chunkData .= Binary::writeVarInt(Biome::PLAINS << 1); //fill plains for now
}
}else{
$chunkData .= $biomes;
}
$chunkData .= Binary::writeByte(0) . implode('', $data['tiles']);
$subClientId = $data['subClientId'];
$pk = new FullChunkDataPacket();
$pk->chunkX = $data['chunkX'];
$pk->chunkZ = $data['chunkZ'];
$pk->senderSubClientID = $subClientId;
$pk->subChunkCount = $subChunkCount;
$pk->data = $chunkData;
$pk->encode($protocol);
$buffer = $pk->getBuffer();
Expand All @@ -120,7 +148,7 @@ private function sortData($data) {
for ($z = $x; $z < $zM; $z += 16) {
$yM = $z + 4096;
for ($y = $z; $y < $yM; $y += 256) {
$result{$i} = $data{$y};
$result[$i] = $data[$y];
++$i;
}
}
Expand All @@ -139,10 +167,10 @@ private function sortHalfData($data) {
for ($y = 0; $y < 8; ++$y) {
$j = (($y << 8) | $zx);
$j80 = ($j | 0x80);
$i1 = ord($data{$j});
$i2 = ord($data{$j80});
$result{$i} = chr(($i2 << 4) | ($i1 & 0x0f));
$result{$i | 0x80} = chr(($i1 >> 4) | ($i2 & 0xf0));
$i1 = ord($data[$j]);
$i2 = ord($data[$j80]);
$result[$i] = chr(($i2 << 4) | ($i1 & 0x0f));
$result[$i | 0x80] = chr(($i1 >> 4) | ($i2 & 0xf0));
$i++;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/pocketmine/PacketMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ protected function sendData($identifier, $buffer) {
$pk = new EncapsulatedPacket();
$pk->buffer = $buffer;
$pk->reliability = 3;
$pk->orderChannel = 0;
$enBuffer = chr(RakLib::PACKET_ENCAPSULATED) . chr(strlen($identifier)) . $identifier . chr(RakLib::PRIORITY_NORMAL) . $pk->toBinary(true);
$this->raklib->pushMainToThreadPacket($enBuffer);
}
Expand Down
Loading