Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
SuppressWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcl committed Feb 9, 2017
1 parent 34789a5 commit 48680ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
34 changes: 17 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ext.modversion = "${project.version_major}.${project.version_minor}.${project.ve
group = project.group
version = "${project.version_minecraft}-${modversion}"
compileJava.options.encoding = 'UTF-8'
compileApiJava.options.encoding = 'UTF-8'
compileApiJava.options.encoding = 'UTF-8'

idea {
module {
Expand Down Expand Up @@ -57,17 +57,17 @@ minecraft {
replace '${forgeversion}', project.version_forge
}

sourceSets {
api {
java {
srcDir "BnnWidget/src/api/java"
}
resources {
srcDir "BnnWidget/src/api/resources"
}
}
}

sourceSets {
api {
java {
srcDir "BnnWidget/src/api/java"
}
resources {
srcDir "BnnWidget/src/api/resources"
}
}
}

processResources {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', project.version
Expand Down Expand Up @@ -114,14 +114,14 @@ jar {
shadowJar {
from sourceSets.main.output
from sourceSets.api.output
relocate 'org.apache.http.entity.mime', 'com.kamesuta.mc.signpic.lib.org.apache.http.entity.mime'
relocate 'org.apache.http.entity.mime.content', 'com.kamesuta.mc.signpic.lib.org.apache.http.entity.mime.content'
relocate 'org.apache.http.entity.mime', 'com.kamesuta.mc.signpic.lib.org.apache.http.entity.mime'
relocate 'org.apache.http.entity.mime.content', 'com.kamesuta.mc.signpic.lib.org.apache.http.entity.mime.content'
classifier = project.hasProperty('extra_classifier') ? project.extra_classifier : 'universal'
manifest commonManifest
}

reobf {
shadowJar { mappingType = "SEARGE" }
shadowJar { mappingType = "SEARGE" }
}
tasks.reobfShadowJar.mustRunAfter shadowJar

Expand Down Expand Up @@ -212,6 +212,6 @@ if (project.hasProperty('api_key_curseforge') && project.hasProperty('extra_curs
changelog = ''

additionalArtifact devJar, sourceJar, apiJar
relatedProject 'bnnwidget'
relatedProject 'bnnwidget'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import com.kamesuta.mc.signpic.entry.content.Content;

import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.model.IBakedModel;
Expand Down Expand Up @@ -58,7 +56,8 @@ public CustomItemSignRenderer(final @Nonnull IBakedModel model) {
}

@Override
public @Nullable Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(final @Nullable TransformType cameraTransformType) {
@SuppressWarnings("deprecation")
public @Nullable Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(final @Nullable net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType cameraTransformType) {
final ItemStack itemStack = this.itemStack;
if (itemStack!=null&&cameraTransformType!=null) {
OpenGL.glPushMatrix();
Expand All @@ -78,7 +77,8 @@ public CustomItemSignRenderer(final @Nonnull IBakedModel model) {
return Pair.of(this, null);
}

public void renderItem(final @Nonnull TransformType type, final @Nullable ItemStack item) {
@SuppressWarnings("deprecation")
public void renderItem(final @Nonnull net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType type, final @Nullable ItemStack item) {
OpenGL.glPushMatrix();
OpenGL.glPushAttrib();
OpenGL.glDisable(GL_CULL_FACE);
Expand All @@ -88,7 +88,7 @@ public void renderItem(final @Nonnull TransformType type, final @Nullable ItemSt
// Size
final SizeData size01 = content!=null ? content.image.getSize() : SizeData.DefaultSize;
final SizeData size = attr.sizes.getMovie().get().aspectSize(size01);
if (type==TransformType.GUI) {
if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.GUI) {
OpenGL.glScalef(1f, -1f, 1f);
final float slot = 1f;
final SizeData size2 = ImageSizes.INNER.defineSize(size, slot, slot);
Expand All @@ -99,17 +99,17 @@ public void renderItem(final @Nonnull TransformType type, final @Nullable ItemSt
entry.gui.drawScreen(0, 0, 0f, 1f, size2.getWidth()/slot, size2.getHeight()/slot);
} else {
OpenGL.glScalef(1f, -1f, 1f);
if (type==TransformType.GROUND)
if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.GROUND)
OpenGL.glTranslatef(-size.getWidth()/2f, .25f, 0f);
else if (type==TransformType.FIXED) {
else if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.FIXED) {
final float f = 0.0078125F; // vanilla map offset
OpenGL.glTranslatef(-size.getWidth()/2f, .5f, f);
} else if (type==TransformType.FIRST_PERSON)
} else if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.FIRST_PERSON)
OpenGL.glTranslatef(-.25f, .25f, 0f);
else if (type==TransformType.THIRD_PERSON) {
else if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.THIRD_PERSON) {
OpenGL.glTranslatef(.25f, .25f, 0f);
OpenGL.glTranslatef(-size.getWidth(), 0f, 0f);
} else if (type==TransformType.HEAD)
} else if (type==net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.HEAD)
;// Minecraft 1.8.x doesn't support Item Head.
OpenGL.glTranslatef(0f, -size.getHeight(), 0f);
final OffsetData offset = attr.offsets.getMovie().get();
Expand Down Expand Up @@ -147,8 +147,9 @@ public boolean isBuiltInRenderer() {
}

@Override
public @Nullable ItemCameraTransforms getItemCameraTransforms() {
return ItemCameraTransforms.DEFAULT;
@Deprecated
public @Nullable net.minecraft.client.renderer.block.model.ItemCameraTransforms getItemCameraTransforms() {
return net.minecraft.client.renderer.block.model.ItemCameraTransforms.DEFAULT;
}

@Override
Expand Down

0 comments on commit 48680ad

Please sign in to comment.