Fixed model Bugs

This commit is contained in:
Frank Bauer 2021-06-28 12:14:56 +02:00
parent 42b436e408
commit 90f865d1af
4 changed files with 38 additions and 19 deletions

View file

@ -111,8 +111,8 @@ public class CubozoaEntityModel extends BlockBenchModel<CubozoaEntity> {
model = modelPart.getChild(PartNames.BODY);
for (int i=1; i<=TENTACLE_COUNT; i++){
tentacle_center[i] = model.getChild("tentacle_center_"+i);
tentacle[i] = tentacle_center[i].getChild("tentacle_"+i);
tentacle_center[i-1] = model.getChild("tentacle_center_"+i);
tentacle[i-1] = tentacle_center[i-1].getChild("tentacle_"+i);
}
}

View file

@ -145,15 +145,15 @@ public class DragonflyEntityModel extends BlockBenchModel<DragonflyEntity> {
super(RenderType::entityCutout);
model = modelPart.getChild(PartNames.BODY);
head = modelPart.getChild(PartNames.HEAD);
tail = modelPart.getChild(PartNames.TAIL);
tail_2 = modelPart.getChild(PartNames.TAIL_FIN);
wing_1 = modelPart.getChild(PartNames.LEFT_WING);
wing_2 = modelPart.getChild(PartNames.RIGHT_WING);
wing_3 = modelPart.getChild(PartNames.LEFT_WING_TIP);
wing_4 = modelPart.getChild(PartNames.RIGHT_WING_BASE);
legs_1 = modelPart.getChild(PartNames.LEFT_LEG);
legs_2 = modelPart.getChild(PartNames.RIGHT_LEG);
head = model.getChild(PartNames.HEAD);
tail = model.getChild(PartNames.TAIL);
tail_2 = tail.getChild(PartNames.TAIL_FIN);
wing_1 = model.getChild(PartNames.LEFT_WING);
wing_2 = model.getChild(PartNames.RIGHT_WING);
wing_3 = model.getChild(PartNames.LEFT_WING_BASE);
wing_4 = model.getChild(PartNames.RIGHT_WING_BASE);
legs_1 = model.getChild(PartNames.LEFT_LEG);
legs_2 = model.getChild(PartNames.RIGHT_LEG);
}
@Override

View file

@ -120,15 +120,23 @@ public class EndSlimeEntityModel<T extends EndSlimeEntity> extends ListModel<T>
return LayerDefinition.create(modelData, 64, 32);
}
public EndSlimeEntityModel(ModelPart modelPart) {
public EndSlimeEntityModel(ModelPart modelPart, boolean onlyShell) {
super(RenderType::entityCutout);
innerCube = modelPart.getChild(PartNames.BODY);
rightEye = modelPart.getChild(PartNames.RIGHT_EYE);
leftEye = modelPart.getChild(PartNames.LEFT_EYE);
mouth = modelPart.getChild(PartNames.MOUTH);
flower = modelPart.getChild("flower");
crop = modelPart.getChild("crop");
if (!onlyShell) {
rightEye = modelPart.getChild(PartNames.RIGHT_EYE);
leftEye = modelPart.getChild(PartNames.LEFT_EYE);
mouth = modelPart.getChild(PartNames.MOUTH);
flower = modelPart.getChild("flower");
crop = modelPart.getChild("crop");
} else {
rightEye = null;
leftEye = null;
mouth = null;
flower = null;
crop = null;
}
}
@Override
@ -144,8 +152,16 @@ public class EndSlimeEntityModel<T extends EndSlimeEntity> extends ListModel<T>
crop.render(matrices, vertices, light, overlay);
}
private boolean isOnlyShell(){
return rightEye==null;
}
@Override
public Iterable<ModelPart> parts() {
return ImmutableList.of(this.innerCube, this.rightEye, this.leftEye, this.mouth);
if (isOnlyShell()) {
return ImmutableList.of(this.innerCube);
} else {
return ImmutableList.of(this.innerCube, this.rightEye, this.leftEye, this.mouth);
}
}
}

View file

@ -5,6 +5,7 @@ import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.plugins.REIServerPlugin;
import me.shedaniel.rei.api.common.util.EntryIngredients;
import me.shedaniel.rei.api.common.util.EntryStacks;
import me.shedaniel.rei.impl.ClientInternals;
@ -20,6 +21,7 @@ import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.recipe.builders.AnvilRecipe;
import ru.betterend.recipe.builders.InfusionRecipe;
import ru.betterend.registry.EndBlocks;
import org.jetbrains.annotations.ApiStatus;
import java.util.List;
import java.util.function.Supplier;
@ -27,7 +29,8 @@ import java.util.stream.Collectors;
//https://github.com/shedaniel/RoughlyEnoughItems/blob/6.x-1.17/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java
@Environment(EnvType.CLIENT)
public class REIPlugin implements REIClientPlugin {
@ApiStatus.Internal
public class REIPlugin implements me.shedaniel.rei.api.client.plugins.REIClientPlugin {
public final static ResourceLocation PLUGIN_ID = BetterEnd.makeID("rei_plugin");
public final static CategoryIdentifier ALLOYING_FUEL = CategoryIdentifier.of(BetterEnd.MOD_ID, "alloying_fuel");