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

1.17.30 #1899

Merged
merged 3 commits into from
Sep 22, 2021
Merged

1.17.30 #1899

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
18 changes: 18 additions & 0 deletions src/main/java/cn/nukkit/entity/data/Skin.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public class Skin {
private boolean premium;
private boolean persona;
private boolean capeOnClassic;
private boolean primaryUser = true;
private String capeId;
private String skinColor = "#0";
private String armSize = "wide";
private boolean trusted = false;
private String geometryDataEngineVersion = "";

public boolean isValid() {
return isValidSkin() && isValidResourcePatch();
Expand Down Expand Up @@ -235,6 +237,22 @@ public void setCapeOnClassic(boolean capeOnClassic) {
this.capeOnClassic = capeOnClassic;
}

public void setPrimaryUser(boolean primaryUser) {
this.primaryUser = primaryUser;
}

public boolean isPrimaryUser() {
return primaryUser;
}

public void setGeometryDataEngineVersion(String geometryDataEngineVersion) {
this.geometryDataEngineVersion = geometryDataEngineVersion;
}

public String getGeometryDataEngineVersion() {
return geometryDataEngineVersion;
}

public boolean isTrusted() {
return trusted;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public void encode() {
this.putVarInt(recipe.getResult().getNetworkId());
}

this.putUnsignedVarInt(0); // Material reducers size

this.putBoolean(cleanRecipes);
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/cn/nukkit/network/protocol/HurtArmorPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class HurtArmorPacket extends DataPacket {

public int cause;
public int damage;
public long armorSlots;

@Override
public void decode() {
Expand All @@ -23,6 +24,7 @@ public void encode() {
this.reset();
this.putVarInt(this.cause);
this.putVarInt(this.damage);
this.putUnsignedVarLong(this.armorSlots);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/cn/nukkit/network/protocol/ProtocolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public interface ProtocolInfo {
* Actual Minecraft: PE protocol version
*/
@SuppressWarnings("UnnecessaryBoxing")
int CURRENT_PROTOCOL = Integer.valueOf("448"); // DO NOT REMOVE BOXING
int CURRENT_PROTOCOL = Integer.valueOf("465"); // DO NOT REMOVE BOXING

List<Integer> SUPPORTED_PROTOCOLS = Ints.asList(CURRENT_PROTOCOL);

String MINECRAFT_VERSION = "v1.17.10";
String MINECRAFT_VERSION_NETWORK = "1.17.10";
String MINECRAFT_VERSION = "v1.17.30";
String MINECRAFT_VERSION_NETWORK = "1.17.30";

byte LOGIN_PACKET = 0x01;
byte PLAY_STATUS_PACKET = 0x02;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/cn/nukkit/network/protocol/StartGamePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public void encode() {
this.putLInt(16); // Limited world width
this.putLInt(16); // Limited world height
this.putBoolean(false); // Nether type
this.putString(""); // EduSharedUriResource buttonName
this.putString(""); // EduSharedUriResource linkUri
this.putBoolean(false); // Experimental Gameplay

this.putString(this.levelId);
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/cn/nukkit/utils/BinaryStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,8 @@ public void putSkin(Skin skin) {

this.putImage(skin.getCapeData());
this.putString(skin.getGeometryData());
this.putString(skin.getGeometryDataEngineVersion());
this.putString(skin.getAnimationData());
this.putBoolean(skin.isPremium());
this.putBoolean(skin.isPersona());
this.putBoolean(skin.isCapeOnClassic());
this.putString(skin.getCapeId());
this.putString(skin.getFullSkinId());
this.putString(skin.getArmSize());
Expand All @@ -310,6 +308,11 @@ public void putSkin(Skin skin) {
this.putString(color);
}
}

this.putBoolean(skin.isPremium());
this.putBoolean(skin.isPersona());
this.putBoolean(skin.isCapeOnClassic());
this.putBoolean(skin.isPrimaryUser());
}

public Skin getSkin() {
Expand All @@ -330,10 +333,8 @@ public Skin getSkin() {

skin.setCapeData(this.getImage());
skin.setGeometryData(this.getString());
skin.setGeometryDataEngineVersion(this.getString());
skin.setAnimationData(this.getString());
skin.setPremium(this.getBoolean());
skin.setPersona(this.getBoolean());
skin.setCapeOnClassic(this.getBoolean());
skin.setCapeId(this.getString());
this.getString(); // TODO: Full skin id
skin.setArmSize(this.getString());
Expand All @@ -359,6 +360,11 @@ public Skin getSkin() {
}
skin.getTintColors().add(new PersonaPieceTint(pieceType, colors));
}

skin.setPremium(this.getBoolean());
skin.setPersona(this.getBoolean());
skin.setCapeOnClassic(this.getBoolean());
skin.setPrimaryUser(this.getBoolean());
return skin;
}

Expand Down
Loading