jopi
Попрошайка
- 1,421
- 30
- 260
мат
короче я откуда-то взял участки кода где пытался сделать вращение, хз как но у меня не робит
код с TileEntity
(передача вращения уже есть просто остаток)
BaseModelBlockPresent
Модель:
код с TileEntity
(передача вращения уже есть просто остаток)
Java:
public BaseModelBlockPresent newRenderModel(int blockMetadata) {
if (this.model == null) {
this.model = new ModelBlockCNCMachine();
}
if (this.isWorking) {
if (this.model.value != this.thisRenderModel) {
this.model.value = this.thisRenderModel;
}
} else if (this.thisRenderModel == 0) {
if (this.model.value != 0) {
this.model.value = 0;
}
} else if (this.thisRenderModel > 0 && this.thisRenderModel < 10) {
this.model.value = this.thisRenderModel + 10;
}
return this.model;
}
Код:
package tco.tiny.blocks.models;
import net.minecraft.client.model.ModelBase;
public abstract class BaseModelBlockPresent extends ModelBase {
public int value;
public abstract void render();
}
Код:
//p.s. кусок кода только где вращение
public void render() {
float f5 = 0.0625f;
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
Shape8.render(f5);
Shape9.render(f5);
Shape10.render(f5);
Shape11.render(f5);
Shape12.render(f5);
Shape13.render(f5);
Shape14.render(f5);
Shape15.render(f5);
Shape16.render(f5);
Shape17.render(f5);
Shape18.render(f5);
Shape19.render(f5);
Shape21.render(f5);
//Shape20.render(f5);
Shape22.render(f5);
Shape23.render(f5);
switch(super.value) {
case 0:
this.non_rot();
break;
case 1:
this.rot();
break;
}
if (super.value > 0) {
if (super.value > 10) {
this.o = 0.0F;
return;
}
if ((this.o += 0.02F) >= 360.0F) {
this.o = 0.0F;
System.out.println("CODE: 360F");
}
} else {
this.o = 0.0F;
}
}
public void non_rot()
{
float f5 = 0.0625f;
Shape20.render(f5);
}
public void rot()
{
float f5 = 0.0625f;
this.setRotation(Shape20, 0.0F, this.o, 0.0F);
System.out.println("CODE: rot");
Shape20.render(f5);
}
}
Последнее редактирование модератором: