Skip to content

Commit

Permalink
Merge pull request #14 from GTNewHorizons/upstream-stuff
Browse files Browse the repository at this point in the history
Upstream Stuff
  • Loading branch information
Dream-Master authored Feb 9, 2022
2 parents eadac98 + 6c46de8 commit 3eba0fb
Show file tree
Hide file tree
Showing 38 changed files with 349 additions and 97 deletions.
29 changes: 15 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//version: 1644194279
//version: 1644349045
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
*/
*/


import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
Expand Down Expand Up @@ -40,12 +40,12 @@ plugins {
id 'idea'
id 'eclipse'
id 'scala'
id 'maven-publish'
id('org.jetbrains.kotlin.jvm') version ('1.6.10') apply false
id('org.ajoberstar.grgit') version('4.1.1')
id('com.github.johnrengelman.shadow') version('4.0.4')
id('com.palantir.git-version') version('0.13.0') apply false
id('de.undercouch.download') version('5.0.1')
id('maven-publish')
}

if (project.file('.git/HEAD').isFile()) {
Expand Down Expand Up @@ -411,7 +411,7 @@ processResources
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
// replace modVersion and minecraftVersion
expand "minecraftVersion": project.minecraft.version,
"modVersion": modVersion,
"modId": modId,
Expand All @@ -422,7 +422,7 @@ processResources
from refMap
}

// copy everything else, thats not the mcmod.info
// copy everything else that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
Expand Down Expand Up @@ -539,8 +539,6 @@ tasks.withType(GenerateModuleMetadata) {
enabled = false
}


// publishing
publishing {
publications {
maven(MavenPublication) {
Expand All @@ -561,13 +559,16 @@ publishing {
// Using the identified version, not project.version as it has the prepended 1.7.10
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion

// Remove all non GTNH deps here.
// Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but
// it also removes all of the MC deps
// remove extra garbage from who knows where
pom.withXml {
def badPomGroup = ['net.minecraft', 'com.google.code.findbugs', 'org.ow2.asm', 'com.typesafe.akka', 'com.typesafe', 'org.scala-lang',
'org.scala-lang.plugins', 'net.sf.jopt-simple', 'lzma', 'com.mojang', 'org.apache.commons', 'org.apache.httpcomponents',
'commons-logging', 'java3d', 'net.sf.trove4j', 'com.ibm.icu', 'com.paulscode', 'io.netty', 'com.google.guava',
'commons-io', 'commons-codec', 'net.java.jinput', 'net.java.jutils', 'com.google.code.gson', 'org.apache.logging.log4j',
'org.lwjgl.lwjgl', 'tv.twitch', '']
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.groupId.text() != 'com.github.GTNewHorizons'
badPomGroup.contains(it.groupId.text())
}.each() {
it.parent().remove(it)
}
Expand Down Expand Up @@ -673,7 +674,7 @@ def deobf(String sourceURL) {
}
}

// The method above is to be prefered. Use this method if the filename is not at the end of the URL.
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
def deobf(String sourceURL, String fileName) {
String cacheDir = System.getProperty("user.home") + "/.gradle/caches/"
String bon2Dir = cacheDir + "forge_gradle/deobf"
Expand All @@ -685,14 +686,14 @@ def deobf(String sourceURL, String fileName) {
return files(deobfFile)
}

download {
download.run {
src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar'
dest bon2File
quiet true
overwrite false
}

download {
download.run {
src sourceURL
dest obfFile
quiet true
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:Mantle:0.3.4:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.5-GTNH:dev") {
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.6-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev") {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ developmentEnvironmentUserName = "Developer"
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile =
replaceGradleTokenInFile = Avaritia.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =

# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/fox/spiteful/avaritia/Avaritia.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
import fox.spiteful.avaritia.items.ItemFracturedOre;
import fox.spiteful.avaritia.items.LudicrousItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;

@Mod(modid = "Avaritia", name = "Avaritia", dependencies = "after:Thaumcraft;after:AWWayofTime;after:Botania")
@Mod(modid = "Avaritia", name = "Avaritia", version = "GRADLETOKEN_VERSION", dependencies = "after:Thaumcraft;after:AWWayofTime;after:Botania")
public class Avaritia {
@Instance
public static Avaritia instance;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/fox/spiteful/avaritia/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Config {
public static boolean bedrockBreaker = true;
public static boolean boringFood = false;
public static boolean fractured = false;
public static boolean fast = true;

public static boolean thaumic = true;
public static boolean sc2 = true;
Expand Down Expand Up @@ -47,6 +48,7 @@ public class Config {
public static boolean steel = true;
public static boolean nickel = true;
public static boolean enderium = true;
public static boolean ultimateBalance = true;

public static int modifier = 0;
public static int multiplier = 0;
Expand All @@ -62,6 +64,7 @@ public static void configurate(File file){
bedrockBreaker = conf.get("general", "Break Bedrock", bedrockBreaker, "Disable if you don't want the World Breaker to break unbreakable blocks").getBoolean(true);
boringFood = conf.get("general", "Boring Food", boringFood, "Enable to keep the Ultimate Stew and Cosmic Meatballs from grabbing more ingredients").getBoolean(false);
fractured = conf.get("general", "Fractured Ores", fractured, "Enable if you don't have Rotarycraft installed and want some buggy fractured ores").getBoolean(false);
fast = conf.get("general", "Gotta Go Fast", fast, "Disable if the Infinity Boots' speed boost is too ridiculous").getBoolean(true);

conf.addCustomCategoryComment("compatibility", "Disable to stop compatibility with that particular mod. Will not use the mod in recipes or add new items for that mod.");
thaumic = conf.get("compatibility", "Thaumcraft", true).getBoolean(true);
Expand Down Expand Up @@ -99,6 +102,7 @@ public static void configurate(File file){
steel = conf.get("materials", "Steel", true).getBoolean(true);
enderium = conf.get("materials", "Enderium", true).getBoolean(true);
darksteel = conf.get("compatibility", "DarkSteel", true).getBoolean(true);
ultimateBalance = conf.get("materials", "Clay", true).getBoolean(true);

modifier = conf.get("balance!", "Cost Modifier", 0, "Added to the existing modifier to make prices more expensive or cheaper. Can be negative.").getInt(0);
multiplier = conf.get("balance!", "Cost Multiplier", 0, "Added to the existing multiplier to make prices more expensive or cheaper. Can be negative.").getInt(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import fox.spiteful.avaritia.tile.TileEntityDireCrafting;
import fox.spiteful.avaritia.tile.TileEntityNeutron;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;


public class LudicrousBlocks {
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/fox/spiteful/avaritia/compat/Compat.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import fox.spiteful.avaritia.crafting.Grinder;
import fox.spiteful.avaritia.items.LudicrousItems;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
Expand Down Expand Up @@ -410,6 +411,22 @@ public static void compatify(){
try {
Item ingredient = getItem("witchery", "ingredient");
Grinder.catalyst.getInput().add(new ItemStack(ingredient, 1, 150));

Block egg = getBlock("witchery", "infinityegg");

ExtremeCraftingManager.getInstance().addExtremeShapedOreRecipe(new ItemStack(egg, 1, 0),
" NNN ",
" NNNNN ",
" NNNNN ",
" NNNINNN ",
"NNNIIINNN",
"NNIIEIINN",
"NNNIIINNN",
" NNNINNN ",
" NNNNN ",
'N', new ItemStack(LudicrousItems.resource, 1, 4),
'E', new ItemStack(Items.egg),
'I', new ItemStack(LudicrousItems.resource, 1, 6));
}
catch (Throwable e){
Lumberjack.log(Level.INFO, e, "Avaritia suffered from Curse of the Incompatibility.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package fox.spiteful.avaritia.compat.botania;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.avaritia.Config;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
import fox.spiteful.avaritia.compat.Compat;
import fox.spiteful.avaritia.compat.nei.NotEnough;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import fox.spiteful.avaritia.crafting.CompressOreRecipe;
import fox.spiteful.avaritia.crafting.CompressorManager;
import fox.spiteful.avaritia.crafting.CompressorRecipe;
import fox.spiteful.avaritia.crafting.ExtremeCraftingManager;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.OreDictionary;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
Expand Down Expand Up @@ -90,8 +88,8 @@ public Remove(ItemStack rem){
@Override
public void apply(){

for(Object obj : ExtremeCraftingManager.getInstance().getRecipeList()){
if(obj instanceof IRecipe){
for(Object obj : CompressorManager.getRecipes()){
if(obj instanceof CompressorRecipe){
CompressorRecipe craft = (CompressorRecipe)obj;
if(craft.getOutput().isItemEqual(remove)) {
recipe = craft;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/fox/spiteful/avaritia/compat/ticon/Tonkers.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Tonkers {

public static void buildstruct() {

neutronium = new ToolMaterial(neutroniumName, "material."+neutroniumName, 5, 2400, 900, 6, 2.5f, 0, 0.0f, EnumChatFormatting.DARK_GRAY.toString(), 0x303030);
neutronium = new ToolMaterial(neutroniumName, "material."+neutroniumName, 5, 4800, 900, 8, 2.5f, 0, 0.0f, EnumChatFormatting.DARK_GRAY.toString(), 0x303030);
infinityMetal = new ToolMaterial(infinityMetalName, "material."+infinityMetalName, 5, 10000, 6000, 50, 10.0f, 10, 0.0f, LudicrousItems.cosmic.rarityColor.toString(), 0xFFFFFF);

TConstructRegistry.addtoolMaterial(neutroniumId, neutronium);
Expand All @@ -37,11 +37,11 @@ public static void buildstruct() {
TConstructRegistry.addDefaultToolPartMaterial(neutroniumId);
TConstructRegistry.addDefaultToolPartMaterial(infinityMetalId);

TConstructRegistry.addBowMaterial(neutroniumId, 50, 5.0f);
TConstructRegistry.addBowMaterial(infinityMetalId, 30, 10.0f);
TConstructRegistry.addBowMaterial(neutroniumId, 109, 10.0f);
TConstructRegistry.addBowMaterial(infinityMetalId, 10, 60.0f);

TConstructRegistry.addArrowMaterial(neutroniumId, 5.0f, 0.0f);
TConstructRegistry.addArrowMaterial(infinityMetalId, 2.0f, 0.0f);
TConstructRegistry.addArrowMaterial(neutroniumId, 5.0f, 0.1f);
TConstructRegistry.addArrowMaterial(infinityMetalId, 4.0f, 0.0f);

TConstructRegistry.addDefaultShardMaterial(neutroniumId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;

Expand Down Expand Up @@ -224,10 +225,25 @@ private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolea

if (target instanceof ItemStack)
{
ItemStack targetStack = (ItemStack) target;
if (!OreDictionary.itemMatches((ItemStack)target, slot, false))
{
return false;
}
if (targetStack.hasTagCompound())
{
NBTTagCompound tagCompound = targetStack.getTagCompound();
if (!slot.hasTagCompound())
{
return false;
}
NBTTagCompound slotTagCompound = slot.getTagCompound();
// I forget, how to compare NBT...
if (!slotTagCompound.equals(tagCompound))
{
return false;
}
}
}
else if (target instanceof ArrayList)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ private boolean checkMatch(InventoryCrafting matrix, int x, int y, boolean mirro
{
return false;
}

if (itemstack.hasTagCompound() && !ItemStack.areItemStackTagsEqual(itemstack, itemstack1))
{
return false;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ public boolean matches(InventoryCrafting matrix, World world)

if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getItemDamage() == 32767 || itemstack.getItemDamage() == itemstack1.getItemDamage()))
{
flag = true;
arraylist.remove(itemstack1);
break;
if (!itemstack1.hasTagCompound() || ItemStack.areItemStackTagsEqual(itemstack1, itemstack))
{
flag = true;
arraylist.remove(itemstack1);
break;
}
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/main/java/fox/spiteful/avaritia/crafting/Grinder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fox.spiteful.avaritia.crafting;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.avaritia.Config;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
Expand All @@ -9,7 +10,6 @@
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapelessOreRecipe;
Expand Down Expand Up @@ -48,6 +48,9 @@ public static void artsAndCrafts(){
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 9, 4), "C", 'C', new ItemStack(LudicrousBlocks.resource_block, 1, 0));
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.resource_block, 1, 1), "CCC", "CCC", "CCC", 'C', new ItemStack(LudicrousItems.resource, 1, 6));
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 9, 6), "C", 'C', new ItemStack(LudicrousBlocks.resource_block, 1, 1));

GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 13, 8), "CCC", "CIC", "CCC", 'C', new ItemStack(Blocks.coal_block, 1), 'I', new ItemStack(LudicrousItems.resource, 1, 1));
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 1, 9), " I ", "ISI", " I ", 'I', new ItemStack(LudicrousItems.resource, 1, 4), 'S', new ItemStack(Items.stick));

ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousBlocks.neutron_collector, 1),
"IIQQQQQII",
Expand Down Expand Up @@ -323,5 +326,10 @@ public static void lastMinuteChanges(){
if(Config.darksteel && !OreDictionary.getOres("blockDarkSteel").isEmpty()){
catalyst.getInput().add(OreDictionary.getOres("blockDarkSteel"));
}

if(Config.ultimateBalance && (Loader.isModLoaded("Botania") || Loader.isModLoaded("Mekanism"))) {
catalyst.getInput().add(new ItemStack(LudicrousItems.singularity, 1, 11));
CompressorManager.addRecipe(new ItemStack(LudicrousItems.singularity, 1, 11), 150, new ItemStack(Items.clay_ball, 1));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public static int getTicksInGround(EntityArrow arrow) {
}

public void barrage() {
for (int i=0; i<10; i++) {
for (int i=0; i<35; i++) {
double angle = randy.nextDouble() * 2 * Math.PI;
double dist = randy.nextGaussian()*0.5;
double dist = randy.nextGaussian()*0.75;

double x = Math.sin(angle) * dist + this.posX;
double z = Math.cos(angle) * dist + this.posZ;
Expand Down
Loading

0 comments on commit 3eba0fb

Please sign in to comment.