-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7651c4
commit b57641b
Showing
36 changed files
with
216 additions
and
10 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
3 changes: 3 additions & 0 deletions
3
src/main/java/artifality/client/particle/ArtifalityParticles.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
85 changes: 85 additions & 0 deletions
85
src/main/java/artifality/client/particle/LunarChainParticle.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,85 @@ | ||
package artifality.client.particle; | ||
|
||
import net.minecraft.client.particle.*; | ||
import net.minecraft.client.render.Camera; | ||
import net.minecraft.client.render.VertexConsumer; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particle.DefaultParticleType; | ||
import net.minecraft.util.math.MathHelper; | ||
import net.minecraft.util.math.Vec3d; | ||
import org.joml.Quaternionf; | ||
import org.joml.Vector3f; | ||
|
||
public class LunarChainParticle extends SpriteBillboardParticle { | ||
private final SpriteProvider sprites; | ||
private static final Quaternionf QUATERNION = new Quaternionf(0F, -0.7F, 0.7F, 0F); | ||
|
||
public LunarChainParticle(ClientWorld world, double x, double y, double z, double color, SpriteProvider sprites) { | ||
super(world, x, y, z, 0, 0, 0); | ||
this.maxAge = 10; | ||
this.setVelocity(0D, 0D, 0D); | ||
if(color != 0) this.setColor((int) color); | ||
this.scale = 0.5F; | ||
this.sprites = sprites; | ||
this.setSpriteForAge(sprites); | ||
} | ||
|
||
public void setColor(int rgbHex) { | ||
float red = (float) ((rgbHex & 16711680) >> 16) / 255.0F; | ||
float green = (float) ((rgbHex & '\uff00') >> 8) / 255.0F; | ||
float blue = (float) ((rgbHex & 255)) / 255.0F; | ||
this.setColor(red, green, blue); | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
// if(this.age > this.maxAge / 2) { | ||
// this.setAlpha(1.0F - ((float) this.age - (float) (this.maxAge / 2)) / (float) this.maxAge); | ||
// } | ||
if(this.age++ >= this.maxAge) { | ||
this.markDead(); | ||
} | ||
else { | ||
this.setSpriteForAge(sprites); | ||
} | ||
} | ||
|
||
@Override | ||
public void buildGeometry(VertexConsumer buffer, Camera camera, float ticks) { | ||
Vec3d vec3 = camera.getPos(); | ||
float x = (float) (MathHelper.lerp(ticks, this.prevPosX, this.x) - vec3.getX()); | ||
float y = (float) (MathHelper.lerp(ticks, this.prevPosY, this.y) - vec3.getY()); | ||
float z = (float) (MathHelper.lerp(ticks, this.prevPosZ, this.z) - vec3.getZ()); | ||
|
||
Vector3f[] vector3fs = new Vector3f[]{new Vector3f(-1.0F, -1.0F, 0.0F), new Vector3f(-1.0F, 1.0F, 0.0F), new Vector3f(1.0F, 1.0F, 0.0F), new Vector3f(1.0F, -1.0F, 0.0F)}; | ||
float f4 = this.getSize(ticks); | ||
|
||
for(int i = 0; i < 4; ++i) { | ||
Vector3f vector3f = vector3fs[i]; | ||
vector3f.rotate(QUATERNION); | ||
vector3f.mul(f4); | ||
vector3f.add(x, y, z); | ||
} | ||
|
||
float f7 = this.getMinU(); | ||
float f8 = this.getMaxU(); | ||
float f5 = this.getMinV(); | ||
float f6 = this.getMaxV(); | ||
int light = this.getBrightness(ticks); | ||
buffer.vertex(vector3fs[0].x(), vector3fs[0].y(), vector3fs[0].z()).texture(f8, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); | ||
buffer.vertex(vector3fs[1].x(), vector3fs[1].y(), vector3fs[1].z()).texture(f8, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); | ||
buffer.vertex(vector3fs[2].x(), vector3fs[2].y(), vector3fs[2].z()).texture(f7, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); | ||
buffer.vertex(vector3fs[3].x(), vector3fs[3].y(), vector3fs[3].z()).texture(f7, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); | ||
} | ||
|
||
@Override | ||
public ParticleTextureSheet getType() { | ||
return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; | ||
} | ||
|
||
public record Factory(SpriteProvider sprites) implements ParticleFactory<DefaultParticleType> { | ||
public Particle createParticle(DefaultParticleType type, ClientWorld world, double x, double y, double z, double velX, double velY, double velZ) { | ||
return new LunarChainParticle(world, x, y, z, velX, sprites); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/artifality/compat/ArtifalityOwoLibIntegration.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,46 @@ | ||
package artifality.compat; | ||
|
||
import artifality.ArtifalityMod; | ||
import artifality.registry.ArtifalityBlocks; | ||
import artifality.registry.ArtifalityEnchants; | ||
import artifality.registry.ArtifalityItems; | ||
import io.wispforest.owo.itemgroup.Icon; | ||
import io.wispforest.owo.itemgroup.OwoItemGroup; | ||
import io.wispforest.owo.itemgroup.gui.ItemGroupButton; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.enchantment.EnchantmentLevelEntry; | ||
import net.minecraft.item.EnchantedBookItem; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ArtifalityOwoLibIntegration { | ||
public static final Identifier ICONS_TEXTURE = ArtifalityMod.id("textures/gui/icons.png"); | ||
|
||
public static ItemGroup createItemGroup() { | ||
return OwoItemGroup.builder(ArtifalityMod.id("items"), () -> Icon.of(ArtifalityItems.FOREST_STAFF)) | ||
.initializer(group -> { | ||
group.addButton(ItemGroupButton.link(group, Icon.of(ICONS_TEXTURE, 0, 0, 64, 64), "discord", "https://discord.gg/DcemWeskeZ")); | ||
}).build(); | ||
} | ||
|
||
public static void initItemGroup() { | ||
if(ArtifalityMod.itemGroup instanceof OwoItemGroup owoItemGroup) { | ||
owoItemGroup.initialize(); | ||
} | ||
|
||
ItemGroupEvents.modifyEntriesEvent(Registries.ITEM_GROUP.getKey(ArtifalityMod.itemGroup).get()).register(entries -> { | ||
ArtifalityItems.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); | ||
ArtifalityBlocks.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); | ||
ArtifalityEnchants.ENCHANTMENTS.forEach((id, enchantment) -> { | ||
for(int i = 1; i <= enchantment.getMaxLevel(); i++) { | ||
ItemStack book = new ItemStack(Items.ENCHANTED_BOOK); | ||
EnchantedBookItem.addEnchantment(book, new EnchantmentLevelEntry(enchantment, i)); | ||
entries.add(book); | ||
} | ||
}); | ||
}); | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/artifality/blockstates/lunalight.json
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,5 @@ | ||
{ | ||
"variants": { | ||
"": { "model": "artifality:block/lunalight" } | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/artifality/models/block/lunalight.json
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,6 @@ | ||
{ | ||
"parent": "block/cube_all", | ||
"textures": { | ||
"all": "artifality:block/lunalight" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/artifality/models/item/haunting_soul.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "artifality:item/haunting_soul" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/artifality/models/item/lunalight.json
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,3 @@ | ||
{ | ||
"parent": "artifality:block/lunalight" | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/resources/assets/artifality/particles/lunar_chain.json
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 @@ | ||
{ | ||
"textures": [ | ||
"artifality:lunar_chain_0", | ||
"artifality:lunar_chain_1", | ||
"artifality:lunar_chain_2", | ||
"artifality:lunar_chain_3", | ||
"artifality:lunar_chain_4" | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
src/main/resources/assets/artifality/textures/item/balloon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-587 Bytes
src/main/resources/assets/artifality/textures/item/floral_staff_model.png
Binary file not shown.
Binary file removed
BIN
-609 Bytes
src/main/resources/assets/artifality/textures/item/forest_staff_model.png
Binary file not shown.
Binary file removed
BIN
-600 Bytes
src/main/resources/assets/artifality/textures/item/harvest_staff_model.png
Binary file not shown.
Binary file added
BIN
+302 Bytes
src/main/resources/assets/artifality/textures/item/haunting_soul.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4 Bytes
(100%)
src/main/resources/assets/artifality/textures/item/invisibility_cape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-207 Bytes
src/main/resources/assets/artifality/textures/item/life_crystal_wand_model.png
Binary file not shown.
Binary file removed
BIN
-210 Bytes
src/main/resources/assets/artifality/textures/item/lunar_crystal_wand_model.png
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-389 Bytes
src/main/resources/assets/artifality/textures/item/ukulele_reversed.png
Binary file not shown.
Binary file removed
BIN
-209 Bytes
src/main/resources/assets/artifality/textures/item/wrath_crystal_wand_model.png
Binary file not shown.
Binary file modified
BIN
+7 Bytes
(100%)
src/main/resources/assets/artifality/textures/item/zeus_staff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-240 Bytes
src/main/resources/assets/artifality/textures/item/zeus_staff_model.png
Binary file not shown.
Binary file added
BIN
+163 Bytes
src/main/resources/assets/artifality/textures/particle/lunar_chain_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+161 Bytes
src/main/resources/assets/artifality/textures/particle/lunar_chain_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+157 Bytes
src/main/resources/assets/artifality/textures/particle/lunar_chain_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 Bytes
src/main/resources/assets/artifality/textures/particle/lunar_chain_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+130 Bytes
src/main/resources/assets/artifality/textures/particle/lunar_chain_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.