mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Settings, imports, and naming changes
This commit is contained in:
parent
cae1f490fb
commit
f1b1e412dc
26 changed files with 136 additions and 129 deletions
|
@ -12,7 +12,7 @@ import com.minelittlepony.common.client.gui.element.Slider;
|
|||
import com.minelittlepony.common.client.gui.element.Toggle;
|
||||
import com.minelittlepony.settings.PonyConfig;
|
||||
import com.minelittlepony.settings.PonyLevel;
|
||||
import com.minelittlepony.settings.PonyConfig.PonySettings;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
|
||||
/**
|
||||
* In-Game options menu.
|
||||
|
@ -77,7 +77,7 @@ public class GuiPonySettings implements IGuiGuest {
|
|||
}
|
||||
|
||||
host.addButton(new Label(RIGHT, row += 15)).getStyle().setText(MOB_PREFIX + "title");
|
||||
for (MobRenderers i : MobRenderers.values()) {
|
||||
for (MobRenderers i : MobRenderers.registry) {
|
||||
host.addButton(new Toggle(RIGHT, row += 20, i.get()))
|
||||
.onChange(i)
|
||||
.getStyle().setText(MOB_PREFIX + i.name().toLowerCase());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.minelittlepony.client.model;
|
||||
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmor;
|
||||
import com.minelittlepony.client.model.armour.PonyArmor;
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmour;
|
||||
import com.minelittlepony.client.model.armour.ArmourWrapper;
|
||||
import com.minelittlepony.client.model.components.PonySnout;
|
||||
import com.minelittlepony.client.model.components.PonyTail;
|
||||
import com.minelittlepony.client.pony.PonyData;
|
||||
|
@ -73,7 +73,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
|||
|
||||
@Override
|
||||
public IEquestrianArmour<?> createArmour() {
|
||||
return new PonyArmor<>(new ModelPonyArmor<>(), new ModelPonyArmor<>());
|
||||
return new ArmourWrapper<>(new ModelPonyArmour<>(), new ModelPonyArmour<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,12 +6,12 @@ import com.minelittlepony.model.armour.ArmourLayer;
|
|||
import com.minelittlepony.model.armour.IEquestrianArmour;
|
||||
import com.minelittlepony.pony.IPonyData;
|
||||
|
||||
public class PonyArmor<T extends LivingEntity> implements IEquestrianArmour<ModelPonyArmor<T>> {
|
||||
public class ArmourWrapper<T extends LivingEntity> implements IEquestrianArmour<ModelPonyArmour<T>> {
|
||||
|
||||
private final ModelPonyArmor<T> outerLayer;
|
||||
private final ModelPonyArmor<T> innerLayer;
|
||||
private final ModelPonyArmour<T> outerLayer;
|
||||
private final ModelPonyArmour<T> innerLayer;
|
||||
|
||||
public PonyArmor(ModelPonyArmor<T> outer, ModelPonyArmor<T> inner) {
|
||||
public ArmourWrapper(ModelPonyArmour<T> outer, ModelPonyArmour<T> inner) {
|
||||
outerLayer = outer;
|
||||
innerLayer = inner;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class PonyArmor<T extends LivingEntity> implements IEquestrianArmour<Mode
|
|||
}
|
||||
|
||||
@Override
|
||||
public ModelPonyArmor<T> getArmorForLayer(ArmourLayer layer) {
|
||||
public ModelPonyArmour<T> getArmorForLayer(ArmourLayer layer) {
|
||||
|
||||
if (layer == ArmourLayer.INNER) {
|
||||
return innerLayer;
|
|
@ -20,7 +20,7 @@ import javax.annotation.Nullable;
|
|||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public class DefaultPonyArmorTextureResolver<T extends LivingEntity> implements IArmourTextureResolver<T> {
|
||||
public class DefaultArmourTextureResolver<T extends LivingEntity> implements IArmourTextureResolver<T> {
|
||||
|
||||
private final Map<String, Identifier> HUMAN_ARMOUR = Maps.newHashMap();
|
||||
private final Map<Identifier, Identifier> PONY_ARMOUR = Maps.newHashMap();
|
||||
|
@ -54,6 +54,7 @@ public class DefaultPonyArmorTextureResolver<T extends LivingEntity> implements
|
|||
|
||||
private Identifier resolve(Identifier... resources) {
|
||||
// check resource packs for either texture.
|
||||
// TODO: We need another way to iterate loaded resourcepacks
|
||||
for (ClientResourcePackContainer entry : MinecraftClient.getInstance().getResourcePackContainerManager().getEnabledContainers()) {
|
||||
ResourcePack pack = entry.createResourcePack();
|
||||
for (Identifier candidate : resources) {
|
|
@ -8,11 +8,11 @@ import com.minelittlepony.client.util.render.PonyRenderer;
|
|||
import com.minelittlepony.model.IModel;
|
||||
import com.minelittlepony.model.armour.IArmour;
|
||||
|
||||
public class ModelPonyArmor<T extends LivingEntity> extends AbstractPonyModel<T> implements IArmour {
|
||||
public class ModelPonyArmour<T extends LivingEntity> extends AbstractPonyModel<T> implements IArmour {
|
||||
|
||||
public PonyRenderer chestPiece;
|
||||
|
||||
public ModelPonyArmor() {
|
||||
public ModelPonyArmour() {
|
||||
super(false);
|
||||
textureHeight = 32;
|
||||
}
|
|
@ -3,10 +3,10 @@ package com.minelittlepony.client.model.components;
|
|||
import net.minecraft.client.model.Cuboid;
|
||||
import net.minecraft.client.model.Model;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.client.util.render.plane.PlaneRenderer;
|
||||
import com.minelittlepony.model.ICapitated;
|
||||
import com.minelittlepony.pony.meta.Gender;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
|
||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class PonySnout {
|
|||
}
|
||||
|
||||
public void setGender(Gender gender) {
|
||||
boolean show = !head.hasHeadGear() && !isHidden && MineLittlePony.getInstance().getConfig().snuzzles;
|
||||
boolean show = !head.hasHeadGear() && !isHidden && PonySettings.SNUZZLES.get();
|
||||
|
||||
mare.field_3664 = !(show && gender.isMare());
|
||||
stallion.field_3664 = !(show && gender.isStallion());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.minelittlepony.client.model.entities;
|
||||
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmor;
|
||||
import com.minelittlepony.client.model.armour.PonyArmor;
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmour;
|
||||
import com.minelittlepony.client.model.armour.ArmourWrapper;
|
||||
import com.minelittlepony.client.model.components.SeaponyTail;
|
||||
import com.minelittlepony.client.model.races.ModelUnicorn;
|
||||
import com.minelittlepony.client.util.render.PonyRenderer;
|
||||
|
@ -35,7 +35,7 @@ public class ModelSeapony<T extends LivingEntity> extends ModelUnicorn<T> {
|
|||
|
||||
@Override
|
||||
public IEquestrianArmour<?> createArmour() {
|
||||
return new PonyArmor<>(new Armour(), new Armour());
|
||||
return new ArmourWrapper<>(new Armour(), new Armour());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -187,7 +187,7 @@ public class ModelSeapony<T extends LivingEntity> extends ModelUnicorn<T> {
|
|||
rightLegOverlay.visible = false;
|
||||
}
|
||||
|
||||
class Armour extends ModelPonyArmor<T> {
|
||||
class Armour extends ModelPonyArmour<T> {
|
||||
|
||||
@Override
|
||||
public void showBoots() {
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.minelittlepony.client.model.races;
|
|||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmor;
|
||||
import com.minelittlepony.client.model.armour.PonyArmor;
|
||||
import com.minelittlepony.client.model.armour.ModelPonyArmour;
|
||||
import com.minelittlepony.client.model.armour.ArmourWrapper;
|
||||
import com.minelittlepony.client.util.render.PonyRenderer;
|
||||
import com.minelittlepony.model.BodyPart;
|
||||
import com.minelittlepony.model.armour.IEquestrianArmour;
|
||||
|
@ -19,7 +19,7 @@ public class ModelZebra<T extends LivingEntity> extends ModelEarthPony<T> {
|
|||
|
||||
@Override
|
||||
public IEquestrianArmour<?> createArmour() {
|
||||
return new PonyArmor<>(new Armour(), new Armour());
|
||||
return new ArmourWrapper<>(new Armour(), new Armour());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +51,7 @@ public class ModelZebra<T extends LivingEntity> extends ModelEarthPony<T> {
|
|||
.pitch = -1F;
|
||||
}
|
||||
|
||||
class Armour extends ModelPonyArmor<T> {
|
||||
class Armour extends ModelPonyArmour<T> {
|
||||
|
||||
@Override
|
||||
public void transform(BodyPart part) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.minelittlepony.client.ducks.IRenderItem;
|
|||
import com.minelittlepony.client.render.tileentities.skull.PonySkullRenderer;
|
||||
import com.minelittlepony.client.util.render.Color;
|
||||
import com.minelittlepony.pony.IPony;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
|
@ -71,7 +72,7 @@ public class LevitatingItemRenderer {
|
|||
|
||||
pushMatrix();
|
||||
|
||||
boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic && pony.getMetadata().hasMagic();
|
||||
boolean doMagic = PonySettings.FPSMAGIC.get() && pony.getMetadata().hasMagic();
|
||||
|
||||
if (doMagic) {
|
||||
setupPerspective(renderer, entity, stack, left);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.minelittlepony.client.render;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.client.PonyRenderManager;
|
||||
import com.minelittlepony.client.model.ModelWrapper;
|
||||
import com.minelittlepony.client.transform.PonyPosture;
|
||||
import com.minelittlepony.model.IPonyModel;
|
||||
import com.minelittlepony.pony.IPony;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
import com.minelittlepony.util.math.MathUtil;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class RenderPony<T extends LivingEntity, M extends EntityModel<T> & IPony
|
|||
}
|
||||
|
||||
public VisibleRegion getFrustrum(T entity, VisibleRegion vanilla) {
|
||||
if (entity.isSleeping() || !MineLittlePony.getInstance().getConfig().frustrum) {
|
||||
if (entity.isSleeping() || !PonySettings.FRUSTRUM.get()) {
|
||||
return vanilla;
|
||||
}
|
||||
return frustrum.withCamera(entity, vanilla);
|
||||
|
|
|
@ -3,7 +3,8 @@ package com.minelittlepony.client.render.entities;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.client.PonyRenderManager;
|
||||
import com.minelittlepony.common.SensibleConfig.Setting;
|
||||
import com.minelittlepony.settings.SensibleConfig;
|
||||
import com.minelittlepony.settings.SensibleConfig.Setting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -77,6 +78,11 @@ public enum MobRenderers implements Setting {
|
|||
apply(PonyRenderManager.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SensibleConfig config() {
|
||||
return MineLittlePony.getInstance().getConfig();
|
||||
}
|
||||
|
||||
public void apply(PonyRenderManager pony) {
|
||||
boolean state = get();
|
||||
register(state, pony);
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.minelittlepony.client.render.layer;
|
|||
|
||||
import com.minelittlepony.client.ForgeProxy;
|
||||
import com.minelittlepony.client.model.ModelWrapper;
|
||||
import com.minelittlepony.client.model.armour.DefaultPonyArmorTextureResolver;
|
||||
import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver;
|
||||
import com.minelittlepony.client.render.IPonyRender;
|
||||
import com.minelittlepony.client.util.render.Color;
|
||||
import com.minelittlepony.model.IPonyModel;
|
||||
|
@ -25,7 +25,7 @@ import net.minecraft.util.Identifier;
|
|||
|
||||
public class LayerPonyArmor<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
|
||||
|
||||
private static final IArmourTextureResolver<LivingEntity> textures = new DefaultPonyArmorTextureResolver<>();
|
||||
private static final IArmourTextureResolver<LivingEntity> textures = new DefaultArmourTextureResolver<>();
|
||||
|
||||
private ModelWrapper<T, M> pony;
|
||||
|
||||
|
|
|
@ -1,48 +1,44 @@
|
|||
package com.minelittlepony.client.render.tileentities.skull;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.client.MineLPClient;
|
||||
import com.minelittlepony.client.ducks.IRenderItem;
|
||||
import com.minelittlepony.pony.IPony;
|
||||
import com.minelittlepony.settings.PonyConfig;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
import net.minecraft.block.SkullBlock;
|
||||
import net.minecraft.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.SystemUtil;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.mojang.blaze3d.platform.GlStateManager.*;
|
||||
|
||||
/**
|
||||
* PonySkullRenderer! It renders ponies as skulls, or something...
|
||||
*/
|
||||
public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRenderItem {
|
||||
|
||||
public static final int SKELETON = 0;
|
||||
public static final int WITHER = 1;
|
||||
public static final int ZOMBIE = 2;
|
||||
public static final int PLAYER = 3;
|
||||
public static final int CREEPER = 4;
|
||||
public static final int DRAGON = 5;
|
||||
|
||||
public static PonySkullRenderer ponyInstance = new PonySkullRenderer();
|
||||
private static SkullBlockEntityRenderer backup = null;
|
||||
|
||||
private final Map<SkullBlock.SkullType, ISkull> skullMap = new HashMap<>();
|
||||
private boolean transparency = false;
|
||||
|
||||
private PonySkullRenderer() {
|
||||
private static final Map<SkullBlock.SkullType, ISkull> skullMap = SystemUtil.consume(Maps.newHashMap(), (skullMap) -> {
|
||||
skullMap.put(SkullBlock.Type.SKELETON, new SkeletonSkullRenderer());
|
||||
skullMap.put(SkullBlock.Type.WITHER_SKELETON, new WitherSkullRenderer());
|
||||
skullMap.put(SkullBlock.Type.ZOMBIE, new ZombieSkullRenderer());
|
||||
skullMap.put(SkullBlock.Type.PLAYER, new PlayerSkullRenderer());
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Resolves the games skull renderer to either a specialised pony skull renderer
|
||||
|
@ -51,7 +47,7 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRend
|
|||
* Original/Existing renderer is stored to a backup variable as a fallback in case of mods.
|
||||
*/
|
||||
public static SkullBlockEntityRenderer resolve() {
|
||||
if (MineLittlePony.getInstance().getConfig().ponyskulls) {
|
||||
if (PonySettings.PONYSKULLS.get()) {
|
||||
if (!(INSTANCE instanceof PonySkullRenderer)) {
|
||||
backup = INSTANCE;
|
||||
MineLPClient.getInstance().getModUtilities().addRenderer(SkullBlockEntity.class, ponyInstance);
|
||||
|
@ -71,8 +67,6 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRend
|
|||
return INSTANCE;
|
||||
}
|
||||
|
||||
protected boolean transparency = false;
|
||||
|
||||
@Override
|
||||
public void render(float x, float y, float z, @Nullable Direction facing, float rotation, SkullBlock.SkullType skullType, @Nullable GameProfile profile, int destroyStage, float animateTicks) {
|
||||
|
||||
|
@ -92,11 +86,11 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRend
|
|||
|
||||
if (destroyStage >= 0) {
|
||||
bindTexture(DESTROY_STAGE_TEXTURES[destroyStage]);
|
||||
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scalef(4, 2, 1);
|
||||
GlStateManager.translatef(scale, scale, scale);
|
||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
||||
matrixMode(GL11.GL_TEXTURE);
|
||||
pushMatrix();
|
||||
scalef(4, 2, 1);
|
||||
translatef(scale, scale, scale);
|
||||
matrixMode(GL11.GL_MODELVIEW);
|
||||
} else {
|
||||
Identifier skin = skull.getSkinResource(profile);
|
||||
|
||||
|
@ -105,24 +99,24 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRend
|
|||
bindTexture(skin);
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.disableCull();
|
||||
pushMatrix();
|
||||
disableCull();
|
||||
|
||||
rotation = handleRotation(x, y, z, facing, rotation);
|
||||
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.scalef(-1, -1, 1);
|
||||
GlStateManager.enableAlphaTest();
|
||||
enableRescaleNormal();
|
||||
scalef(-1, -1, 1);
|
||||
enableAlphaTest();
|
||||
|
||||
skull.preRender(transparency);
|
||||
skull.preRender(usesTransparency());
|
||||
skull.render(animateTicks, rotation, scale);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
popMatrix();
|
||||
|
||||
if (destroyStage >= 0) {
|
||||
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
||||
matrixMode(GL11.GL_TEXTURE);
|
||||
popMatrix();
|
||||
matrixMode(GL11.GL_MODELVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,19 +124,19 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer implements IRend
|
|||
switch (facing) {
|
||||
case EAST:
|
||||
default:
|
||||
GlStateManager.translatef(x + 0.26F, y + 0.25F, z + 0.5F);
|
||||
translatef(x + 0.26F, y + 0.25F, z + 0.5F);
|
||||
return 90;
|
||||
case UP:
|
||||
GlStateManager.translatef(x + 0.5F, y, z + 0.5F);
|
||||
translatef(x + 0.5F, y, z + 0.5F);
|
||||
break;
|
||||
case NORTH:
|
||||
GlStateManager.translatef(x + 0.5F, y + 0.25F, z + 0.74F);
|
||||
translatef(x + 0.5F, y + 0.25F, z + 0.74F);
|
||||
break;
|
||||
case SOUTH:
|
||||
GlStateManager.translatef(x + 0.5F, y + 0.25F, z + 0.26F);
|
||||
translatef(x + 0.5F, y + 0.25F, z + 0.26F);
|
||||
return 180;
|
||||
case WEST:
|
||||
GlStateManager.translatef(x + 0.74F, y + 0.25F, z + 0.5F);
|
||||
translatef(x + 0.74F, y + 0.25F, z + 0.5F);
|
||||
return 270;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.client.render.tileentities.skull;
|
||||
|
||||
import com.minelittlepony.client.render.entities.MobRenderers;
|
||||
import com.minelittlepony.client.render.entities.RenderPonySkeleton;
|
||||
import com.minelittlepony.settings.PonyConfig;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
@ -11,7 +12,7 @@ public class SkeletonSkullRenderer extends PonySkull {
|
|||
|
||||
@Override
|
||||
public boolean canRender(PonyConfig config) {
|
||||
return config.skeletons;
|
||||
return MobRenderers.SKELETONS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.client.render.tileentities.skull;
|
||||
|
||||
import com.minelittlepony.client.render.entities.MobRenderers;
|
||||
import com.minelittlepony.client.render.entities.RenderPonySkeleton;
|
||||
import com.minelittlepony.settings.PonyConfig;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
@ -11,7 +12,7 @@ public class WitherSkullRenderer extends PonySkull {
|
|||
|
||||
@Override
|
||||
public boolean canRender(PonyConfig config) {
|
||||
return config.skeletons;
|
||||
return MobRenderers.SKELETONS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.client.render.tileentities.skull;
|
||||
|
||||
import com.minelittlepony.client.render.entities.MobRenderers;
|
||||
import com.minelittlepony.client.render.entities.RenderPonyZombie;
|
||||
import com.minelittlepony.settings.PonyConfig;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
@ -11,7 +12,7 @@ public class ZombieSkullRenderer extends PonySkull {
|
|||
|
||||
@Override
|
||||
public boolean canRender(PonyConfig config) {
|
||||
return config.zombies;
|
||||
return MobRenderers.ZOMBIES.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ public class HornGlow extends Box<GlowRenderer> {
|
|||
|
||||
private final float alpha;
|
||||
|
||||
private Quad[] quadList;
|
||||
private Quad[] polygons;
|
||||
|
||||
public HornGlow(GlowRenderer renderer, int texX, int texY, float xMin, float yMin, float zMin, int w, int h, int d, float scale, float alpha) {
|
||||
super(renderer, texX, texY, xMin, yMin, zMin, w, h, d, scale);
|
||||
|
@ -47,7 +47,7 @@ public class HornGlow extends Box<GlowRenderer> {
|
|||
Vertex eun = vert(xMax, yMax, zMax, 8, 8);
|
||||
Vertex wun = vert(xMin, yMax, zMax, 8, 0);
|
||||
|
||||
quadList = new Quad[] {
|
||||
polygons = new Quad[] {
|
||||
quad(texX + d + w, d, texY + d, h, edn, eds, eus, eun),
|
||||
quad(texX, d, texY + d, h, wds, wdn, wun, wus),
|
||||
quad(texX + d, w, texY, d, edn, wdn, wds, eds),
|
||||
|
@ -57,7 +57,7 @@ public class HornGlow extends Box<GlowRenderer> {
|
|||
};
|
||||
|
||||
if (renderer.mirror) {
|
||||
for (Quad i : quadList) {
|
||||
for (Quad i : polygons) {
|
||||
i.flip();
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class HornGlow extends Box<GlowRenderer> {
|
|||
public void render(BufferBuilder buffer, float scale) {
|
||||
parent.applyTint(alpha);
|
||||
|
||||
for (Quad i : quadList) {
|
||||
for (Quad i : polygons) {
|
||||
i.render(buffer, scale);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.minelittlepony.client.util.render.plane;
|
||||
|
||||
import net.minecraft.client.render.BufferBuilder;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import com.minelittlepony.client.util.render.Box;
|
||||
import com.minelittlepony.client.util.render.Quad;
|
||||
|
@ -14,7 +15,7 @@ public class ModelPlane extends Box<PlaneRenderer> {
|
|||
|
||||
public boolean hidden = false;
|
||||
|
||||
public ModelPlane(PlaneRenderer renderer, int textureX, int textureY, float xMin, float yMin, float zMin, int w, int h, int d, float scale, Plane face) {
|
||||
public ModelPlane(PlaneRenderer renderer, int textureX, int textureY, float xMin, float yMin, float zMin, int w, int h, int d, float scale, Direction face) {
|
||||
super(renderer, textureX, textureY, xMin, yMin, zMin, w, h, d, scale, false);
|
||||
|
||||
float xMax = xMin + w + scale;
|
||||
|
@ -53,22 +54,22 @@ public class ModelPlane extends Box<PlaneRenderer> {
|
|||
Vertex eun = vert(xMax, yMax, zMax, 8, 8);
|
||||
Vertex wun = vert(xMin, yMax, zMax, 8, 0);
|
||||
|
||||
if (face == Plane.EAST) {
|
||||
if (face == Direction.EAST) {
|
||||
quad = quad(textureX, d, textureY, h, edn, eds, eus, eun);
|
||||
}
|
||||
if (face == Plane.WEST) {
|
||||
if (face == Direction.WEST) {
|
||||
quad = quad(textureX, d, textureY, h, wds, wdn, wun, wus);
|
||||
}
|
||||
if (face == Plane.UP) {
|
||||
if (face == Direction.UP) {
|
||||
quad = quad(textureX, w, textureY, d, edn, wdn, wds, eds);
|
||||
}
|
||||
if (face == Plane.DOWN) {
|
||||
if (face == Direction.DOWN) {
|
||||
quad = quad(textureX, w, textureY, d, eus, wus, wun, eun);
|
||||
}
|
||||
if (face == Plane.SOUTH) {
|
||||
if (face == Direction.SOUTH) {
|
||||
quad = quad(textureX, w, textureY, h, eds, wds, wus, eus);
|
||||
}
|
||||
if (face == Plane.NORTH) {
|
||||
if (face == Direction.NORTH) {
|
||||
quad = quad(textureX, w, textureY, h, wdn, edn, eun, wun);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package com.minelittlepony.client.util.render.plane;
|
||||
|
||||
enum Plane {
|
||||
NORTH,
|
||||
SOUTH,
|
||||
UP,
|
||||
DOWN,
|
||||
EAST,
|
||||
WEST
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.minelittlepony.client.util.render.plane;
|
||||
|
||||
import net.minecraft.client.model.Model;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import com.minelittlepony.client.util.render.AbstractRenderer;
|
||||
|
||||
|
@ -37,32 +38,32 @@ public class PlaneRenderer extends AbstractRenderer<PlaneRenderer> {
|
|||
return new PlaneRenderer(baseModel, textureOffsetX, textureOffsetY);
|
||||
}
|
||||
|
||||
private PlaneRenderer addPlane(float offX, float offY, float offZ, int width, int height, int depth, float scale, Plane face) {
|
||||
private PlaneRenderer addPlane(float offX, float offY, float offZ, int width, int height, int depth, float scale, Direction face) {
|
||||
boxes.add(new ModelPlane(this, textureOffsetX, textureOffsetY, modelOffsetX + offX, modelOffsetY + offY, modelOffsetZ + offZ, width, height, depth, scale, face));
|
||||
return this;
|
||||
}
|
||||
|
||||
public PlaneRenderer top(float offX, float offY, float offZ, int width, int depth, float scale) {
|
||||
return addPlane(offX, offY, offZ, width, 0, depth, scale, Plane.UP);
|
||||
return addPlane(offX, offY, offZ, width, 0, depth, scale, Direction.UP);
|
||||
}
|
||||
|
||||
public PlaneRenderer bottom(float offX, float offY, float offZ, int width, int depth, float scale) {
|
||||
return addPlane(offX, offY, offZ, width, 0, depth, scale, Plane.DOWN);
|
||||
return addPlane(offX, offY, offZ, width, 0, depth, scale, Direction.DOWN);
|
||||
}
|
||||
|
||||
public PlaneRenderer west(float offX, float offY, float offZ, int height, int depth, float scale) {
|
||||
return addPlane(offX, offY, offZ, 0, height, depth, scale, Plane.WEST);
|
||||
return addPlane(offX, offY, offZ, 0, height, depth, scale, Direction.WEST);
|
||||
}
|
||||
|
||||
public PlaneRenderer east(float offX, float offY, float offZ, int height, int depth, float scale) {
|
||||
return addPlane(offX, offY, offZ, 0, height, depth, scale, Plane.EAST);
|
||||
return addPlane(offX, offY, offZ, 0, height, depth, scale, Direction.EAST);
|
||||
}
|
||||
|
||||
public PlaneRenderer north(float offX, float offY, float offZ, int width, int height, float scale) {
|
||||
return addPlane(offX, offY, offZ - scale * 2, width, height, 0, scale, Plane.NORTH);
|
||||
return addPlane(offX, offY, offZ - scale * 2, width, height, 0, scale, Direction.NORTH);
|
||||
}
|
||||
|
||||
public PlaneRenderer south(float offX, float offY, float offZ, int width, int height, float scale) {
|
||||
return addPlane(offX, offY, offZ + scale * 2, width, height, 0, scale, Plane.SOUTH);
|
||||
return addPlane(offX, offY, offZ + scale * 2, width, height, 0, scale, Direction.SOUTH);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.minelittlepony.pony.meta;
|
|||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.pony.ITriggerPixelMapped;
|
||||
import com.minelittlepony.settings.PonySettings;
|
||||
|
||||
public enum Size implements ITriggerPixelMapped<Size> {
|
||||
TALL(0x534b76, 0.45f, 1.1F),
|
||||
|
@ -36,6 +37,6 @@ public enum Size implements ITriggerPixelMapped<Size> {
|
|||
}
|
||||
|
||||
public Size getEffectiveSize() {
|
||||
return MineLittlePony.getInstance().getConfig().sizes ? this : Size.NORMAL;
|
||||
return PonySettings.SIZES.get() ? this : Size.NORMAL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package com.minelittlepony.settings;
|
||||
|
||||
public enum MobSettings {
|
||||
|
||||
}
|
|
@ -11,31 +11,21 @@ public abstract class PonyConfig extends SensibleJsonConfig {
|
|||
|
||||
@Expose private PonyLevel ponylevel = PonyLevel.PONIES;
|
||||
|
||||
@Expose public boolean sizes = true;
|
||||
@Expose public boolean snuzzles = true;
|
||||
@Expose public boolean hd = true;
|
||||
@Expose public boolean showscale = true;
|
||||
@Expose public boolean fpsmagic = true;
|
||||
@Expose public boolean ponyskulls = true;
|
||||
@Expose public boolean frustrum = true;
|
||||
@Expose boolean sizes = true;
|
||||
@Expose boolean snuzzles = true;
|
||||
@Expose boolean hd = true;
|
||||
@Expose boolean showscale = true;
|
||||
@Expose boolean fpsmagic = true;
|
||||
@Expose boolean ponyskulls = true;
|
||||
@Expose boolean frustrum = true;
|
||||
|
||||
public enum PonySettings implements Setting {
|
||||
SIZES,
|
||||
SNUZZLES,
|
||||
HD,
|
||||
SHOWSCALE,
|
||||
FPSMAGIC,
|
||||
PONYSKULLS,
|
||||
FRUSTRUM;
|
||||
}
|
||||
|
||||
@Expose public boolean villagers = true;
|
||||
@Expose public boolean zombies = true;
|
||||
@Expose public boolean pigzombies = true;
|
||||
@Expose public boolean skeletons = true;
|
||||
@Expose public boolean illagers = true;
|
||||
@Expose public boolean guardians = true;
|
||||
@Expose public boolean endermen = true;
|
||||
@Expose boolean villagers = true;
|
||||
@Expose boolean zombies = true;
|
||||
@Expose boolean pigzombies = true;
|
||||
@Expose boolean skeletons = true;
|
||||
@Expose boolean illagers = true;
|
||||
@Expose boolean guardians = true;
|
||||
@Expose boolean endermen = true;
|
||||
|
||||
@Expose private float globalScaleFactor = 0.9F;
|
||||
|
||||
|
|
19
src/main/java/com/minelittlepony/settings/PonySettings.java
Normal file
19
src/main/java/com/minelittlepony/settings/PonySettings.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package com.minelittlepony.settings;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.settings.SensibleConfig.Setting;
|
||||
|
||||
public enum PonySettings implements Setting {
|
||||
SIZES,
|
||||
SNUZZLES,
|
||||
HD,
|
||||
SHOWSCALE,
|
||||
FPSMAGIC,
|
||||
PONYSKULLS,
|
||||
FRUSTRUM;
|
||||
|
||||
@Override
|
||||
public SensibleConfig config() {
|
||||
return MineLittlePony.getInstance().getConfig();
|
||||
}
|
||||
}
|
|
@ -11,12 +11,6 @@ import com.minelittlepony.common.client.gui.IField.IChangeCallback;
|
|||
// Mumfrey pls.
|
||||
public abstract class SensibleConfig {
|
||||
|
||||
private static SensibleConfig instance;
|
||||
|
||||
public SensibleConfig() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public abstract void save();
|
||||
|
||||
public interface Setting extends IChangeCallback<Boolean> {
|
||||
|
@ -26,16 +20,18 @@ public abstract class SensibleConfig {
|
|||
* Gets the config value associated with this entry.
|
||||
*/
|
||||
default boolean get() {
|
||||
return instance.getValue(this);
|
||||
return config().getValue(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the config value associated with this entry.
|
||||
*/
|
||||
default void set(boolean value) {
|
||||
instance.setValue(this, value);
|
||||
config().setValue(this, value);
|
||||
}
|
||||
|
||||
SensibleConfig config();
|
||||
|
||||
@Override
|
||||
default Boolean perform(Boolean v) {
|
||||
set(v);
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.minelittlepony.client.settings.ClientPonyConfig;
|
||||
import com.minelittlepony.common.SensibleConfig;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
|
Loading…
Reference in a new issue