Skip to content

Commit

Permalink
Merge pull request #81 from ThexXTURBOXx/master
Browse files Browse the repository at this point in the history
NoB fixed
  • Loading branch information
ThexXTURBOXx committed Feb 4, 2016
2 parents 7653bba + ca1264a commit 829e36d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
1 change: 0 additions & 1 deletion java/org/silvercatcher/reforged/ReforgedReferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static class Textures
public static class GlobalValues
{
//Items
public static final boolean ARROW_BUNDLE = CommonProxy.arrow_bundle;
public static final boolean BATTLEAXE = CommonProxy.battleaxe;
public static final boolean BLOWGUN = CommonProxy.blowgun;
public static final boolean BOOMERANG = CommonProxy.boomerang;
Expand Down
8 changes: 2 additions & 6 deletions java/org/silvercatcher/reforged/ReforgedRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ public class ReforgedRegistry {

//Registry
public static void createItems() {
if(GlobalValues.ARROW_BUNDLE) {
registrationList.add(ARROW_BUNDLE = new ItemArrowBundle());
}

if(GlobalValues.NEST_OF_BEES) {
registrationList.add(ARROW_BUNDLE = new ItemArrowBundle());
registrationList.add(NEST_OF_BEES = new ItemNestOfBees());
}

Expand Down Expand Up @@ -197,7 +194,6 @@ public static void createItems() {

public static void registerItems() {

//todo refactor recipe system
for(Item item : registrationList) {
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
}
Expand Down Expand Up @@ -238,7 +234,7 @@ public static void registerRecipes() {

public static void registerEntity(Class c, String name, int counter) {
EntityRegistry.registerModEntity(c, name, counter, ReforgedMod.instance, 120, 1, true);
}
}

public static void registerEntityRenderer(Class entityclass, Render renderclass) {
RenderingRegistry.registerEntityRenderingHandler(entityclass, renderclass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ public ItemArrowBundle() {
public void registerRecipes() {

GameRegistry.addShapelessRecipe(new ItemStack(this),
new ItemStack(Items.arrow, 8), new ItemStack(Items.string));
new ItemStack(Items.string), new ItemStack(Items.arrow),
new ItemStack(Items.arrow), new ItemStack(Items.arrow),
new ItemStack(Items.arrow), new ItemStack(Items.arrow),
new ItemStack(Items.arrow), new ItemStack(Items.arrow),
new ItemStack(Items.arrow));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.silvercatcher.reforged.items.CompoundTags;

import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -47,8 +48,12 @@ public boolean matches(InventoryCrafting inventory, World world) {

if(stack != null) {
if(stack.getItem() == ReforgedRegistry.NEST_OF_BEES) {
nestsOfBees++;
output = stack.copy();
if(stack.getTagCompound().getInteger(CompoundTags.AMMUNITION) + 1 > 32) {
return false;
} else {
nestsOfBees++;
output = stack.copy();
}
} else if(stack.getItem() == ReforgedRegistry.ARROW_BUNDLE) {
arrowBundles++;
} else {
Expand Down Expand Up @@ -81,11 +86,9 @@ public ItemStack getCraftingResult(InventoryCrafting inventory) {
Item item = stack.getItem();
if(item == ReforgedRegistry.NEST_OF_BEES) {
output = stack.copy();
} else {
if(item == ReforgedRegistry.ARROW_BUNDLE) {
arrowBundleIndizes.add(i);
input[i] = stack.copy();
}
} else if(item == ReforgedRegistry.ARROW_BUNDLE) {
arrowBundleIndizes.add(i);
input[i] = stack.copy();
}
}
}
Expand All @@ -100,13 +103,11 @@ public ItemStack getCraftingResult(InventoryCrafting inventory) {
int arrowBundleSlot = arrowBundleIndizes.removeFirst();

ItemStack arrowBundleStack = inventory.getStackInSlot(arrowBundleSlot);

int use = (32 - arrows) / 8;
if(use <= 0) break;

arrows += Math.min(use, arrowBundleStack.stackSize) * 8;

input[arrowBundleSlot].stackSize -= use;
arrows += 8;
if(arrows > 32) {
arrows = 32;
}
input[arrowBundleSlot].stackSize -= 4;
}

compound.setInteger(CompoundTags.AMMUNITION, arrows);
Expand Down
4 changes: 1 addition & 3 deletions java/org/silvercatcher/reforged/proxy/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void init(FMLInitializationEvent event) {
}

//Items for Config
public static boolean arrow_bundle;
public static boolean battleaxe;
public static boolean blowgun;
public static boolean boomerang;
Expand All @@ -62,7 +61,6 @@ private void loadConfig(FMLPreInitializationEvent e) {
config.load();

//Items
arrow_bundle = config.getBoolean("Arrow Bundle", "Items", true, "Enable the Arrow Bundle");
battleaxe = config.getBoolean("Battleaxe", "Items", true, "Enable the Battleaxe");
blowgun = config.getBoolean("Blowgun", "Items", true, "Enable the Blowgun plus Darts");
boomerang = config.getBoolean("Boomerang", "Items", true, "Enable the Boomerang");
Expand All @@ -72,7 +70,7 @@ private void loadConfig(FMLPreInitializationEvent e) {
katana= config.getBoolean("Katana", "Items", true, "Enable the Katana");
knife = config.getBoolean("Knife", "Items", true, "Enable the Knife");
musket = config.getBoolean("Musket", "Items", true, "Enable the Musket and Blunderbuss");
nest_of_bees = config.getBoolean("Nest Of Bees", "Items", false, "Enable the Nest Of Bees (Beta, Only use for testing!)");
nest_of_bees = config.getBoolean("Nest Of Bees", "Items", true, "Enable the Nest Of Bees");
sabre = config.getBoolean("Sabre", "Items", true, "Enable the Sabre");

//Others
Expand Down

0 comments on commit 829e36d

Please sign in to comment.