Skip to content

Commit

Permalink
Merge pull request #20 from Lothrazar/develop
Browse files Browse the repository at this point in the history
1.1.0  -> 1.1.2  release and some previous
  • Loading branch information
Lothrazar authored Jan 14, 2019
2 parents 151947e + 1347e89 commit 5de0f10
Show file tree
Hide file tree
Showing 36 changed files with 339 additions and 630 deletions.
31 changes: 31 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Code of Merit ( https://github.com/rosarior/Code-of-Merit )

The project creators, lead developers, core team, constitute the managing members of the project and have final say in every decision of the project, technical or otherwise, including overruling previous decisions. There are no limitations to this decisional power.

Contributions are an expected result of your membership on the project. Don't expect others to do your work or help you with your work forever.

All members have the same opportunities to seek any challenge they want within the project.

Authority or position in the project will be proportional to the accrued contribution. Seniority must be earned.

Software is evolutive: the better implementations must supersede lesser implementations. Technical advantage is the primary evaluation metric.

This is a space for technical prowess; topics outside of the project will not be tolerated.

Non technical conflicts will be discussed in a separate space. Disruption of the project will not be allowed.

Individual characteristics, including but not limited to, body, sex, sexual preference, race, language, religion, nationality, or political preferences are irrelevant in the scope of the project and will not be taken into account concerning your value or that of your contribution to the project.

Discuss or debate the idea, not the person.

There is no room for ambiguity: Ambiguity will be met with questioning; further ambiguity will be met with silence. It is the responsibility of the originator to provide requested context.

If something is illegal outside the scope of the project, it is illegal in the scope of the project. This Code of Merit does not take precedence over governing law.

This Code of Merit governs the technical procedures of the project not the activities outside of it.

Participation on the project equates to agreement of this Code of Merit.

No objectives beyond the stated objectives of this project are relevant to the project. Any intent to deviate the project from its original purpose of existence will constitute grounds for remedial action which may include expulsion from the project.

This document is the Code of Merit (http://code-of-merit.org), version 1.0.
Empty file added .github/CONTRIBUTING.md
Empty file.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Minecraft version & Mod Version:


Single player or Server:


Describe problem (what you were doing / what happened):


Crash log (if any):


(If this is a suggestion and not a bug report, delete all this and just write your suggestion!)



4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ crash-reports/
*.launch
*.lnk
*.jks

\.idea/
classes/
*.iml
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,23 @@ minecraft {
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

dependencies {

repositories {
maven { // JEI & Tinkers
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}
maven { // CraftTweaker (aka MineTweaker3), Immersive Engineering
name 'jared maven'
url "http://blamejared.com/maven"
}
}

dependencies {
compileOnly "mezz.jei:jei_1.12.2:4.11.+"
compileOnly "CraftTweaker2:CraftTweaker2-API:4.1.9.+"
}


processResources
{
// this will ensure that this task is redone when the versions change.
Expand Down
4 changes: 4 additions & 0 deletions dist.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

cp -R build/libs/. c:/users/sam/desktop

cp -R build/libs/. C:/Users/Sam/Documents/Curse/Minecraft/Instances/irnBRU/mods
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx3G
forge_version=14.23.1.2594
mc_version=1.12.2
mod_version=1.0.3
mod_version=1.1.2
30 changes: 30 additions & 0 deletions scripts_zen_example/rituals.zs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,35 @@ import mods.rootsclassic.Ritual;
Ritual.setRitualIngredients("livingSwordCrafting", [<minecraft:dirt>,<minecraft:stone>]);
Ritual.setRitualIncense("livingSwordCrafting", [<minecraft:grass>,<minecraft:sand>]);

//unique name, recipe output, level
// r,g,b colours
// incense list, ingredient list

//level zero means no standing stones, only Altar+Brazier
Ritual.addCraftingRitual("simple", <minecraft:prismarine_shard>, 0,
51,51,255,
[<minecraft:dirt>,<minecraft:dirt>], [<minecraft:string>,<minecraft:emerald>] );

//level 1 means the
Ritual.addCraftingRitual("test1", <minecraft:netherrack>, 1,
255,255,0,
[<minecraft:grass>,<minecraft:grass>], [<minecraft:dye:4>,<minecraft:string>,<minecraft:emerald> ] );

//level 2 is the biggest ritual with the Attuned stones
Ritual.addCraftingRitual("test2", <minecraft:ghast_tear>, 2,
255,0,0,
[<minecraft:feather>,<minecraft:egg>], [<minecraft:diamond>,<minecraft:string>,<minecraft:emerald> ] );

// other examples
Ritual.setPrimaryColor("test2",255,0,0);
Ritual.setSecondaryColor("igniterStoneCrafting",255,0,100);

//change level for the standing stone requirements
Ritual.setLevel("igniterStoneCrafting",0);







7 changes: 4 additions & 3 deletions src/main/java/elucent/rootsclassic/RegistryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static void init() {
registerItem(jungleTreeBark = new ItemRootsBasic(), "jungletreebark");
registerItem(acaciaTreeBark = new ItemRootsBasic(), "acaciatreebark");
registerItem(darkOakTreeBark = new ItemRootsBasic(), "darkoaktreebark");

registerItem(livingPickaxe = new ItemLivingPickaxe(), "livingpickaxe");
registerItem(livingAxe = new ItemLivingAxe(), "livingaxe");
registerItem(livingSword = new ItemLivingSword(), "livingsword");
Expand All @@ -233,11 +232,13 @@ public static void init() {
registerItem(whiteCurrant = new ItemRootsFood(4, 0.4F, false), "whitecurrant");
registerItem(elderBerry = new ItemRootsFood(2, 0.1F, false), "elderberry");
registerItem(healingPoultice = new ItemRootsFood(0, 0F, false).setAlwaysEdible().setMaxStackSize(8), "healingpoultice");
registerItem(rootyStew = new ItemBowlFood(7, 5.0F), "rootystew");//7 means 3.5 nuggets (steak gives 4) 1 is saturation
registerItem(fruitSalad = new ItemBowlFood(8, 14.0F), "fruitsalad");
float cookedBeefSat = 0.8F;
registerItem(rootyStew = new ItemBowlFood(7, 0.2F + cookedBeefSat), "rootystew");//7 means 3.5 nuggets (steak gives 4) 1 is saturation
registerItem(fruitSalad = new ItemBowlFood(8, 0.1F + cookedBeefSat), "fruitsalad");
registerItem(runicFocus = new ItemRunicFocus(), "runicfocus");
registerItem(engravedSword = new ItemEngravedSword(), "engravedsword");
registerItem(manaResearchIcon = new ItemRootsBasic(), "manaresearchicon");
Item apple;
/**
* REGISTERING BLOCKS
*/
Expand Down
1 change: 0 additions & 1 deletion src/main/java/elucent/rootsclassic/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class Util {
public static Random random = new Random();
public static ArrayList<Item> berries = new ArrayList<Item>();


public static double randomDouble(double min, double max) {
double range = max - min;
double scale = random.nextDouble() * range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tag) {
NBTTagList list = new NBTTagList();
for (int i = 0; i < getInventory().size(); i++) {
// if (getInventory().get(i) != null) {
list.appendTag(getInventory().get(i).writeToNBT(new NBTTagCompound()));
list.appendTag(getInventory().get(i).writeToNBT(new NBTTagCompound()));
// }
}
tag.setTag("inventory", list);
Expand All @@ -79,7 +79,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tag) {
for (int i = 0; i < getIncenses().size(); i++) {
// ;
// if (getIncenses().get(i) != null) {
list.appendTag(getIncenses().get(i).writeToNBT(new NBTTagCompound()));
list.appendTag(getIncenses().get(i).writeToNBT(new NBTTagCompound()));
// }
}
tag.setTag("incenses", list);
Expand Down Expand Up @@ -136,13 +136,12 @@ else if (player.isSneaking() && heldItem.isEmpty() && this.getProgress() == 0) {
setRitualName(ritual.getName());
Roots.logger.info("found " + ritual.getName());
setIncenses(RitualManager.getIncenses(world, getPos()));

setProgress(RECIPE_PROGRESS_TIME);
for (TileEntityBrazier brazier : ritual.getRecipeBraziers(world, pos)) {
brazier.setBurning(true);
brazier.setHeldItem(ItemStack.EMPTY);
}
// this.emptyNearbyBraziers();
// this.emptyNearbyBraziers();
// System.out.println(" ritual STARTED " + ritual.name);
markDirty();
this.getWorld().notifyBlockUpdate(getPos(), state, world.getBlockState(pos), 3);
Expand Down Expand Up @@ -238,12 +237,9 @@ public void update() {
// }
if (getProgress() == 0 && getRitualCurrent() != null) {
Roots.logger.info("RITUAL has completed " + getRitualCurrent().getName());

getRitualCurrent().doEffect(getWorld(), getPos(), getInventory(), getIncenses());

setRitualName(null);
setRitualCurrent(null);

markDirty();
this.getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3);
}
Expand All @@ -256,7 +252,6 @@ public void update() {
// brazier.setBurning(false);
// }
// }

public ArrayList<ItemStack> getInventory() {
return inventory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ private void notifyUpdate(IBlockState state) {
@Override
public boolean activate(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack playerItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (playerItem.isEmpty()) {

if (!getHeldItem().isEmpty() && !isBurning()) {
if (player.isSneaking()) {
Roots.statusMessage(player, getHeldItem().getDisplayName());
}
else {

dropContaining(state);
notifyUpdate(state);
Roots.statusMessage(player, "brazier.burning.empty");
Expand All @@ -96,18 +94,15 @@ else if (isBurning()) {
if (player.isSneaking()) {
Roots.statusMessage(player, "brazier.burning.off");
stopBurning();
// heldItem = ItemStack.EMPTY;
notifyUpdate(state);
return true;
}
}

}
else if (playerItem.getItem() == Items.FLINT_AND_STEEL) {
if (!getHeldItem().isEmpty()) {
startBurning();
Roots.statusMessage(player, "brazier.burning.on");

notifyUpdate(state);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ private boolean tryActivateRecipe(IBlockState state) {
ComponentRecipe recipe = ComponentManager.getRecipe(inventory);
if (recipe != null && !recipe.isDisabled() && this.inventory.size() > 3
&& ComponentRecipe.getModifierCapacity(inventory) != -1) {

if (!world.isRemote) {
world.spawnEntity(new EntityItem(world, getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5, recipe.getRecipeResult(inventory)));
}
Expand Down
64 changes: 42 additions & 22 deletions src/main/java/elucent/rootsclassic/compat/RitualZen.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import elucent.rootsclassic.Roots;
import elucent.rootsclassic.ritual.RitualBase;
import elucent.rootsclassic.ritual.RitualManager;
import elucent.rootsclassic.ritual.rituals.RitualCrafting;
import net.minecraftforge.fml.common.Optional;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
Expand All @@ -14,6 +15,38 @@
@ZenRegister
public class RitualZen {

@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void addCraftingRitual(String uniqueName, IItemStack output, int level, double r, double g, double b,
IItemStack incenses[], IItemStack ingredients[]) {
RitualCrafting newCraft = new RitualCrafting(uniqueName, level, r, g, b);
newCraft.setResult(SpellZen.toStack(output));
newCraft.setIngredients(Arrays.asList(SpellZen.toStacks(ingredients)));
newCraft.setIncenses(Arrays.asList(SpellZen.toStacks(incenses)));
RitualManager.addRitual(newCraft);
}

@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setPrimaryColor(String name, double r, double g, double b) {
RitualBase found = findRitualByName(name);
found.setPrimaryColor(r, g, b);
}

@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setSecondaryColor(String name, double r, double g, double b) {
RitualBase found = findRitualByName(name);
found.setSecondaryColor(r, g, b);
}

@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setLevel(String name, int level) {
RitualBase found = findRitualByName(name);
found.setLevel(level);
}

/**
* Invalid ritual, names must be one of: staffCrafting,sylvanHoodCrafting,sylvanChestCrafting,sylvanLegsCrafting,sylvanBootsCrafting,
* wildwoodHeadCrafting,wildwoodChestCrafting,wildwoodLegsCrafting,wildwoodBootsCrafting, acceleratorStoneCrafting,standingStone,entanglerStoneCrafting,growerStoneCrafting,
Expand All @@ -24,42 +57,29 @@ public class RitualZen {
@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setRitualIngredients(String name, IItemStack items[]) {
//
RitualBase found = RitualManager.getRitualFromName(name);
if (found == null) {
String names = "";
for (RitualBase c : RitualManager.rituals) {
names += c.getName() + ",";
}
// Roots.logger.info(names);
throw new IllegalArgumentException("Invalid ritual[" + name + "], names must be one of: " + names);
}
if (items.length == 0 || items.length > 3) {
throw new IllegalArgumentException("Invalid ritual ingredients, must be in range [1,3]");
}
RitualBase found = findRitualByName(name);
Roots.logger.info("[ZenScript:Ritual] changing ingredients " + found.getName());
found.setIngredients(Arrays.asList(SpellZen.toStacks(items)));
}

@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setRitualIncense(String name, IItemStack[] items) {
//
RitualBase found = findRitualByName(name);
Roots.logger.info("[ZenScript:Ritual] changing incense " + found.getName());
found.setIncenses(Arrays.asList(SpellZen.toStacks(items)));
}

private static RitualBase findRitualByName(String name) {
RitualBase found = RitualManager.getRitualFromName(name);
if (found == null) {
String names = "";
for (RitualBase c : RitualManager.rituals) {
names += c.getName() + ",";
}
// Roots.logger.info(names);
Roots.logger.info(names);
throw new IllegalArgumentException("Invalid ritual[" + name + "], names must be one of: " + names);
}

if (items.length == 0 || items.length > 4) {
throw new IllegalArgumentException("Invalid ritual incense, must be in range [1,4]");
}
Roots.logger.info("[ZenScript:Ritual] changing incense " + found.getName());
found.setIncenses(Arrays.asList(SpellZen.toStacks(items)));

return found;
}
}
16 changes: 10 additions & 6 deletions src/main/java/elucent/rootsclassic/compat/SpellZen.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ public class SpellZen {
@Optional.Method(modid = "crafttweaker")
@ZenMethod
public static void setSpellItems(String name, IItemStack items[]) {
//
if (items.length == 0 || items.length > 4) {
throw new IllegalArgumentException("Invalid spell ingredients, must be in range [1,4]");
}
ComponentRecipe found = findSpellByName(name);
Roots.logger.info("[ZenScript:Spell] changing recipe " + found.getLocalizedName());
found.setMaterials(Arrays.asList(toStacks(items)));
}

private static ComponentRecipe findSpellByName(String name) {
ComponentRecipe found = ComponentManager.getSpellFromName(name);
if (found == null) {
String names = "";
Expand All @@ -34,11 +42,7 @@ public static void setSpellItems(String name, IItemStack items[]) {
// Roots.logger.info(names);
throw new IllegalArgumentException("Invalid spell [" + name + "], names must be one of: " + names);
}
if (items.length == 0 || items.length > 4) {
throw new IllegalArgumentException("Invalid spell ingredients, must be in range [1,4]");
}
Roots.logger.info("[ZenScript:Spell] changing recipe " + found.getLocalizedName());
found.setMaterials(Arrays.asList(toStacks(items)));
return found;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public boolean matches(List<ItemStack> items) {
return tempItems.size() == 0;
}


public String getEffectResult() {
return effectResult;
}
Expand Down
Loading

0 comments on commit 5de0f10

Please sign in to comment.