mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
1.15-pre1
This commit is contained in:
parent
6d6e6117b4
commit
f3d8141bae
17 changed files with 43 additions and 75 deletions
build.gradle
fabric-registry-sync-v0
build.gradle
src/main/java/net/fabricmc/fabric
fabric-renderer-api-v1
build.gradle
src/main/java/net/fabricmc/fabric
fabric-renderer-indigo
fabric-resource-loader-v0
fabric-textures-v0
build.gradle
src/main/java/net/fabricmc/fabric
src/main/resources
|
@ -12,9 +12,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.4.12"
|
||||
static def mcVersion = "19w46a"
|
||||
static def yarnVersion = "+build.1"
|
||||
static def baseVersion = "0.4.13"
|
||||
static def mcVersion = "1.15-pre1"
|
||||
static def yarnVersion = "+build.3"
|
||||
}
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
|
@ -56,7 +56,7 @@ allprojects {
|
|||
dependencies {
|
||||
minecraft "com.mojang:minecraft:$Globals.mcVersion"
|
||||
mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}"
|
||||
modCompile "net.fabricmc:fabric-loader:0.6.2+build.166"
|
||||
modCompile "net.fabricmc:fabric-loader:0.7.1+build.173"
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-registry-sync-v0"
|
||||
version = getSubprojectVersion(project, "0.2.5")
|
||||
version = getSubprojectVersion(project, "0.2.6")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class BlockInitTracker implements RegistryEntryAddedCallback<Block>
|
|||
|
||||
@Override
|
||||
public void onEntryAdded(int rawId, Identifier id, Block object) {
|
||||
object.getStateFactory().getStates().forEach(BlockState::initShapeCache);
|
||||
object.getStateManager().getStates().forEach(BlockState::initShapeCache);
|
||||
|
||||
// if false, getDropTableId() will generate an invalid drop table ID
|
||||
assert id.equals(registry.getId(object));
|
||||
|
|
|
@ -50,8 +50,8 @@ public class MixinBootstrap {
|
|||
Object oItem = Items.AIR;
|
||||
|
||||
// state ID tracking
|
||||
StateIdTracker.register(Registry.BLOCK, Block.STATE_IDS, (block) -> block.getStateFactory().getStates());
|
||||
StateIdTracker.register(Registry.FLUID, Fluid.STATE_IDS, (fluid) -> fluid.getStateFactory().getStates());
|
||||
StateIdTracker.register(Registry.BLOCK, Block.STATE_IDS, (block) -> block.getStateManager().getStates());
|
||||
StateIdTracker.register(Registry.FLUID, Fluid.STATE_IDS, (fluid) -> fluid.getStateManager().getStates());
|
||||
|
||||
// map tracking
|
||||
BiomeParentTracker.register(Registry.BIOME);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-renderer-api-v1"
|
||||
version = getSubprojectVersion(project, "0.2.6")
|
||||
version = getSubprojectVersion(project, "0.2.7")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.minecraft.client.MinecraftClient;
|
|||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.render.model.json.Transformation;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
|
@ -71,7 +72,7 @@ public abstract class ModelHelper {
|
|||
* <p>Retrieves sprites from the block texture atlas via {@link SpriteFinder}.
|
||||
*/
|
||||
public static List<BakedQuad>[] toQuadLists(Mesh mesh) {
|
||||
SpriteFinder finder = SpriteFinder.get(MinecraftClient.getInstance().getSpriteAtlas());
|
||||
SpriteFinder finder = SpriteFinder.get(MinecraftClient.getInstance().getBakedModelManager().method_24153(SpriteAtlasTexture.BLOCK_ATLAS_TEX));
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final ImmutableList.Builder<BakedQuad>[] builders = new ImmutableList.Builder[7];
|
||||
|
|
|
@ -19,6 +19,7 @@ package net.fabricmc.fabric.impl.renderer;
|
|||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.MissingSprite;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
|
@ -133,7 +134,7 @@ public class SpriteFinderImpl implements SpriteFinder {
|
|||
} else if (quadrant instanceof Node) {
|
||||
return ((Node) quadrant).find(u, v);
|
||||
} else {
|
||||
return MissingSprite.getMissingSprite();
|
||||
return MinecraftClient.getInstance().getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEX).apply(MissingSprite.getMissingSpriteId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-renderer-indigo"
|
||||
version = getSubprojectVersion(project, "0.2.13")
|
||||
version = getSubprojectVersion(project, "0.2.14")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -19,7 +19,7 @@ package net.fabricmc.fabric.impl.client.indigo;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.spongepowered.asm.lib.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
|
||||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
archivesBaseName = "fabric-resource-loader-v0"
|
||||
version = getSubprojectVersion(project, "0.1.8")
|
||||
version = getSubprojectVersion(project, "0.1.9")
|
||||
|
|
|
@ -14,24 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.api.client.texture;
|
||||
package net.fabricmc.fabric.mixin.resource.loader;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import net.minecraft.resource.ResourceManager;
|
||||
import net.minecraft.class_4729;
|
||||
import net.minecraft.resource.ResourcePack;
|
||||
|
||||
/**
|
||||
* Implement this interface on a Sprite to use a custom loading process instead
|
||||
* of the default (loading a .PNG).
|
||||
*/
|
||||
public interface CustomSpriteLoader {
|
||||
/**
|
||||
* Load the sprite.
|
||||
*
|
||||
* @param manager The resource manager.
|
||||
* @param mipLevel The mip level for this sprite atlas.
|
||||
* @return true if the sprite should be added to the atlas, false otherwise
|
||||
* @throws IOException
|
||||
*/
|
||||
boolean load(ResourceManager manager, int mipLevel) throws IOException;
|
||||
@Mixin(class_4729.class)
|
||||
public interface MixinClass_4729 {
|
||||
@Accessor
|
||||
ResourcePack getField_21766();
|
||||
}
|
|
@ -31,8 +31,9 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import net.minecraft.class_4729;
|
||||
import net.minecraft.resource.DefaultResourcePack;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.resource.DefaultClientResourcePack;
|
||||
import net.minecraft.resource.ReloadableResourceManager;
|
||||
import net.minecraft.resource.ResourcePack;
|
||||
import net.minecraft.resource.ResourceType;
|
||||
|
@ -54,7 +55,14 @@ public class MixinMinecraftGame {
|
|||
ResourcePack pack = oldList.get(i);
|
||||
list.add(pack);
|
||||
|
||||
if (pack instanceof DefaultClientResourcePack) {
|
||||
boolean isDefaultResources = pack instanceof DefaultResourcePack;
|
||||
|
||||
if (!isDefaultResources && pack instanceof class_4729) {
|
||||
MixinClass_4729 fixer = (MixinClass_4729) pack;
|
||||
isDefaultResources = fixer.getField_21766() instanceof DefaultResourcePack;
|
||||
}
|
||||
|
||||
if (isDefaultResources) {
|
||||
ModResourcePackUtil.appendModResourcePacks(list, ResourceType.CLIENT_RESOURCES);
|
||||
appended = true;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"MixinDefaultResourcePack"
|
||||
],
|
||||
"client": [
|
||||
"MixinClass_4729",
|
||||
"MixinKeyedResourceReloadListener$Client",
|
||||
"MixinMinecraftGame"
|
||||
],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-textures-v0"
|
||||
version = getSubprojectVersion(project, "0.1.5")
|
||||
version = getSubprojectVersion(project, "1.0.0")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -16,17 +16,12 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.client.texture;
|
||||
|
||||
import net.minecraft.client.resource.metadata.AnimationResourceMetadata;
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.PngFile;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
|
||||
public class FabricSprite extends Sprite {
|
||||
public FabricSprite(Identifier var1, int var2, int var3) {
|
||||
super(var1, var2, var3);
|
||||
}
|
||||
|
||||
public FabricSprite(Identifier identifier, PngFile pngFile, AnimationResourceMetadata animationResourceMetadata) {
|
||||
super(identifier, pngFile, animationResourceMetadata);
|
||||
public FabricSprite(SpriteAtlasTexture spriteAtlasTexture, Sprite.class_4727 class_4727, int mipmap, int u, int v, int x, int y, NativeImage nativeImage) {
|
||||
super(spriteAtlasTexture, class_4727, mipmap, u, v, x, y, nativeImage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.client.texture;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -43,7 +42,6 @@ import net.minecraft.util.crash.CrashException;
|
|||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
|
||||
import net.fabricmc.fabric.api.client.texture.CustomSpriteLoader;
|
||||
import net.fabricmc.fabric.api.client.texture.DependentSprite;
|
||||
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
|
||||
import net.fabricmc.fabric.impl.client.texture.SpriteAtlasTextureHooks;
|
||||
|
@ -73,7 +71,7 @@ public abstract class MixinSpriteAtlasTexture implements SpriteAtlasTextureHooks
|
|||
private Map<Identifier, Sprite> fabric_injectedSprites;
|
||||
|
||||
// Loads in custom sprite object injections.
|
||||
@Inject(at = @At("RETURN"), method = "loadSprites")
|
||||
@Inject(at = @At("RETURN"), method = "loadSprites(Lnet/minecraft/resource/ResourceManager;Ljava/util/Set;)Ljava/util/Collection;")
|
||||
private void afterLoadSprites(ResourceManager resourceManager_1, Set<Identifier> set_1, CallbackInfoReturnable<Collection<Sprite>> info) {
|
||||
if (fabric_injectedSprites != null) {
|
||||
info.getReturnValue().addAll(fabric_injectedSprites.values());
|
||||
|
@ -164,32 +162,4 @@ public abstract class MixinSpriteAtlasTexture implements SpriteAtlasTextureHooks
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles CustomSpriteLoader.
|
||||
*/
|
||||
@Inject(at = @At("HEAD"), method = "loadSprite", cancellable = true)
|
||||
public void loadSprite(ResourceManager manager, Sprite sprite, CallbackInfoReturnable<Boolean> info) {
|
||||
// refer SpriteAtlasTexture.loadSprite
|
||||
if (sprite instanceof CustomSpriteLoader) {
|
||||
try {
|
||||
if (!((CustomSpriteLoader) sprite).load(manager, mipLevel)) {
|
||||
info.setReturnValue(false);
|
||||
return;
|
||||
}
|
||||
} catch (RuntimeException | IOException e) {
|
||||
FABRIC_LOGGER.error("Unable to load custom sprite {}: {}", sprite.getId(), e);
|
||||
info.setReturnValue(false);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
sprite.generateMipmaps(this.mipLevel);
|
||||
info.setReturnValue(true);
|
||||
} catch (Throwable e) {
|
||||
FABRIC_LOGGER.error("Unable to apply mipmap to custom sprite {}: {}", sprite.getId(), e);
|
||||
info.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.6.2",
|
||||
"fabricloader": ">=0.7.1",
|
||||
"minecraft": "~1.15-alpha.19.42.a"
|
||||
},
|
||||
"description": "Core API module providing key hooks and intercompatibility features."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue