diff --git a/build.gradle b/build.gradle index 604c74838..726e7ac71 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'fabric-loom' version '0.4.3' apply false + id 'fabric-loom' version '0.4-SNAPSHOT' apply false id 'net.minecrell.licenser' version '0.4.1' id "org.ajoberstar.grgit" version "3.1.1" id 'com.matthewprenger.cursegradle' version "1.4.0" @@ -12,8 +12,8 @@ plugins { def ENV = System.getenv() class Globals { - static def baseVersion = "0.11.2" - static def mcVersion = "20w22a" + static def baseVersion = "0.11.3" + static def mcVersion = "1.16-pre1" static def yarnVersion = "+build.1" } @@ -67,7 +67,7 @@ allprojects { dependencies { minecraft "com.mojang:minecraft:$Globals.mcVersion" mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}:v2" - modCompile "net.fabricmc:fabric-loader:0.8.4+build.198" + modCompile "net.fabricmc:fabric-loader:0.8.7+build.201" } configurations { diff --git a/fabric-command-api-v1/build.gradle b/fabric-command-api-v1/build.gradle index 4e65bf492..032d5fb77 100644 --- a/fabric-command-api-v1/build.gradle +++ b/fabric-command-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-command-api-v1" -version = getSubprojectVersion(project, "1.0.3") +version = getSubprojectVersion(project, "1.0.4") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinCommandManager.java b/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinCommandManager.java index 737f2f6d4..d9d8091be 100644 --- a/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinCommandManager.java +++ b/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinCommandManager.java @@ -33,9 +33,9 @@ public abstract class MixinCommandManager { * @reason Add commands before ambiguities are calculated. */ @Redirect(at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/CommandDispatcher;findAmbiguities(Lcom/mojang/brigadier/AmbiguityConsumer;)V"), method = "<init>") - private void fabric_addCommands(CommandDispatcher<ServerCommandSource> dispatcher, AmbiguityConsumer<ServerCommandSource> ambiguityConsumer, boolean isDedicated) { - if (!isDedicated) { - CommandRegistrationCallback.EVENT.invoker().register(dispatcher, isDedicated); + private void fabric_addCommands(CommandDispatcher<ServerCommandSource> dispatcher, AmbiguityConsumer<ServerCommandSource> ambiguityConsumer, CommandManager.class_5364 arg) { + if (arg == CommandManager.class_5364.field_25421) { + CommandRegistrationCallback.EVENT.invoker().register(dispatcher, false); } // Now mimic vanilla logic by calling findAmbiguities. diff --git a/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinMinecraftDedicatedServer.java b/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinMinecraftDedicatedServer.java index ebada175d..7429b39f4 100644 --- a/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinMinecraftDedicatedServer.java +++ b/fabric-command-api-v1/src/main/java/net/fabricmc/fabric/mixin/command/MixinMinecraftDedicatedServer.java @@ -21,6 +21,7 @@ import java.net.Proxy; import com.mojang.authlib.GameProfileRepository; import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.datafixers.DataFixer; +import net.minecraft.world.dimension.DimensionTracker; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -29,7 +30,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.server.MinecraftServer; import net.minecraft.server.WorldGenerationProgressListenerFactory; import net.minecraft.server.dedicated.MinecraftDedicatedServer; -import net.minecraft.class_5350; +import net.minecraft.resource.ServerResourceManager; import net.minecraft.resource.ResourcePackManager; import net.minecraft.resource.ResourcePackProfile; import net.minecraft.util.UserCache; @@ -40,8 +41,8 @@ import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; @Mixin(MinecraftDedicatedServer.class) public abstract class MixinMinecraftDedicatedServer extends MinecraftServer { - public MixinMinecraftDedicatedServer(LevelStorage.Session session, SaveProperties saveProperties, ResourcePackManager<ResourcePackProfile> resourcePackManager, Proxy proxy, DataFixer dataFixer, class_5350 arg, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { - super(session, saveProperties, resourcePackManager, proxy, dataFixer, arg, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory); + public MixinMinecraftDedicatedServer(Thread thread, DimensionTracker.Modifiable modifiable, LevelStorage.Session session, SaveProperties saveProperties, ResourcePackManager<ResourcePackProfile> resourcePackManager, Proxy proxy, DataFixer dataFixer, ServerResourceManager serverResourceManager, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { + super(thread, modifiable, session, saveProperties, resourcePackManager, proxy, dataFixer, serverResourceManager, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory); } @Inject(method = "setupServer", at = @At("HEAD")) diff --git a/fabric-command-api-v1/src/testmod/java/net/fabricmc/fabric/test/command/CommandTest.java b/fabric-command-api-v1/src/testmod/java/net/fabricmc/fabric/test/command/CommandTest.java index 0ca8bc831..a815a3a29 100644 --- a/fabric-command-api-v1/src/testmod/java/net/fabricmc/fabric/test/command/CommandTest.java +++ b/fabric-command-api-v1/src/testmod/java/net/fabricmc/fabric/test/command/CommandTest.java @@ -63,11 +63,6 @@ public class CommandTest implements ModInitializer { } }); - // Disabling the test mod for now, as https://bugs.mojang.com/browse/MC-186109 breaks it - if (true) { - return; - } - // Use the ServerTickCallback to verify the commands actually exist in the command dispatcher. ServerTickCallback.EVENT.register(server -> { // Don't run the test more than once diff --git a/fabric-content-registries-v0/build.gradle b/fabric-content-registries-v0/build.gradle index bfe2ae05c..e4f475d53 100644 --- a/fabric-content-registries-v0/build.gradle +++ b/fabric-content-registries-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-content-registries-v0" -version = getSubprojectVersion(project, "0.1.7") +version = getSubprojectVersion(project, "0.1.8") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java b/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java index d9250772c..a64a89cac 100644 --- a/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java +++ b/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java @@ -16,7 +16,7 @@ package net.fabricmc.fabric.api.registry; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.entry.LootPoolEntry; import net.fabricmc.fabric.impl.content.registry.LootEntryTypeRegistryImpl; @@ -29,5 +29,5 @@ public interface LootEntryTypeRegistry { LootEntryTypeRegistry INSTANCE = LootEntryTypeRegistryImpl.INSTANCE; @Deprecated - void register(LootEntry.class_5337<?> serializer); + void register(LootPoolEntry.class_5337<?> serializer); } diff --git a/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/impl/content/registry/LootEntryTypeRegistryImpl.java b/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/impl/content/registry/LootEntryTypeRegistryImpl.java index 588a5f706..8eee22a53 100644 --- a/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/impl/content/registry/LootEntryTypeRegistryImpl.java +++ b/fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/impl/content/registry/LootEntryTypeRegistryImpl.java @@ -18,8 +18,8 @@ package net.fabricmc.fabric.impl.content.registry; import java.lang.reflect.Method; -import net.minecraft.loot.entry.LootEntries; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.entry.LootPoolEntryTypes; +import net.minecraft.loot.entry.LootPoolEntry; import net.fabricmc.fabric.api.registry.LootEntryTypeRegistry; @@ -31,8 +31,8 @@ public final class LootEntryTypeRegistryImpl implements LootEntryTypeRegistry { static { Method target = null; - for (Method m : LootEntries.class.getDeclaredMethods()) { - if (m.getParameterCount() == 1 && m.getParameterTypes()[0] == LootEntry.class_5337.class) { + for (Method m : LootPoolEntryTypes.class.getDeclaredMethods()) { + if (m.getParameterCount() == 1 && m.getParameterTypes()[0] == LootPoolEntry.class_5337.class) { if (target != null) { throw new RuntimeException("More than one register-like method found in LootEntries!"); } else { @@ -52,7 +52,7 @@ public final class LootEntryTypeRegistryImpl implements LootEntryTypeRegistry { private LootEntryTypeRegistryImpl() { } @Override - public void register(LootEntry.class_5337<?> serializer) { + public void register(LootPoolEntry.class_5337<?> serializer) { try { REGISTER_METHOD.invoke(null, serializer); } catch (Throwable t) { diff --git a/fabric-events-lifecycle-v0/build.gradle b/fabric-events-lifecycle-v0/build.gradle index 21bb53d87..ca8581d05 100644 --- a/fabric-events-lifecycle-v0/build.gradle +++ b/fabric-events-lifecycle-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-events-lifecycle-v0" -version = getSubprojectVersion(project, "0.1.2") +version = getSubprojectVersion(project, "0.1.3") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-events-lifecycle-v0/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/MixinMinecraftServer.java b/fabric-events-lifecycle-v0/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/MixinMinecraftServer.java index b531bf3b1..81386f0a9 100644 --- a/fabric-events-lifecycle-v0/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/MixinMinecraftServer.java +++ b/fabric-events-lifecycle-v0/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/MixinMinecraftServer.java @@ -31,7 +31,7 @@ import net.fabricmc.fabric.api.event.server.ServerTickCallback; @Mixin(MinecraftServer.class) public class MixinMinecraftServer { - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;setFavicon(Lnet/minecraft/server/ServerMetadata;)V", ordinal = 0), method = "run") + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;setFavicon(Lnet/minecraft/server/ServerMetadata;)V", ordinal = 0), method = "method_29741") public void afterSetupServer(CallbackInfo info) { ServerStartCallback.EVENT.invoker().onStartServer((MinecraftServer) (Object) this); } diff --git a/fabric-loot-tables-v1/build.gradle b/fabric-loot-tables-v1/build.gradle index d460cbc0a..cfe8466e8 100644 --- a/fabric-loot-tables-v1/build.gradle +++ b/fabric-loot-tables-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-loot-tables-v1" -version = getSubprojectVersion(project, "0.1.8") +version = getSubprojectVersion(project, "0.1.9") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPool.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPool.java index 3d6112c3c..bf46e3fda 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPool.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPool.java @@ -20,8 +20,8 @@ import java.util.List; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTableRange; -import net.minecraft.class_5341; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.condition.LootCondition; +import net.minecraft.loot.entry.LootPoolEntry; import net.minecraft.loot.function.LootFunction; /** @@ -33,8 +33,8 @@ public interface FabricLootPool { return (LootPool) this; } - List<LootEntry> getEntries(); - List<class_5341> getConditions(); + List<LootPoolEntry> getEntries(); + List<LootCondition> getConditions(); List<LootFunction> getFunctions(); LootTableRange getRolls(); } diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPoolBuilder.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPoolBuilder.java index a969924c2..d0d211dc5 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPoolBuilder.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/FabricLootPoolBuilder.java @@ -16,10 +16,10 @@ package net.fabricmc.fabric.api.loot.v1; -import net.minecraft.class_5341; +import net.minecraft.loot.condition.LootCondition; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTableRange; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.entry.LootPoolEntry; import net.minecraft.loot.function.LootFunction; import net.fabricmc.fabric.mixin.loot.table.LootPoolBuilderHooks; @@ -40,13 +40,13 @@ public class FabricLootPoolBuilder extends LootPool.Builder { } @Override - public FabricLootPoolBuilder with(LootEntry.Builder<?> entry) { + public FabricLootPoolBuilder with(LootPoolEntry.Builder<?> entry) { super.with(entry); return this; } @Override - public FabricLootPoolBuilder conditionally(class_5341.Builder condition) { + public FabricLootPoolBuilder conditionally(LootCondition.Builder condition) { super.conditionally(condition); return this; } @@ -57,12 +57,12 @@ public class FabricLootPoolBuilder extends LootPool.Builder { return this; } - public FabricLootPoolBuilder withEntry(LootEntry entry) { + public FabricLootPoolBuilder withEntry(LootPoolEntry entry) { extended.getEntries().add(entry); return this; } - public FabricLootPoolBuilder withCondition(class_5341 condition) { + public FabricLootPoolBuilder withCondition(LootCondition condition) { extended.getConditions().add(condition); return this; } diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/LootEntryTypeRegistry.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/LootEntryTypeRegistry.java index 079d06aaa..3168807be 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/LootEntryTypeRegistry.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/api/loot/v1/LootEntryTypeRegistry.java @@ -16,7 +16,7 @@ package net.fabricmc.fabric.api.loot.v1; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.entry.LootPoolEntry; import net.fabricmc.fabric.impl.loot.table.LootEntryTypeRegistryImpl; @@ -34,5 +34,5 @@ public interface LootEntryTypeRegistry { * * @param serializer the loot entry serializer */ - void register(LootEntry.class_5337<?> serializer); + void register(LootPoolEntry.class_5337<?> serializer); } diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/impl/loot/table/LootEntryTypeRegistryImpl.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/impl/loot/table/LootEntryTypeRegistryImpl.java index 06656d711..77f3468ba 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/impl/loot/table/LootEntryTypeRegistryImpl.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/impl/loot/table/LootEntryTypeRegistryImpl.java @@ -18,8 +18,8 @@ package net.fabricmc.fabric.impl.loot.table; import java.lang.reflect.Method; -import net.minecraft.loot.entry.LootEntries; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.entry.LootPoolEntryTypes; +import net.minecraft.loot.entry.LootPoolEntry; public final class LootEntryTypeRegistryImpl implements net.fabricmc.fabric.api.loot.v1.LootEntryTypeRegistry { public static final LootEntryTypeRegistryImpl INSTANCE = new LootEntryTypeRegistryImpl(); @@ -28,8 +28,8 @@ public final class LootEntryTypeRegistryImpl implements net.fabricmc.fabric.api. static { Method target = null; - for (Method m : LootEntries.class.getDeclaredMethods()) { - if (m.getParameterCount() == 1 && m.getParameterTypes()[0] == LootEntry.class_5337.class) { + for (Method m : LootPoolEntryTypes.class.getDeclaredMethods()) { + if (m.getParameterCount() == 1 && m.getParameterTypes()[0] == LootPoolEntry.class_5337.class) { if (target != null) { throw new RuntimeException("More than one register-like method found in LootEntries!"); } else { @@ -49,7 +49,7 @@ public final class LootEntryTypeRegistryImpl implements net.fabricmc.fabric.api. private LootEntryTypeRegistryImpl() { } @Override - public void register(LootEntry.class_5337<?> serializer) { + public void register(LootPoolEntry.class_5337<?> serializer) { try { REGISTER_METHOD.invoke(null, serializer); } catch (Throwable t) { diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/LootPoolBuilderHooks.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/LootPoolBuilderHooks.java index 4bca6c03f..30085cec3 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/LootPoolBuilderHooks.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/LootPoolBuilderHooks.java @@ -22,16 +22,16 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; import net.minecraft.loot.LootPool; -import net.minecraft.class_5341; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.condition.LootCondition; +import net.minecraft.loot.entry.LootPoolEntry; import net.minecraft.loot.function.LootFunction; @Mixin(LootPool.Builder.class) public interface LootPoolBuilderHooks { @Accessor - List<LootEntry> getEntries(); + List<LootPoolEntry> getEntries(); @Accessor - List<class_5341> getConditions(); + List<LootCondition> getConditions(); @Accessor List<LootFunction> getFunctions(); } diff --git a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/MixinLootPool.java b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/MixinLootPool.java index 002ebf998..de8120d98 100644 --- a/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/MixinLootPool.java +++ b/fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric/mixin/loot/table/MixinLootPool.java @@ -26,8 +26,8 @@ import org.spongepowered.asm.mixin.gen.Accessor; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTableRange; -import net.minecraft.class_5341; -import net.minecraft.loot.entry.LootEntry; +import net.minecraft.loot.condition.LootCondition; +import net.minecraft.loot.entry.LootPoolEntry; import net.minecraft.loot.function.LootFunction; import net.fabricmc.fabric.api.loot.v1.FabricLootPool; @@ -36,23 +36,23 @@ import net.fabricmc.fabric.api.loot.v1.FabricLootPool; public abstract class MixinLootPool implements FabricLootPool { @Shadow @Final - private LootEntry[] entries; + private LootPoolEntry[] entries; @Shadow @Final - private class_5341[] conditions; + private LootCondition[] conditions; @Shadow @Final private LootFunction[] functions; @Override - public List<LootEntry> getEntries() { + public List<LootPoolEntry> getEntries() { return Arrays.asList(entries); } @Override - public List<class_5341> getConditions() { + public List<LootCondition> getConditions() { return Arrays.asList(conditions); } diff --git a/fabric-object-builder-api-v1/build.gradle b/fabric-object-builder-api-v1/build.gradle index 7ddd1f214..1b7517178 100644 --- a/fabric-object-builder-api-v1/build.gradle +++ b/fabric-object-builder-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-object-builder-api-v1" -version = getSubprojectVersion(project, "1.5.1") +version = getSubprojectVersion(project, "1.5.2") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/FabricEntityTypeBuilder.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/FabricEntityTypeBuilder.java index 8fd092f13..527553c49 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/FabricEntityTypeBuilder.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/api/object/builder/v1/entity/FabricEntityTypeBuilder.java @@ -16,6 +16,8 @@ package net.fabricmc.fabric.api.object.builder.v1.entity; +import com.google.common.collect.ImmutableSet; +import net.minecraft.block.Block; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -44,6 +46,7 @@ public class FabricEntityTypeBuilder<T extends Entity> { private boolean fireImmune = false; private boolean spawnableFarFromPlayer; private EntityDimensions dimensions = EntityDimensions.changing(-1.0f, -1.0f); + private ImmutableSet<Block> specificSpawnBlocks = ImmutableSet.of(); protected FabricEntityTypeBuilder(SpawnGroup spawnGroup, EntityType.EntityFactory<T> function) { this.spawnGroup = spawnGroup; @@ -123,31 +126,6 @@ public class FabricEntityTypeBuilder<T extends Entity> { return this; } - /** - * @deprecated For removal: Gas been moved to EntityCategory - * - * @param maxDespawnDistance the distance - * - * - * @return this builder for chaining - */ - @Deprecated - public FabricEntityTypeBuilder<T> maxDespawnDistance(int maxDespawnDistance) { - return this; - } - - /** - * @deprecated For removal: Gas been moved to EntityCategory - * - * @param minDespawnDistance the distance - * - * @return this builder for chaining - */ - @Deprecated - public FabricEntityTypeBuilder<T> minDespawnDistance(int minDespawnDistance) { - return this; - } - public FabricEntityTypeBuilder<T> trackable(int trackingDistanceBlocks, int updateIntervalTicks) { return trackable(trackingDistanceBlocks, updateIntervalTicks, true); } @@ -159,6 +137,17 @@ public class FabricEntityTypeBuilder<T extends Entity> { return this; } + /** + * Sets the {@link ImmutableSet} of blocks this entity can spawn on + * + * @param blocks the blocks the entity can spawn on + * @return this builder for chaining + */ + public FabricEntityTypeBuilder<T> specificSpawnBlocks(Block... blocks) { + this.specificSpawnBlocks = ImmutableSet.copyOf(blocks); + return this; + } + /** * Creates the entity type. * @@ -170,7 +159,7 @@ public class FabricEntityTypeBuilder<T extends Entity> { // TODO: Flesh out once modded datafixers exist. } - EntityType<T> type = new FabricEntityType<T>(this.function, this.spawnGroup, this.saveable, this.summonable, this.fireImmune, this.spawnableFarFromPlayer, dimensions, trackingDistance, updateIntervalTicks, alwaysUpdateVelocity); + EntityType<T> type = new FabricEntityType<T>(this.function, this.spawnGroup, this.saveable, this.summonable, this.fireImmune, this.spawnableFarFromPlayer, this.specificSpawnBlocks, dimensions, trackingDistance, updateIntervalTicks, alwaysUpdateVelocity); return type; } diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/impl/object/builder/FabricEntityType.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/impl/object/builder/FabricEntityType.java index 43f17c30b..df003d6c3 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/impl/object/builder/FabricEntityType.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/impl/object/builder/FabricEntityType.java @@ -16,6 +16,8 @@ package net.fabricmc.fabric.impl.object.builder; +import com.google.common.collect.ImmutableSet; +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.EntityDimensions; @@ -24,8 +26,8 @@ import net.minecraft.entity.EntityType; public class FabricEntityType<T extends Entity> extends EntityType<T> { private final Boolean alwaysUpdateVelocity; - public FabricEntityType(EntityType.EntityFactory<T> factory, SpawnGroup spawnGroup, boolean bl, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, EntityDimensions entityDimensions, int maxTrackDistance, int trackTickInterval, Boolean alwaysUpdateVelocity) { - super(factory, spawnGroup, bl, summonable, fireImmune, spawnableFarFromPlayer, entityDimensions, (maxTrackDistance + 15) / 16, trackTickInterval); + public FabricEntityType(EntityType.EntityFactory<T> factory, SpawnGroup spawnGroup, boolean bl, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> spawnBlocks, EntityDimensions entityDimensions, int maxTrackDistance, int trackTickInterval, Boolean alwaysUpdateVelocity) { + super(factory, spawnGroup, bl, summonable, fireImmune, spawnableFarFromPlayer, spawnBlocks, entityDimensions, (maxTrackDistance + 15) / 16, trackTickInterval); this.alwaysUpdateVelocity = alwaysUpdateVelocity; } diff --git a/fabric-registry-sync-v0/build.gradle b/fabric-registry-sync-v0/build.gradle index e1f8729e4..3343a8076 100644 --- a/fabric-registry-sync-v0/build.gradle +++ b/fabric-registry-sync-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-registry-sync-v0" -version = getSubprojectVersion(project, "0.3.4") +version = getSubprojectVersion(project, "0.3.5") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java index 94a36ade9..d7e23e4b6 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import net.minecraft.world.dimension.DimensionTracker; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.mixin.Final; @@ -121,7 +122,7 @@ public class MixinLevelStorageSession { } @Inject(method = "method_27426", at = @At("HEAD")) - public void saveWorld(SaveProperties saveProperties, CompoundTag compoundTag, CallbackInfo info) { + public void saveWorld(DimensionTracker dimensionTracker, SaveProperties saveProperties, CompoundTag compoundTag, CallbackInfo info) { if (!Files.exists(directory)) { return; } diff --git a/fabric-rendering-v1/build.gradle b/fabric-rendering-v1/build.gradle index 9a1f26f41..d842b10da 100644 --- a/fabric-rendering-v1/build.gradle +++ b/fabric-rendering-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-rendering-v1" -version = getSubprojectVersion(project, "1.1.1") +version = getSubprojectVersion(project, "1.1.2") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinBuiltinModelItemRenderer.java b/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinBuiltinModelItemRenderer.java index 006fa23e2..b21941e35 100644 --- a/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinBuiltinModelItemRenderer.java +++ b/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinBuiltinModelItemRenderer.java @@ -16,6 +16,7 @@ package net.fabricmc.fabric.mixin.client.rendering; +import net.minecraft.client.render.model.json.ModelTransformation; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -32,7 +33,7 @@ import net.fabricmc.fabric.impl.client.rendering.BuiltinItemRendererRegistryImpl @Mixin(BuiltinModelItemRenderer.class) abstract class MixinBuiltinModelItemRenderer { @Inject(method = "render", at = @At("HEAD"), cancellable = true) - private void fabric_onRender(ItemStack stack, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo info) { + private void fabric_onRender(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo info) { BuiltinItemRenderer renderer = BuiltinItemRendererRegistryImpl.getRenderer(stack.getItem()); if (renderer != null) { diff --git a/fabric-resource-loader-v0/build.gradle b/fabric-resource-loader-v0/build.gradle index 20e4d7170..64b393fa6 100644 --- a/fabric-resource-loader-v0/build.gradle +++ b/fabric-resource-loader-v0/build.gradle @@ -1,2 +1,2 @@ archivesBaseName = "fabric-resource-loader-v0" -version = getSubprojectVersion(project, "0.2.0") +version = getSubprojectVersion(project, "0.2.1") diff --git a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModNioResourcePack.java b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModNioResourcePack.java index 8cbeafefc..3820377f1 100644 --- a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModNioResourcePack.java +++ b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModNioResourcePack.java @@ -210,14 +210,12 @@ public class ModNioResourcePack extends AbstractFileResourcePack implements ModR } @Override - public void close() throws IOException { + public void close() { if (closer != null) { try { closer.close(); - } catch (IOException e) { - throw e; } catch (Exception e) { - throw new IOException(e); + throw new RuntimeException(e); } } } diff --git a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModResourcePackCreator.java b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModResourcePackCreator.java index e54961b46..228693d22 100644 --- a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModResourcePackCreator.java +++ b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/impl/resource/loader/ModResourcePackCreator.java @@ -18,8 +18,9 @@ package net.fabricmc.fabric.impl.resource.loader; import java.util.ArrayList; import java.util.List; -import java.util.Map; +import java.util.function.Consumer; +import net.minecraft.class_5352; import net.minecraft.resource.ResourcePack; import net.minecraft.resource.ResourcePackProfile; import net.minecraft.resource.ResourcePackProvider; @@ -35,7 +36,7 @@ public class ModResourcePackCreator implements ResourcePackProvider { } @Override - public <T extends ResourcePackProfile> void register(Map<String, T> map, ResourcePackProfile.Factory<T> factory) { + public <T extends ResourcePackProfile> void register(Consumer<T> consumer, ResourcePackProfile.class_5351<T> factory) { // TODO: "vanilla" does not emit a message; neither should a modded datapack List<ResourcePack> packs = new ArrayList<>(); ModResourcePackUtil.appendModResourcePacks(packs, type); @@ -46,10 +47,10 @@ public class ModResourcePackCreator implements ResourcePackProvider { } T var3 = ResourcePackProfile.of("fabric/" + ((ModResourcePack) pack).getFabricModMetadata().getId(), - false, () -> pack, factory, ResourcePackProfile.InsertionPosition.TOP); + false, () -> pack, factory, ResourcePackProfile.InsertionPosition.TOP, class_5352.field_25348); if (var3 != null) { - map.put(var3.getName(), var3); + consumer.accept(var3); } } } diff --git a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinMinecraftServer.java b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinMinecraftServer.java index 867064bdb..c1d3275d5 100644 --- a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinMinecraftServer.java +++ b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinMinecraftServer.java @@ -16,6 +16,7 @@ package net.fabricmc.fabric.mixin.resource.loader; +import net.minecraft.server.Main; import org.apache.commons.lang3.ArrayUtils; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -27,9 +28,9 @@ import net.minecraft.resource.ResourcePackProvider; import net.fabricmc.fabric.impl.resource.loader.ModResourcePackCreator; -@Mixin(MinecraftServer.class) +@Mixin(Main.class) public class MixinMinecraftServer { - @ModifyArg(method = "method_29438", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ResourcePackManager;<init>(Lnet/minecraft/resource/ResourcePackProfile$Factory;[Lnet/minecraft/resource/ResourcePackProvider;)V")) + @ModifyArg(method = "main", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ResourcePackManager;<init>(Lnet/minecraft/resource/ResourcePackProfile$class_5351;[Lnet/minecraft/resource/ResourcePackProvider;)V")) private static ResourcePackProvider[] appendFabricDataPacks(ResourcePackProvider[] packProviders) { return ArrayUtils.add(packProviders, new ModResourcePackCreator(ResourceType.SERVER_DATA)); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index afd79dc45..b50bf8225 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.8.2", + "fabricloader": ">=0.8.7", "minecraft": "~1.16-alpha.20.14.a" }, "description": "Core API module providing key hooks and intercompatibility features."