v1.4.0
This commit is contained in:
1 parent
b82f9aca22
commit
9f1ea674b8
22 files changed
+146
-50
No files matched your search
@@ -23,7 +23,9 @@ import net.neoforged.neoforge.client.event.RenderLevelStageEvent;
|
||||
public class EntityEmissiveRenderer {
|
||||
@SubscribeEvent
|
||||
public static void onRenderStage(RenderLevelStageEvent event) {
|
||||
if(event.getStage() != RenderLevelStageEvent.Stage.AFTER_WEATHER) return;
|
||||
if(event.getStage() != RenderLevelStageEvent.Stage.AFTER_ENTITIES) return;
|
||||
|
||||
/*
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if(mc.level == null || mc.player == null) return;
|
||||
@@ -68,5 +70,7 @@ public class EntityEmissiveRenderer {
|
||||
}
|
||||
bufferSource.endBatch();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class ModEntities {
|
||||
.sized(1.0f, 1.0f)
|
||||
.clientTrackingRange(1024)
|
||||
.updateInterval(1)
|
||||
.fireImmune()
|
||||
.build("static_projectile")
|
||||
);
|
||||
public static final Supplier<EntityType<StaticSummon>> STATIC_SUMMON =
|
||||
@@ -31,6 +32,7 @@ public class ModEntities {
|
||||
.sized(1.0f, 1.0f)
|
||||
.clientTrackingRange(1024)
|
||||
.updateInterval(1)
|
||||
.fireImmune()
|
||||
.build("static_summon")
|
||||
);
|
||||
|
||||
@@ -40,6 +42,7 @@ public class ModEntities {
|
||||
.sized(0.5f, 0.5f)
|
||||
.clientTrackingRange(1024)
|
||||
.updateInterval(1)
|
||||
.fireImmune()
|
||||
.build("sword_beam")
|
||||
);
|
||||
|
||||
@@ -47,7 +50,8 @@ public class ModEntities {
|
||||
ENTITY_TYPES.register("bee_summon", () -> EntityType.Builder.of(
|
||||
BeeSummon::new, MobCategory.MISC)
|
||||
.sized(0.7F, 0.6F)
|
||||
.clientTrackingRange(8)
|
||||
.clientTrackingRange(1024)
|
||||
.fireImmune()
|
||||
.build("bee_summon")
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.lzxnone.terraria.entity;
|
||||
|
||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.RenderStateShard;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class ModRenderTypes {
|
||||
public static RenderType entityTranslucentEmissive(ResourceLocation texture) {
|
||||
return RenderType.create(
|
||||
"m_entity_translucent_emissive",
|
||||
DefaultVertexFormat.NEW_ENTITY,
|
||||
VertexFormat.Mode.QUADS,
|
||||
1536,
|
||||
false,
|
||||
false,
|
||||
RenderType.CompositeState.builder()
|
||||
.setShaderState(RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_EMISSIVE_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(texture, false, false))
|
||||
.setTransparencyState(RenderStateShard.TRANSLUCENT_TRANSPARENCY)
|
||||
.setCullState(RenderStateShard.NO_CULL)
|
||||
.setLightmapState(RenderStateShard.NO_LIGHTMAP)
|
||||
.setOverlayState(RenderStateShard.OVERLAY)
|
||||
.setDepthTestState(RenderStateShard.LEQUAL_DEPTH_TEST)
|
||||
.setWriteMaskState(RenderStateShard.COLOR_DEPTH_WRITE)
|
||||
.createCompositeState(true)
|
||||
);
|
||||
}
|
||||
|
||||
public static RenderType entityTranslucent(ResourceLocation texture) {
|
||||
return RenderType.create(
|
||||
"m_entity_translucent",
|
||||
DefaultVertexFormat.NEW_ENTITY,
|
||||
VertexFormat.Mode.QUADS,
|
||||
1536,
|
||||
false,
|
||||
false,
|
||||
RenderType.CompositeState.builder()
|
||||
// 1. 核心修改:换成标准实体半透明着色器(支持环境光照计算)
|
||||
.setShaderState(RenderStateShard.RENDERTYPE_ENTITY_TRANSLUCENT_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(texture, false, false))
|
||||
.setTransparencyState(RenderStateShard.TRANSLUCENT_TRANSPARENCY)
|
||||
.setCullState(RenderStateShard.NO_CULL)
|
||||
// 2. 核心修改:开启光照图(Lightmap),让它正式吃环境光
|
||||
.setLightmapState(RenderStateShard.LIGHTMAP)
|
||||
.setOverlayState(RenderStateShard.OVERLAY)
|
||||
.setDepthTestState(RenderStateShard.LEQUAL_DEPTH_TEST)
|
||||
// 3. 依然保留深度写入,防止被水面、云层裁剪掉
|
||||
.setWriteMaskState(RenderStateShard.COLOR_DEPTH_WRITE)
|
||||
.createCompositeState(true)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.lzxnone.terraria.entity.beam;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.utils.MathUtil;
|
||||
import com.lzxnone.terraria.utils.RenderUtil;
|
||||
@@ -71,7 +72,7 @@ public interface ISwordBeamBehavior {
|
||||
float halfWidth = SwordBeam.HALF_WIDTH * SwordBeam.SCALE;
|
||||
float halfHeight = SwordBeam.HALF_HEIGHT * SwordBeam.SCALE;
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//左边
|
||||
poseStack.pushPose();
|
||||
@@ -97,7 +98,7 @@ public interface ISwordBeamBehavior {
|
||||
color1.x(), color1.y(), color1.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES3));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES3));
|
||||
|
||||
//三线
|
||||
poseStack.pushPose();
|
||||
@@ -124,7 +125,7 @@ public interface ISwordBeamBehavior {
|
||||
color3.x(), color3.y(), color3.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES4));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES4));
|
||||
|
||||
//边缘高光
|
||||
poseStack.pushPose();
|
||||
@@ -137,7 +138,7 @@ public interface ISwordBeamBehavior {
|
||||
}
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES5));
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES5));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
|
||||
@@ -15,7 +15,8 @@ public class SwordBeamRenderer extends EntityRenderer<Entity> {
|
||||
@Override
|
||||
public void render(Entity entity, float entityYaw, float partialTick,
|
||||
PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if(!(entity instanceof SwordBeam)) return;
|
||||
if(!(entity instanceof SwordBeam beam)) return;
|
||||
SwordBeamBehaviors.getBehavior(beam.getEntityData().get(SwordBeam.BEHAVIOR)).render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ public class StaticProjectileRenderer extends EntityRenderer<Entity> {
|
||||
PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if(!(entity instanceof StaticProjectile proj)) return;
|
||||
if(!proj.isInit) return;
|
||||
/*
|
||||
if(proj.getEntityData().get(StaticProjectile.RENDER_MODE).equals("item") && proj.getEntityData().get(StaticProjectile.ITEM) != ItemStack.EMPTY) {
|
||||
StaticProjectileBehaviors.getBehavior(proj.getEntityData().get(StaticProjectile.BEHAVIOR)).renderItem(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(proj.getEntityData().get(StaticProjectile.RENDER_MODE).equals("block") && proj.getEntityData().get(StaticProjectile.BLOCK) != Blocks.AIR.defaultBlockState()) {
|
||||
@@ -29,6 +30,14 @@ public class StaticProjectileRenderer extends EntityRenderer<Entity> {
|
||||
}else if(!proj.getEntityData().get(StaticProjectile.GLOW)) {
|
||||
StaticProjectileBehaviors.getBehavior(proj.getEntityData().get(StaticProjectile.BEHAVIOR)).render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
*/
|
||||
if(proj.getEntityData().get(StaticProjectile.RENDER_MODE).equals("item") && proj.getEntityData().get(StaticProjectile.ITEM) != ItemStack.EMPTY) {
|
||||
StaticProjectileBehaviors.getBehavior(proj.getEntityData().get(StaticProjectile.BEHAVIOR)).renderItem(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(proj.getEntityData().get(StaticProjectile.RENDER_MODE).equals("block") && proj.getEntityData().get(StaticProjectile.BLOCK) != Blocks.AIR.defaultBlockState()) {
|
||||
StaticProjectileBehaviors.getBehavior(proj.getEntityData().get(StaticProjectile.BEHAVIOR)).renderBlock(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(proj.getEntityData().get(StaticProjectile.RENDER_MODE).equals("custom")) {
|
||||
StaticProjectileBehaviors.getBehavior(proj.getEntityData().get(StaticProjectile.BEHAVIOR)).render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,13 +43,22 @@ public class StaticSummonRenderer extends EntityRenderer<Entity> {
|
||||
public void render(Entity entity, float entityYaw, float partialTick,
|
||||
PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if(!(entity instanceof StaticSummon summon)) return;
|
||||
if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("item") && summon.getEntityData().get(StaticSummon.ITEM) != ItemStack.EMPTY) {
|
||||
/*if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("item") && summon.getEntityData().get(StaticSummon.ITEM) != ItemStack.EMPTY) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).renderItem(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("block") && summon.getEntityData().get(StaticSummon.BLOCK) != Blocks.AIR.defaultBlockState()) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).renderBlock(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(!summon.getEntityData().get(StaticSummon.GLOW)) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
|
||||
*/
|
||||
if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("item") && summon.getEntityData().get(StaticSummon.ITEM) != ItemStack.EMPTY) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).renderItem(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("block") && summon.getEntityData().get(StaticSummon.BLOCK) != Blocks.AIR.defaultBlockState()) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).renderBlock(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}else if(summon.getEntityData().get(StaticSummon.RENDER_MODE).equals("custom")) {
|
||||
StaticSummonBehaviors.getBehavior(summon.getEntityData().get(StaticSummon.BEHAVIOR)).render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
|
||||
@@ -79,7 +80,7 @@ public class BladeOfGrass extends SwordItem {
|
||||
|
||||
Vec3 currentPos = projectile.getPosition(partialTick);
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucent(RES));
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucent(RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
int quadCount = projectile.trailPositions.size() / 2 - 1;
|
||||
@@ -110,16 +111,16 @@ public class BladeOfGrass extends SwordItem {
|
||||
|
||||
vertexConsumer.addVertex(matrix, (float)x1, (float)y1, (float)z1)
|
||||
.setColor(TRAIL_COLOR.x, TRAIL_COLOR.y, TRAIL_COLOR.z, TRAIL_ALPHA).setUv(radio1, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0, 1, 0);
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(matrix, (float)x2, (float)y2, (float)z2)
|
||||
.setColor(TRAIL_COLOR.x, TRAIL_COLOR.y, TRAIL_COLOR.z, TRAIL_ALPHA).setUv(radio1, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0, 1, 0);
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(matrix, (float)x3, (float)y3, (float)z3)
|
||||
.setColor(TRAIL_COLOR.x, TRAIL_COLOR.y, TRAIL_COLOR.z, TRAIL_ALPHA).setUv(radio2, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0, 1, 0);
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(matrix, (float)x4, (float)y4, (float)z4)
|
||||
.setColor(TRAIL_COLOR.x, TRAIL_COLOR.y, TRAIL_COLOR.z, TRAIL_ALPHA).setUv(radio2, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0, 1, 0);
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.TintedVertexConsumer;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.summon.*;
|
||||
@@ -159,7 +160,7 @@ public class FirstFractal extends SwordItem {
|
||||
poseStack.pushPose();
|
||||
float starHalfWidth = 45 * 0.06f;
|
||||
float starHalfHeight = 17 * 0.06f;
|
||||
VertexConsumer starConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES2));
|
||||
VertexConsumer starConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES2));
|
||||
|
||||
poseStack.translate(
|
||||
dirs[0].x * 0 + dirs[1].x * 1.3,
|
||||
@@ -194,7 +195,7 @@ public class FirstFractal extends SwordItem {
|
||||
float sparkleHalfWidth = 32 * 0.12f;
|
||||
float sparkleHalfHeight = 32 * 0.03f;
|
||||
|
||||
VertexConsumer sparkleConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES));
|
||||
VertexConsumer sparkleConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES));
|
||||
|
||||
poseStack.translate(
|
||||
dirs[0].x * 2 + dirs[1].x * 1.3,
|
||||
@@ -267,7 +268,7 @@ public class FirstFractal extends SwordItem {
|
||||
poseStack.scale(-1.0F, -1.0F, 1.0F);
|
||||
poseStack.translate(0.0F, -1.501F, 0.0F);
|
||||
|
||||
VertexConsumer modelConsumer = bufferSource.getBuffer(RenderType.entityTranslucent(playerSkin.texture()));
|
||||
VertexConsumer modelConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucent(playerSkin.texture()));
|
||||
|
||||
int packedColor = FastColor.ARGB32.color(Math.min((int)(alpha * 255), 255), 255, 255, 255);
|
||||
activeModel.renderToBuffer(poseStack, modelConsumer, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, packedColor);
|
||||
|
||||
@@ -200,7 +200,7 @@ public class InfluxWaver extends SwordItem {
|
||||
summon.getEntityData().set(StaticSummon.RXP, -90);
|
||||
summon.getEntityData().set(StaticSummon.RZP, -135);
|
||||
summon.getEntityData().set(StaticSummon.GLOW, true);
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 300);
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 150);
|
||||
summon.setNoGravity(true);
|
||||
summon.noPhysics = true;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lzxnone.terraria.item.weapon.melee;
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
@@ -99,7 +100,7 @@ public class LightsBane extends SwordItem {
|
||||
poseStack.pushPose();
|
||||
poseStack.mulPose(Minecraft.getInstance().getEntityRenderDispatcher().cameraOrientation());
|
||||
|
||||
VertexConsumer consumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES[frame]));
|
||||
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES[frame]));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
|
||||
@@ -86,7 +87,8 @@ public class Meowmere extends SwordItem {
|
||||
|
||||
Vec3 currentPos = summon.getPosition(partialTick);
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES));
|
||||
//VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES));
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
int quadCount = summon.trailPositions.size() / 2 - 1;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lzxnone.terraria.item.weapon.melee;
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
|
||||
@@ -158,7 +159,7 @@ public class Muramasa extends SwordItem {
|
||||
if(!(entity instanceof StaticProjectile projectile)) return;
|
||||
Vec3 currentPos = projectile.getPosition(partialTick);
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES));
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
int quadCount = projectile.trailPositions.size() / 2 - 1;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.beam.ISwordBeamBehavior;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeamBehaviors;
|
||||
@@ -120,7 +121,7 @@ public class NightsEdge extends SwordItem {
|
||||
float halfWidth = SwordBeam.HALF_WIDTH * SwordBeam.SCALE;
|
||||
float halfHeight = SwordBeam.HALF_HEIGHT * SwordBeam.SCALE;
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//左边
|
||||
poseStack.pushPose();
|
||||
@@ -146,7 +147,7 @@ public class NightsEdge extends SwordItem {
|
||||
color1.x(), color1.y(), color1.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES3));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES3));
|
||||
|
||||
//外线
|
||||
poseStack.pushPose();
|
||||
@@ -157,7 +158,7 @@ public class NightsEdge extends SwordItem {
|
||||
color3.x(), color3.y(), color3.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES5));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES5));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
@@ -273,7 +274,7 @@ public class NightsEdge extends SwordItem {
|
||||
);
|
||||
poseStack.mulPose(rotation);
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//外层(亮)
|
||||
poseStack.pushPose();
|
||||
@@ -285,7 +286,7 @@ public class NightsEdge extends SwordItem {
|
||||
COLOR0.x(), COLOR0.y(), COLOR0.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES1));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES1));
|
||||
|
||||
//外线
|
||||
poseStack.pushPose();
|
||||
@@ -297,7 +298,7 @@ public class NightsEdge extends SwordItem {
|
||||
1.0f, 1.0f, 1.0f, alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES2));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES2));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.beam.ISwordBeamBehavior;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeamBehaviors;
|
||||
@@ -187,7 +188,7 @@ public class TerraBlade extends SwordItem {
|
||||
float size = 1.0f - 0.25f * progress;
|
||||
poseStack.scale(size, size, size);
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//左边
|
||||
poseStack.pushPose();
|
||||
@@ -214,7 +215,7 @@ public class TerraBlade extends SwordItem {
|
||||
COLOR2.x(), COLOR2.y(), COLOR2.z(), alpha, halfWidth, halfHeight, 0f, 0, 0.01f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES1));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES1));
|
||||
|
||||
//三线
|
||||
poseStack.pushPose();
|
||||
@@ -241,7 +242,7 @@ public class TerraBlade extends SwordItem {
|
||||
1.0f, 1.0f, 1.0f, alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES2));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES2));
|
||||
|
||||
//边缘高光
|
||||
poseStack.pushPose();
|
||||
@@ -264,7 +265,7 @@ public class TerraBlade extends SwordItem {
|
||||
sparkleAlpha = (progress - FADE_IN) / (FADE_OUT - FADE_IN);
|
||||
}
|
||||
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES3));
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES3));
|
||||
|
||||
//闪烁(外层)
|
||||
poseStack.pushPose();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
|
||||
@@ -101,7 +102,7 @@ public class Terragrim extends SwordItem {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
if(!customData.contains("idx")) return;
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES[Math.min(customData.getInt("idx"), RES.length - 1)]));
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES[Math.min(customData.getInt("idx"), RES.length - 1)]));
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(owner);
|
||||
int rotate = summon.getEntityData().get(StaticSummon.RZP);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lzxnone.terraria.item.weapon.melee;
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.beam.ISwordBeamBehavior;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeamBehaviors;
|
||||
@@ -114,7 +115,7 @@ public class TrueExcalibur extends SwordItem {
|
||||
float halfWidth = SwordBeam.HALF_WIDTH * SwordBeam.SCALE;
|
||||
float halfHeight = SwordBeam.HALF_HEIGHT * SwordBeam.SCALE;
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//左边
|
||||
poseStack.pushPose();
|
||||
@@ -142,8 +143,8 @@ public class TrueExcalibur extends SwordItem {
|
||||
renderQuad(poseStack.last().pose(), vertexConsumer0,
|
||||
color1.x(), color1.y(), color1.z(), alpha, halfWidth, halfHeight, 0f, 0f, -0.04f);
|
||||
poseStack.popPose();
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES3));
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES3));
|
||||
|
||||
//三线
|
||||
poseStack.pushPose();
|
||||
@@ -170,7 +171,7 @@ public class TrueExcalibur extends SwordItem {
|
||||
color3.x(), color3.y(), color3.z(), alpha, halfWidth, halfHeight, 0f, 0f, -0.045f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES4));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES4));
|
||||
|
||||
//边缘高光
|
||||
poseStack.pushPose();
|
||||
@@ -183,7 +184,7 @@ public class TrueExcalibur extends SwordItem {
|
||||
}
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES5));
|
||||
VertexConsumer vertexConsumer3 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES5));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.beam.ISwordBeamBehavior;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeamBehaviors;
|
||||
@@ -126,7 +127,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
float halfWidth = SwordBeam.HALF_WIDTH * SwordBeam.SCALE;
|
||||
float halfHeight = SwordBeam.HALF_HEIGHT * SwordBeam.SCALE;
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//左边
|
||||
poseStack.pushPose();
|
||||
@@ -152,7 +153,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
color1.x(), color1.y(), color1.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES3));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES3));
|
||||
|
||||
//外线
|
||||
poseStack.pushPose();
|
||||
@@ -163,7 +164,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
color3.x(), color3.y(), color3.z(), alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES5));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES5));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
@@ -276,7 +277,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
double rotateSpeed = summon.getEntityData().get(StaticSummon.RZPS);
|
||||
float rotateAngle = (float) ((summon.getEntityData().get(StaticSummon.AGE) + partialTick) * rotateSpeed);
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
|
||||
//外层(亮)
|
||||
poseStack.pushPose();
|
||||
@@ -349,7 +350,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
COLOR1.x(), COLOR1.y(), COLOR1.z(), alpha * 0.125f, halfWidth, halfHeight, 0f, 0f, -0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES1));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES1));
|
||||
|
||||
//外线
|
||||
poseStack.pushPose();
|
||||
@@ -370,7 +371,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
1.0f, 1.0f, 1.0f, alpha, halfWidth, halfHeight, 0f, 0f, 0.02f);
|
||||
poseStack.popPose();
|
||||
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES2));
|
||||
VertexConsumer vertexConsumer2 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES2));
|
||||
|
||||
//闪烁
|
||||
poseStack.pushPose();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.TintedVertexConsumer;
|
||||
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
@@ -181,7 +182,7 @@ public class Zenith extends SwordItem {
|
||||
|
||||
Vec3 currentPos = proj.getPosition(partialTick);
|
||||
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES0));
|
||||
VertexConsumer vertexConsumer0 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES0));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
Vector3f color = new Vector3f(
|
||||
@@ -254,7 +255,7 @@ public class Zenith extends SwordItem {
|
||||
}
|
||||
if(Math.abs(alpha) < 0.001) return;
|
||||
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(RenderType.entityTranslucentEmissive(RES1));
|
||||
VertexConsumer vertexConsumer1 = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES1));
|
||||
poseStack.pushPose();
|
||||
|
||||
Vector3f tempRight = right.toVector3f();
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
" B ",
|
||||
"C "
|
||||
"DB ",
|
||||
"CD "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:emerald" },
|
||||
"B": { "item": "minecraft:stick" },
|
||||
"C": { "item": "minecraft:nether_wart_block" }
|
||||
"C": { "item": "minecraft:nether_wart_block" },
|
||||
"D": { "item": "minecraft:ender_eye" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:blood_butcherer",
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
" B ",
|
||||
"C "
|
||||
"DB ",
|
||||
"CD "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond" },
|
||||
"B": { "item": "minecraft:stick" },
|
||||
"C": { "item": "minecraft:prismarine" }
|
||||
"C": { "item": "minecraft:prismarine" },
|
||||
"D": { "item": "minecraft:ender_eye" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:lights_bane",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"A": { "item": "minecraft:magma_block" },
|
||||
"B": { "item": "minecraft:magma_cream" },
|
||||
"C": { "item": "minecraft:nether_wart" },
|
||||
"D": { "item": "minecraft:stick" }
|
||||
"D": { "item": "minecraft:blaze_rod" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:volcano",
|
||||
|
||||
Reference in new issue
Block a user