Update to 1.16.2-pre1

This commit is contained in:
DoctorMacc 2020-07-29 21:05:18 -04:00
parent 43c062c23c
commit bf07f1a9ba
No known key found for this signature in database
GPG Key ID: 6D6E7E059F186DB4
4 changed files with 7 additions and 6 deletions

View File

@ -26,7 +26,7 @@
<dependency>
<groupId>us.myles</groupId>
<artifactId>viaversion</artifactId>
<version>3.0.1</version>
<version>3.1.0-1.16.2-pre1</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -33,7 +33,7 @@ import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.world.WorldManager;
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13;
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.data.MappingData;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.data.MappingData;
@AllArgsConstructor
public class GeyserSpigotWorldManager extends WorldManager {
@ -60,12 +60,13 @@ public class GeyserSpigotWorldManager extends WorldManager {
Block block = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getBlockAt(x, y, z);
// Black magic that gets the old block state ID
int oldBlockId = (block.getType().getId() << 4) | (block.getData() & 0xF);
// Convert block state from old version -> 1.13 -> 1.13.1 -> 1.14 -> 1.15 -> 1.16
// Convert block state from old version -> 1.13 -> 1.13.1 -> 1.14 -> 1.15 -> 1.16 -> 1.16.2
int thirteenBlockId = us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData.blockMappings.getNewId(oldBlockId);
int thirteenPointOneBlockId = Protocol1_13_1To1_13.getNewBlockStateId(thirteenBlockId);
int fourteenBlockId = us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData.blockStateMappings.getNewId(thirteenPointOneBlockId);
int fifteenBlockId = us.myles.ViaVersion.protocols.protocol1_15to1_14_4.data.MappingData.blockStateMappings.getNewId(fourteenBlockId);
return MappingData.blockStateMappings.getNewId(fifteenBlockId);
int sixteenBlockId = us.myles.ViaVersion.protocols.protocol1_16to1_15_2.data.MappingData.blockStateMappings.getNewId(fifteenBlockId);
return MappingData.blockStateMappings.getNewId(sixteenBlockId);
} else {
return BlockTranslator.AIR;
}

View File

@ -105,7 +105,7 @@
<dependency>
<groupId>com.github.GeyserMC</groupId>
<artifactId>MCProtocolLib</artifactId>
<version>da45dc9165</version>
<version>ba0c4e9ecd</version>
<scope>compile</scope>
<exclusions>
<exclusion>

@ -1 +1 @@
Subproject commit 536cde02e47416a341c6de4635a3e5a400d4b9a3
Subproject commit 46538b6036f02b3fe855ff75d82646ed74d46156