mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Compare commits
No commits in common. "de635bb709691bb768699e528047f9d7cf3b2ce6" and "db1bb6e7eb75f77f915290a7d93b71f884d9d3a4" have entirely different histories.
de635bb709
...
db1bb6e7eb
3 changed files with 53 additions and 34 deletions
|
@ -94,6 +94,9 @@ repositories {
|
||||||
includeGroup "curse.maven"
|
includeGroup "curse.maven"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
url = "https://api.modrinth.com/maven"
|
||||||
|
}
|
||||||
maven { url = 'https://maven.octo-studios.com/releases' }
|
maven { url = 'https://maven.octo-studios.com/releases' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +113,8 @@ dependencies {
|
||||||
|
|
||||||
localRuntime "curse.maven:jade-324717:5803666"
|
localRuntime "curse.maven:jade-324717:5803666"
|
||||||
localRuntime "curse.maven:mekanism-268560:5680395"
|
localRuntime "curse.maven:mekanism-268560:5680395"
|
||||||
|
localRuntime "maven.modrinth:sodium:mc1.21.1-0.6.0-beta.4-neoforge"
|
||||||
|
localRuntime "curse.maven:irisshaders-455508:5873114"
|
||||||
|
|
||||||
// Immersive Engineering, mainly for compat datagen
|
// Immersive Engineering, mainly for compat datagen
|
||||||
localRuntime "curse.maven:ie-231951:5828000"
|
localRuntime "curse.maven:ie-231951:5828000"
|
||||||
|
|
|
@ -37,8 +37,9 @@ public class ParticleBeam extends Particle {
|
||||||
public BufferBuilder begin(Tesselator tesselator, TextureManager textureManager) {
|
public BufferBuilder begin(Tesselator tesselator, TextureManager textureManager) {
|
||||||
RenderSystem.disableCull();
|
RenderSystem.disableCull();
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 0.2F);
|
||||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
|
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
|
||||||
return tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
|
return tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.PARTICLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,7 +101,7 @@ public class ParticleBeam extends Particle {
|
||||||
|
|
||||||
public static ParticleOptions createData(double endX, double endY, double endZ, int color, float alpha,
|
public static ParticleOptions createData(double endX, double endY, double endZ, int color, float alpha,
|
||||||
int maxAge, double rotationTime, float size) {
|
int maxAge, double rotationTime, float size) {
|
||||||
return new BeamParticleData(endX, endY, endZ, FastColor.ARGB32.color((int)(alpha * 255F), color), maxAge, rotationTime, size);
|
return new BeamParticleData(endX, endY, endZ, color, maxAge, rotationTime, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import net.minecraft.client.renderer.LightTexture;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.entity.ItemRenderer;
|
import net.minecraft.client.renderer.entity.ItemRenderer;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
import net.minecraft.client.resources.model.BakedModel;
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -253,29 +254,35 @@ public final class AssetUtil {
|
||||||
|
|
||||||
Matrix4f matrix = matrixStack.last().pose();
|
Matrix4f matrix = matrixStack.last().pose();
|
||||||
|
|
||||||
|
TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(FORGE_WHITE);
|
||||||
|
float minU = sprite.getU0();
|
||||||
|
float maxU = sprite.getU1();
|
||||||
|
float minV = sprite.getV0();
|
||||||
|
float maxV = sprite.getV1();
|
||||||
|
|
||||||
//Draw laser tube faces
|
//Draw laser tube faces
|
||||||
for (int i = 1; i < 4; i++) {
|
for (int i = 1; i < 4; i++) {
|
||||||
float width = beamWidth * (i / 4.0f);
|
float width = beamWidth * (i / 4.0f);
|
||||||
//top
|
//top
|
||||||
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setUv(minU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setUv(maxU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
//bottom
|
//bottom
|
||||||
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setUv(minU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setUv(maxU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
//left
|
//left
|
||||||
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
//right
|
//right
|
||||||
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setLight(lightmap);
|
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,29 +336,35 @@ public final class AssetUtil {
|
||||||
|
|
||||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||||
|
|
||||||
|
TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(FORGE_WHITE);
|
||||||
|
float minU = sprite.getU0();
|
||||||
|
float maxU = sprite.getU1();
|
||||||
|
float minV = sprite.getV0();
|
||||||
|
float maxV = sprite.getV1();
|
||||||
|
|
||||||
//Draw laser tube faces
|
//Draw laser tube faces
|
||||||
for (int i = 1; i < 4; i++) {
|
for (int i = 1; i < 4; i++) {
|
||||||
float width = beamWidth * (i / 4.0f);
|
float width = beamWidth * (i / 4.0f);
|
||||||
//top
|
//top
|
||||||
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setUv(minU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setUv(maxU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
//bottom
|
//bottom
|
||||||
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setUv(minU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setUv(maxU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
//left
|
//left
|
||||||
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, -width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
//right
|
//right
|
||||||
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, -width, 0.0f).setColor(r, g, b, a).setUv(maxU, maxV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, -width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a);
|
builder.addVertex(matrix, width, width, -length).setColor(r, g, b, a).setUv(minU, minV).setLight(lightmap);
|
||||||
|
|
||||||
}
|
}
|
||||||
matrixStack.popPose();
|
matrixStack.popPose();
|
||||||
|
|
Loading…
Reference in a new issue