Fixed up slanted belt render
1
.gitignore
vendored
|
@ -12,6 +12,7 @@ CHANGELOG
|
||||||
!/models/
|
!/models/
|
||||||
!info.txt
|
!info.txt
|
||||||
!publish.bat
|
!publish.bat
|
||||||
|
!publish_obf.bat
|
||||||
!include.bat
|
!include.bat
|
||||||
!buildlocal.bat
|
!buildlocal.bat
|
||||||
!/README
|
!/README
|
52
publish_obf.bat
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
::ASSEMBLY LINE BUILDER
|
||||||
|
@echo off
|
||||||
|
echo Promotion Type? (Choose * for recommended, @ for stable and x for unstable)
|
||||||
|
set /p PROMOTION=
|
||||||
|
|
||||||
|
set /p MODVERSION=<modversion.txt
|
||||||
|
set /p CurrentBuild=<buildnumber.txt
|
||||||
|
set /a BUILD_NUMBER=%CurrentBuild%+1
|
||||||
|
|
||||||
|
set NAME=AssemblyLine_v%MODVERSION%.%BUILD_NUMBER%
|
||||||
|
set FILE_NAME=%NAME%.jar
|
||||||
|
set TEMP_FILE=%NAME%_temp.jar
|
||||||
|
set TEMP_FILE2=%NAME%_temp2.jar
|
||||||
|
set TEMP_FOLDER=%NAME%_temp
|
||||||
|
set API_NAME=%NAME%_api.zip
|
||||||
|
set BACKUP_NAME=%NAME%_backup.zip
|
||||||
|
|
||||||
|
echo Starting to build %NAME%
|
||||||
|
|
||||||
|
::BUILD
|
||||||
|
::runtime\bin\python\python_mcp runtime\recompile.py %*
|
||||||
|
::runtime\bin\python\python_mcp runtime\reobfuscate.py %*
|
||||||
|
|
||||||
|
::ZIP-UP
|
||||||
|
cd reobf\minecraft\
|
||||||
|
"..\..\..\7za.exe" a "..\..\builds\%TEMP_FILE_NAME%" "*"
|
||||||
|
cd ..\..\
|
||||||
|
cd resources\
|
||||||
|
"..\..\7za.exe" a "..\builds\%FILE_NAME%" "*"
|
||||||
|
"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*" -pdarkguardsman
|
||||||
|
cd ..\
|
||||||
|
cd src\
|
||||||
|
"..\..\7za.exe" a "..\builds\%BACKUP_NAME%" "*\assemblyline\" -pdarkguardsman
|
||||||
|
"..\..\7za.exe" a "..\builds\%API_NAME%" "*\assemblyline\api\"
|
||||||
|
cd ..\
|
||||||
|
|
||||||
|
::Obfuscation
|
||||||
|
echo Injector Minecraft Source
|
||||||
|
cd obf_minecraft
|
||||||
|
"..\..\7za.exe" a "..\builds\%TEMP_FILE_NAME%" "*"
|
||||||
|
cd ..\
|
||||||
|
echo Obfuscating...
|
||||||
|
java -jar "retroguard.jar" "builds\%TEMP_FILE_NAME%" "builds\%TEMP_FILE2%" obf.rgs
|
||||||
|
echo Repacking
|
||||||
|
"..\7za.exe" x "builds\%TEMP_FILE_NAME%" "builds\%TEMP_FOLDER%"
|
||||||
|
cd "builds\%TEMP_FOLDER%"
|
||||||
|
"..\..\..\7za.exe" a "..\..\builds\%FILE_NAME%" "*"
|
||||||
|
cd ..\..\
|
||||||
|
|
||||||
|
echo Done building %NAME%
|
||||||
|
|
||||||
|
pause
|
Before Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 407 B |
Before Width: | Height: | Size: 1,018 B |
|
@ -16,8 +16,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderConveyorBelt extends TileEntitySpecialRenderer
|
public class RenderConveyorBelt extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
private ModelConveyorBelt model = new ModelConveyorBelt();
|
public static final ModelConveyorBelt MODEL = new ModelConveyorBelt();
|
||||||
private ModelAngledBelt model2 = new ModelAngledBelt();
|
public static final ModelAngledBelt MODEL2 = new ModelAngledBelt();
|
||||||
|
|
||||||
private void renderAModelAt(TileEntityConveyorBelt tileEntity, double x, double y, double z, float f)
|
private void renderAModelAt(TileEntityConveyorBelt tileEntity, double x, double y, double z, float f)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,6 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
if (slantType != null && slantType != SlantType.NONE)
|
if (slantType != null && slantType != SlantType.NONE)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (face)
|
switch (face)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -50,18 +49,18 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "slantedbelt/frame" + frame + ".png");
|
||||||
|
|
||||||
if (slantType == SlantType.UP)
|
if (slantType == SlantType.UP)
|
||||||
{
|
{
|
||||||
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "slantedbelt/Upframe0.png");
|
GL11.glTranslatef(0f, 0.8f, -0.8f);
|
||||||
//GL11.glRotatef(-90f, 1f, 0f, 0f);
|
GL11.glRotatef(180f, 0f, 1f, 1f);
|
||||||
model2.render(0.0625F);
|
MODEL2.render(0.0625F);
|
||||||
}
|
}
|
||||||
else if (slantType == SlantType.DOWN)
|
else
|
||||||
{
|
{
|
||||||
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "slantedbelt/frame"+frame+".png");
|
|
||||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||||
model2.render(0.0625F);
|
MODEL2.render(0.0625F);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -81,8 +80,9 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
|
||||||
GL11.glRotatef(90f, 0f, 1f, 0f);
|
GL11.glRotatef(90f, 0f, 1f, 0f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "belt/frame" + frame + ".png");
|
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "belt/frame" + frame + ".png");
|
||||||
model.render(0.0625F, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false);
|
MODEL.render(0.0625F, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class AssemblyLine
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockCrate, new Object[] { "TST", "S S", "TST", 'S', "ingotSteel", 'T', Item.stick }));
|
GameRegistry.addRecipe(new ShapedOreRecipe(blockCrate, new Object[] { "TST", "S S", "TST", 'S', "ingotSteel", 'T', Item.stick }));
|
||||||
|
|
||||||
// Conveyor Belt
|
// Conveyor Belt
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 8), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" }));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', "ingotSteel", 'W', Block.wood, 'M', "motor" }));
|
||||||
|
|
||||||
// Rejector
|
// Rejector
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "WPW", "@R@", '@', "plateSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" }));
|
GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "WPW", "@R@", '@', "plateSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" }));
|
||||||
|
|
|
@ -32,7 +32,8 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements
|
||||||
NONE, UP, DOWN
|
NONE, UP, DOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int NUM_FRAMES = 13;
|
public static final int MAX_FRAME = 13;
|
||||||
|
public static final int MAX_SLANT_FRAME = 23;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joules required to run this thing.
|
* Joules required to run this thing.
|
||||||
|
@ -41,14 +42,12 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements
|
||||||
public final float maxSpeed = 0.1f;
|
public final float maxSpeed = 0.1f;
|
||||||
|
|
||||||
public float wheelRotation = 0;
|
public float wheelRotation = 0;
|
||||||
public int animFrame = 0; // this is from 0 to 15
|
private int animFrame = 0; // this is from 0 to 15
|
||||||
private SlantType slantType = SlantType.NONE;
|
private SlantType slantType = SlantType.NONE;
|
||||||
|
|
||||||
public TileEntityConveyorBelt()
|
public TileEntityConveyorBelt()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
// ElectricityConnections.registerConnector(this, EnumSet.of(ForgeDirection.DOWN,
|
|
||||||
// ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.NORTH, ForgeDirection.SOUTH));
|
|
||||||
ElectricityConnections.registerConnector(this, EnumSet.of(ForgeDirection.DOWN));
|
ElectricityConnections.registerConnector(this, EnumSet.of(ForgeDirection.DOWN));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,18 +119,30 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements
|
||||||
|
|
||||||
if (this.isRunning())
|
if (this.isRunning())
|
||||||
{
|
{
|
||||||
// System.out.println(FMLCommonHandler.instance().getEffectiveSide());
|
|
||||||
this.wheelRotation += 40;
|
this.wheelRotation += 40;
|
||||||
|
|
||||||
if (this.wheelRotation > 360)
|
if (this.wheelRotation > 360)
|
||||||
this.wheelRotation = 0;
|
this.wheelRotation = 0;
|
||||||
|
|
||||||
float wheelRotPct = wheelRotation / 360f;
|
float wheelRotPct = wheelRotation / 360f;
|
||||||
animFrame = (int) (wheelRotPct * NUM_FRAMES); // sync the animation
|
|
||||||
if (animFrame < 0)
|
// Sync the animation. Slant belts are slower.
|
||||||
animFrame = 0;
|
if (this.getSlant() == SlantType.NONE)
|
||||||
if (animFrame > NUM_FRAMES)
|
{
|
||||||
animFrame = NUM_FRAMES;
|
this.animFrame = (int) (wheelRotPct * MAX_FRAME);
|
||||||
|
if (this.animFrame < 0)
|
||||||
|
this.animFrame = 0;
|
||||||
|
if (this.animFrame > MAX_FRAME)
|
||||||
|
this.animFrame = MAX_FRAME;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.animFrame = (int) (wheelRotPct * MAX_SLANT_FRAME);
|
||||||
|
if (this.animFrame < 0)
|
||||||
|
this.animFrame = 0;
|
||||||
|
if (this.animFrame > MAX_SLANT_FRAME)
|
||||||
|
this.animFrame = MAX_SLANT_FRAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -263,15 +274,31 @@ public class TileEntityConveyorBelt extends TileEntityAssemblyNetwork implements
|
||||||
public int getAnimationFrame()
|
public int getAnimationFrame()
|
||||||
{
|
{
|
||||||
TileEntity te = null;
|
TileEntity te = null;
|
||||||
te = worldObj.getBlockTileEntity(xCoord - 1, yCoord, zCoord);
|
te = this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord);
|
||||||
|
|
||||||
if (te != null)
|
if (te != null)
|
||||||
|
{
|
||||||
if (te instanceof TileEntityConveyorBelt)
|
if (te instanceof TileEntityConveyorBelt)
|
||||||
|
{
|
||||||
|
if (((TileEntityConveyorBelt) te).getSlant() == this.slantType)
|
||||||
return ((TileEntityConveyorBelt) te).getAnimationFrame();
|
return ((TileEntityConveyorBelt) te).getAnimationFrame();
|
||||||
te = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord - 1);
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
te = this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1);
|
||||||
|
|
||||||
if (te != null)
|
if (te != null)
|
||||||
|
{
|
||||||
if (te instanceof TileEntityConveyorBelt)
|
if (te instanceof TileEntityConveyorBelt)
|
||||||
|
{
|
||||||
|
if (((TileEntityConveyorBelt) te).getSlant() == this.slantType)
|
||||||
return ((TileEntityConveyorBelt) te).getAnimationFrame();
|
return ((TileEntityConveyorBelt) te).getAnimationFrame();
|
||||||
return animFrame;
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.animFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|