forked from FabricMC/fabric
20w11a - All mapping changes
This commit is contained in:
parent
3c3ab87276
commit
5b8a535acb
15 changed files with 47 additions and 47 deletions
|
@ -12,9 +12,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.5.2"
|
||||
static def mcVersion = "20w10a"
|
||||
static def yarnVersion = "+build.7"
|
||||
static def baseVersion = "0.5.3"
|
||||
static def mcVersion = "20w11a"
|
||||
static def yarnVersion = "+build.1"
|
||||
}
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-containers-v0"
|
||||
version = getSubprojectVersion(project, "0.1.4")
|
||||
version = getSubprojectVersion(project, "0.1.6")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
package net.fabricmc.fabric.api.client.screen;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.ContainerScreen;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.client.gui.screen.ingame.ScreenWithHandler;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ContainerScreenFactory<C extends Container> {
|
||||
ContainerScreen create(C container);
|
||||
public interface ContainerScreenFactory<C extends ScreenHandler> {
|
||||
ScreenWithHandler create(C container);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
package net.fabricmc.fabric.api.client.screen;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.ContainerScreen;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.client.gui.screen.ingame.ScreenWithHandler;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.api.container.ContainerFactory;
|
||||
|
@ -33,14 +33,14 @@ public interface ScreenProviderRegistry {
|
|||
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
|
||||
* @param containerScreenFactory the supplier that should be used to create the new gui
|
||||
*/
|
||||
<C extends Container> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory);
|
||||
<C extends ScreenHandler> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory);
|
||||
|
||||
/**
|
||||
* Register a "packet -> ContainerScreen" factory. This is used only on the client side, and allows you
|
||||
* 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 ScreenWithHandler}
|
||||
*/
|
||||
void registerFactory(Identifier identifier, ContainerFactory<ContainerScreen> factory);
|
||||
void registerFactory(Identifier identifier, ContainerFactory<ScreenWithHandler> factory);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ package net.fabricmc.fabric.api.container;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -34,9 +34,9 @@ public interface ContainerProviderRegistry {
|
|||
* Register a "packet buffer -> container" factory. This is used both on the client and server side.
|
||||
*
|
||||
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ScreenProviderRegistry}
|
||||
* @param factory the ContainerFactory that should return a new {@link Container}
|
||||
* @param factory the ContainerFactory that should return a new {@link ScreenHandler}
|
||||
*/
|
||||
void registerFactory(Identifier identifier, ContainerFactory<Container> factory);
|
||||
void registerFactory(Identifier identifier, ContainerFactory<ScreenHandler> factory);
|
||||
|
||||
/**
|
||||
* Open a modded container.
|
||||
|
|
|
@ -19,12 +19,12 @@ package net.fabricmc.fabric.impl.client.container;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.ScreenWithHandler;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ingame.ContainerScreen;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.api.client.screen.ContainerScreenFactory;
|
||||
|
@ -42,10 +42,10 @@ 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<ScreenWithHandler>> FACTORIES = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void registerFactory(Identifier identifier, ContainerFactory<ContainerScreen> factory) {
|
||||
public void registerFactory(Identifier identifier, ContainerFactory<ScreenWithHandler> factory) {
|
||||
if (FACTORIES.containsKey(identifier)) {
|
||||
throw new RuntimeException("A factory has already been registered as " + identifier + "!");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class ScreenProviderRegistryImpl implements ScreenProviderRegistry {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <C extends Container> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory) {
|
||||
public <C extends ScreenHandler> void registerFactory(Identifier identifier, ContainerScreenFactory<C> containerScreenFactory) {
|
||||
registerFactory(identifier, (syncId, identifier1, player, buf) -> {
|
||||
C container = ContainerProviderImpl.INSTANCE.createContainer(syncId, identifier1, player, buf);
|
||||
|
||||
|
@ -75,15 +75,15 @@ public class ScreenProviderRegistryImpl implements ScreenProviderRegistry {
|
|||
|
||||
MinecraftClient.getInstance().execute(() -> {
|
||||
try {
|
||||
ContainerFactory<ContainerScreen> factory = FACTORIES.get(identifier);
|
||||
ContainerFactory<ScreenWithHandler> 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);
|
||||
packetContext.getPlayer().container = gui.getContainer();
|
||||
ScreenWithHandler gui = factory.create(syncId, identifier, packetContext.getPlayer(), packetByteBuf);
|
||||
packetContext.getPlayer().currentScreenHandler = gui.getScreenHandler();
|
||||
MinecraftClient.getInstance().openScreen(gui);
|
||||
} finally {
|
||||
packetByteBuf.release();
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -44,10 +44,10 @@ public class ContainerProviderImpl implements ContainerProviderRegistry {
|
|||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
private static final Map<Identifier, ContainerFactory<Container>> FACTORIES = new HashMap<>();
|
||||
private static final Map<Identifier, ContainerFactory<ScreenHandler>> FACTORIES = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void registerFactory(Identifier identifier, ContainerFactory<Container> factory) {
|
||||
public void registerFactory(Identifier identifier, ContainerFactory<ScreenHandler> factory) {
|
||||
if (FACTORIES.containsKey(identifier)) {
|
||||
throw new RuntimeException("A factory has already been registered as " + identifier.toString());
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ public class ContainerProviderImpl implements ContainerProviderRegistry {
|
|||
emittedNoSyncHookWarning = true;
|
||||
}
|
||||
|
||||
syncId = (((ServerPlayerEntityAccessor) player).getContainerSyncId() + 1) % 100;
|
||||
((ServerPlayerEntityAccessor) player).setContainerSyncId(syncId);
|
||||
syncId = (((ServerPlayerEntityAccessor) player).getScreenHandlerSyncId() + 1) % 100;
|
||||
((ServerPlayerEntityAccessor) player).setScreenHandlerSyncId(syncId);
|
||||
} else {
|
||||
throw new RuntimeException("Neither ServerPlayerEntitySyncHook nor Accessor present! This should not happen!");
|
||||
}
|
||||
|
@ -97,18 +97,18 @@ public class ContainerProviderImpl implements ContainerProviderRegistry {
|
|||
clonedBuf.readIdentifier();
|
||||
clonedBuf.readUnsignedByte();
|
||||
|
||||
Container container = createContainer(syncId, identifier, player, clonedBuf);
|
||||
ScreenHandler container = createContainer(syncId, identifier, player, clonedBuf);
|
||||
|
||||
if (container == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
player.container = container;
|
||||
player.container.addListener(player);
|
||||
player.currentScreenHandler = container;
|
||||
player.currentScreenHandler.addListener(player);
|
||||
}
|
||||
|
||||
public <C extends Container> C createContainer(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf) {
|
||||
ContainerFactory<Container> factory = FACTORIES.get(identifier);
|
||||
public <C extends ScreenHandler> C createContainer(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf) {
|
||||
ContainerFactory<ScreenHandler> factory = FACTORIES.get(identifier);
|
||||
|
||||
if (factory == null) {
|
||||
LOGGER.error("No container factory found for {}!", identifier.toString());
|
||||
|
|
|
@ -26,14 +26,14 @@ import net.fabricmc.fabric.impl.container.ServerPlayerEntitySyncHook;
|
|||
@Mixin(ServerPlayerEntity.class)
|
||||
public abstract class MixinServerPlayerEntity implements ServerPlayerEntitySyncHook {
|
||||
@Shadow
|
||||
private int containerSyncId;
|
||||
private int screenHandlerSyncId;
|
||||
|
||||
@Shadow
|
||||
protected abstract void incrementContainerSyncId();
|
||||
protected abstract void incrementScreenHandlerSyncId();
|
||||
|
||||
@Override
|
||||
public int fabric_incrementSyncId() {
|
||||
incrementContainerSyncId();
|
||||
return containerSyncId;
|
||||
incrementScreenHandlerSyncId();
|
||||
return screenHandlerSyncId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
|||
@Mixin(ServerPlayerEntity.class)
|
||||
public interface ServerPlayerEntityAccessor {
|
||||
@Accessor
|
||||
int getContainerSyncId();
|
||||
int getScreenHandlerSyncId();
|
||||
@Accessor
|
||||
void setContainerSyncId(int syncId);
|
||||
void setScreenHandlerSyncId(int syncId);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-item-groups-v0"
|
||||
version = getSubprojectVersion(project, "0.1.8")
|
||||
version = getSubprojectVersion(project, "0.1.9")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.text.Text;
|
||||
|
@ -35,7 +35,7 @@ import net.fabricmc.fabric.impl.item.group.FabricCreativeGuiComponents;
|
|||
|
||||
@Mixin(CreativeInventoryScreen.class)
|
||||
public abstract class MixinCreativePlayerInventoryGui extends AbstractInventoryScreen implements CreativeGuiExtensions {
|
||||
public MixinCreativePlayerInventoryGui(Container container_1, PlayerInventory playerInventory_1, Text textComponent_1) {
|
||||
public MixinCreativePlayerInventoryGui(ScreenHandler container_1, PlayerInventory playerInventory_1, Text textComponent_1) {
|
||||
super(container_1, playerInventory_1, textComponent_1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-mining-levels-v0"
|
||||
version = getSubprojectVersion(project, "0.1.1")
|
||||
version = getSubprojectVersion(project, "0.1.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -44,7 +44,7 @@ public abstract class MixinItemStack {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "getMiningSpeed", cancellable = true)
|
||||
@Inject(at = @At("HEAD"), method = "getMiningSpeedMultiplier", cancellable = true)
|
||||
public void getBlockBreakingSpeed(BlockState state, CallbackInfoReturnable<Float> info) {
|
||||
if (this.getItem() instanceof MiningToolItemAccessor) {
|
||||
TriState triState = ToolManager.handleIsEffectiveOn((ItemStack) (Object) this, state);
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
archivesBaseName = "fabric-resource-loader-v0"
|
||||
version = getSubprojectVersion(project, "0.1.11")
|
||||
version = getSubprojectVersion(project, "0.1.12")
|
||||
|
|
|
@ -45,7 +45,7 @@ import net.minecraft.util.profiler.Profiler;
|
|||
*/
|
||||
public interface SimpleResourceReloadListener<T> extends IdentifiableResourceReloadListener {
|
||||
@Override
|
||||
default CompletableFuture<Void> method_25931(ResourceReloadListener.Synchronizer helper, ResourceManager manager, Profiler loadProfiler, Profiler applyProfiler, Executor loadExecutor, Executor applyExecutor) {
|
||||
default CompletableFuture<Void> reload(ResourceReloadListener.Synchronizer helper, ResourceManager manager, Profiler loadProfiler, Profiler applyProfiler, Executor loadExecutor, Executor applyExecutor) {
|
||||
return load(manager, loadProfiler, loadExecutor).thenCompose(helper::whenPrepared).thenCompose(
|
||||
(o) -> apply(o, manager, applyProfiler, applyExecutor)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue