Everything posted by BusyBeever
-
[1.8.9][Loot] Changing default values of Minecraft entities, blocks or items
yes
-
[1.7.10] Problems with FluidTank NBT read/write
dont reuse nbttagcompounds. where are you even using those? I guess most of the confusion comes from the lack of informations provided. in each normal case you wouldn't be write to the same compound you read from (e.g. tileentities)
-
[1.7.10] Problems with FluidTank NBT read/write
The empty tag only gets added if the fluidstack is null. read the code. if stack not null do stuff else write empty
-
[1.7.10] Problems with FluidTank NBT read/write
why should it never be read? if you create e.g. a tileentity with a fluidtank in the tileentities readFromNBT you will read the tank from nbt, which will get saved to disk in writeToNBT of the tileentity if you code it that way
-
[1.7.10] Problems with FluidTank NBT read/write
I dont know why you showed me that piece of code since it has no relation to what I told you but thats just my point of view. If you change the fluidstack inside at runtime it wont be null, so that code wont write empty to the compound
-
[1.7.10] Problems with FluidTank NBT read/write
you dont need to remove the tag, because everytime writeToNBT is called they get a clear new NBTTagCompound, which means that the old "empty" key wont be inside of it
-
[1.8.9]ITickable not ticking
From reading your code it looks like you are triing to give your player mana. You should do that using the new capability system, not worldsaved data https://mcforge.readthedocs.org/en/latest/datastorage/capabilities/ (btw how to make clickable links?)
-
[1.8.9]ITickable not ticking
ITickable doesnt work for WorldSavedData. I think it only works for TileEntities
-
Simple Ways To Implement All Blocks List
I dont think there is a tutorial for EVERY type of minecraft block, for most of it you will need to look into the miencraft sources and understand how minecraft is doing it. e.g. doors are placing the upper half of themselves in onBlockPlaced
-
SubscribeEvent EntityJoinWorldEvent [Solved]
you shouldnt be getting the world the way you do it there.. in most of the cases u want to be using the world the entity is in and not the overworld.
-
[1.8.9][SOLVED]How to tell if an item is already in custom inventory?
I guess it is crashign with an NullPointerException? You are never checking if the item stacks are null
-
[1.8.9][SOLVED] Make a recipe that needs more than 1 Item unit on the same slot
I think you can do that for custom vanilla crafting table. You just need to return the right stuff in getRemainingItems in ur custom IRecipe
-
[1.7.10] [SOLVED] How to make a block that is not 1x1x1?
Pipes should not be bigger then 1x1x1. A large pipe consists of multiple small pipes
-
[1.8.9] Getting IInventory from ItemHandler
Hey everyone, I am working on my guicontainer using the new capabilities system. I feel retarded to ask this, but how do I get an IInventory from the IItemHandler, since I need it to add slots to the container.. Thanks for every hint I get ! for (int i = 0; i < handler.getSlots(); i++) { addSlotToContainer(new Slot(handler, i, 10, 10)); }
-
[1.7.10] [SOLVED] How to make a block that is not 1x1x1?
You should do it how vanilla does it, which is the bed.
-
Voice Recognition
Voice recognition is nothing but plain java. So you need to get a speech recognizer and think about what it should do for you. I think sphinx was an library for speech recognition but never really worked with it
-
[1.8][UNSOLVED] Help Me! Crash Report My Forge Modding In Custom Drops!!!
Spoiler Alert: This wont work.
-
[1.8.9]Loading text from an assets file
you missed the / at the start :b
-
[1.8.9]Loading text from an assets file
InputStream is = Schematic.class.getResourceAsStream("/assets/extendedvillages/schematics/"+name+".schematic"); This is my code to access everything inside assets/extendedvillages/schematics/VARIABLENAME.schematic You can replace the Schematic.class with TextResource.class if im not mistaken
-
[1.8.9] NPE while reading Schematics
The problem seemed to be my java for some reason.. Since I completed working on my mod on another machine and it works now.. Still thank you for the answer :'D
-
[1.8.9] NPE while reading Schematics
Hello everyone, I am triing to code my own Schematic creator. I already got a working Schematic reader that works like a charm. The problem is that when I try to read my own schematics I get an NPE for the InflaterInputStream, and I have no idea why. Here is my code for creating the schematic private boolean createSchematic(String path, BlockPos first, BlockPos second, World world) { try { int smallerY, smallerX, smallerZ; int biggerY, biggerX, biggerZ; if(first.getX()>second.getX()) { smallerX= second.getX(); biggerX = first.getX(); } else { smallerX = first.getX(); biggerX = second.getX(); } if(first.getY()>second.getY()) { smallerY= second.getY(); biggerY = first.getY(); } else { smallerY = first.getY(); biggerY = second.getY(); } if(first.getZ()>second.getZ()) { smallerZ= second.getZ(); biggerZ = first.getZ(); } else { smallerZ = first.getZ(); biggerZ = second.getZ(); } NBTTagCompound compound = new NBTTagCompound(); int width = biggerX-smallerX+1; int height = biggerY-smallerY+1; int length = biggerZ-smallerZ+1; compound.setInteger("Width", width); compound.setInteger("Height", height); compound.setInteger("Length", length); byte[] blockIDS = new byte[width*height*length]; byte[] metadata = new byte[width*height*length]; int counter=0; for(int y=smallerY; y<=biggerY;y++) { for (int z = smallerZ; z <= biggerZ; z++) { for (int x = smallerX; x <= biggerX; x++) { IBlockState state = world.getBlockState(new BlockPos(x,y,z)); blockIDS[counter] = (byte) Block.getIdFromBlock(state.getBlock()); metadata[counter] = (byte) state.getBlock().getMetaFromState(state); counter++; } } } compound.setByteArray("Blocks", blockIDS); compound.setByteArray("Data", metadata); FileOutputStream fos = new FileOutputStream(path); CompressedStreamTools.writeCompressed(compound, fos); fos.close(); return true; } catch (FileNotFoundException e) { e.printStackTrace(); return false; } catch (IOException e) { e.printStackTrace(); return false; } } And for creating the schematic public Schematic(String name) { try { InputStream is = Schematic.class.getResourceAsStream("/assets/extendedvillages/schematics/"+name+".schematic"); NBTTagCompound compound = CompressedStreamTools.readCompressed(is); is.close(); width = compound.getShort("Width"); //This is where it crashes height = compound.getShort("Height"); length = compound.getShort("Length"); blocks = new BlockInf[width*height*length]; byte[] blockIDS = compound.getByteArray("Blocks"); byte[] metadata = compound.getByteArray("Data"); int counter=0; for (int y = 0; y < height; y++) { for (int z = 0; z < length; z++) { for (int x = 0; x < width; x++) { BlockPos pos = new BlockPos(x,y,z); IBlockState state = Block.getBlockById(blockIDS[counter]!=-92?blockIDS[counter] : 53).getStateFromMeta(metadata[counter]); counter++; blocks[counter] = new BlockInf(pos, state); System.out.println(blocks[counter]); } } } } catch(Exception e) { e.printStackTrace(); } }
-
[1.8.9] Item that acts as a furnace (container, inventory, gui..., te ?)
you can store everything you need in the itemstacks nbt. I would save the time the "furnace" got opened last time in the nbt, and whenever the player opens the inventory process the items for actualTime-lastTimeOpened ticks
-
[1.7.10] [Solved] Thermal dynamics energy pipes not returning how much energy they got
mb u should report that to thermal energy
-
[1.7.10] [SOLVED] Need GUI example
you will need to textures. "checked" and "notchecked", in ur render method make a check if the box is checked or check not. you could also put both textures in one file and paint different parts of it. thats how i would do it, maybe not the best approach
-
custom block that prevents spawning of mobs in a certain perimeter
Depends on your computer :b The real question is how long takes it to get worldsaveddata from a worldobj. and of course the more blocks that prevent spawning get spawned the, the more efficent it would be to check the surroudings instead of saving them
IPS spam blocked by CleanTalk.