Switch to the new data-driven connector models

Update to new mappings
This commit is contained in:
malte0811 2018-11-17 12:23:31 +01:00
parent a60b55cad1
commit 88c10cdb81
32 changed files with 1062 additions and 184 deletions

View File

@ -32,11 +32,11 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "14.23.4.2745"
version = "1.12.2-14.23.5.2768"
runDir = "run"
replace '${version}', project.version
mappings = "snapshot_20171003"
mappings = "stable_39"
}
repositories {

View File

@ -37,7 +37,7 @@ public class IWPotions {
setIconIndex(0, 0);
this.setRegistryName(new ResourceLocation(IndustrialWires.MODID, "tinnitus"));
ForgeRegistries.POTIONS.register(this);
this.setPotionName("potion."+ IndustrialWires.MODID+"." + getRegistryName().getResourcePath());
this.setPotionName("potion." + IndustrialWires.MODID + "." + getRegistryName().getPath());
}
@Override

View File

@ -140,8 +140,9 @@ public class IndustrialWires {
public static IndustrialWires instance = new IndustrialWires();
public static CreativeTabs creativeTab = new CreativeTabs(MODID) {
@Override
public ItemStack getTabIconItem() {
public ItemStack createIcon() {
if (coil!=null) {
return new ItemStack(coil, 1, 2);
} else {

View File

@ -55,7 +55,7 @@ public abstract class BlockIWBase extends Block {
super(mat);
setHardness(3.0F);
setResistance(15.0F);
setUnlocalizedName(IndustrialWires.MODID + "." + name);
setTranslationKey(IndustrialWires.MODID + "." + name);
setRegistryName(IndustrialWires.MODID, name);
setCreativeTab(IndustrialWires.creativeTab);
IndustrialWires.blocks.add(this);

View File

@ -45,12 +45,12 @@ public class ItemBlockIW extends ItemBlock {
@Nonnull
@Override
public String getUnlocalizedName(ItemStack stack) {
public String getTranslationKey(ItemStack stack) {
int meta = stack.getMetadata();
if (values != null) {
return block.getUnlocalizedName() + "." + values[meta].toString().toLowerCase();
return block.getTranslationKey() + "." + values[meta].toString().toLowerCase();
} else {
return block.getUnlocalizedName();
return block.getTranslationKey();
}
}

View File

@ -122,7 +122,7 @@ public abstract class TileEntityIWMultiblock extends TileEntityIWBase implements
mirrored = in.getBoolean(MIRRORED);
int[] offset = in.getIntArray(OFFSET);
this.offset = new Vec3i(offset[0], offset[1], offset[2]);
facing = EnumFacing.getHorizontal(in.getInteger(FACING));
facing = EnumFacing.byHorizontalIndex(in.getInteger(FACING));
}
public Vec3i getSize() {

View File

@ -48,7 +48,7 @@ public class TileEntityComponentPanel extends TileEntityPanel {
}
public void updateRSInput() {
int value = world.isBlockIndirectlyGettingPowered(pos);
int value = world.getRedstonePowerFromNeighbors(pos);
if (value == 0) {
for (EnumFacing f : EnumFacing.HORIZONTALS) {
IBlockState state = world.getBlockState(pos.offset(f));

View File

@ -106,8 +106,8 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
@Override
public void readNBT(NBTTagCompound in, boolean updatePacket) {
readFromItemNBT(in);
components.setFacing(EnumFacing.getHorizontal(in.getInteger("facing")));
components.setTop(EnumFacing.getFront(in.getInteger("top")));
components.setFacing(EnumFacing.byHorizontalIndex(in.getInteger("facing")));
components.setTop(EnumFacing.byIndex(in.getInteger("top")));
}
@Override
@ -226,9 +226,9 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
Matrix4 mat = components.getPanelTopTransformInverse();
PanelComponent retPc = null;
RayTraceResult retRay = null;
Vec3d playerPosRelative = player.getPositionVector().addVector(-pos.getX(), player.getEyeHeight() - pos.getY(), -pos.getZ());
Vec3d playerPosRelative = player.getPositionVector().add(-pos.getX(), player.getEyeHeight() - pos.getY(), -pos.getZ());
Vec3d playerPosTransformed = mat.apply(playerPosRelative);
Vec3d hitRel = hitAbs ? hitVec.addVector(-pos.getX(), -pos.getY(), -pos.getZ()) : hitVec;
Vec3d hitRel = hitAbs ? hitVec.add(-pos.getX(), -pos.getY(), -pos.getZ()) : hitVec;
RayTraceResult r = getBoundingBox().calculateIntercept(playerPosRelative, playerPosRelative.add(player.getLookVec().scale(200)));
if (r != null && r.hitVec != null) {
hitRel = r.hitVec;

View File

@ -146,7 +146,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel//TODO what parts of T
public Vec3d getConnectionOffset(ImmersiveNetHandler.Connection connection) {
EnumFacing side = facing.getOpposite();
double conRadius = connection.cableType.getRenderDiameter() / 2;
return new Vec3d(.5 - conRadius * side.getFrontOffsetX(), .5 - conRadius * side.getFrontOffsetY(), .5 - conRadius * side.getFrontOffsetZ());
return new Vec3d(.5 - conRadius * side.getXOffset(), .5 - conRadius * side.getYOffset(), .5 - conRadius * side.getZOffset());
}
@Override

View File

@ -143,9 +143,10 @@ public class BlockJacobsLadder extends BlockIWBase implements IMetaEnum, IPlacem
return new ItemStack(this, 1, getMetaFromState(state));
}
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
super.onEntityCollision(worldIn, pos, state, entityIn);
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityJacobsLadder) {
((TileEntityJacobsLadder) te).onEntityTouch(entityIn);

View File

@ -52,7 +52,7 @@ public class TileEntityDischargeMeter extends TileEntityIWBase implements IPlaye
@Override
public void readNBT(NBTTagCompound in, boolean updatePacket) {
hasWire = in.getBoolean(HAS_WIRE);
facing = EnumFacing.getHorizontal(in.getByte(FACING));
facing = EnumFacing.byHorizontalIndex(in.getByte(FACING));
lastDischarge = in.getDouble(LAST_DISCHARGE);
aabb = null;
}

View File

@ -714,16 +714,16 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
.radius(5);
List<Light> toAdd = new ArrayList<>(te.stageCount*2-3);
if (te.dischargeData!=null&&te.dischargeData.energy>0) {
toAdd.add(builder.pos(origin.addVector(0, 0, 0)).build());
toAdd.add(builder.pos(origin.addVector(0, te.stageCount/2, 0)).build());
toAdd.add(builder.pos(origin.addVector(0, te.stageCount-2, 0)).build());
toAdd.add(builder.pos(origin.add(0, 0, 0)).build());
toAdd.add(builder.pos(origin.add(0, te.stageCount / 2, 0)).build());
toAdd.add(builder.pos(origin.add(0, te.stageCount - 2, 0)).build());
}
origin = new Vec3d(offset(te.pos, te.facing, te.mirrored, 1, 0, 0))
.addVector(0, .75, 0)
.add(0, .75, 0)
.add(new Vec3d(te.facing.getDirectionVec()).scale(.25));
builder.radius(.5F);
for (int i = 0;i<te.stageCount-1;i+=te.stageCount/5) {
toAdd.add(builder.pos(origin.addVector(0, i, 0)).build());
toAdd.add(builder.pos(origin.add(0, i, 0)).build());
}
event.getLightList().addAll(toAdd);
}
@ -768,12 +768,12 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
Vec3d diff = vertices[max].subtract(vertices[min]);
Vec3d v0 = diff.crossProduct(side);
transform.setIdentity();
double diffLength = diff.lengthVector();
double diffLength = diff.length();
double noise = Math.sqrt(diffLength)*rand.nextDouble()*1/(1+Math.abs(stageCount/2.0-toGenerate))*.75;
if ((max-min)%2==1) {
noise *= (toGenerate-min)/(double)(max-min);
}
v0 = v0.scale((float) (noise/v0.lengthVector()));
v0 = v0.scale((float) (noise / v0.length()));
diff = diff.scale(1/diffLength);
transform.rotate(Math.PI*2*rand.nextDouble(), diff.x, diff.y, diff.z);
Vec3d center = vertices[max].add(vertices[min]).scale(.5);

View File

@ -309,9 +309,9 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im
EnumFacing side = facing.getOpposite();
double conRadius = con.cableType.getRenderDiameter() / 2;
double length = relay?relayOffset:connOffset;
return new Vec3d(.5 + ( length - conRadius) * side.getFrontOffsetX(),
.5 + (length - conRadius) * side.getFrontOffsetY(),
.5 + (length - conRadius) * side.getFrontOffsetZ());
return new Vec3d(.5 + (length - conRadius) * side.getXOffset(),
.5 + (length - conRadius) * side.getYOffset(),
.5 + (length - conRadius) * side.getZOffset());
}
@Override
@ -427,7 +427,7 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im
@Override
public void readCustomNBT(@Nonnull NBTTagCompound nbt, boolean descPacket) {
super.readCustomNBT(nbt, descPacket);
facing = EnumFacing.getFront(nbt.getInteger("facing"));
facing = EnumFacing.byIndex(nbt.getInteger("facing"));
relay = nbt.getBoolean("relay");
int version = nbt.getInteger("version");
bufferToNet = nbt.getDouble("inBuffer");

View File

@ -193,7 +193,7 @@ public class ClientEventHandler {
public static void renderWorldLastLow(RenderWorldLastEvent ev) {
if (shouldScreenshot) {
Minecraft mc = Minecraft.getMinecraft();
ITextComponent comp = ScreenShotHelper.saveScreenshot(mc.mcDataDir, mc.displayWidth, mc.displayHeight, mc.getFramebuffer());//TODO
ITextComponent comp = ScreenShotHelper.saveScreenshot(mc.gameDir, mc.displayWidth, mc.displayHeight, mc.getFramebuffer());//TODO
mc.player.sendMessage(comp);
shouldScreenshot = false;
}

View File

@ -16,7 +16,6 @@ package malte0811.industrialwires.client;
import blusunrize.immersiveengineering.api.ManualHelper;
import blusunrize.immersiveengineering.api.ManualPageMultiblock;
import blusunrize.immersiveengineering.api.energy.wires.WireApi;
import blusunrize.immersiveengineering.client.ClientUtils;
import blusunrize.immersiveengineering.common.Config;
import blusunrize.immersiveengineering.common.util.Utils;
@ -25,7 +24,6 @@ import blusunrize.lib.manual.ManualInstance;
import blusunrize.lib.manual.ManualPages;
import blusunrize.lib.manual.ManualPages.PositionedItemStack;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
@ -91,45 +89,6 @@ public class ClientProxy extends CommonProxy {
@Override
public void preInit() {
super.preInit();
if (IndustrialWires.hasIC2) {
WireApi.registerConnectorForRender("ic2_conn_tin", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
IndustrialWires.MODID + ":blocks/ic2_conn_tin"));
WireApi.registerConnectorForRender("ic2_relay_tin", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
IndustrialWires.MODID + ":blocks/ic2_relay_tin"));
WireApi.registerConnectorForRender("ic2_conn_copper", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
IndustrialWires.MODID + ":blocks/ic2_conn_copper"));
WireApi.registerConnectorForRender("ic2_relay_copper", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
IndustrialWires.MODID + ":blocks/ic2_relay_copper"));
WireApi.registerConnectorForRender("ic2_conn_gold", new ResourceLocation("immersiveengineering:block/connector/connector_mv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_mv",
IndustrialWires.MODID + ":blocks/ic2_conn_gold"));
WireApi.registerConnectorForRender("ic2_relay_gold", new ResourceLocation("immersiveengineering:block/connector/connector_mv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_mv",
IndustrialWires.MODID + ":blocks/ic2_relay_gold"));
WireApi.registerConnectorForRender("ic2_conn_hv", new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
IndustrialWires.MODID + ":blocks/ic2_conn_hv"));
WireApi.registerConnectorForRender("ic2_relay_hv", new ResourceLocation("immersiveengineering:block/connector/relay_hv.obj"), null);
WireApi.registerConnectorForRender("ic2_conn_glass", new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
IndustrialWires.MODID + ":blocks/ic2_conn_glass"));
WireApi.registerConnectorForRender("ic2_relay_glass", new ResourceLocation("immersiveengineering:block/connector/relay_hv.obj"),
ImmutableMap.of("#immersiveengineering:blocks/connector_relay_hv",
IndustrialWires.MODID + ":blocks/ic2_relay_glass"));
}
WireApi.registerConnectorForRender("rs_panel_conn", new ResourceLocation("industrialwires:block/rs_panel_conn.obj"), null);
WireApi.registerConnectorForRender("empty", new ResourceLocation("builtin/generated"), null);
OBJLoader.INSTANCE.addDomain(IndustrialWires.MODID);
ModelLoaderRegistry.registerLoader(new PanelModelLoader());
ModelLoaderRegistry.registerLoader(new MBIOModelLoader());

View File

@ -309,7 +309,7 @@ public class GuiPanelCreator extends GuiContainer {
nbt.setInteger("type", MessageType.DISASSEMBLE.ordinal());
break;
}
if (!nbt.hasNoTags()) {
if (!nbt.isEmpty()) {
IndustrialWires.packetHandler.sendToServer(new MessageGUIInteract(container.tile, nbt));
}
}

View File

@ -113,7 +113,7 @@ public class BakedMBIOModel implements IBakedModel {
float[] vec = new float[3];
for (int i = 0; i < EnumFacing.VALUES.length; i++) {
EnumFacing f = EnumFacing.VALUES[i];
NORMALS[i] = new Vector3f(f.getFrontOffsetX(), f.getFrontOffsetY(), f.getFrontOffsetZ());
NORMALS[i] = new Vector3f(f.getXOffset(), f.getYOffset(), f.getZOffset());
int axis = f.getAxis().ordinal();
vec[axis] = f.getAxisDirection()==EnumFacing.AxisDirection.POSITIVE?1.001F:-.001F;
float x1 = f.getAxisDirection()==EnumFacing.AxisDirection.POSITIVE?offsetInner:1-offsetInner;

View File

@ -50,8 +50,8 @@ public class MBIOModelLoader implements ICustomModelLoader {
}
@Override
public boolean accepts(@Nonnull ResourceLocation modelLocation) {
return IndustrialWires.MODID.equals(modelLocation.getResourceDomain())
&& "models/block/mbio".equals(modelLocation.getResourcePath());
return IndustrialWires.MODID.equals(modelLocation.getNamespace())
&& "models/block/mbio".equals(modelLocation.getPath());
}
@Nonnull

View File

@ -47,13 +47,13 @@ public class PanelModelLoader implements ICustomModelLoader {
@Override
public boolean accepts(@Nonnull ResourceLocation modelLocation) {
return modelLocation.getResourcePath().contains(RESOURCE_BASE + RESOURCE_LOCATION);
return modelLocation.getPath().contains(RESOURCE_BASE + RESOURCE_LOCATION);
}
@Nonnull
@Override
public IModel loadModel(@Nonnull ResourceLocation modelLocation) throws IOException {
String resourcePath = modelLocation.getResourcePath();
String resourcePath = modelLocation.getPath();
int pos = resourcePath.indexOf(RESOURCE_LOCATION);
if (pos >= 0) {
return new PanelModelBase();

View File

@ -91,10 +91,10 @@ public class RawModelFontRenderer extends FontRenderer {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
super.onResourceManagerReload(resourceManager);
String p = locationFontTexture.getResourcePath();
String p = locationFontTexture.getPath();
if (p.startsWith("textures/")) p = p.substring("textures/".length(), p.length());
if (p.endsWith(".png")) p = p.substring(0, p.length() - ".png".length());
String f = locationFontTexture.getResourceDomain() + ":" + p;
String f = locationFontTexture.getNamespace() + ":" + p;
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(f);
}

View File

@ -52,14 +52,14 @@ public class TileRenderMarx extends TileEntitySpecialRenderer<TileEntityMarx> {
//draw firing spark gaps
Vec3i facing = te.facing.getDirectionVec();
Vec3d offset = new Vec3d(MiscUtils.offset(BlockPos.ORIGIN, te.facing, te.mirrored, 1, 1, 0));
offset = offset.addVector(-.5*oneSgn(offset.x), 0, -.5*oneSgn(offset.z));
offset = offset.add(-.5 * oneSgn(offset.x), 0, -.5 * oneSgn(offset.z));
final float pos = .3125F;
Vec3d gapDir = new Vec3d(facing.getZ()*(te.mirrored?-1:1), 1, facing.getX()*(te.mirrored?1:-1));
Vec3d up = new Vec3d(gapDir.x, -1, gapDir.z);
Vec3d bottomGap = new Vec3d(offset.x+facing.getX()*pos+.5, offset.y+.75, offset.z+facing.getZ() * pos+.5);
GlStateManager.pushMatrix();
GlStateManager.translate(x + bottomGap.x, y + bottomGap.y, z + bottomGap.z);
bottomGap = bottomGap.addVector(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
bottomGap = bottomGap.add(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
for (int i = 0; i < te.getStageCount() - 1; i++) {
renderGap(i, facing, vb, tes, player, gapDir, up, bottomGap, te.mirrored);
}
@ -85,7 +85,7 @@ public class TileRenderMarx extends TileEntitySpecialRenderer<TileEntityMarx> {
player = player.subtract(bottomGap.x, bottomGap.y+i, bottomGap.z);
double t = player.dotProduct(gapDir)/2;
Vec3d lineToPlayer = gapDir.scale(t).subtract(player);
double angleRad = Math.acos(up.dotProduct(lineToPlayer)/(up.lengthVector()*lineToPlayer.lengthVector()));
double angleRad = Math.acos(up.dotProduct(lineToPlayer) / (up.length() * lineToPlayer.length()));
angleRad *= Math.signum(lineToPlayer.dotProduct(new Vec3d(facing)));
float angle = (float) (Math.toDegrees(angleRad));
if (facing.getZ()<0) {

View File

@ -304,7 +304,7 @@ public final class PanelUtils {
if (rs && data.hasKey(RS_CHANNEL)) {
EnumDyeColor channColor = EnumDyeColor.byMetadata(data.getInteger(RS_CHANNEL));
String hexCol = Integer.toHexString(channColor.getColorValue());
list.add(I18n.format("desc.immersiveengineering.info.redstoneChannel", "<hexcol=" + hexCol + ":" + channColor.getUnlocalizedName() + ">"));
list.add(I18n.format("desc.immersiveengineering.info.redstoneChannel", "<hexcol=" + hexCol + ":" + channColor.getTranslationKey() + ">"));
}
if (rs && data.hasKey(RS_ID)) {
list.add(I18n.format(IndustrialWires.MODID + ".tooltip.rsId", data.getInteger(RS_ID)));

View File

@ -39,8 +39,8 @@ public class EntityBrokenPart extends Entity {
public static final DataSerializer<ResourceLocation> RES_LOC_SERIALIZER = new DataSerializer<ResourceLocation>() {
@Override
public void write(@Nonnull PacketBuffer buf, @Nonnull ResourceLocation value) {
buf.writeString(value.getResourceDomain());
buf.writeString(value.getResourcePath());
buf.writeString(value.getNamespace());
buf.writeString(value.getPath());
}
@Nonnull
@ -59,7 +59,7 @@ public class EntityBrokenPart extends Entity {
@Nonnull
@Override
public ResourceLocation copyValue(@Nonnull ResourceLocation value) {
return new ResourceLocation(value.getResourceDomain(), value.getResourcePath());
return new ResourceLocation(value.getNamespace(), value.getPath());
}
};
public static DataParameter<ResourceLocation> MARKER_TEXTURE;

View File

@ -47,7 +47,7 @@ public class ItemIC2Coil extends Item implements IWireCoil {
public final static String NAME = "ic2_wire_coil";
public ItemIC2Coil() {
setUnlocalizedName(IndustrialWires.MODID + "."+NAME);
setTranslationKey(IndustrialWires.MODID + "." + NAME);
setHasSubtypes(true);
this.setCreativeTab(IndustrialWires.creativeTab);
setMaxStackSize(1);
@ -67,10 +67,11 @@ public class ItemIC2Coil extends Item implements IWireCoil {
}
}
@Nonnull
@Override
public String getUnlocalizedName(ItemStack stack) {
return this.getUnlocalizedName() + "." + subNames[stack.getMetadata()];
public String getTranslationKey(ItemStack stack) {
return this.getTranslationKey() + "." + subNames[stack.getMetadata()];
}
@Override

View File

@ -42,7 +42,7 @@ public class ItemKey extends Item implements INetGUIItem {
public static final String ITEM_NAME = "key";
public ItemKey() {
setUnlocalizedName(IndustrialWires.MODID + "."+ITEM_NAME);
setTranslationKey(IndustrialWires.MODID + "." + ITEM_NAME);
setHasSubtypes(true);
this.setCreativeTab(IndustrialWires.creativeTab);
setMaxStackSize(64);
@ -83,7 +83,7 @@ public class ItemKey extends Item implements INetGUIItem {
@Nonnull
@Override
public String getUnlocalizedName(ItemStack stack) {
public String getTranslationKey(ItemStack stack) {
return "item."+IndustrialWires.MODID+".key."+types[stack.getMetadata()];
}

View File

@ -58,7 +58,7 @@ public class ItemPanelComponent extends Item implements INetGUIItem {
public static final String NAME = "panel_component";
public ItemPanelComponent() {
setUnlocalizedName(IndustrialWires.MODID + "."+NAME);
setTranslationKey(IndustrialWires.MODID + "." + NAME);
setHasSubtypes(true);
this.setCreativeTab(IndustrialWires.creativeTab);
setMaxStackSize(64);
@ -85,10 +85,11 @@ public class ItemPanelComponent extends Item implements INetGUIItem {
return ClientProxy.itemFont;//TODO non-core-IE solution?
}
@Nonnull
@Override
public String getUnlocalizedName(ItemStack stack) {
return this.getUnlocalizedName() + "." + types[stack.getMetadata()];
public String getTranslationKey(ItemStack stack) {
return this.getTranslationKey() + "." + types[stack.getMetadata()];
}
@Override

View File

@ -31,7 +31,7 @@ public final class Beziers {
int n = controls.length - 1;
for (int i = 0; i <= n; i++) {
double coeff = binomialCoeff(n, i) * Math.pow(t, i) * Math.pow(1 - t, n - i);
ret = ret.addVector(coeff * controls[i].x, coeff * controls[i].y, coeff * controls[i].z);
ret = ret.add(coeff * controls[i].x, coeff * controls[i].y, coeff * controls[i].z);
}
return ret;
}

View File

@ -88,7 +88,7 @@ public class LocalSidedWorld {
public Vec3d getRealPos(Vec3d relative) {
return MiscUtils.offset(new Vec3d(origin.getX()+.5, origin.getY()+.5, origin.getZ()+.5), facing, mirror,
relative.addVector(.5, .5, .5));
relative.add(.5, .5, .5));
}
public Vec3d getRealDirection(Vec3d dir) {
@ -100,14 +100,14 @@ public class LocalSidedWorld {
return f;
}
//+6 because getHorizontal uses abs(input%3). No idea why.
return EnumFacing.getHorizontal(f.getHorizontalIndex()-facing.getHorizontalIndex()+6);
return EnumFacing.byHorizontalIndex(f.getHorizontalIndex() - facing.getHorizontalIndex() + 6);
}
public EnumFacing transformedToReal(@Nullable EnumFacing f) {
if (f==null||f.getAxis()== EnumFacing.Axis.Y) {
return f;
}
return EnumFacing.getHorizontal(f.getHorizontalIndex()+facing.getHorizontalIndex()+2);
return EnumFacing.byHorizontalIndex(f.getHorizontalIndex() + facing.getHorizontalIndex() + 2);
}
//Getters+Setters

View File

@ -88,14 +88,14 @@ public final class MiscUtils {
if (mirror) {
right *= -1;
}
return offset(offset(p, f, forward), f.rotateY(), right).addVector(0, up, 0);
return offset(offset(p, f, forward), f.rotateY(), right).add(0, up, 0);
}
public static Vec3d offset(Vec3d in, EnumFacing f, double amount) {
if (amount==0) {
return in;
}
return in.addVector(f.getFrontOffsetX()*amount, f.getFrontOffsetY()*amount, f.getFrontOffsetZ()*amount);
return in.add(f.getXOffset() * amount, f.getYOffset() * amount, f.getZOffset() * amount);
}
/**

View File

@ -53,7 +53,13 @@
},
"type": {
"rs_wire": {
"model": "immersiveengineering:smartmodel/conn_rs_panel_conn"
"model": "immersiveengineering:smartmodel/connector",
"custom": {
"base": "industrialwires:block/rs_panel_conn.obj",
"layers": [
"SOLID"
]
}
},
"top": {
"model": "industrialwires:smartmodel/panel"

View File

@ -77,7 +77,11 @@
"model": "builtin/generated"
},
"connector": {
"model": "immersiveengineering:smartmodel/conn_empty"
"model": "immersiveengineering:smartmodel/connector",
"custom": {
"base": "builtin/generated",
"layers": []
}
}
},
"boolean0":