Jump to content

Power API 1.10.2


NoVaGaming

Recommended Posts

Honestly it is not that hard and you could try IC2 though I don't know how easy that will bex and how simple installing/getting the source is.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Yes but the problem is im not that good at coding and i do not know how im sorry i know i need basic java knowlage but i would not know how to update cofh any tutorials on it that i can follow im trying to learn and im just starting and im reaching out for help thank you

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

Updating the RF API is not that hard only some parameters in the methods need to be changed like ForgeDirection to EnumFacing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

In eclipse press ctrl+shift+o i dont know what it is on intelij if you are using that, but it is an auto import shortcut.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Though you should learn a bit of Java before continuing because otherwise you will have a hard time trying to create any generators or machines what ever it is.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

boolean canConnectEnergy(ForgeDirection from);

ForgeDirection is most of the error

 

Funny. You don't say.  Try reading this post again:

 

some parameters in the methods need to be changed like ForgeDirection to EnumFacing

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

Ok so i set everything else but i tryied fixing these 2 and i cant figure it our i didnt want to bother u guys again

package cofh.api.energy;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

/**
* Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own.
* 
* @author King Lemming
* 
*/
public class ItemEnergyContainer extends Item implements IEnergyContainerItem {

protected int capacity;
protected int maxReceive;
protected int maxExtract;

public ItemEnergyContainer() {

}

public ItemEnergyContainer(int capacity) {

	this(capacity, capacity, capacity);
}

public ItemEnergyContainer(int capacity, int maxTransfer) {

	this(capacity, maxTransfer, maxTransfer);
}

public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) {

	this.capacity = capacity;
	this.maxReceive = maxReceive;
	this.maxExtract = maxExtract;
}

public ItemEnergyContainer setCapacity(int capacity) {

	this.capacity = capacity;
	return this;
}

public void setMaxTransfer(int maxTransfer) {

	setMaxReceive(maxTransfer);
	setMaxExtract(maxTransfer);
}

public void setMaxReceive(int maxReceive) {

	this.maxReceive = maxReceive;
}

public void setMaxExtract(int maxExtract) {

	this.maxExtract = maxExtract;
}

/* IEnergyContainerItem */
@Override
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {

	if (container.stackTagCompound == null) {
		container.stackTagCompound = new NBTTagCompound();
	}
	int energy = container.stackTagCompound.getInteger("Energy");
	int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));

	if (!simulate) {
		energy += energyReceived;
		container.stackTagCompound.setInteger("Energy", energy);
	}
	return energyReceived;
}

@Override
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {

	if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
		return 0;
	}
	int energy = container.stackTagCompound.getInteger("Energy");
	int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));

	if (!simulate) {
		energy -= energyExtracted;
		container.stackTagCompound.setInteger("Energy", energy);
	}
	return energyExtracted;
}

@Override
public int getEnergyStored(ItemStack container) {

	if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
		return 0;
	}
	return container.stackTagCompound.getInteger("Energy");
}

@Override
public int getMaxEnergyStored(ItemStack container) {

	return capacity;
}

}

stackTagCompound Is the problem there and

 

@Override
public void writeToNBT(NBTTagCompound nbt) {

	super.writeToNBT(nbt);
	storage.writeToNBT(nbt);
}

Im getting an error at void and i have no idea why

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

ItemStack#stackTagCompound was replaced with a setter & getter. ItemStack#setTagCompound() & ItemStack#getTagCompound respectively.

 

writeToNBT was changed from void to NBTTagCompound, meaning you have to return the compound that was passed to it, altered or not.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

stackTagCompound = someTag is when you use setTagCompound().

Everything else is getTagCompound ().

I thought that would be obvious.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Not Much Im Learning

Thoughbif you plan on making your own piping system learn more Java first otherwise it will be the most painful experience ever.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

		if (container.setTagCompound()  == null) {
		container.setTagCompound()  = new NBTTagCompound();

The method setTagCompound(NBTTagCompound) in the type ItemStack is not applicable for the arguments ()

It kinda tells you exactly what is wrong in the second one(Hint: It's the ()) and the first one is two == not one. When I said stackTagCompound = someTagCompound there was only one.

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

	if (container.setTagCompound()  == null) {
		container.getTagCompound())  = new NBTTagCompound();
	}

Dude im so sorry if im wasting your time. I think i might just try figuring this stuff out by myself after this questions but is this right  :P If not i think i might go slit my wrist and put it in bleach and then call myself an idiot 60000 times

Are You Feeling it now Mr.Krabs?

 

GitHub

https://github.com/nuclearelectricity/Nuclear-Electricity

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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