use of riskyken.armourersWorkshop.common.data.BipedRotations.BipedPart in project Armourers-Workshop by RiskyKen.
the class GuiMannequinTabRotations method actionPerformed.
@Override
protected void actionPerformed(GuiButton button) {
if (button == resetRotsButton) {
guiLoaded = false;
bipedRotations.resetRotations();
bipedPartChange(activeBipedPart);
guiLoaded = true;
checkAndSendRotationValues();
}
if (button == randomRotsButton) {
guiLoaded = false;
Random rnd = new Random();
for (int i = 0; i < bipedParts.length; i++) {
BipedPart part = bipedRotations.getPartForIndex(i);
if (part != bipedRotations.chest) {
part.rotationX = (float) Math.toRadians(rnd.nextFloat() * 180F - 90F);
part.rotationY = (float) Math.toRadians(rnd.nextFloat() * 180F - 90F);
part.rotationZ = (float) Math.toRadians(rnd.nextFloat() * 180F - 90F);
bipedPartChange(activeBipedPart);
}
}
guiLoaded = true;
checkAndSendRotationValues();
}
}
use of riskyken.armourersWorkshop.common.data.BipedRotations.BipedPart in project Armourers-Workshop by RiskyKen.
the class GuiMannequinTabRotations method checkAndSendRotationValues.
public void checkAndSendRotationValues() {
BipedPart activePart = bipedRotations.getPartForIndex(activeBipedPart);
activePart.setRotationsDegrees((float) -bipedRotXslider.getValue(), (float) -bipedRotYslider.getValue(), (float) -bipedRotZslider.getValue());
if (!this.bipedRotations.equals(this.lastBipedRotations)) {
NBTTagCompound compound = new NBTTagCompound();
this.bipedRotations.saveNBTData(compound);
this.lastBipedRotations.loadNBTData(compound);
MessageClientGuiBipedRotations message = new MessageClientGuiBipedRotations(bipedRotations);
PacketHandler.networkWrapper.sendToServer(message);
}
}
use of riskyken.armourersWorkshop.common.data.BipedRotations.BipedPart in project Armourers-Workshop by RiskyKen.
the class GuiMannequinTabRotations method bipedPartChange.
private void bipedPartChange(int partIndex) {
activeBipedPart = partIndex;
BipedPart part = bipedRotations.getPartForIndex(activeBipedPart);
guiLoaded = false;
bipedRotXslider.setValue(Math.toDegrees(-part.rotationX));
bipedRotYslider.setValue(Math.toDegrees(-part.rotationY));
bipedRotZslider.setValue(Math.toDegrees(-part.rotationZ));
bipedRotXslider.updateSlider();
bipedRotYslider.updateSlider();
bipedRotZslider.updateSlider();
guiLoaded = true;
}
Aggregations