Jump to content


  • Posts

  • Joined

  • Last visited


  • Gender
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AlekBardzo's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. Yes, I know, it does pop-up in search though. Besides I still cannot get it to work...
  2. Should anybody look for it (to make a tutorial or something), in 1.8 there is no more : MapStorage storage = world.perWorldStorage; there is instead : MapStorage storage = world.getPerWorldStorage();
  3. I did as You said, only with uuid, since I'd be checking uuid's internally and want to test if data saved in the world will properly belong to a player that created it, no personal paswords or such...
  4. I stumbled upon the solution sometime ago, yet cant find it now. My point is that everytime I run minecraft from eclipse, it assigns a random player name and uuid. How do I prevent that so it launches with constant uuid ? There was a parameter that should have been called somewhere, correct ? Just a hint please ?
  5. Where can I change how are inputs processed after crafting ? They are only decremented by amount of 1, no matter what I change. My current code (sloppy, I know) : public class MultipleInputRecipe implements IRecipe { /** Is the ItemStack that you get when craft the recipe. */ private final ItemStack recipeOutput; public final Item recipeInput; private int multiplier; public MultipleInputRecipe(ItemStack outputStack, Item item, int multi) { this.recipeOutput = outputStack; this.recipeInput = item; this.multiplier = multi; } public ItemStack getRecipeOutput() { return this.recipeOutput; } public ItemStack[] func_179532_b(InventoryCrafting inventory) {System.out.println("fired!"); ItemStack[] aitemstack = new ItemStack[inventory.getSizeInventory()]; return aitemstack; } /** * Used to check if a recipe matches current crafting inventory */ public boolean matches(InventoryCrafting inventory, World worldIn) { int amount = 0; for (int i = 0; i < inventory.func_174923_h(); ++i) { for (int j = 0; j < inventory.func_174922_i(); ++j) { ItemStack itemstack = inventory.getStackInRowAndColumn(j, i); if (itemstack != null) { if(itemstack.getItem() instanceof SilverCoin && this.recipeInput instanceof SilverCoin)amount+=itemstack.stackSize; if(itemstack.getItem() instanceof GoldCoin && this.recipeInput instanceof GoldCoin)amount+=itemstack.stackSize; if(itemstack.getItem() instanceof LargeGoldCoin && this.recipeInput instanceof LargeGoldCoin)amount+=itemstack.stackSize; } } } if(amount>=this.multiplier)return true; return false; } /** * Returns an Item that is the result of this recipe */ public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { return this.recipeOutput.copy(); } /** * Returns the size of the recipe area */ public int getRecipeSize() { return 2; } }
  6. I figured I could do 5 coins, but that would be a pain the butt of each player, and my own, so I'd try the IRecipe then
  7. as far as I understand what I see there are no classes for recipes, the behaviour is hardcoded into CraftingManager, so I guess I'd either convert them into 9's or do some "magic" with them.
  8. Hi, this is probalby rather basic : GameRegistry.addShapelessRecipe(new ItemStack(CommonProxy.largeGoldCoin,1), new ItemStack(CommonProxy.goldCoin,10)); My intention is to make a recipe that will turn 10 normal coins into one large, but when I test it, it only "eats" one normal coin for each large given. What am I doing wrong ? Is it even possible this way or do I need to handle this stuff differently ?
  9. Yes, that solves the problem, and yet nobody of You guys bothered to fix the wiki page so I did, shame on You !
  10. Yay, approved, so perhaps me be bit smart, ya ? As for the stored array, I don't know much about Java, so it never occured to me that might be wasting memory, lesson learned, thanks Wow, I was not even aware that BiomeDictionary even existed, its kinda awesome. It does make my method kinda pointless by rendering it obsolete though.
  11. Ok, so as You probably noticed already, learing Forge makes a man bang his head against the wall quite often. To spare You that, I decided do describe what I found. I know one might find the answer through search on this humble forum, but if I had this problem, I'd rather find it in a nice single post detailing that particular situation. And the issue is : "I made a custom mode with a tutorial, and I want it to spawn in custom and moded biomes" Presented solution works for 1.7.10 (yay, no erratas for 1.6.4/1.7.2 upgrades !) : Go to the place in Your code where You register Your mob, like : EntityRegistry.addSpawn(BrigandEntity.class, spawnRate, 2, 4, EnumCreatureType.monster, this.all_biomes); All tutorials I've seen ask You to provide BiomeGenBase.SOMETHING as the last parameter of .addSpawn() , You may however pass an array of BiomeGenBase objects. It is important for this to be an array, not a ArrayList. You need to prepare it before, the solution that I've found to work : ArrayList<BiomeGenBase> all_biomesList = new ArrayList<BiomeGenBase>(); for( BiomeGenBase biome : BiomeGenBase.getBiomeGenArray() ) { if( biome != null ) { all_biomesList.add(biome); // here You may filter biomes which are You like by their properties and insert them in separate ArrayLists } } BiomeGenBase[] all_biomes_array = new BiomeGenBase[all_biomesList.size()]; // type casting from List to array all_biomes = all_biomesList.toArray(all_biomes_array); and "all_biomes" will be Your passable array. Mind You, You may further filter biomes within "if" loop, in order to create more specyfic list of biomes, and than convert it to array as well. TIP: in earlier versions, field BiomeGenBase.biomesList was public, as of 1.7.10 it is not, it can be fetched with BiomeGenBase.getBiomeGenArray(). A living, breathing example (I sure love those in tutorials) : public void register(int banditRate, int brigandRate, int tribesmanRate){ // prepare biomes lists // ArrayList<BiomeGenBase> all_biomesList = new ArrayList<BiomeGenBase>(); ArrayList<BiomeGenBase> cold_biomesList = new ArrayList<BiomeGenBase>(); ArrayList<BiomeGenBase> warmAndMedium_biomesList = new ArrayList<BiomeGenBase>(); for( BiomeGenBase biome : BiomeGenBase.getBiomeGenArray() ) { if( biome != null ) { //all_biomesList.add(biome); if( biome.getIntRainfall()>8000 && biome.getTempCategory()!=TempCategory.OCEAN && biome.heightVariation<0.5F){ // hospitable biomes only if(biome.getTempCategory()==TempCategory.COLD){ // cold biomes cold_biomesList.add(biome); }else{ // medium and warm biomes warmAndMedium_biomesList.add(biome); } } } } //BiomeGenBase[] all_biomes_array = new BiomeGenBase[all_biomesList.size()]; // type casting from List to array and stuff //all_biomes = all_biomesList.toArray(all_biomes_array); BiomeGenBase[] cold_biomes_array = new BiomeGenBase[cold_biomesList.size()]; BiomeGenBase[] warmAndMedium_biomes_array = new BiomeGenBase[warmAndMedium_biomesList.size()]; this.registerBrigand(brigandRate,warmAndMedium_biomesList.toArray(warmAndMedium_biomes_array)); this.registerBandit(banditRate,warmAndMedium_biomesList.toArray(warmAndMedium_biomes_array)); this.registerTribesman(tribesmanRate,cold_biomesList.toArray(cold_biomes_array)); } EDIT: Or... if You may acomplish the same quicker by using BiomeDictionary, like that : // prepare biomes BiomeGenBase[] biomes = new BiomeGenBase[0]; biomes = ArrayUtils.addAll(biomes, BiomeDictionary.getBiomesForType(Type.DENSE)); biomes = ArrayUtils.addAll(biomes, BiomeDictionary.getBiomesForType(Type.FOREST)); biomes = ArrayUtils.addAll(biomes, BiomeDictionary.getBiomesForType(Type.RIVER)); EntityRegistry.addSpawn(BanditEntity.class, spawnRate, 2, 4, EnumCreatureType.monster, biomes);
  12. Let me dig it up, since it shows in search, so someone might want to use it. I'm coding for 1.7.10 and BiomeGenBase.biomesList is not availble directly, there is a method .getBiomeGenArray() that returns it. Also EntityRegistry.addSpawn() wants BiomeGenBase[] as param, not ArrayList<BiomeGenBase> I did it like that : ArrayList<BiomeGenBase> all_biomesList = new ArrayList<BiomeGenBase>(); for( BiomeGenBase biome : BiomeGenBase.getBiomeGenArray() ) { if( biome != null ) { all_biomesList.add(biome); } } BiomeGenBase[] all_biomes_array = new BiomeGenBase[all_biomesList.size()]; // type casting from List to array and stuff this.all_biomes = all_biomesList.toArray(all_biomes_array);
  13. That clouds up my mind even further... so lets take a wider perspective then. There is a Entity, Entity is a Human, so it has a name, surname and sex. Those are given to it on first spawn, and will not change during the game (lets assume that). - should it then be enough to use IEntityAdditionalSpawnData ? - does it require IExtendedEntityProperties ? - or perhaps it needs additional playing around with packets to get synced ? perhaps I'm creating my entity wrong then, for those parameters to be given to the entity, what is the good place to do it ? Constructor ? "init()" ? By the way "init()" function within Entity declaration, what does it do exacly ? In human comprehendible way I mean ?
  14. Allright, thats probably obvious, but : - I have a persistent entity that is loaded, upon loading I want to send a packet to a client. So I'm sending a packet, to a player. How do I know which player should I send it to ? Send it to everyone and check if a player is aware of entity's existence ? EDIT: That wont work since server will load entity's data before client is even ready. I'll have to have client request missing data and hope for response, and the whole thing gets hopelessly convoluted in the process...
  15. Yeah, I figured as much already... Many thanks I want those entities to be persistent in the game, so I implemented IExtendedEntityProperties, yet it does nothing to inform the client about that data, or perhaps my implementation is wrong. Should IExtendedEntityProperties be updating client info ? Or is it just designed for persistence on the server ? Affirmative
  • Create New...

Important Information

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