Jump to content

Making a generator


GodOfYeti

Recommended Posts

What, exactly, are you trying to do?

 

Panel 2 is highly appropriate:

width=740 height=225http://imgs.xkcd.com/comics/well_2.png[/img]

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Nah air would be like the energy

 

Do you mean the name of the energy system would be "air"?

If so:

1. This is not a good name, pick something unique.

2. PneumaticCraft has something similar involving pressurized air.

3. Why not just use an existing energy system like RF or EU?

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Link to comment
Share on other sites

No one knows what you want.

 

width=740 height=225http://imgs.xkcd.com/comics/well_2.png[/img]

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Im trying to explain this as much as possible, I want to make a block that creates coolant/energy (how every you want to call it) and then make my block register if it is receiving this coolant/energy and display true or false basicly

 

I think I understand what you want to be able to do. And I will give you the idea how to do it but you have to implement it.

 

First step: create tileentity classes for your cooleant generator and your server and register it. I will assume that you dont want to make the cooleant an item because that is tiny bit more complex.

Second  step: create a variable called  cooleantAmount on both server tileentiy and generator tileentity and create methods getCooleantAmount to both and into the server tileentity you create method addCooleant.

Step three: on your generator tileentity's onUpdate method you want to increase the value of cooleantAmount by how much you want be generated. You also wanna check if any blocks around the generator have tileentities mathching the server tileentity and if it is call that particular server-tileentity's addCooleant-method and remove that amount from the generator's cooleantAmount

Step 4: Check in your server tileentity's onUpdate-method if you have enough cooleant and do it do what it should.

 

It wasnt so hard was it.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Link to comment
Share on other sites

This is what I got so far

 

package com.linumhost.TileEntity;

import com.linumhost.Energy.IEnergyProvider;

import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;

public class TileEntityAirGeneratorBlock extends TileEntity {

protected int cooleantAmount;

public int getAmount(){
	return cooleantAmount;
}

public int extractAmount(int amount){
	int postAmount = cooleantAmount;
	if(cooleantAmount < 0){
		amount = 0;
	}
	int cooleantAmount = postAmount - amount;
	if(cooleantAmount < 0){
		cooleantAmount = 0;
	}
	return cooleantAmount;
}

public void onUpdate(){
	cooleantAmount += 100;
}

}

 

package com.linumhost.TileEntity;

import org.lwjgl.input.Keyboard;

import com.linumhost.Energy.EnergyStorage;
import com.linumhost.Energy.IEnergyHandler;
import com.mcpixelplex.Gui.TestGui;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class TileEntityServerCaseBlock extends TileEntity{

public static boolean isCooled = false;
public static boolean receivingAir = false;

protected int cooleantAmount;
protected int maxCooleantAmount = 10000;

public int getAmount(){
	return cooleantAmount;
}

public int getMaxAmount(){
	return maxCooleantAmount;
}

public int addCooleant(int amount){

	return cooleantAmount += amount;
}

}

Link to comment
Share on other sites

Send me like a pastebin of your code or something in PM and I can help you.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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