mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-25 14:34:28 +00:00
Merge branch 'Xandavin-master'
This commit is contained in:
commit
077e5ce57a
8 files changed
+147
-40
No files matched your search
+22
-6
@@ -1,9 +1,25 @@
|
||||
/bin
|
||||
/build
|
||||
/download
|
||||
/.settings
|
||||
/.gradle
|
||||
/eclipse
|
||||
/eclipseBin
|
||||
/.classpath
|
||||
|
||||
## gradle
|
||||
/.gradle
|
||||
/build
|
||||
|
||||
## ForgeGradle
|
||||
/run
|
||||
|
||||
## eclipse
|
||||
/eclipse
|
||||
/.settings
|
||||
/.metadata
|
||||
/.classpath
|
||||
/.project
|
||||
/bin
|
||||
|
||||
## intellij
|
||||
/out
|
||||
/.idea
|
||||
/*.iml
|
||||
/*.ipr
|
||||
/*.iws
|
||||
/atlassian-ide-plugin.xml
|
||||
+25
-9
@@ -44,12 +44,28 @@ configurations {
|
||||
compile.extendsFrom exportedCompile
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name "Mobius Repo"
|
||||
url "http://mobiusstrip.eu/maven"
|
||||
}
|
||||
maven {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile files('lib/cglib-nodep-2.2.3.jar')
|
||||
compile files('lib/NotEnoughItems-1.7.2-1.0.1-universal.jar')
|
||||
compile files('lib/CodeChickenCore-1.7.2-1.0.0-universal.jar')
|
||||
compile files('lib/CodeChickenLib-1.7.2-1.1.0.76-dev.jar')
|
||||
exportedCompile 'com.mod-buildcraft:buildcraft:6.0.11:api'
|
||||
exportedCompile 'cglib:cglib-nodep:3.1'
|
||||
|
||||
compile "mcp.mobius.waila:Waila:1.5.3_1.7.10"
|
||||
// These will be included automatically
|
||||
//compile "codechicken:NotEnoughItems:1.7.10-1.0.2.31:dev"
|
||||
//compile "codechicken:CodeChickenLib:1.7.10-1.1.1.95:dev"
|
||||
//compile "codechicken:CodeChickenCore:1.7.10-1.0.2.11:dev"
|
||||
|
||||
exportedCompile 'com.mod-buildcraft:buildcraft:6.0.17:api'
|
||||
}
|
||||
|
||||
// configure the source folders
|
||||
@@ -57,7 +73,7 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'src/main/java'
|
||||
exclude '**/enderio/trigger/**'
|
||||
exclude '**/enderio/trigger/**'
|
||||
// exclude 'some exclusion'
|
||||
// include 'some inclusion'
|
||||
}
|
||||
@@ -71,9 +87,9 @@ sourceSets {
|
||||
|
||||
processResources
|
||||
{
|
||||
processResources{
|
||||
from(zipTree("lib/cglib-nodep-2.2.3.jar"))
|
||||
}
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Brads" version="12">
|
||||
<profile kind="CodeFormatterProfile" name="EnderIO" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,6 +21,8 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.BlockConduitBundle;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
@@ -28,6 +30,7 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
|
||||
import crazypants.enderio.conduit.facade.BlockConduitFacade;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
@@ -37,6 +40,7 @@ import crazypants.render.BoundingBox;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.IBlockAccessWrapper;
|
||||
|
||||
public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -97,30 +101,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(x, y, z);
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
boolean renderConduit = true;
|
||||
if(bundle.hasFacade()) {
|
||||
|
||||
Block facadeId = bundle.getFacadeId();
|
||||
if(ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
bundle.setFacadeId(null, false);
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.WIRE_FRAME);
|
||||
} else {
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.FULL);
|
||||
renderConduit = false;
|
||||
}
|
||||
|
||||
BlockConduitFacade facb = EnderIO.blockConduitFacade;
|
||||
facb.setBlockOverride(bundle);
|
||||
facb.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
rb.setRenderBoundsFromBlock(facb);
|
||||
rb.renderStandardBlock(facb, x, y, z);
|
||||
facb.setBlockOverride(null);
|
||||
|
||||
bundle.setFacadeId(facadeId, false);
|
||||
|
||||
} else {
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.NONE);
|
||||
}
|
||||
boolean renderConduit = renderFacade(x, y, z, rb, bundle, player);
|
||||
|
||||
if(renderConduit) {
|
||||
BlockCoord loc = bundle.getBlockCoord();
|
||||
@@ -136,6 +117,54 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean renderFacade(int x, int y, int z, RenderBlocks rb, IConduitBundle bundle, EntityClientPlayerMP player) {
|
||||
boolean res = true;
|
||||
if(bundle.hasFacade()) {
|
||||
|
||||
Block facadeId = bundle.getFacadeId();
|
||||
if(ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
bundle.setFacadeId(null, false);
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.WIRE_FRAME);
|
||||
|
||||
BlockConduitFacade facb = EnderIO.blockConduitFacade;
|
||||
facb.setBlockOverride(bundle);
|
||||
facb.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
rb.setRenderBoundsFromBlock(facb);
|
||||
rb.renderStandardBlock(facb, x, y, z);
|
||||
facb.setBlockOverride(null);
|
||||
|
||||
bundle.setFacadeId(facadeId, false);
|
||||
|
||||
|
||||
} else if(facadeId != null){
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.FULL);
|
||||
res = false;
|
||||
|
||||
IBlockAccess origBa = rb.blockAccess;
|
||||
rb.blockAccess = new FacadeAccessWrapper(origBa);
|
||||
|
||||
// BlockConduitFacade facb = EnderIO.blockConduitFacade;
|
||||
// facb.setBlockOverride(bundle);
|
||||
// facb.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
// rb.setRenderBoundsFromBlock(facb);
|
||||
// rb.renderStandardBlock(facb, x, y, z);
|
||||
// facb.setBlockOverride(null);
|
||||
|
||||
//rb.renderStandardBlock(facadeId, x, y, z);
|
||||
rb.renderBlockByRenderType(facadeId, x, y, z);
|
||||
|
||||
|
||||
rb.blockAccess = origBa;
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.NONE);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public void renderConduits(IConduitBundle bundle, double x, double y, double z, float partialTick, float brightness) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
@@ -225,5 +254,51 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
public int getRenderId() {
|
||||
return BlockConduitBundle.rendererId;
|
||||
}
|
||||
|
||||
private class FacadeAccessWrapper extends IBlockAccessWrapper {
|
||||
|
||||
public FacadeAccessWrapper(IBlockAccess ba) {
|
||||
super(ba);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int x, int y, int z) {
|
||||
Block res = super.getBlock(x, y, z);
|
||||
if(res == EnderIO.blockConduitBundle) {
|
||||
TileEntity te = getTileEntity(x, y, z);
|
||||
if(te instanceof TileConduitBundle) {
|
||||
TileConduitBundle tcb = (TileConduitBundle)te;
|
||||
Block fac = tcb.getFacadeId();
|
||||
if(fac != null) {
|
||||
res = fac;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4) {
|
||||
return wrapped.getLightBrightnessForSkyBlocks(var1 , var2, var3, var4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockMetadata(int x, int y, int z) {
|
||||
Block block = super.getBlock(x, y, z);
|
||||
if(block == EnderIO.blockConduitBundle) {
|
||||
TileEntity te = getTileEntity(x, y, z);
|
||||
if(te instanceof TileConduitBundle) {
|
||||
TileConduitBundle tcb = (TileConduitBundle)te;
|
||||
Block fac = tcb.getFacadeId();
|
||||
if(fac != null) {
|
||||
return tcb.getFacadeMetadata();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user