Skip to content

Commit

Permalink
1.20.70
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 committed Mar 11, 2024
1 parent 0cff906 commit affe5d7
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 46,669 deletions.
1 change: 1 addition & 0 deletions src/main/java/cn/nukkit/block/BlockID.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public interface BlockID {
int AIR = 0;
int STONE = 1;
int GRASS = 2;
int GRASS_BLOCK = 2;
int DIRT = 3;
int COBBLESTONE = 4;
int COBBLE = 4;
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/cn/nukkit/command/defaults/ClearCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import cn.nukkit.Server;
import cn.nukkit.command.Command;
import cn.nukkit.command.CommandSender;
import cn.nukkit.command.data.CommandEnum;
import cn.nukkit.command.data.CommandParamType;
import cn.nukkit.command.data.CommandParameter;
import cn.nukkit.item.Item;
import cn.nukkit.lang.TranslationContainer;
import cn.nukkit.utils.TextFormat;

Expand Down Expand Up @@ -35,17 +33,11 @@ public boolean execute(CommandSender sender, String commandLabel, String[] args)
return false;
}

if (args.length > 1 || (!(sender instanceof Player) && args.length < 1)) {
if (args.length != 1) {
sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
return false;
}

if (args.length == 0) {
Player player = (Player) sender;
player.getInventory().clearAll();
return false;
}

List<Player> targets = new ArrayList<>();
if (args[0].equals("@a")) {
targets.addAll(Server.getInstance().getOnlinePlayers().values());
Expand Down
1 change: 0 additions & 1 deletion src/main/java/cn/nukkit/command/defaults/GiveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import cn.nukkit.utils.TextFormat;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class LecternUpdatePacket extends DataPacket {
public int page;
public int totalPages;
public BlockVector3 blockPosition;
public boolean dropBook;

@Override
public byte pid() {
Expand All @@ -23,7 +22,6 @@ public void decode() {
this.page = this.getByte();
this.totalPages = this.getByte();
this.blockPosition = this.getBlockVector3();
this.dropBook = this.getBoolean();
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/cn/nukkit/network/protocol/MobEffectPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public byte pid() {
public int amplifier = 0;
public boolean particles = true;
public int duration = 0;
public long tick;

@Override
public void decode() {
Expand All @@ -41,5 +42,6 @@ public void encode() {
this.putVarInt(this.amplifier);
this.putBoolean(this.particles);
this.putVarInt(this.duration);
this.putLLong(this.tick);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.nukkit.network.protocol;

import cn.nukkit.math.Vector2;
import cn.nukkit.math.Vector2f;
import cn.nukkit.math.Vector3f;
import cn.nukkit.network.protocol.types.*;
import lombok.Getter;
Expand Down Expand Up @@ -32,6 +33,7 @@ public class PlayerAuthInputPacket extends DataPacket {
private Map<PlayerActionType, PlayerBlockActionData> blockActionData = new EnumMap<>(PlayerActionType.class);
private Vector2 analogMoveVector;
private long predictedVehicle;
private Vector2f vehicleRotation;

@Override
public byte pid() {
Expand Down Expand Up @@ -88,6 +90,7 @@ public void decode() {
}

if (this.inputData.contains(AuthInputAction.IN_CLIENT_PREDICTED_IN_VEHICLE)) {
this.vehicleRotation = new Vector2f(this.getLFloat(), this.getLFloat());
this.predictedVehicle = this.getVarLong();
}

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

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

String MINECRAFT_VERSION_NETWORK = "1.20.60";
String MINECRAFT_VERSION_NETWORK = "1.20.70";
String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;

byte BATCH_PACKET = (byte) 0xff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ResourcePackClientResponsePacket extends DataPacket {
@Override
public void decode() {
this.responseStatus = (byte) this.getByte();
this.packEntries = new Entry[this.getLShort()];
this.packEntries = new Entry[Math.min(this.getLShort(), 1024)];
for (int i = 0; i < this.packEntries.length; i++) {
String[] entry = this.getString().split("_");
this.packEntries[i] = new Entry(UUID.fromString(entry[0]), entry[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ResourcePacksInfoPacket extends DataPacket {
public boolean mustAccept;
public boolean scripting;
public boolean forceServerPacks;
public boolean hasAddonPacks;
public ResourcePack[] behaviourPackEntries = new ResourcePack[0];
public ResourcePack[] resourcePackEntries = new ResourcePack[0];
public List<CDNEntry> CDNEntries = new ObjectArrayList<>();
Expand All @@ -28,6 +29,7 @@ public void decode() {
public void encode() {
this.reset();
this.putBoolean(this.mustAccept);
this.putBoolean(this.hasAddonPacks);
this.putBoolean(this.scripting);
this.putBoolean(this.forceServerPacks);
this.encodeBehaviourPacks(this.behaviourPackEntries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class SetEntityMotionPacket extends DataPacket {
public float motionX;
public float motionY;
public float motionZ;
public long tick;

@Override
public byte pid() {
Expand All @@ -30,5 +31,6 @@ public void encode() {
this.reset();
this.putEntityRuntimeId(this.eid);
this.putVector3f(this.motionX, this.motionY, this.motionZ);
this.putUnsignedVarLong(this.tick);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/creative_items.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/item_mappings.json

Large diffs are not rendered by default.

Loading

0 comments on commit affe5d7

Please sign in to comment.