mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
20w46a
This commit is contained in:
parent
e7f25d0d6f
commit
df3673f0bc
26 changed files with 48 additions and 48 deletions
build.gradle
fabric-biome-api-v1
fabric-events-interaction-v0
fabric-item-api-v1
build.gradle
src/main
fabric-loot-tables-v1
fabric-object-builder-api-v1
fabric-renderer-registries-v1
build.gradle
src/main/java/net/fabricmc/fabric
api/client/rendereregistry/v1
impl/client/renderer/registry
mixin/client/renderer/registry
fabric-resource-loader-v0
fabric-screen-handler-api-v1
fabric-tool-attribute-api-v1
|
@ -18,9 +18,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.25.5"
|
||||
static def mcVersion = "20w45a"
|
||||
static def yarnVersion = "+build.10"
|
||||
static def baseVersion = "0.25.6"
|
||||
static def mcVersion = "20w46a"
|
||||
static def yarnVersion = "+build.2"
|
||||
static def loaderVersion = "0.10.5+build.213"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-biome-api-v1"
|
||||
version = getSubprojectVersion(project, "3.0.0")
|
||||
version = getSubprojectVersion(project, "3.0.1")
|
||||
|
||||
minecraft {
|
||||
accessWidener = file("src/main/resources/fabric-biome-api-v1.accesswidener")
|
||||
|
|
|
@ -159,7 +159,7 @@ public final class BiomeSelectors {
|
|||
SpawnSettings spawnSettings = context.getBiome().getSpawnSettings();
|
||||
|
||||
for (SpawnGroup spawnGroup : SpawnGroup.values()) {
|
||||
for (SpawnSettings.SpawnEntry spawnEntry : spawnSettings.getSpawnEntry(spawnGroup)) {
|
||||
for (SpawnSettings.SpawnEntry spawnEntry : spawnSettings.getSpawnEntries(spawnGroup)) {
|
||||
if (entityTypes.contains(spawnEntry.type)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-events-interaction-v0"
|
||||
version = getSubprojectVersion(project, "0.4.2")
|
||||
version = getSubprojectVersion(project, "0.4.3")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -66,9 +66,9 @@ public abstract class MixinMinecraftClient {
|
|||
info.cancel();
|
||||
|
||||
// I don't like that we clone vanilla logic here, but it's our best bet for now.
|
||||
PlayerInventory playerInventory = client.player.method_31548();
|
||||
PlayerInventory playerInventory = client.player.getInventory();
|
||||
|
||||
if (client.player.method_31549().creativeMode && Screen.hasControlDown() && client.crosshairTarget.getType() == HitResult.Type.BLOCK) {
|
||||
if (client.player.getAbilities().creativeMode && Screen.hasControlDown() && client.crosshairTarget.getType() == HitResult.Type.BLOCK) {
|
||||
BlockEntity be = client.world.getBlockEntity(((BlockHitResult) client.crosshairTarget).getBlockPos());
|
||||
|
||||
if (be != null) {
|
||||
|
@ -82,7 +82,7 @@ public abstract class MixinMinecraftClient {
|
|||
return;
|
||||
}
|
||||
|
||||
if (client.player.method_31549().creativeMode) {
|
||||
if (client.player.getAbilities().creativeMode) {
|
||||
playerInventory.addPickBlock(stack);
|
||||
client.interactionManager.clickCreativeStack(client.player.getStackInHand(Hand.MAIN_HAND), 36 + playerInventory.selectedSlot);
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-item-api-v1"
|
||||
version = getSubprojectVersion(project, "1.2.0")
|
||||
version = getSubprojectVersion(project, "1.2.1")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -23,16 +23,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.EquipmentSlotProvider;
|
||||
import net.fabricmc.fabric.impl.item.ItemExtensions;
|
||||
|
||||
@Mixin(MobEntity.class)
|
||||
abstract class MobEntityMixin {
|
||||
@Inject(method = "getPreferredEquipmentSlot", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
@Mixin(LivingEntity.class)
|
||||
abstract class LivingEntityMixin {
|
||||
@Inject(method = "method_32326", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private static void onGetPreferredEquipmentSlot(ItemStack stack, CallbackInfoReturnable<EquipmentSlot> info, Item item) {
|
||||
EquipmentSlotProvider equipmentSlotProvider = ((ItemExtensions) item).fabric_getEquipmentSlotProvider();
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
"mixins": [
|
||||
"ItemStackMixin",
|
||||
"ItemMixin",
|
||||
"MobEntityMixin"
|
||||
"LivingEntityMixin"
|
||||
],
|
||||
"client": [
|
||||
"client.ItemStackMixin"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-loot-tables-v1"
|
||||
version = getSubprojectVersion(project, "1.0.1")
|
||||
version = getSubprojectVersion(project, "1.0.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.loot.v1;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.loot.LootPool;
|
||||
import net.minecraft.loot.LootTableRange;
|
||||
import net.minecraft.class_5658;
|
||||
import net.minecraft.loot.condition.LootCondition;
|
||||
import net.minecraft.loot.entry.LootPoolEntry;
|
||||
import net.minecraft.loot.function.LootFunction;
|
||||
|
@ -36,5 +36,5 @@ public interface FabricLootPool {
|
|||
List<LootPoolEntry> getEntries();
|
||||
List<LootCondition> getConditions();
|
||||
List<LootFunction> getFunctions();
|
||||
LootTableRange getRolls();
|
||||
class_5658 getRolls();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ package net.fabricmc.fabric.api.loot.v1;
|
|||
|
||||
import net.minecraft.loot.condition.LootCondition;
|
||||
import net.minecraft.loot.LootPool;
|
||||
import net.minecraft.loot.LootTableRange;
|
||||
import net.minecraft.class_5658;
|
||||
import net.minecraft.loot.entry.LootPoolEntry;
|
||||
import net.minecraft.loot.function.LootFunction;
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class FabricLootPoolBuilder extends LootPool.Builder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public FabricLootPoolBuilder rolls(LootTableRange range) {
|
||||
public FabricLootPoolBuilder rolls(class_5658 range) {
|
||||
super.rolls(range);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import net.minecraft.loot.LootPool;
|
||||
import net.minecraft.loot.LootTableRange;
|
||||
import net.minecraft.class_5658;
|
||||
import net.minecraft.loot.condition.LootCondition;
|
||||
import net.minecraft.loot.entry.LootPoolEntry;
|
||||
import net.minecraft.loot.function.LootFunction;
|
||||
|
@ -63,5 +63,5 @@ public abstract class MixinLootPool implements FabricLootPool {
|
|||
|
||||
@Accessor
|
||||
@Override
|
||||
public abstract LootTableRange getRolls();
|
||||
public abstract class_5658 getRolls();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class LootTest implements ModInitializer {
|
|||
LootPool pool = FabricLootPoolBuilder.builder()
|
||||
.withEntry(ItemEntry.builder(Items.FEATHER).build())
|
||||
.withEntry(entryFromString)
|
||||
.rolls(ConstantLootTableRange.create(1))
|
||||
.rolls(ConstantLootTableRange.method_32448(1))
|
||||
.withCondition(SurvivesExplosionLootCondition.builder().build())
|
||||
.build();
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-object-builder-api-v1"
|
||||
version = getSubprojectVersion(project, "1.10.1")
|
||||
version = getSubprojectVersion(project, "1.10.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -2,4 +2,4 @@ accessWidener v1 named
|
|||
extendable method net/minecraft/block/AbstractBlock$Settings <init> (Lnet/minecraft/block/Material;Ljava/util/function/Function;)V
|
||||
extendable method net/minecraft/block/AbstractBlock$Settings <init> (Lnet/minecraft/block/Material;Lnet/minecraft/block/MapColor;)V
|
||||
|
||||
extendable class net/minecraft/block/entity/BlockEntityType$class_5559
|
||||
extendable class net/minecraft/block/entity/BlockEntityType$BlockEntityFactory
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-renderer-registries-v1"
|
||||
version = getSubprojectVersion(project, "3.0.1")
|
||||
version = getSubprojectVersion(project, "3.0.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -18,7 +18,7 @@ package net.fabricmc.fabric.api.client.rendereregistry.v1;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.class_5614;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
|
||||
|
@ -39,5 +39,5 @@ public interface BlockEntityRendererRegistry {
|
|||
* class is already loaded
|
||||
* @param <E> the {@link BlockEntity}
|
||||
*/
|
||||
<E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, class_5614<E> blockEntityRendererFactory);
|
||||
<E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<E> blockEntityRendererFactory);
|
||||
}
|
||||
|
|
|
@ -21,20 +21,20 @@ import java.util.function.BiConsumer;
|
|||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.class_5614;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
|
||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
||||
|
||||
public class BlockEntityRendererRegistryImpl implements BlockEntityRendererRegistry {
|
||||
private static HashMap<BlockEntityType<?>, class_5614<?>> map = new HashMap<>();
|
||||
private static BiConsumer<BlockEntityType<?>, class_5614<?>> handler = (type, function) -> map.put(type, function);
|
||||
private static HashMap<BlockEntityType<?>, BlockEntityRendererFactory<?>> map = new HashMap<>();
|
||||
private static BiConsumer<BlockEntityType<?>, BlockEntityRendererFactory<?>> handler = (type, function) -> map.put(type, function);
|
||||
|
||||
@Override
|
||||
public <E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, class_5614<E> blockEntityRendererFactory) {
|
||||
public <E extends BlockEntity> void register(BlockEntityType<E> blockEntityType, BlockEntityRendererFactory<E> blockEntityRendererFactory) {
|
||||
handler.accept(blockEntityType, blockEntityRendererFactory);
|
||||
}
|
||||
|
||||
public static void setup(BiConsumer<BlockEntityType<?>, class_5614<?>> vanillaHandler) {
|
||||
public static void setup(BiConsumer<BlockEntityType<?>, BlockEntityRendererFactory<?>> vanillaHandler) {
|
||||
map.forEach(vanillaHandler);
|
||||
handler = vanillaHandler;
|
||||
}
|
||||
|
|
|
@ -25,20 +25,20 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.class_5614;
|
||||
import net.minecraft.class_5616;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
|
||||
import net.fabricmc.fabric.impl.client.renderer.registry.BlockEntityRendererRegistryImpl;
|
||||
|
||||
@Mixin(class_5616.class)
|
||||
@Mixin(BlockEntityRendererFactories.class)
|
||||
public abstract class MixinBlockEntityRenderers {
|
||||
@Shadow()
|
||||
@Final
|
||||
private static Map<BlockEntityType<?>, class_5614<?>> field_27752;
|
||||
private static Map<BlockEntityType<?>, BlockEntityRendererFactory<?>> FACTORIES;
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "<clinit>*")
|
||||
private static void init(CallbackInfo ci) {
|
||||
BlockEntityRendererRegistryImpl.setup(((t, factory) -> field_27752.put(t, factory)));
|
||||
BlockEntityRendererRegistryImpl.setup(((t, factory) -> FACTORIES.put(t, factory)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.class_5617;
|
||||
import net.minecraft.class_5619;
|
||||
import net.minecraft.client.render.entity.EntityRenderers;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.render.entity.EntityRenderer;
|
||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||
|
@ -40,7 +40,7 @@ import net.fabricmc.fabric.api.client.rendereregistry.v1.LivingEntityFeatureRend
|
|||
import net.fabricmc.fabric.impl.client.renderer.registry.RegistrationHelperImpl;
|
||||
import net.fabricmc.fabric.impl.client.renderer.registry.EntityRendererRegistryImpl;
|
||||
|
||||
@Mixin(class_5619.class)
|
||||
@Mixin(EntityRenderers.class)
|
||||
public abstract class MixinEntityRenderers {
|
||||
@Shadow()
|
||||
@Final
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
archivesBaseName = "fabric-resource-loader-v0"
|
||||
version = getSubprojectVersion(project, "0.3.2")
|
||||
version = getSubprojectVersion(project, "0.3.3")
|
||||
|
|
|
@ -67,7 +67,7 @@ public final class ModResourcePackUtil {
|
|||
description = description.replaceAll("\"", "\\\"");
|
||||
}
|
||||
|
||||
String pack = String.format("{\"pack\":{\"pack_format\":" + type.method_31438(SharedConstants.getGameVersion()) + ",\"description\":\"%s\"}}", description);
|
||||
String pack = String.format("{\"pack\":{\"pack_format\":" + type.getPackVersion(SharedConstants.getGameVersion()) + ",\"description\":\"%s\"}}", description);
|
||||
return IOUtils.toInputStream(pack, Charsets.UTF_8);
|
||||
default:
|
||||
return null;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-screen-handler-api-v1"
|
||||
version = getSubprojectVersion(project, "1.1.1")
|
||||
version = getSubprojectVersion(project, "1.1.3")
|
||||
|
||||
minecraft {
|
||||
accessWidener = file('src/main/resources/fabric-screen-handler-api-v1.accesswidener')
|
||||
|
|
|
@ -73,8 +73,8 @@ public final class ClientNetworking implements ClientModInitializer {
|
|||
PlayerEntity player = client.player;
|
||||
|
||||
Screen screen = screenFactory.create(
|
||||
((ExtendedScreenHandlerType<?>) type).create(syncId, player.method_31548(), buf),
|
||||
player.method_31548(),
|
||||
((ExtendedScreenHandlerType<?>) type).create(syncId, player.getInventory(), buf),
|
||||
player.getInventory(),
|
||||
title
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-tool-attribute-api-v1"
|
||||
version = getSubprojectVersion(project, "1.2.6")
|
||||
version = getSubprojectVersion(project, "1.2.7")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -175,7 +175,7 @@ public final class ToolManagerImpl {
|
|||
*/
|
||||
public static boolean handleIsEffectiveOnIgnoresVanilla(BlockState state, ItemStack stack, @Nullable LivingEntity user, boolean vanillaResult) {
|
||||
for (Map.Entry<Tag<Item>, Event<ToolHandler>> eventEntry : HANDLER_MAP.entrySet()) {
|
||||
if (stack.method_31573(eventEntry.getKey())) {
|
||||
if (stack.isIn(eventEntry.getKey())) {
|
||||
ActionResult effective = eventEntry.getValue().invoker().isEffectiveOn(eventEntry.getKey(), state, stack, user);
|
||||
if (effective.isAccepted()) return true;
|
||||
effective = general().invoker().isEffectiveOn(eventEntry.getKey(), state, stack, user);
|
||||
|
@ -194,7 +194,7 @@ public final class ToolManagerImpl {
|
|||
boolean handled = false;
|
||||
|
||||
for (Map.Entry<Tag<Item>, Event<ToolHandler>> eventEntry : HANDLER_MAP.entrySet()) {
|
||||
if (stack.method_31573(eventEntry.getKey())) {
|
||||
if (stack.isIn(eventEntry.getKey())) {
|
||||
TypedActionResult<Float> speedMultiplier = Objects.requireNonNull(eventEntry.getValue().invoker().getMiningSpeedMultiplier(eventEntry.getKey(), state, stack, user));
|
||||
|
||||
if (speedMultiplier.getResult().isAccepted()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue