-
Posts
444 -
Joined
-
Last visited
Everything posted by brandon3055
-
Can't use Thermal Expansion in dev enviroment
brandon3055 replied to KeeganDeathman's topic in Modder Support
I ment get the latest non dev version of thermal expansion. I am using the following versions. CoFHCore-[1.7.10]3.0.0B7-dev-35 ThermalExpansion-[1.7.10]4.0.0B6-16 ThermalFoundation-[1.7.10]1.0.0B3-dev-8 CodeChickenCore:1.7.10-1.0.4.29:dev Only thing is i have CCC setup as a dependency so its not actually installed in the mods folder but that shouldnt make a difference. -
Can't use Thermal Expansion in dev enviroment
brandon3055 replied to KeeganDeathman's topic in Modder Support
I recently tried updating CoFHCore, Thermal Expansion and Thermal Foundation in my workspace and got the same error from thermal expansion. My guess is that field was somehow missed by the deobfuscation process and CCC isnt fixing it because the rest of the mod is already deobfuscated. But thats just a guess. I updated to the latest NON dev version and that fixed the problem. -
ItemStack NBT is just like TE NBT. They just store different things. I think he was referring to the way tile nbt is read and saved to fields inside the tile entity class. The difference is with tile entities every single block that has a tile entity has its own unique instance of the tile entity class not unlike regular entities. But with items all items share one instance of the item class so if you change something in the item class it affects all items. It can be a little confusing at first but there aren't actually any items in game. Every item is an items stack that contains that item and it is the item stack that you can store data in using nbt.
-
There is an example in the API that shows you how to do exactly that.
-
That is a technic bug you need to switch the following lines this.body.mirror = true; this.body = new ModelRenderer(this, 26, 6); "body" needs to be created before you can do anything with it.
-
Both work. You Also dont need to create your resource location every render tick just store it in the class.
-
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Of corse that makes total sense and it works now!!! after 3 hours scratching my head because of a typo Thank you SOO much for your help and most of all thankyou for putting up with my incompetence! -
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Ok so im pretty sure i have it setup properly but i cant seem to get it to work. I assume i would use it like this new ResourceLocation("myRsPackName","imageName") but i cant figure out where to define "myRsPackName" there is getPackName() but that dosnt seem to work. -
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Ok easy enough but that brings me back to ModContainer. FMLFolderResourcePack requires a mod container or do i just create a default constructor and give it that? -
RenderMob should be RenderDeer the constructor needs to have the same name as the class.
-
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Hmm... I cant figure out how to register an FMLFolderResourcePack. Or do i just need to create an instance of it? -
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Ok so looks like i am going to have to learn how to use a mod container. Im sure i can figure can figure it out but do you know of any tutorials that could save some time? (I tried looking for one but all that came up were inventory containers) -
First of all you almost never need to use a tick handler for anything like that. entities and tileEntitys have update methods that are called every tick use that. As for what sine code should be run on well that depends on what you are trying to do but usually things like tile/entity logic run on the server and anything todo with rendering runs client side.
-
Not sure if thats the correct way to do it but i believe you are crashing because coffeeMaker.getWaterTank().getFluid() == null when the tank is empty and you cant copy null. So just like you would with an itemstack make sure the fluid != null before you try to do anything with it.
-
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Thanks I wanted to use the absolute path because i will need that for the resource location when i go to use it but that brings me to another question. Is there a way to create resource location from a file path? From what i can tell there isnt so how would i bind the image? im guessing GL11 has a function for that? Edit: Trying to figure out how the texture system works. It looks like using the texture is going to be a bit tricky unless there is another way to do it that i havent found yet. -
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Already a step ahead of you. This is what i have come up with keep in mind this code is just a proof of concept i will have to create a proper handler for it i just want to make sure there aren't any problems with it. I am creating a new folder in the mods folder to store the images and i am getting the file path from the config file. @Override public void preInit(FMLPreInitializationEvent event) { downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/mods/draconicevolution"; downloadLocation = downloadLocation.replaceAll("\\\\", "/"); File file = new File(downloadLocation); if (!file.exists()) file.mkdir(); try { URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg"); String fileName = url.getFile(); String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/")); InputStream is = url.openStream(); OutputStream os = new FileOutputStream(destName); byte[] b = new byte[2048]; int length; while ((length = is.read(b)) != -1) { os.write(b, 0, length); } is.close(); os.close(); }catch (IOException e){ LogHelper.info(e); } } -
[Solved]Is there a way to embed an online image in a gui
brandon3055 replied to brandon3055's topic in Modder Support
Thanks i didnt think of that. The issue is mod file size. As it is now the tutorial images take up around 70% of my mod and thats just 2 tutorials. Ideally i would like to download them once on first startup but i haven't even started to learn java file systems although it would be a good way to learn. I think i will just look at all the options you and diesieben gave me and figure out which works best for my situation. Thanks for the replys! -
Title says it all. I recently added an information book to my mod that includes some tutorials which require images. But even at the lowest bearable resolution the image sizes are relatively large so i am just wondering if there is a way to use online images? Im guessing there isnt at least not without a lot of work but figured id ask anyway.
-
Ok so it seems you arnt clear on how receive energy works. maxReceive is the amount that a tile is trying to push into your tile you need to take that and try to add it to your storage (i say try because your storage may be full or almost full) then you return the amount of energy that was successfully added to your storage and the tile sending will subtract that number from its storage. If the simulate flag is true you return the amount that would have been added to your storage but you dont actually add it because it is simulated (a way for things to check how much energy your tile can accept) Here is what your receive energy should look like most of what i just described is handles by the EnergyStorage class so its very simple @Override public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { return this.storage.receiveEnergy(Math.min(maxInput, maxReceive), simulate); } I havent had a good look at the rest of your code so there may be other problems but that is the first one i noticed.
-
Your not actually storing the energy you receive @Override public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if(storage.getEnergyStored() < storage.getMaxEnergyStored()) { return storage.getMaxReceive(); } return 0; } your returning max receive so it is accepting energy but you are not actually adding it to the energy storage that is why storage.getEnergyStored ()> 0 is always false because its always 0.
-
You can find a mod item by modid and the name of the item like so. ItemStack stack = GameRegistry.findItemStack("ThermalFoundation", "ingotTin", 1);
-
Dont be silly anything is possible with modded minecraft! I couldn't get what SanAndreasP was talking about to work for some reason but this works TileEntity spawner = world.getTileEntity(x, y, z); if (spawner instanceof TileEntityMobSpawner){ MobSpawnerBaseLogic logic = ((TileEntityMobSpawner)spawner).func_145881_a(); logic.setEntityName("Zombie"); EntityZombie zombie = new EntityZombie(world); zombie.setChild(true); NBTTagCompound compound = new NBTTagCompound(); zombie.writeEntityToNBT(compound); NBTTagCompound compound2 = new NBTTagCompound(); logic.writeToNBT(compound2); compound2.setTag("SpawnData", compound); logic.readFromNBT(compound2); } This works by modifying the spanners nbt its not as good as what SanAndreasP suggested but it works. Edit: only down side i have found is that it only spawns one mob at a time like that.
-
[1.7.10]Access Transformers not as simple as i thought?
brandon3055 replied to brandon3055's topic in Modder Support
Ok that took some figuring out but i think i figured out what you are talking about (Sorry i know java but i dont know java that well) private static Field recentlyHit; if (recentlyHit == null) { recentlyHit = ReflectionHelper.findField(EntityLivingBase.class, "recentlyHit", "field_70718_bc"); recentlyHit.setAccessible(true); } try { recentlyHit.setInt(mob, 60); } catch (IllegalAccessException e) { LogHelper.error(e); } Is that correct? -
[1.7.10]Access Transformers not as simple as i thought?
brandon3055 replied to brandon3055's topic in Modder Support
What do you by "Correctly" I thought there was only one way to use it.