Skip to content

Commit

Permalink
Merge pull request #106 from mircokroon/downgrade-java
Browse files Browse the repository at this point in the history
Downgrade java version to 8
  • Loading branch information
mircokroon authored Feb 9, 2021
2 parents cb53316 + dcdd6e3 commit 21dd125
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build

on: [push, pull_request]
on: [pull_request]

jobs:
build:
Expand All @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '9.0.4'
java-version: '8'
- run: |
mvn assembly:assembly
test:
Expand All @@ -18,6 +18,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '9.0.4'
java-version: '8'
- run: |
mvn test
mvn test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A Minecraft world downloader that works by intercepting & decrypting network tra
<img src="https://i.imgur.com/nSM6mLw.png" width="50%" title="Example of the GUI showing previously downloaded chunks as white squares, chunks sent from the downloader to the client to extend the render distance in normal colours, and chunks sent by server directly to the client in red.">

### Requirements
- Java 9 or higher
- Java 8 or higher
- Minecraft version 1.12.2+ // 1.13.2+ // 1.14.1+ // 1.15.2+ // 1.16.2+

### Basic usage
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<java.version>9</java.version>
<java.version>8</java.version>
</properties>

<repositories>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/game/data/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import se.llbit.nbt.SpecificTag;
import se.llbit.nbt.StringTag;

import java.util.Arrays;
import java.util.List;

public abstract class Entity {
Expand Down Expand Up @@ -49,10 +50,10 @@ protected static Entity parseEntity(DataTypeProvider provider, Entity ent) {
public SpecificTag toNbt() {
CompoundTag root = new CompoundTag();

List<DoubleTag> pos = List.of(new DoubleTag(x), new DoubleTag(y), new DoubleTag(z));
List<DoubleTag> pos = Arrays.asList(new DoubleTag(x), new DoubleTag(y), new DoubleTag(z));
root.add("Pos", new ListTag(ListTag.TAG_DOUBLE, pos));

List<DoubleTag> motion = List.of(new DoubleTag(velX), new DoubleTag(velY), new DoubleTag(velZ));
List<DoubleTag> motion = Arrays.asList(new DoubleTag(velX), new DoubleTag(velY), new DoubleTag(velZ));
root.add("Motion", new ListTag(ListTag.TAG_DOUBLE, motion));

root.add("UUIDLeast", new LongTag(uuid.getLower()));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/game/data/entity/MobEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import se.llbit.nbt.FloatTag;
import se.llbit.nbt.ListTag;

import java.util.Arrays;
import java.util.List;

public class MobEntity extends Entity {
Expand All @@ -19,7 +20,7 @@ private MobEntity() { }

@Override
protected void addNbtData(CompoundTag root) {
List<FloatTag> pos = List.of(new FloatTag(pitch), new FloatTag(yaw));
List<FloatTag> pos = Arrays.asList(new FloatTag(pitch), new FloatTag(yaw));
root.add("Rotation", new ListTag(ListTag.TAG_FLOAT, pos));

metaData.addNbtTags(root);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/game/data/entity/ObjectEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import se.llbit.nbt.FloatTag;
import se.llbit.nbt.ListTag;

import java.util.Arrays;
import java.util.List;

public class ObjectEntity extends Entity {
Expand All @@ -16,7 +17,7 @@ private ObjectEntity() { }

@Override
protected void addNbtData(CompoundTag root) {
List<FloatTag> pos = List.of(new FloatTag(pitch), new FloatTag(yaw));
List<FloatTag> pos = Arrays.asList(new FloatTag(pitch), new FloatTag(yaw));
root.add("Rotation", new ListTag(ListTag.TAG_FLOAT, pos));
}

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/game/data/entity/metadata/MetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ public void parse(DataTypeProvider provider) {
Consumer<DataTypeProvider> indexHandler = getIndexHandler(index);
Consumer<DataTypeProvider> typeHandler = getTypeHandler(type);

if (indexHandler == null || typeHandler == null) { break; }
if (indexHandler == null && typeHandler == null) { break; }

Objects.requireNonNullElse(indexHandler, typeHandler).accept(provider);
if (indexHandler != null) {
indexHandler.accept(provider);
} else {
typeHandler.accept(provider);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import packets.lib.ByteQueue;
import se.llbit.nbt.*;

import java.util.Arrays;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -139,7 +140,7 @@ void nbtCompoundTest() {

@Test
void nbtListTest() {
ListTag before = new ListTag(Tag.TAG_STRING, List.of(
ListTag before = new ListTag(Tag.TAG_STRING, Arrays.asList(
new StringTag("a"),
new StringTag("b"),
new StringTag("c")
Expand Down

0 comments on commit 21dd125

Please sign in to comment.