-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changes Dawnstone Anvil functionality to be recipe based
- Changes Pedestals to only accept one aspectus, not a whole stack - Adds visuals to the Ignem Reactor - Makes Beam Cannon only fire on a rising edge - Makes the Ember Bore and Ember Injector sounds work properly - Adds the furnace recipes to the Heat Coil properly - Adds back FluidTextureUtil as a stub for Soot compat
- Loading branch information
1 parent
7c020e0
commit e44e40f
Showing
25 changed files
with
276 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/teamroots/embers/recipe/AnvilAddCoreRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import teamroots.embers.RegistryManager; | ||
import teamroots.embers.itemmod.ModifierBase; | ||
import teamroots.embers.util.ItemModUtil; | ||
|
||
import java.util.List; | ||
|
||
public class AnvilAddCoreRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
ModifierBase modifier = ItemModUtil.modifierRegistry.get(RegistryManager.ancient_motive_core); //TODO: instead of hardcoding this, see if the modifier can be applied as a core | ||
return (!ItemModUtil.hasHeat(input1) || !ItemModUtil.hasModifier(input1, modifier.name)) && modifier.canApplyTo(input1) && input2.getItem() == RegistryManager.ancient_motive_core; | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
ItemStack result = input1.copy(); | ||
ItemModUtil.addModifier(result, input2); | ||
return Lists.newArrayList(result); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/teamroots/embers/recipe/AnvilAddModifierRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import teamroots.embers.util.ItemModUtil; | ||
|
||
import java.util.List; | ||
|
||
public class AnvilAddModifierRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
return ItemModUtil.hasHeat(input1) && ItemModUtil.modifierRegistry.containsKey(input2.getItem()) && ItemModUtil.getLevel(input1) > ItemModUtil.getTotalModLevel(input1) && ItemModUtil.isModValid(input1,input2); | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
ItemStack result = input1.copy(); | ||
ItemModUtil.addModifier(result, input2); | ||
return Lists.newArrayList(result); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/teamroots/embers/recipe/AnvilBreakdownRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import teamroots.embers.util.Misc; | ||
|
||
import java.util.List; | ||
|
||
public class AnvilBreakdownRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
ItemStack repairItem = Misc.getRepairItem(input1); | ||
return !input1.isEmpty() && input1.getItem().getIsRepairable(input1,repairItem) && input2.isEmpty() && Misc.getResourceCount(input1) != -1; | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
int resourceAmount = Misc.getResourceCount(input1); | ||
ItemStack repairItem = Misc.getRepairItem(input1); | ||
return Lists.newArrayList(new ItemStack(repairItem.getItem(),resourceAmount, repairItem.getItemDamage())); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/teamroots/embers/recipe/AnvilRemoveModifierRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.nbt.NBTTagList; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraftforge.common.util.Constants; | ||
import teamroots.embers.util.ItemModUtil; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class AnvilRemoveModifierRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
return ItemModUtil.hasHeat(input1) && input1.getTagCompound().getCompoundTag(ItemModUtil.HEAT_TAG).getTagList("modifiers", Constants.NBT.TAG_COMPOUND).tagCount() > 0 && input2.isEmpty(); | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
NBTTagCompound tagCompound = input1.getTagCompound(); | ||
NBTTagCompound heatCompound = tagCompound.getCompoundTag(ItemModUtil.HEAT_TAG); | ||
if (heatCompound.getTagList("modifiers", Constants.NBT.TAG_COMPOUND).tagCount() > 0){ //TODO: cleanup | ||
List<ItemStack> results = new ArrayList<>(); | ||
for (int i = 0; i < heatCompound.getTagList("modifiers", Constants.NBT.TAG_COMPOUND).tagCount(); i ++){ | ||
ItemStack s = new ItemStack(heatCompound.getTagList("modifiers", Constants.NBT.TAG_COMPOUND).getCompoundTagAt(i).getCompoundTag("item")); | ||
if (ItemModUtil.modifierRegistry.get(s.getItem()) != null && ItemModUtil.modifierRegistry.get(s.getItem()).countTowardsTotalLevel){ | ||
for (int j = 0; j < heatCompound.getTagList("modifiers", Constants.NBT.TAG_COMPOUND).getCompoundTagAt(i).getInteger("level"); j ++){ | ||
results.add(new ItemStack(heatCompound.getTagList("modifiers", Constants.NBT.TAG_COMPOUND).getCompoundTagAt(i).getCompoundTag("item"))); | ||
} | ||
} | ||
} | ||
ItemStack result = input1.copy(); | ||
result.getTagCompound().getCompoundTag(ItemModUtil.HEAT_TAG).setTag("modifiers", new NBTTagList()); | ||
results.add(result.copy()); | ||
return results; | ||
} | ||
return Lists.newArrayList(result); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/teamroots/embers/recipe/AnvilRepairMateriaRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import teamroots.embers.RegistryManager; | ||
|
||
import java.util.List; | ||
|
||
public class AnvilRepairMateriaRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
return !input1.isEmpty() && input1.getItem().isRepairable() && input2.getItem() == RegistryManager.isolated_materia; | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
ItemStack result = input1.copy(); | ||
result.setItemDamage(Math.max(0, result.getItemDamage() - result.getMaxDamage())); | ||
return Lists.newArrayList(result); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/teamroots/embers/recipe/AnvilRepairRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import com.google.common.collect.Lists; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
import java.util.List; | ||
|
||
public class AnvilRepairRecipe extends DawnstoneAnvilRecipe { | ||
@Override | ||
public boolean matches(ItemStack input1, ItemStack input2) { | ||
return !input1.isEmpty() && input1.getItem().getIsRepairable(input1,input2); | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getResult(TileEntity tile, ItemStack input1, ItemStack input2) { | ||
ItemStack result = input1.copy(); | ||
result.setItemDamage(Math.max(0, result.getItemDamage() - result.getMaxDamage())); | ||
return Lists.newArrayList(result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/teamroots/embers/recipe/HeatCoilFurnaceRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package teamroots.embers.recipe; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.crafting.FurnaceRecipes; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
public class HeatCoilFurnaceRecipe extends HeatCoilRecipe { | ||
@Override | ||
public boolean matches(ItemStack stack) { | ||
return !FurnaceRecipes.instance().getSmeltingResult(stack).isEmpty(); | ||
} | ||
|
||
@Override | ||
public ItemStack getResult(TileEntity tile, ItemStack stack) { | ||
return FurnaceRecipes.instance().getSmeltingResult(stack).copy(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.