저는 Minecraft 모드에서 전기 케이블 시스템을 만들려고합니다. 분명히 다른 케이블을 연결/분리 할 수 있어야합니다. 현재 저는 미학을 연구하고 있으며 와이어의 각 부분이 표시되는지 여부를 변경하려고합니다. 내 와이어 모델은 Techne (모델을 조각별로 모델링하는 Minecraft 모델링 프로그램)에서 만들어지며 7 개 부분 (코어와 위, 아래, 북쪽, 남쪽, 동쪽, 서쪽)으로 구성됩니다. 상태 만 다시 시작하여 변경 될 수 있는지변수 초기화하기
public RenderCable()
{
this.modelCable = new ModelCableAll(true, true, true, false, false, false);
}
이 가진 문제 : 모델이 첫 번째 (내가 핵심을 전환 할 필요가 없습니다) 각 방향에 대한 부울를 사용하여 인스턴스화 할 때 그들은 현재 전환 할 수 게임, 그래서 어떻게 살 수있는 상태를 업데이 트/기존 인스턴스를 수정/모델의 인스턴스를 리메이크?
package foodTech.tileEntities.render;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import foodTech.tileEntities.models.cable.ModelCableAll;
public class RenderCable extends TileEntitySpecialRenderer {
ResourceLocation textureOff = (new ResourceLocation("roboguy99:textures/models/cableOff.png"));
ResourceLocation textureOn = (new ResourceLocation("roboguy99:textures/models/cableOn.png"));
private final ModelCableAll modelCable;
public RenderCable()
{
this.modelCable = new ModelCableAll(false, false, false, false, false, false);
}
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale)
{
GL11.glTranslatef((float) x + 0.5F, (float) y - 0.5F, (float) z + 0.5F);
setConnections();
GL11.glTranslatef((float) x - 0.5F, (float) y + 0.5F, (float) z - 0.5F);
}
public void setConnections()
{
GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(textureOff);
this.modelCable.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
}
흠 좋습니다. 나는 본질적으로 this.modelCable을 같은 것으로 설정해야한다. ModelCableAll의 새 인스턴스를 만들거나 메모리가 부족합니까? –