Updated radial menu to match 1.18, with build mode categories, descriptions and new icons. Changed reach upgrade recipes.
@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
version = '1.16.3-2.28'
|
version = '1.16.3-2.32'
|
||||||
group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = 'nl.requios.effortlessbuilding' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = 'effortlessbuilding'
|
archivesBaseName = 'effortlessbuilding'
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import net.minecraft.util.math.BlockPos;
|
|||||||
import net.minecraft.util.math.RayTraceContext;
|
import net.minecraft.util.math.RayTraceContext;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraft.util.math.vector.Vector4f;
|
||||||
import nl.requios.effortlessbuilding.EffortlessBuilding;
|
import nl.requios.effortlessbuilding.EffortlessBuilding;
|
||||||
import nl.requios.effortlessbuilding.buildmode.buildmodes.*;
|
import nl.requios.effortlessbuilding.buildmode.buildmodes.*;
|
||||||
import nl.requios.effortlessbuilding.buildmodifier.BuildModifiers;
|
import nl.requios.effortlessbuilding.buildmodifier.BuildModifiers;
|
||||||
@@ -245,27 +246,50 @@ public class BuildModes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum BuildModeEnum {
|
public enum BuildModeEnum {
|
||||||
NORMAL("effortlessbuilding.mode.normal", new Normal()),
|
NORMAL("normal", new Normal(), BuildModeCategoryEnum.BASIC),
|
||||||
NORMAL_PLUS("effortlessbuilding.mode.normal_plus", new NormalPlus(), OptionEnum.BUILD_SPEED),
|
NORMAL_PLUS("normal_plus", new NormalPlus(), BuildModeCategoryEnum.BASIC, OptionEnum.BUILD_SPEED),
|
||||||
LINE("effortlessbuilding.mode.line", new Line() /*, OptionEnum.THICKNESS*/),
|
LINE("line", new Line(), BuildModeCategoryEnum.BASIC /*, OptionEnum.THICKNESS*/),
|
||||||
WALL("effortlessbuilding.mode.wall", new Wall(), OptionEnum.FILL),
|
WALL("wall", new Wall(), BuildModeCategoryEnum.BASIC, OptionEnum.FILL),
|
||||||
FLOOR("effortlessbuilding.mode.floor", new Floor(), OptionEnum.FILL),
|
FLOOR("floor", new Floor(), BuildModeCategoryEnum.BASIC, OptionEnum.FILL),
|
||||||
DIAGONAL_LINE("effortlessbuilding.mode.diagonal_line", new DiagonalLine() /*, OptionEnum.THICKNESS*/),
|
CUBE("cube", new Cube(), BuildModeCategoryEnum.BASIC, OptionEnum.CUBE_FILL),
|
||||||
DIAGONAL_WALL("effortlessbuilding.mode.diagonal_wall", new DiagonalWall() /*, OptionEnum.FILL*/),
|
DIAGONAL_LINE("diagonal_line", new DiagonalLine(), BuildModeCategoryEnum.DIAGONAL /*, OptionEnum.THICKNESS*/),
|
||||||
SLOPE_FLOOR("effortlessbuilding.mode.slope_floor", new SlopeFloor(), OptionEnum.RAISED_EDGE),
|
DIAGONAL_WALL("diagonal_wall", new DiagonalWall(), BuildModeCategoryEnum.DIAGONAL /*, OptionEnum.FILL*/),
|
||||||
CIRCLE("effortlessbuilding.mode.circle", new Circle(), OptionEnum.CIRCLE_START, OptionEnum.FILL),
|
SLOPE_FLOOR("slope_floor", new SlopeFloor(), BuildModeCategoryEnum.DIAGONAL, OptionEnum.RAISED_EDGE),
|
||||||
CYLINDER("effortlessbuilding.mode.cylinder", new Cylinder(), OptionEnum.CIRCLE_START, OptionEnum.FILL),
|
CIRCLE("circle", new Circle(), BuildModeCategoryEnum.CIRCULAR, OptionEnum.CIRCLE_START, OptionEnum.FILL),
|
||||||
SPHERE("effortlessbuilding.mode.sphere", new Sphere(), OptionEnum.CIRCLE_START, OptionEnum.FILL),
|
CYLINDER("cylinder", new Cylinder(), BuildModeCategoryEnum.CIRCULAR, OptionEnum.CIRCLE_START, OptionEnum.FILL),
|
||||||
CUBE("effortlessbuilding.mode.cube", new Cube(), OptionEnum.CUBE_FILL);
|
SPHERE("sphere", new Sphere(), BuildModeCategoryEnum.CIRCULAR, OptionEnum.CIRCLE_START, OptionEnum.FILL);
|
||||||
|
|
||||||
public String name;
|
public String name;
|
||||||
public IBuildMode instance;
|
public IBuildMode instance;
|
||||||
|
public final BuildModeCategoryEnum category;
|
||||||
public OptionEnum[] options;
|
public OptionEnum[] options;
|
||||||
|
|
||||||
BuildModeEnum(String name, IBuildMode instance, OptionEnum... options) {
|
BuildModeEnum(String name, IBuildMode instance, BuildModeCategoryEnum category, OptionEnum... options) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
|
this.category = category;
|
||||||
this.options = options;
|
this.options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNameKey() {
|
||||||
|
return "effortlessbuilding.mode." + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescriptionKey() {
|
||||||
|
return "effortlessbuilding.modedescription." + name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BuildModeCategoryEnum {
|
||||||
|
BASIC(new Vector4f(0f, .5f, 1f, .8f)),
|
||||||
|
DIAGONAL(new Vector4f(0.56f, 0.28f, 0.87f, .8f)),
|
||||||
|
CIRCULAR(new Vector4f(0.29f, 0.76f, 0.3f, 1f)),
|
||||||
|
ROOF(new Vector4f(0.83f, 0.87f, 0.23f, .8f));
|
||||||
|
|
||||||
|
public final Vector4f color;
|
||||||
|
|
||||||
|
BuildModeCategoryEnum(Vector4f color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ import net.minecraft.client.renderer.texture.AtlasTexture;
|
|||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvents;
|
import net.minecraft.util.SoundEvents;
|
||||||
|
import net.minecraft.util.math.vector.Vector4f;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.util.text.TranslationTextComponent;
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import nl.requios.effortlessbuilding.EffortlessBuilding;
|
import nl.requios.effortlessbuilding.EffortlessBuilding;
|
||||||
@@ -40,7 +42,7 @@ import nl.requios.effortlessbuilding.buildmode.ModeOptions.OptionEnum;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initially from Chisels and Bits by AlgorithmX2
|
* Initially from Chisels and Bits by AlgorithmX2
|
||||||
* https://github.com/AlgorithmX2/Chisels-and-Bits/blob/1.12/src/main/java/mod/chiselsandbits/client/gui/ChiselsAndBitsMenu.java
|
* <a href="https://github.com/AlgorithmX2/Chisels-and-Bits/blob/1.12/src/main/java/mod/chiselsandbits/client/gui/ChiselsAndBitsMenu.java">Link</a>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
@@ -48,9 +50,30 @@ import nl.requios.effortlessbuilding.buildmode.ModeOptions.OptionEnum;
|
|||||||
public class RadialMenu extends Screen {
|
public class RadialMenu extends Screen {
|
||||||
|
|
||||||
public static final RadialMenu instance = new RadialMenu();
|
public static final RadialMenu instance = new RadialMenu();
|
||||||
|
|
||||||
|
private final Vector4f radialButtonColor = new Vector4f(0f, 0f, 0f, .5f);
|
||||||
|
private final Vector4f sideButtonColor = new Vector4f(.5f, .5f, .5f, .5f);
|
||||||
|
private final Vector4f highlightColor = new Vector4f(.6f, .8f, 1f, .6f);
|
||||||
|
private final Vector4f selectedColor = new Vector4f(0f, .5f, 1f, .5f);
|
||||||
|
private final Vector4f highlightSelectedColor = new Vector4f(0.2f, .7f, 1f, .7f);
|
||||||
|
|
||||||
|
private final int whiteTextColor = 0xffffffff;
|
||||||
|
private final int watermarkTextColor = 0x88888888;
|
||||||
|
private final int descriptionTextColor = 0xdd888888;
|
||||||
|
private final int optionTextColor = 0xeeeeeeff;
|
||||||
|
|
||||||
|
private final double ringInnerEdge = 30;
|
||||||
|
private final double ringOuterEdge = 65;
|
||||||
|
private final double categoryLineWidth = 1;
|
||||||
|
private final double textDistance = 75;
|
||||||
|
private final double buttonDistance = 105;
|
||||||
|
private final float fadeSpeed = 0.3f;
|
||||||
|
private final int descriptionHeight = 100;
|
||||||
|
|
||||||
public BuildModeEnum switchTo = null;
|
public BuildModeEnum switchTo = null;
|
||||||
public ActionEnum doAction = null;
|
public ActionEnum doAction = null;
|
||||||
public boolean performedActionUsingMouse;
|
public boolean performedActionUsingMouse;
|
||||||
|
|
||||||
private float visibility;
|
private float visibility;
|
||||||
|
|
||||||
public RadialMenu() {
|
public RadialMenu() {
|
||||||
@@ -84,7 +107,7 @@ public class RadialMenu extends Screen {
|
|||||||
RenderSystem.pushMatrix();
|
RenderSystem.pushMatrix();
|
||||||
RenderSystem.translatef(0.0F, 0.0F, 200.0F);
|
RenderSystem.translatef(0.0F, 0.0F, 200.0F);
|
||||||
|
|
||||||
visibility += 0.3f * partialTicks;
|
visibility += fadeSpeed * partialTicks;
|
||||||
if (visibility > 1f) visibility = 1f;
|
if (visibility > 1f) visibility = 1f;
|
||||||
|
|
||||||
final int startColor = (int) (visibility * 98) << 24;
|
final int startColor = (int) (visibility * 98) << 24;
|
||||||
@@ -115,10 +138,6 @@ public class RadialMenu extends Screen {
|
|||||||
final double mouseYCenter = mouseYY - middleY;
|
final double mouseYCenter = mouseYY - middleY;
|
||||||
double mouseRadians = Math.atan2(mouseYCenter, mouseXCenter);
|
double mouseRadians = Math.atan2(mouseYCenter, mouseXCenter);
|
||||||
|
|
||||||
final double ringInnerEdge = 30;
|
|
||||||
final double ringOuterEdge = 65;
|
|
||||||
final double textDistance = 75;
|
|
||||||
final double buttonDistance = 105;
|
|
||||||
final double quarterCircle = Math.PI / 2.0;
|
final double quarterCircle = Math.PI / 2.0;
|
||||||
|
|
||||||
if (mouseRadians < -quarterCircle) {
|
if (mouseRadians < -quarterCircle) {
|
||||||
@@ -153,17 +172,35 @@ public class RadialMenu extends Screen {
|
|||||||
doAction = null;
|
doAction = null;
|
||||||
|
|
||||||
//Draw buildmode backgrounds
|
//Draw buildmode backgrounds
|
||||||
|
drawRadialButtonBackgrounds(currentBuildMode, buffer, middleX, middleY, mouseXCenter, mouseYCenter, mouseRadians,
|
||||||
|
quarterCircle, modes);
|
||||||
|
|
||||||
|
//Draw action backgrounds
|
||||||
|
drawSideButtonBackgrounds(buffer, middleX, middleY, mouseXCenter, mouseYCenter, buttons);
|
||||||
|
|
||||||
|
tessellator.end();
|
||||||
|
|
||||||
|
drawIcons(buffer, middleX, middleY, mc, modes, buttons);
|
||||||
|
|
||||||
|
tessellator.end();
|
||||||
|
|
||||||
|
drawTexts(ms, currentBuildMode, middleX, middleY, modes, buttons, options);
|
||||||
|
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawRadialButtonBackgrounds(BuildModeEnum currentBuildMode, BufferBuilder buffer, double middleX, double middleY,
|
||||||
|
double mouseXCenter, double mouseYCenter, double mouseRadians, double quarterCircle, ArrayList<MenuRegion> modes) {
|
||||||
if (!modes.isEmpty()) {
|
if (!modes.isEmpty()) {
|
||||||
final int totalModes = Math.max(3, modes.size());
|
final int totalModes = Math.max(3, modes.size());
|
||||||
int currentMode = 0;
|
|
||||||
final double fragment = Math.PI * 0.005;
|
final double fragment = Math.PI * 0.005;
|
||||||
final double fragment2 = Math.PI * 0.0025;
|
final double fragment2 = Math.PI * 0.0025;
|
||||||
final double perObject = 2.0 * Math.PI / totalModes;
|
final double perObject = 2.0 * Math.PI / totalModes;
|
||||||
|
|
||||||
for (int i = 0; i < modes.size(); i++) {
|
for (int i = 0; i < modes.size(); i++) {
|
||||||
MenuRegion menuRegion = modes.get(i);
|
MenuRegion menuRegion = modes.get(i);
|
||||||
final double beginRadians = currentMode * perObject - quarterCircle;
|
final double beginRadians = i * perObject - quarterCircle;
|
||||||
final double endRadians = (currentMode + 1) * perObject - quarterCircle;
|
final double endRadians = (i + 1) * perObject - quarterCircle;
|
||||||
|
|
||||||
menuRegion.x1 = Math.cos(beginRadians);
|
menuRegion.x1 = Math.cos(beginRadians);
|
||||||
menuRegion.x2 = Math.cos(endRadians);
|
menuRegion.x2 = Math.cos(endRadians);
|
||||||
@@ -180,81 +217,74 @@ public class RadialMenu extends Screen {
|
|||||||
final double y1m2 = Math.sin(beginRadians + fragment2) * ringOuterEdge;
|
final double y1m2 = Math.sin(beginRadians + fragment2) * ringOuterEdge;
|
||||||
final double y2m2 = Math.sin(endRadians - fragment2) * ringOuterEdge;
|
final double y2m2 = Math.sin(endRadians - fragment2) * ringOuterEdge;
|
||||||
|
|
||||||
float r = 0.0f;
|
final boolean isSelected = currentBuildMode.ordinal() == i;
|
||||||
float g = 0.0f;
|
|
||||||
float b = 0.0f;
|
|
||||||
float a = 0.5f;
|
|
||||||
|
|
||||||
//check if current mode
|
|
||||||
int buildMode = currentBuildMode.ordinal();
|
|
||||||
if (buildMode == i) {
|
|
||||||
r = 0f;
|
|
||||||
g = 0.5f;
|
|
||||||
b = 1f;
|
|
||||||
a = 0.5f;
|
|
||||||
//menuRegion.highlighted = true; //draw text
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if mouse is over this region
|
|
||||||
final boolean isMouseInQuad = inTriangle(x1m1, y1m1, x2m2, y2m2, x2m1, y2m1, mouseXCenter, mouseYCenter)
|
final boolean isMouseInQuad = inTriangle(x1m1, y1m1, x2m2, y2m2, x2m1, y2m1, mouseXCenter, mouseYCenter)
|
||||||
|| inTriangle(x1m1, y1m1, x1m2, y1m2, x2m2, y2m2, mouseXCenter, mouseYCenter);
|
|| inTriangle(x1m1, y1m1, x1m2, y1m2, x2m2, y2m2, mouseXCenter, mouseYCenter);
|
||||||
|
final boolean isHighlighted = beginRadians <= mouseRadians && mouseRadians <= endRadians && isMouseInQuad;
|
||||||
|
|
||||||
if (beginRadians <= mouseRadians && mouseRadians <= endRadians && isMouseInQuad) {
|
Vector4f color = radialButtonColor;
|
||||||
r = 0.6f;
|
if (isSelected) color = selectedColor;
|
||||||
g = 0.8f;
|
if (isHighlighted) color = highlightColor;
|
||||||
b = 1f;
|
if (isSelected && isHighlighted) color = highlightSelectedColor;
|
||||||
a = 0.6f;
|
|
||||||
|
if (isHighlighted) {
|
||||||
menuRegion.highlighted = true;
|
menuRegion.highlighted = true;
|
||||||
switchTo = menuRegion.mode;
|
switchTo = menuRegion.mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.vertex(middleX + x1m1, middleY + y1m1, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + x1m1, middleY + y1m1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + x2m1, middleY + y2m1, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + x2m1, middleY + y2m1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + x2m2, middleY + y2m2, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + x2m2, middleY + y2m2, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + x1m2, middleY + y1m2, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + x1m2, middleY + y1m2, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
|
|
||||||
currentMode++;
|
//Category line
|
||||||
|
color = menuRegion.mode.category.color;
|
||||||
|
final double categoryLineOuterEdge = ringInnerEdge + categoryLineWidth;
|
||||||
|
|
||||||
|
final double x1m3 = Math.cos(beginRadians + fragment) * categoryLineOuterEdge;
|
||||||
|
final double y1m3 = Math.sin(beginRadians + fragment) * categoryLineOuterEdge;
|
||||||
|
final double x2m3 = Math.cos(endRadians - fragment) * categoryLineOuterEdge;
|
||||||
|
final double y2m3 = Math.sin(endRadians - fragment) * categoryLineOuterEdge;
|
||||||
|
|
||||||
|
buffer.vertex(middleX + x1m1, middleY + y1m1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
|
buffer.vertex(middleX + x2m1, middleY + y2m1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
|
buffer.vertex(middleX + x2m3, middleY + y2m3, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
|
buffer.vertex(middleX + x1m3, middleY + y1m3, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Draw action backgrounds
|
private void drawSideButtonBackgrounds(BufferBuilder buffer, double middleX, double middleY, double mouseXCenter, double mouseYCenter, ArrayList<MenuButton> buttons) {
|
||||||
for (final MenuButton btn : buttons) {
|
for (final MenuButton btn : buttons) {
|
||||||
float r = 0.5f;
|
|
||||||
float g = 0.5f;
|
|
||||||
float b = 0.5f;
|
|
||||||
float a = 0.5f;
|
|
||||||
|
|
||||||
//highlight when active option
|
final boolean isSelected =
|
||||||
if (btn.action == getBuildSpeed() ||
|
btn.action == getBuildSpeed() ||
|
||||||
btn.action == getFill() ||
|
btn.action == getFill() ||
|
||||||
btn.action == getCubeFill() ||
|
btn.action == getCubeFill() ||
|
||||||
btn.action == getRaisedEdge() ||
|
btn.action == getRaisedEdge() ||
|
||||||
btn.action == getLineThickness() ||
|
btn.action == getLineThickness() ||
|
||||||
btn.action == getCircleStart()) {
|
btn.action == getCircleStart();
|
||||||
r = 0.0f;
|
|
||||||
g = 0.5f;
|
|
||||||
b = 1f;
|
|
||||||
a = 0.6f;
|
|
||||||
}
|
|
||||||
|
|
||||||
//highlight when mouse over
|
final boolean isHighlighted = btn.x1 <= mouseXCenter && btn.x2 >= mouseXCenter && btn.y1 <= mouseYCenter && btn.y2 >= mouseYCenter;
|
||||||
if (btn.x1 <= mouseXCenter && btn.x2 >= mouseXCenter && btn.y1 <= mouseYCenter && btn.y2 >= mouseYCenter) {
|
|
||||||
r = 0.6f;
|
Vector4f color = sideButtonColor;
|
||||||
g = 0.8f;
|
if (isSelected) color = selectedColor;
|
||||||
b = 1f;
|
if (isHighlighted) color = highlightColor;
|
||||||
a = 0.6f;
|
if (isSelected && isHighlighted) color = highlightSelectedColor;
|
||||||
|
|
||||||
|
if (isHighlighted) {
|
||||||
btn.highlighted = true;
|
btn.highlighted = true;
|
||||||
doAction = btn.action;
|
doAction = btn.action;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.vertex(middleX + btn.x1, middleY + btn.y1, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + btn.x1, middleY + btn.y1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + btn.x1, middleY + btn.y2, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + btn.x1, middleY + btn.y2, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + btn.x2, middleY + btn.y2, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + btn.x2, middleY + btn.y2, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
buffer.vertex(middleX + btn.x2, middleY + btn.y1, getBlitOffset()).color(r, g, b, a).endVertex();
|
buffer.vertex(middleX + btn.x2, middleY + btn.y1, getBlitOffset()).color(color.x(), color.y(), color.z(), color.w()).endVertex();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tessellator.end();
|
private void drawIcons(BufferBuilder buffer, double middleX, double middleY, Minecraft mc, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons) {
|
||||||
|
|
||||||
RenderSystem.shadeModel(GL11.GL_FLAT);
|
RenderSystem.shadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
RenderSystem.translatef(0f, 0f, 5f);
|
RenderSystem.translatef(0f, 0f, 5f);
|
||||||
@@ -269,8 +299,8 @@ public class RadialMenu extends Screen {
|
|||||||
//Draw buildmode icons
|
//Draw buildmode icons
|
||||||
for (final MenuRegion menuRegion : modes) {
|
for (final MenuRegion menuRegion : modes) {
|
||||||
|
|
||||||
final double x = (menuRegion.x1 + menuRegion.x2) * 0.5 * (ringOuterEdge * 0.6 + 0.4 * ringInnerEdge);
|
final double x = (menuRegion.x1 + menuRegion.x2) * 0.5 * (ringOuterEdge * 0.55 + 0.45 * ringInnerEdge);
|
||||||
final double y = (menuRegion.y1 + menuRegion.y2) * 0.5 * (ringOuterEdge * 0.6 + 0.4 * ringInnerEdge);
|
final double y = (menuRegion.y1 + menuRegion.y2) * 0.5 * (ringOuterEdge * 0.55 + 0.45 * ringInnerEdge);
|
||||||
|
|
||||||
final TextureAtlasSprite sprite = ModClientEventHandler.getBuildModeIcon(menuRegion.mode);
|
final TextureAtlasSprite sprite = ModClientEventHandler.getBuildModeIcon(menuRegion.mode);
|
||||||
|
|
||||||
@@ -318,20 +348,19 @@ public class RadialMenu extends Screen {
|
|||||||
buffer.vertex(middleX + btnx2, middleY + btny2, getBlitOffset()).uv(sprite.getU(u2), sprite.getV(v2)).color(f, f, f, a).endVertex();
|
buffer.vertex(middleX + btnx2, middleY + btny2, getBlitOffset()).uv(sprite.getU(u2), sprite.getV(v2)).color(f, f, f, a).endVertex();
|
||||||
buffer.vertex(middleX + btnx2, middleY + btny1, getBlitOffset()).uv(sprite.getU(u2), sprite.getV(v1)).color(f, f, f, a).endVertex();
|
buffer.vertex(middleX + btnx2, middleY + btny1, getBlitOffset()).uv(sprite.getU(u2), sprite.getV(v1)).color(f, f, f, a).endVertex();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tessellator.end();
|
private void drawTexts(MatrixStack ms, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options) {
|
||||||
|
|
||||||
//Draw strings
|
|
||||||
//font.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - font.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
|
//font.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - font.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
|
||||||
|
|
||||||
//Draw option strings
|
//Draw option strings
|
||||||
for (int i = 0; i < currentBuildMode.options.length; i++) {
|
for (int i = 0; i < currentBuildMode.options.length; i++) {
|
||||||
OptionEnum option = options[i];
|
OptionEnum option = options[i];
|
||||||
font.drawShadow(ms, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, 0xeeeeeeff);
|
font.drawShadow(ms, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, optionTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
String credits = "Effortless Building";
|
String credits = "Effortless Building";
|
||||||
font.drawShadow(ms, credits, width - font.width(credits) - 4, height - 10, 0x88888888);
|
font.drawShadow(ms, credits, width - font.width(credits) - 4, height - 10, watermarkTextColor);
|
||||||
|
|
||||||
//Draw buildmode text
|
//Draw buildmode text
|
||||||
for (final MenuRegion menuRegion : modes) {
|
for (final MenuRegion menuRegion : modes) {
|
||||||
@@ -342,7 +371,7 @@ public class RadialMenu extends Screen {
|
|||||||
|
|
||||||
int fixed_x = (int) (x * textDistance);
|
int fixed_x = (int) (x * textDistance);
|
||||||
final int fixed_y = (int) (y * textDistance) - font.lineHeight / 2;
|
final int fixed_y = (int) (y * textDistance) - font.lineHeight / 2;
|
||||||
final String text = I18n.get(menuRegion.mode.name);
|
String text = I18n.get(menuRegion.mode.getNameKey());
|
||||||
|
|
||||||
if (x <= -0.2) {
|
if (x <= -0.2) {
|
||||||
fixed_x -= font.width(text);
|
fixed_x -= font.width(text);
|
||||||
@@ -350,7 +379,11 @@ public class RadialMenu extends Screen {
|
|||||||
fixed_x -= font.width(text) / 2;
|
fixed_x -= font.width(text) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
font.drawShadow(ms, text, (int) middleX + fixed_x, (int) middleY + fixed_y, 0xffffffff);
|
font.drawShadow(ms, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor);
|
||||||
|
|
||||||
|
//Draw description
|
||||||
|
text = I18n.get(menuRegion.mode.getDescriptionKey());
|
||||||
|
font.drawShadow(ms, text, (int) middleX - font.width(text) / 2f, (int) middleY + descriptionHeight, descriptionTextColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,66 +391,71 @@ public class RadialMenu extends Screen {
|
|||||||
for (final MenuButton button : buttons) {
|
for (final MenuButton button : buttons) {
|
||||||
if (button.highlighted) {
|
if (button.highlighted) {
|
||||||
String text = TextFormatting.AQUA + button.name;
|
String text = TextFormatting.AQUA + button.name;
|
||||||
int wrap = 120;
|
|
||||||
String keybind = ""; // FIXME
|
|
||||||
String keybindFormatted = "";
|
|
||||||
|
|
||||||
//Add keybind in brackets
|
//Add keybind in brackets
|
||||||
if (button.action == ActionEnum.UNDO) {
|
String keybind = findKeybind(button, currentBuildMode);
|
||||||
keybind = I18n.get(ClientProxy.keyBindings[3].saveString());
|
String keybindFormatted = "";
|
||||||
}
|
|
||||||
if (button.action == ActionEnum.REDO) {
|
|
||||||
keybind = I18n.get(ClientProxy.keyBindings[4].saveString());
|
|
||||||
}
|
|
||||||
if (button.action == ActionEnum.REPLACE) {
|
|
||||||
keybind = I18n.get(ClientProxy.keyBindings[1].saveString());
|
|
||||||
}
|
|
||||||
if (button.action == ActionEnum.OPEN_MODIFIER_SETTINGS) {
|
|
||||||
keybind = I18n.get(ClientProxy.keyBindings[0].saveString());
|
|
||||||
}
|
|
||||||
if (currentBuildMode.options.length > 0) {
|
|
||||||
//Add (ctrl) to first two actions of first option
|
|
||||||
if (button.action == currentBuildMode.options[0].actions[0]
|
|
||||||
|| button.action == currentBuildMode.options[0].actions[1]) {
|
|
||||||
keybind = I18n.get(ClientProxy.keyBindings[5].saveString());
|
|
||||||
if (keybind.equals("Left Control")) keybind = "Ctrl";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!keybind.isEmpty())
|
if (!keybind.isEmpty())
|
||||||
keybindFormatted = TextFormatting.GRAY + "(" + WordUtils.capitalizeFully(keybind) + ")";
|
keybindFormatted = TextFormatting.GRAY + "(" + WordUtils.capitalizeFully(keybind) + ")";
|
||||||
|
|
||||||
if (button.textSide == Direction.WEST) {
|
if (button.textSide == Direction.WEST) {
|
||||||
|
|
||||||
font.draw(ms, text, (int) (middleX + button.x1 - 8) - font.width(text),
|
font.draw(ms, text, (int) (middleX + button.x1 - 8) - font.width(text),
|
||||||
(int) (middleY + button.y1 + 6), 0xffffffff);
|
(int) (middleY + button.y1 + 6), whiteTextColor);
|
||||||
|
|
||||||
} else if (button.textSide == Direction.EAST) {
|
} else if (button.textSide == Direction.EAST) {
|
||||||
|
|
||||||
font.draw(ms, text, (int) (middleX + button.x2 + 8),
|
font.draw(ms, text, (int) (middleX + button.x2 + 8),
|
||||||
(int) (middleY + button.y1 + 6), 0xffffffff);
|
(int) (middleY + button.y1 + 6), whiteTextColor);
|
||||||
|
|
||||||
} else if (button.textSide == Direction.UP || button.textSide == Direction.NORTH) {
|
} else if (button.textSide == Direction.UP || button.textSide == Direction.NORTH) {
|
||||||
|
|
||||||
font.draw(ms, keybindFormatted, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(keybindFormatted) * 0.5),
|
font.draw(ms, keybindFormatted, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(keybindFormatted) * 0.5),
|
||||||
(int) (middleY + button.y1 - 26), 0xffffffff);
|
(int) (middleY + button.y1 - 26), whiteTextColor);
|
||||||
|
|
||||||
font.draw(ms, text, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(text) * 0.5),
|
font.draw(ms, text, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(text) * 0.5),
|
||||||
(int) (middleY + button.y1 - 14), 0xffffffff);
|
(int) (middleY + button.y1 - 14), whiteTextColor);
|
||||||
|
|
||||||
} else if (button.textSide == Direction.DOWN || button.textSide == Direction.SOUTH) {
|
} else if (button.textSide == Direction.DOWN || button.textSide == Direction.SOUTH) {
|
||||||
|
|
||||||
font.draw(ms, text, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(text) * 0.5),
|
font.draw(ms, text, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(text) * 0.5),
|
||||||
(int) (middleY + button.y1 + 26), 0xffffffff);
|
(int) (middleY + button.y1 + 26), whiteTextColor);
|
||||||
|
|
||||||
font.draw(ms, keybindFormatted, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(keybindFormatted) * 0.5),
|
font.draw(ms, keybindFormatted, (int) (middleX + (button.x1 + button.x2) * 0.5 - font.width(keybindFormatted) * 0.5),
|
||||||
(int) (middleY + button.y1 + 38), 0xffffffff);
|
(int) (middleY + button.y1 + 38), whiteTextColor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RenderSystem.popMatrix();
|
private String findKeybind(MenuButton button, BuildModeEnum currentBuildMode){
|
||||||
|
String result = "";
|
||||||
|
int keybindingIndex = -1;
|
||||||
|
if (button.action == ActionEnum.UNDO) keybindingIndex = 3;
|
||||||
|
if (button.action == ActionEnum.REDO) keybindingIndex = 4;
|
||||||
|
if (button.action == ActionEnum.REPLACE) keybindingIndex = 1;
|
||||||
|
if (button.action == ActionEnum.OPEN_MODIFIER_SETTINGS) keybindingIndex = 0;
|
||||||
|
|
||||||
|
if (keybindingIndex != -1) {
|
||||||
|
KeyBinding keyMap = ClientProxy.keyBindings[keybindingIndex];
|
||||||
|
|
||||||
|
if (!keyMap.getKeyModifier().name().equals("none")) {
|
||||||
|
result = keyMap.getKeyModifier().name() + " ";
|
||||||
|
}
|
||||||
|
result += I18n.get(keyMap.getKey().getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentBuildMode.options.length > 0) {
|
||||||
|
//Add (ctrl) to first two actions of first option
|
||||||
|
if (button.action == currentBuildMode.options[0].actions[0]
|
||||||
|
|| button.action == currentBuildMode.options[0].actions[1]) {
|
||||||
|
result = I18n.get(ClientProxy.keyBindings[5].getKey().getName());
|
||||||
|
if (result.equals("Left Control")) result = "Ctrl";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean inTriangle(final double x1, final double y1, final double x2, final double y2,
|
private boolean inTriangle(final double x1, final double y1, final double x2, final double y2,
|
||||||
@@ -463,7 +501,7 @@ public class RadialMenu extends Screen {
|
|||||||
ModeSettingsManager.setModeSettings(player, modeSettings);
|
ModeSettingsManager.setModeSettings(player, modeSettings);
|
||||||
PacketHandler.INSTANCE.sendToServer(new ModeSettingsMessage(modeSettings));
|
PacketHandler.INSTANCE.sendToServer(new ModeSettingsMessage(modeSettings));
|
||||||
|
|
||||||
EffortlessBuilding.log(player, I18n.get(modeSettings.getBuildMode().name), true);
|
EffortlessBuilding.log(player, I18n.get(modeSettings.getBuildMode().getNameKey()), true);
|
||||||
|
|
||||||
if (fromMouseClick) performedActionUsingMouse = true;
|
if (fromMouseClick) performedActionUsingMouse = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import net.minecraft.client.renderer.RenderState;
|
|||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||||
@@ -14,22 +15,7 @@ import org.lwjgl.opengl.*;
|
|||||||
import java.util.OptionalDouble;
|
import java.util.OptionalDouble;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class BuildRenderTypes {
|
public class BuildRenderTypes extends RenderType {
|
||||||
public static final RenderState.TransparencyState TRANSLUCENT_TRANSPARENCY;
|
|
||||||
public static final RenderState.TransparencyState NO_TRANSPARENCY;
|
|
||||||
|
|
||||||
public static final RenderState.DiffuseLightingState DIFFUSE_LIGHTING_ENABLED;
|
|
||||||
public static final RenderState.DiffuseLightingState DIFFUSE_LIGHTING_DISABLED;
|
|
||||||
|
|
||||||
public static final RenderState.LayerState PROJECTION_LAYERING;
|
|
||||||
|
|
||||||
public static final RenderState.CullState CULL_DISABLED;
|
|
||||||
|
|
||||||
public static final RenderState.AlphaState DEFAULT_ALPHA;
|
|
||||||
|
|
||||||
public static final RenderState.WriteMaskState WRITE_TO_DEPTH_AND_COLOR;
|
|
||||||
public static final RenderState.WriteMaskState COLOR_WRITE;
|
|
||||||
|
|
||||||
public static final RenderType LINES;
|
public static final RenderType LINES;
|
||||||
public static final RenderType PLANES;
|
public static final RenderType PLANES;
|
||||||
|
|
||||||
@@ -37,57 +23,42 @@ public class BuildRenderTypes {
|
|||||||
private static final int secondaryTextureUnit = 2;
|
private static final int secondaryTextureUnit = 2;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
TRANSLUCENT_TRANSPARENCY = ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "TRANSLUCENT_TRANSPARENCY");
|
final LineState LINE = new LineState(OptionalDouble.of(2.0));
|
||||||
NO_TRANSPARENCY = ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "NO_TRANSPARENCY");
|
|
||||||
|
|
||||||
DIFFUSE_LIGHTING_ENABLED = new RenderState.DiffuseLightingState(true);
|
|
||||||
DIFFUSE_LIGHTING_DISABLED = new RenderState.DiffuseLightingState(false);
|
|
||||||
|
|
||||||
PROJECTION_LAYERING = ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "VIEW_OFFSET_Z_LAYERING");
|
|
||||||
|
|
||||||
CULL_DISABLED = new RenderState.CullState(false);
|
|
||||||
|
|
||||||
DEFAULT_ALPHA = new RenderState.AlphaState(0.003921569F);
|
|
||||||
|
|
||||||
final boolean ENABLE_DEPTH_WRITING = true;
|
|
||||||
final boolean ENABLE_COLOUR_COMPONENTS_WRITING = true;
|
|
||||||
WRITE_TO_DEPTH_AND_COLOR = new RenderState.WriteMaskState(ENABLE_COLOUR_COMPONENTS_WRITING, ENABLE_DEPTH_WRITING);
|
|
||||||
COLOR_WRITE = new RenderState.WriteMaskState(true, false);
|
|
||||||
|
|
||||||
final int INITIAL_BUFFER_SIZE = 128;
|
final int INITIAL_BUFFER_SIZE = 128;
|
||||||
RenderType.State renderState;
|
RenderType.State renderState;
|
||||||
|
|
||||||
//LINES
|
//LINES
|
||||||
// RenderSystem.pushLightingAttributes();
|
renderState = State.builder()
|
||||||
// RenderSystem.pushTextureAttributes();
|
.setLineState(LINE)
|
||||||
// RenderSystem.disableCull();
|
.setLayeringState(VIEW_OFFSET_Z_LAYERING)
|
||||||
// RenderSystem.disableLighting();
|
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||||
// RenderSystem.disableTexture();
|
.setTextureState(NO_TEXTURE)
|
||||||
//
|
.setDepthTestState(NO_DEPTH_TEST)
|
||||||
// RenderSystem.enableBlend();
|
.setLightmapState(NO_LIGHTMAP)
|
||||||
// RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
.setWriteMaskState(COLOR_DEPTH_WRITE)
|
||||||
//
|
.setCullState(NO_CULL)
|
||||||
// RenderSystem.lineWidth(2);
|
.createCompositeState(false);
|
||||||
renderState = RenderType.State.builder()
|
|
||||||
.setLineState(new RenderState.LineState(OptionalDouble.of(2)))
|
|
||||||
.setLayeringState(PROJECTION_LAYERING)
|
|
||||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
|
||||||
.setWriteMaskState(WRITE_TO_DEPTH_AND_COLOR)
|
|
||||||
.setCullState(CULL_DISABLED)
|
|
||||||
.createCompositeState(false);
|
|
||||||
LINES = RenderType.create("eb_lines",
|
LINES = RenderType.create("eb_lines",
|
||||||
DefaultVertexFormats.POSITION_COLOR, GL11.GL_LINES, INITIAL_BUFFER_SIZE, renderState);
|
DefaultVertexFormats.POSITION_COLOR, GL11.GL_LINES, INITIAL_BUFFER_SIZE, false, false, renderState);
|
||||||
|
|
||||||
renderState = RenderType.State.builder()
|
//PLANES
|
||||||
.setLineState(new RenderState.LineState(OptionalDouble.of(2)))
|
renderState = State.builder()
|
||||||
.setLayeringState(PROJECTION_LAYERING)
|
.setLineState(LINE)
|
||||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
.setLayeringState(VIEW_OFFSET_Z_LAYERING)
|
||||||
.setWriteMaskState(COLOR_WRITE)
|
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||||
.setCullState(CULL_DISABLED)
|
.setTextureState(NO_TEXTURE)
|
||||||
.createCompositeState(false);
|
.setDepthTestState(NO_DEPTH_TEST)
|
||||||
|
.setLightmapState(NO_LIGHTMAP)
|
||||||
|
.setWriteMaskState(COLOR_WRITE)
|
||||||
|
.setCullState(NO_CULL)
|
||||||
|
.createCompositeState(false);
|
||||||
PLANES = RenderType.create("eb_planes",
|
PLANES = RenderType.create("eb_planes",
|
||||||
DefaultVertexFormats.POSITION_COLOR, GL11.GL_TRIANGLE_STRIP, INITIAL_BUFFER_SIZE, renderState);
|
DefaultVertexFormats.POSITION_COLOR, GL11.GL_TRIANGLE_STRIP, INITIAL_BUFFER_SIZE, false, false, renderState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dummy constructor needed to make java happy
|
||||||
|
public BuildRenderTypes(String p_i225992_1_, VertexFormat p_i225992_2_, int p_i225992_3_, int p_i225992_4_, boolean p_i225992_5_, boolean p_i225992_6_, Runnable p_i225992_7_, Runnable p_i225992_8_) {
|
||||||
|
super(p_i225992_1_, p_i225992_2_, p_i225992_3_, p_i225992_4_, p_i225992_5_, p_i225992_6_, p_i225992_7_, p_i225992_8_);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RenderType getBlockPreviewRenderType(float dissolve, BlockPos blockPos, BlockPos firstPos,
|
public static RenderType getBlockPreviewRenderType(float dissolve, BlockPos blockPos, BlockPos firstPos,
|
||||||
@@ -107,7 +78,7 @@ public class BuildRenderTypes {
|
|||||||
//highjacking texturing state (which does nothing by default) to do my own things
|
//highjacking texturing state (which does nothing by default) to do my own things
|
||||||
|
|
||||||
String stateName = "eb_texturing_" + dissolve + "_" + blockPos + "_" + firstPos + "_" + secondPos + "_" + red;
|
String stateName = "eb_texturing_" + dissolve + "_" + blockPos + "_" + firstPos + "_" + secondPos + "_" + red;
|
||||||
RenderState.TexturingState MY_TEXTURING = new RenderState.TexturingState(stateName, () -> {
|
TexturingState MY_TEXTURING = new TexturingState(stateName, () -> {
|
||||||
// RenderSystem.pushLightingAttributes();
|
// RenderSystem.pushLightingAttributes();
|
||||||
// RenderSystem.pushTextureAttributes();
|
// RenderSystem.pushTextureAttributes();
|
||||||
|
|
||||||
@@ -116,14 +87,14 @@ public class BuildRenderTypes {
|
|||||||
}, ShaderHandler::releaseShader);
|
}, ShaderHandler::releaseShader);
|
||||||
|
|
||||||
RenderType.State renderState = RenderType.State.builder()
|
RenderType.State renderState = RenderType.State.builder()
|
||||||
.setTextureState(new RenderState.TextureState(ShaderHandler.shaderMaskTextureLocation, false, false))
|
.setTextureState(new TextureState(ShaderHandler.shaderMaskTextureLocation, false, false))
|
||||||
.setTexturingState(MY_TEXTURING)
|
.setTexturingState(MY_TEXTURING)
|
||||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||||
.setDiffuseLightingState(DIFFUSE_LIGHTING_DISABLED)
|
.setDiffuseLightingState(NO_DIFFUSE_LIGHTING)
|
||||||
.setAlphaState(DEFAULT_ALPHA)
|
.setAlphaState(DEFAULT_ALPHA)
|
||||||
.setCullState(new RenderState.CullState(true))
|
.setCullState(new CullState(true))
|
||||||
.setLightmapState(new RenderState.LightmapState(false))
|
.setLightmapState(new LightmapState(false))
|
||||||
.setOverlayState(new RenderState.OverlayState(false))
|
.setOverlayState(new OverlayState(false))
|
||||||
.createCompositeState(true);
|
.createCompositeState(true);
|
||||||
//Unique name for every combination, otherwise it will reuse the previous one
|
//Unique name for every combination, otherwise it will reuse the previous one
|
||||||
String name = "eb_block_previews_" + dissolve + "_" + blockPos + "_" + firstPos + "_" + secondPos + "_" + red;
|
String name = "eb_block_previews_" + dissolve + "_" + blockPos + "_" + firstPos + "_" + secondPos + "_" + red;
|
||||||
@@ -198,43 +169,4 @@ public class BuildRenderTypes {
|
|||||||
this.red = red;
|
this.red = red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static class MyTexturingState extends RenderState.TexturingState {
|
|
||||||
//
|
|
||||||
// public float dissolve;
|
|
||||||
// public Vector3d blockPos;
|
|
||||||
// public Vector3d firstPos;
|
|
||||||
// public Vector3d secondPos;
|
|
||||||
// public boolean highlight;
|
|
||||||
// public boolean red;
|
|
||||||
//
|
|
||||||
// public MyTexturingState(String p_i225989_1_, float dissolve, Vector3d blockPos, Vector3d firstPos,
|
|
||||||
// Vector3d secondPos, boolean highlight, boolean red, Runnable p_i225989_2_, Runnable p_i225989_3_) {
|
|
||||||
// super(p_i225989_1_, p_i225989_2_, p_i225989_3_);
|
|
||||||
// this.dissolve = dissolve;
|
|
||||||
// this.blockPos = blockPos;
|
|
||||||
// this.firstPos = firstPos;
|
|
||||||
// this.secondPos = secondPos;
|
|
||||||
// this.highlight = highlight;
|
|
||||||
// this.red = red;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean equals(Object p_equals_1_) {
|
|
||||||
// if (this == p_equals_1_) {
|
|
||||||
// return true;
|
|
||||||
// } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) {
|
|
||||||
// MyTexturingState other = (MyTexturingState)p_equals_1_;
|
|
||||||
// return this.dissolve == other.dissolve && this.blockPos == other.blockPos && this.firstPos == other.firstPos
|
|
||||||
// && this.secondPos == other.secondPos && this.highlight == other.highlight && this.red == other.red;
|
|
||||||
// } else {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int hashCode() {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
|
||||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
|
||||||
# The overall format is standard TOML format, v0.5.0.
|
|
||||||
# Note that there are a couple of TOML lists in this file.
|
|
||||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
|
||||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
|
||||||
modLoader="javafml" #mandatory
|
modLoader="javafml" #mandatory
|
||||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||||
loaderVersion="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
loaderVersion="[34,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||||
@@ -30,7 +24,7 @@ credits="" #optional
|
|||||||
authors="Requios" #optional
|
authors="Requios" #optional
|
||||||
# The description text for the mod (multi line!) (#mandatory)
|
# The description text for the mod (multi line!) (#mandatory)
|
||||||
description='''
|
description='''
|
||||||
Makes building easier by providing tools like mirrors, arrays, QuickReplace and a block randomizer. For survival and creative mode.
|
Makes building easier by providing tools like mirrors, arrays, build modes and a block randomizer. For survival and creative mode.
|
||||||
'''
|
'''
|
||||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||||
[[dependencies.examplemod]] #optional
|
[[dependencies.examplemod]] #optional
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
"effortlessbuilding:reach_upgrade2": "Reach Upgrade 2",
|
"effortlessbuilding:reach_upgrade2": "Reach Upgrade 2",
|
||||||
"effortlessbuilding:reach_upgrade3": "Reach Upgrade 3",
|
"effortlessbuilding:reach_upgrade3": "Reach Upgrade 3",
|
||||||
|
|
||||||
"effortlessbuilding.mode.normal": "Normal",
|
"effortlessbuilding.mode.normal": "Disable",
|
||||||
"effortlessbuilding.mode.normal_plus": "Normal+",
|
"effortlessbuilding.mode.normal_plus": "Single",
|
||||||
"effortlessbuilding.mode.line": "Line",
|
"effortlessbuilding.mode.line": "Line",
|
||||||
"effortlessbuilding.mode.wall": "Wall",
|
"effortlessbuilding.mode.wall": "Wall",
|
||||||
"effortlessbuilding.mode.floor": "Floor",
|
"effortlessbuilding.mode.floor": "Floor",
|
||||||
@@ -30,6 +30,25 @@
|
|||||||
"effortlessbuilding.mode.circle": "Circle",
|
"effortlessbuilding.mode.circle": "Circle",
|
||||||
"effortlessbuilding.mode.cylinder": "Cylinder",
|
"effortlessbuilding.mode.cylinder": "Cylinder",
|
||||||
"effortlessbuilding.mode.sphere": "Sphere",
|
"effortlessbuilding.mode.sphere": "Sphere",
|
||||||
|
"effortlessbuilding.mode.pyramid": "Pyramid",
|
||||||
|
"effortlessbuilding.mode.cone": "Cone",
|
||||||
|
"effortlessbuilding.mode.dome": "Dome",
|
||||||
|
|
||||||
|
"effortlessbuilding.modedescription.normal": "Disable mod and use vanilla placement rules",
|
||||||
|
"effortlessbuilding.modedescription.normal_plus": "Like vanilla, but with increased reach and placement preview",
|
||||||
|
"effortlessbuilding.modedescription.line": "",
|
||||||
|
"effortlessbuilding.modedescription.wall": "",
|
||||||
|
"effortlessbuilding.modedescription.floor": "",
|
||||||
|
"effortlessbuilding.modedescription.diagonal_line": "",
|
||||||
|
"effortlessbuilding.modedescription.diagonal_wall": "",
|
||||||
|
"effortlessbuilding.modedescription.slope_floor": "",
|
||||||
|
"effortlessbuilding.modedescription.cube": "",
|
||||||
|
"effortlessbuilding.modedescription.circle": "",
|
||||||
|
"effortlessbuilding.modedescription.cylinder": "",
|
||||||
|
"effortlessbuilding.modedescription.sphere": "",
|
||||||
|
"effortlessbuilding.modedescription.pyramid": "",
|
||||||
|
"effortlessbuilding.modedescription.cone": "",
|
||||||
|
"effortlessbuilding.modedescription.dome": "",
|
||||||
|
|
||||||
"effortlessbuilding.action.undo": "Undo",
|
"effortlessbuilding.action.undo": "Undo",
|
||||||
"effortlessbuilding.action.redo": "Redo",
|
"effortlessbuilding.action.redo": "Redo",
|
||||||
|
|||||||
79
src/main/resources/assets/effortlessbuilding/lang/ru_ru.json
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"efortlessbuilding.screen.modifier_settings": "Настройки модификатора",
|
||||||
|
"efortlessbuilding.screen.radial_menu": "Режимы строительства",
|
||||||
|
"efortlessbuilding.screen.player_settings": "Настройки игрока",
|
||||||
|
|
||||||
|
"key.efortlessbuilding.category": "Строительство без усилий",
|
||||||
|
"key.efortlessbuilding.hud.desc": "Меню модификаторов",
|
||||||
|
"key.effortlessbuilding.replace.desc": "Переключить быструю замену",
|
||||||
|
"key.efortlessbuilding.mode.desc": "Круговое меню",
|
||||||
|
"key.efortlessbuilding.undo.desc": "Отменить",
|
||||||
|
"key.effortlessbuilding.redo.desc": "Повторить",
|
||||||
|
"key.efortlessbuilding.altplacement.desc": "Альтернативное размещение",
|
||||||
|
|
||||||
|
"efortlessbuilding:randomizer_bag": "Кожаная сумка рандомизатора",
|
||||||
|
"efortlessbuilding:golden_randomizer_bag": "Золотой мешок рандомизатора",
|
||||||
|
"efortlessbuilding:diamond_randomizer_bag": "Бриллиантовый рандомизатор",
|
||||||
|
"efortlessbuilding:reach_upgrade1": "Достичь улучшения 1",
|
||||||
|
"efortlessbuilding:reach_upgrade2": "Достичь улучшения 2",
|
||||||
|
"efortlessbuilding:reach_upgrade3": "Достичь улучшения 3",
|
||||||
|
|
||||||
|
"efortlessbuilding.mode.normal": "Отключить",
|
||||||
|
"efortlessbuilding.mode.normal_plus": "Одиночный",
|
||||||
|
"efortlessbuilding.mode.line": "Линия",
|
||||||
|
"efortlessbuilding.mode.wall": "Стена",
|
||||||
|
"efortlessbuilding.mode.floor": "Этаж",
|
||||||
|
"efortlessbuilding.mode.diagonal_line": "Диагональная линия",
|
||||||
|
"efortlessbuilding.mode.diagonal_wall": "Диагональная стена",
|
||||||
|
"effortlessbuilding.mode.slope_floor": "Наклонный этаж",
|
||||||
|
"effortlessbuilding.mode.cube": "Куб",
|
||||||
|
"efortlessbuilding.mode.circle": "Круг",
|
||||||
|
"efortlessbuilding.mode.cylinder": "Цилиндр",
|
||||||
|
"efortlessbuilding.mode.sphere": "Сфера",
|
||||||
|
"efortlessbuilding.mode.pyramid": "Пирамида",
|
||||||
|
"effortlessbuilding.mode.cone": "Конус",
|
||||||
|
"efortlessbuilding.mode.dome": "Купол",
|
||||||
|
|
||||||
|
"effortlessbuilding.modedescription.normal": "Отключить мод и использовать ванильные правила размещения",
|
||||||
|
"effortlessbuilding.modedescription.normal_plus": "Как и ваниль, но с увеличенным охватом и предварительным просмотром места размещения",
|
||||||
|
"efortlessbuilding.modedescription.line": "",
|
||||||
|
"efortlessbuilding.modedescription.wall": "",
|
||||||
|
"efortlessbuilding.modedescription.floor": "",
|
||||||
|
"efortlessbuilding.modedescription.diagonal_line": "",
|
||||||
|
"efortlessbuilding.modedescription.diagonal_wall": "",
|
||||||
|
"effortlessbuilding.modedescription.slope_floor": "",
|
||||||
|
"efortlessbuilding.modedescription.cube": "",
|
||||||
|
"efortlessbuilding.modedescription.circle": "",
|
||||||
|
"efortlessbuilding.modedescription.cylinder": "",
|
||||||
|
"efortlessbuilding.modedescription.sphere": "",
|
||||||
|
"efortlessbuilding.modedescription.pyramid": "",
|
||||||
|
"efortlessbuilding.modedescription.cone": "",
|
||||||
|
"efortlessbuilding.modedescription.dome": "",
|
||||||
|
|
||||||
|
"efortlessbuilding.action.undo": "Отменить",
|
||||||
|
"efortlessbuilding.action.redo": "Повторить",
|
||||||
|
"efortlessbuilding.action.replace": "Заменить",
|
||||||
|
"efortlessbuilding.action.open_modifier_settings": "Открыть настройки модификатора",
|
||||||
|
"efortlessbuilding.action.open_player_settings": "Открыть настройки",
|
||||||
|
|
||||||
|
"efortlessbuilding.action.build_speed": "Скорость сборки",
|
||||||
|
"efortlessbuilding.action.filling": "Заполнение",
|
||||||
|
"efortlessbuilding.action.raised_edge": "Приподнятый край",
|
||||||
|
"efortlessbuilding.action.thickness": "Толщина линии",
|
||||||
|
"efortlessbuilding.action.circle_start": "Начальная точка",
|
||||||
|
|
||||||
|
"efortlessbuilding.action.normal_speed": "Нормальный",
|
||||||
|
"efortlessbuilding.action.fast_speed": "Быстро",
|
||||||
|
"efortlessbuilding.action.full": "Заполнено",
|
||||||
|
"efortlessbuilding.action.hollow": "Пустой",
|
||||||
|
"efortlessbuilding.action.skeleton": "Скелет",
|
||||||
|
"efortlessbuilding.action.short_edge": "Короткая кромка",
|
||||||
|
"efortlessbuilding.action.long_edge": "Длинный край",
|
||||||
|
"efortlessbuilding.action.thickness_1": "Толщиной 1 блок",
|
||||||
|
"efortlessbuilding.action.thickness_3": "Толщиной 3 блока",
|
||||||
|
"efortlessbuilding.action.thickness_5": "Толщиной 5 блоков",
|
||||||
|
"efortlessbuilding.action.start_center": "Посередине",
|
||||||
|
"efortlessbuilding.action.start_corner": "Угол",
|
||||||
|
|
||||||
|
"commands.reach.usage": "/reach <уровень>"
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 317 B |
|
After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 603 B |
@@ -10,7 +10,7 @@
|
|||||||
"item": "minecraft:ender_pearl"
|
"item": "minecraft:ender_pearl"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"item": "minecraft:prismarine_crystals"
|
"item": "minecraft:slime_ball"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
{
|
{
|
||||||
"type": "minecraft:crafting_shaped",
|
"type": "minecraft:crafting_shaped",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
"x#x",
|
" # ",
|
||||||
"#O#",
|
"#O#",
|
||||||
"x#x"
|
" # "
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"O": {
|
"O": {
|
||||||
"item": "minecraft:ender_pearl"
|
"item": "minecraft:ender_pearl"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"item": "minecraft:slime_ball"
|
"item": "minecraft:blaze_powder"
|
||||||
},
|
}
|
||||||
"x": {
|
|
||||||
"item": "minecraft:chorus_fruit"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "effortlessbuilding:reach_upgrade2"
|
"item": "effortlessbuilding:reach_upgrade2"
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"O": {
|
"O": {
|
||||||
"item": "minecraft:nether_star"
|
"item": "minecraft:end_crystal"
|
||||||
},
|
},
|
||||||
"#": {
|
"#": {
|
||||||
"item": "minecraft:diamond"
|
"item": "minecraft:chorus_fruit"
|
||||||
},
|
},
|
||||||
"x": {
|
"x": {
|
||||||
"item": "minecraft:purple_dye"
|
"item": "minecraft:ghast_tear"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||