Crystalite Armor models; WIP: REI Infusion view compass

This commit is contained in:
Aleksey 2020-12-03 22:13:27 +03:00
parent 15d2d981de
commit b7c0ce452e
5 changed files with 28 additions and 35 deletions

View file

@ -18,11 +18,14 @@ import me.shedaniel.rei.gui.widget.Widget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import ru.betterend.BetterEnd;
import ru.betterend.recipe.builders.InfusionRecipe;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.LangUtil;
public class REIInfusionCategory implements TransferRecipeCategory<REIInfusionDisplay> {
private final static Identifier COMPASS_IMG = BetterEnd.makeID("textures/gui/compass.png");
@Override
public @NotNull Identifier getIdentifier() {
@ -46,11 +49,13 @@ public class REIInfusionCategory implements TransferRecipeCategory<REIInfusionDi
@Override
public @NotNull List<Widget> setupDisplay(REIInfusionDisplay display, Rectangle bounds) {
Point centerPoint = new Point(bounds.getCenterX() - 36, bounds.getCenterY() - 4);
Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 6);
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
List<List<EntryStack>> inputEntries = display.getInputEntries();
List<List<EntryStack>> outputEntries = display.getResultingEntries();
widgets.add(Widgets.createArrow(new Point(centerPoint.x + 48, centerPoint.y)));
widgets.add(Widgets.createTexturedWidget(COMPASS_IMG, centerPoint.x - 40, centerPoint.y - 40, 0.0F, 0.0F, 96, 96, 512, 512, 512, 512));
widgets.add(Widgets.createSlot(centerPoint).entries(inputEntries.get(0)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 28)).entries(inputEntries.get(1)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 28, centerPoint.y)).entries(inputEntries.get(3)).markInput());
@ -60,7 +65,6 @@ public class REIInfusionCategory implements TransferRecipeCategory<REIInfusionDi
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 24, centerPoint.y + 24)).entries(inputEntries.get(4)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y + 24)).entries(inputEntries.get(6)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y - 24)).entries(inputEntries.get(8)).markInput());
widgets.add(Widgets.createArrow(new Point(centerPoint.x + 48, centerPoint.y)));
widgets.add(Widgets.createResultSlotBackground(new Point(centerPoint.x + 80, centerPoint.y)));
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 80, centerPoint.y)).entries(outputEntries.get(0)).disableBackground().markOutput());
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 6), new TranslatableText("category.rei.infusion.time&val", display.getInfusionTime()))

View file

@ -23,6 +23,13 @@ public class CrystaliteBootsModel extends BipedEntityModel<LivingEntity> {
this.rightBoot.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.25F);
this.rightBoot.setPivot(-1.9F, 12.0F, 0.0F);
}
@Override
public void setAttributes(BipedEntityModel<LivingEntity> bipedEntityModel) {
super.setAttributes(bipedEntityModel);
this.leftBoot.copyPositionAndRotation(leftLeg);
this.rightBoot.copyPositionAndRotation(rightLeg);
}
@Override
protected Iterable<ModelPart> getHeadParts() {
@ -33,12 +40,4 @@ public class CrystaliteBootsModel extends BipedEntityModel<LivingEntity> {
protected Iterable<ModelPart> getBodyParts() {
return Lists.newArrayList(leftBoot, rightBoot);
}
@Override
public void setAttributes(BipedEntityModel<LivingEntity> bipedEntityModel) {
this.leftLeg.copyPositionAndRotation(bipedEntityModel.leftLeg);
this.rightLeg.copyPositionAndRotation(bipedEntityModel.rightLeg);
this.leftBoot.copyPositionAndRotation(leftLeg);
this.rightBoot.copyPositionAndRotation(rightLeg);
}
}

View file

@ -25,23 +25,30 @@ public class CrystaliteChestplateModel extends BipedEntityModel<LivingEntity> {
this.torso.setPivot(0.0F, 0.0F, 0.0F);
if (thinArms) {
this.leftShoulder = new ModelPart(this, 41, 32);
this.leftShoulder.addCuboid(-1.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.3F);
this.leftShoulder.addCuboid(-1.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.35F);
this.leftShoulder.setPivot(5.0F, 2.5F, 0.0F);
this.leftShoulder.mirror = true;
this.rightShoulder = new ModelPart(this, 41, 16);
this.rightShoulder.addCuboid(-2.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.3F);
this.rightShoulder.addCuboid(-2.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.35F);
this.rightShoulder.setPivot(-5.0F, 2.5F, 10.0F);
} else {
this.leftShoulder = new ModelPart(this, 40, 32);
this.leftShoulder.addCuboid(-1.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.4F);
this.leftShoulder.addCuboid(-1.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.45F);
this.leftShoulder.setPivot(5.0F, 2.0F, 0.0F);
this.leftShoulder.mirror = true;
this.rightShoulder = new ModelPart(this, 40, 16);
this.rightShoulder.addCuboid(-3.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.4F);
this.rightShoulder.addCuboid(-3.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.45F);
this.rightShoulder.setPivot(-5.0F, 2.0F, 10.0F);
}
}
@Override
public void setAttributes(BipedEntityModel<LivingEntity> bipedEntityModel) {
super.setAttributes(bipedEntityModel);
this.leftShoulder.copyPositionAndRotation(leftArm);
this.rightShoulder.copyPositionAndRotation(rightArm);
}
@Override
protected Iterable<ModelPart> getHeadParts() {
return Collections::emptyIterator;
@ -52,15 +59,6 @@ public class CrystaliteChestplateModel extends BipedEntityModel<LivingEntity> {
return Lists.newArrayList(torso, leftShoulder, rightShoulder);
}
@Override
public void setAttributes(BipedEntityModel<LivingEntity> bipedEntityModel) {
this.torso.copyPositionAndRotation(bipedEntityModel.torso);
this.leftArm.copyPositionAndRotation(bipedEntityModel.leftArm);
this.rightArm.copyPositionAndRotation(bipedEntityModel.rightArm);
this.leftShoulder.copyPositionAndRotation(leftArm);
this.rightShoulder.copyPositionAndRotation(rightArm);
}
@Override
public void setArmAngle(Arm arm, MatrixStack matrices) {
ModelPart modelPart = this.getArm(arm);

View file

@ -11,13 +11,11 @@ import net.minecraft.entity.LivingEntity;
public class CrystaliteLeggingsModel extends BipedEntityModel<LivingEntity> {
public ModelPart jacket;
public CrystaliteLeggingsModel(float scale) {
super(RenderLayer::getEntityTranslucent, scale, 0.0F, 64, 48);
this.jacket = new ModelPart(this, 16, 16);
this.jacket.addCuboid(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale);
this.jacket.setPivot(0.0F, 0.0F, 0.0F);
this.torso = new ModelPart(this, 16, 16);
this.torso.addCuboid(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale);
this.torso.setPivot(0.0F, 0.0F, 0.0F);
this.leftLeg = new ModelPart(this, 0, 32);
this.leftLeg.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
this.leftLeg.setPivot(1.9F, 12.0F, 0.0F);
@ -33,12 +31,6 @@ public class CrystaliteLeggingsModel extends BipedEntityModel<LivingEntity> {
@Override
protected Iterable<ModelPart> getBodyParts() {
return Lists.newArrayList(jacket, rightLeg, leftLeg);
}
@Override
public void setAngles(LivingEntity livingEntity, float f, float g, float h, float i, float j) {
super.setAngles(livingEntity, f, g, h, i, j);
this.jacket.copyPositionAndRotation(torso);
return Lists.newArrayList(torso, rightLeg, leftLeg);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB