update to 1.14.2pre2

This commit is contained in:
Adrian Siekierka 2019-05-17 16:20:37 +02:00
parent 57f0d19cc0
commit 945f265fc3
9 changed files with 27 additions and 26 deletions

View file

@ -12,7 +12,7 @@ plugins {
def ENV = System.getenv()
def baseVersion = "0.3.0-pre"
def mcVersion = "1.14.1 Pre-Release 2"
def mcVersion = "1.14.2 Pre-Release 2"
def yarnVersion = "+build.2"
def getSubprojectVersion(project, version) {
@ -140,7 +140,7 @@ publishing {
def depNode = depsNode.appendNode("dependency")
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
depNode.appendNode("version", it.version)
depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
@ -173,7 +173,7 @@ dependencies {
}
// workaround linux segfault
compile "org.lwjgl:lwjgl-jemalloc:3.2.1"
// compile "org.lwjgl:lwjgl-jemalloc:3.2.1"
}
version = baseVersion + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local")

View file

@ -16,12 +16,12 @@
package net.fabricmc.fabric.api.client.screen;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.container.Container;
@FunctionalInterface
public interface ContainerScreenFactory<C extends Container> {
ContainerScreen create(C container);
AbstractContainerScreen create(C container);
}

View file

@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.client.screen;
import net.fabricmc.fabric.api.container.ContainerFactory;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.fabricmc.fabric.impl.client.gui.ScreenProviderRegistryImpl;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.container.Container;
import net.minecraft.util.Identifier;
@ -40,8 +40,8 @@ public interface ScreenProviderRegistry {
* to override the default behaviour of re-using the existing "packet -> Container" logic.
*
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
* @param factory the gui factory, this should return a new {@link ContainerScreen}
* @param factory the gui factory, this should return a new {@link AbstractContainerScreen}
*/
void registerFactory(Identifier identifier, ContainerFactory<ContainerScreen> factory);
void registerFactory(Identifier identifier, ContainerFactory<AbstractContainerScreen> factory);
}

View file

@ -23,7 +23,7 @@ import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
import net.fabricmc.fabric.impl.container.ContainerProviderImpl;
import net.fabricmc.fabric.impl.network.PacketTypes;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.container.Container;
import net.minecraft.util.Identifier;
import org.apache.logging.log4j.LogManager;
@ -41,9 +41,9 @@ public class ScreenProviderRegistryImpl implements ScreenProviderRegistry {
private static final Logger LOGGER = LogManager.getLogger();
private static final Map<Identifier, ContainerFactory<ContainerScreen>> FACTORIES = new HashMap<>();
private static final Map<Identifier, ContainerFactory<AbstractContainerScreen>> FACTORIES = new HashMap<>();
public void registerFactory(Identifier identifier, ContainerFactory<ContainerScreen> factory) {
public void registerFactory(Identifier identifier, ContainerFactory<AbstractContainerScreen> factory) {
if (FACTORIES.containsKey(identifier)) {
throw new RuntimeException("A factory has already been registered as " + identifier + "!");
}
@ -67,12 +67,12 @@ public class ScreenProviderRegistryImpl implements ScreenProviderRegistry {
Identifier identifier = packetByteBuf.readIdentifier();
int syncId = packetByteBuf.readUnsignedByte();
MinecraftClient.getInstance().execute(() -> {
ContainerFactory<ContainerScreen> factory = FACTORIES.get(identifier);
ContainerFactory<AbstractContainerScreen> factory = FACTORIES.get(identifier);
if (factory == null) {
LOGGER.error("No GUI factory found for {}!", identifier.toString());
return;
}
ContainerScreen gui = factory.create(syncId, identifier, packetContext.getPlayer(), packetByteBuf);
AbstractContainerScreen gui = factory.create(syncId, identifier, packetContext.getPlayer(), packetByteBuf);
packetContext.getPlayer().container = gui.getContainer();
MinecraftClient.getInstance().openScreen(gui);
});

View file

@ -21,7 +21,7 @@ import net.fabricmc.fabric.api.event.client.player.ClientPickBlockCallback;
import net.fabricmc.fabric.api.event.client.player.ClientPickBlockGatherCallback;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;

View file

@ -18,7 +18,8 @@ package net.fabricmc.fabric.impl.itemgroup;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.item.ItemGroup;
@ -42,14 +43,14 @@ public class FabricCreativeGuiComponents {
public static class ItemGroupButtonWidget extends ButtonWidget {
CreativeGuiExtensions extensions;
CreativePlayerInventoryScreen gui;
CreativeInventoryScreen gui;
Type type;
public ItemGroupButtonWidget(int x, int y, Type type, CreativeGuiExtensions extensions) {
super(x, y, 10, 11, type.text, (bw) -> type.clickConsumer.accept(extensions));
this.extensions = extensions;
this.type = type;
this.gui = (CreativePlayerInventoryScreen) extensions;
this.gui = (CreativeInventoryScreen) extensions;
}
@Override

View file

@ -18,8 +18,8 @@ package net.fabricmc.fabric.mixin.itemgroup.client;
import net.fabricmc.fabric.impl.itemgroup.CreativeGuiExtensions;
import net.fabricmc.fabric.impl.itemgroup.FabricCreativeGuiComponents;
import net.minecraft.client.gui.ingame.AbstractPlayerInventoryScreen;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemGroup;
@ -31,8 +31,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(CreativePlayerInventoryScreen.class)
public abstract class MixinCreativePlayerInventoryGui extends AbstractPlayerInventoryScreen implements CreativeGuiExtensions {
@Mixin(CreativeInventoryScreen.class)
public abstract class MixinCreativePlayerInventoryGui extends AbstractInventoryScreen implements CreativeGuiExtensions {
public MixinCreativePlayerInventoryGui(Container container_1, PlayerInventory playerInventory_1, Component textComponent_1) {
super(container_1, playerInventory_1, textComponent_1);

View file

@ -18,7 +18,7 @@ package net.fabricmc.fabric.mixin.network;
import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.screen.Screen;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@ -28,7 +28,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftClient.class)
public class MixinMinecraftClient {
@Inject(at = @At("RETURN"), method = "disconnect(Lnet/minecraft/client/gui/Screen;)V")
@Inject(at = @At("RETURN"), method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;)V")
public void disconnectAfter(Screen screen_1, CallbackInfo info) {
ClientSidePacketRegistryImpl.invalidateRegisteredIdList();
}

View file

@ -20,7 +20,7 @@ import net.fabricmc.fabric.impl.network.ClientSidePacketRegistryImpl;
import net.fabricmc.fabric.impl.registry.RegistrySyncManager;
import net.fabricmc.fabric.impl.registry.RemapException;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.screen.Screen;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@ -34,7 +34,7 @@ public class MixinMinecraftClient {
private static Logger LOGGER;
// Unmap the registry before loading a new SP/MP setup.
@Inject(at = @At("RETURN"), method = "disconnect(Lnet/minecraft/client/gui/Screen;)V")
@Inject(at = @At("RETURN"), method = "disconnect(Lnet/minecraft/client/gui/screen/Screen;)V")
public void disconnectAfter(Screen screen_1, CallbackInfo info) {
ClientSidePacketRegistryImpl.invalidateRegisteredIdList();
@ -44,4 +44,4 @@ public class MixinMinecraftClient {
LOGGER.warn("Failed to unmap Fabric registries!", e);
}
}
}
}