Compare commits

...
9 Commits
Author SHA1 Message Date
Martin Robertz 29554c6a40 update 2024-02-22 13:27:10 +01:00
connor135246 fc5cba342c Fix Dark Steel Anvils in WAILA (#152)
Dark Steel Anvils wouldn't show the correct block in WAILA if the "Sneaky Facades" option was on.
2024-02-22 11:33:13 +01:00
Jason Mitchell 05d31b2e70 Some null checks to avoid outright crashing with Angelica, future thread saftey to come (#150) 2024-02-22 11:32:53 +01:00
Martin Robertz 5265340e3c update 2024-02-17 11:13:20 +01:00
Raven Szewczyk 37e239ae81 [ci skip] upgraded build system 2024-02-04 19:58:13 +00:00
Martin Robertz a725ebf120 update bs+deps 2024-01-31 22:47:55 +01:00
Pascal 6affe75674 fix protection mode of travel anchor (#149) 2024-01-31 07:53:01 +01:00
Martin Robertz 19f19d348b update bs+deps 2024-01-24 18:19:30 +01:00
Under 3154d03b4f Fix Anchor always rendering bug (#148)
* Fix Anchor always rendering bug

Also stop inventory scanning from happening every client tick, whoops.
Tested by placing a debug point on line 768 of TravelController (in getRequiredPower) and a debug point at line 656 of TravelController (in findTravelItemInInventoryOrBaubles). Debug points were used to verify that the code was ONLY hit when actual teleport happens, and not happening every tick like what was accidentally happening before.

* Run spotlessApply

Forgot that was a thing I do for GTNH stuff.
2024-01-24 10:58:27 -06:00
12 changed files with 238 additions and 1712 deletions

No files matched your search

+2 -1602
View File
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -1,21 +1,21 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.3.0:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.1.0:dev")
api('com.github.GTNewHorizons:EnderCore:0.3.1:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.4:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.19-GTNH:dev')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.2.7:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
compileOnly('com.github.GTNewHorizons:waila:1.6.5:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-310-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.25:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.3:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.0-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.13.2-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.7.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-325-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.71:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.5:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.3-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.14.1-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api') {transitive = false}
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
+150 -28
View File
@@ -1,63 +1,104 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Ender IO
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = EnderIO
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = crazypants.enderio
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Define other MCP mappings for dependency deobfuscation
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = EnderIO.java
gradleTokenModId =
gradleTokenModName =
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass =
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile = EnderIO.java
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage = api
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatability only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
@@ -65,6 +106,87 @@ containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = true
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+10 -10
View File
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
+3 -7
View File
@@ -6,6 +6,7 @@ pluginManagement {
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
@@ -16,12 +17,7 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -81,7 +81,7 @@ public enum TravelSource {
return 0;
}
TravelSource source = TravelController.instance.getTravelItemTravelSource(player);
TravelSource source = TravelController.instance.getTravelItemTravelSource(player, false);
if (source == null) {
return TravelSource.BLOCK.getMaxDistanceTravelledSq();
} else {
@@ -158,7 +158,7 @@ public class ConduitUtil {
}
public static boolean isFacadeHidden(IConduitBundle bundle, EntityPlayer player) {
return bundle.getFacadeId() != null && shouldHeldItemHideFacades(player);
return bundle != null && bundle.getFacadeId() != null && shouldHeldItemHideFacades(player);
}
public static ConduitDisplayMode getDisplayMode(EntityPlayer player) {
@@ -59,9 +59,11 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
IConduitBundle bundle = (IConduitBundle) te;
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
if (bundle.hasFacade() && bundle.getFacadeId().isOpaqueCube() && !ConduitUtil.isFacadeHidden(bundle, player)) {
if (bundle == null || (bundle.hasFacade() && bundle.getFacadeId().isOpaqueCube()
&& !ConduitUtil.isFacadeHidden(bundle, player))) {
return;
}
final Tessellator tessellator = Tessellator.instance;
float brightness = -1;
for (IConduit con : bundle.getConduits()) {
@@ -84,7 +86,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
Tessellator.instance.startDrawingQuads();
tessellator.startDrawingQuads();
}
renderer.renderDynamicEntity(this, bundle, con, x, y, z, partialTick, brightness);
}
@@ -92,7 +94,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
}
if (brightness != -1) {
Tessellator.instance.draw();
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
@@ -104,6 +106,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks rb) {
final Tessellator tessellator = Tessellator.instance;
int pass = RenderPassHelper.getBlockRenderPass();
if (pass == 1) {
// If the MC renderer is told that an alpha pass is required ( see
@@ -113,10 +116,10 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
// around is to ensure we always render something in this pass. Throwing
// in a polygon with a 0 area does the job
// See: https://github.com/MinecraftForge/MinecraftForge/issues/981
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
tessellator.addVertexWithUV(x, y, z, 0, 0);
tessellator.addVertexWithUV(x, y, z, 0, 0);
tessellator.addVertexWithUV(x, y, z, 0, 0);
tessellator.addVertexWithUV(x, y, z, 0, 0);
}
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(x, y, z);
@@ -125,7 +128,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
boolean renderedFacade = renderFacade(x, y, z, pass, rb, bundle, player);
boolean renderConduit = !renderedFacade || ConduitUtil.isFacadeHidden(bundle, player);
if (renderConduit && (pass == 0 || rb.overrideBlockTexture != null)) {
if (bundle != null && renderConduit && (pass == 0 || rb.overrideBlockTexture != null)) {
BlockCoord loc = bundle.getLocation();
float brightness;
if (!Config.updateLightingWhenHidingFacades && bundle.hasFacade()
@@ -138,17 +141,21 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
return true;
}
return renderedFacade || (bundle.hasFacade() && !bundle.getFacadeId().isOpaqueCube());
return renderedFacade || (bundle != null && bundle.hasFacade() && !bundle.getFacadeId().isOpaqueCube());
}
private boolean renderFacade(int x, int y, int z, int pass, RenderBlocks rb, IConduitBundle bundle,
EntityClientPlayerMP player) {
boolean res = false;
if (bundle == null) {
return false;
}
final Tessellator tessellator = Tessellator.instance;
if (bundle.hasFacade()) {
res = true;
Block facadeId = bundle.getFacadeId();
if (ConduitUtil.isFacadeHidden(bundle, player)) {
Tessellator.instance.setColorOpaque_F(1, 1, 1);
tessellator.setColorOpaque_F(1, 1, 1);
bundle.setFacadeId(null, false);
bundle.setFacadeRenderAs(FacadeRenderState.WIRE_FRAME);
@@ -192,15 +199,17 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
public void renderConduits(IConduitBundle bundle, double x, double y, double z, float partialTick, float brightness,
RenderBlocks rb) {
Tessellator tessellator = Tessellator.instance;
if (bundle == null) return;
final Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addTranslation((float) x, (float) y, (float) z);
// Conduits
Set<ForgeDirection> externals = new HashSet<ForgeDirection>();
Set<ForgeDirection> externals = new HashSet<>();
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
List<BoundingBox> wireBounds = new ArrayList<BoundingBox>();
List<BoundingBox> wireBounds = new ArrayList<>();
for (IConduit con : bundle.getConduits()) {
@@ -225,7 +234,8 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
// Internal conectors between conduits
List<CollidableComponent> connectors = bundle.getConnectors();
List<CollidableComponent> rendered = Lists.newArrayList();
for (CollidableComponent component : connectors) {
for (int i = 0; i < connectors.size(); i++) {
final CollidableComponent component = connectors.get(i);
if (component.conduitType != null) {
IConduit conduit = bundle.getConduit(component.conduitType);
if (conduit != null) {
@@ -261,12 +271,13 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
}
}
// render these after the 'normal' conduits so help with proper blending
for (BoundingBox wireBound : wireBounds) {
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
for (int i = 0; i < wireBounds.size(); i++) {
final BoundingBox wireBound = wireBounds.get(i);
tessellator.setColorRGBA_F(1, 1, 1, 0.25f);
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
}
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
tessellator.setColorRGBA_F(1, 1, 1, 1f);
// External connection terminations
if (rb.overrideBlockTexture == null) {
for (ForgeDirection dir : externals) {
@@ -279,7 +290,8 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
private void renderExternalConnection(ForgeDirection dir) {
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon(ConduitConnectorType.EXTERNAL);
BoundingBox[] bbs = ConduitGeometryUtil.instance.getExternalConnectorBoundingBoxes(dir);
for (BoundingBox bb : bbs) {
for (int i = 0; i < bbs.length; i++) {
final BoundingBox bb = bbs[i];
CubeRenderer.render(bb, tex, true);
}
}
@@ -152,7 +152,7 @@ public class TravelController {
TileEntity maybeAnchor = target.getTileEntity(toTp.worldObj);
if (!(maybeAnchor instanceof ITravelAccessable)) return "not anchor";
ITravelAccessable anchor = (ITravelAccessable) maybeAnchor;
if (!anchor.canBlockBeAccessed(toTp) && isValidTarget(toTp, target, TravelSource.BLOCK)) {
if (!isValidTarget(toTp, target, TravelSource.BLOCK)) {
return "not valid target";
}
return null;
@@ -527,7 +527,7 @@ public class TravelController {
}
onBlockCoord = getActiveTravelBlock(player);
boolean onBlock = onBlockCoord != null;
showTargets = onBlock || isTravelItemActive(player);
showTargets = onBlock || isTravelItemActive(player, false);
if (showTargets) {
updateSelectedTarget(player);
} else {
@@ -615,22 +615,23 @@ public class TravelController {
return ((IItemOfTravel) equipped.getItem()).getEnergyStored(equipped);
}
public boolean isTravelItemActive(EntityPlayer ep) {
return getTravelItemTravelSource(ep) != null;
public boolean isTravelItemActive(EntityPlayer ep, boolean checkInventoryAndBaubles) {
return getTravelItemTravelSource(ep, checkInventoryAndBaubles) != null;
}
/** Returns null if no travel item is in inventory/baubles. */
@Nullable
public TravelSource getTravelItemTravelSource(EntityPlayer ep) {
public TravelSource getTravelItemTravelSource(EntityPlayer ep, boolean checkInventoryAndBaubles) {
if (ep == null) {
return null;
}
ItemStack equipped = ep.getCurrentEquippedItem();
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)) {
equipped = findTravelItemInInventoryOrBaubles(ep);
if (checkInventoryAndBaubles) {
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)) {
equipped = findTravelItemInInventoryOrBaubles(ep);
}
}
if (equipped != null) {
if (equipped.getItem() instanceof ItemTeleportStaff) {
if (((ItemTeleportStaff) equipped.getItem()).isActive(ep, equipped)) {
@@ -684,7 +685,7 @@ public class TravelController {
* Baubles return value is unique/hacky, if <-1 return, then do the following to calculate the baubles slot:
* "Math.abs(returnval)-2" <br>
* Example: -3 return is Bauble slot 1, -2 return is Bauble slot 0
*
*
* @return -1 if no travel item found. 0 or more if item found in inventory. -2 or less if item found in Baubles.
*/
public int findTravelItemSlotInInventoryOrBaubles(EntityPlayer ep) {
@@ -764,7 +765,7 @@ public class TravelController {
}
public int getRequiredPower(EntityPlayer player, TravelSource source, BlockCoord coord) {
if (!isTravelItemActive(player)) {
if (!isTravelItemActive(player, true)) {
return 0;
}
int requiredPower;
@@ -1063,7 +1064,7 @@ public class TravelController {
@SideOnly(Side.CLIENT)
private int getMaxTravelDistanceSqForPlayer(EntityPlayer player) {
TravelSource source = getTravelItemTravelSource(player);
TravelSource source = getTravelItemTravelSource(player, false);
if (source == null) {
return TravelSource.BLOCK.getMaxDistanceTravelledSq();
}
@@ -69,7 +69,8 @@ public class TravelEntitySpecialRenderer extends TileEntitySpecialRenderer {
Vector3d eye = Util.getEyePositionEio(Minecraft.getMinecraft().thePlayer);
Vector3d loc = new Vector3d(tileentity.xCoord + 0.5, tileentity.yCoord + 0.5, tileentity.zCoord + 0.5);
double maxDistance = TravelSource.BLOCK.getMaxDistanceTravelledSq();
TravelSource source = TravelController.instance.getTravelItemTravelSource(Minecraft.getMinecraft().thePlayer);
TravelSource source = TravelController.instance
.getTravelItemTravelSource(Minecraft.getMinecraft().thePlayer, false);
if (source != null) {
maxDistance = source.getMaxDistanceTravelledSq();
}
@@ -140,30 +140,24 @@ public class WailaCompat implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
MovingObjectPosition pos = accessor.getPosition();
if (config.getConfig("facades.hidden")) {
if (accessor.getBlock() instanceof IFacade) {
// If facades are hidden, we need to ignore it
if (accessor.getTileEntity() instanceof IConduitBundle && ConduitUtil
.isFacadeHidden((IConduitBundle) accessor.getTileEntity(), accessor.getPlayer())) {
return null;
}
IFacade bundle = (IFacade) accessor.getBlock();
Block facade = bundle.getFacade(
accessor.getWorld(),
if (config.getConfig("facades.hidden") && accessor.getBlock() instanceof IFacade) {
// If facades are hidden, we need to ignore it
if (accessor.getTileEntity() instanceof IConduitBundle
&& ConduitUtil.isFacadeHidden((IConduitBundle) accessor.getTileEntity(), accessor.getPlayer())) {
return null;
}
IFacade bundle = (IFacade) accessor.getBlock();
Block facade = bundle
.getFacade(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getSide().ordinal());
if (facade != accessor.getBlock()) {
ItemStack ret = facade.getPickBlock(
pos,
new WailaWorldWrapper(accessor.getWorld()),
pos.blockX,
pos.blockY,
pos.blockZ,
accessor.getSide().ordinal());
if (facade != accessor.getBlock()) {
ItemStack ret = facade.getPickBlock(
pos,
new WailaWorldWrapper(accessor.getWorld()),
pos.blockX,
pos.blockY,
pos.blockZ,
accessor.getPlayer());
return ret;
}
accessor.getPlayer());
return ret;
}
} else if (accessor.getBlock() instanceof BlockDarkSteelAnvil) {
return accessor.getBlock().getPickBlock(