Files
2019-02-24 22:29:41 +08:00

60 lines
2.9 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
@@ -50,12 +50,10 @@
this.originX = originInX;
this.originY = originInY;
this.rotated = rotatedIn;
- float f = (float)(0.009999999776482582D / (double)inX);
- float f1 = (float)(0.009999999776482582D / (double)inY);
- this.minU = (float)originInX / (float)((double)inX) + f;
- this.maxU = (float)(originInX + this.width) / (float)((double)inX) - f;
- this.minV = (float)originInY / (float)inY + f1;
- this.maxV = (float)(originInY + this.height) / (float)inY - f1;
+ this.minU = (float)originInX / (float)inX;
+ this.maxU = (float)(originInX + this.width) / (float)inX;
+ this.minV = (float)originInY / (float)inY;
+ this.maxV = (float)(originInY + this.height) / (float)inY;
}
public void copyFrom(TextureAtlasSprite atlasSpirit)
@@ -398,4 +396,39 @@
{
return "TextureAtlasSprite{name='" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}';
}
+
+ /*===================================== FORGE START =====================================*/
+ /**
+ * The result of this function determines is the below 'load' function is called, and the
+ * default vanilla loading code is bypassed completely.
+ * @param manager Main resource manager
+ * @param location File resource location
+ * @return True to use your own custom load code and bypass vanilla loading.
+ */
+ public boolean hasCustomLoader(net.minecraft.client.resources.IResourceManager manager, ResourceLocation location)
+ {
+ return false;
+ }
+
+ /**
+ * Load the specified resource as this sprite's data.
+ * Returning false from this function will prevent this icon from being stitched onto the master texture.
+ * @param manager Main resource manager
+ * @param location File resource location
+ * @param textureGetter accessor for dependencies. All of them will be loaded before this one
+ * @return False to prevent this Icon from being stitched
+ */
+ public boolean load(net.minecraft.client.resources.IResourceManager manager, ResourceLocation location, java.util.function.Function<ResourceLocation, TextureAtlasSprite> textureGetter)
+ {
+ return true;
+ }
+
+ /**
+ * @return all textures that should be loaded before this texture.
+ */
+ public java.util.Collection<ResourceLocation> getDependencies() {
+ return com.google.common.collect.ImmutableList.of();
+ }
+
+ /*===================================== FORGE END ======================================*/
}