Added stuff
I didn't remove stuff yet.
No files matched your search
@@ -0,0 +1,60 @@
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Gradle
|
||||
/.gradle
|
||||
/gradle
|
||||
gradlew
|
||||
gradlew.bat
|
||||
|
||||
# Eclipse
|
||||
/eclipse
|
||||
/bin
|
||||
/.settings
|
||||
.classpath
|
||||
.project
|
||||
@@ -22,13 +22,10 @@ group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-
|
||||
archivesBaseName = "modid"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.4.1614-1.7.10"
|
||||
version = "1.7.10-10.13.4.1558-1.7.10"
|
||||
runDir = "eclipse"
|
||||
}
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fox.spiteful.avaritia.entity.EntityImmortalItem;
|
||||
import fox.spiteful.avaritia.items.ItemSingularity;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import fox.spiteful.avaritia.render.ICosmicRenderItem;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EternalSingularityItem extends ItemSingularity implements ICosmicRenderItem
|
||||
{
|
||||
private IIcon cosmicMask;
|
||||
|
||||
public EternalSingularityItem()
|
||||
{
|
||||
super();
|
||||
setHasSubtypes(false);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
|
||||
{
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage)
|
||||
{
|
||||
super.setDamage(stack, 0);
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack)
|
||||
{
|
||||
return LudicrousItems.cosmic;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getMaskTexture(ItemStack stack, EntityPlayer player)
|
||||
{
|
||||
return this.cosmicMask;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaskMultiplier(ItemStack stack, EntityPlayer player)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack stack)
|
||||
{
|
||||
return "item.eternalSingularity";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir)
|
||||
{
|
||||
super.registerIcons(ir);
|
||||
this.cosmicMask = ir.registerIcon("universalsingularities:eternalSingularity_cosmicMask2");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World world, Entity location, ItemStack itemstack)
|
||||
{
|
||||
return new EntityImmortalItem(world, location, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
import static singulariteam.eternalsingularity.Reference.*;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import singulariteam.eternalsingularity.proxy.CommonProxy;
|
||||
|
||||
@Mod(modid = MOD_ID, name = MOD_NAME, version = MOD_VERSION, acceptedMinecraftVersions = MC_VERSION, dependencies = "required-after:Avaritia")
|
||||
public class EternalSingularityMod
|
||||
{
|
||||
@Mod.Instance(MOD_ID)
|
||||
public static EternalSingularityMod instance;
|
||||
|
||||
@SidedProxy(serverSide = COMMON_PROXY, clientSide = CLIENT_PROXY)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(final FMLPreInitializationEvent event)
|
||||
{
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(final FMLInitializationEvent event)
|
||||
{
|
||||
proxy.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(final FMLPostInitializationEvent event)
|
||||
{
|
||||
proxy.postInit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
public final class Reference
|
||||
{
|
||||
public static final String MOD_ID = "eternalsingularity";
|
||||
public static final String MOD_NAME = "Eternal Singularity";
|
||||
public static final String MOD_VERSION = "1.7.10-2";
|
||||
public static final String MC_VERSION = "[1.7.10]";
|
||||
static final String COMMON_PROXY = "singulariteam.eternalsingularity.proxy.CommonProxy";
|
||||
static final String CLIENT_PROXY = "singulariteam.eternalsingularity.proxy.ClientProxy";
|
||||
|
||||
private Reference() {}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
/*
|
||||
* Created by WanionCane(https://github.com/WanionCane).
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public final class UniversalSingularity
|
||||
{
|
||||
public final String name;
|
||||
public final List<UniversalSingularityWrapper> singularities;
|
||||
|
||||
public UniversalSingularity(@Nonnull final String name, @Nonnull final List<UniversalSingularityWrapper> singularities)
|
||||
{
|
||||
this.name = name;
|
||||
this.singularities = singularities;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fox.spiteful.avaritia.items.ItemSingularity;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public final class UniversalSingularityItem extends ItemSingularity
|
||||
{
|
||||
public final String name;
|
||||
public final List<UniversalSingularityWrapper> universalSingularities;
|
||||
|
||||
public UniversalSingularityItem(@Nonnull final String name, @Nonnull final List<UniversalSingularityWrapper> universalSingularities)
|
||||
{
|
||||
super();
|
||||
this.name = name;
|
||||
this.universalSingularities = universalSingularities;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemstack, final int renderPass)
|
||||
{
|
||||
final int metadata = getDamage(itemstack);
|
||||
return renderPass == 0 ? universalSingularities.get(metadata).dColor : universalSingularities.get(metadata).cColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack stack)
|
||||
{
|
||||
return "item.universalSingularities." + name + "." + universalSingularities.get(getDamage(stack)).name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamage(final ItemStack itemStack)
|
||||
{
|
||||
return MathHelper.clamp_int(super.getDamage(itemStack), 0, universalSingularities.size() - 1);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list)
|
||||
{
|
||||
for (int i = 0; i < universalSingularities.size(); i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package singulariteam.eternalsingularity;
|
||||
|
||||
/*
|
||||
* Created by WanionCane(https://github.com/WanionCane).
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public final class UniversalSingularityWrapper
|
||||
{
|
||||
public final String name;
|
||||
public final String oreName;
|
||||
public final int recipeBaseValue;
|
||||
public final int cColor;
|
||||
public final int dColor;
|
||||
|
||||
public UniversalSingularityWrapper(@Nonnull final String name, @Nonnull final String oreName, final int recipeBaseValue, final int cColor, final int dColor)
|
||||
{
|
||||
this.name = name;
|
||||
this.oreName = oreName;
|
||||
this.recipeBaseValue = recipeBaseValue;
|
||||
this.cColor = cColor;
|
||||
this.dColor = dColor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package singulariteam.eternalsingularity.proxy;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import fox.spiteful.avaritia.render.FancyHaloRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import singulariteam.eternalsingularity.EternalSingularityItem;
|
||||
|
||||
public final class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
final FancyHaloRenderer fancyHaloRenderer = new FancyHaloRenderer();
|
||||
singularities.forEach(singularity -> MinecraftForgeClient.registerItemRenderer(singularity, fancyHaloRenderer));
|
||||
MinecraftForgeClient.registerItemRenderer(eternalSingularity, fancyHaloRenderer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package singulariteam.eternalsingularity.proxy;
|
||||
|
||||
import fox.spiteful.avaritia.crafting.CompressorManager;
|
||||
import fox.spiteful.avaritia.crafting.Grinder;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import singulariteam.eternalsingularity.EternalSingularityItem;
|
||||
import singulariteam.eternalsingularity.UniversalSingularity;
|
||||
import singulariteam.eternalsingularity.UniversalSingularityItem;
|
||||
import singulariteam.eternalsingularity.UniversalSingularityWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static fox.spiteful.avaritia.Config.craftingOnly;
|
||||
import static java.io.File.separatorChar;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
protected final List<UniversalSingularityItem> singularities = new ArrayList<>();
|
||||
protected final EternalSingularityItem eternalSingularity = new EternalSingularityItem();
|
||||
|
||||
private final Map<String, Set<String>> allowed = new HashMap<>();
|
||||
|
||||
//Base Values were Generated by random.org [Min: 65, Max: 95]
|
||||
public CommonProxy()
|
||||
{
|
||||
final List<UniversalSingularity> universalSingularities = Arrays.asList(
|
||||
// Vanilla Singularities
|
||||
new UniversalSingularity("vanilla", Arrays.asList(
|
||||
new UniversalSingularityWrapper("coal", "blockCoal", 90, 0x282828, 0x0C0C0C),
|
||||
new UniversalSingularityWrapper("emerald", "blockEmerald", 81, 0x60DB83, 0x2CA746),
|
||||
new UniversalSingularityWrapper("diamond", "blockDiamond", 76, 0x4AEDD1, 0x30DBBD)
|
||||
)),
|
||||
// Applied Energistics Singularities
|
||||
/*
|
||||
new UniversalSingularity("appliedEnergistics", Arrays.asList(
|
||||
new UniversalSingularityWrapper("certus", "blockCertus", 71, 0xC6D4F8, 0xB9CAE7),
|
||||
new UniversalSingularityWrapper("fluix", "blockFluix", 67, 0x903BC8, 0x572FA3)
|
||||
)),
|
||||
*/
|
||||
// Big Reactors Singularities
|
||||
new UniversalSingularity("bigReactors", Arrays.asList(
|
||||
new UniversalSingularityWrapper("blutonium", "blockBlutonium", 68, 0x4642D6, 0x1B00E6),
|
||||
new UniversalSingularityWrapper("cyanite", "blockCyanite", 86, 0x5CAFDB, 0x0087EF),
|
||||
new UniversalSingularityWrapper("graphite", "blockGraphite", 94, 0x5D5D5D, 0x444444),
|
||||
new UniversalSingularityWrapper("ludicrite", "blockLudicrite", 88, 0xF001E8, 0xF103B1),
|
||||
new UniversalSingularityWrapper("yellorium", "blockYellorium", 75, 0xD9DB5C, 0xEBFF3D)
|
||||
)),
|
||||
// Botania Singularities
|
||||
/*
|
||||
new UniversalSingularity("botania", Arrays.asList(
|
||||
new UniversalSingularityWrapper("manasteel", "blockManasteel", 71, 0x7ACDFD, 0x2CAEF8),
|
||||
new UniversalSingularityWrapper("terrasteel", "blockTerrasteel", 91, 0x62D62A, 0x31AF04)
|
||||
)),
|
||||
*/
|
||||
// Draconic Evolution Singularities
|
||||
new UniversalSingularity("draconicEvolution", Collections.singletonList(
|
||||
new UniversalSingularityWrapper("awakenedDraconium", "blockAwakenedDraconium", 83, 0xFF7200, 0xFF6600)
|
||||
)),
|
||||
// Ender IO Singularities
|
||||
new UniversalSingularity("enderIO", Arrays.asList(
|
||||
new UniversalSingularityWrapper("conductiveIron", "blockConductiveIron", 65, 0xCA9D9D, 0xC39499),
|
||||
new UniversalSingularityWrapper("electricalSteel", "blockElectricalSteel", 91, 0x949494, 0x8D8D8D),
|
||||
new UniversalSingularityWrapper("energeticAlloy", "blockEnergeticAlloy", 83, 0xFFA638, 0xFF9C21),
|
||||
new UniversalSingularityWrapper("darkSteel", "blockDarkSteel", 77, 0x3C3C3C, 0x383838),
|
||||
new UniversalSingularityWrapper("pulsatingIron", "blockPulsatingIron", 74, 0x82FA9E, 0x69EA88),
|
||||
new UniversalSingularityWrapper("redstoneAlloy", "blockRedstoneAlloy", 89, 0xF25757, 0xD63C3C),
|
||||
new UniversalSingularityWrapper("soularium", "blockSoularium", 73, 0x5C4527, 0x5A3E25),
|
||||
new UniversalSingularityWrapper("vibrantAlloy", "blockVibrantAlloy", 74, 0xA7CA52, 0x98BB40)
|
||||
)),
|
||||
// ExtraTiC Singularities
|
||||
new UniversalSingularity("extraTiC", Arrays.asList(
|
||||
new UniversalSingularityWrapper("fairy", "blockFairy", 90, 0xFF83C3, 0xFF65B4),
|
||||
new UniversalSingularityWrapper("pokefennium", "blockPokefennium", 71, 0x436B73, 0x485361),
|
||||
new UniversalSingularityWrapper("red_aurum", "blockRed_aurum", 78, 0xFF4809, 0xFF3D09)
|
||||
)),
|
||||
// Extra Utilities Singularities
|
||||
new UniversalSingularity("extraUtilities", Collections.singletonList(
|
||||
new UniversalSingularityWrapper("unstable", "blockUnstable", 67, 0xC5C5C5, 0xB1B1B1)
|
||||
)),
|
||||
// Metallurgy Singularities
|
||||
new UniversalSingularity("metallurgy", Collections.singletonList(
|
||||
new UniversalSingularityWrapper("tartarite", "blockTartarite", 89, 0xAE3400, 0x792400)
|
||||
)),
|
||||
// ProjectE Singularities
|
||||
/*
|
||||
new UniversalSingularity("projectE", Arrays.asList(
|
||||
new UniversalSingularityWrapper("darkMatter", "blockDarkMatter", 67, 0x38173C, 0x240F27),
|
||||
new UniversalSingularityWrapper("redMatter", "blockRedMatter", 95, 0x9A0707, 0x7B0606)
|
||||
)),
|
||||
*/
|
||||
// Redstone Arsenal Singularities
|
||||
new UniversalSingularity("redstoneArsenal", Arrays.asList(
|
||||
new UniversalSingularityWrapper("electrumFlux", "blockElectrumFlux", 77, 0xD0B64D, 0xA40606),
|
||||
new UniversalSingularityWrapper("crystalFlux", "blockCrystalFlux", 76, 0xFE333A, 0xE8111A)
|
||||
)),
|
||||
// Tinkers' Construct Singularities
|
||||
new UniversalSingularity("tinkersConstruct", Arrays.asList(
|
||||
new UniversalSingularityWrapper("aluminumBrass", "blockAluminumBrass", 88, 0xE2BE4E, 0xD4B148),
|
||||
new UniversalSingularityWrapper("alumite", "blockAlumite", 84, 0xE9ADDA, 0xE298D1),
|
||||
new UniversalSingularityWrapper("ardite", "blockArdite", 86, 0xD24900, 0x960000),
|
||||
new UniversalSingularityWrapper("cobalt", "blockCobalt", 67, 0x2376DD, 0x023C9B),
|
||||
new UniversalSingularityWrapper("manyullyn", "blockManyullyn", 73, 0xA97DE0, 0x926AC3)//,
|
||||
//new UniversalSingularityWrapper("pigIron", "blockPigIron", 93, 0xF0A8A4, 0xEF7E4A)
|
||||
)),
|
||||
// General (Not Mod Specific)
|
||||
new UniversalSingularity("general", Arrays.asList(
|
||||
new UniversalSingularityWrapper("aluminum", "blockAluminum", 92, 0xEDEDED, 0xC5C5C5),
|
||||
new UniversalSingularityWrapper("brass", "blockBrass", 67, 0xD89634, 0x8B5F1B),
|
||||
new UniversalSingularityWrapper("bronze", "blockBronze", 90, 0xCA904E, 0xC97A25),
|
||||
new UniversalSingularityWrapper("charcoal", "blockCharcoal", 81, 0x605543, 0x100E0B),
|
||||
new UniversalSingularityWrapper("electrum", "blockElectrum", 94, 0xFDEF5A, 0xEFE252),
|
||||
new UniversalSingularityWrapper("invar", "blockInvar", 95, 0xD0D7CE, 0xACB4B1),
|
||||
new UniversalSingularityWrapper("osmium", "blockOsmium", 69, 0xAABACE, 0x9BABC4),
|
||||
new UniversalSingularityWrapper("steel", "blockSteel", 88, 0x9F9F9F, 0x888888),
|
||||
new UniversalSingularityWrapper("zinc", "blockZinc", 76, 0xBFC55C, 0x939836),
|
||||
new UniversalSingularityWrapper("ruby", "blockRuby", 91, 0xB44848, 0x993D3D),
|
||||
new UniversalSingularityWrapper("sapphire", "blockSapphire", 86, 0x5173D1, 0x466ACE),
|
||||
new UniversalSingularityWrapper("peridot", "blockPeridot", 95, 0x58A52B, 0x4E9226)
|
||||
))
|
||||
);
|
||||
final Configuration config = new Configuration(new File("." + separatorChar + "config" + separatorChar + "UniversalSingularities.cfg"));
|
||||
universalSingularities.forEach(universalSingularity -> {
|
||||
if (config.get(universalSingularity.name, "enabled", true).getBoolean()) {
|
||||
universalSingularity.singularities.forEach(universalSingularityWrapper -> {
|
||||
if (config.get(universalSingularity.name, universalSingularityWrapper.name, true).getBoolean()) {
|
||||
if (!allowed.containsKey(universalSingularity.name))
|
||||
allowed.put(universalSingularity.name, new HashSet<>());
|
||||
allowed.get(universalSingularity.name).add(universalSingularityWrapper.name);
|
||||
}
|
||||
});
|
||||
singularities.add(new UniversalSingularityItem(universalSingularity.name, universalSingularity.singularities));
|
||||
}
|
||||
});
|
||||
if (config.hasChanged())
|
||||
config.save();
|
||||
}
|
||||
|
||||
public final void preInit()
|
||||
{
|
||||
singularities.forEach(singularity -> GameRegistry.registerItem(singularity, "universal." + singularity.name + ".singularity"));
|
||||
GameRegistry.registerItem(eternalSingularity, "eternalSingularity");
|
||||
}
|
||||
|
||||
public void init() {}
|
||||
|
||||
public final void postInit()
|
||||
{
|
||||
if (!craftingOnly)
|
||||
addToRecipeInput();
|
||||
}
|
||||
|
||||
private void addToRecipeInput()
|
||||
{
|
||||
singularities.forEach(singularity -> {
|
||||
for (int i = 0; i < singularity.universalSingularities.size(); i++) {
|
||||
final UniversalSingularityWrapper universalSingularityWrapper = singularity.universalSingularities.get(i);
|
||||
if (allowed.get(singularity.name).contains(universalSingularityWrapper.name)) {
|
||||
final List<ItemStack> oreList = OreDictionary.getOres(universalSingularityWrapper.oreName, false);
|
||||
if (oreList != null && !oreList.isEmpty()) {
|
||||
CompressorManager.addOreRecipe(new ItemStack(singularity, 1, i), universalSingularityWrapper.recipeBaseValue, universalSingularityWrapper.oreName);
|
||||
Grinder.catalyst.getInput().add(new ItemStack(singularity, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public UniversalSingularityItem getSingularityByName(@Nonnull final String name)
|
||||
{
|
||||
for (final UniversalSingularityItem singularity : singularities)
|
||||
if (singularity.name.equals(name))
|
||||
return singularity;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package singulariteam.eternalsingularity.render;
|
||||
|
||||
public abstract class ShaderCallback
|
||||
{
|
||||
public abstract void call(int paramInt);
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package singulariteam.eternalsingularity.render;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.lwjgl.opengl.ARBFragmentShader;
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.ARBVertexShader;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
|
||||
public final class ShaderHelper {
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
private static final String PREFIX = "/assets/uiesingularities/shader/";
|
||||
|
||||
public static int cosmicShader = 0;
|
||||
|
||||
public static void initShaders() {
|
||||
if(!useShaders())
|
||||
return;
|
||||
|
||||
cosmicShader = createProgram("cosmic.vert", "cosmic.frag");
|
||||
}
|
||||
|
||||
public static void useShader(int shader, ShaderCallback callback) {
|
||||
if(!useShaders())
|
||||
return;
|
||||
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
if(shader != 0) {
|
||||
int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.thePlayer != null && mc.thePlayer.worldObj != null) {
|
||||
ARBShaderObjects.glUniform1iARB(time, (int)(mc.thePlayer.worldObj.getWorldTime() % Integer.MAX_VALUE));
|
||||
}
|
||||
|
||||
if(callback != null)
|
||||
callback.call(shader);
|
||||
}
|
||||
}
|
||||
|
||||
public static void useShader(int shader) {
|
||||
useShader(shader, null);
|
||||
}
|
||||
|
||||
public static void releaseShader() {
|
||||
useShader(0);
|
||||
}
|
||||
|
||||
public static boolean useShaders() {
|
||||
return OpenGlHelper.shadersSupported;
|
||||
}
|
||||
|
||||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
|
||||
private static int createProgram(String vert, String frag) {
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
if(vert != null)
|
||||
vertId = createShader(PREFIX + vert, VERT);
|
||||
if(frag != null)
|
||||
fragId = createShader(PREFIX + frag, FRAG);
|
||||
|
||||
program = ARBShaderObjects.glCreateProgramObjectARB();
|
||||
if(program == 0)
|
||||
return 0;
|
||||
|
||||
if(vert != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, vertId);
|
||||
if(frag != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
Lumberjack.log(Level.ERROR, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
Lumberjack.log(Level.ERROR, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
private static int createShader(String filename, int shaderType){
|
||||
int shader = 0;
|
||||
try {
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
|
||||
if(shader == 0)
|
||||
return 0;
|
||||
|
||||
ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
|
||||
ARBShaderObjects.glCompileShaderARB(shader);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
throw new RuntimeException("Error creating shader \""+filename+"\": " + getLogInfo(shader));
|
||||
|
||||
return shader;
|
||||
}
|
||||
catch(Exception e) {
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLogInfo(int obj) {
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception {
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
BufferedReader reader;
|
||||
|
||||
if(in == null)
|
||||
return "";
|
||||
|
||||
try {
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
|
||||
Exception innerExc= null;
|
||||
try {
|
||||
String line;
|
||||
while((line = reader.readLine()) != null)
|
||||
source.append(line).append('\n');
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch(Exception exc) {
|
||||
if(innerExc == null)
|
||||
innerExc = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if(innerExc != null)
|
||||
throw innerExc;
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch(Exception exc) {
|
||||
if(exception == null)
|
||||
exception = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
|
||||
if(exception != null)
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return source.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
//en_US Localization File - Universal Singularities
|
||||
//Creator of Localization File: Wealthyturtle
|
||||
|
||||
//Contact Wealthyturtle/WanionCane If You Would Like to Volunteer to Create a Localization File for Another Language.
|
||||
|
||||
//Vanilla
|
||||
item.universalSingularities.vanilla.coal.name=Coal Singularity
|
||||
item.universalSingularities.vanilla.diamond.name=Diamond Singularity
|
||||
item.universalSingularities.vanilla.emerald.name=Emerald Singularity
|
||||
//Vanilla
|
||||
|
||||
//General
|
||||
item.universalSingularities.general.aluminum.name=Aluminum Singularity
|
||||
item.universalSingularities.general.brass.name=Brass Singularity
|
||||
item.universalSingularities.general.bronze.name=Bronze Singularity
|
||||
item.universalSingularities.general.charcoal.name=Charcoal Singularity
|
||||
item.universalSingularities.general.electrum.name=Electrum Singularity
|
||||
item.universalSingularities.general.invar.name=Invar Singularity
|
||||
item.universalSingularities.general.osmium.name=Osmium Singularity
|
||||
item.universalSingularities.general.steel.name=Steel Singularity
|
||||
item.universalSingularities.general.zinc.name=Zinc Singularity
|
||||
item.universalSingularities.general.ruby.name=Ruby Singularity
|
||||
item.universalSingularities.general.sapphire.name=Sapphire Singularity
|
||||
item.universalSingularities.general.peridot.name=Peridot Singularity
|
||||
//General
|
||||
|
||||
//Applied Energistics 2
|
||||
/*
|
||||
item.universalSingularities.appliedEnergistics.certus.name=Certus Quartz Singularity
|
||||
item.universalSingularities.appliedEnergistics.fluix.name=Fluix Crystal Singularity
|
||||
*/
|
||||
//Applied Energistics 2
|
||||
|
||||
//Big Reactors
|
||||
item.universalSingularities.bigReactors.blutonium.name=Blutonium Singularity
|
||||
item.universalSingularities.bigReactors.cyanite.name=Cyanite Singularity
|
||||
item.universalSingularities.bigReactors.graphite.name=Graphite Singularity
|
||||
item.universalSingularities.bigReactors.ludicrite.name=Ludicrite Singularity
|
||||
item.universalSingularities.bigReactors.yellorium.name=Yellorium Singularity
|
||||
//Big Reactors
|
||||
|
||||
//Botania
|
||||
/*
|
||||
item.universalSingularities.botania.manasteel.name=Manasteel Singularity
|
||||
item.universalSingularities.botania.terrasteel.name=Terrasteel Singularity
|
||||
*/
|
||||
//Botania
|
||||
|
||||
//Draconic Evolution
|
||||
item.universalSingularities.draconicEvolution.awakenedDraconium.name=Awakened Draconium Singularity
|
||||
//Draconic Evolution
|
||||
|
||||
//Ender IO
|
||||
item.universalSingularities.enderIO.conductiveIron.name=Conductive Iron Singularity
|
||||
item.universalSingularities.enderIO.electricalSteel.name=Electrical Steel Singularity
|
||||
item.universalSingularities.enderIO.energeticAlloy.name=Energetic Alloy Singularity
|
||||
item.universalSingularities.enderIO.darkSteel.name=Dark Steel Singularity
|
||||
item.universalSingularities.enderIO.pulsatingIron.name=Pulsating Iron Singularity
|
||||
item.universalSingularities.enderIO.redstoneAlloy.name=Redstone Alloy Singularity
|
||||
item.universalSingularities.enderIO.soularium.name=Soularium Singularity
|
||||
item.universalSingularities.enderIO.vibrantAlloy.name=Vibrant Alloy Singularity
|
||||
//Ender IO
|
||||
|
||||
//ExtraTiC
|
||||
item.universalSingularities.extraTiC.fairy.name=Fairy Singularity
|
||||
item.universalSingularities.extraTiC.pokefennium.name=Pokefennium Singularity
|
||||
item.universalSingularities.extraTiC.red_aurum.name=RedAurum Singularity
|
||||
//ExtraTiC
|
||||
|
||||
//Extra Utilities
|
||||
item.universalSingularities.extraUtilities.unstable.name=Unstable Ingot Singularity
|
||||
//Extra Utilities
|
||||
|
||||
//Metallurgy 4
|
||||
item.universalSingularities.metallurgy.tartarite.name=Tartarite Singularity
|
||||
//Metallurgy 4
|
||||
|
||||
//ProjectE
|
||||
item.universalSingularities.projectE.darkMatter.name=Dark Matter Singularity
|
||||
item.universalSingularities.projectE.redMatter.name=Red Matter Singularity
|
||||
//ProjectE
|
||||
|
||||
//Redstone Arsenal
|
||||
item.universalSingularities.redstoneArsenal.electrumFlux.name=Fluxed Electrum Singularity
|
||||
item.universalSingularities.redstoneArsenal.crystalFlux.name=Flux Crystal Singularity
|
||||
//Redstone Arsenal
|
||||
|
||||
//Tinkers' Construct
|
||||
item.universalSingularities.tinkersConstruct.aluminumBrass.name=Aluminum Brass Singularity
|
||||
item.universalSingularities.tinkersConstruct.alumite.name=Alumite Singularity
|
||||
item.universalSingularities.tinkersConstruct.ardite.name=Ardite Singularity
|
||||
item.universalSingularities.tinkersConstruct.cobalt.name=Cobalt Singularity
|
||||
item.universalSingularities.tinkersConstruct.manyullyn.name=Manyullyn Singularity
|
||||
//item.universalSingularities.tinkersConstruct.pigIron.name=Pig Iron Singularity
|
||||
//Tinkers' Construct
|
||||
|
||||
//Eternal Singularity - OMG
|
||||
item.eternalSingularity.name=Eternal Singularity
|
||||
//Eternal Singularity - OMG
|
||||
@@ -0,0 +1,178 @@
|
||||
#version 130
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
const int cosmiccount = 10;
|
||||
const int cosmicoutof = 101;
|
||||
|
||||
uniform sampler2D texture0;
|
||||
uniform vec3 lightlevel;
|
||||
|
||||
uniform int time;
|
||||
|
||||
uniform float yaw;
|
||||
uniform float pitch;
|
||||
uniform float externalScale;
|
||||
|
||||
uniform float lightmix;
|
||||
uniform float opacity;
|
||||
|
||||
uniform mat2 cosmicuvs[cosmiccount];
|
||||
|
||||
varying vec3 position;
|
||||
|
||||
mat4 rotationMatrix(vec3 axis, float angle)
|
||||
{
|
||||
|
||||
axis = normalize(axis);
|
||||
float s = sin(angle);
|
||||
float c = cos(angle);
|
||||
float oc = 1.0 - c;
|
||||
|
||||
return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,
|
||||
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,
|
||||
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 light = gl_Color;
|
||||
vec4 mask = texture2D(texture0, gl_TexCoord[0].xy);
|
||||
light.rgb *= lightlevel;
|
||||
|
||||
float oneOverExternalScale = 1.0/externalScale;
|
||||
|
||||
int uvtiles = 16;
|
||||
|
||||
// background colour
|
||||
vec4 col = vec4(0.1,0.0,0.0,1.0);
|
||||
|
||||
float pulse = mod(time,400)/400.0;
|
||||
|
||||
col.g = sin(pulse*M_PI*2) * 0.075 + 0.225;
|
||||
col.b = cos(pulse*M_PI*2) * 0.05 + 0.3;
|
||||
|
||||
// get ray from camera to fragment
|
||||
vec4 dir = normalize(vec4( -position, 0));
|
||||
|
||||
// rotate the ray to show the right bit of the sphere for the angle
|
||||
float sb = sin(pitch);
|
||||
float cb = cos(pitch);
|
||||
dir = normalize(vec4(dir.x, dir.y * cb - dir.z * sb, dir.y * sb + dir.z * cb, 0));
|
||||
|
||||
float sa = sin(-yaw);
|
||||
float ca = cos(-yaw);
|
||||
dir = normalize(vec4(dir.z * sa + dir.x * ca, dir.y, dir.z * ca - dir.x * sa, 0));
|
||||
|
||||
vec4 ray;
|
||||
|
||||
// draw the layers
|
||||
for (int i=0; i<16; i++) {
|
||||
int mult = 16-i;
|
||||
|
||||
// get semi-random stuff
|
||||
int j = i + 7;
|
||||
float rand1 = (j * j * 4321 + j * 8) * 2.0F;
|
||||
int k = j + 1;
|
||||
float rand2 = (k * k * k * 239 + k * 37) * 3.6F;
|
||||
float rand3 = rand1 * 347.4 + rand2 * 63.4;
|
||||
|
||||
// random rotation matrix by random rotation around random axis
|
||||
vec3 axis = normalize(vec3(sin(rand1), sin(rand2) , cos(rand3)));
|
||||
|
||||
// apply
|
||||
ray = dir * rotationMatrix(axis, mod(rand3, 2*M_PI));
|
||||
|
||||
// calcuate the UVs from the final ray
|
||||
float rawu = 0.5 + (atan(ray.z,ray.x)/(2*M_PI));
|
||||
float rawv = 0.5 + (asin(ray.y)/M_PI);
|
||||
|
||||
// get UV scaled for layers and offset by time;
|
||||
float scale = mult*0.5 + 2.75;
|
||||
float u = rawu * scale * externalScale;
|
||||
//float v = (rawv + time * 0.00006) * scale * 0.6;
|
||||
float v = (rawv + time * 0.0002 * oneOverExternalScale) * scale * 0.6 * externalScale;
|
||||
|
||||
vec2 tex = vec2( u, v );
|
||||
|
||||
// tile position of the current uv
|
||||
int tu = int(mod(floor(u*uvtiles),uvtiles));
|
||||
int tv = int(mod(floor(v*uvtiles),uvtiles));
|
||||
|
||||
// get pseudorandom variants
|
||||
int position = ((1777541 * tu) + (7649689 * tv) + (3612703 * (i+31)) + 1723609 ) ^ 50943779;
|
||||
int symbol = int(mod(position, cosmicoutof));
|
||||
int rotation = int(mod(pow(tu,float(tv)) + tu + 3 + tv*i, 8));
|
||||
bool flip = false;
|
||||
if (rotation >= 4) {
|
||||
rotation -= 4;
|
||||
flip = true;
|
||||
}
|
||||
|
||||
// if it's an icon, then add the colour!
|
||||
if (symbol >= 0 && symbol < cosmiccount) {
|
||||
|
||||
vec2 cosmictex = vec2(1.0,1.0);
|
||||
vec4 tcol = vec4(1.0,0.0,0.0,1.0);
|
||||
|
||||
// get uv within the tile
|
||||
float ru = clamp(mod(u,1.0)*uvtiles - tu, 0.0, 1.0);
|
||||
float rv = clamp(mod(v,1.0)*uvtiles - tv, 0.0, 1.0);
|
||||
|
||||
if (flip) {
|
||||
ru = 1.0 - ru;
|
||||
}
|
||||
|
||||
float oru = ru;
|
||||
float orv = rv;
|
||||
|
||||
// rotate uvs if necessary
|
||||
if (rotation == 1) {
|
||||
oru = 1.0-rv;
|
||||
orv = ru;
|
||||
} else if (rotation == 2) {
|
||||
oru = 1.0-ru;
|
||||
orv = 1.0-rv;
|
||||
} else if (rotation == 3) {
|
||||
oru = rv;
|
||||
orv = 1.0-ru;
|
||||
}
|
||||
|
||||
// get the iicon uvs for the tile
|
||||
float umin = cosmicuvs[symbol][0][0];
|
||||
float umax = cosmicuvs[symbol][1][0];
|
||||
float vmin = cosmicuvs[symbol][0][1];
|
||||
float vmax = cosmicuvs[symbol][1][1];
|
||||
|
||||
// interpolate based on tile uvs
|
||||
cosmictex.x = umin * (1.0-oru) + umax * oru;
|
||||
cosmictex.y = vmin * (1.0-orv) + vmax * orv;
|
||||
|
||||
tcol = texture2D(texture0, cosmictex);
|
||||
|
||||
// set the alpha, blending out at the bunched ends
|
||||
float a = tcol.r * (0.5 + (1.0/mult) * 1.0) * (1.0-smoothstep(0.15, 0.48, abs(rawv-0.5)));
|
||||
|
||||
// get fancy colours
|
||||
float r = (mod(rand1, 29.0)/29.0) * 0.3 + 0.4;
|
||||
float g = (mod(rand2, 35.0)/35.0) * 0.4 + 0.6;
|
||||
float b = (mod(rand1, 17.0)/17.0) * 0.3 + 0.7;
|
||||
|
||||
// mix the colours
|
||||
//col = col*(1-a) + vec4(r,g,b,1)*a;
|
||||
col = col + vec4(r,g,b,1)*a;
|
||||
}
|
||||
}
|
||||
|
||||
// apply lighting
|
||||
vec3 shade = light.rgb * (lightmix) + vec3(1.0-lightmix,1.0-lightmix,1.0-lightmix);
|
||||
col.rgb *= shade;
|
||||
|
||||
// apply mask
|
||||
col.a *= mask.r * opacity;
|
||||
|
||||
col = clamp(col,0.0,1.0);
|
||||
|
||||
gl_FragColor = col;
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
#version 120
|
||||
|
||||
vec4 Ambient;
|
||||
vec4 Diffuse;
|
||||
vec4 Specular;
|
||||
|
||||
attribute float activelights;
|
||||
|
||||
varying vec3 position;
|
||||
|
||||
void pointLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3)
|
||||
{
|
||||
float nDotVP; // normal . light direction
|
||||
float nDotHV; // normal . light half vector
|
||||
float pf; // power factor
|
||||
float attenuation; // computed attenuation factor
|
||||
float d; // distance from surface to light source
|
||||
vec3 VP; // direction from surface to light position
|
||||
vec3 halfVector; // direction of maximum highlights
|
||||
|
||||
// Compute vector from surface to light position
|
||||
VP = vec3 (gl_LightSource[i].position) - ecPosition3;
|
||||
|
||||
// Compute distance between surface and light position
|
||||
d = length(VP);
|
||||
|
||||
// Normalize the vector from surface to light position
|
||||
VP = normalize(VP);
|
||||
|
||||
// Compute attenuation
|
||||
attenuation = 1.0 / (gl_LightSource[i].constantAttenuation +
|
||||
gl_LightSource[i].linearAttenuation * d +
|
||||
gl_LightSource[i].quadraticAttenuation * d * d);
|
||||
|
||||
halfVector = normalize(VP + eye);
|
||||
|
||||
nDotVP = max(0.0, dot(normal, VP));
|
||||
//nDotHV = max(0.0, dot(normal, halfVector));
|
||||
|
||||
//if (nDotVP == 0.0)
|
||||
//{
|
||||
pf = 0.0;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
//}
|
||||
Ambient += gl_LightSource[i].ambient * attenuation;
|
||||
Diffuse += gl_LightSource[i].diffuse * nDotVP * attenuation;
|
||||
//Specular += gl_LightSource[i].specular * pf * attenuation;
|
||||
}
|
||||
|
||||
void spotLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3)
|
||||
{
|
||||
float nDotVP; // normal . light direction
|
||||
float nDotHV; // normal . light half vector
|
||||
float pf; // power factor
|
||||
float spotDot; // cosine of angle between spotlight
|
||||
float spotAttenuation; // spotlight attenuation factor
|
||||
float attenuation; // computed attenuation factor
|
||||
float d; // distance from surface to light source
|
||||
vec3 VP; // direction from surface to light position
|
||||
vec3 halfVector; // direction of maximum highlights
|
||||
|
||||
// Compute vector from surface to light position
|
||||
VP = vec3 (gl_LightSource[i].position) - ecPosition3;
|
||||
|
||||
// Compute distance between surface and light position
|
||||
d = length(VP);
|
||||
|
||||
// Normalize the vector from surface to light position
|
||||
VP = normalize(VP);
|
||||
|
||||
// Compute attenuation
|
||||
attenuation = 1.0 / (gl_LightSource[i].constantAttenuation +
|
||||
gl_LightSource[i].linearAttenuation * d +
|
||||
gl_LightSource[i].quadraticAttenuation * d * d);
|
||||
|
||||
// See if point on surface is inside cone of illumination
|
||||
spotDot = dot(-VP, normalize(gl_LightSource[i].spotDirection));
|
||||
|
||||
if (spotDot < gl_LightSource[i].spotCosCutoff)
|
||||
{
|
||||
spotAttenuation = 0.0; // light adds no contribution
|
||||
}
|
||||
else
|
||||
{
|
||||
spotAttenuation = pow(spotDot, gl_LightSource[i].spotExponent);
|
||||
|
||||
}
|
||||
// Combine the spotlight and distance attenuation.
|
||||
attenuation *= spotAttenuation;
|
||||
|
||||
halfVector = normalize(VP + eye);
|
||||
|
||||
nDotVP = max(0.0, dot(normal, VP));
|
||||
//nDotHV = max(0.0, dot(normal, halfVector));
|
||||
|
||||
//if (nDotVP == 0.0)
|
||||
//{
|
||||
pf = 0.0;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
//
|
||||
// }
|
||||
Ambient += gl_LightSource[i].ambient * attenuation;
|
||||
Diffuse += gl_LightSource[i].diffuse * nDotVP * attenuation;
|
||||
//Specular += gl_LightSource[i].specular * pf * attenuation;
|
||||
|
||||
}
|
||||
|
||||
void directionalLight(in int i, in vec3 normal)
|
||||
{
|
||||
float nDotVP; // normal . light direction
|
||||
float nDotHV; // normal . light half vector
|
||||
float pf; // power factor
|
||||
|
||||
nDotVP = max(0.0, dot(normal, normalize(vec3 (gl_LightSource[i].position))));
|
||||
//nDotHV = max(0.0, dot(normal, vec3 (gl_LightSource[i].halfVector)));
|
||||
|
||||
//if (nDotVP == 0.0)
|
||||
//{
|
||||
pf = 0.0;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
//}
|
||||
Ambient += gl_LightSource[i].ambient;
|
||||
Diffuse += gl_LightSource[i].diffuse * nDotVP;
|
||||
//Specular += gl_LightSource[i].specular * pf;
|
||||
}
|
||||
|
||||
vec3 fnormal(void)
|
||||
{
|
||||
//Compute the normal
|
||||
vec3 normal = gl_NormalMatrix * gl_Normal;
|
||||
normal = normalize(normal);
|
||||
return normal;
|
||||
}
|
||||
|
||||
void ProcessLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3)
|
||||
{
|
||||
if (gl_LightSource[i].spotCutoff==180.0)
|
||||
{
|
||||
if (gl_LightSource[i].position.w==0.0)
|
||||
{
|
||||
directionalLight(i, normal);
|
||||
}
|
||||
else
|
||||
{
|
||||
pointLight(i, normal, eye, ecPosition3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
spotLight(i,normal,eye,ecPosition3);
|
||||
}
|
||||
}
|
||||
|
||||
void flight(in vec3 normal, in vec4 ecPosition, float alphaFade)
|
||||
{
|
||||
vec4 color;
|
||||
vec3 ecPosition3;
|
||||
vec3 eye;
|
||||
int i;
|
||||
|
||||
ecPosition3 = (vec3 (ecPosition)) / ecPosition.w;
|
||||
eye = vec3 (0.0, 0.0, 1.0);
|
||||
|
||||
// Clear the light intensity accumulators
|
||||
Ambient = vec4 (0.0);
|
||||
Diffuse = vec4 (0.0);
|
||||
Specular = vec4 (0.0);
|
||||
|
||||
if (activelights>0)
|
||||
{
|
||||
ProcessLight(0,normal,eye,ecPosition3);
|
||||
}
|
||||
if (activelights>1)
|
||||
{
|
||||
ProcessLight(1,normal,eye,ecPosition3);
|
||||
}
|
||||
//if (activelights>2)
|
||||
//{
|
||||
// ProcessLight(2,normal,eye,ecPosition3);
|
||||
//}
|
||||
//if (activelights>3)
|
||||
//{
|
||||
// ProcessLight(3,normal,eye,ecPosition3);
|
||||
//}
|
||||
|
||||
color = gl_FrontLightModelProduct.sceneColor +
|
||||
Ambient * gl_FrontMaterial.ambient +
|
||||
Diffuse * gl_FrontMaterial.diffuse;
|
||||
color += Specular * gl_FrontMaterial.specular;
|
||||
color = clamp( color, 0.0, 1.0 );
|
||||
gl_FrontColor = color;
|
||||
gl_FrontColor.a *= alphaFade;
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec3 transformedNormal;
|
||||
float alphaFade = 1.0;
|
||||
|
||||
// Eye-coordinate position of vertex, needed in various calculations
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
// Do fixed functionality vertex transform
|
||||
gl_Position = ftransform();
|
||||
transformedNormal = fnormal();
|
||||
flight(transformedNormal, ecPosition, alphaFade);
|
||||
|
||||
//Enable texture coordinates
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
//gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
//gl_TexCoord[2] = gl_MultiTexCoord2;
|
||||
//gl_TexCoord[3] = gl_MultiTexCoord3;
|
||||
|
||||
position = (gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 7
|
||||
},
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 4
|
||||
},
|
||||
1,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 9
|
||||
},
|
||||
2,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 7
|
||||
},
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 16
|
||||
},
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 13
|
||||
},
|
||||
1,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 10
|
||||
},
|
||||
3,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 5
|
||||
},
|
||||
2,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 15
|
||||
},
|
||||
4
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 34
|
||||
},
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 18
|
||||
},
|
||||
1,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 4
|
||||
},
|
||||
3,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 14
|
||||
},
|
||||
2
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.4 KiB |
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
1,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 22
|
||||
},
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
6,
|
||||
5,
|
||||
4,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 31
|
||||
},
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
1,
|
||||
{
|
||||
"index": 0,
|
||||
"time": 12
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"modid": "eternalsingularity",
|
||||
"name": "Eternal Singularity",
|
||||
"description": "A mod that adds an eternal singularity!",
|
||||
"version": "1.0.0",
|
||||
"mcversion": "1.7.10",
|
||||
"url": "https://minecraft.curseforge.com/projects/universal-singularities",
|
||||
"updateUrl": "",
|
||||
"authorList": ["Wealthyturtle, WanionCane"],
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
||||