From 7edbb6720da6f2992e87b7a04ad70027ffa3bdcd Mon Sep 17 00:00:00 2001 From: IAXRetailer Date: Sun, 23 Jul 2023 20:47:18 +0800 Subject: [PATCH] =?UTF-8?q?rc3=20-=20=E4=B8=BB=E8=A6=81=E6=98=AF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=9B=E5=BB=BADanmaku=E6=94=AF=E6=8C=81=E4=B8=8E?= =?UTF-8?q?=E5=8F=91=E5=B8=83maven?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- ...DanmakuHelper.java => DanmakuBuilder.java} | 6 +-- .../kekkai/danmaku/DanmakuFormBase.java | 50 +++++++++++++++++++ .../kekkai/danmaku/DanmakuSubEntityBase.java | 14 ++++++ .../danmaku/DanmakuSubEntityTypeBase.java | 13 +++++ .../kekkai/example/MySpellCardEntity.java | 4 +- .../kekkai/spellcard/SpellCardBase.java | 7 ++- 7 files changed, 89 insertions(+), 7 deletions(-) rename src/main/java/io/github/teamgensouspark/kekkai/danmaku/{DanmakuHelper.java => DanmakuBuilder.java} (73%) create mode 100644 src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuFormBase.java create mode 100644 src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityBase.java create mode 100644 src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityTypeBase.java diff --git a/gradle.properties b/gradle.properties index 3f8cff5..62b526a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.daemon=false systemProp.file.encoding=UTF-8 # Mod Information -mod_version = 1.0 +mod_version = 1.0-rc3 maven_group = io.github.teamgensouspark.kekkai archives_base_name = kekkai diff --git a/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuHelper.java b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuBuilder.java similarity index 73% rename from src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuHelper.java rename to src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuBuilder.java index 1746527..83f08c0 100644 --- a/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuHelper.java +++ b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuBuilder.java @@ -4,12 +4,12 @@ import net.katsstuff.teamnightclipse.danmakucore.danmaku.DanmakuTemplate.Builder; import net.minecraft.entity.EntityLivingBase; -public class DanmakuHelper { - public static Builder get_builder() { +public class DanmakuBuilder { + public static Builder getBuilder() { return DanmakuTemplate.builder(); } - public static Builder get_builder_e(EntityLivingBase entity) { + public static Builder getBuilderWithEntity(EntityLivingBase entity) { return DanmakuTemplate.builder().setUser(entity).setWorld(entity.world); } diff --git a/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuFormBase.java b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuFormBase.java new file mode 100644 index 0000000..59bc386 --- /dev/null +++ b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuFormBase.java @@ -0,0 +1,50 @@ +package io.github.teamgensouspark.kekkai.danmaku; + +import net.katsstuff.teamnightclipse.danmakucore.client.helper.DanCoreRenderHelper; +import net.katsstuff.teamnightclipse.danmakucore.danmaku.DanmakuState; +import net.katsstuff.teamnightclipse.danmakucore.danmaku.form.IRenderForm; +import net.katsstuff.teamnightclipse.danmakucore.danmaku.form.RenderingProperty; +import net.katsstuff.teamnightclipse.danmakucore.impl.form.FormGeneric; +import net.katsstuff.teamnightclipse.mirror.client.shaders.MirrorShaderProgram; +import net.katsstuff.teamnightclipse.mirror.data.Quat; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import scala.collection.immutable.Map; +import scala.collection.immutable.Map$; + +public class DanmakuFormBase extends FormGeneric { + public DanmakuFormBase(String name){ + super(name); + } + + @Override + @SideOnly(Side.CLIENT) + public IRenderForm createRenderer() { + return new IRenderForm() { + + @Override + public void renderLegacy(DanmakuState danmaku, double x, double y, double z, Quat orientation, + float partialTicks, RenderManager manager) { + } + + @Override + public void renderShaders(DanmakuState danmaku, double x, double y, double z, Quat orientation, + float partialTicks, RenderManager manager, MirrorShaderProgram shaderProgram) { + } + + @Override + public Map defaultAttributeValues() { + return Map$.MODULE$.empty(); + } + + @Override + public ResourceLocation shader(DanmakuState state) { + return DanCoreRenderHelper.baseDanmakuShaderLoc(); + } + + }; + } + +} diff --git a/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityBase.java b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityBase.java new file mode 100644 index 0000000..2720dc2 --- /dev/null +++ b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityBase.java @@ -0,0 +1,14 @@ +package io.github.teamgensouspark.kekkai.danmaku; + +import net.katsstuff.teamnightclipse.danmakucore.danmaku.DanmakuState; +import net.katsstuff.teamnightclipse.danmakucore.danmaku.DanmakuUpdate; +import net.katsstuff.teamnightclipse.danmakucore.impl.subentity.SubEntityDefault; + +public class DanmakuSubEntityBase extends SubEntityDefault{ + @Override + public DanmakuUpdate subEntityTick(DanmakuState state) { + return state.update(); + } + + +} diff --git a/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityTypeBase.java b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityTypeBase.java new file mode 100644 index 0000000..c5ac90c --- /dev/null +++ b/src/main/java/io/github/teamgensouspark/kekkai/danmaku/DanmakuSubEntityTypeBase.java @@ -0,0 +1,13 @@ +package io.github.teamgensouspark.kekkai.danmaku; + +import net.katsstuff.teamnightclipse.danmakucore.danmaku.subentity.SubEntity; +import net.katsstuff.teamnightclipse.danmakucore.danmaku.subentity.SubEntityType; + +public class DanmakuSubEntityTypeBase extends SubEntityType{ + + @Override + public SubEntity instantiate() { + return new DanmakuSubEntityBase(); + } + +} diff --git a/src/main/java/io/github/teamgensouspark/kekkai/example/MySpellCardEntity.java b/src/main/java/io/github/teamgensouspark/kekkai/example/MySpellCardEntity.java index 7301452..95bdac4 100644 --- a/src/main/java/io/github/teamgensouspark/kekkai/example/MySpellCardEntity.java +++ b/src/main/java/io/github/teamgensouspark/kekkai/example/MySpellCardEntity.java @@ -1,7 +1,7 @@ package io.github.teamgensouspark.kekkai.example; -import io.github.teamgensouspark.kekkai.danmaku.DanmakuHelper; +import io.github.teamgensouspark.kekkai.danmaku.DanmakuBuilder; import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.EntitySpellcard; import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard; import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.SpellcardEntity; @@ -21,7 +21,7 @@ public MySpellCardEntity(Spellcard spellcard, EntitySpellcard cardEntity, Option public void onSpellcardUpdate() { DanmakuCreationHelper.createWideShot( Quat.orientationOf(this.user()), - DanmakuHelper.get_builder_e(this.user()) + DanmakuBuilder.getBuilderWithEntity(this.user()) .setShot(LibShotData.SHOT_CIRCLE.setSize(1.5F)) .build(), 2, diff --git a/src/main/java/io/github/teamgensouspark/kekkai/spellcard/SpellCardBase.java b/src/main/java/io/github/teamgensouspark/kekkai/spellcard/SpellCardBase.java index cbe2703..faa845e 100644 --- a/src/main/java/io/github/teamgensouspark/kekkai/spellcard/SpellCardBase.java +++ b/src/main/java/io/github/teamgensouspark/kekkai/spellcard/SpellCardBase.java @@ -10,7 +10,7 @@ import net.minecraft.entity.EntityLivingBase; import scala.Option; -public abstract class SpellCardBase extends Spellcard{ +public class SpellCardBase extends Spellcard{ int level = 1; int removeTime = 50; int endTime = 50; @@ -74,4 +74,9 @@ public Spellcard setendTime(int endTime){ public TouhouCharacter touhouUser() { return this.character; } + + public Spellcard setTouhouUser(TouhouCharacter character){ + this.character= character; + return this; + } }