Jump to content

SteampunkRBot

Members
  • Posts

    13
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SteampunkRBot's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey all, On our server we've run into a bit of an issue, where players who are in this specific area, or teleport there, get kicked from the server and are unable to join back due to "Internal Server Error". I downloaded the world and ran it in singleplayer, teleported to the area and this is the crash I got. http://pastebin.com/BncCJ5Fm​​ This was running Forge 10.13.2.1232. Any and all help is greatly appreciated, as this area of our server is kind of important due to it being out build area. Thanks in advance! ^.^
  2. Hey guys, So I'm in need of a little assistance with something I'd like to do in my mod. I have a function that will teleport a player to a given location, however I would like to give the player 1 minute to prepare before the teleport. During this minute, if they issue a specified command, then I'd like them to skip the minute wait and teleport. This code isn't inside an entity, block, or other class that has an onUpdate or other function I could use. Any and all help is greatly appreciated! ^.^ (Will provide code as required, so just say the word if you need to see the code, unless you know how I can do this without seeing my code.)
  3. Ok, thats all I needed now! All works! Thanks for all the help!!! You guys are awesome. I shall stop bugging you now, and let you get back to things.
  4. Ok, that solved it! Thanks for the explaination, I have never heard someone explain something like that Just to use this thread a little more, I seem to be having trouble with searching through recipes. In my BrewingManager, I try to make a getRecipe function, but on my "for (BrewingRecipe r : this.recipe)" line, eclipse is telling me "Type mismatch: cannot convert from element type Object to BrewingManager.BrewingRecipe" and as I am still kinda nooby (as you may have gathered ) I cant't figure out a solution... (Basically, just tell me how to solve this :3) Thanks for all the help so far, I really appreciate it!
  5. @hydroflame I am not sure... Where should it be? (I might have forgotten to create a class or two, as this is my first crafting system.) @GotoLink I did indeed remove the "final" keyword
  6. @hydroFlame My Liquids class as requested: package RV97.Drinks; import cpw.mods.fml.common.registry.LanguageRegistry; import RV97.Drinks.Config.ItemInfo; import RV97.Drinks.Items.Items; import RV97.Drinks.Utils.Crafting.CraftingManager; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidContainerData; import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidDictionary; import net.minecraftforge.liquids.LiquidStack; public class Liquids { public static Item applejackDaniels; public static Item goldApplejackDaniels; public static Item witherWine; public static Item zambambooze; public static Item spiderSpirit; public static void init(){ applejackDaniels = new Item(ItemInfo.LIQUID_ID).setUnlocalizedName("applejackDaniels"); LanguageRegistry.addName(applejackDaniels, "Apple JackDaniels"); } public static void registerLiquids(){ LiquidDictionary.getOrCreateLiquid("Apple JackDaniels", new LiquidStack(applejackDaniels, 1)); LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Apple JackDaniels", 1000), new ItemStack(Items.drink,1,1), new ItemStack(Items.mug))); } public static void registerLiquidRecipes(){ CraftingManager.brewery.addRecipe(new ItemStack(Item.sugar), new ItemStack(Item.appleRed), new LiquidStack(Block.waterStill.blockID, 1000), new LiquidStack(Block.lavaStill, 1000), 300); } } Line 33 is: CraftingManager.brewery.addRecipe(new ItemStack(Item.sugar), new ItemStack(Item.appleRed), new LiquidStack(Block.waterStill.blockID, 1000), new LiquidStack(Block.lavaStill, 1000), 300); @GotoLink I moved that code into the BrewingManager code, which is the only class that tries to access those lines, so that should fix it (atleast, for now).
  7. I moved the BrewingRecipe code into my brewing manager, so that should be fine. Still need to solve this crash though... I shall try re-adding all my items, just to check none of them are conflicting with 0. Shall Report back shortly. EDIT: Ok, now the breakline no longer refers to id conflicts of 0 (turns out I forgot to change my config class to use my ID's for 2 items... Silly mistake ) However, we are back to the original crash of:
  8. Here are my BrewingManager and BrewingRecipe classes (Not to be mistaken for IBrewingManager and IBrewingRecipe), which handle adding the recipes etc. BrewingManager: package RV97.Drinks.Utils.Crafting; import java.util.ArrayList; import java.util.List; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidStack; public class BrewingManager implements IBrewingManager{ private final List recipes; public BrewingManager() { this.recipes = new ArrayList(); } public static IBrewingManager getInstance(){ return CraftingManager.brewery; } public void addRecipe(ItemStack inputItemStack1, LiquidStack outputLiquidStack, int brewingTime) { if(inputItemStack1 == null){ return; } this.recipes.add(new BrewingRecipe(inputItemStack1, outputLiquidStack, brewingTime)); } public void addRecipe(ItemStack inputItemStack1, ItemStack inputItemStack2, LiquidStack outputLiquidStack, int brewingTime) { if((inputItemStack1 == null) || (inputItemStack2 == null)){ return; } this.recipes.add(new BrewingRecipe(inputItemStack1, inputItemStack2, outputLiquidStack, brewingTime)); } public void addRecipe(ItemStack inputItemStack1, LiquidStack inputLiquidStack, LiquidStack outputLiquidStack, int brewingTime) { if((inputItemStack1 == null) || (inputLiquidStack == null)){ return; } this.recipes.add(new BrewingRecipe(inputItemStack1, inputLiquidStack, outputLiquidStack, brewingTime)); } public void addRecipe(ItemStack inputItemStack1, ItemStack inputItemStack2, LiquidStack inputLiquidStack, LiquidStack outputLiquidStack, int brewingTime) { if((inputItemStack1 == null) || (inputItemStack2 == null) || (inputLiquidStack == null)){ return; } this.recipes.add(new BrewingRecipe(inputItemStack1, inputItemStack2, inputLiquidStack, outputLiquidStack, brewingTime)); } public IBrewingRecipe getRecipe(ItemStack inputStack) { if (inputStack == null){ return null; } for (BrewingRecipe r : this.recipes){ if(inputStack.isItemEqual(r.getInput1())){ return r; } } return null; } public IBrewingRecipe getRecipe(ItemStack inputStack, ItemStack inputStack2) { if ((inputStack == null)||(inputStack2 == null)){ return null; } for (BrewingRecipe r : this.recipes){ if((inputStack.isItemEqual(r.getInput1())) && (inputStack2.isItemEqual(r.getInput2()))){ return r; } } return null; } public IBrewingRecipe getRecipe(ItemStack inputStack, LiquidStack inputLiquid) { if ((inputStack == null)||(inputLiquid == null)){ return null; } for (BrewingRecipe r : this.recipes){ if((inputStack.isItemEqual(r.getInput1())) && (inputLiquid.isLiquidEqual(r.getLiquidInput()))){ return r; } } return null; } public IBrewingRecipe getRecipe(ItemStack inputStack, ItemStack inputStack2, LiquidStack inputLiquid) { if ((inputStack == null)|| (inputStack2 == null) ||(inputLiquid == null)){ return null; } for (BrewingRecipe r : this.recipes){ if((inputStack.isItemEqual(r.getInput1())) && (inputStack2.isItemEqual(r.getInput2())) && (inputLiquid.isLiquidEqual(r.getLiquidInput()))){ return r; } } return null; } public List getRecipes() { return this.recipes; } } BrewingRecipe: package RV97.Drinks.Utils.Crafting; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidStack; public class BrewingRecipe implements IBrewingRecipe{ private final ItemStack inputStack; private final ItemStack inputStack2; private final LiquidStack inputLiquid; private final LiquidStack resultLiquid; private final int brewTime; public BrewingRecipe(ItemStack inputStack, LiquidStack resultLiquid, int brewTime){ this.inputStack = inputStack; this.resultLiquid = resultLiquid; this.brewTime = brewTime; } public BrewingRecipe(ItemStack inputStack, ItemStack inputStack2, LiquidStack resultLiquid, int brewTime){ this.inputStack = inputStack; this.inputStack2 = inputStack2; this.resultLiquid = resultLiquid; this.brewTime = brewTime; } public BrewingRecipe(ItemStack inputStack, LiquidStack inputLiquid, LiquidStack resultLiquid, int brewTime){ this.inputStack = inputStack; this.inputLiquid = inputLiquid; this.resultLiquid = resultLiquid; this.brewTime = brewTime; } public BrewingRecipe(ItemStack inputStack, ItemStack inputStack2, LiquidStack inputLiquid, LiquidStack resultLiquid, int brewTime){ this.inputStack = inputStack; this.inputStack2 = inputStack2; this.inputLiquid = inputLiquid; this.resultLiquid = resultLiquid; this.brewTime = brewTime; } public int getBrewTime() { return this.brewTime; } public ItemStack getInput1() { return this.inputStack.copy(); } public ItemStack getInput2() { if(this.inputStack2 == null){ return null; } return this.inputStack2.copy(); } public LiquidStack getLiquidInput() { if(this.inputLiquid == null){ return null; } return this.inputLiquid.copy(); } public LiquidStack getLiquidOutput() { return this.resultLiquid.copy(); } }
  9. This makes no sense, none of my items have an id of 0, and the crash only occurs if the addRecipe line is in there. If I comment the addRecipe out, then I have no crashes.
  10. @Mazetar Ok, im now getting this: I have no idea why its mentioning the Spade item... Unless I accidentally conflicted with it with one of my items. @GotoLink I plan to add more types of crafting, so that will be the central crafting class where I, and possibly other mods, may access these crafting managers.
  11. I am working on a crafting manager for my mod, but when I try to use my addRecipe I get a null pointer exception. My IBrewingManager package RV97.Drinks.Utils.Crafting; import java.util.List; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidStack; public abstract interface IBrewingManager { public abstract void addRecipe(ItemStack inputItemStack1, LiquidStack outputLiquidStack, int brewingTime); public abstract void addRecipe(ItemStack inputItemStack1, ItemStack inputItemStack2, LiquidStack outputLiquidStack, int brewingTime); public abstract void addRecipe(ItemStack inputItemStack1, LiquidStack inputLiquidStack, LiquidStack outputLiquidStack, int brewingTime); public abstract void addRecipe(ItemStack inputItemStack1, ItemStack inputItemStack2, LiquidStack inputLiquidStack, LiquidStack outputLiquidStack, int brewingTime); public abstract IBrewingRecipe getRecipe(ItemStack inputStack, ItemStack inputStack2, LiquidStack inputLiquid); public abstract List getRecipes(); } My CraftingManager package RV97.Drinks.Utils.Crafting; public class CraftingManager { public static IBrewingManager brewery; } My IBrewingRecipe package RV97.Drinks.Utils.Crafting; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidStack; public abstract interface IBrewingRecipe { public abstract int getBrewTime(); public abstract ItemStack getInput1(); public abstract ItemStack getInput2(); public abstract LiquidStack getLiquidInput(); public abstract LiquidStack getLiquidOutput(); } My attempt at addRecipe CraftingManager.brewery.addRecipe(new ItemStack(Item.sugar), new ItemStack(Item.appleRed), new LiquidStack(Block.waterStill.blockID, 1000), new LiquidStack(applejackDaniels, 1000), 300); And the error I get is as follows: RV97.Drinks.Liquids.registerLiquidRecipes(Liquids.java:33) Refers to where I have the addRecipe I show above, and RV97.Drinks.DrinksCore.preInit(DrinksCore.java:44) refers to when I register that piece of code (I have addRecipe under a function I run during the mod initialisation) Any and all help is appreciated.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.