翻新炮塔,修复配方

This commit is contained in:
Atsuihsio 2024-12-15 16:31:10 +08:00
parent 29b0c7bc85
commit 05757f4e51
8 changed files with 761 additions and 298 deletions

View file

@ -0,0 +1,31 @@
package com.atsuishio.superbwarfare.client.layer;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.SpeedboatEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
import static com.atsuishio.superbwarfare.entity.SpeedboatEntity.ENERGY;
public class SpeedBoatPowerLayer extends GeoRenderLayer<SpeedboatEntity> {
private static final ResourceLocation LAYER = ModUtils.loc("textures/entity/speedboat_power.png");
public SpeedBoatPowerLayer(GeoRenderer<SpeedboatEntity> entityRenderer) {
super(entityRenderer);
}
@Override
public void render(PoseStack poseStack, SpeedboatEntity animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
if (animatable.getEntityData().get(ENERGY) <= 0) return;
RenderType glowRenderType = RenderType.eyes(LAYER);
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
}
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.renderer.entity;
import com.atsuishio.superbwarfare.client.layer.SpeedBoatLayer;
import com.atsuishio.superbwarfare.client.layer.SpeedBoatPowerLayer;
import com.atsuishio.superbwarfare.client.model.entity.SpeedboatModel;
import com.atsuishio.superbwarfare.entity.SpeedboatEntity;
import com.mojang.blaze3d.vertex.PoseStack;
@ -20,6 +21,7 @@ public class SpeedboatRenderer extends GeoEntityRenderer<SpeedboatEntity> {
public SpeedboatRenderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new SpeedboatModel());
this.addRenderLayer(new SpeedBoatLayer(this));
this.addRenderLayer(new SpeedBoatPowerLayer(this));
}
@Override

View file

@ -22,6 +22,16 @@
"0.0917": [0, 0, 0],
"0.15": [0, 0, 0]
}
},
"gun": {
"position": {
"0.0": [0, 0, 0],
"0.0083": [0, 0.05, 0.1],
"0.05": [0, -0.025, 0],
"0.075": [0, 0.05, 0.05],
"0.0917": [0, 0, 0],
"0.15": [0, 0, 0]
}
}
}
}

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -11,7 +11,7 @@
"item": "superbwarfare:empty_perk"
},
"b": {
"item": "superbwarfare:shield_cell"
"item": "superbwarfare:cell"
},
"c": {
"item": "minecraft:daylight_detector"

View file

@ -11,7 +11,7 @@
"item": "superbwarfare:empty_perk"
},
"b": {
"item": "superbwarfare:shield_cell"
"item": "superbwarfare:cell"
},
"c": {
"item": "minecraft:lightning_rod"