-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new model, new events and sort classes
- Loading branch information
Showing
30 changed files
with
1,814 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
common/src/main/java/com/iafenvoy/sow/power/ClientPowerEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.iafenvoy.sow.power; | ||
|
||
import com.iafenvoy.sow.power.type.AbstractSongPower; | ||
import dev.architectury.event.Event; | ||
import dev.architectury.event.EventFactory; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class ClientPowerEvents { | ||
public static final Event<PowerStateChange> POWER_ENABLE = EventFactory.of(callbacks -> (player, songPower) -> callbacks.forEach(x -> x.onChange(player, songPower))); | ||
//Note: Disable only invoke for persist song power | ||
public static final Event<PowerStateChange> POWER_DISABLE = EventFactory.of(callbacks -> (player, songPower) -> callbacks.forEach(x -> x.onChange(player, songPower))); | ||
|
||
@FunctionalInterface | ||
public interface PowerStateChange { | ||
void onChange(PlayerEntity player, AbstractSongPower<?> songPower); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
common/src/main/java/com/iafenvoy/sow/render/RenderConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.iafenvoy.sow.render; | ||
|
||
import com.iafenvoy.sow.SongsOfWar; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class RenderConstants { | ||
public static final Identifier WHITE_TEXTURE = Identifier.of(SongsOfWar.MOD_ID, "textures/white.png"); | ||
public static final Identifier STONE_TEXTURE = Identifier.of(Identifier.DEFAULT_NAMESPACE, "textures/block/stone.png"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ow/render/util/ArdoniMarkerGenerator.java → ...nder/generator/ArdoniMarkerGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oy/sow/render/util/GeneratorReloader.java → ...w/render/generator/GeneratorReloader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...w/render/util/MagnoriteSkinGenerator.java → ...der/generator/MagnoriteSkinGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../sow/render/power/AggroShardRenderer.java → ...nder/power/entity/AggroShardRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ow/render/power/SupporoSpikeRenderer.java → ...er/power/entity/SupporoSpikeRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
common/src/main/java/com/iafenvoy/sow/render/power/feature/MobiliBurstFeatureRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.iafenvoy.sow.render.power.feature; | ||
|
||
import com.iafenvoy.sow.SongsOfWar; | ||
import com.iafenvoy.sow.power.SongPowerData; | ||
import com.iafenvoy.sow.registry.power.MobiliumPowers; | ||
import com.iafenvoy.sow.render.power.test.MobiliBurstModel; | ||
import net.minecraft.client.render.OverlayTexture; | ||
import net.minecraft.client.render.RenderLayer; | ||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.entity.feature.FeatureRenderer; | ||
import net.minecraft.client.render.entity.feature.FeatureRendererContext; | ||
import net.minecraft.client.render.entity.model.PlayerEntityModel; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class MobiliBurstFeatureRenderer<T extends PlayerEntity, M extends PlayerEntityModel<T>> extends FeatureRenderer<T, M> { | ||
private static final Identifier TEXTURE = Identifier.of(SongsOfWar.MOD_ID, "textures/block/mobilibounce_platform.png"); | ||
private final MobiliBurstModel<T> model; | ||
private float alpha = 0; | ||
|
||
public MobiliBurstFeatureRenderer(FeatureRendererContext<T, M> context) { | ||
super(context); | ||
this.model = new MobiliBurstModel<>(MobiliBurstModel.getTexturedModelData().createModel()); | ||
} | ||
|
||
@Override | ||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { | ||
matrices.push(); | ||
if (SongPowerData.byPlayer(entity).powerEnabled(MobiliumPowers.MOBILIBURST)) | ||
this.alpha += 0.05f; | ||
else this.alpha = 0; | ||
if (this.alpha > 0) | ||
this.model.render(matrices, vertexConsumers.getBuffer(RenderLayer.getEntityTranslucentEmissive(TEXTURE)), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, Math.min(this.alpha, 1)); | ||
matrices.pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.