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

Port to 1.19 #3

Open
wants to merge 2 commits into
base: 1.17
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -79,6 +79,8 @@ publishing {

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Temporary response
/*
maven {
url "https://maven.cafeteria.dev/releases"
credentials {
Expand All @@ -89,5 +91,6 @@ publishing {
basic(BasicAuthentication)
}
}
*/
}
}
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.8
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8

#Fabric api
fabric_version=0.44.0+1.18
fabric_version=0.57.0+1.19

# Mod Properties
mod_version = 0.3.0
mod_version = 0.4.0
maven_group = dev.cafeteria
archives_base_name = fakeplayerapi

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class PlayerAdvancementTrackerMixin {
private void fakeplayerapi_cancelLoad(ServerAdvancementLoader advancementLoader, CallbackInfo ci) {
if ((Object) this instanceof FakePlayerAdvancementTracker) ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class ServerPlayerEntityMixin {

@Shadow @Final @Mutable
private PlayerAdvancementTracker advancementTracker;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ public void setDisplayTab(@Nullable Advancement advancement) {
public AdvancementProgress getProgress(Advancement advancement) {
return new AdvancementProgress();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package dev.cafeteria.fakeplayerapi.server;

import com.mojang.authlib.GameProfile;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

import java.util.UUID;

Expand All @@ -30,11 +32,11 @@ public Identifier getId() {
return builderId;
}

public FakeServerPlayer create(MinecraftServer server, ServerWorld world, GameProfile profile) {
return factory.create(this, server, world, profile);
public FakeServerPlayer create(MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) {
return factory.create(this, server, world, profile, publicKey);
}

public FakeServerPlayer create(MinecraftServer server, ServerWorld world, String name) {
return factory.create(this, server, world, new GameProfile(UUID.randomUUID(), name));
public FakeServerPlayer create(MinecraftServer server, ServerWorld world, String name, @Nullable PlayerPublicKey publicKey) {
return factory.create(this, server, world, new GameProfile(UUID.randomUUID(), name), publicKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ public void tick() {
@Override
public void disconnect(Text reason) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
import com.mojang.authlib.GameProfile;
import dev.cafeteria.fakeplayerapi.mixin.ServerPlayerEntityAccessor;
import net.minecraft.entity.LivingEntity;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import org.jetbrains.annotations.Nullable;

public class FakeServerPlayer extends ServerPlayerEntity {

private final FakePlayerBuilder builder;

protected FakeServerPlayer(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile) {
super(server, world, profile);
protected FakeServerPlayer(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) {
super(server, world, profile, publicKey);
this.builder = builder;

this.networkHandler = new FakeServerPlayNetworkHandler(server, FakeClientConnection.SERVER_FAKE_CONNECTION, this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package dev.cafeteria.fakeplayerapi.server;

import com.mojang.authlib.GameProfile;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import org.jetbrains.annotations.Nullable;

public interface FakeServerPlayerFactory {

FakeServerPlayerFactory DEFAULT = FakeServerPlayer::new;

FakeServerPlayer create(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile);
FakeServerPlayer create(FakePlayerBuilder builder, MinecraftServer server, ServerWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public <T> int getStat(StatType<T> type, T stat) {
public int getStat(Stat<?> stat) {
return 0;
}
}
}