Jump to content

Recommended Posts

Posted

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.

Posted

For now it will probably be simple storage but Ill add more advance  thing later but the first thing I want it to do is make a generator that creates the coolant and then make the server accept the "air" coolant and register that its cooled

Posted

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.

Posted

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

Posted

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.

Posted

Good until I got to here

"You also wanna check if any blocks have tileentity mathching the server tileentity and if it is call that particular server-tileentity's addCllleant-method and remove that amount from the generator's cooleantAmount" then I got so lost

 

Posted

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;
}

}

Posted

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.

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.