diff --git a/src/main/java/fox/spiteful/avaritia/ClientProxy.java b/src/main/java/fox/spiteful/avaritia/ClientProxy.java index f964020..d8c352a 100644 --- a/src/main/java/fox/spiteful/avaritia/ClientProxy.java +++ b/src/main/java/fox/spiteful/avaritia/ClientProxy.java @@ -38,6 +38,7 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.registerItemRenderer(LudicrousItems.infinity_armor, sparkly); MinecraftForgeClient.registerItemRenderer(LudicrousItems.infinity_pants, sparkly); MinecraftForgeClient.registerItemRenderer(LudicrousItems.infinity_shoes, sparkly); + MinecraftForgeClient.registerItemRenderer(LudicrousItems.matter_cluster, sparkly); MinecraftForgeClient.registerItemRenderer(LudicrousItems.fractured_ore, new FracturedOreRenderer()); diff --git a/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java b/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java index d5dbdff..a99fa1b 100644 --- a/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java +++ b/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java @@ -3,6 +3,7 @@ package fox.spiteful.avaritia; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import fox.spiteful.avaritia.items.ItemArmorInfinity; import fox.spiteful.avaritia.items.ItemFracturedOre; +import fox.spiteful.avaritia.items.ItemMatterCluster; import fox.spiteful.avaritia.items.LudicrousItems; import fox.spiteful.avaritia.items.tools.ItemPickaxeInfinity; import fox.spiteful.avaritia.items.tools.ItemSwordInfinity; @@ -25,6 +26,7 @@ import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -83,6 +85,7 @@ public class LudicrousEvents { if(held.getItem() == LudicrousItems.infinity_pickaxe){ if(event.block.getMaterial() == Material.rock){ List adds = new ArrayList(); + List removals = new ArrayList(); for(ItemStack drop : event.drops){ if(drop.getItem() != Item.getItemFromBlock(event.block) && !(drop.getItem() instanceof ItemBlock)){ drop.stackSize = Math.min(drop.stackSize * 4, drop.getMaxStackSize()); @@ -95,13 +98,24 @@ public class LudicrousEvents { String orename = OreDictionary.getOreName(oreids[i]); if (orename.startsWith("ore")) { // add the fractured ores - adds.add(ifo.getStackForOre(drop, Math.min(drop.stackSize * 4, drop.getMaxStackSize()))); + adds.add(ifo.getStackForOre(drop, Math.min(drop.stackSize * 5, drop.getMaxStackSize()))); + removals.add(drop); break; } } } } event.drops.addAll(adds); + event.drops.removeAll(removals); + } + + if (held.getTagCompound().getBoolean("hammer") + && ToolHelper.hammering.contains(event.harvester) + && ToolHelper.hammerdrops.containsKey(event.harvester) + && ToolHelper.hammerdrops.get(event.harvester) != null) { + + ToolHelper.hammerdrops.get(event.harvester).addAll(event.drops); + event.drops.clear(); } } } @@ -203,4 +217,21 @@ public class LudicrousEvents { event.drops.add(entityitem); } + @SubscribeEvent + public void clusterClustererererer(EntityItemPickupEvent event) { + if(event.entityPlayer != null && event.item.getEntityItem().getItem() == LudicrousItems.matter_cluster) { + ItemStack stack = event.item.getEntityItem(); + EntityPlayer player = event.entityPlayer; + + for (int i=0; i items) { + super(world, x,y,z); + ItemStack watchstack = new ItemStack(Blocks.bedrock); + + NBTTagCompound tag = new NBTTagCompound(); + NBTTagList itemlist = new NBTTagList(); + + for (ItemStack stack : items) { + NBTTagCompound itemtag = stack.writeToNBT(new NBTTagCompound()); + itemlist.appendTag(itemtag); + } + + tag.setTag(ITEMTAG, itemlist); + watchstack.setTagCompound(tag); + + this.setEntityItemStack(watchstack); + + this.lifespan = 18000; + this.delayBeforeCanPickup = 20; + this.isImmuneToFire = true; + } + + // default constructors + public EntityCollationItem(World world, double x, double y, double z, ItemStack stack) { + super(world, x, y, z, stack); + } + + public EntityCollationItem(World world, double x, double y, double z) { + super(world, x, y, z); + } + + public EntityCollationItem(World world) { + super(world); + } + // end that junk + + @Override + public void onUpdate() + { + super.onUpdate(); + ItemStack stack = this.getEntityItem(); + NBTTagList list = stack.getTagCompound().getTagList(ITEMTAG, 10); + if (list.tagCount() == 0) { + this.setDead(); + } + } + + @Override + public boolean combineItems(EntityItem other) { + return false; + } + + // and the big one! + @Override + public void onCollideWithPlayer(EntityPlayer player) + { + if (!this.worldObj.isRemote) + { + if (this.delayBeforeCanPickup > 0) + { + return; + } + + EntityItemPickupEvent event = new EntityItemPickupEvent(player, this); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + + String owner = this.func_145798_i(); + + ItemStack basestack = this.getEntityItem(); + NBTTagList list = basestack.getTagCompound().getTagList(ITEMTAG, 10); + List removed = new ArrayList(); + + for (int i=0; i makeClusters(List input) { + Map items = ToolHelper.collateMatterCluster(input); + List clusters = new ArrayList(); + List> itemlist = new ArrayList>(); + itemlist.addAll(items.entrySet()); + + int currentTotal = 0; + Map currentItems = new HashMap(); + + while(!itemlist.isEmpty()) { + Entry e = itemlist.get(0); + ItemStackWrapper wrap = e.getKey(); + int wrapcount = e.getValue(); + + int count = Math.min(capacity - currentTotal, wrapcount); + + if (!currentItems.containsKey(e.getKey())) { + currentItems.put(wrap, count); + } else { + currentItems.put(wrap, currentItems.get(wrap) + count); + } + currentTotal += count; + + e.setValue(wrapcount - count); + if (e.getValue() == 0) { + itemlist.remove(0); + } + + if (currentTotal == capacity) { + ItemStack cluster = makeCluster(currentItems); + + clusters.add(cluster); + + currentTotal = 0; + currentItems = new HashMap(); + } + } + + if (currentTotal > 0) { + ItemStack cluster = makeCluster(currentItems); + + clusters.add(cluster); + } + + return clusters; + } + + public static ItemStack makeCluster(Map input) { + ItemStack cluster = new ItemStack(LudicrousItems.matter_cluster); + int total = 0; + for (int num : input.values()) { + total += num; + } + setClusterData(cluster, input, total); + return cluster; + } + + public static Map getClusterData(ItemStack cluster) { + if (!cluster.hasTagCompound() || !cluster.getTagCompound().hasKey(MAINTAG)) { + return null; + } + NBTTagCompound tag = cluster.getTagCompound().getCompoundTag(MAINTAG); + NBTTagList list = tag.getTagList(LISTTAG, 10); + Map data = new HashMap(); + + for (int i=0; i data, int count) { + if (!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } + + NBTTagCompound clustertag = new NBTTagCompound(); + NBTTagList list = new NBTTagList(); + + for (Entry entry : data.entrySet()) { + NBTTagCompound itemtag = new NBTTagCompound(); + itemtag.setTag(ITEMTAG, entry.getKey().stack.writeToNBT(new NBTTagCompound())); + itemtag.setInteger(COUNTTAG, entry.getValue()); + list.appendTag(itemtag); + } + clustertag.setTag(LISTTAG, list); + clustertag.setInteger(MAINCOUNTTAG, count); + stack.getTagCompound().setTag(MAINTAG, clustertag); + } + + public static void mergeClusters(ItemStack donor, ItemStack recipient) { + int donorcount = getClusterSize(donor); + int recipientcount = getClusterSize(recipient); + + Lumberjack.info("merge 1"); + Lumberjack.info(donorcount +", "+ recipientcount); + if (donorcount == 0 || donorcount == capacity || recipientcount == capacity) { + return; + } + + Map donordata = getClusterData(donor); + Map recipientdata = getClusterData(recipient); + List> datalist = new ArrayList>(); + datalist.addAll(donordata.entrySet()); + + Lumberjack.info("merge 2"); + while (recipientcount < capacity && donorcount > 0) { + Entry e = datalist.get(0); + ItemStackWrapper wrap = e.getKey(); + int wrapcount = e.getValue(); + + int count = Math.min(capacity - recipientcount, wrapcount); + + if (!recipientdata.containsKey(wrap)) { + recipientdata.put(wrap, count); + } else { + recipientdata.put(wrap, recipientdata.get(wrap) + count); + } + + donorcount -= count; + recipientcount += count; + + if (wrapcount - count > 0) { + e.setValue(wrapcount - count); + } else { + donordata.remove(wrap); + datalist.remove(0); + } + } + + Lumberjack.info("merge 4"); + setClusterData(recipient, recipientdata, recipientcount); + + if (donorcount > 0) { + setClusterData(donor, donordata, donorcount); + } else { + donor.setTagCompound(null); + donor.stackSize = 0; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + List drops = ToolHelper.collateMatterClusterContents(ItemMatterCluster.getClusterData(stack)); + + for (ItemStack drop : drops) { + ToolHelper.dropItem(drop, world, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); + } + + stack.stackSize = 0; + return stack; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getMaskTexture(ItemStack stack) { + int count = getClusterSize(stack); + if (count == capacity) { + return cosmicIconFull; + } + return cosmicIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public float getMaskMultiplier(ItemStack stack) { + int count = getClusterSize(stack); + return count / (float)capacity; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + int count = getClusterSize(stack); + if (count == capacity) { + return iconFull; + } + return super.getIcon(stack, pass); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconIndex(ItemStack stack) + { + return this.getIcon(stack, 0); + } +} diff --git a/src/main/java/fox/spiteful/avaritia/items/ItemStackWrapper.java b/src/main/java/fox/spiteful/avaritia/items/ItemStackWrapper.java new file mode 100644 index 0000000..c823282 --- /dev/null +++ b/src/main/java/fox/spiteful/avaritia/items/ItemStackWrapper.java @@ -0,0 +1,50 @@ +package fox.spiteful.avaritia.items; + +import net.minecraft.item.ItemStack; + +public class ItemStackWrapper { + public final ItemStack stack; + + public ItemStackWrapper(ItemStack stack) { + this.stack = stack; + } + + @Override + public boolean equals(Object otherobj) { + if (otherobj instanceof ItemStackWrapper) { + ItemStackWrapper other = (ItemStackWrapper)otherobj; + + if (this.stack.getItem().equals(other.stack.getItem()) + && this.stack.getItemDamage() == other.stack.getItemDamage() + ) { + + if (this.stack.stackTagCompound == null && other.stack.stackTagCompound == null) { + return true; + } else { + if (this.stack.stackTagCompound == null ^ other.stack.stackTagCompound == null) { + return false; + } + else if (this.stack.stackTagCompound.equals(other.stack.stackTagCompound)) { + return true; + } + } + + } + } + return false; + } + + @Override + public int hashCode() { + int h = this.stack.getItem().hashCode(); + if (this.stack.stackTagCompound != null) { + h ^= this.stack.stackTagCompound.hashCode(); + } + return h ^ this.stack.getItemDamage(); + } + + @Override + public String toString() { + return this.stack.toString(); + } +} diff --git a/src/main/java/fox/spiteful/avaritia/items/LudicrousItems.java b/src/main/java/fox/spiteful/avaritia/items/LudicrousItems.java index c20961c..da3c36e 100644 --- a/src/main/java/fox/spiteful/avaritia/items/LudicrousItems.java +++ b/src/main/java/fox/spiteful/avaritia/items/LudicrousItems.java @@ -28,6 +28,7 @@ public class LudicrousItems { public static Item cosmic_meatballs; public static Item endest_pearl; public static Item fractured_ore; + public static Item matter_cluster; public static Item infinity_helm; public static Item infinity_armor; @@ -68,6 +69,8 @@ public class LudicrousItems { GameRegistry.registerItem(infinity_shoes, "Infinity_Shoes"); fractured_ore = new ItemFracturedOre(); GameRegistry.registerItem(fractured_ore, "Fractured_Ore"); + matter_cluster = new ItemMatterCluster(); + GameRegistry.registerItem(matter_cluster, "Matter_Cluster"); MinecraftForge.EVENT_BUS.register(new ItemArmorInfinity.abilityHandler()); } diff --git a/src/main/java/fox/spiteful/avaritia/items/tools/ItemSwordInfinity.java b/src/main/java/fox/spiteful/avaritia/items/tools/ItemSwordInfinity.java index 48d4e41..ea2e5df 100644 --- a/src/main/java/fox/spiteful/avaritia/items/tools/ItemSwordInfinity.java +++ b/src/main/java/fox/spiteful/avaritia/items/tools/ItemSwordInfinity.java @@ -103,9 +103,16 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem { } @Override + @SideOnly(Side.CLIENT) public IIcon getMaskTexture(ItemStack stack) { return cosmicMask; } + + @Override + @SideOnly(Side.CLIENT) + public float getMaskMultiplier(ItemStack stack) { + return 1.0f; + } @SideOnly(Side.CLIENT) @Override diff --git a/src/main/java/fox/spiteful/avaritia/items/tools/ToolHelper.java b/src/main/java/fox/spiteful/avaritia/items/tools/ToolHelper.java index 85118ad..467d34d 100644 --- a/src/main/java/fox/spiteful/avaritia/items/tools/ToolHelper.java +++ b/src/main/java/fox/spiteful/avaritia/items/tools/ToolHelper.java @@ -12,13 +12,29 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.Random; +import java.util.Set; +import java.util.WeakHashMap; + +import fox.spiteful.avaritia.Lumberjack; +import fox.spiteful.avaritia.entity.EntityCollationItem; +import fox.spiteful.avaritia.items.ItemMatterCluster; +import fox.spiteful.avaritia.items.ItemStackWrapper; +import fox.spiteful.avaritia.items.LudicrousItems; public class ToolHelper { @@ -27,14 +43,47 @@ public class ToolHelper { public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood }; private static Random randy = new Random(); + + public static Set hammering = new HashSet(); + public static Map> hammerdrops = new WeakHashMap>(); public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) { float blockHardness = block == null ? 1F : block.getBlockHardness(world, x, y, z); + if (!hammerdrops.containsKey(player) || hammerdrops.get(player) == null) { + hammerdrops.put(player, new ArrayList()); + } + + if (!hammering.contains(player)) { + hammering.add(player); + } + for(int x1 = xs; x1 < xe; x1++) for(int y1 = ys; y1 < ye; y1++) for(int z1 = zs; z1 < ze; z1++) removeBlockWithDrops(player, stack, world, x1 + x, y1 + y, z1 + z, block, materialsListing, silk, fortune, blockHardness, dispose); + + int meta = world.getBlockMetadata(x, y, z); + if(!world.isRemote /*&& ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool*/) + world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); + + if (hammering.contains(player)) { + hammering.remove(player); + } + + //List drops = collateDropList(hammerdrops.get(player)); + //Lumberjack.info(drops); + + if(!world.isRemote) { + List clusters = ItemMatterCluster.makeClusters(hammerdrops.get(player)); + + for (ItemStack cluster : clusters) { + EntityItem ent = new EntityItem(world, x,y,z, cluster); + world.spawnEntityInWorld(ent); + } + } + + hammerdrops.put(player, null); } public static boolean isRightMaterial(Material material, Material[] materialsListing) { @@ -80,8 +129,8 @@ public class ToolHelper { } else world.setBlockToAir(x, y, z); - if(!world.isRemote /*&& ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool*/) - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12)); + //if(!world.isRemote /*&& ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool*/) + // world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12)); } } @@ -109,7 +158,7 @@ public class ToolHelper { return world.rayTraceBlocks(vec3, vec31, wut); } - private static void dropItem(ItemStack drop, World world, int x, int y, int z){ + public static void dropItem(ItemStack drop, World world, int x, int y, int z){ float f = 0.7F; double d0 = (double)(randy.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(randy.nextFloat() * f) + (double)(1.0F - f) * 0.5D; @@ -118,4 +167,50 @@ public class ToolHelper { entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); } + + public static List collateDropList(List input) { + return collateMatterClusterContents(collateMatterCluster(input)); + } + + public static List collateMatterClusterContents(Map input) { + List collated = new ArrayList(); + + for (Entry e : input.entrySet()) { + int count = e.getValue(); + ItemStackWrapper wrap = e.getKey(); + + int size = wrap.stack.getMaxStackSize(); + int fullstacks = (int) Math.floor(count / size); + + for(int i=0; i 0) { + ItemStack stack = wrap.stack.copy(); + stack.stackSize = count; + collated.add(stack); + } + } + + return collated; + } + + public static Map collateMatterCluster(List input) { + Map counts = new HashMap(); + + for (ItemStack stack : input) { + ItemStackWrapper wrap = new ItemStackWrapper(stack); + if (!counts.containsKey(wrap)) { + counts.put(wrap, 0); + } + + counts.put(wrap, counts.get(wrap) + stack.stackSize); + } + + return counts; + } } diff --git a/src/main/java/fox/spiteful/avaritia/render/CosmicItemRenderer.java b/src/main/java/fox/spiteful/avaritia/render/CosmicItemRenderer.java index e9d9b10..af26023 100644 --- a/src/main/java/fox/spiteful/avaritia/render/CosmicItemRenderer.java +++ b/src/main/java/fox/spiteful/avaritia/render/CosmicItemRenderer.java @@ -74,9 +74,12 @@ public class CosmicItemRenderer implements IItemRenderer { GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_DEPTH_TEST); + ICosmicRenderItem icri = (ICosmicRenderItem)(item.getItem()); + + CosmicRenderShenanigans.cosmicOpacity = icri.getMaskMultiplier(item); CosmicRenderShenanigans.inventoryRender = true; CosmicRenderShenanigans.useShader(); - ICosmicRenderItem icri = (ICosmicRenderItem)(item.getItem()); + IIcon cosmicicon = icri.getMaskTexture(item); GL11.glColor4d(1, 1, 1, 1); @@ -156,8 +159,11 @@ public class CosmicItemRenderer implements IItemRenderer { } if (item.getItem() instanceof ICosmicRenderItem) { - CosmicRenderShenanigans.useShader(); + GL11.glDisable(GL11.GL_ALPHA_TEST); ICosmicRenderItem icri = (ICosmicRenderItem)(item.getItem()); + CosmicRenderShenanigans.cosmicOpacity = icri.getMaskMultiplier(item); + CosmicRenderShenanigans.useShader(); + IIcon cosmicicon = icri.getMaskTexture(item); float minu = cosmicicon.getMinU(); @@ -166,6 +172,7 @@ public class CosmicItemRenderer implements IItemRenderer { float maxv = cosmicicon.getMaxV(); ItemRenderer.renderItemIn2D(Tessellator.instance, maxu, minv, minu, maxv, cosmicicon.getIconWidth(), cosmicicon.getIconHeight(), scale); CosmicRenderShenanigans.releaseShader(); + GL11.glEnable(GL11.GL_ALPHA_TEST); } GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/fox/spiteful/avaritia/render/CosmicRenderShenanigans.java b/src/main/java/fox/spiteful/avaritia/render/CosmicRenderShenanigans.java index 62a9533..98fbec7 100644 --- a/src/main/java/fox/spiteful/avaritia/render/CosmicRenderShenanigans.java +++ b/src/main/java/fox/spiteful/avaritia/render/CosmicRenderShenanigans.java @@ -20,6 +20,7 @@ public class CosmicRenderShenanigans { public static String[] lightmapobf = new String[] {"lightmapColors", "field_78504_Q", "U"}; public static boolean inventoryRender = false; + public static float cosmicOpacity = 1.0f; static { shaderCallback = new ShaderCallback() { @@ -55,6 +56,9 @@ public class CosmicRenderShenanigans { int s = ARBShaderObjects.glGetUniformLocationARB(shader, "externalScale"); ARBShaderObjects.glUniform1fARB(s, scale); + + int o = ARBShaderObjects.glGetUniformLocationARB(shader, "opacity"); + ARBShaderObjects.glUniform1fARB(o, cosmicOpacity); } }; } diff --git a/src/main/java/fox/spiteful/avaritia/render/ICosmicRenderItem.java b/src/main/java/fox/spiteful/avaritia/render/ICosmicRenderItem.java index 23d857a..a1c9650 100644 --- a/src/main/java/fox/spiteful/avaritia/render/ICosmicRenderItem.java +++ b/src/main/java/fox/spiteful/avaritia/render/ICosmicRenderItem.java @@ -9,4 +9,7 @@ public interface ICosmicRenderItem { @SideOnly(Side.CLIENT) public IIcon getMaskTexture(ItemStack stack); + + @SideOnly(Side.CLIENT) + public float getMaskMultiplier(ItemStack stack); } diff --git a/src/main/resources/assets/avaritia/lang/en_US.lang b/src/main/resources/assets/avaritia/lang/en_US.lang index 4743a25..d58767c 100644 --- a/src/main/resources/assets/avaritia/lang/en_US.lang +++ b/src/main/resources/assets/avaritia/lang/en_US.lang @@ -32,6 +32,7 @@ item.infinity_armor_2.name=Infinity Pants item.infinity_armor_3.name=Infinity Boots item.avaritia_fracturedore.name=Unknown Fractured Ore item.avaritia_fracturedore.prefix=Fractured +item.avaritia_mattercluster.name=Matter Cluster # # Blocks tile.compressed_workbench.name=Compressed Crafting Table @@ -54,6 +55,9 @@ tooltip.infinity_catalyst.desc=One is all and all is one. tooltip.infinity_ingot.desc=The fury of the universe in the palm of your hand. tooltip.record_fragment.desc=One likes to believe in the freedom of music~ tooltip.skullfire_sword.desc=Beheads skeletons and scorches them black. +tooltip.matter_cluster.desc=Use to deconstruct. +tooltip.matter_cluster.desc2=Hold SHIFT for more info. +tooltip.matter_cluster.counter=items # # Achievements achievement.avaritia:crystal_matrix=The First Seal diff --git a/src/main/resources/assets/avaritia/shader/cosmic.frag b/src/main/resources/assets/avaritia/shader/cosmic.frag index c03f1ab..fcbef89 100644 --- a/src/main/resources/assets/avaritia/shader/cosmic.frag +++ b/src/main/resources/assets/avaritia/shader/cosmic.frag @@ -15,6 +15,7 @@ uniform float pitch; uniform float externalScale; uniform float lightmix; +uniform float opacity; uniform mat2 cosmicuvs[cosmiccount]; @@ -169,7 +170,7 @@ void main (void) col.rgb *= shade; // apply mask - col.a *= mask.r; + col.a *= mask.r * opacity; col = clamp(col,0.0,1.0); diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster.png b/src/main/resources/assets/avaritia/textures/items/mattercluster.png new file mode 100644 index 0000000..08993d7 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/items/mattercluster.png differ diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster_full.png b/src/main/resources/assets/avaritia/textures/items/mattercluster_full.png new file mode 100644 index 0000000..057a70e Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/items/mattercluster_full.png differ diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png b/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png new file mode 100644 index 0000000..c3c3847 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png differ diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png.mcmeta b/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png.mcmeta new file mode 100644 index 0000000..caa3c53 --- /dev/null +++ b/src/main/resources/assets/avaritia/textures/items/mattercluster_full_mask.png.mcmeta @@ -0,0 +1,22 @@ +{ + "animation": { + "frametime": 1, + "frames": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 2, + 3, + 4, + 3, + 2, + 2, + 1, + 1 + ] + } +} diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png b/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png new file mode 100644 index 0000000..e61a357 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png differ diff --git a/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png.mcmeta b/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png.mcmeta new file mode 100644 index 0000000..caa3c53 --- /dev/null +++ b/src/main/resources/assets/avaritia/textures/items/mattercluster_mask.png.mcmeta @@ -0,0 +1,22 @@ +{ + "animation": { + "frametime": 1, + "frames": [ + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 2, + 3, + 4, + 3, + 2, + 2, + 1, + 1 + ] + } +}