Some improvements to render speed of cables

This commit is contained in:
modmuss50 2015-06-25 20:10:03 +01:00
parent 7c56cd25f6
commit 37467cab7e
5 changed files with 21 additions and 19 deletions

View file

@ -39,12 +39,14 @@ public class ModPartItem extends Item {
try {
if(modPart instanceof CablePart){
if (ModPartRegistry.masterProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().getDeclaredConstructor(int.class).newInstance(((CablePart) modPart).type))) {
player.swingItem();
return true;
}
}else{
if (ModPartRegistry.masterProvider.placePart(item, player,
world, x, y, z, face, x_, y_, z_, modPart.getClass()
.newInstance())) {
player.swingItem();
return true;
}
}
@ -64,7 +66,8 @@ public class ModPartItem extends Item {
if(modPart instanceof CablePart){
try {
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().getDeclaredConstructor(int.class).newInstance(((CablePart) modPart).type))) {
return true;
player.swingItem();
return true;
}
} catch (InvocationTargetException e) {
e.printStackTrace();
@ -73,7 +76,8 @@ public class ModPartItem extends Item {
}
} else {
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().newInstance())) {
return true;
player.swingItem();
return true;
}
}

View file

@ -7,6 +7,7 @@ package techreborn.partSystem.fmp;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
@ -25,6 +26,7 @@ import codechicken.multipart.TMultiPart;
import codechicken.multipart.TSlottedPart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import uk.co.qmunity.lib.vec.Vec3i;
public class FMPModPart extends TMultiPart implements TSlottedPart,
JNormalOcclusion, ISidedHollowConnect {
@ -176,12 +178,10 @@ public class FMPModPart extends TMultiPart implements TSlottedPart,
@Override
public boolean renderStatic(Vector3 pos, int pass) {
boolean render = false;
render = iModPart.renderStatic(new Vecs3d(pos.x, pos.y, pos.z), uk.co.qmunity.lib.client.render.RenderHelper.instance, pass);
RenderHelper.instance.resetRenderedSides();
RenderHelper.instance.resetTextureRotations();
RenderHelper.instance.resetTransformations();
RenderHelper.instance.setColor(0xFFFFFF);
return render;
}
RenderHelper.instance.setRenderCoords(getWorld(), (int) pos.x, (int) pos.y, (int) pos.z);
iModPart.renderStatic(new Vecs3d((int) pos.x, (int) pos.y, (int) pos.z), RenderHelper.instance, pass);
RenderHelper.instance.reset();
return false;
}
}

View file

@ -16,6 +16,7 @@ import java.util.Map;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.core.network.NetworkManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -131,7 +132,6 @@ public class CablePart extends ModPart implements IEnergyConductor, INetworkTile
@Override
public void renderDynamic(Vecs3d translation, double delta) {
}
@Override