Skip to content

Commit

Permalink
+ add cosmic sprites
Browse files Browse the repository at this point in the history
+ fix #28
+ add tracer function for infinity bow
+ update readme
+ try to fix halo item
  • Loading branch information
cnlimiter committed Sep 23, 2023
1 parent 9f114d7 commit cff71fe
Show file tree
Hide file tree
Showing 58 changed files with 1,568 additions and 93 deletions.
129 changes: 124 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width="300" src="https://s2.loli.net/2022/05/22/VcARrbQdT5tjJiM.png" alt="title">
<img class="circle" src="https://s2.loli.net/2022/05/22/VcARrbQdT5tjJiM.png" alt="title">
</p>
<hr>
<p align="center">Avaritia Reforged is a Minecraft mod made for Minecraft Forge</p>
Expand All @@ -16,14 +16,133 @@
<a href="#">简体中文</a>
</p>

This is a Minecraft 1.20.1 NeoForged mod.
This mod adds all from Avaritia.
<style type="text/css">
.circle{
width: 250px;
border-radius: 10%;
border: 5px solid rosybrown;
}
</style>

## Authors



## **📕Introduction:**
* <span style="color: #ff0000;">This mod adds all from Avaritia.</span>
* This mod is <span style="color: #ff6600;">unofficial</span> and have bugs!

## ✏️Authors

- Programmer: `cnlimiter` `Asek3` `MikhailTapio`

## License
## 🔒License

- Code: [MIT](https://www.mit.edu/~amini/LICENSE.md)
- Assets: [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)

## **📌Download official:**
* [Avaritia (1.1x)](https://www.curseforge.com/minecraft/mc-mods/avaritia-1-10)
* [Avaritia (official)](https://www.curseforge.com/minecraft/mc-mods/avaritia)
* [AvaritiaLite](https://www.curseforge.com/minecraft/mc-mods/avaritia-lite)

## **❗Attention:**
* You&nbsp;<span style="color: #00ff00;"><strong>DEFINITELY CAN</strong></span>&nbsp;add the mod to your modpack.</li>
* Recipe viewing is supported via JEI.&nbsp;
* You can add&nbsp;singularity by using json!
* You can add recipes by CraftTweaker!
* You can add recipes by KubeJs!


## **🔎Develop:**
### **CraftTweaker:**
```
mods.avaritia.CompressionCrafting.addRecipe("name",input, inputCount, timeRequierd);
mods.avaritia.CompressionCrafting.remove(output);
mods.avaritia.ExtremeTableCrafting.addShaped("name",output, ingredients);
mods.avaritia.ExtremeTableCrafting.addShapeless("name",output, ingredients);
mods.avaritia.ExtremeTableCrafting.remove(output);
```

### **KubeJs:**
```javascript
//ExtremeCraft
event.custom({
type: 'avaritia:shaped_extreme_craft',//Shaped Extreme Craft,Shapeless is avaritia:shapeless_extreme_craft
pattern: [
" II",
" III",
" III ",
" III ",
" C III ",
" CII ",
" NC ",
" N C ",
"X "
],
key: {
C: [
Ingredient.of('avaritia:crystal_matrix_ingot').toJson()
],
I: [
Ingredient.of('avaritia:infinity_ingot').toJson()
],
N: [
Ingredient.of('avaritia:neutron_ingot').toJson()
],
X: [
Ingredient.of('avaritia:infinity_catalyst').toJson()
]
},
result: [
Ingredient.of('avaritia:infinity_sword').toJson()
]
})
//Compressor
event.custom({
type: 'avaritia:compressor',//Compressor Recipe
materialCount: 1000,
timeRequired: 240,
ingredients: [
Ingredient.of('#forge:ingots/bronze').toJson()
],
result: [
Ingredient.of('avaritia:bronze_singularity').toJson()
]
})
```
### **InfinityCatalyst:**
```json5
{
"type": "avaritia:infinity_catalyst_craft",//Infinity Catalyst recipe type
"category": "misc",
"ingredients": [
{
"item": "minecraft:emerald_block"
},
{
"item": "avaritia:crystal_matrix_ingot"
},
{
"item": "avaritia:neutron_ingot"
},
{
"item": "avaritia:cosmic_meatballs"
},
{
"item": "avaritia:ultimate_stew"
},
{
"item": "avaritia:endest_pearl"
},
{
"item": "avaritia:record_fragment"
}
],
"result": {
"item": "avaritia:infinity_catalyst"//Fixed products
}
}
```



2 changes: 2 additions & 0 deletions src/main/java/committee/nova/mods/avaritia/Avaritia.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package committee.nova.mods.avaritia;

import committee.nova.mods.avaritia.client.shader.AvaritiaShaders;
import committee.nova.mods.avaritia.common.entity.EndestPearlEntity;
import committee.nova.mods.avaritia.init.config.ModConfig;
import committee.nova.mods.avaritia.init.data.ModDataGen;
Expand Down Expand Up @@ -44,6 +45,7 @@ public Avaritia() {
ModRecipeSerializers.SERIALIZERS.register(bus);
ModCreativeModeTabs.TABS.register(bus);

AvaritiaShaders.init();
ModConfig.register();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import committee.nova.mods.avaritia.Static;
import committee.nova.mods.avaritia.api.iface.IColored;
import committee.nova.mods.avaritia.client.model.GapingVoidModel;
import committee.nova.mods.avaritia.client.model.HaloItemModelLoader;
import committee.nova.mods.avaritia.client.model.WingModel;
import committee.nova.mods.avaritia.client.render.layer.EyeInfinityLayer;
import committee.nova.mods.avaritia.client.render.layer.WingInfinityLayer;
import committee.nova.mods.avaritia.init.registry.ModItems;
import committee.nova.mods.avaritia.util.ColorUtil;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.client.event.RegisterGuiOverlaysEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand Down Expand Up @@ -43,7 +46,6 @@ public static void registerOverlays(RegisterGuiOverlaysEvent event) {

}


private static int getCurrentRainbowColor() {
var hue = (System.currentTimeMillis() % 18000) / 18000F;
return ColorUtil.hsbToRGB(hue, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package committee.nova.mods.avaritia.client.model;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import it.unimi.dsi.fastutil.Pair;
import it.unimi.dsi.fastutil.ints.IntList;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.*;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.model.geometry.IGeometryBakingContext;
import net.minecraftforge.client.model.geometry.IGeometryLoader;
import net.minecraftforge.client.model.geometry.IUnbakedGeometry;

import java.util.HashSet;
import java.util.Objects;
import java.util.function.Function;

/**
* Name: Avaritia-forge / HaloItemModelLoader
* Author: cnlimiter
* CreateTime: 2023/9/18 23:45
* Description:
*/

public class HaloItemModelLoader implements IGeometryLoader<HaloItemModelLoader.HaloItemModel> {



@Override
public HaloItemModel read(JsonObject jsonObject, JsonDeserializationContext deserializationContext) throws JsonParseException {
return null;
}

public static class HaloItemModel implements IUnbakedGeometry<HaloItemModel>{
private final BlockModel baseModel;
private final IntList layerColors;
private final String texture;
private final int color;
private final int size;
private final boolean pulse;
private Material haloMaterial;

public HaloItemModel(BlockModel baseModel, IntList layerColors, String texture, int color, int size, boolean pulse) {
this.baseModel = baseModel;
this.layerColors = layerColors;
this.texture = texture;
this.color = color;
this.size = size;
this.pulse = pulse;
}

@Override
public BakedModel bake(IGeometryBakingContext context, ModelBaker baker, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState, ItemOverrides overrides, ResourceLocation modelLocation) {
if (haloMaterial == null){
HashSet<Material> materials = new HashSet<Material>();
this.haloMaterial = context.getMaterial(this.texture);
materials.add(this.haloMaterial);
// this.baseModel.resolveParents()
// materials.addAll();
}


return null;
}



}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package committee.nova.mods.avaritia.client.render.entity;

import committee.nova.mods.avaritia.Static;
import committee.nova.mods.avaritia.common.entity.HeavenArrowEntity;
import committee.nova.mods.avaritia.common.entity.arrow.HeavenArrowEntity;
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package committee.nova.mods.avaritia.client.render.entity;

import committee.nova.mods.avaritia.Static;
import committee.nova.mods.avaritia.common.entity.HeavenSubArrowEntity;
import committee.nova.mods.avaritia.common.entity.arrow.HeavenSubArrowEntity;
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package committee.nova.mods.avaritia.client.render.entity;

import committee.nova.mods.avaritia.Static;
import committee.nova.mods.avaritia.common.entity.arrow.HeavenArrowEntity;
import committee.nova.mods.avaritia.common.entity.arrow.TraceArrowEntity;
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.jetbrains.annotations.NotNull;

/**
* Description:
* Author: cnlimiter
* Date: 2022/4/20 18:54
* Version: 1.0
*/
@OnlyIn(Dist.CLIENT)
public class TracerArrowRender extends ArrowRenderer<TraceArrowEntity> {

private static final ResourceLocation tex = new ResourceLocation(Static.MOD_ID, "textures/entity/heavenarrow.png");


public TracerArrowRender(EntityRendererProvider.Context p_174008_) {
super(p_174008_);
}

@Override
public @NotNull ResourceLocation getTextureLocation(@NotNull TraceArrowEntity entity) {
return tex;
}


}
Loading

0 comments on commit cff71fe

Please sign in to comment.