mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 01:44:27 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -31,7 +31,7 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
public class BlockBannerRenderer extends BlockRendererInterface {
|
||||
|
||||
public static final ModelLegacyBanner legacyBanner = new ModelLegacyBanner();
|
||||
public static final ModelLegacyBannerFlag legacyFlag = new ModelLegacyBannerFlag();
|
||||
@@ -39,40 +39,40 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
public static final ModelBannerFloor banner = new ModelBannerFloor();
|
||||
public static final ModelBannerFloorFlag flag = new ModelBannerFloorFlag();
|
||||
|
||||
public static final ResourceLocation legacyFlagResource = new ResourceLocation("customnpcs","textures/models/legacy/banner.png");
|
||||
public static final ResourceLocation legacyFlagResource = new ResourceLocation("customnpcs", "textures/models/legacy/banner.png");
|
||||
|
||||
public static final ResourceLocation normalFlag = new ResourceLocation("customnpcs","textures/models/banner/flag/normal.png");
|
||||
public static final ResourceLocation pointyFlag = new ResourceLocation("customnpcs","textures/models/banner/flag/pointy.png");
|
||||
public static final ResourceLocation triangleFlag = new ResourceLocation("customnpcs","textures/models/banner/flag/triangle.png");
|
||||
public static final ResourceLocation tornFlag = new ResourceLocation("customnpcs","textures/models/banner/flag/torn.png");
|
||||
public static final ResourceLocation curvedFlag = new ResourceLocation("customnpcs","textures/models/banner/flag/curved.png");
|
||||
public static final ResourceLocation normalFlag = new ResourceLocation("customnpcs", "textures/models/banner/flag/normal.png");
|
||||
public static final ResourceLocation pointyFlag = new ResourceLocation("customnpcs", "textures/models/banner/flag/pointy.png");
|
||||
public static final ResourceLocation triangleFlag = new ResourceLocation("customnpcs", "textures/models/banner/flag/triangle.png");
|
||||
public static final ResourceLocation tornFlag = new ResourceLocation("customnpcs", "textures/models/banner/flag/torn.png");
|
||||
public static final ResourceLocation curvedFlag = new ResourceLocation("customnpcs", "textures/models/banner/flag/curved.png");
|
||||
|
||||
protected static final ResourceLocation BannerWood = new ResourceLocation("customnpcs","textures/models/banner/BannerFloorWood.png");
|
||||
protected static final ResourceLocation BannerStone = new ResourceLocation("customnpcs","textures/models/banner/BannerFloorStone.png");
|
||||
protected static final ResourceLocation BannerIron = new ResourceLocation("customnpcs","textures/models/banner/BannerFloorIron.png");
|
||||
protected static final ResourceLocation BannerGold = new ResourceLocation("customnpcs","textures/models/banner/BannerFloorGold.png");
|
||||
protected static final ResourceLocation BannerDiamond = new ResourceLocation("customnpcs","textures/models/banner/BannerFloorDiamond.png");
|
||||
protected static final ResourceLocation BannerWood = new ResourceLocation("customnpcs", "textures/models/banner/BannerFloorWood.png");
|
||||
protected static final ResourceLocation BannerStone = new ResourceLocation("customnpcs", "textures/models/banner/BannerFloorStone.png");
|
||||
protected static final ResourceLocation BannerIron = new ResourceLocation("customnpcs", "textures/models/banner/BannerFloorIron.png");
|
||||
protected static final ResourceLocation BannerGold = new ResourceLocation("customnpcs", "textures/models/banner/BannerFloorGold.png");
|
||||
protected static final ResourceLocation BannerDiamond = new ResourceLocation("customnpcs", "textures/models/banner/BannerFloorDiamond.png");
|
||||
|
||||
public BlockBannerRenderer(){
|
||||
((BlockBanner)CustomItems.banner).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
public BlockBannerRenderer() {
|
||||
((BlockBanner) CustomItems.banner).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
|
||||
double var6, float var8) {
|
||||
TileBanner tile = (TileBanner) var1;
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
|
||||
double var6, float var8) {
|
||||
TileBanner tile = (TileBanner) var1;
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f);
|
||||
GL11.glTranslatef((float) var2 + 0.5f, (float) var4 + 1.5f, (float) var6 + 0.5f);
|
||||
//GL11.glScalef(0.95f, 0.95f, 0.95f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
if(ConfigClient.LegacyBanner){
|
||||
if (ConfigClient.LegacyBanner) {
|
||||
setMaterialTexture(var1.getBlockMetadata());
|
||||
legacyBanner.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
|
||||
@@ -83,11 +83,10 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
if(tile.icon != null && !this.playerTooFar(tile)){
|
||||
if (tile.icon != null && !this.playerTooFar(tile)) {
|
||||
doRender(var2, var4, var6, tile.rotation, tile.icon, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
long worldTime = tile.getWorldObj() != null ? tile.getWorldObj().getTotalWorldTime() : 0;
|
||||
// 100 is one full revolution, so we can just mod by 100 without affecting the result
|
||||
int animationProgress100 = (((tile.xCoord % 100) * 7 + (tile.yCoord % 100) * 9 + (tile.zCoord % 100) * 13) + (int) (worldTime % 100)) % 100;
|
||||
@@ -99,7 +98,7 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
banner.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
|
||||
setFlagType(tile.bannerTrim);
|
||||
float[] color = ColorUtil.hexToRGB(tile.color);
|
||||
float[] color = ColorUtil.hexToRGB(tile.color);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f(color[0], color[1], color[2]);
|
||||
flag.render(null, 0, 0, 0, f3, 0.0F, 0.0625F);
|
||||
@@ -107,23 +106,22 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
if(tile.icon != null && !this.playerTooFar(tile)){
|
||||
if (tile.icon != null && !this.playerTooFar(tile)) {
|
||||
doRender(var2, var4, var6, tile.rotation, tile.icon, angle_x);
|
||||
}
|
||||
}
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
public void doRender(double par2, double par4, double par6, int meta, ItemStack iicon, float rotate)
|
||||
{
|
||||
}
|
||||
|
||||
public void doRender(double par2, double par4, double par6, int meta, ItemStack iicon, float rotate) {
|
||||
GL11.glPushMatrix();
|
||||
bindTexture(TextureMap.locationItemsTexture);
|
||||
GL11.glTranslatef((float)par2 + 0.5f, (float)par4 +1.3f, (float)par6 + 0.5f);
|
||||
GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 1.3f, (float) par6 + 0.5f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90 * meta, 0, 1, 0);
|
||||
if(ConfigClient.LegacyBanner){
|
||||
GL11.glRotatef(90 * meta, 0, 1, 0);
|
||||
if (ConfigClient.LegacyBanner) {
|
||||
GL11.glTranslatef(0, 0, -0.14f);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GL11.glTranslatef(0, 0, -0.075f);
|
||||
|
||||
GL11.glTranslatef(0, -0.6f, 0); // Translate to pivot point
|
||||
@@ -173,8 +171,7 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
public void renderItemBanner(TextureManager txtMng, ItemStack item, int p_77015_4_, int p_77015_5_, boolean renderEffect)
|
||||
{
|
||||
public void renderItemBanner(TextureManager txtMng, ItemStack item, int p_77015_4_, int p_77015_5_, boolean renderEffect) {
|
||||
Object object = item.getIconIndex();
|
||||
int l;
|
||||
float f;
|
||||
@@ -187,18 +184,16 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
ResourceLocation resourcelocation = txtMng.getResourceLocation(item.getItemSpriteNumber());
|
||||
txtMng.bindTexture(resourcelocation);
|
||||
|
||||
if (object == null)
|
||||
{
|
||||
object = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
if (object == null) {
|
||||
object = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
l = item.getItem().getColorFromItemStack(item, 0);
|
||||
f3 = (float)(l >> 16 & 255) / 255.0F;
|
||||
f4 = (float)(l >> 8 & 255) / 255.0F;
|
||||
f = (float)(l & 255) / 255.0F;
|
||||
f3 = (float) (l >> 16 & 255) / 255.0F;
|
||||
f4 = (float) (l >> 8 & 255) / 255.0F;
|
||||
f = (float) (l & 255) / 255.0F;
|
||||
|
||||
if (renderer.renderWithColor)
|
||||
{
|
||||
if (renderer.renderWithColor) {
|
||||
GL11.glColor4f(f3, f4, f, 1.0F);
|
||||
}
|
||||
|
||||
@@ -206,50 +201,50 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
renderer.renderIcon(p_77015_4_, p_77015_5_, (IIcon)object, 16, 16);
|
||||
renderer.renderIcon(p_77015_4_, p_77015_5_, (IIcon) object, 16, 16);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
if (renderEffect && item.hasEffect(0))
|
||||
{
|
||||
if (renderEffect && item.hasEffect(0)) {
|
||||
renderer.renderEffect(txtMng, p_77015_4_, p_77015_5_);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId,
|
||||
RenderBlocks renderer) {}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return CustomItems.banner.getRenderType();
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return CustomItems.banner.getRenderType();
|
||||
}
|
||||
|
||||
public int specialRenderDistance(){
|
||||
return 26;
|
||||
}
|
||||
public int specialRenderDistance() {
|
||||
return 26;
|
||||
}
|
||||
|
||||
public static void setBannerMaterial(int meta){
|
||||
public static void setBannerMaterial(int meta) {
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
if(meta == 1)
|
||||
if (meta == 1)
|
||||
manager.bindTexture(BannerStone);
|
||||
else if(meta == 2)
|
||||
else if (meta == 2)
|
||||
manager.bindTexture(BannerIron);
|
||||
else if(meta == 3)
|
||||
else if (meta == 3)
|
||||
manager.bindTexture(BannerGold);
|
||||
else if(meta == 4)
|
||||
else if (meta == 4)
|
||||
manager.bindTexture(BannerDiamond);
|
||||
else
|
||||
manager.bindTexture(BannerWood);
|
||||
}
|
||||
|
||||
public static void setFlagType(EnumBannerVariant variant){
|
||||
public static void setFlagType(EnumBannerVariant variant) {
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
switch (variant){
|
||||
switch (variant) {
|
||||
case Pointy:
|
||||
manager.bindTexture(pointyFlag);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user