2015-04-20 21:08:14 +02:00
|
|
|
/*
|
|
|
|
* This file was made by modmuss50. View the licence file to see what licence this is is on. You can always ask me if you would like to use part or all of this file in your project.
|
|
|
|
*/
|
|
|
|
|
2015-04-20 22:02:25 +02:00
|
|
|
package techreborn.partSystem;
|
2015-04-20 21:08:14 +02:00
|
|
|
|
2015-04-20 22:16:29 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2015-04-20 21:08:14 +02:00
|
|
|
import net.minecraft.world.World;
|
2015-11-08 13:15:45 +01:00
|
|
|
import reborncore.common.misc.Location;
|
2015-04-20 21:08:14 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Extend this class to make your multipart
|
|
|
|
*/
|
2015-04-20 22:16:29 +02:00
|
|
|
public abstract class ModPart extends TileEntity implements IModPart {
|
2015-04-20 21:08:14 +02:00
|
|
|
|
2015-08-09 12:05:32 +02:00
|
|
|
/**
|
|
|
|
* The world of the part
|
|
|
|
*/
|
|
|
|
public World world;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The location of the part
|
|
|
|
*/
|
|
|
|
public Location location;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the world
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public World getWorld() {
|
|
|
|
|
|
|
|
return world;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This sets the world Don't use this unless you know what you are doing.
|
|
|
|
*/
|
|
|
|
public void setWorld(World world) {
|
|
|
|
this.world = world;
|
|
|
|
setWorldObj(world);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the x position in the world
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getX() {
|
|
|
|
return location.getX();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the y position in the world
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getY() {
|
|
|
|
return location.getY();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the z position in the world
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getZ() {
|
|
|
|
return location.getZ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the location of the part
|
|
|
|
*/
|
|
|
|
public Location getLocation() {
|
|
|
|
return location;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the x position in the world
|
|
|
|
*/
|
|
|
|
public void setLocation(Location location) {
|
|
|
|
this.location = location;
|
2015-11-23 15:47:50 +01:00
|
|
|
this.getPos().getX() = location.getX();
|
|
|
|
this.getPos().getY() = location.getY();
|
|
|
|
this.getPos().getZ() = location.getZ();
|
2015-08-09 12:05:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public World getWorldObj() {
|
|
|
|
return getWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setWorldObj(World p_145834_1_) {
|
|
|
|
super.setWorldObj(p_145834_1_);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getItemTextureName() {
|
|
|
|
return "";
|
|
|
|
}
|
2015-10-05 18:39:45 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean needsItem() {
|
|
|
|
return true;
|
|
|
|
}
|
2015-04-20 21:08:14 +02:00
|
|
|
}
|