Reformatted all the code using the default intelji formatting options.
This commit is contained in:
parent
2f63a24070
commit
e0ab0af822
363 changed files with 20524 additions and 23016 deletions
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
|||
|
||||
public interface ICustomHighlight {
|
||||
|
||||
ArrayList<AxisAlignedBB> getBoxes(World world, int x, int y, int z,
|
||||
EntityPlayer player);
|
||||
ArrayList<AxisAlignedBB> getBoxes(World world, int x, int y, int z,
|
||||
EntityPlayer player);
|
||||
|
||||
}
|
||||
|
|
|
@ -24,95 +24,95 @@ import java.util.List;
|
|||
*/
|
||||
public interface IModPart {
|
||||
|
||||
/**
|
||||
* Adds all of this part's collision boxes to the list. These boxes can
|
||||
* depend on the entity that's colliding with them.
|
||||
*/
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity);
|
||||
/**
|
||||
* Adds all of this part's collision boxes to the list. These boxes can
|
||||
* depend on the entity that's colliding with them.
|
||||
*/
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity);
|
||||
|
||||
/**
|
||||
* Gets this part's selection boxes.
|
||||
*/
|
||||
public List<Vecs3dCube> getSelectionBoxes();
|
||||
/**
|
||||
* Gets this part's selection boxes.
|
||||
*/
|
||||
public List<Vecs3dCube> getSelectionBoxes();
|
||||
|
||||
/**
|
||||
* Gets this part's occlusion boxes.
|
||||
*/
|
||||
public List<Vecs3dCube> getOcclusionBoxes();
|
||||
/**
|
||||
* Gets this part's occlusion boxes.
|
||||
*/
|
||||
public List<Vecs3dCube> getOcclusionBoxes();
|
||||
|
||||
/**
|
||||
* Renders this part dynamically (every render tick).
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vecs3d translation, double delta);
|
||||
/**
|
||||
* Renders this part dynamically (every render tick).
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vecs3d translation, double delta);
|
||||
|
||||
/**
|
||||
* Renders this part statically. A tessellator has alredy started drawing. <br>
|
||||
* Only called when there's a block/lighting/render update in the chunk this
|
||||
* part is in.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean renderStatic(Vecs3d translation, int pass);
|
||||
/**
|
||||
* Renders this part statically. A tessellator has alredy started drawing. <br>
|
||||
* Only called when there's a block/lighting/render update in the chunk this
|
||||
* part is in.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean renderStatic(Vecs3d translation, int pass);
|
||||
|
||||
/**
|
||||
* Writes the part's data to an NBT tag, which is saved with the game data.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound tag);
|
||||
/**
|
||||
* Writes the part's data to an NBT tag, which is saved with the game data.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* Reads the part's data from an NBT tag, which was stored in the game data.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound tag);
|
||||
/**
|
||||
* Reads the part's data from an NBT tag, which was stored in the game data.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* Gets the itemstack that places this part.
|
||||
*/
|
||||
public ItemStack getItem();
|
||||
/**
|
||||
* Gets the itemstack that places this part.
|
||||
*/
|
||||
public ItemStack getItem();
|
||||
|
||||
/**
|
||||
* Gets the name of this part.
|
||||
*/
|
||||
public String getName();
|
||||
/**
|
||||
* Gets the name of this part.
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Gets the world of this part.
|
||||
*/
|
||||
public World getWorld();
|
||||
/**
|
||||
* Gets the world of this part.
|
||||
*/
|
||||
public World getWorld();
|
||||
|
||||
/**
|
||||
* This is the item texture eg: "network:cable"
|
||||
*/
|
||||
public String getItemTextureName();
|
||||
/**
|
||||
* This is the item texture eg: "network:cable"
|
||||
*/
|
||||
public String getItemTextureName();
|
||||
|
||||
/**
|
||||
* Gets the X cord of this part.
|
||||
*/
|
||||
public int getX();
|
||||
/**
|
||||
* Gets the X cord of this part.
|
||||
*/
|
||||
public int getX();
|
||||
|
||||
/**
|
||||
* Gets the Y cord of this part.
|
||||
*/
|
||||
public int getY();
|
||||
/**
|
||||
* Gets the Y cord of this part.
|
||||
*/
|
||||
public int getY();
|
||||
|
||||
/**
|
||||
* Gets the Z cord of this part.
|
||||
*/
|
||||
public int getZ();
|
||||
/**
|
||||
* Gets the Z cord of this part.
|
||||
*/
|
||||
public int getZ();
|
||||
|
||||
/**
|
||||
* Called every tick
|
||||
*/
|
||||
public void tick();
|
||||
/**
|
||||
* Called every tick
|
||||
*/
|
||||
public void tick();
|
||||
|
||||
/**
|
||||
* Called when a block or part has been changed. Can be used for cables to
|
||||
* check nearby blocks
|
||||
*/
|
||||
public void nearByChange();
|
||||
/**
|
||||
* Called when a block or part has been changed. Can be used for cables to
|
||||
* check nearby blocks
|
||||
*/
|
||||
public void nearByChange();
|
||||
|
||||
public void onAdded();
|
||||
public void onAdded();
|
||||
|
||||
public void onRemoved();
|
||||
public void onRemoved();
|
||||
|
||||
public IModPart copy();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
|
||||
public interface IPartDesc {
|
||||
|
||||
public void readDesc(NBTTagCompound tagCompound);
|
||||
public void readDesc(NBTTagCompound tagCompound);
|
||||
|
||||
public void writeDesc(NBTTagCompound tagCompound);
|
||||
public void writeDesc(NBTTagCompound tagCompound);
|
||||
}
|
||||
|
|
|
@ -13,20 +13,20 @@ import techreborn.lib.vecmath.Vecs3dCube;
|
|||
|
||||
public interface IPartProvider {
|
||||
|
||||
public String modID();
|
||||
public String modID();
|
||||
|
||||
public void registerPart();
|
||||
public void registerPart();
|
||||
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube);
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube);
|
||||
|
||||
public boolean hasPart(World world, Location location, String name);
|
||||
public boolean hasPart(World world, Location location, String name);
|
||||
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float hitX, float hitY, float hitZ,
|
||||
ModPart modPart);
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float hitX, float hitY, float hitZ,
|
||||
ModPart modPart);
|
||||
|
||||
public boolean isTileFromProvider(TileEntity tileEntity);
|
||||
public boolean isTileFromProvider(TileEntity tileEntity);
|
||||
|
||||
public IModPart getPartFromWorld(World world, Location location, String name);
|
||||
public IModPart getPartFromWorld(World world, Location location, String name);
|
||||
}
|
||||
|
|
|
@ -13,86 +13,86 @@ import techreborn.lib.Location;
|
|||
*/
|
||||
public abstract class ModPart extends TileEntity implements IModPart {
|
||||
|
||||
/**
|
||||
* The world of the part
|
||||
*/
|
||||
public World world;
|
||||
/**
|
||||
* The world of the part
|
||||
*/
|
||||
public World world;
|
||||
|
||||
/**
|
||||
* The location of the part
|
||||
*/
|
||||
public Location location;
|
||||
/**
|
||||
* The location of the part
|
||||
*/
|
||||
public Location location;
|
||||
|
||||
/**
|
||||
* This is the world
|
||||
*/
|
||||
@Override
|
||||
public World getWorld() {
|
||||
/**
|
||||
* This is the world
|
||||
*/
|
||||
@Override
|
||||
public World getWorld() {
|
||||
|
||||
return world;
|
||||
}
|
||||
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);
|
||||
}
|
||||
/**
|
||||
* 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 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 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 z position in the world
|
||||
*/
|
||||
@Override
|
||||
public int getZ() {
|
||||
return location.getZ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location of the part
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
this.xCoord = location.getX();
|
||||
this.yCoord = location.getY();
|
||||
this.zCoord = location.getZ();
|
||||
}
|
||||
/**
|
||||
* Sets the x position in the world
|
||||
*/
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
this.xCoord = location.getX();
|
||||
this.yCoord = location.getY();
|
||||
this.zCoord = location.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorldObj() {
|
||||
return getWorld();
|
||||
}
|
||||
@Override
|
||||
public World getWorldObj() {
|
||||
return getWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWorldObj(World p_145834_1_) {
|
||||
super.setWorldObj(p_145834_1_);
|
||||
}
|
||||
@Override
|
||||
public void setWorldObj(World p_145834_1_) {
|
||||
super.setWorldObj(p_145834_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,56 +9,53 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.partSystem.parts.CablePart;
|
||||
import uk.co.qmunity.lib.ref.Names;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class ModPartItem extends Item {
|
||||
|
||||
ModPart modPart;
|
||||
ModPart modPart;
|
||||
|
||||
public ModPartItem(ModPart part) {
|
||||
modPart = part;
|
||||
setUnlocalizedName(Names.Unlocalized.Items.MULTIPART);
|
||||
}
|
||||
public ModPartItem(ModPart part) {
|
||||
modPart = part;
|
||||
setUnlocalizedName(Names.Unlocalized.Items.MULTIPART);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int face, float x_, float y_, float z_) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
if (ModPartUtils.hasPart(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, modPart.getName())) {
|
||||
x = x + dir.offsetX;
|
||||
y = y + dir.offsetY;
|
||||
z = z + dir.offsetZ;
|
||||
}
|
||||
if (ModPartUtils.hasPart(world, x, y, z, modPart.getName())) {
|
||||
return false;
|
||||
}
|
||||
if (ModPartRegistry.masterProvider != null) {
|
||||
if (ModPartRegistry.masterProvider.placePart(item, player,
|
||||
world, x, y, z, face, x_, y_, z_, (ModPart) modPart.copy())) {
|
||||
player.swingItem();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, (ModPart) modPart.copy())) {
|
||||
player.swingItem();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int face, float x_, float y_, float z_) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
if (ModPartUtils.hasPart(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, modPart.getName())) {
|
||||
x = x + dir.offsetX;
|
||||
y = y + dir.offsetY;
|
||||
z = z + dir.offsetZ;
|
||||
}
|
||||
if (ModPartUtils.hasPart(world, x, y, z, modPart.getName())) {
|
||||
return false;
|
||||
}
|
||||
if (ModPartRegistry.masterProvider != null) {
|
||||
if (ModPartRegistry.masterProvider.placePart(item, player,
|
||||
world, x, y, z, face, x_, y_, z_, (ModPart) modPart.copy())) {
|
||||
player.swingItem();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, (ModPart) modPart.copy())) {
|
||||
player.swingItem();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return modPart.getName();
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return modPart.getName();
|
||||
}
|
||||
|
||||
public ModPart getModPart() {
|
||||
return modPart;
|
||||
}
|
||||
public ModPart getModPart() {
|
||||
return modPart;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,83 +20,83 @@ import java.util.Map;
|
|||
|
||||
public class ModPartRegistry {
|
||||
|
||||
public static ArrayList<ModPart> parts = new ArrayList<ModPart>();
|
||||
public static ArrayList<ModPart> parts = new ArrayList<ModPart>();
|
||||
|
||||
public static ArrayList<IPartProvider> providers = new ArrayList<IPartProvider>();
|
||||
public static ArrayList<IPartProvider> providers = new ArrayList<IPartProvider>();
|
||||
|
||||
public static IPartProvider masterProvider = null;
|
||||
public static IPartProvider masterProvider = null;
|
||||
|
||||
public static Map<String, Item> itemParts = new HashMap<String, Item>();
|
||||
public static Map<String, Item> itemParts = new HashMap<String, Item>();
|
||||
|
||||
public static void registerPart(ModPart iModPart) {
|
||||
parts.add(iModPart);
|
||||
}
|
||||
public static void registerPart(ModPart iModPart) {
|
||||
parts.add(iModPart);
|
||||
}
|
||||
|
||||
public static void addAllPartsToSystems() {
|
||||
LogHelper.info("Started to load all parts");
|
||||
public static void addAllPartsToSystems() {
|
||||
LogHelper.info("Started to load all parts");
|
||||
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
System.out.println(modPart.getName());
|
||||
Item part = new ModPartItem(modPart)
|
||||
.setUnlocalizedName(modPart.getName())
|
||||
.setCreativeTab(TechRebornCreativeTab.instance)
|
||||
.setTextureName(modPart.getItemTextureName());
|
||||
GameRegistry.registerItem(part, modPart.getName());
|
||||
itemParts.put(modPart.getName(), part);
|
||||
if (modPart instanceof CablePart) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(part), IC2Items.getItem(CablePart.getTextureNameFromType(((CablePart) modPart).type)));
|
||||
((CablePart) modPart).stack = new ItemStack(part);
|
||||
ModParts.stackCable.put(((CablePart) modPart).type, new ItemStack(part));
|
||||
}
|
||||
}
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
System.out.println(modPart.getName());
|
||||
Item part = new ModPartItem(modPart)
|
||||
.setUnlocalizedName(modPart.getName())
|
||||
.setCreativeTab(TechRebornCreativeTab.instance)
|
||||
.setTextureName(modPart.getItemTextureName());
|
||||
GameRegistry.registerItem(part, modPart.getName());
|
||||
itemParts.put(modPart.getName(), part);
|
||||
if (modPart instanceof CablePart) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(part), IC2Items.getItem(CablePart.getTextureNameFromType(((CablePart) modPart).type)));
|
||||
((CablePart) modPart).stack = new ItemStack(part);
|
||||
ModParts.stackCable.put(((CablePart) modPart).type, new ItemStack(part));
|
||||
}
|
||||
}
|
||||
|
||||
for (IPartProvider iPartProvider : providers) {
|
||||
iPartProvider.registerPart();
|
||||
}
|
||||
}
|
||||
for (IPartProvider iPartProvider : providers) {
|
||||
iPartProvider.registerPart();
|
||||
}
|
||||
}
|
||||
|
||||
public static Item getItem(String string) {
|
||||
for (Map.Entry<String, Item> entry : itemParts.entrySet()) {
|
||||
if (entry.getValue().equals(string)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Item getItem(String string) {
|
||||
for (Map.Entry<String, Item> entry : itemParts.entrySet()) {
|
||||
if (entry.getValue().equals(string)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addProvider(String className, String modid) {
|
||||
if (Loader.isModLoaded(modid) || modid.equals("Minecraft")) {
|
||||
try {
|
||||
IPartProvider iPartProvider = null;
|
||||
iPartProvider = (IPartProvider) Class.forName(className)
|
||||
.newInstance();
|
||||
providers.add(iPartProvider);
|
||||
//I am doing this because the qlibProvider is the most stable
|
||||
if (modid.equals("qmunitylib")) {
|
||||
masterProvider = iPartProvider;
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void addProvider(String className, String modid) {
|
||||
if (Loader.isModLoaded(modid) || modid.equals("Minecraft")) {
|
||||
try {
|
||||
IPartProvider iPartProvider = null;
|
||||
iPartProvider = (IPartProvider) Class.forName(className)
|
||||
.newInstance();
|
||||
providers.add(iPartProvider);
|
||||
//I am doing this because the qlibProvider is the most stable
|
||||
if (modid.equals("qmunitylib")) {
|
||||
masterProvider = iPartProvider;
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
LogHelper.error("Failed to load " + className
|
||||
+ " to the part system!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only use this one if it is a standalone Provider
|
||||
public static void addProvider(IPartProvider iPartProvider) {
|
||||
if (Loader.isModLoaded(iPartProvider.modID())
|
||||
|| iPartProvider.modID().equals("Minecraft")) {
|
||||
providers.add(iPartProvider);
|
||||
}
|
||||
}
|
||||
// Only use this one if it is a standalone Provider
|
||||
public static void addProvider(IPartProvider iPartProvider) {
|
||||
if (Loader.isModLoaded(iPartProvider.modID())
|
||||
|| iPartProvider.modID().equals("Minecraft")) {
|
||||
providers.add(iPartProvider);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,82 +13,82 @@ import java.util.Map;
|
|||
|
||||
public class ModPartUtils {
|
||||
|
||||
public static boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
IPartProvider partProvider = getPartProvider(world, location);
|
||||
if (partProvider != null) {
|
||||
return partProvider.checkOcclusion(world, location, cube);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
IPartProvider partProvider = getPartProvider(world, location);
|
||||
if (partProvider != null) {
|
||||
return partProvider.checkOcclusion(world, location, cube);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkOcclusion(World world, int x, int y, int z, Vecs3dCube cube) {
|
||||
return !checkOcclusion(world, new Location(x, y, z), cube);
|
||||
}
|
||||
public static boolean checkOcclusion(World world, int x, int y, int z, Vecs3dCube cube) {
|
||||
return !checkOcclusion(world, new Location(x, y, z), cube);
|
||||
}
|
||||
|
||||
public static boolean checkOcclusionInvert(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
for (IPartProvider iPartProvider : ModPartRegistry.providers) {
|
||||
if (!iPartProvider.checkOcclusion(world, location, cube)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean checkOcclusionInvert(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
if (world == null) {
|
||||
return false;
|
||||
}
|
||||
for (IPartProvider iPartProvider : ModPartRegistry.providers) {
|
||||
if (!iPartProvider.checkOcclusion(world, location, cube)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkOcclusionInvert(World world, int x, int y,
|
||||
int z, Vecs3dCube cube) {
|
||||
return checkOcclusionInvert(world, new Location(x, y, z), cube);
|
||||
}
|
||||
public static boolean checkOcclusionInvert(World world, int x, int y,
|
||||
int z, Vecs3dCube cube) {
|
||||
return checkOcclusionInvert(world, new Location(x, y, z), cube);
|
||||
}
|
||||
|
||||
public static boolean hasPart(World world, Location location, String name) {
|
||||
for (IPartProvider iPartProvider : ModPartRegistry.providers) {
|
||||
if (iPartProvider.hasPart(world, location, name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean hasPart(World world, Location location, String name) {
|
||||
for (IPartProvider iPartProvider : ModPartRegistry.providers) {
|
||||
if (iPartProvider.hasPart(world, location, name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasPart(World world, int x, int y, int z, String name) {
|
||||
return hasPart(world, new Location(x, y, z), name);
|
||||
}
|
||||
public static boolean hasPart(World world, int x, int y, int z, String name) {
|
||||
return hasPart(world, new Location(x, y, z), name);
|
||||
}
|
||||
|
||||
public static Item getItemForPart(String string) {
|
||||
for (Map.Entry<String, Item> item : ModPartRegistry.itemParts
|
||||
.entrySet()) {
|
||||
if (item.getValue().equals(string)) {
|
||||
return item.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Item getItemForPart(String string) {
|
||||
for (Map.Entry<String, Item> item : ModPartRegistry.itemParts
|
||||
.entrySet()) {
|
||||
if (item.getValue().equals(string)) {
|
||||
return item.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IPartProvider getPartProvider(World world, Location location) {
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
if (partProvider.isTileFromProvider(world.getTileEntity(
|
||||
location.getX(), location.getY(), location.getZ()))) {
|
||||
return partProvider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static IPartProvider getPartProvider(World world, Location location) {
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
if (partProvider.isTileFromProvider(world.getTileEntity(
|
||||
location.getX(), location.getY(), location.getZ()))) {
|
||||
return partProvider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
IModPart tempPart = null;
|
||||
tempPart = partProvider.getPartFromWorld(world, location, name);
|
||||
if (tempPart != null) {
|
||||
return tempPart;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
for (IPartProvider partProvider : ModPartRegistry.providers) {
|
||||
IModPart tempPart = null;
|
||||
tempPart = partProvider.getPartFromWorld(world, location, name);
|
||||
if (tempPart != null) {
|
||||
return tempPart;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,38 +17,38 @@ import java.util.List;
|
|||
*/
|
||||
public class ModLib2QLib {
|
||||
|
||||
public static Vec3d convert(Vecs3d input) {
|
||||
return new Vec3d(input.getX(), input.getY(), input.getZ());
|
||||
}
|
||||
public static Vec3d convert(Vecs3d input) {
|
||||
return new Vec3d(input.getX(), input.getY(), input.getZ());
|
||||
}
|
||||
|
||||
public static Vec3dCube convert(Vecs3dCube input) {
|
||||
return new Vec3dCube(input.toAABB());
|
||||
}
|
||||
public static Vec3dCube convert(Vecs3dCube input) {
|
||||
return new Vec3dCube(input.toAABB());
|
||||
}
|
||||
|
||||
public static Vecs3d convert(Vec3d input) {
|
||||
return new Vecs3d(input.getX(), input.getY(), input.getZ());
|
||||
}
|
||||
public static Vecs3d convert(Vec3d input) {
|
||||
return new Vecs3d(input.getX(), input.getY(), input.getZ());
|
||||
}
|
||||
|
||||
public static Vecs3dCube convert(Vec3dCube input) {
|
||||
return new Vecs3dCube(input.toAABB());
|
||||
}
|
||||
public static Vecs3dCube convert(Vec3dCube input) {
|
||||
return new Vecs3dCube(input.toAABB());
|
||||
}
|
||||
|
||||
public static List<Vecs3dCube> convert(List<Vec3dCube> input) {
|
||||
List<Vecs3dCube> list = new ArrayList<Vecs3dCube>();
|
||||
for (Vec3dCube cube : input) {
|
||||
list.add(new Vecs3dCube(cube.toAABB()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public static List<Vecs3dCube> convert(List<Vec3dCube> input) {
|
||||
List<Vecs3dCube> list = new ArrayList<Vecs3dCube>();
|
||||
for (Vec3dCube cube : input) {
|
||||
list.add(new Vecs3dCube(cube.toAABB()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// Its got to be called becuase of some weird thing see:
|
||||
// https://stackoverflow.com/questions/1998544/method-has-the-same-erasure-as-another-method-in-type
|
||||
public static List<Vec3dCube> convert2(List<Vecs3dCube> input) {
|
||||
List<Vec3dCube> list = new ArrayList<Vec3dCube>();
|
||||
for (Vecs3dCube cube : input) {
|
||||
list.add(new Vec3dCube(cube.toAABB()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
// Its got to be called becuase of some weird thing see:
|
||||
// https://stackoverflow.com/questions/1998544/method-has-the-same-erasure-as-another-method-in-type
|
||||
public static List<Vec3dCube> convert2(List<Vecs3dCube> input) {
|
||||
List<Vec3dCube> list = new ArrayList<Vec3dCube>();
|
||||
for (Vecs3dCube cube : input) {
|
||||
list.add(new Vec3dCube(cube.toAABB()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,14 +13,7 @@ import techreborn.lib.vecmath.Vecs3d;
|
|||
import techreborn.lib.vecmath.Vecs3dCube;
|
||||
import techreborn.partSystem.ModPart;
|
||||
import uk.co.qmunity.lib.client.render.RenderHelper;
|
||||
import uk.co.qmunity.lib.part.IPart;
|
||||
import uk.co.qmunity.lib.part.IPartCollidable;
|
||||
import uk.co.qmunity.lib.part.IPartRenderPlacement;
|
||||
import uk.co.qmunity.lib.part.IPartSelectable;
|
||||
import uk.co.qmunity.lib.part.IPartTicking;
|
||||
import uk.co.qmunity.lib.part.IPartUpdateListener;
|
||||
import uk.co.qmunity.lib.part.ITilePartHolder;
|
||||
import uk.co.qmunity.lib.part.PartBase;
|
||||
import uk.co.qmunity.lib.part.*;
|
||||
import uk.co.qmunity.lib.raytrace.QMovingObjectPosition;
|
||||
import uk.co.qmunity.lib.raytrace.RayTracer;
|
||||
import uk.co.qmunity.lib.vec.Vec3d;
|
||||
|
@ -31,126 +24,126 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class QModPart extends PartBase implements IPartCollidable,
|
||||
IPartSelectable, IPartRenderPlacement, IPartTicking,
|
||||
IPartUpdateListener {
|
||||
IPartSelectable, IPartRenderPlacement, IPartTicking,
|
||||
IPartUpdateListener {
|
||||
|
||||
ModPart iModPart;
|
||||
ModPart iModPart;
|
||||
|
||||
public QModPart(ModPart iModPart) {
|
||||
this.iModPart = iModPart;
|
||||
public QModPart(ModPart iModPart) {
|
||||
this.iModPart = iModPart;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(ITilePartHolder parent) {
|
||||
super.setParent(parent);
|
||||
}
|
||||
@Override
|
||||
public void setParent(ITilePartHolder parent) {
|
||||
super.setParent(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return iModPart.getName();
|
||||
}
|
||||
@Override
|
||||
public String getType() {
|
||||
return iModPart.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return iModPart.getItem();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return iModPart.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vec3dCube> boxes, Entity entity) {
|
||||
List<Vecs3dCube> cubes = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(cubes, entity);
|
||||
for (Vecs3dCube cube : cubes) {
|
||||
if (cube != null)
|
||||
boxes.add(ModLib2QLib.convert(cube));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vec3dCube> boxes, Entity entity) {
|
||||
List<Vecs3dCube> cubes = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(cubes, entity);
|
||||
for (Vecs3dCube cube : cubes) {
|
||||
if (cube != null)
|
||||
boxes.add(ModLib2QLib.convert(cube));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamic(Vec3d translation, double delta, int pass) {
|
||||
iModPart.renderDynamic(ModLib2QLib.convert(translation), delta);
|
||||
}
|
||||
@Override
|
||||
public void renderDynamic(Vec3d translation, double delta, int pass) {
|
||||
iModPart.renderDynamic(ModLib2QLib.convert(translation), delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
|
||||
return iModPart.renderStatic(new Vecs3d(translation.getX(), translation.getY(), translation.getZ()), pass);
|
||||
}
|
||||
@Override
|
||||
public boolean renderStatic(Vec3i translation, RenderHelper renderer, RenderBlocks renderBlocks, int pass) {
|
||||
return iModPart.renderStatic(new Vecs3d(translation.getX(), translation.getY(), translation.getZ()), pass);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QMovingObjectPosition rayTrace(Vec3d start, Vec3d end) {
|
||||
return RayTracer.instance().rayTraceCubes(this, start, end);
|
||||
}
|
||||
@Override
|
||||
public QMovingObjectPosition rayTrace(Vec3d start, Vec3d end) {
|
||||
return RayTracer.instance().rayTraceCubes(this, start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vec3dCube> getSelectionBoxes() {
|
||||
return ModLib2QLib.convert2(iModPart.getSelectionBoxes());
|
||||
}
|
||||
@Override
|
||||
public List<Vec3dCube> getSelectionBoxes() {
|
||||
return ModLib2QLib.convert2(iModPart.getSelectionBoxes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return getParent().getWorld();
|
||||
}
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return getParent().getWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.tick();
|
||||
}
|
||||
@Override
|
||||
public void update() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPartChanged(IPart part) {
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onPartChanged(IPart part) {
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange() {
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onNeighborBlockChange() {
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborTileChange() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onNeighborTileChange() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
iModPart.onAdded();
|
||||
}
|
||||
@Override
|
||||
public void onAdded() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
iModPart.onAdded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
iModPart.onRemoved();
|
||||
}
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
iModPart.onRemoved();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(getWorld());
|
||||
iModPart.setLocation(new Location(getX(), getY(), getZ()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnloaded() {
|
||||
@Override
|
||||
public void onUnloaded() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConverted() {
|
||||
@Override
|
||||
public void onConverted() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import techreborn.partSystem.IModPart;
|
|||
import techreborn.partSystem.IPartProvider;
|
||||
import techreborn.partSystem.ModPart;
|
||||
import techreborn.partSystem.ModPartRegistry;
|
||||
import techreborn.partSystem.parts.CablePart;
|
||||
import uk.co.qmunity.lib.QLModInfo;
|
||||
import uk.co.qmunity.lib.part.IPart;
|
||||
import uk.co.qmunity.lib.part.IPartFactory;
|
||||
|
@ -27,89 +26,87 @@ import uk.co.qmunity.lib.tile.TileMultipart;
|
|||
import uk.co.qmunity.lib.vec.Vec3dCube;
|
||||
import uk.co.qmunity.lib.vec.Vec3i;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class QModPartFactory implements IPartFactory, IPartProvider {
|
||||
@Override
|
||||
public IPart createPart(String type, boolean client) {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
if (modPart.getName().equals(type)) {
|
||||
return new QModPart((ModPart) modPart.copy());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IPart createPart(String type, boolean client) {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
if (modPart.getName().equals(type)) {
|
||||
return new QModPart((ModPart) modPart.copy());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int face, float x_, float y_, float z_,
|
||||
ModPart modPart) {
|
||||
IPart part = createPart(
|
||||
item,
|
||||
player,
|
||||
world,
|
||||
new MovingObjectPosition(x, y, z, face, Vec3
|
||||
.createVectorHelper(x + x_, y + y_, z + z_)), modPart);
|
||||
@Override
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int face, float x_, float y_, float z_,
|
||||
ModPart modPart) {
|
||||
IPart part = createPart(
|
||||
item,
|
||||
player,
|
||||
world,
|
||||
new MovingObjectPosition(x, y, z, face, Vec3
|
||||
.createVectorHelper(x + x_, y + y_, z + z_)), modPart);
|
||||
|
||||
if (part == null)
|
||||
return false;
|
||||
if (part == null)
|
||||
return false;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
return MultipartCompatibility.placePartInWorld(part, world, new Vec3i(
|
||||
x, y, z), dir, player, item);
|
||||
}
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
return MultipartCompatibility.placePartInWorld(part, world, new Vec3i(
|
||||
x, y, z), dir, player, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTileFromProvider(TileEntity tileEntity) {
|
||||
return tileEntity instanceof TileMultipart;
|
||||
}
|
||||
@Override
|
||||
public boolean isTileFromProvider(TileEntity tileEntity) {
|
||||
return tileEntity instanceof TileMultipart;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
IPart part = MultipartCompatibility.getPart(world, location.getX(), location.getY(), location.getZ(), name);
|
||||
if (part != null) {
|
||||
if (part instanceof QModPart) {
|
||||
return ((QModPart) part).iModPart;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
IPart part = MultipartCompatibility.getPart(world, location.getX(), location.getY(), location.getZ(), name);
|
||||
if (part != null) {
|
||||
if (part instanceof QModPart) {
|
||||
return ((QModPart) part).iModPart;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCreatedPartType(ItemStack item, EntityPlayer player,
|
||||
World world, MovingObjectPosition mop, ModPart modPart) {
|
||||
return modPart.getName();
|
||||
}
|
||||
public String getCreatedPartType(ItemStack item, EntityPlayer player,
|
||||
World world, MovingObjectPosition mop, ModPart modPart) {
|
||||
return modPart.getName();
|
||||
}
|
||||
|
||||
public IPart createPart(ItemStack item, EntityPlayer player, World world,
|
||||
MovingObjectPosition mop, ModPart modPart) {
|
||||
public IPart createPart(ItemStack item, EntityPlayer player, World world,
|
||||
MovingObjectPosition mop, ModPart modPart) {
|
||||
|
||||
return PartRegistry.createPart(
|
||||
getCreatedPartType(item, player, world, mop, modPart),
|
||||
world.isRemote);
|
||||
}
|
||||
return PartRegistry.createPart(
|
||||
getCreatedPartType(item, player, world, mop, modPart),
|
||||
world.isRemote);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modID() {
|
||||
return QLModInfo.MODID;
|
||||
}
|
||||
@Override
|
||||
public String modID() {
|
||||
return QLModInfo.MODID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPart() {
|
||||
PartRegistry.registerFactory(new QModPartFactory());
|
||||
}
|
||||
@Override
|
||||
public void registerPart() {
|
||||
PartRegistry.registerFactory(new QModPartFactory());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
return MultipartCompatibility.checkOcclusion(world, location.x,
|
||||
location.y, location.z, new Vec3dCube(cube.toAABB()));
|
||||
}
|
||||
@Override
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
return MultipartCompatibility.checkOcclusion(world, location.x,
|
||||
location.y, location.z, new Vec3dCube(cube.toAABB()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPart(World world, Location location, String name) {
|
||||
if (MultipartCompatibility.getPartHolder(world, location.getX(), location.getY(), location.getZ()) == null) {
|
||||
return false;
|
||||
}
|
||||
return MultipartCompatibility.getPart(world, location.getX(), location.getY(), location.getZ(), name) == null;
|
||||
}
|
||||
@Override
|
||||
public boolean hasPart(World world, Location location, String name) {
|
||||
if (MultipartCompatibility.getPartHolder(world, location.getX(), location.getY(), location.getZ()) == null) {
|
||||
return false;
|
||||
}
|
||||
return MultipartCompatibility.getPart(world, location.getX(), location.getY(), location.getZ(), name) == null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,113 +29,113 @@ import techreborn.partSystem.ModPartItem;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class PartPlacementRenderer {
|
||||
|
||||
private Framebuffer fb = null;
|
||||
private int width = 0, height = 0;
|
||||
private Framebuffer fb = null;
|
||||
private int width = 0, height = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderTick(RenderWorldLastEvent event) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
ItemStack item = player.getCurrentEquippedItem();
|
||||
if (item == null)
|
||||
return;
|
||||
if (!(item.getItem() instanceof ModPartItem))
|
||||
return;
|
||||
if (Minecraft.getMinecraft().gameSettings.hideGUI
|
||||
&& Minecraft.getMinecraft().currentScreen == null)
|
||||
return;
|
||||
MovingObjectPosition mop = player.rayTrace(
|
||||
player.capabilities.isCreativeMode ? 5 : 4, 0);
|
||||
if (mop == null
|
||||
|| mop.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
return;
|
||||
IModPart part = ((ModPartItem) item.getItem()).getModPart();
|
||||
if (part == null)
|
||||
return;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(mop.sideHit);
|
||||
Location location = new Location(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (fb == null || width != Minecraft.getMinecraft().displayWidth
|
||||
|| height != Minecraft.getMinecraft().displayHeight) {
|
||||
width = Minecraft.getMinecraft().displayWidth;
|
||||
height = Minecraft.getMinecraft().displayHeight;
|
||||
fb = new Framebuffer(width, height, true);
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onRenderTick(RenderWorldLastEvent event) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
ItemStack item = player.getCurrentEquippedItem();
|
||||
if (item == null)
|
||||
return;
|
||||
if (!(item.getItem() instanceof ModPartItem))
|
||||
return;
|
||||
if (Minecraft.getMinecraft().gameSettings.hideGUI
|
||||
&& Minecraft.getMinecraft().currentScreen == null)
|
||||
return;
|
||||
MovingObjectPosition mop = player.rayTrace(
|
||||
player.capabilities.isCreativeMode ? 5 : 4, 0);
|
||||
if (mop == null
|
||||
|| mop.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
return;
|
||||
IModPart part = ((ModPartItem) item.getItem()).getModPart();
|
||||
if (part == null)
|
||||
return;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(mop.sideHit);
|
||||
Location location = new Location(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (fb == null || width != Minecraft.getMinecraft().displayWidth
|
||||
|| height != Minecraft.getMinecraft().displayHeight) {
|
||||
width = Minecraft.getMinecraft().displayWidth;
|
||||
height = Minecraft.getMinecraft().displayHeight;
|
||||
fb = new Framebuffer(width, height, true);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Minecraft.getMinecraft().getFramebuffer().unbindFramebuffer();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
GL11.glLoadIdentity();
|
||||
fb.bindFramebuffer(true);
|
||||
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT
|
||||
| GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glClearColor(0, 0, 0, 0);
|
||||
net.minecraft.client.renderer.RenderHelper
|
||||
.enableStandardItemLighting();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Vec3 playerPos = player.getPosition(event.partialTicks);
|
||||
double x = location.getX() - playerPos.xCoord
|
||||
+ faceHit.offsetX;
|
||||
double y = location.getY() - playerPos.yCoord
|
||||
+ faceHit.offsetY;
|
||||
double z = location.getZ() - playerPos.zCoord
|
||||
+ faceHit.offsetZ;
|
||||
GL11.glRotated(player.rotationPitch, 1, 0, 0);
|
||||
GL11.glRotated(player.rotationYaw - 180, 0, 1, 0);
|
||||
GL11.glTranslated(x, y, z);
|
||||
part.renderDynamic(new Vecs3d(0, 0, 0), event.partialTicks);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
net.minecraft.client.renderer.RenderHelper
|
||||
.disableStandardItemLighting();
|
||||
fb.unbindFramebuffer();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(true);
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc,
|
||||
mc.displayWidth, mc.displayHeight);
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0, scaledresolution.getScaledWidth_double(),
|
||||
scaledresolution.getScaledHeight_double(), 0, 0.1,
|
||||
10000D);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
|
||||
fb.bindFramebufferTexture();
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int w = scaledresolution.getScaledWidth();
|
||||
int h = scaledresolution.getScaledHeight();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Minecraft.getMinecraft().getFramebuffer().unbindFramebuffer();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
GL11.glLoadIdentity();
|
||||
fb.bindFramebuffer(true);
|
||||
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT
|
||||
| GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glClearColor(0, 0, 0, 0);
|
||||
net.minecraft.client.renderer.RenderHelper
|
||||
.enableStandardItemLighting();
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Vec3 playerPos = player.getPosition(event.partialTicks);
|
||||
double x = location.getX() - playerPos.xCoord
|
||||
+ faceHit.offsetX;
|
||||
double y = location.getY() - playerPos.yCoord
|
||||
+ faceHit.offsetY;
|
||||
double z = location.getZ() - playerPos.zCoord
|
||||
+ faceHit.offsetZ;
|
||||
GL11.glRotated(player.rotationPitch, 1, 0, 0);
|
||||
GL11.glRotated(player.rotationYaw - 180, 0, 1, 0);
|
||||
GL11.glTranslated(x, y, z);
|
||||
part.renderDynamic(new Vecs3d(0, 0, 0), event.partialTicks);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
net.minecraft.client.renderer.RenderHelper
|
||||
.disableStandardItemLighting();
|
||||
fb.unbindFramebuffer();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(true);
|
||||
GL11.glPushMatrix();
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc,
|
||||
mc.displayWidth, mc.displayHeight);
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0, scaledresolution.getScaledWidth_double(),
|
||||
scaledresolution.getScaledHeight_double(), 0, 0.1,
|
||||
10000D);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
|
||||
fb.bindFramebufferTexture();
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int w = scaledresolution.getScaledWidth();
|
||||
int h = scaledresolution.getScaledHeight();
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(1, 1, 1, 0.5F);
|
||||
tessellator.addVertexWithUV(w, h, 0.0D, 1.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(w, 0, 0.0D, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(0, 0, 0.0D, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(0, h, 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
fb.unbindFramebufferTexture();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
fb.framebufferClear();
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(true);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(1, 1, 1, 0.5F);
|
||||
tessellator.addVertexWithUV(w, h, 0.0D, 1.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(w, 0, 0.0D, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(0, 0, 0.0D, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(0, h, 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
fb.unbindFramebufferTexture();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
fb.framebufferClear();
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(true);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,86 +20,84 @@ import techreborn.partSystem.IModPart;
|
|||
import techreborn.partSystem.IPartProvider;
|
||||
import techreborn.partSystem.ModPart;
|
||||
import techreborn.partSystem.ModPartRegistry;
|
||||
import techreborn.partSystem.parts.CablePart;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by mark on 09/12/14.
|
||||
*/
|
||||
public class FMPFactory implements MultiPartRegistry.IPartFactory,
|
||||
IPartProvider {
|
||||
@Override
|
||||
public TMultiPart createPart(String type, boolean client) {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
if (modPart.getName().equals(type)) {
|
||||
return new FMPModPart((ModPart) modPart.copy());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
IPartProvider {
|
||||
@Override
|
||||
public TMultiPart createPart(String type, boolean client) {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
if (modPart.getName().equals(type)) {
|
||||
return new FMPModPart((ModPart) modPart.copy());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float hitX, float hitY, float hitZ,
|
||||
ModPart modPart) {
|
||||
return new FakeFMPPlacerItem(modPart).onItemUse(item, player, world, x,
|
||||
y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
public boolean placePart(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float hitX, float hitY, float hitZ,
|
||||
ModPart modPart) {
|
||||
return new FakeFMPPlacerItem(modPart).onItemUse(item, player, world, x,
|
||||
y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTileFromProvider(TileEntity tileEntity) {
|
||||
return tileEntity instanceof TileMultipart;
|
||||
}
|
||||
@Override
|
||||
public boolean isTileFromProvider(TileEntity tileEntity) {
|
||||
return tileEntity instanceof TileMultipart;
|
||||
}
|
||||
|
||||
//TODO
|
||||
@Override
|
||||
public IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
return null;
|
||||
}
|
||||
//TODO
|
||||
@Override
|
||||
public IModPart getPartFromWorld(World world, Location location, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modID() {
|
||||
return "ForgeMultipart";
|
||||
}
|
||||
@Override
|
||||
public String modID() {
|
||||
return "ForgeMultipart";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPart() {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
MultiPartRegistry.registerParts(new FMPFactory(), new String[]
|
||||
{modPart.getName()});
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void registerPart() {
|
||||
for (ModPart modPart : ModPartRegistry.parts) {
|
||||
MultiPartRegistry.registerParts(new FMPFactory(), new String[]
|
||||
{modPart.getName()});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
codechicken.multipart.TileMultipart tmp = codechicken.multipart.TileMultipart
|
||||
.getOrConvertTile(world, new BlockCoord(location.getX(),
|
||||
location.getY(), location.getZ()));
|
||||
if (tmp == null)
|
||||
return false;
|
||||
return !tmp.occlusionTest(tmp.partList(), new NormallyOccludedPart(
|
||||
new Cuboid6(cube.toAABB())));
|
||||
}
|
||||
@Override
|
||||
public boolean checkOcclusion(World world, Location location,
|
||||
Vecs3dCube cube) {
|
||||
codechicken.multipart.TileMultipart tmp = codechicken.multipart.TileMultipart
|
||||
.getOrConvertTile(world, new BlockCoord(location.getX(),
|
||||
location.getY(), location.getZ()));
|
||||
if (tmp == null)
|
||||
return false;
|
||||
return !tmp.occlusionTest(tmp.partList(), new NormallyOccludedPart(
|
||||
new Cuboid6(cube.toAABB())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPart(World world, Location location, String name) {
|
||||
TileEntity tileEntity = world.getTileEntity(location.getX(),
|
||||
location.getY(), location.getZ());
|
||||
if (tileEntity instanceof TileMultipart) {
|
||||
TileMultipart mp = (TileMultipart) tileEntity;
|
||||
boolean ret = false;
|
||||
List<TMultiPart> t = mp.jPartList();
|
||||
for (TMultiPart p : t) {
|
||||
if (ret == false) {
|
||||
if (p.getType().equals(name)) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hasPart(World world, Location location, String name) {
|
||||
TileEntity tileEntity = world.getTileEntity(location.getX(),
|
||||
location.getY(), location.getZ());
|
||||
if (tileEntity instanceof TileMultipart) {
|
||||
TileMultipart mp = (TileMultipart) tileEntity;
|
||||
boolean ret = false;
|
||||
List<TMultiPart> t = mp.jPartList();
|
||||
for (TMultiPart p : t) {
|
||||
if (ret == false) {
|
||||
if (p.getType().equals(name)) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,198 +32,198 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class FMPModPart extends TMultiPart implements TSlottedPart,
|
||||
JNormalOcclusion, ISidedHollowConnect {
|
||||
JNormalOcclusion, ISidedHollowConnect {
|
||||
|
||||
ModPart iModPart;
|
||||
ModPart iModPart;
|
||||
|
||||
public FMPModPart(ModPart iModPart) {
|
||||
this.iModPart = iModPart;
|
||||
public FMPModPart(ModPart iModPart) {
|
||||
this.iModPart = iModPart;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHollowSize(int i) {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int getHollowSize(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Cuboid6> getOcclusionBoxes() {
|
||||
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
|
||||
for (Vecs3dCube c : iModPart.getOcclusionBoxes())
|
||||
cubes.add(new Cuboid6(c.toAABB()));
|
||||
return cubes;
|
||||
}
|
||||
@Override
|
||||
public Iterable<Cuboid6> getOcclusionBoxes() {
|
||||
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
|
||||
for (Vecs3dCube c : iModPart.getOcclusionBoxes())
|
||||
cubes.add(new Cuboid6(c.toAABB()));
|
||||
return cubes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean occlusionTest(TMultiPart npart) {
|
||||
return NormalOcclusionTest.apply(this, npart);
|
||||
}
|
||||
@Override
|
||||
public boolean occlusionTest(TMultiPart npart) {
|
||||
return NormalOcclusionTest.apply(this, npart);
|
||||
}
|
||||
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> l,
|
||||
AxisAlignedBB bounds, Entity entity) {
|
||||
List<Vecs3dCube> boxes = new ArrayList<Vecs3dCube>();
|
||||
List<Vecs3dCube> boxes_ = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(boxes_, entity);
|
||||
for (Vecs3dCube c : boxes_) {
|
||||
Vecs3dCube cube = c.clone();
|
||||
cube.add(getX(), getY(), getZ());
|
||||
boxes.add(cube);
|
||||
}
|
||||
boxes_.clear();
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> l,
|
||||
AxisAlignedBB bounds, Entity entity) {
|
||||
List<Vecs3dCube> boxes = new ArrayList<Vecs3dCube>();
|
||||
List<Vecs3dCube> boxes_ = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(boxes_, entity);
|
||||
for (Vecs3dCube c : boxes_) {
|
||||
Vecs3dCube cube = c.clone();
|
||||
cube.add(getX(), getY(), getZ());
|
||||
boxes.add(cube);
|
||||
}
|
||||
boxes_.clear();
|
||||
|
||||
for (Vecs3dCube c : boxes) {
|
||||
if (c.toAABB().intersectsWith(bounds))
|
||||
l.add(c);
|
||||
}
|
||||
}
|
||||
for (Vecs3dCube c : boxes) {
|
||||
if (c.toAABB().intersectsWith(bounds))
|
||||
l.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Cuboid6> getCollisionBoxes() {
|
||||
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
|
||||
List<Vecs3dCube> boxes = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(boxes, null);
|
||||
for (Vecs3dCube c : boxes) {
|
||||
if (c != null)
|
||||
cubes.add(new Cuboid6(c.toAABB()));
|
||||
}
|
||||
@Override
|
||||
public Iterable<Cuboid6> getCollisionBoxes() {
|
||||
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
|
||||
List<Vecs3dCube> boxes = new ArrayList<Vecs3dCube>();
|
||||
iModPart.addCollisionBoxesToList(boxes, null);
|
||||
for (Vecs3dCube c : boxes) {
|
||||
if (c != null)
|
||||
cubes.add(new Cuboid6(c.toAABB()));
|
||||
}
|
||||
|
||||
return cubes;
|
||||
}
|
||||
return cubes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<IndexedCuboid6> getSubParts() {
|
||||
List<IndexedCuboid6> cubes = new ArrayList<IndexedCuboid6>();
|
||||
if (iModPart.getSelectionBoxes() != null) {
|
||||
for (Vecs3dCube c : iModPart.getSelectionBoxes())
|
||||
if (c != null)
|
||||
cubes.add(new IndexedCuboid6(0, new Cuboid6(c.toAABB())));
|
||||
@Override
|
||||
public Iterable<IndexedCuboid6> getSubParts() {
|
||||
List<IndexedCuboid6> cubes = new ArrayList<IndexedCuboid6>();
|
||||
if (iModPart.getSelectionBoxes() != null) {
|
||||
for (Vecs3dCube c : iModPart.getSelectionBoxes())
|
||||
if (c != null)
|
||||
cubes.add(new IndexedCuboid6(0, new Cuboid6(c.toAABB())));
|
||||
|
||||
if (cubes.size() == 0)
|
||||
cubes.add(new IndexedCuboid6(0, new Cuboid6(0, 0, 0, 1, 1, 1)));
|
||||
if (cubes.size() == 0)
|
||||
cubes.add(new IndexedCuboid6(0, new Cuboid6(0, 0, 0, 1, 1, 1)));
|
||||
|
||||
}
|
||||
return cubes;
|
||||
}
|
||||
}
|
||||
return cubes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float frame, int pass) {
|
||||
iModPart.renderDynamic(new Vecs3d(pos.x, pos.y, pos.z), frame);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float frame, int pass) {
|
||||
iModPart.renderDynamic(new Vecs3d(pos.x, pos.y, pos.z), frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return iModPart.getName();
|
||||
}
|
||||
@Override
|
||||
public String getType() {
|
||||
return iModPart.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotMask() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int getSlotMask() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return world();
|
||||
}
|
||||
public World getWorld() {
|
||||
return world();
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return x();
|
||||
}
|
||||
public int getX() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return x();
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return y();
|
||||
}
|
||||
public int getY() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return y();
|
||||
}
|
||||
|
||||
public int getZ() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return z();
|
||||
}
|
||||
public int getZ() {
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
return z();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
iModPart.nearByChange();
|
||||
iModPart.onAdded();
|
||||
}
|
||||
@Override
|
||||
public void onAdded() {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
iModPart.nearByChange();
|
||||
iModPart.onAdded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (iModPart.location != null) {
|
||||
iModPart.tick();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void update() {
|
||||
if (iModPart.location != null) {
|
||||
iModPart.tick();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged() {
|
||||
super.onNeighborChanged();
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onNeighborChanged() {
|
||||
super.onNeighborChanged();
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
public void onRemoved() {
|
||||
iModPart.onRemoved();
|
||||
super.onRemoved();
|
||||
public void onRemoved() {
|
||||
iModPart.onRemoved();
|
||||
super.onRemoved();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStatic(Vector3 pos, int pass) {
|
||||
boolean render;
|
||||
render = iModPart.renderStatic(new Vecs3d((int) pos.x, (int) pos.y, (int) pos.z), pass);
|
||||
return render;
|
||||
}
|
||||
@Override
|
||||
public boolean renderStatic(Vector3 pos, int pass) {
|
||||
boolean render;
|
||||
render = iModPart.renderStatic(new Vecs3d((int) pos.x, (int) pos.y, (int) pos.z), pass);
|
||||
return render;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<ItemStack> getDrops() {
|
||||
List<ItemStack> stackArrayList = new ArrayList<ItemStack>();
|
||||
if (iModPart.getItem() != null) {
|
||||
stackArrayList.add(iModPart.getItem().copy());
|
||||
} else {
|
||||
LogHelper.error("Part " + iModPart.getName() + " has a null drop");
|
||||
}
|
||||
return stackArrayList;
|
||||
}
|
||||
@Override
|
||||
public Iterable<ItemStack> getDrops() {
|
||||
List<ItemStack> stackArrayList = new ArrayList<ItemStack>();
|
||||
if (iModPart.getItem() != null) {
|
||||
stackArrayList.add(iModPart.getItem().copy());
|
||||
} else {
|
||||
LogHelper.error("Part " + iModPart.getName() + " has a null drop");
|
||||
}
|
||||
return stackArrayList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPartChanged(TMultiPart part) {
|
||||
super.onPartChanged(part);
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
@Override
|
||||
public void onPartChanged(TMultiPart part) {
|
||||
super.onPartChanged(part);
|
||||
if (iModPart.world == null || iModPart.location == null) {
|
||||
iModPart.setWorld(world());
|
||||
iModPart.setLocation(new Location(x(), y(), z()));
|
||||
}
|
||||
iModPart.nearByChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDesc(MCDataInput packet) {
|
||||
super.readDesc(packet);
|
||||
if (iModPart instanceof IPartDesc) {
|
||||
((IPartDesc) iModPart).readDesc(packet.readNBTTagCompound());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void readDesc(MCDataInput packet) {
|
||||
super.readDesc(packet);
|
||||
if (iModPart instanceof IPartDesc) {
|
||||
((IPartDesc) iModPart).readDesc(packet.readNBTTagCompound());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDesc(MCDataOutput packet) {
|
||||
super.writeDesc(packet);
|
||||
if (iModPart instanceof IPartDesc) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
((IPartDesc) iModPart).writeDesc(tagCompound);
|
||||
packet.writeNBTTagCompound(tagCompound);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void writeDesc(MCDataOutput packet) {
|
||||
super.writeDesc(packet);
|
||||
if (iModPart instanceof IPartDesc) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
((IPartDesc) iModPart).writeDesc(tagCompound);
|
||||
packet.writeNBTTagCompound(tagCompound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,16 +19,16 @@ import techreborn.partSystem.ModPart;
|
|||
* the world.
|
||||
*/
|
||||
public class FakeFMPPlacerItem extends JItemMultiPart {
|
||||
ModPart modPart;
|
||||
ModPart modPart;
|
||||
|
||||
public FakeFMPPlacerItem(ModPart part) {
|
||||
modPart = part;
|
||||
}
|
||||
public FakeFMPPlacerItem(ModPart part) {
|
||||
modPart = part;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TMultiPart newPart(ItemStack item, EntityPlayer player, World world,
|
||||
BlockCoord pos, int side, Vector3 vhit) {
|
||||
TMultiPart w = MultiPartRegistry.createPart(modPart.getName(), false);
|
||||
return w;
|
||||
}
|
||||
@Override
|
||||
public TMultiPart newPart(ItemStack item, EntityPlayer player, World world,
|
||||
BlockCoord pos, int side, Vector3 vhit) {
|
||||
TMultiPart w = MultiPartRegistry.createPart(modPart.getName(), false);
|
||||
return w;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import techreborn.partSystem.IModPart;
|
|||
import techreborn.partSystem.IPartDesc;
|
||||
import techreborn.partSystem.ModPart;
|
||||
import techreborn.partSystem.ModPartUtils;
|
||||
import techreborn.util.LogHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -33,165 +32,165 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class CablePart extends ModPart implements IEnergyConductor, INetworkTileEntityEventListener, IPartDesc {
|
||||
public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14];
|
||||
public float center = 0.6F;
|
||||
public float offset = 0.10F;
|
||||
public Map<ForgeDirection, TileEntity> connectedSides;
|
||||
public int ticks = 0;
|
||||
protected ForgeDirection[] dirs = ForgeDirection.values();
|
||||
private boolean[] connections = new boolean[6];
|
||||
public boolean addedToEnergyNet = false;
|
||||
public ItemStack stack;
|
||||
private boolean hasCheckedSinceStartup;
|
||||
public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14];
|
||||
public float center = 0.6F;
|
||||
public float offset = 0.10F;
|
||||
public Map<ForgeDirection, TileEntity> connectedSides;
|
||||
public int ticks = 0;
|
||||
protected ForgeDirection[] dirs = ForgeDirection.values();
|
||||
private boolean[] connections = new boolean[6];
|
||||
public boolean addedToEnergyNet = false;
|
||||
public ItemStack stack;
|
||||
private boolean hasCheckedSinceStartup;
|
||||
|
||||
public int type = 0;
|
||||
public int type = 0;
|
||||
|
||||
public CablePart() {
|
||||
public CablePart() {
|
||||
connectedSides = new HashMap<ForgeDirection, TileEntity>();
|
||||
}
|
||||
}
|
||||
|
||||
public void setType(int newType){
|
||||
public void setType(int newType) {
|
||||
this.type = newType;
|
||||
refreshBounding();
|
||||
}
|
||||
|
||||
public void refreshBounding() {
|
||||
float centerFirst = center - offset;
|
||||
double w = getCableThickness(type) / 2;
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w - 0.03, centerFirst
|
||||
- w - 0.08, centerFirst - w - 0.03, centerFirst + w + 0.08,
|
||||
centerFirst + w + 0.04, centerFirst + w + 0.08);
|
||||
public void refreshBounding() {
|
||||
float centerFirst = center - offset;
|
||||
double w = getCableThickness(type) / 2;
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w - 0.03, centerFirst
|
||||
- w - 0.08, centerFirst - w - 0.03, centerFirst + w + 0.08,
|
||||
centerFirst + w + 0.04, centerFirst + w + 0.08);
|
||||
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w,
|
||||
centerFirst - w, centerFirst + w, centerFirst + w, centerFirst
|
||||
+ w);
|
||||
boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w,
|
||||
centerFirst - w, centerFirst + w, centerFirst + w, centerFirst
|
||||
+ w);
|
||||
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
double xMin1 = (dir.offsetX < 0 ? 0.0
|
||||
: (dir.offsetX == 0 ? centerFirst - w : centerFirst + w));
|
||||
double xMax1 = (dir.offsetX > 0 ? 1.0
|
||||
: (dir.offsetX == 0 ? centerFirst + w : centerFirst - w));
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
double xMin1 = (dir.offsetX < 0 ? 0.0
|
||||
: (dir.offsetX == 0 ? centerFirst - w : centerFirst + w));
|
||||
double xMax1 = (dir.offsetX > 0 ? 1.0
|
||||
: (dir.offsetX == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
double yMin1 = (dir.offsetY < 0 ? 0.0
|
||||
: (dir.offsetY == 0 ? centerFirst - w : centerFirst + w));
|
||||
double yMax1 = (dir.offsetY > 0 ? 1.0
|
||||
: (dir.offsetY == 0 ? centerFirst + w : centerFirst - w));
|
||||
double yMin1 = (dir.offsetY < 0 ? 0.0
|
||||
: (dir.offsetY == 0 ? centerFirst - w : centerFirst + w));
|
||||
double yMax1 = (dir.offsetY > 0 ? 1.0
|
||||
: (dir.offsetY == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
double zMin1 = (dir.offsetZ < 0 ? 0.0
|
||||
: (dir.offsetZ == 0 ? centerFirst - w : centerFirst + w));
|
||||
double zMax1 = (dir.offsetZ > 0 ? 1.0
|
||||
: (dir.offsetZ == 0 ? centerFirst + w : centerFirst - w));
|
||||
double zMin1 = (dir.offsetZ < 0 ? 0.0
|
||||
: (dir.offsetZ == 0 ? centerFirst - w : centerFirst + w));
|
||||
double zMax1 = (dir.offsetZ > 0 ? 1.0
|
||||
: (dir.offsetZ == 0 ? centerFirst + w : centerFirst - w));
|
||||
|
||||
boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1,
|
||||
yMax1, zMax1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1,
|
||||
yMax1, zMax1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
boxes.add(boundingBoxes[Functions.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
boxes.add(boundingBoxes[6]);
|
||||
}
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
boxes.add(boundingBoxes[Functions.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
boxes.add(boundingBoxes[6]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vecs3dCube> getSelectionBoxes() {
|
||||
List<Vecs3dCube> vec3dCubeList = new ArrayList<Vecs3dCube>();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
vec3dCubeList.add(boundingBoxes[Functions
|
||||
.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
vec3dCubeList.add(boundingBoxes[6]);
|
||||
return vec3dCubeList;
|
||||
}
|
||||
@Override
|
||||
public List<Vecs3dCube> getSelectionBoxes() {
|
||||
List<Vecs3dCube> vec3dCubeList = new ArrayList<Vecs3dCube>();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
vec3dCubeList.add(boundingBoxes[Functions
|
||||
.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
vec3dCubeList.add(boundingBoxes[6]);
|
||||
return vec3dCubeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vecs3dCube> getOcclusionBoxes() {
|
||||
List<Vecs3dCube> vecs3dCubesList = new ArrayList<Vecs3dCube>();
|
||||
@Override
|
||||
public List<Vecs3dCube> getOcclusionBoxes() {
|
||||
List<Vecs3dCube> vecs3dCubesList = new ArrayList<Vecs3dCube>();
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
vecs3dCubesList.add(boundingBoxes[Functions
|
||||
.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
return vecs3dCubesList;
|
||||
}
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (connectedSides.containsKey(dir))
|
||||
vecs3dCubesList.add(boundingBoxes[Functions
|
||||
.getIntDirFromDirection(dir)]);
|
||||
}
|
||||
return vecs3dCubesList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamic(Vecs3d translation, double delta) {
|
||||
}
|
||||
@Override
|
||||
public void renderDynamic(Vecs3d translation, double delta) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStatic(Vecs3d translation, int pass) {
|
||||
return RenderCablePart.renderStatic(translation, pass, this);
|
||||
}
|
||||
@Override
|
||||
public boolean renderStatic(Vecs3d translation, int pass) {
|
||||
return RenderCablePart.renderStatic(translation, pass, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
tag.setInteger("type", type);
|
||||
writeConnectedSidesToNBT(tag);
|
||||
}
|
||||
writeConnectedSidesToNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
type = tag.getInteger("type");
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
type = tag.getInteger("type");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Cable." + getNameFromType(type);
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Cable." + getNameFromType(type);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return IC2Items.getItem(getTextureNameFromType(type)).getIconIndex().getIconName();
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return IC2Items.getItem(getTextureNameFromType(type)).getIconIndex().getIconName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient() && !this.addedToEnergyNet) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
this.addedToEnergyNet = true;
|
||||
nearByChange();
|
||||
}
|
||||
if (worldObj != null) {
|
||||
if (worldObj.getTotalWorldTime() % 40 == 0 || !hasCheckedSinceStartup) {
|
||||
checkConnectedSides();
|
||||
hasCheckedSinceStartup = true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient() && !this.addedToEnergyNet) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
this.addedToEnergyNet = true;
|
||||
nearByChange();
|
||||
}
|
||||
if (worldObj != null) {
|
||||
if (worldObj.getTotalWorldTime() % 40 == 0 || !hasCheckedSinceStartup) {
|
||||
checkConnectedSides();
|
||||
hasCheckedSinceStartup = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nearByChange() {
|
||||
checkConnectedSides();
|
||||
}
|
||||
@Override
|
||||
public void nearByChange() {
|
||||
checkConnectedSides();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
checkConnections(world, getX(), getY(), getZ());
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
this.addedToEnergyNet = true;
|
||||
nearByChange();
|
||||
}
|
||||
checkConnectedSides();
|
||||
}
|
||||
@Override
|
||||
public void onAdded() {
|
||||
checkConnections(world, getX(), getY(), getZ());
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
this.addedToEnergyNet = true;
|
||||
nearByChange();
|
||||
}
|
||||
checkConnectedSides();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient() && this.addedToEnergyNet) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
this.addedToEnergyNet = false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
if (!FMLCommonHandler.instance().getEffectiveSide().isClient() && this.addedToEnergyNet) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
this.addedToEnergyNet = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModPart copy() {
|
||||
|
@ -201,366 +200,366 @@ public class CablePart extends ModPart implements IEnergyConductor, INetworkTile
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return ModParts.stackCable.get(type);
|
||||
}
|
||||
public ItemStack getItem() {
|
||||
return ModParts.stackCable.get(type);
|
||||
}
|
||||
|
||||
public boolean shouldConnectTo(TileEntity entity, ForgeDirection dir) {
|
||||
if (entity == null) {
|
||||
return false;
|
||||
} else if (entity instanceof IEnergyTile) {
|
||||
return true;
|
||||
} else {
|
||||
return ModPartUtils.hasPart(entity.getWorldObj(), entity.xCoord,
|
||||
entity.yCoord, entity.zCoord, this.getName());
|
||||
}
|
||||
}
|
||||
public boolean shouldConnectTo(TileEntity entity, ForgeDirection dir) {
|
||||
if (entity == null) {
|
||||
return false;
|
||||
} else if (entity instanceof IEnergyTile) {
|
||||
return true;
|
||||
} else {
|
||||
return ModPartUtils.hasPart(entity.getWorldObj(), entity.xCoord,
|
||||
entity.yCoord, entity.zCoord, this.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void checkConnectedSides() {
|
||||
refreshBounding();
|
||||
connectedSides = new HashMap<ForgeDirection, TileEntity>();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
int d = Functions.getIntDirFromDirection(dir);
|
||||
if (world == null) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(getX() + dir.offsetX, getY()
|
||||
+ dir.offsetY, getZ() + dir.offsetZ);
|
||||
if (shouldConnectTo(te, dir)) {
|
||||
if (ModPartUtils.checkOcclusion(getWorld(), getX(),
|
||||
getY(), getZ(), boundingBoxes[d])) {
|
||||
connectedSides.put(dir, te);
|
||||
}
|
||||
}
|
||||
if (te != null) {
|
||||
te.getWorldObj().markBlockForUpdate(te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
}
|
||||
checkConnections(world, getX(), getY(), getZ());
|
||||
getWorld().markBlockForUpdate(getX(), getY(), getZ());
|
||||
}
|
||||
public void checkConnectedSides() {
|
||||
refreshBounding();
|
||||
connectedSides = new HashMap<ForgeDirection, TileEntity>();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
int d = Functions.getIntDirFromDirection(dir);
|
||||
if (world == null) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(getX() + dir.offsetX, getY()
|
||||
+ dir.offsetY, getZ() + dir.offsetZ);
|
||||
if (shouldConnectTo(te, dir)) {
|
||||
if (ModPartUtils.checkOcclusion(getWorld(), getX(),
|
||||
getY(), getZ(), boundingBoxes[d])) {
|
||||
connectedSides.put(dir, te);
|
||||
}
|
||||
}
|
||||
if (te != null) {
|
||||
te.getWorldObj().markBlockForUpdate(te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
}
|
||||
checkConnections(world, getX(), getY(), getZ());
|
||||
getWorld().markBlockForUpdate(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public void checkConnections(World world, int x, int y, int z) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ForgeDirection dir = dirs[i];
|
||||
int dx = x + dir.offsetX;
|
||||
int dy = y + dir.offsetY;
|
||||
int dz = z + dir.offsetZ;
|
||||
connections[i] = shouldConnectTo(world.getTileEntity(dx, dy, dz),
|
||||
dir);
|
||||
world.func_147479_m(dx, dy, dz);
|
||||
}
|
||||
world.func_147479_m(x, y, z);
|
||||
}
|
||||
public void checkConnections(World world, int x, int y, int z) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ForgeDirection dir = dirs[i];
|
||||
int dx = x + dir.offsetX;
|
||||
int dy = y + dir.offsetY;
|
||||
int dz = z + dir.offsetZ;
|
||||
connections[i] = shouldConnectTo(world.getTileEntity(dx, dy, dz),
|
||||
dir);
|
||||
world.func_147479_m(dx, dy, dz);
|
||||
}
|
||||
world.func_147479_m(x, y, z);
|
||||
}
|
||||
|
||||
public double getConductionLoss() {
|
||||
switch (this.type) {
|
||||
case 0:
|
||||
return 0.2D;
|
||||
case 1:
|
||||
return 0.3D;
|
||||
case 2:
|
||||
return 0.5D;
|
||||
case 3:
|
||||
return 0.45D;
|
||||
case 4:
|
||||
return 0.4D;
|
||||
case 5:
|
||||
return 1.0D;
|
||||
case 6:
|
||||
return 0.95D;
|
||||
case 7:
|
||||
return 0.9D;
|
||||
case 8:
|
||||
return 0.8D;
|
||||
case 9:
|
||||
return 0.025D;
|
||||
case 10:
|
||||
return 0.025D;
|
||||
case 11:
|
||||
return 0.5D;
|
||||
case 12:
|
||||
return 0.5D;
|
||||
case 13:
|
||||
default:
|
||||
return 0.025D;
|
||||
case 14:
|
||||
return 0.2D;
|
||||
}
|
||||
}
|
||||
public double getConductionLoss() {
|
||||
switch (this.type) {
|
||||
case 0:
|
||||
return 0.2D;
|
||||
case 1:
|
||||
return 0.3D;
|
||||
case 2:
|
||||
return 0.5D;
|
||||
case 3:
|
||||
return 0.45D;
|
||||
case 4:
|
||||
return 0.4D;
|
||||
case 5:
|
||||
return 1.0D;
|
||||
case 6:
|
||||
return 0.95D;
|
||||
case 7:
|
||||
return 0.9D;
|
||||
case 8:
|
||||
return 0.8D;
|
||||
case 9:
|
||||
return 0.025D;
|
||||
case 10:
|
||||
return 0.025D;
|
||||
case 11:
|
||||
return 0.5D;
|
||||
case 12:
|
||||
return 0.5D;
|
||||
case 13:
|
||||
default:
|
||||
return 0.025D;
|
||||
case 14:
|
||||
return 0.2D;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getMaxCapacity(int type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return 128;
|
||||
case 1:
|
||||
return 128;
|
||||
case 2:
|
||||
return 512;
|
||||
case 3:
|
||||
return 512;
|
||||
case 4:
|
||||
return 512;
|
||||
case 5:
|
||||
return 2048;
|
||||
case 6:
|
||||
return 2048;
|
||||
case 7:
|
||||
return 2048;
|
||||
case 8:
|
||||
return 2048;
|
||||
case 9:
|
||||
return 8192;
|
||||
case 10:
|
||||
return 32;
|
||||
case 11:
|
||||
return 8192;
|
||||
case 12:
|
||||
return 8192;
|
||||
case 13:
|
||||
return 32;
|
||||
case 14:
|
||||
return 32;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static int getMaxCapacity(int type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return 128;
|
||||
case 1:
|
||||
return 128;
|
||||
case 2:
|
||||
return 512;
|
||||
case 3:
|
||||
return 512;
|
||||
case 4:
|
||||
return 512;
|
||||
case 5:
|
||||
return 2048;
|
||||
case 6:
|
||||
return 2048;
|
||||
case 7:
|
||||
return 2048;
|
||||
case 8:
|
||||
return 2048;
|
||||
case 9:
|
||||
return 8192;
|
||||
case 10:
|
||||
return 32;
|
||||
case 11:
|
||||
return 8192;
|
||||
case 12:
|
||||
return 8192;
|
||||
case 13:
|
||||
return 32;
|
||||
case 14:
|
||||
return 32;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static float getCableThickness(int cableType) {
|
||||
float p = 1.0F;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 1:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 2:
|
||||
p = 3.0F;
|
||||
break;
|
||||
case 3:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 4:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 5:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 6:
|
||||
p = 10.0F;
|
||||
break;
|
||||
case 7:
|
||||
p = 10.0F;
|
||||
break;
|
||||
case 8:
|
||||
p = 12.0F;
|
||||
break;
|
||||
case 9:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 10:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 11:
|
||||
p = 8.0F;
|
||||
break;
|
||||
case 12:
|
||||
p = 8.0F;
|
||||
break;
|
||||
case 13:
|
||||
p = 16.0F;
|
||||
break;
|
||||
case 14:
|
||||
p = 6.0F;
|
||||
}
|
||||
public static float getCableThickness(int cableType) {
|
||||
float p = 1.0F;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 1:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 2:
|
||||
p = 3.0F;
|
||||
break;
|
||||
case 3:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 4:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 5:
|
||||
p = 6.0F;
|
||||
break;
|
||||
case 6:
|
||||
p = 10.0F;
|
||||
break;
|
||||
case 7:
|
||||
p = 10.0F;
|
||||
break;
|
||||
case 8:
|
||||
p = 12.0F;
|
||||
break;
|
||||
case 9:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 10:
|
||||
p = 4.0F;
|
||||
break;
|
||||
case 11:
|
||||
p = 8.0F;
|
||||
break;
|
||||
case 12:
|
||||
p = 8.0F;
|
||||
break;
|
||||
case 13:
|
||||
p = 16.0F;
|
||||
break;
|
||||
case 14:
|
||||
p = 6.0F;
|
||||
}
|
||||
|
||||
return p / 16.0F;
|
||||
}
|
||||
return p / 16.0F;
|
||||
}
|
||||
|
||||
public static String getNameFromType(int cableType) {
|
||||
String p = null;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = "copperCable";
|
||||
break;
|
||||
case 1:
|
||||
p = "insulatedCopperCable";
|
||||
break;
|
||||
case 2:
|
||||
p = "goldCable";
|
||||
break;
|
||||
case 3:
|
||||
p = "insulatedGoldCable";
|
||||
break;
|
||||
case 4:
|
||||
p = "doubleInsulatedGoldCable";
|
||||
break;
|
||||
case 5:
|
||||
p = "ironCable";
|
||||
break;
|
||||
case 6:
|
||||
p = "insulatedIronCable";
|
||||
break;
|
||||
case 7:
|
||||
p = "doubleInsulatedIronCable";
|
||||
break;
|
||||
case 8:
|
||||
p = "trippleInsulatedIronCable";
|
||||
break;
|
||||
case 9:
|
||||
p = "glassFiberCable";
|
||||
break;
|
||||
case 10:
|
||||
p = "tinCable";
|
||||
break;
|
||||
case 11:
|
||||
p = "detectorCableBlock";//Detector
|
||||
break;
|
||||
case 12:
|
||||
p = "splitterCableBlock";// Splitter
|
||||
break;
|
||||
case 13:
|
||||
p = "insulatedtinCable";
|
||||
break;
|
||||
case 14:
|
||||
p = "unused"; // unused?
|
||||
}
|
||||
public static String getNameFromType(int cableType) {
|
||||
String p = null;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = "copperCable";
|
||||
break;
|
||||
case 1:
|
||||
p = "insulatedCopperCable";
|
||||
break;
|
||||
case 2:
|
||||
p = "goldCable";
|
||||
break;
|
||||
case 3:
|
||||
p = "insulatedGoldCable";
|
||||
break;
|
||||
case 4:
|
||||
p = "doubleInsulatedGoldCable";
|
||||
break;
|
||||
case 5:
|
||||
p = "ironCable";
|
||||
break;
|
||||
case 6:
|
||||
p = "insulatedIronCable";
|
||||
break;
|
||||
case 7:
|
||||
p = "doubleInsulatedIronCable";
|
||||
break;
|
||||
case 8:
|
||||
p = "trippleInsulatedIronCable";
|
||||
break;
|
||||
case 9:
|
||||
p = "glassFiberCable";
|
||||
break;
|
||||
case 10:
|
||||
p = "tinCable";
|
||||
break;
|
||||
case 11:
|
||||
p = "detectorCableBlock";//Detector
|
||||
break;
|
||||
case 12:
|
||||
p = "splitterCableBlock";// Splitter
|
||||
break;
|
||||
case 13:
|
||||
p = "insulatedtinCable";
|
||||
break;
|
||||
case 14:
|
||||
p = "unused"; // unused?
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
public static String getTextureNameFromType(int cableType) {
|
||||
String p = null;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = "copperCableItem";
|
||||
break;
|
||||
case 1:
|
||||
p = "insulatedCopperCableItem";
|
||||
break;
|
||||
case 2:
|
||||
p = "goldCableItem";
|
||||
break;
|
||||
case 3:
|
||||
p = "insulatedGoldCableItem";
|
||||
break;
|
||||
case 4:
|
||||
p = "doubleInsulatedGoldCableItem";
|
||||
break;
|
||||
case 5:
|
||||
p = "ironCableItem";
|
||||
break;
|
||||
case 6:
|
||||
p = "insulatedIronCableItem";
|
||||
break;
|
||||
case 7:
|
||||
p = "doubleInsulatedIronCableItem";
|
||||
break;
|
||||
case 8:
|
||||
p = "trippleInsulatedIronCableItem";
|
||||
break;
|
||||
case 9:
|
||||
p = "glassFiberCableItem";
|
||||
break;
|
||||
case 10:
|
||||
p = "tinCableItem";
|
||||
break;
|
||||
case 11:
|
||||
p = "detectorCableItem";//Detector
|
||||
break;
|
||||
case 12:
|
||||
p = "splitterCableItem";// Splitter
|
||||
break;
|
||||
case 13:
|
||||
p = "insulatedTinCableItem";
|
||||
break;
|
||||
case 14:
|
||||
p = "unused"; // unused?
|
||||
}
|
||||
public static String getTextureNameFromType(int cableType) {
|
||||
String p = null;
|
||||
switch (cableType) {
|
||||
case 0:
|
||||
p = "copperCableItem";
|
||||
break;
|
||||
case 1:
|
||||
p = "insulatedCopperCableItem";
|
||||
break;
|
||||
case 2:
|
||||
p = "goldCableItem";
|
||||
break;
|
||||
case 3:
|
||||
p = "insulatedGoldCableItem";
|
||||
break;
|
||||
case 4:
|
||||
p = "doubleInsulatedGoldCableItem";
|
||||
break;
|
||||
case 5:
|
||||
p = "ironCableItem";
|
||||
break;
|
||||
case 6:
|
||||
p = "insulatedIronCableItem";
|
||||
break;
|
||||
case 7:
|
||||
p = "doubleInsulatedIronCableItem";
|
||||
break;
|
||||
case 8:
|
||||
p = "trippleInsulatedIronCableItem";
|
||||
break;
|
||||
case 9:
|
||||
p = "glassFiberCableItem";
|
||||
break;
|
||||
case 10:
|
||||
p = "tinCableItem";
|
||||
break;
|
||||
case 11:
|
||||
p = "detectorCableItem";//Detector
|
||||
break;
|
||||
case 12:
|
||||
p = "splitterCableItem";// Splitter
|
||||
break;
|
||||
case 13:
|
||||
p = "insulatedTinCableItem";
|
||||
break;
|
||||
case 14:
|
||||
p = "unused"; // unused?
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
public double getInsulationEnergyAbsorption() {
|
||||
return (double) getMaxCapacity(this.type);
|
||||
}
|
||||
public double getInsulationEnergyAbsorption() {
|
||||
return (double) getMaxCapacity(this.type);
|
||||
}
|
||||
|
||||
public double getInsulationBreakdownEnergy() {
|
||||
return 9001.0D;
|
||||
}
|
||||
public double getInsulationBreakdownEnergy() {
|
||||
return 9001.0D;
|
||||
}
|
||||
|
||||
public double getConductorBreakdownEnergy() {
|
||||
return (double) (getMaxCapacity(this.type) + 1);
|
||||
}
|
||||
public double getConductorBreakdownEnergy() {
|
||||
return (double) (getMaxCapacity(this.type) + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeInsulation() {
|
||||
@Override
|
||||
public void removeInsulation() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConductor() {
|
||||
@Override
|
||||
public void removeConductor() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity tileEntity,
|
||||
ForgeDirection forgeDirection) {
|
||||
return connectedSides.containsKey(forgeDirection);
|
||||
}
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity tileEntity,
|
||||
ForgeDirection forgeDirection) {
|
||||
return connectedSides.containsKey(forgeDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean emitsEnergyTo(TileEntity tileEntity,
|
||||
ForgeDirection forgeDirection) {
|
||||
return connectedSides.containsKey(forgeDirection);
|
||||
}
|
||||
@Override
|
||||
public boolean emitsEnergyTo(TileEntity tileEntity,
|
||||
ForgeDirection forgeDirection) {
|
||||
return connectedSides.containsKey(forgeDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetworkEvent(int i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.worldObj.playSoundEffect((double) ((float) this.xCoord + 0.5F), (double) ((float) this.yCoord + 0.5F), (double) ((float) this.zCoord + 0.5F), "random.fizz", 0.5F, 2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
|
||||
@Override
|
||||
public void onNetworkEvent(int i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.worldObj.playSoundEffect((double) ((float) this.xCoord + 0.5F), (double) ((float) this.yCoord + 0.5F), (double) ((float) this.zCoord + 0.5F), "random.fizz", 0.5F, 2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
|
||||
|
||||
for (int l = 0; l < 8; ++l) {
|
||||
this.worldObj.spawnParticle("largesmoke", (double) this.xCoord + Math.random(), (double) this.yCoord + 1.2D, (double) this.zCoord + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
for (int l = 0; l < 8; ++l) {
|
||||
this.worldObj.spawnParticle("largesmoke", (double) this.xCoord + Math.random(), (double) this.yCoord + 1.2D, (double) this.zCoord + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readConnectedSidesFromNBT(NBTTagCompound tagCompound) {
|
||||
private void readConnectedSidesFromNBT(NBTTagCompound tagCompound) {
|
||||
|
||||
NBTTagCompound ourCompound = tagCompound.getCompoundTag("connectedSides");
|
||||
NBTTagCompound ourCompound = tagCompound.getCompoundTag("connectedSides");
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
connections[dir.ordinal()] = ourCompound.getBoolean(dir.ordinal() + "");
|
||||
}
|
||||
checkConnectedSides();
|
||||
}
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
connections[dir.ordinal()] = ourCompound.getBoolean(dir.ordinal() + "");
|
||||
}
|
||||
checkConnectedSides();
|
||||
}
|
||||
|
||||
private void writeConnectedSidesToNBT(NBTTagCompound tagCompound) {
|
||||
private void writeConnectedSidesToNBT(NBTTagCompound tagCompound) {
|
||||
|
||||
NBTTagCompound ourCompound = new NBTTagCompound();
|
||||
int i = 0;
|
||||
for (boolean b : connections) {
|
||||
ourCompound.setBoolean(i + "", b);
|
||||
i++;
|
||||
}
|
||||
NBTTagCompound ourCompound = new NBTTagCompound();
|
||||
int i = 0;
|
||||
for (boolean b : connections) {
|
||||
ourCompound.setBoolean(i + "", b);
|
||||
i++;
|
||||
}
|
||||
|
||||
tagCompound.setTag("connectedSides", ourCompound);
|
||||
}
|
||||
tagCompound.setTag("connectedSides", ourCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDesc(NBTTagCompound tagCompound) {
|
||||
readConnectedSidesFromNBT(tagCompound);
|
||||
}
|
||||
@Override
|
||||
public void readDesc(NBTTagCompound tagCompound) {
|
||||
readConnectedSidesFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDesc(NBTTagCompound tagCompound) {
|
||||
writeConnectedSidesToNBT(tagCompound);
|
||||
}
|
||||
@Override
|
||||
public void writeDesc(NBTTagCompound tagCompound) {
|
||||
writeConnectedSidesToNBT(tagCompound);
|
||||
}
|
||||
}
|
|
@ -44,7 +44,7 @@ public class FarmInventoryCable extends ModPart implements IPartDesc {
|
|||
centerFirst - w, centerFirst + w, centerFirst + w, centerFirst
|
||||
+ w);
|
||||
|
||||
w = 0.4F /2;
|
||||
w = 0.4F / 2;
|
||||
int i = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
double xMin1 = (dir.offsetX < 0 ? 0.0
|
||||
|
|
|
@ -19,77 +19,77 @@ import java.util.List;
|
|||
* Created by mark on 11/12/14.
|
||||
*/
|
||||
public class NullPart extends ModPart {
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity) {
|
||||
boxes.add(new Vecs3dCube(0, 0, 0, 1, 1, 1));
|
||||
}
|
||||
@Override
|
||||
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity) {
|
||||
boxes.add(new Vecs3dCube(0, 0, 0, 1, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vecs3dCube> getSelectionBoxes() {
|
||||
List<Vecs3dCube> cubes = new ArrayList<Vecs3dCube>();
|
||||
cubes.add(new Vecs3dCube(0, 0, 0, 1, 1, 1));
|
||||
return cubes;
|
||||
}
|
||||
@Override
|
||||
public List<Vecs3dCube> getSelectionBoxes() {
|
||||
List<Vecs3dCube> cubes = new ArrayList<Vecs3dCube>();
|
||||
cubes.add(new Vecs3dCube(0, 0, 0, 1, 1, 1));
|
||||
return cubes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vecs3dCube> getOcclusionBoxes() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<Vecs3dCube> getOcclusionBoxes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamic(Vecs3d translation, double delta) {
|
||||
@Override
|
||||
public void renderDynamic(Vecs3d translation, double delta) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStatic(Vecs3d translation, int pass) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderStatic(Vecs3d translation, int pass) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "NullPart";
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return "NullPart";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String getItemTextureName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@Override
|
||||
public void tick() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nearByChange() {
|
||||
@Override
|
||||
public void nearByChange() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded() {
|
||||
@Override
|
||||
public void onAdded() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
@Override
|
||||
public void onRemoved() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModPart copy() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue