mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
69
Commits
2.7.2
...
2.9.10-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cd91b0112 | ||
|
|
29f8752c98 | ||
|
|
41657d44b1 | ||
|
|
4d2ace0d3f | ||
|
|
38845890c1 | ||
|
|
be92550e42 | ||
|
|
63971381cc | ||
|
|
09238b09ef | ||
|
|
6e5087dac1 | ||
|
|
a12e5f37ba | ||
|
|
d023c347cb | ||
|
|
56a642cebf | ||
|
|
68bc2116b4 | ||
|
|
3e72fe00ac | ||
|
|
efbe0ba259 | ||
|
|
0ef9ce80ea | ||
|
|
bc7975f26c | ||
|
|
b3acdd8f35 | ||
|
|
559c64e82c | ||
|
|
2fe6acc762 | ||
|
|
80c83d3fce | ||
|
|
32556e078e | ||
|
|
ace514f628 | ||
|
|
0102b89c33 | ||
|
|
b65afde754 | ||
|
|
4a0a427186 | ||
|
|
e04e2e3411 | ||
|
|
316db4bd77 | ||
|
|
f43936c29a | ||
|
|
c6471ed6b0 | ||
|
|
654b95da1a | ||
|
|
d70263f3af | ||
|
|
c10f74486b | ||
|
|
c7db2c4840 | ||
|
|
948a021f3e | ||
|
|
346bbf4e53 | ||
|
|
5769ebe3cb | ||
|
|
4558f194be | ||
|
|
e12142890e | ||
|
|
e6ebb5dfec | ||
|
|
1d4f6831dd | ||
|
|
726ce46475 | ||
|
|
d01de95e8e | ||
|
|
b15d357f1a | ||
|
|
0fbf6f05ba | ||
|
|
bf9c2cd2c7 | ||
|
|
51b4c4e74c | ||
|
|
cf6b678dd9 | ||
|
|
6c205150b1 | ||
|
|
e39a1e1eb6 | ||
|
|
4a94c1ba90 | ||
|
|
0fc382dd13 | ||
|
|
04964e15e4 | ||
|
|
085ccc9d21 | ||
|
|
1903589e29 | ||
|
|
46971bbe0e | ||
|
|
4ccecf7bc0 | ||
|
|
92fb58f0c6 | ||
|
|
54c6db0afc | ||
|
|
84d9dcaf00 | ||
|
|
af923d1977 | ||
|
|
efb918fc6d | ||
|
|
6447ffb4d5 | ||
|
|
fb4c9bde59 | ||
|
|
bd47a39c83 | ||
|
|
43d74c9a7a | ||
|
|
6d3a631bb0 | ||
|
|
ccdef03296 | ||
|
|
56e163c234 |
No files matched your search
@@ -27,3 +27,4 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
+15
-13
@@ -1,22 +1,24 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.5:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.4:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.21-GTNH:dev')
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.2.9:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.7:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.21:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42: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')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.13.21-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.7.1:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-328-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.4:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-586-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.79: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('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.256:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.7-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.23:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.0-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.2-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.13-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')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
@@ -24,5 +26,5 @@ dependencies {
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-alpha30:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta40:api') {transitive = false}
|
||||
}
|
||||
+13
-2
@@ -14,7 +14,7 @@ modId = EnderIO
|
||||
modGroup = crazypants.enderio
|
||||
|
||||
# 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.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
@@ -85,6 +85,11 @@ accessTransformersFile =
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
@@ -117,9 +122,15 @@ 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.
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# 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.
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -84,7 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -203,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
Vendored
+2
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.BlockConduitBundle;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.facade.FacadeRenderer;
|
||||
import crazypants.enderio.conduit.gas.GasConduit;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
@@ -108,7 +107,7 @@ import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.ranged.RangeRenerer;
|
||||
import crazypants.enderio.machine.ranged.RangeRenderer;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import crazypants.enderio.machine.solar.BlockSolarPanel;
|
||||
@@ -378,7 +377,6 @@ public class ClientProxy extends CommonProxy {
|
||||
cbr = new ConduitBundleRenderer((float) Config.conduitScale);
|
||||
BlockConduitBundle.rendererId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(cbr);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileConduitBundle.class, cbr);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTravelAnchor.class, new TravelEntitySpecialRenderer());
|
||||
|
||||
@@ -421,7 +419,7 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(KeyTracker.instance);
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(SoundEntity.class, new SoundRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenerer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenderer());
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(SoundDetector.instance);
|
||||
FMLCommonHandler.instance().bus().register(SoundDetector.instance);
|
||||
|
||||
@@ -186,7 +186,7 @@ import crazypants.util.EE3Util;
|
||||
modid = MODID,
|
||||
name = MOD_NAME,
|
||||
version = VERSION,
|
||||
dependencies = "required-after:CoFHLib@(1.0.3B3,);after:endercore;after:MineFactoryReloaded;after:Forestry;after:Waila@[1.5.8,);after:Thaumcraft;after:appliedenergistics2@[rv2-beta-8,);after:chisel",
|
||||
dependencies = "required-after:CoFHLib@(1.0.3B3,);required-after:endercore;after:MineFactoryReloaded;after:Forestry;after:Waila@[1.5.8,);after:Thaumcraft;after:appliedenergistics2@[rv2-beta-8,);after:chisel;required-after:gtnhlib@[0.2.10,)",
|
||||
guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
|
||||
@@ -208,7 +208,7 @@ public class EnderIO {
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi_post");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
|
||||
@@ -67,7 +67,6 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
if (MicroblocksUtil.supportMicroblocks() && tryAddToMicroblocks(stack, player, world, x, y, z, side)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord placeAt = Util.canPlaceItem(stack, EnderIO.blockConduitBundle, player, world, x, y, z, side);
|
||||
if (placeAt != null) {
|
||||
if (!world.isRemote) {
|
||||
@@ -84,9 +83,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.values()[side];
|
||||
int placeX = x + dir.offsetX;
|
||||
int placeY = y + dir.offsetY;
|
||||
@@ -116,7 +113,6 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,8 +158,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
System.out.println("AbstractItemConduit.onItemUse: Conduit null.");
|
||||
return false;
|
||||
}
|
||||
bundle.removeConduit(existingConduit);
|
||||
bundle.addConduit(newConduit);
|
||||
bundle.replaceConduit(existingConduit, newConduit);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
for (ItemStack drop : existingConduit.getDrops()) {
|
||||
|
||||
@@ -697,10 +697,6 @@ public class ConduitRecipes {
|
||||
|
||||
res.stackSize = 1;
|
||||
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
|
||||
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
|
||||
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
if (Config.enableMEUltraDenseConduits) {
|
||||
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,8 @@ public interface IConduitBundle extends IInternalPowerHandler, IFluidHandler, II
|
||||
|
||||
void addConduit(IConduit conduit);
|
||||
|
||||
void replaceConduit(IConduit original, IConduit replacement);
|
||||
|
||||
void removeConduit(IConduit conduit);
|
||||
|
||||
Collection<IConduit> getConduits();
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.gtnewhorizon.gtnhlib.concurrent.cas.CasList;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -66,7 +67,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
public static final short NBT_VERSION = 1;
|
||||
|
||||
private final List<IConduit> conduits = new ArrayList<IConduit>();
|
||||
private final List<IConduit> conduits = new CasList<>();
|
||||
|
||||
private Block facadeId = null;
|
||||
private int facadeMeta = 0;
|
||||
@@ -74,9 +75,9 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
private boolean facadeChanged;
|
||||
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<CollidableComponent>();
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<>();
|
||||
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<CollidableComponent>();
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<>();
|
||||
|
||||
private boolean conduitsDirty = true;
|
||||
private boolean collidablesDirty = true;
|
||||
@@ -404,6 +405,29 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
dirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceConduit(IConduit original, IConduit replacement) {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
// If you're wondering why I am not using conduit.writeToNBT, it is because there is some data that should not
|
||||
// persist, some of which causes crashes with energy conduits.
|
||||
NBTTagCompound[] originalData = new NBTTagCompound[ForgeDirection.values().length];
|
||||
for (ForgeDirection conduitConnection : original.getExternalConnections()) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
original.writeConnectionSettingsToNBT(conduitConnection, tag);
|
||||
originalData[conduitConnection.ordinal()] = tag;
|
||||
}
|
||||
removeConduit(original);
|
||||
addConduit(replacement);
|
||||
for (int i = 0; i < originalData.length; i++) {
|
||||
NBTTagCompound nbt = originalData[i];
|
||||
if (nbt != null) {
|
||||
replacement.readConduitSettingsFromNBT(ForgeDirection.values()[i], nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConduit(IConduit conduit) {
|
||||
if (conduit != null) {
|
||||
@@ -513,7 +537,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public List<CollidableComponent> getConnectors() {
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
List<CollidableComponent> result = new ArrayList<>();
|
||||
addConnectors(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
}
|
||||
if (!foundFluid) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
FluidStack couldDrain = extTank.drain(dir.getOpposite(), MAX_EXTRACT_PER_TICK, false);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -56,10 +56,17 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
}
|
||||
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (isNSEWUD(component.dir)) {
|
||||
LiquidConduit lc = (LiquidConduit) conduit;
|
||||
IIcon fluidTex = conduit.getTransmitionTextureForState(component);
|
||||
FluidStack fluid = lc.getFluidType();
|
||||
if (fluid != null) {
|
||||
renderFluidOutline(component, fluid);
|
||||
@@ -67,33 +74,40 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(cube, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), component.dir, false);
|
||||
// This check is kinda broken, but whatever, it was like that when this was done in a TESR too
|
||||
if (lc.getTank().getFilledRatio() <= 0) {
|
||||
continue;
|
||||
}
|
||||
tessellator.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
drawSection(
|
||||
cube,
|
||||
fluidTex.getMinU(),
|
||||
fluidTex.getMaxU(),
|
||||
fluidTex.getMinV(),
|
||||
fluidTex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
} else {
|
||||
drawSection(
|
||||
component.bound,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound
|
||||
.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(
|
||||
component.dir,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,27 +127,29 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = new WeakHashMap<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>>();
|
||||
private static final Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = Collections
|
||||
.synchronizedMap(new WeakHashMap<>());
|
||||
|
||||
public static List<CachableRenderStatement> computeFluidOutlineToCache(CollidableComponent component, Fluid fluid,
|
||||
double scaleFactor, float outlineWidth) {
|
||||
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache.get(component);
|
||||
if (cache0 == null) {
|
||||
cache0 = new HashMap<Fluid, List<CachableRenderStatement>>();
|
||||
cache.put(component, cache0);
|
||||
}
|
||||
// Only init once per component across all threads so the cache stays accurate.
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache
|
||||
.computeIfAbsent(component, _k -> new ConcurrentHashMap<>());
|
||||
// The rest of this function 'should' be in a `computeIfAbsent` as well for:
|
||||
// `cache0.computeIfAbsent(fluid, _k -> ...)` but that won't cause a bug in this case,
|
||||
// just a bit more garbage.
|
||||
List<CachableRenderStatement> data = cache0.get(fluid);
|
||||
if (data != null) {
|
||||
return data;
|
||||
}
|
||||
data = new ArrayList<CachableRenderStatement>();
|
||||
cache0.put(fluid, data);
|
||||
data = new ArrayList<>();
|
||||
|
||||
IIcon texture = fluid.getStillIcon();
|
||||
if (texture == null) {
|
||||
texture = fluid.getIcon();
|
||||
if (texture == null) {
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -192,6 +208,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
}
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -239,49 +256,6 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
// done in the dynamic section
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
if (((LiquidConduit) conduit).getTank().getFilledRatio() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Collection<CollidableComponent> components = conduit.getCollidableComponents();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
calculateRatios((LiquidConduit) conduit);
|
||||
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
|
||||
|
||||
IIcon tex;
|
||||
for (CollidableComponent component : components) {
|
||||
if (renderComponent(component)) {
|
||||
if (isNSEWUD(component.dir) && conduit.getTransmitionTextureForState(component) != null) {
|
||||
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tex = conduit.getTransmitionTextureForState(component);
|
||||
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(
|
||||
cube,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setVerticesForTransmission(BoundingBox bound, ForgeDirection id) {
|
||||
|
||||
|
||||
@@ -14,7 +14,5 @@ public interface IMEConduit extends IConduit {
|
||||
|
||||
boolean isDense();
|
||||
|
||||
boolean isDenseUltra();
|
||||
|
||||
int getChannelsInUse();
|
||||
}
|
||||
@@ -15,8 +15,7 @@ public class ItemMEConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMeConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "DenseUltra", "enderio:itemMeConduitDenseUltra") };
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense") };
|
||||
|
||||
public static ItemMEConduit create() {
|
||||
ItemMEConduit result = new ItemMEConduit();
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -51,7 +50,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public static IIcon[] longTextures;
|
||||
|
||||
private boolean isDense;
|
||||
private boolean isDenseUltra;
|
||||
private int playerID = -1;
|
||||
|
||||
public MEConduit() {
|
||||
@@ -59,7 +57,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
|
||||
public MEConduit(int itemDamage) {
|
||||
isDenseUltra = itemDamage == 2;
|
||||
isDense = itemDamage == 1;
|
||||
}
|
||||
|
||||
@@ -68,16 +65,14 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
coreTextures = new IIcon[3];
|
||||
longTextures = new IIcon[3];
|
||||
coreTextures = new IIcon[2];
|
||||
longTextures = new IIcon[2];
|
||||
|
||||
coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
|
||||
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
|
||||
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");
|
||||
|
||||
longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
|
||||
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
|
||||
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,10 +82,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
});
|
||||
}
|
||||
|
||||
public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
|
||||
if (isDenseUltra) {
|
||||
return 2;
|
||||
}
|
||||
public static int getDamageForState(boolean isDense) {
|
||||
if (isDense) {
|
||||
return 1;
|
||||
}
|
||||
@@ -104,7 +96,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,7 +114,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setBoolean("isDense", isDense);
|
||||
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
|
||||
nbtRoot.setInteger("playerID", playerID);
|
||||
}
|
||||
|
||||
@@ -135,9 +126,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
} else {
|
||||
playerID = -1;
|
||||
}
|
||||
if (nbtRoot.hasKey("isDenseUltra")) {
|
||||
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerID(int playerID) {
|
||||
@@ -208,22 +196,12 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Method(modid = "appliedenergistics2")
|
||||
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
|
||||
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
|
||||
if (isDenseUltra()) {
|
||||
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|
||||
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
|
||||
} else if (isDense()) {
|
||||
return true;
|
||||
} else {
|
||||
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
int state = getDamageForState(isDense, isDenseUltra);
|
||||
int state = getDamageForState(isDense);
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return coreTextures[state];
|
||||
} else {
|
||||
@@ -400,9 +378,4 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean isDense() {
|
||||
return isDense;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDenseUltra() {
|
||||
return isDenseUltra;
|
||||
}
|
||||
}
|
||||
@@ -43,9 +43,6 @@ public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
@Override
|
||||
public EnumSet<GridFlags> getFlags() {
|
||||
if (conduit.isDenseUltra()) {
|
||||
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
if (conduit.isDense()) {
|
||||
return EnumSet.of(GridFlags.DENSE_CAPACITY);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,13 +18,9 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.IBlockAccessWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -53,59 +48,12 @@ import crazypants.util.RenderPassHelper;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@ThreadSafeISBRH(perThread = false)
|
||||
public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
public class ConduitBundleRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public ConduitBundleRenderer(float conduitScale) {}
|
||||
|
||||
public ConduitBundleRenderer() {}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
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()) {
|
||||
if (ConduitUtil.renderConduit(player, con)) {
|
||||
final ConduitRenderer renderer = con.getRenderer();
|
||||
if (renderer.isDynamic()) {
|
||||
if (brightness == -1) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
brightness = bundle.getEntity().getWorldObj()
|
||||
.getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);
|
||||
|
||||
RenderUtil.bindBlockTexture();
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
renderer.renderDynamicEntity(this, bundle, con, x, y, z, partialTick, brightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (brightness != -1) {
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks rb) {
|
||||
|
||||
@@ -10,8 +10,4 @@ public interface ConduitRenderer {
|
||||
void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x, double y,
|
||||
double z, float partialTick, float worldLight, RenderBlocks rb);
|
||||
|
||||
boolean isDynamic();
|
||||
|
||||
void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x,
|
||||
double y, double z, float partialTick, float worldLight);
|
||||
}
|
||||
@@ -63,10 +63,6 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con,
|
||||
double x, double y, double z, float partialTick, float worldLight) {}
|
||||
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
|
||||
@@ -349,8 +345,4 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
return new BoundingBox[] { bb };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,6 @@ public final class Config {
|
||||
public static final Section sectionMobConfig = new Section("Mob Config", "mobconfig");
|
||||
public static final Section sectionRailConfig = new Section("Rail", "railconfig");
|
||||
public static final Section sectionEnchantments = new Section("Enchantments", "enchantments");
|
||||
public static final Section sectionWeather = new Section("Weather", "weather");
|
||||
public static final Section sectionTelepad = new Section("Telepad", "telepad");
|
||||
public static final Section sectionInventoryPanel = new Section("InventoryPanel", "inventorypanel");
|
||||
public static final Section sectionMisc = new Section("Misc", "misc");
|
||||
@@ -175,6 +174,34 @@ public final class Config {
|
||||
*/
|
||||
public static int teleportStaffFailedBlinkDistance = 64;
|
||||
|
||||
/**
|
||||
* Sets the teleport staff right-click action.
|
||||
*
|
||||
* <p>
|
||||
* Values:
|
||||
* <ul>
|
||||
* <li><b>0:</b> Do nothing
|
||||
* <li><b>1:</b> Teleport to look
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor <em>(default)</em>
|
||||
* </ul>
|
||||
*/
|
||||
public static int teleportStaffAction = 3;
|
||||
|
||||
/**
|
||||
* Sets the teleport staff sneak right-click action.
|
||||
*
|
||||
* <p>
|
||||
* Values:
|
||||
* <ul>
|
||||
* <li><b>0:</b> Do nothing
|
||||
* <li><b>1:</b> Teleport to look <em>(default)</em>
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor
|
||||
* </ul>
|
||||
*/
|
||||
public static int teleportStaffSneakAction = 1;
|
||||
|
||||
public static int enderIoRange = 8;
|
||||
public static boolean enderIoMeAccessEnabled = true;
|
||||
|
||||
@@ -257,6 +284,8 @@ public final class Config {
|
||||
|
||||
public static int darkSteelApiaristArmorCost = 10;
|
||||
|
||||
public static int darkSteelTrackmanGogglesCost = 10;
|
||||
|
||||
public static int darkSteelSwimCost = 10;
|
||||
|
||||
public static int darkSteelNightVisionCost = 10;
|
||||
@@ -361,6 +390,8 @@ public final class Config {
|
||||
"TwilightForest:item.steeleafHoe", "TwilightForest:item.ironwoodHoe", "IC2:itemToolBronzeHoe" };
|
||||
public static List<ItemStack> farmHoes = new ArrayList<ItemStack>();
|
||||
public static int farmSaplingReserveAmount = 8;
|
||||
public static double farmParticlesMaxRange = 64;
|
||||
public static int farmParticlesCount = 15;
|
||||
|
||||
public static int magnetPowerUsePerSecondRF = 1;
|
||||
public static int magnetPowerCapacityRF = 100000;
|
||||
@@ -445,7 +476,6 @@ public final class Config {
|
||||
|
||||
public static boolean isGasConduitEnabled = true;
|
||||
public static boolean enableMEConduits = true;
|
||||
public static boolean enableMEUltraDenseConduits = false;
|
||||
public static boolean enableOCConduits = true;
|
||||
public static boolean enableOCConduitsAnimatedTexture = true;
|
||||
|
||||
@@ -513,10 +543,6 @@ public final class Config {
|
||||
public static boolean spawnGuardStopAllSlimesDebug = false;
|
||||
public static boolean spawnGuardStopAllSquidSpawning = false;
|
||||
|
||||
public static int weatherObeliskClearFluid = 2000;
|
||||
public static int weatherObeliskRainFluid = 500;
|
||||
public static int weatherObeliskThunderFluid = 1000;
|
||||
|
||||
// Loot Defaults
|
||||
public static boolean lootDarkSteel = true;
|
||||
public static boolean lootItemConduitProbe = true;
|
||||
@@ -569,6 +595,8 @@ public final class Config {
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static float fusedQuartzExplosionResistance = 2000.0f;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -1269,6 +1297,27 @@ public final class Config {
|
||||
"Number of blocks teleported when no block is being looked at.")
|
||||
.getInt(teleportStaffFailedBlinkDistance);
|
||||
|
||||
teleportStaffAction = config.get(
|
||||
sectionStaff.name,
|
||||
"teleportStaffAction",
|
||||
teleportStaffAction,
|
||||
"Sets the action for right-click with the staff of teleportation. Values:\n" + " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor (default)")
|
||||
.getInt(teleportStaffAction);
|
||||
|
||||
teleportStaffSneakAction = config.get(
|
||||
sectionStaff.name,
|
||||
"teleportStaffSneakAction",
|
||||
teleportStaffSneakAction,
|
||||
"Sets the action for sneak right-click with the staff of teleportation. Values:\n"
|
||||
+ " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look (default)\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor")
|
||||
.getInt(teleportStaffSneakAction);
|
||||
|
||||
enderIoRange = config.get(
|
||||
sectionEfficiency.name,
|
||||
"enderIoRange",
|
||||
@@ -1559,6 +1608,14 @@ public final class Config {
|
||||
darkSteelApiaristArmorCost,
|
||||
"Number of levels required for the Apiarist Armor upgrade.").getInt(darkSteelApiaristArmorCost);
|
||||
|
||||
darkSteelTrackmanGogglesCost = config
|
||||
.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTrackmanGogglesCost",
|
||||
darkSteelTrackmanGogglesCost,
|
||||
"Number of levels required for the Trackman's Goggles upgrade.")
|
||||
.getInt(darkSteelTrackmanGogglesCost);
|
||||
|
||||
darkSteelTravelCost = config.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTravelCost",
|
||||
@@ -2060,6 +2117,18 @@ public final class Config {
|
||||
+ "always shear all leaves.")
|
||||
.getInt(farmSaplingReserveAmount);
|
||||
|
||||
farmParticlesMaxRange = config.get(
|
||||
sectionFarm.name,
|
||||
"farmParticlesMaxRange",
|
||||
farmParticlesMaxRange,
|
||||
"The max range of the farm action particles.").getDouble(farmParticlesMaxRange);
|
||||
|
||||
farmParticlesCount = config.get(
|
||||
sectionFarm.name,
|
||||
"farmParticlesCount",
|
||||
farmParticlesCount,
|
||||
"The number of particles produces by farm action.").getInt(farmParticlesCount);
|
||||
|
||||
combustionGeneratorUseOpaqueModel = config
|
||||
.get(
|
||||
sectionAesthetic.name,
|
||||
@@ -2352,11 +2421,6 @@ public final class Config {
|
||||
sectionItems.name,
|
||||
enableMEConduits,
|
||||
"Allows ME conduits. Only has an effect with AE2 installed.");
|
||||
enableMEUltraDenseConduits = config.getBoolean(
|
||||
"enableMEUltraDenseConduits",
|
||||
sectionItems.name,
|
||||
enableMEUltraDenseConduits,
|
||||
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
|
||||
enableOCConduits = config.getBoolean(
|
||||
"enableOCConduits",
|
||||
sectionItems.name,
|
||||
@@ -2679,22 +2743,6 @@ public final class Config {
|
||||
spawnGuardStopAllSquidSpawning,
|
||||
"When true no squid will be spawned.");
|
||||
|
||||
weatherObeliskClearFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskClearFluid",
|
||||
weatherObeliskClearFluid,
|
||||
"The fluid required (in mB) to set the world to clear weather").getInt();
|
||||
weatherObeliskRainFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskRainFluid",
|
||||
weatherObeliskRainFluid,
|
||||
"The fluid required (in mB) to set the world to rainy weather").getInt();
|
||||
weatherObeliskThunderFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskThunderFluid",
|
||||
weatherObeliskThunderFluid,
|
||||
"The fluid required (in mB) to set the world to thundering weather").getInt();
|
||||
|
||||
// Loot Config
|
||||
lootDarkSteel = config.getBoolean(
|
||||
"lootDarkSteel",
|
||||
@@ -2923,6 +2971,13 @@ public final class Config {
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
fusedQuartzExplosionResistance = config.getFloat(
|
||||
"fusedQuartzExplosionResistance",
|
||||
sectionMisc.name,
|
||||
2000.0f,
|
||||
0.0f,
|
||||
Float.MAX_VALUE,
|
||||
"How blast resistant the three Fused Quartz blocks should be.");
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -25,16 +25,19 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketMagnetState.SlotType;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelController;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState.Type;
|
||||
import crazypants.enderio.item.darksteel.SoundDetector;
|
||||
import crazypants.enderio.item.darksteel.upgrade.JumpUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import crazypants.util.BaublesUtil;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
|
||||
public class KeyTracker {
|
||||
|
||||
@@ -54,6 +57,8 @@ public class KeyTracker {
|
||||
|
||||
private final KeyBinding gogglesKey;
|
||||
|
||||
private final KeyBinding trackmansGogglesKey;
|
||||
|
||||
private final KeyBinding yetaWrenchMode;
|
||||
|
||||
private final KeyBinding magnetKey;
|
||||
@@ -84,6 +89,12 @@ public class KeyTracker {
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(gogglesKey);
|
||||
|
||||
trackmansGogglesKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.trackmansgoggles"),
|
||||
Keyboard.KEY_NONE,
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(trackmansGogglesKey);
|
||||
|
||||
stepAssistKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.stepassist"),
|
||||
Keyboard.KEY_NONE,
|
||||
@@ -128,6 +139,7 @@ public class KeyTracker {
|
||||
handleNightVision();
|
||||
handleYetaWrench();
|
||||
handleGoggles();
|
||||
handleTrackmanGoggles();
|
||||
handleStepAssist();
|
||||
handleSpeed();
|
||||
handleJump();
|
||||
@@ -154,7 +166,8 @@ public class KeyTracker {
|
||||
if (player != null) {
|
||||
ItemStack travelItem = player.getHeldItem();
|
||||
if (travelItem == null || travelItem.getItem() == null
|
||||
|| !(travelItem.getItem() instanceof IItemOfTravel)) {
|
||||
|| !(travelItem.getItem() instanceof IItemOfTravel)
|
||||
|| !((IItemOfTravel) travelItem.getItem()).isActive(player, travelItem)) {
|
||||
travelItem = TravelController.instance.findTravelItemInInventoryOrBaubles(player);
|
||||
}
|
||||
|
||||
@@ -231,6 +244,22 @@ public class KeyTracker {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTrackmanGoggles() {
|
||||
if (trackmansGogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (!TrackmanGogglesUpgrade.isUpgradeEquipped(player)) {
|
||||
return;
|
||||
}
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
((ItemDarkSteelArmor) helmet.getItem()).incrementAura(helmet);
|
||||
IToolGoggles.displaySwitchMessage(
|
||||
Minecraft.getMinecraft().theWorld,
|
||||
Minecraft.getMinecraft().thePlayer,
|
||||
((ItemDarkSteelArmor) helmet.getItem()).getCurrentAura(helmet));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGoggles() {
|
||||
if (gogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
@@ -33,6 +33,7 @@ import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SwimUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.endergy.AlloyEndergy;
|
||||
@@ -75,6 +76,9 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(ApiaristArmorUpgrade.LEGS);
|
||||
upgrades.add(ApiaristArmorUpgrade.BOOTS);
|
||||
}
|
||||
if (Loader.isModLoaded("Railcraft")) {
|
||||
upgrades.add(TrackmanGogglesUpgrade.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
@@ -34,9 +35,13 @@ import crazypants.enderio.item.darksteel.upgrade.ApiaristArmorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.NaturalistEyeUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
import mods.railcraft.common.core.RailcraftConfig;
|
||||
import mods.railcraft.common.items.ItemGoggles.GoggleAura;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -45,11 +50,12 @@ import thaumcraft.api.nodes.IRevealer;
|
||||
@InterfaceList({ @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
|
||||
@Interface(iface = "mods.railcraft.api.core.items.IToolGoggles", modid = "Railcraft"),
|
||||
@Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry"),
|
||||
@Interface(iface = "forestry.api.core.IArmorNaturalist", modid = "Forestry") })
|
||||
public class ItemDarkSteelArmor extends ItemArmor
|
||||
implements IEnergyContainerItem, ISpecialArmor, IAdvancedTooltipProvider, IDarkSteelItem, IGoggles, IRevealer,
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist {
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist, IToolGoggles {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("darkSteel", 35, new int[] { 2, 6, 5, 2 }, 15);
|
||||
@@ -322,9 +328,45 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
@Override
|
||||
@Method(modid = "Forestry")
|
||||
public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee) {
|
||||
if (armor == null || DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
if (armor == null || !DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
return NaturalistEyeUpgrade.isUpgradeEquipped(player);
|
||||
}
|
||||
|
||||
// Railcraft
|
||||
|
||||
public void incrementAura(ItemStack goggles) {
|
||||
if (goggles != null && goggles.getItem() instanceof ItemDarkSteelArmor
|
||||
&& DarkSteelItems.isArmorPart(goggles.getItem(), 0)) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data == null) {
|
||||
data = new NBTTagCompound();
|
||||
goggles.setTagCompound(data);
|
||||
}
|
||||
byte aura = data.getByte("aura");
|
||||
aura++;
|
||||
if (aura >= GoggleAura.VALUES.length) aura = 0;
|
||||
data.setByte("aura", aura);
|
||||
|
||||
if (this.getCurrentAura(goggles) == GoggleAura.TRACKING && !RailcraftConfig.isTrackingAuraEnabled()) {
|
||||
incrementAura(goggles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Railcraft")
|
||||
public GoggleAura getCurrentAura(ItemStack goggles) {
|
||||
if (TrackmanGogglesUpgrade.loadFromItem(goggles) != null) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data != null) {
|
||||
return GoggleAura.VALUES[data.getByte("aura")];
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -386,7 +386,15 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
@Override
|
||||
public boolean isActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isTravelUpgradeActive(ep, equipped);
|
||||
if (ep != null && equipped != null && isTravelUpgradeActive(ep, equipped)) {
|
||||
// Only "active" if held while sneaking. But still "active" for the purposes of travel keybind if not held
|
||||
if (isEquipped(ep)) {
|
||||
return ep.isSneaking();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -400,12 +408,12 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
return ep != null && equipped != null && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (isTravelUpgradeActive(player, stack)) {
|
||||
if (isActive(player, stack)) {
|
||||
if (world.isRemote) {
|
||||
if (TravelController.instance.activateTravelAccessable(stack, world, player, TravelSource.STAFF)) {
|
||||
player.swingItem();
|
||||
|
||||
@@ -8,13 +8,17 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem {
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem, IHazardProtector {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("endSteel", 50, new int[] { 4, 7, 10, 5 }, 25);
|
||||
@@ -77,4 +81,11 @@ public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelIt
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
/// GT5 Hazmat protection
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
@Override
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,17 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem {
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh") })
|
||||
public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem, IHazardProtector {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("stellarAlloy", 75, new int[] { 8, 14, 18, 7 }, 25);
|
||||
@@ -78,4 +82,11 @@ public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
/// GT5 Hazmat protection
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
@Override
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class TrackmanGogglesUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "trackmansGoggles";
|
||||
|
||||
public static final TrackmanGogglesUpgrade INSTANCE = new TrackmanGogglesUpgrade();
|
||||
|
||||
public static ItemStack getGoggles() {
|
||||
Item i = GameRegistry.findItem("Railcraft", "armor.goggles");
|
||||
if (i != null) {
|
||||
return new ItemStack(i);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TrackmanGogglesUpgrade loadFromItem(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
if (stack.stackTagCompound == null) {
|
||||
return null;
|
||||
}
|
||||
if (!stack.stackTagCompound.hasKey(KEY_UPGRADE_PREFIX + UPGRADE_NAME)) {
|
||||
return null;
|
||||
}
|
||||
return new TrackmanGogglesUpgrade(
|
||||
(NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
public static boolean isUpgradeEquipped(EntityPlayer player) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return TrackmanGogglesUpgrade.loadFromItem(helmet) != null;
|
||||
}
|
||||
|
||||
public TrackmanGogglesUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public TrackmanGogglesUpgrade() {
|
||||
super(
|
||||
UPGRADE_NAME,
|
||||
"enderio.darksteel.upgrade.trackmansGoggles",
|
||||
getGoggles(),
|
||||
Config.darkSteelTrackmanGogglesCost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if (stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0) || getUpgradeItem() == null) {
|
||||
return false;
|
||||
}
|
||||
TrackmanGogglesUpgrade up = loadFromItem(stack);
|
||||
return up == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {}
|
||||
|
||||
@Override
|
||||
public ItemStack getUpgradeItem() {
|
||||
if (upgradeItem != null) {
|
||||
return upgradeItem;
|
||||
}
|
||||
upgradeItem = getGoggles();
|
||||
return upgradeItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpgradeItemName() {
|
||||
if (getUpgradeItem() == null) {
|
||||
return "Trackman's Helmet";
|
||||
}
|
||||
return super.getUpgradeItemName();
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,8 @@ public abstract class AbstractMachineEntity extends TileEntityEio
|
||||
public final boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
if (slotDefinition.isUpgradeSlot(i)) {
|
||||
return itemstack != null && itemstack.getItem() == EnderIO.itemBasicCapacitor
|
||||
&& itemstack.getItemDamage() > 0;
|
||||
&& itemstack.getItemDamage() > 0
|
||||
&& itemstack.getItemDamage() != 7;
|
||||
}
|
||||
return isMachineItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,12 @@ public class FarmingStationRenderer extends TechneMachineRenderer<TileFarmStatio
|
||||
bb = bb.translate(x, y, z);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tessellator.setBrightness(0xF000F0);
|
||||
CubeRenderer.get().render(bb, override != null ? override : Blocks.portal.getBlockTextureFromSide(1));
|
||||
IIcon ico = override != null ? override : Blocks.portal.getBlockTextureFromSide(1);
|
||||
float x1 = ico.getInterpolatedU(3);
|
||||
float x2 = ico.getInterpolatedU(13);
|
||||
float y1 = ico.getInterpolatedV(6);
|
||||
float y2 = ico.getInterpolatedV(10);
|
||||
CubeRenderer.get().render(bb, x1, x2, y1, y2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package crazypants.enderio.machine.farm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -10,9 +12,11 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
@@ -20,11 +24,42 @@ import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
|
||||
public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
|
||||
private static final int RANGE_ID = 8738924;
|
||||
private static final int LOCK_ID = 1234;
|
||||
|
||||
private final ToggleButton showRangeB;
|
||||
|
||||
public GuiFarmStation(InventoryPlayer par1InventoryPlayer, TileFarmStation machine) {
|
||||
super(machine, new FarmStationContainer(par1InventoryPlayer, machine), "farmStation");
|
||||
|
||||
int x = getXSize() - 5 - BUTTON_SIZE / 2;
|
||||
int y = getGuiTop() + 5;
|
||||
getRedstoneBtn().setPosition(x, y);
|
||||
|
||||
y += BUTTON_SIZE + 2;
|
||||
getConfigBtn().setPosition(x, y);
|
||||
|
||||
y += BUTTON_SIZE + 2;
|
||||
showRangeB = new ToggleButton(this, RANGE_ID, x, y, IconEIO.PLUS, IconEIO.MINUS);
|
||||
showRangeB.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
addToolTip(new GuiToolTip(showRangeB.getBounds(), "null") {
|
||||
|
||||
@Override
|
||||
public List<String> getToolTipText() {
|
||||
return Lists.newArrayList(
|
||||
EnderIO.lang.localize(
|
||||
showRangeB.isSelected() ? "gui.spawnGurad.hideRange" : "gui.spawnGurad.showRange"));
|
||||
}
|
||||
});
|
||||
|
||||
setYSize(ySize + 3);
|
||||
setXSize(xSize + 8);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerU() {
|
||||
return 184;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -32,6 +67,9 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
showRangeB.onGuiInit();
|
||||
showRangeB.setSelected(getTileEntity().isShowingRange());
|
||||
|
||||
int x = getGuiLeft() + 36;
|
||||
int y = getGuiTop() + 43;
|
||||
|
||||
@@ -94,7 +132,10 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
if (b.id >= LOCK_ID + TileFarmStation.minSupSlot && b.id <= LOCK_ID + TileFarmStation.maxSupSlot) {
|
||||
getTileEntity().toggleLockedState(b.id - LOCK_ID);
|
||||
} else if (b.id == RANGE_ID) {
|
||||
getTileEntity().setShowRange(showRangeB.isSelected());
|
||||
}
|
||||
|
||||
super.actionPerformed(b);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.util.ClientUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@@ -51,11 +52,7 @@ public class PacketFarmAction implements IMessage, IMessageHandler<PacketFarmAct
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketFarmAction message, MessageContext ctx) {
|
||||
for (BlockCoord bc : message.coords) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
ClientUtil.spawnFarmParcticles(rand, bc);
|
||||
}
|
||||
}
|
||||
ClientUtil.spawnFarmParticles(rand, message.coords, Config.farmParticlesCount);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,17 @@ import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -32,13 +37,52 @@ import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.farm.farmers.FarmersCommune;
|
||||
import crazypants.enderio.machine.farm.farmers.IHarvestResult;
|
||||
import crazypants.enderio.machine.farm.farmers.RubberTreeFarmerIC2;
|
||||
import crazypants.enderio.machine.ranged.IRanged;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.tool.ArrayMappingTool;
|
||||
|
||||
public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
public class TileFarmStation extends AbstractPoweredTaskEntity implements IRanged {
|
||||
|
||||
private static final int TICKS_PER_WORK = 20;
|
||||
private boolean showingRange;
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return new Vector3d(getFarmSize(), 0, getFarmSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowingRange() {
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
return;
|
||||
}
|
||||
showingRange = showRange;
|
||||
if (showingRange) {
|
||||
worldObj.spawnEntityInWorld(new RangeEntity(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FFAA00;
|
||||
}
|
||||
|
||||
public enum ToolType {
|
||||
|
||||
@@ -458,8 +502,9 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
IHarvestResult harvest = FarmersCommune.instance.harvestBlock(this, bc, block, meta);
|
||||
if (harvest != null && harvest.getDrops() != null) {
|
||||
PacketFarmAction pkt = new PacketFarmAction(harvest.getHarvestedBlocks());
|
||||
PacketHandler.INSTANCE
|
||||
.sendToAllAround(pkt, new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, 64));
|
||||
PacketHandler.INSTANCE.sendToAllAround(
|
||||
pkt,
|
||||
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, Config.farmParticlesMaxRange));
|
||||
for (EntityItem ei : harvest.getDrops()) {
|
||||
if (ei != null) {
|
||||
insertHarvestDrop(ei, bc);
|
||||
@@ -487,7 +532,12 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
inventory[minFirtSlot] = farmerJoe.inventory.mainInventory[0];
|
||||
PacketHandler.INSTANCE.sendToAllAround(
|
||||
new PacketFarmAction(bc),
|
||||
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, 64));
|
||||
new TargetPoint(
|
||||
worldObj.provider.dimensionId,
|
||||
bc.x,
|
||||
bc.y,
|
||||
bc.z,
|
||||
Config.farmParticlesMaxRange));
|
||||
if (inventory[minFirtSlot] != null && inventory[minFirtSlot].stackSize == 0) {
|
||||
inventory[minFirtSlot] = null;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,11 @@ public class TileZombieGenerator extends AbstractGeneratorEntity
|
||||
public String getMachineName() {
|
||||
return ModObject.blockFrankenzombieGenerator.unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratorType getGeneratorType() {
|
||||
return GeneratorType.FRANKENZOMBIE;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileEnderGenerator extends TileZombieGenerator {
|
||||
@@ -58,6 +63,11 @@ public class TileZombieGenerator extends AbstractGeneratorEntity
|
||||
protected Fluid getFluidType() {
|
||||
return EnderIO.fluidEnderDistillation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratorType getGeneratorType() {
|
||||
return GeneratorType.ENDER;
|
||||
}
|
||||
}
|
||||
|
||||
private static int IO_MB_TICK = 250;
|
||||
@@ -326,7 +336,7 @@ public class TileZombieGenerator extends AbstractGeneratorEntity
|
||||
}
|
||||
|
||||
public GeneratorType getGeneratorType() {
|
||||
return ((BlockZombieGenerator) worldObj.getBlock(xCoord, yCoord, zCoord)).getGeneratorType();
|
||||
return GeneratorType.ZOMBIE;
|
||||
}
|
||||
|
||||
public int getOutputPerTick() {
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
@@ -211,4 +212,12 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected RedstoneModeButton getRedstoneBtn() {
|
||||
return redstoneButton;
|
||||
}
|
||||
|
||||
protected ToggleButton getConfigBtn() {
|
||||
return configB;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.machine.killera;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -8,9 +9,11 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.SoundUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
@@ -23,6 +26,9 @@ import crazypants.enderio.xp.PacketGivePlayerXP;
|
||||
|
||||
public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
|
||||
private static final int RANGE_ID = 8738924;
|
||||
private final ToggleButton showRangeB;
|
||||
|
||||
private static final int XP_ID = 3489;
|
||||
private static final int XP10_ID = 34892;
|
||||
|
||||
@@ -32,6 +38,18 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
public GuiKillerJoe(InventoryPlayer inventory, final TileKillerJoe tileEntity) {
|
||||
super(tileEntity, new ContainerKillerJoe(inventory, tileEntity), "killerJoe");
|
||||
|
||||
showRangeB = new ToggleButton(this, RANGE_ID, 155, 24 + 18, IconEIO.PLUS, IconEIO.MINUS);
|
||||
showRangeB.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
addToolTip(new GuiToolTip(showRangeB.getBounds(), "null") {
|
||||
|
||||
@Override
|
||||
public List<String> getToolTipText() {
|
||||
return Lists.newArrayList(
|
||||
EnderIO.lang.localize(
|
||||
showRangeB.isSelected() ? "gui.spawnGurad.hideRange" : "gui.spawnGurad.showRange"));
|
||||
}
|
||||
});
|
||||
|
||||
addToolTip(new GuiToolTip(new Rectangle(18, 11, 15, 47), "") {
|
||||
|
||||
@Override
|
||||
@@ -46,11 +64,17 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
}
|
||||
});
|
||||
|
||||
xpB = new IconButton(this, XP_ID, 128, 56, IconEIO.XP);
|
||||
xpB.setToolTip(EnderIO.lang.localize("killerJoe.giveXp.tooltip"));
|
||||
int size = 14;
|
||||
int x = guiLeft + 56 + (65 / 2);
|
||||
int y = guiTop + 62 + 6;
|
||||
|
||||
xp10B = new IconButton(this, XP10_ID, 148, 56, IconEIO.XP_PLUS);
|
||||
xpB = new IconButton(this, XP_ID, x - 16, y, IconEIO.XP);
|
||||
xpB.setToolTip(EnderIO.lang.localize("killerJoe.giveXp.tooltip"));
|
||||
xpB.setSize(size, size);
|
||||
|
||||
xp10B = new IconButton(this, XP10_ID, x + 2, y, IconEIO.XP_PLUS);
|
||||
xp10B.setToolTip(EnderIO.lang.localize("killerJoe.giveXp10.tooltip"));
|
||||
xp10B.setSize(size, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,6 +82,9 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
super.initGui();
|
||||
xpB.onGuiInit();
|
||||
xp10B.onGuiInit();
|
||||
|
||||
showRangeB.onGuiInit();
|
||||
showRangeB.setSelected(getTileEntity().isShowingRange());
|
||||
((ContainerKillerJoe) inventorySlots).createGhostSlots(getGhostSlots());
|
||||
}
|
||||
|
||||
@@ -70,6 +97,8 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
} else if (b.id == XP10_ID) {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketGivePlayerXP(getTileEntity(), 10));
|
||||
SoundUtil.playClientSoundFX("random.orb", getTileEntity());
|
||||
} else if (b.id == RANGE_ID) {
|
||||
getTileEntity().setShowRange(showRangeB.isSelected());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
@@ -39,6 +40,8 @@ import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -47,6 +50,8 @@ import crazypants.enderio.machine.FakePlayerEIO;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.generator.zombie.IHasNutrientTank;
|
||||
import crazypants.enderio.machine.generator.zombie.PacketNutrientTank;
|
||||
import crazypants.enderio.machine.ranged.IRanged;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.wireless.WirelessChargedLocation;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.SmartTank;
|
||||
@@ -56,7 +61,46 @@ import crazypants.enderio.xp.PacketExperianceContainer;
|
||||
import crazypants.enderio.xp.XpUtil;
|
||||
|
||||
public class TileKillerJoe extends AbstractMachineEntity
|
||||
implements IFluidHandler, IEntitySelector, IHaveExperience, ITankAccess, IHasNutrientTank {
|
||||
implements IFluidHandler, IEntitySelector, IHaveExperience, ITankAccess, IHasNutrientTank, IRanged {
|
||||
|
||||
private boolean showingRange;
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBounds() {
|
||||
return getKillBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isShowingRange() {
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
return;
|
||||
}
|
||||
showingRange = showRange;
|
||||
if (showingRange) {
|
||||
worldObj.spawnEntityInWorld(new RangeEntity(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FF0000;
|
||||
}
|
||||
|
||||
public static class ZombieCache {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -56,9 +57,10 @@ public class BlockLightNode extends BlockEio {
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
TileLightNode te = (TileLightNode) world.getTileEntity(x, y, z);
|
||||
if (te != null) {
|
||||
te.onBlockRemoved();
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileLightNode) {
|
||||
TileLightNode light = (TileLightNode) te;
|
||||
light.onBlockRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class GuiAttractor extends GuiPoweredMachineBase<TileAttractor> {
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
|
||||
int range = (int) getTileEntity().getRange();
|
||||
int range = (int) getTileEntity().getRange().x;
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
|
||||
@@ -61,8 +61,13 @@ public class TileAttractor extends AbstractPowerConsumerEntity implements IRange
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRange() {
|
||||
return range;
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return new Vector3d(range, range, range);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,6 +76,11 @@ public class TileAttractor extends AbstractPowerConsumerEntity implements IRange
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FFFFFF;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
@@ -317,8 +327,7 @@ public class TileAttractor extends AbstractPowerConsumerEntity implements IRange
|
||||
ent.faceEntity(getTarget(), 10.0F, 20.0F);
|
||||
return true;
|
||||
} else if (ent instanceof EntitySilverfish) {
|
||||
PathEntity pathentity = worldObj
|
||||
.getPathEntityToEntity(ent, getTarget(), getRange(), true, false, false, true);
|
||||
PathEntity pathentity = worldObj.getPathEntityToEntity(ent, getTarget(), range, true, false, false, true);
|
||||
((EntityCreature) ent).setPathToEntity(pathentity);
|
||||
return true;
|
||||
} else if (ent instanceof EntityBlaze) {
|
||||
@@ -339,8 +348,7 @@ public class TileAttractor extends AbstractPowerConsumerEntity implements IRange
|
||||
return;
|
||||
}
|
||||
EntitySilverfish sf = (EntitySilverfish) ent;
|
||||
PathEntity pathentity = worldObj
|
||||
.getPathEntityToEntity(ent, getTarget(), getRange(), true, false, false, true);
|
||||
PathEntity pathentity = worldObj.getPathEntityToEntity(ent, getTarget(), range, true, false, false, true);
|
||||
sf.setPathToEntity(pathentity);
|
||||
} else if (ent instanceof EntityBlaze) {
|
||||
EntityBlaze mob = (EntityBlaze) ent;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiAversionObelisk extends GuiPoweredMachineBase<TileAversionObelis
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
|
||||
int range = (int) getTileEntity().getRange();
|
||||
int range = (int) getTileEntity().getRange().x;
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -40,6 +41,11 @@ public class TileAversionObelisk extends AbstractPowerConsumerEntity implements
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FFFFFF;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
@@ -64,8 +70,13 @@ public class TileAversionObelisk extends AbstractPowerConsumerEntity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRange() {
|
||||
return range;
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return new Vector3d(range, range, range);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GuiInhibitorObelisk extends GuiPoweredMachineBase<TileInhibitorObel
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
|
||||
int range = (int) getTileEntity().getRange();
|
||||
int range = (int) getTileEntity().getRange().x;
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
|
||||
+15
-2
@@ -1,8 +1,11 @@
|
||||
package crazypants.enderio.machine.obelisk.inhibitor;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractPowerConsumerEntity;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
@@ -42,8 +45,13 @@ public class TileInhibitorObelisk extends AbstractPowerConsumerEntity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRange() {
|
||||
return range;
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return new Vector3d(range, range, range);
|
||||
}
|
||||
|
||||
public void setRange(float range) {
|
||||
@@ -56,6 +64,11 @@ public class TileInhibitorObelisk extends AbstractPowerConsumerEntity implements
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
|
||||
@@ -31,6 +31,11 @@ public class BlockWeatherObelisk extends BlockObeliskAbstract<TileWeatherObelisk
|
||||
Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketWeatherTank.class, PacketWeatherTank.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketControlModeWeather.class,
|
||||
PacketControlModeWeather.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
|
||||
EntityRegistry
|
||||
.registerModEntity(EntityWeatherRocket.class, "weather_rocket", 33, EnderIO.instance, 64, 3, false);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraftforge.fluids.FluidTank;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
@@ -24,6 +25,7 @@ import crazypants.enderio.network.PacketHandler;
|
||||
public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk> {
|
||||
|
||||
private IconButton buttonStart;
|
||||
private ToggleButton buttonMode;
|
||||
|
||||
public GuiWeatherObelisk(InventoryPlayer inventory, TileWeatherObelisk tileEntity) {
|
||||
super(tileEntity, new ContainerWeatherObelisk(inventory, tileEntity), "weatherObelisk");
|
||||
@@ -50,10 +52,23 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
int x = (xSize / 2) - (BUTTON_SIZE / 2);
|
||||
int x_mode = xSize - 5 - BUTTON_SIZE;
|
||||
int x_start = (xSize / 2) - (BUTTON_SIZE / 2);
|
||||
int y = 58;
|
||||
|
||||
addButton(buttonStart = new IconButton(this, 0, x, y, IconEIO.TICK));
|
||||
buttonMode = new ToggleButton(this, 1, x_mode, y, IconEIO.ROUND_ROBIN_OFF, IconEIO.REDSTONE_MODE_WITH_SIGNAL);
|
||||
|
||||
buttonMode.setToolTip(EnderIO.lang.localize("gui.machine.weather.control"));
|
||||
buttonMode.setSelectedToolTip(EnderIO.lang.localize("gui.machine.weather.redstone"));
|
||||
buttonMode.setUnselectedToolTip(EnderIO.lang.localize("gui.machine.weather.manual"));
|
||||
buttonMode.setSelected(getTileEntity().getLaunchOnRedstone());
|
||||
addButton(buttonMode);
|
||||
buttonMode.onGuiInit();
|
||||
|
||||
buttonStart = new IconButton(this, 0, x_start, y, IconEIO.TICK);
|
||||
buttonStart.setToolTip(EnderIO.lang.localize("gui.machine.weather.run"));
|
||||
|
||||
addButton(buttonStart);
|
||||
buttonStart.onGuiInit();
|
||||
|
||||
refreshButtons();
|
||||
@@ -68,6 +83,9 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
}
|
||||
|
||||
private void refreshButtons() {
|
||||
boolean pulseControl = getTileEntity().getLaunchOnRedstone();
|
||||
pulseControlAction(pulseControl);
|
||||
|
||||
FluidStack fs = getTileEntity().getInputTank().getFluid();
|
||||
if (fs == null) {
|
||||
buttonStart.enabled = false;
|
||||
@@ -143,9 +161,22 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
super.actionPerformed(b);
|
||||
if (b.id >= 0 && b.id <= 2) {
|
||||
if (b.id == 0) {
|
||||
// Start Button
|
||||
getTileEntity().startTask();
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketActivateWeather(getTileEntity()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketActivateWeather(getTileEntity(), true));
|
||||
} else if (b.id == 1) {
|
||||
// Control Mode Button
|
||||
boolean pulseControl = buttonMode.isSelected();
|
||||
getTileEntity().setLaunchOnRedstone(pulseControl);
|
||||
pulseControlAction(pulseControl);
|
||||
PacketControlModeWeather packet = new PacketControlModeWeather(getTileEntity());
|
||||
PacketHandler.INSTANCE.sendToServer(packet);
|
||||
}
|
||||
}
|
||||
|
||||
protected void pulseControlAction(boolean pulseControl) {
|
||||
redstoneButton.setVisible(!pulseControl);
|
||||
buttonStart.setVisible(!pulseControl);
|
||||
}
|
||||
}
|
||||
+19
-1
@@ -7,14 +7,30 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketActivateWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
implements IMessageHandler<PacketActivateWeather, IMessage> {
|
||||
|
||||
private boolean start;
|
||||
|
||||
public PacketActivateWeather() {}
|
||||
|
||||
public PacketActivateWeather(TileWeatherObelisk te) {
|
||||
public PacketActivateWeather(TileWeatherObelisk te, boolean start) {
|
||||
super(te);
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(start);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
start = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -24,6 +40,8 @@ public class PacketActivateWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
if (te != null) {
|
||||
if (ctx.side.isServer()) {
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
}
|
||||
if (message.start) {
|
||||
te.startTask();
|
||||
} else {
|
||||
te.stopTask();
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package crazypants.enderio.machine.obelisk.weather;
|
||||
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketControlModeWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
implements IMessageHandler<PacketControlModeWeather, IMessage> {
|
||||
|
||||
private boolean pulse;
|
||||
|
||||
public PacketControlModeWeather() {}
|
||||
|
||||
public PacketControlModeWeather(TileWeatherObelisk te) {
|
||||
super(te);
|
||||
this.pulse = te.getLaunchOnRedstone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(pulse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
pulse = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketControlModeWeather message, MessageContext ctx) {
|
||||
TileWeatherObelisk te = message.getTileEntity(message.getWorld(ctx));
|
||||
if (te != null) {
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
te.setLaunchOnRedstone(message.pulse);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractPowerConsumerEntity;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
@@ -100,6 +101,9 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
private boolean canBeActive = true;
|
||||
private boolean tanksDirty;
|
||||
|
||||
private boolean launchOnRedstone = false;
|
||||
private int cooldown = 0;
|
||||
|
||||
private static final ICapacitor cap = Capacitors.BASIC_CAPACITOR.capacitor;
|
||||
|
||||
private FluidTank inputTank = new FluidTank(8000);
|
||||
@@ -230,7 +234,13 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
protected boolean processTasks(boolean redstoneCheckPassed) {
|
||||
boolean res = false;
|
||||
|
||||
if (!redstoneCheckPassed) {
|
||||
if (cooldown > 0) {
|
||||
cooldown--;
|
||||
res = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!redstoneCheckPassed && !launchOnRedstone) {
|
||||
if (canBeActive) {
|
||||
canBeActive = false;
|
||||
res = true;
|
||||
@@ -254,9 +264,13 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
EntityWeatherRocket e = new EntityWeatherRocket(worldObj, activeTask);
|
||||
e.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
|
||||
worldObj.spawnEntityInWorld(e);
|
||||
cooldown = 200;
|
||||
stopTask();
|
||||
res = true;
|
||||
}
|
||||
} else if (launchOnRedstone && RedstoneControlMode.isConditionMet(RedstoneControlMode.ON, this)) {
|
||||
startTask();
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,20 +294,19 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
&& inputTank.getFluidAmount() >= 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
public boolean startTask() {
|
||||
public void startTask() {
|
||||
if (getActiveTask() == null && inputTank.getFluidAmount() > 0) {
|
||||
fluidUsed = 0;
|
||||
WeatherTask task = WeatherTask.fromFluid(inputTank.getFluid().getFluid());
|
||||
if (canStartTask(task)) {
|
||||
if (!worldObj.isRemote) {
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new PacketActivateWeather(this, true), worldObj.provider.dimensionId);
|
||||
}
|
||||
decrStackSize(0, 1);
|
||||
activeTask = task;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void stopTask() {
|
||||
@@ -301,7 +314,8 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
activeTask = null;
|
||||
fluidUsed = 0;
|
||||
if (!worldObj.isRemote) {
|
||||
PacketHandler.INSTANCE.sendToDimension(new PacketActivateWeather(this), worldObj.provider.dimensionId);
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new PacketActivateWeather(this, false), worldObj.provider.dimensionId);
|
||||
} else {
|
||||
playedFuse = false;
|
||||
}
|
||||
@@ -312,12 +326,14 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
public void writeCommon(NBTTagCompound nbtRoot) {
|
||||
super.writeCommon(nbtRoot);
|
||||
nbtRoot.setTag("tank", inputTank.writeToNBT(new NBTTagCompound()));
|
||||
nbtRoot.setBoolean("weatherobeliskcontrolmode", launchOnRedstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCommon(NBTTagCompound nbtRoot) {
|
||||
super.readCommon(nbtRoot);
|
||||
inputTank.readFromNBT(nbtRoot.getCompoundTag("tank"));
|
||||
launchOnRedstone = nbtRoot.getBoolean("weatherobeliskcontrolmode");
|
||||
}
|
||||
|
||||
private boolean isValidFluid(Fluid f) {
|
||||
@@ -382,4 +398,12 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
return new FluidTankInfo[] { inputTank.getInfo() };
|
||||
}
|
||||
|
||||
public void setLaunchOnRedstone(boolean launchOnRedstone) {
|
||||
this.launchOnRedstone = launchOnRedstone;
|
||||
}
|
||||
|
||||
public boolean getLaunchOnRedstone() {
|
||||
return this.launchOnRedstone;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package crazypants.enderio.machine.ranged;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
public interface IRanged {
|
||||
|
||||
@@ -10,7 +12,11 @@ public interface IRanged {
|
||||
|
||||
BlockCoord getLocation();
|
||||
|
||||
float getRange();
|
||||
AxisAlignedBB getBounds();
|
||||
|
||||
Vector3d getRange();
|
||||
|
||||
boolean isShowingRange();
|
||||
|
||||
int getColor();
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -13,16 +14,22 @@ public class RangeEntity extends Entity {
|
||||
|
||||
int totalLife = 20;
|
||||
int lifeSpan = totalLife;
|
||||
float range;
|
||||
private IRanged spawnGuard;
|
||||
private Vector3d lastRange;
|
||||
private AxisAlignedBB lastBounds;
|
||||
private final IRanged spawnGuard;
|
||||
private int color;
|
||||
private AxisAlignedBB rangeBounds;
|
||||
private Vector3d range;
|
||||
|
||||
public RangeEntity(IRanged sg) {
|
||||
super(sg.getWorld());
|
||||
spawnGuard = sg;
|
||||
BlockCoord bc = spawnGuard.getLocation();
|
||||
setPosition(bc.x + 0.5, bc.y + 0.5, bc.z + 0.5);
|
||||
setPosition(bc.x - 0.01, bc.y - 0.01, bc.z - 0.01);
|
||||
ignoreFrustumCheck = true;
|
||||
range = sg.getRange() + 0.5f;
|
||||
color = sg.getColor();
|
||||
lastRange = spawnGuard.getRange();
|
||||
lastBounds = spawnGuard.getBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,7 +48,14 @@ public class RangeEntity extends Entity {
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
return null;
|
||||
return spawnGuard.getBounds() != null ? spawnGuard.getBounds()
|
||||
: AxisAlignedBB.getBoundingBox(
|
||||
posX - lastRange.x,
|
||||
posY - lastRange.y,
|
||||
posZ - lastRange.z,
|
||||
posX + lastRange.x + 1,
|
||||
posY + lastRange.y + 1,
|
||||
posZ + lastRange.z + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,6 +63,8 @@ public class RangeEntity extends Entity {
|
||||
super.onUpdate();
|
||||
lifeSpan--;
|
||||
BlockCoord bc = spawnGuard.getLocation();
|
||||
updateRange();
|
||||
|
||||
if (!(worldObj.getTileEntity(bc.x, bc.y, bc.z) instanceof IRanged)) {
|
||||
setDead();
|
||||
}
|
||||
@@ -62,4 +78,17 @@ public class RangeEntity extends Entity {
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
|
||||
|
||||
private void updateRange() {
|
||||
if (lastRange != null && !lastRange.equals(spawnGuard.getRange())) {
|
||||
lastRange = spawnGuard.getRange();
|
||||
} else if (lastBounds != null && !lastBounds.equals(spawnGuard.getBounds())) {
|
||||
lastBounds = spawnGuard.getBounds();
|
||||
}
|
||||
}
|
||||
|
||||
public float[] getColor() {
|
||||
return new float[] { (float) (this.color >> 16 & 255) / 255.0F, (float) (this.color >> 8 & 255) / 255.0F,
|
||||
(float) (this.color & 255) / 255.0F, (float) (this.color >> 24 & 255) / 255.0F };
|
||||
}
|
||||
}
|
||||
+23
-12
@@ -3,6 +3,7 @@ package crazypants.enderio.machine.ranged;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -10,17 +11,19 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RangeRenerer extends RenderEntity {
|
||||
public class RangeRenderer extends RenderEntity {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
|
||||
RangeEntity se = ((RangeEntity) entity);
|
||||
AxisAlignedBB rangeBB = se.getBoundingBox();
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
@@ -30,21 +33,29 @@ public class RangeRenerer extends RenderEntity {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
float scale = 1 - (se.lifeSpan / (float) se.totalLife);
|
||||
scale = Math.min(scale, 1);
|
||||
scale *= se.range;
|
||||
Vector3d translate = new Vector3d(
|
||||
-(se.posX - rangeBB.minX + 0.01),
|
||||
-(se.posY - rangeBB.minY + 0.01),
|
||||
-(se.posZ - rangeBB.minZ + 0.01));
|
||||
|
||||
Vector3d scale = new Vector3d(
|
||||
1 - (se.lifeSpan / (float) se.totalLife),
|
||||
1 - (se.lifeSpan / (float) se.totalLife),
|
||||
rangeBB.maxZ - rangeBB.minZ);
|
||||
|
||||
scale.x = Math.min(scale.x, 1);
|
||||
scale.y = Math.min(scale.y, 1);
|
||||
|
||||
scale.x *= (rangeBB.maxX - rangeBB.minX);
|
||||
scale.y *= (rangeBB.maxY - rangeBB.minY);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
|
||||
GL11.glColor4f(1, 1, 1, 0.4f);
|
||||
|
||||
GL11.glColor4f(se.getColor()[0], se.getColor()[1], se.getColor()[2], se.getColor()[3]);
|
||||
RenderUtil.bindBlockTexture();
|
||||
tessellator.startDrawingQuads();
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glTranslated(translate.x, translate.y, translate.z);
|
||||
GL11.glScaled(scale.x, scale.y, scale.z);
|
||||
tessellator.setBrightness(15 << 20 | 15 << 4);
|
||||
CubeRenderer.get().render(BoundingBox.UNIT_CUBE, IconUtil.whiteTexture);
|
||||
tessellator.draw();
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.machine.spawner;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -10,22 +11,40 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.MultiIconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class GuiPoweredSpawner extends GuiPoweredMachineBase<TilePoweredSpawner> {
|
||||
|
||||
private static final int RANGE_ID = 8738924;
|
||||
private final MultiIconButton modeB;
|
||||
private final Rectangle progressTooltipRect;
|
||||
private final ToggleButton showRangeB;
|
||||
private boolean wasSpawnMode;
|
||||
private String header;
|
||||
|
||||
public GuiPoweredSpawner(InventoryPlayer par1InventoryPlayer, TilePoweredSpawner te) {
|
||||
super(te, new ContainerPoweredSpawner(par1InventoryPlayer, te), "poweredSpawner");
|
||||
|
||||
showRangeB = new ToggleButton(this, RANGE_ID, 155, 24 + 18, IconEIO.PLUS, IconEIO.MINUS);
|
||||
showRangeB.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
addToolTip(new GuiToolTip(showRangeB.getBounds(), "null") {
|
||||
|
||||
@Override
|
||||
public List<String> getToolTipText() {
|
||||
return Lists.newArrayList(
|
||||
EnderIO.lang.localize(
|
||||
showRangeB.isSelected() ? "gui.spawnGurad.hideRange" : "gui.spawnGurad.showRange"));
|
||||
}
|
||||
});
|
||||
|
||||
modeB = MultiIconButton.createRightArrowButton(this, 8888, 115, 10);
|
||||
modeB.setSize(10, 16);
|
||||
|
||||
@@ -38,6 +57,8 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase<TilePoweredSpawner>
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
showRangeB.onGuiInit();
|
||||
showRangeB.setSelected(getTileEntity().isShowingRange());
|
||||
modeB.onGuiInit();
|
||||
((ContainerPoweredSpawner) inventorySlots).createGhostSlots(getGhostSlots());
|
||||
}
|
||||
@@ -47,9 +68,9 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase<TilePoweredSpawner>
|
||||
if (par1GuiButton == modeB) {
|
||||
getTileEntity().setSpawnMode(!getTileEntity().isSpawnMode());
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketMode(getTileEntity()));
|
||||
} else {
|
||||
super.actionPerformed(par1GuiButton);
|
||||
}
|
||||
} else if (par1GuiButton.id == RANGE_ID) {
|
||||
getTileEntity().setShowRange(showRangeB.isSelected());
|
||||
} else super.actionPerformed(par1GuiButton);
|
||||
}
|
||||
|
||||
private void updateSpawnMode(boolean spawnMode) {
|
||||
|
||||
@@ -7,7 +7,12 @@ import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -16,11 +21,13 @@ import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.IPoweredTask;
|
||||
import crazypants.enderio.machine.PoweredTask;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.ranged.IRanged;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
|
||||
public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
public class TilePoweredSpawner extends AbstractPoweredTaskEntity implements IRanged {
|
||||
|
||||
public static final int MIN_SPAWN_DELAY_BASE = Config.poweredSpawnerMinDelayTicks;
|
||||
public static final int MAX_SPAWN_DELAY_BASE = Config.poweredSpawnerMaxDelayTicks;
|
||||
@@ -94,6 +101,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
private boolean isSpawnMode = true;
|
||||
private int powerUsePerTick;
|
||||
private int remainingSpawnTries;
|
||||
private boolean showingRange;
|
||||
|
||||
public TilePoweredSpawner() {
|
||||
super(new SlotDefinition(1, 1, 1));
|
||||
@@ -178,6 +186,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
basePowerUse = POWER_PER_TICK_TEN;
|
||||
break;
|
||||
}
|
||||
|
||||
double multiplier = PoweredSpawnerConfig.getInstance().getCostMultiplierFor(getEntityName());
|
||||
setCapacitor(
|
||||
new BasicCapacitor(
|
||||
@@ -375,4 +384,41 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
public boolean hasEntityName() {
|
||||
return !NULL_ENTITY_NAME.equals(entityTypeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
int range = Config.poweredSpawnerSpawnRange - 1;
|
||||
return new Vector3d(range, 1, range);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowingRange() {
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
return;
|
||||
}
|
||||
showingRange = showRange;
|
||||
if (showingRange) {
|
||||
worldObj.spawnEntityInWorld(new RangeEntity(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x66FF0000;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.machine.vacuum;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -18,6 +19,7 @@ import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
@@ -28,6 +30,7 @@ import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
|
||||
private static final int RANGE_ID = 8738924;
|
||||
private static final int RANGE_LEFT = 145;
|
||||
private static final int RANGE_TOP = 86;
|
||||
private static final int RANGE_WIDTH = 16;
|
||||
@@ -43,6 +46,7 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
|
||||
private final TileVacuumChest te;
|
||||
|
||||
private final ToggleButton showRangeB;
|
||||
private final GuiToolTip rangeTooltip;
|
||||
private final MultiIconButton rangeUpB;
|
||||
private final MultiIconButton rangeDownB;
|
||||
@@ -75,6 +79,18 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
y = 104;
|
||||
rsB = new RedstoneModeButton(this, ID_REDSTONE, x, y, te, new BlockCoord(te));
|
||||
|
||||
showRangeB = new ToggleButton(this, RANGE_ID, x - 18, y, IconEIO.PLUS, IconEIO.MINUS);
|
||||
showRangeB.setSize(16, 16);
|
||||
addToolTip(new GuiToolTip(showRangeB.getBounds(), "null") {
|
||||
|
||||
@Override
|
||||
public List<String> getToolTipText() {
|
||||
return Lists.newArrayList(
|
||||
EnderIO.lang.localize(
|
||||
showRangeB.isSelected() ? "gui.spawnGurad.hideRange" : "gui.spawnGurad.showRange"));
|
||||
}
|
||||
});
|
||||
|
||||
x = FILTER_LEFT + TileVacuumChest.FILTER_SLOTS * 18 + 2;
|
||||
y = 86;
|
||||
whiteListB = new ToggleButton(this, ID_WHITELIST, x, y, IconEIO.FILTER_WHITELIST, IconEIO.FILTER_BLACKLIST);
|
||||
@@ -110,6 +126,8 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
showRangeB.onGuiInit();
|
||||
showRangeB.setSelected(te.isShowingRange());
|
||||
rangeUpB.onGuiInit();
|
||||
rangeDownB.onGuiInit();
|
||||
rsB.onGuiInit();
|
||||
@@ -124,11 +142,13 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
ItemFilter itemFilter;
|
||||
switch (guiButton.id) {
|
||||
case ID_RANGE_UP:
|
||||
setRange(te.getRange() + 1);
|
||||
setRange((int) te.getRange().x + 1);
|
||||
break;
|
||||
case ID_RANGE_DOWN:
|
||||
setRange(te.getRange() - 1);
|
||||
setRange((int) te.getRange().x - 1);
|
||||
break;
|
||||
case RANGE_ID:
|
||||
te.setShowRange(showRangeB.isSelected());
|
||||
case ID_WHITELIST:
|
||||
itemFilter = te.getItemFilter();
|
||||
if (itemFilter != null) {
|
||||
@@ -193,7 +213,7 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
fr.drawString(headerInventory, sx + 7, sy + 111, headerColor);
|
||||
|
||||
IconEIO.map.render(EnderWidget.BUTTON_DOWN, sx + RANGE_LEFT, sy + RANGE_TOP, RANGE_WIDTH, 16, 0, true);
|
||||
String str = Integer.toString(te.getRange());
|
||||
String str = Integer.toString((int) te.getRange().x);
|
||||
int sw = fr.getStringWidth(str);
|
||||
fr.drawString(str, sx + RANGE_LEFT + RANGE_WIDTH - sw - 5, sy + RANGE_TOP + 5, ColorUtil.getRGB(Color.black));
|
||||
|
||||
|
||||
@@ -13,10 +13,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
@@ -26,8 +30,11 @@ import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.ranged.IRanged;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
|
||||
public class TileVacuumChest extends TileEntityEio implements IEntitySelector, IInventory, IRedstoneModeControlable {
|
||||
public class TileVacuumChest extends TileEntityEio
|
||||
implements IEntitySelector, IInventory, IRedstoneModeControlable, IRanged {
|
||||
|
||||
public static final int ITEM_ROWS = 3;
|
||||
public static final int ITEM_SLOTS = 9 * ITEM_ROWS;
|
||||
@@ -42,6 +49,8 @@ public class TileVacuumChest extends TileEntityEio implements IEntitySelector, I
|
||||
protected boolean redstoneCheckPassed;
|
||||
private boolean redstoneStateDirty = true;
|
||||
|
||||
private boolean showingRange;
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if (redstoneStateDirty) {
|
||||
@@ -226,8 +235,41 @@ public class TileVacuumChest extends TileEntityEio implements IEntitySelector, I
|
||||
&& itemstack.getItemDamage() == 0;
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
return range;
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBounds() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getRange() {
|
||||
return new Vector3d(range, range, range);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isShowingRange() {
|
||||
return showingRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x660000FF;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setShowRange(boolean showRange) {
|
||||
if (showingRange == showRange) {
|
||||
return;
|
||||
}
|
||||
showingRange = showRange;
|
||||
if (showingRange) {
|
||||
worldObj.spawnEntityInWorld(new RangeEntity(this));
|
||||
}
|
||||
}
|
||||
|
||||
private int limitRange(int range) {
|
||||
|
||||
@@ -33,9 +33,10 @@ public enum Alloy {
|
||||
if (oreDictName != null) {
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(oreDictName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(oreDictName));
|
||||
} else {
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(baseName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(baseName));
|
||||
}
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(baseName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(baseName));
|
||||
this.hardness = hardness;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ public class BlockFusedQuartz extends BlockEio {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Type type = Type.byMeta(meta);
|
||||
if (type.blastResistance) {
|
||||
return 20;
|
||||
return Config.fusedQuartzExplosionResistance;
|
||||
} else {
|
||||
return super.getExplosionResistance(par1Entity);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ItemCapacitor extends Item implements ICapacitorItem {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if (par1ItemStack != null && par1ItemStack.getItemDamage() > 0) {
|
||||
if (par1ItemStack != null && par1ItemStack.getItemDamage() > 0 && par1ItemStack.getItemDamage() != 7) {
|
||||
par3List.add(EnderIO.lang.localize("machine.tooltip.upgrade"));
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(par3List, "enderio.machine.tooltip.upgrade");
|
||||
|
||||
@@ -15,6 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemTeleportStaff extends ItemTravelStaff {
|
||||
@@ -56,14 +57,30 @@ public class ItemTeleportStaff extends ItemTravelStaff {
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack equipped, World world, EntityPlayer player) {
|
||||
if (world.isRemote) {
|
||||
if (player.isSneaking()) {
|
||||
TravelController.instance
|
||||
.activateTravelAccessable(equipped, world, player, TravelSource.TELEPORT_STAFF);
|
||||
} else {
|
||||
TravelController.instance.doTeleport(player);
|
||||
int action = player.isSneaking() ? Config.teleportStaffSneakAction : Config.teleportStaffAction;
|
||||
switch (action) {
|
||||
case 0:
|
||||
// Do nothing.
|
||||
break;
|
||||
|
||||
case 1:
|
||||
TravelController.instance.doTeleport(player);
|
||||
player.swingItem();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
TravelController.instance
|
||||
.activateTravelAccessable(equipped, world, player, TravelSource.TELEPORT_STAFF);
|
||||
player.swingItem();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
TravelController.instance
|
||||
.activateTravelAccessable(equipped, world, player, TravelSource.TELEPORT_STAFF, true);
|
||||
player.swingItem();
|
||||
break;
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
return equipped;
|
||||
}
|
||||
|
||||
@@ -89,6 +106,12 @@ public class ItemTeleportStaff extends ItemTravelStaff {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack item) {
|
||||
// Has infinite energy, always report as being full of energy for any validation-code purposes.
|
||||
return this.capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
|
||||
@@ -3,10 +3,8 @@ package crazypants.enderio.teleport;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -32,6 +30,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
@@ -41,10 +40,12 @@ import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector2d;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.google.common.collect.MultimapBuilder;
|
||||
import com.google.common.collect.RowSortedTable;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
import com.google.common.collect.Table;
|
||||
import com.google.common.collect.TreeBasedTable;
|
||||
import com.gtnewhorizon.gtnhlib.GTNHLib;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
@@ -148,8 +149,9 @@ public class TravelController {
|
||||
// target must be a valid selectedCoord
|
||||
// selectedCoord can either be a block right above/below when the player is on anchor...
|
||||
if (on.x == x && on.z == z) return null;
|
||||
// or another anchor
|
||||
TileEntity maybeAnchor = target.getTileEntity(toTp.worldObj);
|
||||
// or another anchor. We need to look one block below because TP goes above the anchor.
|
||||
BlockCoord belowTarget = target.getLocation(ForgeDirection.DOWN);
|
||||
TileEntity maybeAnchor = belowTarget.getTileEntity(toTp.worldObj);
|
||||
if (!(maybeAnchor instanceof ITravelAccessable)) return "not anchor";
|
||||
ITravelAccessable anchor = (ITravelAccessable) maybeAnchor;
|
||||
if (!isValidTarget(toTp, target, TravelSource.BLOCK)) {
|
||||
@@ -160,7 +162,8 @@ public class TravelController {
|
||||
case STAFF_BLINK:
|
||||
if (Config.travelStaffKeybindEnabled) {
|
||||
if (equippedItem == null || equippedItem.getItem() == null
|
||||
|| !(equippedItem.getItem() instanceof IItemOfTravel)) {
|
||||
|| !(equippedItem.getItem() instanceof IItemOfTravel)
|
||||
|| !((IItemOfTravel) equippedItem.getItem()).isActive(toTp, equippedItem)) {
|
||||
equippedItem = findTravelItemInInventoryOrBaubles(toTp);
|
||||
}
|
||||
}
|
||||
@@ -190,12 +193,36 @@ public class TravelController {
|
||||
}
|
||||
|
||||
public boolean activateTravelAccessable(ItemStack equipped, World world, EntityPlayer player, TravelSource source) {
|
||||
return activateTravelAccessable(equipped, world, player, source, false);
|
||||
}
|
||||
|
||||
public boolean activateTravelAccessable(ItemStack equipped, World world, EntityPlayer player, TravelSource source,
|
||||
boolean alsoDoTeleport) {
|
||||
if (!hasTarget()) {
|
||||
if (alsoDoTeleport) {
|
||||
Optional<BlockCoord> destinationOptional = findTeleportDestination(player);
|
||||
if (destinationOptional.isPresent()) {
|
||||
BlockCoord destination = destinationOptional.get();
|
||||
PacketLongDistanceTravelEvent p = new PacketLongDistanceTravelEvent(
|
||||
player,
|
||||
false,
|
||||
source,
|
||||
true,
|
||||
destination.x,
|
||||
destination.y,
|
||||
destination.z);
|
||||
PacketHandler.INSTANCE.sendToServer(p);
|
||||
// We have no way of knowing if it will succeed, so just return false.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PacketLongDistanceTravelEvent p = new PacketLongDistanceTravelEvent(player, false, source);
|
||||
PacketHandler.INSTANCE.sendToServer(p);
|
||||
// We have no way of knowing if it will succeed, so just return false.
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockCoord target = selectedCoord;
|
||||
TileEntity te = world.getTileEntity(target.x, target.y, target.z);
|
||||
if (te instanceof ITravelAccessable) {
|
||||
@@ -243,7 +270,10 @@ public class TravelController {
|
||||
sample.add(eye);
|
||||
// we test against our feets location
|
||||
sample.y -= playerHeight;
|
||||
if (doBlinkAround(player, source, sample, true)) {
|
||||
|
||||
Optional<BlockCoord> destinationOptional = findNearbyDestination(player, source, sample);
|
||||
if (destinationOptional.isPresent()
|
||||
&& travelToLocation(player, source, destinationOptional.get(), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +310,9 @@ public class TravelController {
|
||||
// we test against our feets location
|
||||
sample.y -= playerHeight;
|
||||
|
||||
if (doBlinkAround(player, source, sample, false)) {
|
||||
Optional<BlockCoord> destinationOptional = findNearbyDestination(player, source, sample);
|
||||
if (destinationOptional.isPresent()
|
||||
&& travelToLocation(player, source, destinationOptional.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
teleDistance++;
|
||||
@@ -296,7 +328,9 @@ public class TravelController {
|
||||
// we test against our feets location
|
||||
sample.y -= playerHeight;
|
||||
|
||||
if (doBlinkAround(player, source, sample, false)) {
|
||||
Optional<BlockCoord> destinationOptional = findNearbyDestination(player, source, sample);
|
||||
if (destinationOptional.isPresent()
|
||||
&& travelToLocation(player, source, destinationOptional.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
sampleDistance--;
|
||||
@@ -308,114 +342,13 @@ public class TravelController {
|
||||
|
||||
/** This is the teleport staff super-teleport. */
|
||||
public boolean doTeleport(EntityPlayer player) {
|
||||
TravelSource source = TravelSource.TELEPORT_STAFF_BLINK;
|
||||
|
||||
Vector3d eye = Util.getEyePositionEio(player);
|
||||
Vector3d look = Util.getLookVecEio(player);
|
||||
|
||||
double playerHeight = player.yOffset;
|
||||
// +2 to compensate for the standard distance decrement of -2
|
||||
double teleDistance = Config.teleportStaffFailedBlinkDistance + 2;
|
||||
Vec3 eye3 = Vec3.createVectorHelper(eye.x, eye.y, eye.z);
|
||||
|
||||
// rayTraceBlocks has a limit of 200 distance.
|
||||
double maxDistance = Config.teleportStaffMaxBlinkDistance;
|
||||
double currDistance = 0;
|
||||
Vec3 pos = eye3;
|
||||
boolean loop = true;
|
||||
while (loop) {
|
||||
double distance = 200;
|
||||
if (maxDistance - currDistance < 200) {
|
||||
distance = maxDistance - currDistance;
|
||||
loop = false;
|
||||
}
|
||||
|
||||
Vector3d sample = new Vector3d(look);
|
||||
sample.scale(distance);
|
||||
sample.add(eye);
|
||||
Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);
|
||||
|
||||
MovingObjectPosition p = player.worldObj
|
||||
.rayTraceBlocks(pos, end, !Config.travelStaffBlinkThroughClearBlocksEnabled);
|
||||
if (p != null) {
|
||||
teleDistance = VecmathUtil.distance(eye, new Vector3d(p.blockX + 0.5, p.blockY + 0.5, p.blockZ + 0.5));
|
||||
break;
|
||||
}
|
||||
|
||||
pos = end;
|
||||
currDistance += distance;
|
||||
}
|
||||
|
||||
Vector3d sample = new Vector3d(look);
|
||||
sample.scale(Config.teleportStaffMaxBlinkDistance);
|
||||
sample.add(eye);
|
||||
Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);
|
||||
MovingObjectPosition p = player.worldObj
|
||||
.rayTraceBlocks(eye3, end, !Config.travelStaffBlinkThroughClearBlocksEnabled);
|
||||
if (p != null) {
|
||||
teleDistance = VecmathUtil.distance(eye, new Vector3d(p.blockX + 0.5, p.blockY + 0.5, p.blockZ + 0.5));
|
||||
}
|
||||
|
||||
double distanceIncrement = -2;
|
||||
// Special case: if the targeted block is too close, we'll try to teleport through it.
|
||||
if (teleDistance < 3) {
|
||||
distanceIncrement = 2;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
teleDistance += distanceIncrement;
|
||||
|
||||
sample.set(look);
|
||||
sample.scale(teleDistance);
|
||||
sample.add(eye);
|
||||
// we test against our feets location
|
||||
sample.y -= playerHeight;
|
||||
|
||||
if (doBlinkAround(player, source, sample, false)) {
|
||||
return true;
|
||||
}
|
||||
Optional<BlockCoord> destinationOptional = findTeleportDestination(player);
|
||||
if (destinationOptional.isPresent()) {
|
||||
return travelToLocation(player, TravelSource.TELEPORT_STAFF_BLINK, destinationOptional.get(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Returns empty optional if no travel destination was found. */
|
||||
public Optional<BlockCoord> findTravelDestination(EntityPlayer player, TravelSource source) {
|
||||
Vector3d eye = Util.getEyePositionEio(player);
|
||||
Vector3d look = Util.getLookVecEio(player);
|
||||
|
||||
// Map of distance to coordinate for eligible travel destinations (within angle).
|
||||
Map<Double, BlockCoord> distanceMap = new TreeMap<>();
|
||||
// Limit the max distance at which we'll display an out of range message.
|
||||
// Otherwise, you could trigger the message for any travel anchor on the entire server.
|
||||
double maxMessageDistance = 1.25 * source.getMaxDistanceTravelled();
|
||||
boolean displayOutOfRangeMessage = false;
|
||||
for (BlockCoord p : travelDestinations.get(player.worldObj.provider.dimensionId)) {
|
||||
Vector3d block = new Vector3d(p.x + 0.5, p.y + 0.5, p.z + 0.5);
|
||||
block.sub(eye);
|
||||
double distance = block.length();
|
||||
if (distance > maxMessageDistance) {
|
||||
continue;
|
||||
}
|
||||
block.normalize();
|
||||
|
||||
double angle = Math.acos(look.dot(block));
|
||||
// Roughly 5 degrees
|
||||
if (angle < 0.087) {
|
||||
if (distance > source.getMaxDistanceTravelled()) {
|
||||
displayOutOfRangeMessage = true;
|
||||
} else {
|
||||
distanceMap.put(distance, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (displayOutOfRangeMessage && distanceMap.isEmpty()) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
|
||||
return distanceMap.values().stream().findFirst();
|
||||
}
|
||||
|
||||
private boolean isBlackListedBlock(EntityPlayer player, MovingObjectPosition pos, Block hitBlock) {
|
||||
UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(hitBlock);
|
||||
if (ui == null) {
|
||||
@@ -426,36 +359,6 @@ public class TravelController {
|
||||
|| !Config.travelStaffBlinkThroughUnbreakableBlocksEnabled);
|
||||
}
|
||||
|
||||
private boolean doBlinkAround(EntityPlayer player, TravelSource source, Vector3d sample, boolean conserveMomentum) {
|
||||
if (travelToLocation(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord((int) Math.floor(sample.x), (int) Math.floor(sample.y), (int) Math.floor(sample.z)),
|
||||
conserveMomentum)) {
|
||||
return true;
|
||||
}
|
||||
if (travelToLocation(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord((int) Math.floor(sample.x), (int) Math.floor(sample.y) + 1, (int) Math.floor(sample.z)),
|
||||
conserveMomentum)) {
|
||||
return true;
|
||||
}
|
||||
if (!Config.travelStaffSearchOptimize) {
|
||||
if (travelToLocation(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord(
|
||||
(int) Math.floor(sample.x),
|
||||
(int) Math.floor(sample.y) - 1,
|
||||
(int) Math.floor(sample.z)),
|
||||
conserveMomentum)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean showTargets() {
|
||||
return showTargets && selectionEnabled;
|
||||
}
|
||||
@@ -492,6 +395,13 @@ public class TravelController {
|
||||
.getBlock(selectedCoord.x, selectedCoord.y, selectedCoord.z) == EnderIO.blockEnderIo;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldLoad(WorldEvent.Load e) {
|
||||
if (!e.world.isRemote) {
|
||||
travelDestinations.removeAll(e.world.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRender(RenderWorldLastEvent event) {
|
||||
@@ -527,7 +437,7 @@ public class TravelController {
|
||||
}
|
||||
onBlockCoord = getActiveTravelBlock(player);
|
||||
boolean onBlock = onBlockCoord != null;
|
||||
showTargets = onBlock || isTravelItemActive(player, false);
|
||||
showTargets = onBlock || (isTravelItemActive(player, false) && !shouldHideTargets(player));
|
||||
if (showTargets) {
|
||||
updateSelectedTarget(player);
|
||||
} else {
|
||||
@@ -619,6 +529,16 @@ public class TravelController {
|
||||
return getTravelItemTravelSource(ep, checkInventoryAndBaubles) != null;
|
||||
}
|
||||
|
||||
/** Currently, we only hide travel targets for the teleport staff, in certain action modes. */
|
||||
public boolean shouldHideTargets(EntityPlayer ep) {
|
||||
if (getTravelItemTravelSource(ep, false) != TravelSource.TELEPORT_STAFF) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int action = ep.isSneaking() ? Config.teleportStaffSneakAction : Config.teleportStaffAction;
|
||||
return action < 2;
|
||||
}
|
||||
|
||||
/** Returns null if no travel item is in inventory/baubles. */
|
||||
@Nullable
|
||||
public TravelSource getTravelItemTravelSource(EntityPlayer ep, boolean checkInventoryAndBaubles) {
|
||||
@@ -628,7 +548,8 @@ public class TravelController {
|
||||
|
||||
ItemStack equipped = ep.getCurrentEquippedItem();
|
||||
if (checkInventoryAndBaubles) {
|
||||
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)) {
|
||||
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)
|
||||
|| !((IItemOfTravel) equipped.getItem()).isActive(ep, equipped)) {
|
||||
equipped = findTravelItemInInventoryOrBaubles(ep);
|
||||
}
|
||||
}
|
||||
@@ -657,7 +578,8 @@ public class TravelController {
|
||||
ItemStack travelItem = null;
|
||||
for (int i = 0; i < ep.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = ep.inventory.getStackInSlot(i);
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel) {
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel
|
||||
&& ((IItemOfTravel) stack.getItem()).isActive(ep, stack)) {
|
||||
travelItem = stack;
|
||||
break;
|
||||
}
|
||||
@@ -668,7 +590,8 @@ public class TravelController {
|
||||
if (baubles != null) {
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
ItemStack stack = baubles.getStackInSlot(i);
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel) {
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel
|
||||
&& ((IItemOfTravel) stack.getItem()).isActive(ep, stack)) {
|
||||
travelItem = stack;
|
||||
break;
|
||||
}
|
||||
@@ -692,7 +615,8 @@ public class TravelController {
|
||||
int travelItemSlot = -1;
|
||||
for (int i = 0; i < ep.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = ep.inventory.getStackInSlot(i);
|
||||
if (stack != null && (stack.getItem() instanceof IItemOfTravel)) {
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel
|
||||
&& ((IItemOfTravel) stack.getItem()).isActive(ep, stack)) {
|
||||
travelItemSlot = i;
|
||||
break;
|
||||
}
|
||||
@@ -703,7 +627,8 @@ public class TravelController {
|
||||
if (baubles != null) {
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
ItemStack stack = baubles.getStackInSlot(i);
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel) {
|
||||
if (stack != null && stack.getItem() instanceof IItemOfTravel
|
||||
&& ((IItemOfTravel) stack.getItem()).isActive(ep, stack)) {
|
||||
travelItemSlot = -(i + 2);
|
||||
break;
|
||||
}
|
||||
@@ -713,43 +638,201 @@ public class TravelController {
|
||||
return travelItemSlot;
|
||||
}
|
||||
|
||||
/** Finds the destination for the teleport staff super-teleport, or returns empty optional if unsuccessful. */
|
||||
public Optional<BlockCoord> findTeleportDestination(EntityPlayer player) {
|
||||
TravelSource source = TravelSource.TELEPORT_STAFF_BLINK;
|
||||
|
||||
Vector3d eye = Util.getEyePositionEio(player);
|
||||
Vector3d look = Util.getLookVecEio(player);
|
||||
|
||||
double playerHeight = player.yOffset;
|
||||
// +2 to compensate for the standard distance decrement of -2
|
||||
double teleDistance = Config.teleportStaffFailedBlinkDistance + 2;
|
||||
Vec3 eye3 = Vec3.createVectorHelper(eye.x, eye.y, eye.z);
|
||||
|
||||
// rayTraceBlocks has a limit of 200 distance.
|
||||
double maxDistance = Config.teleportStaffMaxBlinkDistance;
|
||||
double currDistance = 0;
|
||||
Vec3 pos = eye3;
|
||||
boolean loop = true;
|
||||
while (loop) {
|
||||
double distance = 200;
|
||||
if (maxDistance - currDistance < 200) {
|
||||
distance = maxDistance - currDistance;
|
||||
loop = false;
|
||||
}
|
||||
|
||||
Vector3d sample = new Vector3d(look);
|
||||
sample.scale(distance);
|
||||
sample.add(eye);
|
||||
Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);
|
||||
|
||||
MovingObjectPosition p = player.worldObj
|
||||
.rayTraceBlocks(pos, end, !Config.travelStaffBlinkThroughClearBlocksEnabled);
|
||||
if (p != null) {
|
||||
teleDistance = VecmathUtil.distance(eye, new Vector3d(p.blockX + 0.5, p.blockY + 0.5, p.blockZ + 0.5));
|
||||
break;
|
||||
}
|
||||
|
||||
pos = end;
|
||||
currDistance += distance;
|
||||
}
|
||||
|
||||
Vector3d sample = new Vector3d(look);
|
||||
sample.scale(Config.teleportStaffMaxBlinkDistance);
|
||||
sample.add(eye);
|
||||
Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);
|
||||
MovingObjectPosition p = player.worldObj
|
||||
.rayTraceBlocks(eye3, end, !Config.travelStaffBlinkThroughClearBlocksEnabled);
|
||||
if (p != null) {
|
||||
teleDistance = VecmathUtil.distance(eye, new Vector3d(p.blockX + 0.5, p.blockY + 0.5, p.blockZ + 0.5));
|
||||
}
|
||||
|
||||
double distanceIncrement = -2;
|
||||
int maxIter = Math.min(8, (int) teleDistance / 2);
|
||||
// Special case: if the targeted block is too close, we'll try to teleport through it.
|
||||
if (teleDistance < 4) {
|
||||
distanceIncrement = 0.5;
|
||||
maxIter = 32;
|
||||
}
|
||||
|
||||
for (int i = 0; i < maxIter; i++) {
|
||||
teleDistance += distanceIncrement;
|
||||
|
||||
sample.set(look);
|
||||
sample.scale(teleDistance);
|
||||
sample.add(eye);
|
||||
// we test against our feets location
|
||||
sample.y -= playerHeight;
|
||||
|
||||
Optional<BlockCoord> destinationOptional = findNearbyDestination(player, source, sample);
|
||||
if (destinationOptional.isPresent()) {
|
||||
return destinationOptional;
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/** Finds a long-distance travel anchor, or returns empty optional if unsuccessful. */
|
||||
public Optional<BlockCoord> findTravelDestination(EntityPlayer player, TravelSource source) {
|
||||
double maxDistance = source.getMaxDistanceTravelled();
|
||||
double maxMessageDistance = 1.25 * maxDistance;
|
||||
// Find possible destinations within about 5 degrees.
|
||||
RowSortedTable<Double, Double, BlockCoord> possibleDestinations = findBlocksWithinAngle(
|
||||
player,
|
||||
travelDestinations.get(player.worldObj.provider.dimensionId),
|
||||
0.087,
|
||||
maxMessageDistance);
|
||||
|
||||
for (Table.Cell<Double, Double, BlockCoord> cell : possibleDestinations.cellSet()) {
|
||||
if (cell.getColumnKey() <= maxDistance) {
|
||||
return Optional.of(cell.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (!possibleDestinations.isEmpty()) {
|
||||
// We found at least one block within maxMessageDistance, but no blocks within maxDistance.
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/** Finds a valid destination near the provided vector, or returns empty optional if unsuccessful. */
|
||||
private Optional<BlockCoord> findNearbyDestination(EntityPlayer player, TravelSource source, Vector3d sample) {
|
||||
Optional<BlockCoord> destinationOptional = findValidDestination(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord((int) Math.floor(sample.x), (int) Math.floor(sample.y), (int) Math.floor(sample.z)));
|
||||
if (destinationOptional.isPresent()) {
|
||||
return destinationOptional;
|
||||
}
|
||||
|
||||
destinationOptional = findValidDestination(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord((int) Math.floor(sample.x), (int) Math.floor(sample.y) + 1, (int) Math.floor(sample.z)));
|
||||
if (destinationOptional.isPresent()) {
|
||||
return destinationOptional;
|
||||
}
|
||||
|
||||
if (!Config.travelStaffSearchOptimize) {
|
||||
destinationOptional = findValidDestination(
|
||||
player,
|
||||
source,
|
||||
new BlockCoord(
|
||||
(int) Math.floor(sample.x),
|
||||
(int) Math.floor(sample.y) - 1,
|
||||
(int) Math.floor(sample.z)));
|
||||
if (destinationOptional.isPresent()) {
|
||||
return destinationOptional;
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the provided position if it's valid, or returns empty optional if unsuccessful.
|
||||
*
|
||||
* <p>
|
||||
* To be precise: if the destination is a travel anchor or other block, then the returned coordinates will be one
|
||||
* block higher, to place the player on top of the block.
|
||||
*/
|
||||
public Optional<BlockCoord> findValidDestination(EntityPlayer player, TravelSource source, BlockCoord coord) {
|
||||
// Are we trying to travel to a block (anchor or telepad)?
|
||||
boolean travelToBlock = source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK;
|
||||
|
||||
BlockCoord destination = coord;
|
||||
if (travelToBlock) {
|
||||
TileEntity te = player.worldObj.getTileEntity(coord.x, coord.y, coord.z);
|
||||
if (te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
if (!ta.canBlockBeAccessed(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
// We actually want to go on top of the block.
|
||||
destination = coord.getLocation(ForgeDirection.UP);
|
||||
}
|
||||
|
||||
if (!isInRangeTarget(player, destination, source.getMaxDistanceTravelledSq())) {
|
||||
if (travelToBlock) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
if (!isValidTarget(player, destination, source)) {
|
||||
if (travelToBlock) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(destination);
|
||||
}
|
||||
|
||||
public boolean travelToSelectedTarget(EntityPlayer player, TravelSource source, boolean conserveMomentum) {
|
||||
return travelToLocation(player, source, selectedCoord, conserveMomentum);
|
||||
}
|
||||
|
||||
public boolean travelToLocation(EntityPlayer player, TravelSource source, BlockCoord coord,
|
||||
boolean conserveMomentum) {
|
||||
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
TileEntity te = player.worldObj.getTileEntity(coord.x, coord.y, coord.z);
|
||||
if (te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
if (!ta.canBlockBeAccessed(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Optional<BlockCoord> destinationOptional = findValidDestination(player, source, coord);
|
||||
if (!destinationOptional.isPresent()) {
|
||||
return false;
|
||||
}
|
||||
BlockCoord destination = destinationOptional.get();
|
||||
|
||||
int requiredPower = 0;
|
||||
requiredPower = getRequiredPower(player, source, coord);
|
||||
requiredPower = getRequiredPower(player, source, destination);
|
||||
if (requiredPower < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isInRangeTarget(player, coord, source.getMaxDistanceTravelledSq())) {
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.outOfRange"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!isValidTarget(player, coord, source)) {
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (doClientTeleport(player, coord, source, requiredPower, conserveMomentum)) {
|
||||
if (doClientTeleport(player, destinationOptional.get(), source, requiredPower, conserveMomentum)) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
player.worldObj.spawnParticle(
|
||||
"portal",
|
||||
@@ -764,6 +847,17 @@ public class TravelController {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isValidTarget(EntityPlayer player, BlockCoord bc, TravelSource source) {
|
||||
if (bc == null) {
|
||||
return false;
|
||||
}
|
||||
World w = player.worldObj;
|
||||
BlockCoord baseLoc = bc;
|
||||
|
||||
return canTeleportTo(player, source, baseLoc, w)
|
||||
&& canTeleportTo(player, source, baseLoc.getLocation(ForgeDirection.UP), w);
|
||||
}
|
||||
|
||||
public int getRequiredPower(EntityPlayer player, TravelSource source, BlockCoord coord) {
|
||||
if (!isTravelItemActive(player, true)) {
|
||||
return 0;
|
||||
@@ -808,21 +902,6 @@ public class TravelController {
|
||||
return Math.sqrt(getDistanceSquared(player, coord));
|
||||
}
|
||||
|
||||
private boolean isValidTarget(EntityPlayer player, BlockCoord bc, TravelSource source) {
|
||||
if (bc == null) {
|
||||
return false;
|
||||
}
|
||||
World w = player.worldObj;
|
||||
BlockCoord baseLoc = bc;
|
||||
if (source != TravelSource.STAFF_BLINK && source != TravelSource.TELEPORT_STAFF_BLINK) {
|
||||
// targeting a block so go one up
|
||||
baseLoc = bc.getLocation(ForgeDirection.UP);
|
||||
}
|
||||
|
||||
return canTeleportTo(player, source, baseLoc, w)
|
||||
&& canTeleportTo(player, source, baseLoc.getLocation(ForgeDirection.UP), w);
|
||||
}
|
||||
|
||||
private boolean canTeleportTo(EntityPlayer player, TravelSource source, BlockCoord bc, World w) {
|
||||
if (bc.y < 1) {
|
||||
return false;
|
||||
@@ -904,6 +983,7 @@ public class TravelController {
|
||||
if (selectedBlock instanceof ITravelAccessable) {
|
||||
ITravelAccessable travelBlock = (ITravelAccessable) selectedBlock;
|
||||
BlockCoord targetBlock = new BlockCoord(currentBlock.x, y, currentBlock.z);
|
||||
BlockCoord destination = targetBlock.getLocation(ForgeDirection.UP);
|
||||
|
||||
if (Config.travelAnchorSkipWarning) {
|
||||
if (travelBlock.getRequiresPassword(player)) {
|
||||
@@ -914,55 +994,67 @@ public class TravelController {
|
||||
&& !travelBlock.canUiBeAccessed(player)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipPrivate"));
|
||||
}
|
||||
if (!isValidTarget(player, targetBlock, TravelSource.BLOCK)) {
|
||||
if (!isValidTarget(player, destination, TravelSource.BLOCK)) {
|
||||
showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.skipObstructed"));
|
||||
}
|
||||
}
|
||||
if (travelBlock.canBlockBeAccessed(player) && isValidTarget(player, targetBlock, TravelSource.BLOCK)) {
|
||||
if (travelBlock.canBlockBeAccessed(player) && isValidTarget(player, destination, TravelSource.BLOCK)) {
|
||||
return targetBlock;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a row-sorted table with angle in radians as the row, distance as the column, and block coordinate as the
|
||||
* value, holding all blocks which lie within the specified viewing angle and distance.
|
||||
*
|
||||
* <p>
|
||||
* The table is sorted by angle ascending, so the smallest angle will be first.
|
||||
*
|
||||
* @param player The player to search from.
|
||||
* @param blocks The blocks to search through.
|
||||
* @param maxAngle The maximum allowed angle, in radians.
|
||||
* @param maxDistance The maximum allowed distance.
|
||||
*/
|
||||
private RowSortedTable<Double, Double, BlockCoord> findBlocksWithinAngle(EntityPlayer player,
|
||||
Iterable<BlockCoord> blocks, double maxAngle, double maxDistance) {
|
||||
Vector3d eye = Util.getEyePositionEio(player);
|
||||
Vector3d look = Util.getLookVecEio(player);
|
||||
|
||||
// Table of angle, distance, and block coordinate holding found blocks.
|
||||
// Angle is the row, so this table will automatically be sorted by angle ascending.
|
||||
RowSortedTable<Double, Double, BlockCoord> foundBlocks = TreeBasedTable.create();
|
||||
|
||||
for (BlockCoord p : blocks) {
|
||||
Vector3d block = new Vector3d(p.x + 0.5, p.y + 0.5, p.z + 0.5);
|
||||
block.sub(eye);
|
||||
double distance = block.length();
|
||||
if (distance > maxDistance) {
|
||||
continue;
|
||||
}
|
||||
block.normalize();
|
||||
|
||||
double angle = Math.acos(look.dot(block));
|
||||
if (angle <= maxAngle) {
|
||||
foundBlocks.put(angle, distance, p);
|
||||
}
|
||||
}
|
||||
|
||||
return foundBlocks;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateSelectedTarget(EntityPlayer player) {
|
||||
selectedCoord = null;
|
||||
if (candidates.isEmpty()) {
|
||||
selectedCoord = null;
|
||||
return;
|
||||
}
|
||||
|
||||
double closestDistance = Double.MAX_VALUE;
|
||||
for (BlockCoord bc : candidates.keySet()) {
|
||||
if (!bc.equals(onBlockCoord)) {
|
||||
|
||||
double d = addRatio(bc);
|
||||
if (d < closestDistance) {
|
||||
selectedCoord = bc;
|
||||
closestDistance = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedCoord != null) {
|
||||
|
||||
Vector3d blockCenter = new Vector3d(selectedCoord.x + 0.5, selectedCoord.y + 0.5, selectedCoord.z + 0.5);
|
||||
Vector2d blockCenterPixel = currentView.getScreenPoint(blockCenter);
|
||||
|
||||
Vector2d screenMidPixel = new Vector2d(
|
||||
Minecraft.getMinecraft().displayWidth,
|
||||
Minecraft.getMinecraft().displayHeight);
|
||||
screenMidPixel.scale(0.5);
|
||||
|
||||
double pixDist = blockCenterPixel.distance(screenMidPixel);
|
||||
double rat = pixDist / Minecraft.getMinecraft().displayHeight;
|
||||
if (rat != rat) {
|
||||
rat = 0;
|
||||
}
|
||||
if (rat > 0.07) {
|
||||
selectedCoord = null;
|
||||
}
|
||||
}
|
||||
// Find the nearest travel anchor within roughly 10 degrees.
|
||||
Optional<BlockCoord> selectedBlock = findBlocksWithinAngle(player, candidates.keySet(), 0.175, Double.MAX_VALUE)
|
||||
.values().stream().findFirst();
|
||||
selectedCoord = selectedBlock.orElse(null);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1101,19 +1193,15 @@ public class TravelController {
|
||||
}
|
||||
|
||||
public static void showMessage(EntityPlayer player, IChatComponent chatComponent) {
|
||||
if (Loader.isModLoaded("gtnhlib")) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
chatComponent.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
|
||||
GTNHLib.proxy.sendMessageAboveHotbar((EntityPlayerMP) player, chatComponent, 60, true, true);
|
||||
} else {
|
||||
GTNHLib.proxy.printMessageAboveHotbar(
|
||||
EnumChatFormatting.WHITE + chatComponent.getFormattedText(),
|
||||
60,
|
||||
true,
|
||||
true);
|
||||
}
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
chatComponent.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.WHITE));
|
||||
GTNHLib.proxy.sendMessageAboveHotbar((EntityPlayerMP) player, chatComponent, 60, true, true);
|
||||
} else {
|
||||
player.addChatComponentMessage(chatComponent);
|
||||
GTNHLib.proxy.printMessageAboveHotbar(
|
||||
EnumChatFormatting.WHITE + chatComponent.getFormattedText(),
|
||||
60,
|
||||
true,
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,6 +337,9 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
|
||||
public void validate() {
|
||||
super.validate();
|
||||
if (isTravelSource()) {
|
||||
// Note: travelDestinations is a SetMultimap, which does not allow duplicate entries.
|
||||
// So it's okay if this gets called multiple times with the same BlockCoord.
|
||||
// Though, I think that it's not currently getting called multiple times, anyway.
|
||||
TravelController.instance.travelDestinations.put(worldObj.provider.dimensionId, getLocation());
|
||||
}
|
||||
}
|
||||
@@ -346,10 +349,4 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
|
||||
super.invalidate();
|
||||
TravelController.instance.travelDestinations.remove(worldObj.provider.dimensionId, getLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
TravelController.instance.travelDestinations.remove(worldObj.provider.dimensionId, getLocation());
|
||||
}
|
||||
}
|
||||
+107
-33
@@ -7,7 +7,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.server.S12PacketEntityVelocity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
@@ -18,6 +21,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.teleport.ITravelAccessable;
|
||||
import crazypants.enderio.api.teleport.TeleportEntityEvent;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.teleport.ItemTeleportStaff;
|
||||
@@ -30,13 +34,27 @@ public class PacketLongDistanceTravelEvent
|
||||
boolean conserveMotion;
|
||||
int entityId;
|
||||
int source;
|
||||
// Below values are for also attempting a regular blink if the long-distance anchor check fails.
|
||||
boolean alsoDoTeleport;
|
||||
int tpX;
|
||||
int tpY;
|
||||
int tpZ;
|
||||
|
||||
public PacketLongDistanceTravelEvent() {}
|
||||
|
||||
public PacketLongDistanceTravelEvent(Entity entity, boolean conserveMotion, TravelSource source) {
|
||||
this(entity, conserveMotion, source, false, 0, 0, 0);
|
||||
}
|
||||
|
||||
public PacketLongDistanceTravelEvent(Entity entity, boolean conserveMotion, TravelSource source,
|
||||
boolean alsoDoTeleport, int tpX, int tpY, int tpZ) {
|
||||
this.conserveMotion = conserveMotion;
|
||||
this.entityId = entity instanceof EntityPlayer ? -1 : entity.getEntityId();
|
||||
this.source = source.ordinal();
|
||||
this.alsoDoTeleport = alsoDoTeleport;
|
||||
this.tpX = tpX;
|
||||
this.tpY = tpY;
|
||||
this.tpZ = tpZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,6 +62,10 @@ public class PacketLongDistanceTravelEvent
|
||||
buf.writeBoolean(conserveMotion);
|
||||
buf.writeInt(entityId);
|
||||
buf.writeInt(source);
|
||||
buf.writeBoolean(alsoDoTeleport);
|
||||
buf.writeInt(tpX);
|
||||
buf.writeInt(tpY);
|
||||
buf.writeInt(tpZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +73,10 @@ public class PacketLongDistanceTravelEvent
|
||||
conserveMotion = buf.readBoolean();
|
||||
entityId = buf.readInt();
|
||||
source = buf.readInt();
|
||||
alsoDoTeleport = buf.readBoolean();
|
||||
tpX = buf.readInt();
|
||||
tpY = buf.readInt();
|
||||
tpZ = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,7 +95,14 @@ public class PacketLongDistanceTravelEvent
|
||||
|
||||
TravelSource source = TravelSource.values()[message.source];
|
||||
|
||||
if (!validate(toTp, source)) {
|
||||
if (!validate(
|
||||
toTp,
|
||||
source,
|
||||
message.conserveMotion,
|
||||
message.alsoDoTeleport,
|
||||
message.tpX,
|
||||
message.tpY,
|
||||
message.tpZ)) {
|
||||
Log.LOGGER.warn(
|
||||
Log.securityMarker,
|
||||
"Player {} tried to tp without valid prereq.",
|
||||
@@ -77,35 +110,82 @@ public class PacketLongDistanceTravelEvent
|
||||
return null;
|
||||
}
|
||||
|
||||
doServerTeleport(toTp, message.conserveMotion, source);
|
||||
doServerTeleport(
|
||||
toTp,
|
||||
message.conserveMotion,
|
||||
source,
|
||||
message.alsoDoTeleport,
|
||||
message.tpX,
|
||||
message.tpY,
|
||||
message.tpZ);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean validate(EntityPlayerMP toTp, TravelSource source) {
|
||||
private static boolean validate(EntityPlayerMP toTp, TravelSource source, boolean conserveMotion,
|
||||
boolean alsoDoTeleport, int tpX, int tpY, int tpZ) {
|
||||
ItemStack equippedItem = toTp.getCurrentEquippedItem();
|
||||
switch (source) {
|
||||
case STAFF:
|
||||
// Not allowed to do teleport staff teleport with regular staff.
|
||||
if (alsoDoTeleport) {
|
||||
return false;
|
||||
}
|
||||
return equippedItem != null && equippedItem.getItem() instanceof IItemOfTravel
|
||||
&& ((IItemOfTravel) equippedItem.getItem()).isActive(toTp, equippedItem);
|
||||
case TELEPORT_STAFF:
|
||||
// tp staff is creative version of traveling staff
|
||||
// no energy check or anything else needed
|
||||
// but the player must actually be equipped with one of these
|
||||
if (alsoDoTeleport) {
|
||||
String error = TravelController.instance
|
||||
.validatePacketTravelEvent(toTp, tpX, tpY, tpZ, 0, conserveMotion, source);
|
||||
if (error != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return equippedItem != null && equippedItem.getItem() instanceof ItemTeleportStaff;
|
||||
|
||||
default:
|
||||
// all other types are not allowed
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean doServerTeleport(Entity toTp, boolean conserveMotion, TravelSource source) {
|
||||
EntityPlayer player = toTp instanceof EntityPlayer ? (EntityPlayer) toTp : null;
|
||||
Optional<BlockCoord> travelDestination = TravelController.instance.findTravelDestination(player, source);
|
||||
if (!travelDestination.isPresent()) {
|
||||
public static boolean doServerTeleport(Entity toTp, boolean conserveMotion, TravelSource source,
|
||||
boolean alsoDoTeleport, int tpX, int tpY, int tpZ) {
|
||||
if (!(toTp instanceof EntityPlayer)) {
|
||||
return false;
|
||||
}
|
||||
BlockCoord destination = travelDestination.get();
|
||||
EntityPlayer player = (EntityPlayer) toTp;
|
||||
|
||||
Optional<BlockCoord> travelDestination = TravelController.instance.findTravelDestination(player, source);
|
||||
if (!travelDestination.isPresent()) {
|
||||
if (alsoDoTeleport) {
|
||||
return PacketTravelEvent.doServerTeleport(toTp, tpX, tpY, tpZ, 0, conserveMotion, source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockCoord targetBlock = travelDestination.get();
|
||||
TileEntity te = player.worldObj.getTileEntity(targetBlock.x, targetBlock.y, targetBlock.z);
|
||||
if (te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
if (!ta.canBlockBeAccessed(player)) {
|
||||
TravelController
|
||||
.showMessage(player, new ChatComponentTranslation("enderio.gui.travelAccessable.unauthorised"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// We're teleporting to a block, so go one above.
|
||||
BlockCoord destination = targetBlock.getLocation(ForgeDirection.UP);
|
||||
if (!TravelController.instance.isValidTarget(player, destination, source)) {
|
||||
TravelController
|
||||
.showMessage(player, new ChatComponentTranslation("enderio.blockTravelPlatform.invalidTarget"));
|
||||
return false;
|
||||
}
|
||||
|
||||
int x = destination.x;
|
||||
int y = destination.y;
|
||||
int z = destination.z;
|
||||
@@ -113,7 +193,7 @@ public class PacketLongDistanceTravelEvent
|
||||
if (powerUse < 0) {
|
||||
return false;
|
||||
}
|
||||
if (player != null && player.getCurrentEquippedItem() != null
|
||||
if (player.getCurrentEquippedItem() != null
|
||||
&& player.getCurrentEquippedItem().getItem() instanceof IItemOfTravel) {
|
||||
int used = ((IItemOfTravel) player.getCurrentEquippedItem().getItem())
|
||||
.canExtractInternal(player.getCurrentEquippedItem(), powerUse);
|
||||
@@ -134,32 +214,26 @@ public class PacketLongDistanceTravelEvent
|
||||
|
||||
toTp.playSound(source.sound, 1.0F, 1.0F);
|
||||
|
||||
if (player != null) {
|
||||
player.setPositionAndUpdate(x + 0.5, y + 1.1, z + 0.5);
|
||||
} else {
|
||||
toTp.setPosition(x, y, z);
|
||||
player.setPositionAndUpdate(x + 0.5, y + 0.1, z + 0.5);
|
||||
|
||||
player.worldObj.playSoundEffect(x, y, z, source.sound, 1.0F, 1.0F);
|
||||
player.fallDistance = 0;
|
||||
|
||||
if (conserveMotion) {
|
||||
Vector3d velocityVex = Util.getLookVecEio(player);
|
||||
S12PacketEntityVelocity p = new S12PacketEntityVelocity(
|
||||
toTp.getEntityId(),
|
||||
velocityVex.x,
|
||||
velocityVex.y,
|
||||
velocityVex.z);
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(p);
|
||||
}
|
||||
|
||||
toTp.worldObj.playSoundEffect(x, y, z, source.sound, 1.0F, 1.0F);
|
||||
toTp.fallDistance = 0;
|
||||
|
||||
if (player != null) {
|
||||
if (conserveMotion) {
|
||||
Vector3d velocityVex = Util.getLookVecEio(player);
|
||||
S12PacketEntityVelocity p = new S12PacketEntityVelocity(
|
||||
toTp.getEntityId(),
|
||||
velocityVex.x,
|
||||
velocityVex.y,
|
||||
velocityVex.z);
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(p);
|
||||
}
|
||||
|
||||
if (powerUse > 0 && player.getCurrentEquippedItem() != null
|
||||
&& player.getCurrentEquippedItem().getItem() instanceof IItemOfTravel) {
|
||||
ItemStack item = player.getCurrentEquippedItem().copy();
|
||||
((IItemOfTravel) item.getItem()).extractInternal(item, powerUse);
|
||||
toTp.setCurrentItemOrArmor(0, item);
|
||||
}
|
||||
if (powerUse > 0 && player.getCurrentEquippedItem() != null
|
||||
&& player.getCurrentEquippedItem().getItem() instanceof IItemOfTravel) {
|
||||
ItemStack item = player.getCurrentEquippedItem().copy();
|
||||
((IItemOfTravel) item.getItem()).extractInternal(item, powerUse);
|
||||
toTp.setCurrentItemOrArmor(0, item);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -118,7 +118,7 @@ public class PacketTravelEvent implements IMessage, IMessageHandler<PacketTravel
|
||||
toTp.playSound(source.sound, 1.0F, 1.0F);
|
||||
|
||||
if (player != null) {
|
||||
player.setPositionAndUpdate(x + 0.5, y + 1.1, z + 0.5);
|
||||
player.setPositionAndUpdate(x + 0.5, y + 0.1, z + 0.5);
|
||||
} else {
|
||||
toTp.setPosition(x, y, z);
|
||||
}
|
||||
|
||||
@@ -344,14 +344,13 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
} else if (itemStack.getItem() == EnderIO.itemMEConduit) {
|
||||
NBTTagCompound nbtRoot = accessor.getNBTData();
|
||||
if (nbtRoot.hasKey("isDense")) {
|
||||
boolean isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
|
||||
boolean isDense = nbtRoot.getBoolean("isDense");
|
||||
int channelsInUse = nbtRoot.getInteger("channelsInUse");
|
||||
currenttip.add(
|
||||
MessageFormat.format(
|
||||
EnderIO.lang.localize("itemMEConduit.channelsUsed"),
|
||||
channelsInUse,
|
||||
isDenseUltra ? 128 : (isDense ? 32 : 8)));
|
||||
isDense ? 32 : 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,7 +386,6 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
if (mec != null) {
|
||||
tag.setInteger("channelsInUse", mec.getChannelsInUse());
|
||||
tag.setBoolean("isDense", mec.isDense());
|
||||
tag.setBoolean("isDenseUltra", mec.isDenseUltra());
|
||||
}
|
||||
} else if (te instanceof IInternalPoweredTile) {
|
||||
IInternalPoweredTile ipte = (IInternalPoweredTile) te;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package crazypants.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityPortalFX;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
@@ -47,18 +51,35 @@ public class ClientUtil {
|
||||
con.readFromNBT(pkt.tc, TileConduitBundle.NBT_VERSION);
|
||||
}
|
||||
|
||||
public static void spawnFarmParcticles(Random rand, BlockCoord bc) {
|
||||
double xOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
|
||||
double yOff = 0.5 + (rand.nextDouble() - 0.5) * 0.2;
|
||||
double zOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
|
||||
Minecraft.getMinecraft().theWorld.spawnParticle(
|
||||
"portal",
|
||||
bc.x + xOff,
|
||||
bc.y + yOff,
|
||||
bc.z + zOff,
|
||||
(rand.nextDouble() - 0.5) * 1.5,
|
||||
-rand.nextDouble(),
|
||||
(rand.nextDouble() - 0.5) * 1.5);
|
||||
public static void spawnFarmParticles(Random rand, List<BlockCoord> coords, int particlesCount) {
|
||||
// 0 = All, 1 = Decreased, 2 = Minimal
|
||||
int particleSetting = Minecraft.getMinecraft().gameSettings.particleSetting;
|
||||
if (particleSetting >= 2 /* Minimal */) {
|
||||
return;
|
||||
}
|
||||
|
||||
int particles = particleSetting == 0 ? particlesCount /* All */
|
||||
: (particlesCount / 2) /* Decreased */;
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
EffectRenderer effectRenderer = Minecraft.getMinecraft().effectRenderer;
|
||||
|
||||
for (BlockCoord bc : coords) {
|
||||
for (int i = 0; i < particles; i++) {
|
||||
double xOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
|
||||
double yOff = 0.5 + (rand.nextDouble() - 0.5) * 0.2;
|
||||
double zOff = 0.5 + (rand.nextDouble() - 0.5) * 1.1;
|
||||
effectRenderer.addEffect(
|
||||
new EntityPortalFX(
|
||||
world,
|
||||
bc.x + xOff,
|
||||
bc.y + yOff,
|
||||
bc.z + zOff,
|
||||
(rand.nextDouble() - 0.5) * 1.5,
|
||||
-rand.nextDouble(),
|
||||
(rand.nextDouble() - 0.5) * 1.5));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setTankNBT(PacketCombustionTank message, int x, int y, int z) {
|
||||
|
||||
@@ -1130,6 +1130,7 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.name=Apiarist's Pants
|
||||
enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protection against bees
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Apiarist's Shoes
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protection against bees
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Brýle strojvůdce
|
||||
enderio.darksteel.upgrade.jump.enabled=Jump Enabled
|
||||
enderio.darksteel.upgrade.jump.disabled=Jump Disabled
|
||||
enderio.darksteel.upgrade.solar_one.name=Solar I
|
||||
@@ -1219,6 +1220,7 @@ enderio.category.darksteelarmor=Dark Steel Armor
|
||||
enderio.category.tools=EnderIO - Tools
|
||||
enderio.keybind.glidertoggle=Glider Toggle
|
||||
enderio.keybind.gogglesofrevealing=Goggles of Revealing
|
||||
enderio.keybind.trackmansgoggles=Brýle strojvůdce
|
||||
enderio.keybind.nightvision=Night Vision
|
||||
enderio.keybind.soundlocator=Sound Locator
|
||||
enderio.keybind.speed=Speed
|
||||
|
||||
@@ -130,7 +130,6 @@ enderio.itemGasConduit.tooltip.detailed.line1=Transportiert Mekanism-kompatible
|
||||
|
||||
enderio.itemMEConduit.name=ME-Leitung
|
||||
enderio.itemMEConduitDense.name=Dichte ME-Leitung
|
||||
enderio.itemMEConduitDenseUltra.name=Extrem Dichte ME-Leitungen
|
||||
enderio.itemMEConduit.channelsUsed={0,number} von {1,number} Kanälen
|
||||
|
||||
enderio.itemOCConduit.name=Netzwerkleitung (OC)
|
||||
@@ -907,6 +906,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Schutz g
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Imkerschuhe
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Schutz gegen Beinen
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Schienenwartbrille
|
||||
|
||||
item.itemGliderWing.name=Gleiterflügel
|
||||
item.itemGliderWings.name=Gleiterflügelpaar
|
||||
item.itemGliderWings.tooltip.detailed.line1=Upgrade für den
|
||||
@@ -1242,6 +1243,7 @@ enderio.category.darksteelarmor=Dunkelstahlrüstung
|
||||
enderio.category.tools=EnderIO - Werkzeuge
|
||||
enderio.keybind.glidertoggle=Gleiterschaltung
|
||||
enderio.keybind.gogglesofrevealing=Brille der Enthüllung
|
||||
enderio.keybind.trackmansgoggles=Schienenwartbrille
|
||||
enderio.keybind.nightvision=Nachtsicht
|
||||
enderio.keybind.soundlocator=Schalldetektor
|
||||
enderio.keybind.speed=Schnelligkeit
|
||||
|
||||
@@ -19,6 +19,7 @@ item.enderio.itemEnderface.name=Enderface
|
||||
|
||||
#Conduits
|
||||
enderio.blockConduitBundle=Conduit Bundle
|
||||
tile.blockConduitFacade.name=Conduit Facade
|
||||
enderio.blockConduitFacade=Conduit Facade
|
||||
item.enderio.itemConduitFacade.name=Conduit Facade
|
||||
item.enderio.itemConduitFacade.hardened.name=Hardened Conduit Facade
|
||||
@@ -29,10 +30,12 @@ item.enderio.itemConduitFacade.tooltip.detailed.line3=Hidden when a wrench or co
|
||||
item.enderio.itemConduitFacade.tooltip.detailed.line4=is equipped
|
||||
item.enderio.itemConduitFacade.hardened.tooltip=Hardened: Resists breaking and explosions
|
||||
|
||||
item.itemPowerConduit.name=Energy Conduit
|
||||
enderio.itemPowerConduit.name=Energy Conduit
|
||||
enderio.itemPowerConduitEnhanced.name=Enhanced Energy Conduit
|
||||
enderio.itemPowerConduitEnder.name=Ender Energy Conduit
|
||||
|
||||
item.itemPowerConduitEndergy.name=Energy Conduit
|
||||
enderio.itemPowerConduitEndergyCrude.name=Clay Compound Energy Conduit
|
||||
enderio.itemPowerConduitEndergyIron.name=Iron Energy Conduit
|
||||
enderio.itemPowerConduitEndergyAluminum.name=Aluminum Energy Conduit
|
||||
@@ -46,10 +49,12 @@ enderio.itemPowerConduitEndergyCrystallinePinkSlime.name=Crystalline Pink Slime
|
||||
enderio.itemPowerConduitEndergyMelodic.name=Melodic Energy Conduit
|
||||
enderio.itemPowerConduitEndergyStellar.name=Stellar Energy Conduit
|
||||
|
||||
item.itemRedstoneConduit.name=Redstone Conduit
|
||||
enderio.itemRedstoneConduit.name=Redstone Conduit
|
||||
enderio.itemRedstoneConduitSwitch.name=Conduit Switch
|
||||
enderio.itemRedstoneConduitInsulated.name=Insulated Redstone Conduit
|
||||
|
||||
item.itemLiquidConduit.name=Fluid Conduit
|
||||
enderio.itemLiquidConduit.name=Fluid Conduit
|
||||
enderio.itemLiquidConduitAdvanced.name=Pressurized Fluid Conduit
|
||||
enderio.itemLiquidConduitEnder.name=Ender Fluid Conduit
|
||||
@@ -71,10 +76,13 @@ enderio.itemLiquidConduitEnder.tooltip.detailed.line1=Instant fluid teleportatio
|
||||
enderio.itemLiquidConduitEnder.tooltip.detailed.line2=allows multiple fluids to be
|
||||
enderio.itemLiquidConduitEnder.tooltip.detailed.line3=transported on the same line
|
||||
|
||||
item.itemItemConduit.name=Item Conduit
|
||||
enderio.itemItemConduit.name=Item Conduit
|
||||
|
||||
item.itemBasicFilterUpgrade.name=Item Filter
|
||||
enderio.filterUpgradeBasic.name=Basic Item Filter
|
||||
enderio.filterUpgradeAdvanced.name=Advanced Item Filter
|
||||
item.itemBigFilterUpgrade.name=Big Item Filter
|
||||
enderio.filterUpgradeBig.name=Big Item Filter
|
||||
enderio.filterUpgradeBigAdvanced.name=Big Advanced Item Filter
|
||||
enderio.itemConduitFilterUpgrade=Upgrade for item conduits
|
||||
@@ -119,6 +127,7 @@ item.itemExtractSpeedDowngrade.tooltip.basic.line1=Downgrade for item conduits
|
||||
item.itemExtractSpeedDowngrade.tooltip.detailed.line1=Reduces speed to 1
|
||||
item.itemExtractSpeedDowngrade.tooltip.detailed.line2=item per extraction
|
||||
|
||||
item.itemFunctionUpgrade.name=Remote Awareness Upgrade
|
||||
item.itemInventoryPanelUpgrade.name=Remote Awareness Upgrade
|
||||
item.itemInventoryPanelUpgrade.tooltip.basic.line1=Inventory Panel Remote Awareness
|
||||
item.itemInventoryPanelUpgrade.tooltip.detailed.line1=Function upgrade for item conduits
|
||||
@@ -134,11 +143,12 @@ enderio.itemGasConduit.tooltip.maxExtract=Max Extract:
|
||||
enderio.itemGasConduit.tooltip.maxIo=Max IO:
|
||||
enderio.itemGasConduit.tooltip.detailed.line1=Transfers Mekanism-compatible gases
|
||||
|
||||
item.itemMEConduit.name=ME Conduit
|
||||
enderio.itemMEConduit.name=ME Conduit
|
||||
enderio.itemMEConduitDense.name=Dense ME Conduit
|
||||
enderio.itemMEConduitDenseUltra.name=Ultra Dense ME Conduit
|
||||
enderio.itemMEConduit.channelsUsed={0,number} of {1,number} Channels
|
||||
|
||||
item.itemOCConduit.name=Network Conduit (OC)
|
||||
enderio.itemOCConduit.name=Network Conduit (OC)
|
||||
|
||||
#Entity
|
||||
@@ -146,11 +156,12 @@ entity.witherSkeleton.name=Wither Skeleton
|
||||
|
||||
#Materials
|
||||
enderio.itemMaterial.name=Materials
|
||||
item.itemMaterial.name=Materials
|
||||
enderio.silicon.name=Silicon
|
||||
enderio.conduitBinder.name=Conduit Binder
|
||||
enderio.binderComposite.name=Binder Composite
|
||||
enderio.phasedIronNugget.name=Pulsating Iron Nugget
|
||||
tile.blockDarkIronBars.name=Dark Iron Bars
|
||||
tile.blockDarkIronBars.name=Dark Steel Bars
|
||||
tile.blockSoulariumBars.name=Soularium Bars
|
||||
tile.blockEndSteelBars.name=End Steel Bars
|
||||
tile.blockEndermanSkull.name=Enderman Skull
|
||||
@@ -222,6 +233,7 @@ enderio.gas.gasTick=Gas/t
|
||||
|
||||
#Materials
|
||||
enderio.itemMachinePart.name=Machine Parts
|
||||
item.itemMachinePart.name=Machine Parts
|
||||
enderio.machineChassi.name=Machine Chassis
|
||||
enderio.basicGear.name=Basic Gear
|
||||
enderio.soulMachineChassi.name=Soul Machine Chassis
|
||||
@@ -232,6 +244,7 @@ enderio.enderCrystal.name=Ender Crystal
|
||||
enderio.attractorCrystal.name=Enticing Crystal
|
||||
enderio.weatherCrystal.name=Weather Crystal
|
||||
|
||||
item.itemGrindingBall.name=Grinding Ball
|
||||
enderio.darkGrindingBall.name=Dark Steel Ball
|
||||
enderio.electricalGrindingBall.name=Electrical Steel Ball
|
||||
enderio.energeticGrindingBall.name=Energetic Alloy Ball
|
||||
@@ -265,6 +278,7 @@ enderio.itemPowderIngot=Powders & Ingots
|
||||
|
||||
#Alloys
|
||||
enderio.itemAlloy.name=Alloy
|
||||
item.itemAlloy.name=Alloy
|
||||
enderio.electricalSteel.name=Electrical Steel
|
||||
enderio.energeticAlloy.name=Energetic Alloy
|
||||
enderio.phasedGold.name=Vibrant Alloy
|
||||
@@ -277,6 +291,7 @@ enderio.soularium.name=Soularium
|
||||
enderio.endSteel.name=End Steel
|
||||
enderio.endSteelNugget.name=End Steel Nugget
|
||||
|
||||
item.itemAlloyEndergy.name=Alloy
|
||||
enderio.crudeSteel.name=Clay Compound
|
||||
enderio.crystallineAlloy.name=Crystalline Alloy
|
||||
enderio.melodicAlloy.name=Melodic Alloy
|
||||
@@ -285,6 +300,7 @@ enderio.crystallinePinkSlime.name=Crystalline Pink Slime
|
||||
enderio.energeticSilver.name=Energetic Silver
|
||||
enderio.vividAlloy.name=Vivid Alloy
|
||||
|
||||
item.itemGrindingBallEndergy.name=Grinding Ball
|
||||
enderio.crudeSteelGrindingBall.name=Clay Compound Grinding Ball
|
||||
enderio.crystallineAlloyGrindingBall.name=Crystalline Alloy Grinding Ball
|
||||
enderio.melodicAlloyGrindingBall.name=Melodic Alloy Grinding Ball
|
||||
@@ -323,6 +339,7 @@ tile.enderio.darkSteel.name=Dark Steel Block
|
||||
tile.enderio.soularium.name=Soularium Block
|
||||
tile.enderio.endSteel.name=End Steel Block
|
||||
|
||||
tile.blockIngotStorageEndergy.name=Alloy Block
|
||||
tile.enderio.crudeSteel.name=Clay Compound Block
|
||||
tile.enderio.crystallineAlloy.name=Crystalline Alloy Block
|
||||
tile.enderio.melodicAlloy.name=Melodic Alloy Block
|
||||
@@ -332,6 +349,7 @@ tile.enderio.energeticSilver.name=Energetic Silver Block
|
||||
tile.enderio.vividAlloy.name=Vivid Alloy Block
|
||||
|
||||
#Powder / Ingot
|
||||
item.itemPowderIngot.name=Powder
|
||||
enderio.powderCoal.name=Coal Powder
|
||||
enderio.powderIron.name=Iron Powder
|
||||
enderio.powderGold.name=Gold Powder
|
||||
@@ -343,6 +361,7 @@ enderio.ingotEnderiumBase.name=Enderium Base
|
||||
|
||||
#Capacitors
|
||||
enderio.itemBasicCapacitor.name=Capacitor
|
||||
item.itemBasicCapacitor.name=Capacitor
|
||||
enderio.basicCapacitor.name=Basic Capacitor
|
||||
enderio.activatedCapacitor.name=Double-Layer Capacitor
|
||||
enderio.enderCapacitor.name=Octadic Capacitor
|
||||
@@ -391,6 +410,7 @@ enderio.maxSolorProduction=Max Output
|
||||
enderio.tooltip.efficiency=Efficiency
|
||||
enderio.tooltip.sunlightBlocked=Sky Blocked!
|
||||
|
||||
tile.blockElectricLight.name=Powered Light
|
||||
item.itemElectricLight.name=Powered Light
|
||||
item.itemElectricLight.tooltip.detailed.line1=Lights a large area when supplied with
|
||||
item.itemElectricLight.tooltip.detailed.line2=power and a redstone signal.
|
||||
@@ -408,6 +428,8 @@ item.itemLightInverted.name=Light (Inverted)
|
||||
item.itemLightInverted.tooltip.detailed.line1=Emits light, disable with
|
||||
item.itemLightInverted.tooltip.detailed.line2=a redstone signal.
|
||||
|
||||
tile.blockLightNode.name=Light Node
|
||||
|
||||
item.itemWirelessLight.name=Wireless Powered Light
|
||||
item.itemWirelessLight.tooltip.detailed.line1=Lights a large area when supplied with
|
||||
item.itemWirelessLight.tooltip.detailed.line2=power and a redstone signal.
|
||||
@@ -425,6 +447,7 @@ tile.blockCapacitorBank.tooltip.detailed.line1=Convert to new block by placing
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=in a crafting grid
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contains
|
||||
|
||||
tile.blockCapBank.name=Capacitor Bank
|
||||
tile.blockCapBank.creative.name=Creative Capacitor Bank
|
||||
tile.blockCapBank.simple.name=Basic Capacitor Bank
|
||||
tile.blockCapBank.activated.name=Capacitor Bank
|
||||
@@ -622,6 +645,7 @@ tile.blockWeatherObelisk.tooltip.detailed.line1=Changes the current weather
|
||||
tile.blockWeatherObelisk.tooltip.detailed.line2=Requires a lot of power and
|
||||
tile.blockWeatherObelisk.tooltip.detailed.line3=a catalyst item
|
||||
|
||||
tile.blockBuffer.name=Buffer
|
||||
tile.blockBuffer.item.name=Item Buffer
|
||||
tile.blockBuffer.power.name=Power Buffer
|
||||
tile.blockBuffer.omni.name=Omni Buffer
|
||||
@@ -696,6 +720,7 @@ tile.blockDarkSteelPressurePlate.silent.tooltip.detailed.line2=Can be painted in
|
||||
tile.blockDarkSteelPressurePlate.silent.tooltip.detailed.line3=invisible when painted with Quite
|
||||
tile.blockDarkSteelPressurePlate.silent.tooltip.detailed.line4=Clear Glass
|
||||
|
||||
tile.blockDarkSteelAnvil.name=Dark Steel Anvil
|
||||
tile.blockDarkSteelAnvil.intact.name=Dark Steel Anvil
|
||||
tile.blockDarkSteelAnvil.slightlyDamaged.name=Slightly Damaged Dark Steel Anvil
|
||||
tile.blockDarkSteelAnvil.veryDamaged.name=Very Damaged Dark Steel Anvil
|
||||
@@ -759,6 +784,7 @@ tile.blockPaintedFenceGate.name=Painted Gate
|
||||
tile.blockPaintedWall.name=Painted Wall
|
||||
tile.blockPaintedStair.name=Painted Stairs
|
||||
tile.blockPaintedSlab.name=Painted Slab
|
||||
tile.blockPaintedSlabDouble.name=Painted Slab
|
||||
tile.blockPaintedDoubleSlab.name=Painted Slab
|
||||
tile.blockPaintedGlowstone.name=Painted Glowstone
|
||||
tile.blockPaintedCarpet.name=Painted Carpet
|
||||
@@ -810,6 +836,7 @@ item.itemXpTransfer.tooltip.detailed.line2=liquid XP to gain levels
|
||||
item.itemXpTransfer.tooltip.detailed.line3=Shift-R-Click to transfer levels to
|
||||
item.itemXpTransfer.tooltip.detailed.line4=the tank
|
||||
|
||||
item.itemFrankenSkull.name=Zombie Electrode
|
||||
skullZombieElectrode.name=Zombie Electrode
|
||||
skullZombieController.name=Z-Logic Controller
|
||||
skullZombieFrankenstien.name=Frank'N'Zombie
|
||||
@@ -947,6 +974,9 @@ enderio.darksteel.upgrade.gogglesOfRevealing.tooltip.detailed.line1=Vis Discount
|
||||
enderio.darksteel.upgrade.gogglesOfRevealing.enabled=Magic is being revealed
|
||||
enderio.darksteel.upgrade.gogglesOfRevealing.disabled=Magic is hidden from plain sight
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Trackman's Goggles
|
||||
enderio.darksteel.upgrade.trackmansGoggles.tooltip.detailed.line1=Show infrastructure and anchor auras
|
||||
|
||||
enderio.darksteel.upgrade.naturalistEye.name=Naturalist's Eye
|
||||
enderio.darksteel.upgrade.naturalistEye.tooltip.detailed.line1=Shows pollinated tree leaves
|
||||
|
||||
@@ -1071,6 +1101,10 @@ enderio.gui.machine.side.west=West
|
||||
enderio.gui.machine.side.east=East
|
||||
enderio.gui.machine.side.up=Up
|
||||
enderio.gui.machine.side.down=Down
|
||||
enderio.gui.machine.weather.control=Control Mode
|
||||
enderio.gui.machine.weather.redstone=Launch on Redstone
|
||||
enderio.gui.machine.weather.manual=Default Control Mode
|
||||
enderio.gui.machine.weather.run=Launch
|
||||
|
||||
|
||||
#Power Monitor
|
||||
@@ -1385,6 +1419,7 @@ enderio.category.darksteelarmor=Dark Steel Armor
|
||||
enderio.category.tools=EnderIO - Tools
|
||||
enderio.keybind.glidertoggle=Glider Toggle
|
||||
enderio.keybind.gogglesofrevealing=Goggles of Revealing
|
||||
enderio.keybind.trackmansgoggles=Trackman's Goggles
|
||||
enderio.keybind.nightvision=Night Vision
|
||||
enderio.keybind.soundlocator=Sound Locator
|
||||
enderio.keybind.speed=Speed
|
||||
|
||||
@@ -660,6 +660,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protecci
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Zapatos del Apicultor
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protección contra abejas.
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Gafas de Ferroviario
|
||||
|
||||
item.itemGliderWing.name=Ala de Planeador
|
||||
item.itemGliderWings.name=Alas de Planeador
|
||||
item.itemGliderWings.tooltip.detailed.line1=Mejora para la pechera de Acero Oscuro.
|
||||
@@ -979,6 +981,7 @@ enderio.category.darksteelarmor=Armadura de Acero Oscuro
|
||||
enderio.category.tools=EnderIO - Herramientas
|
||||
enderio.keybind.glidertoggle=Activar/Desactivar Planeador
|
||||
enderio.keybind.gogglesofrevealing=Gafas de Revelación
|
||||
enderio.keybind.trackmansgoggles=Gafas de Ferroviario
|
||||
enderio.keybind.nightvision=Visión Nocturna
|
||||
enderio.keybind.soundlocator=Localizador de Sonidos
|
||||
enderio.keybind.speed=Velocidad
|
||||
|
||||
@@ -662,6 +662,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protecci
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Zapatos del Apicultor
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protección contra abejas.
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Gafas de Ferroviario
|
||||
|
||||
item.itemGliderWing.name=Ala de Planeador
|
||||
item.itemGliderWings.name=Alas de Planeador
|
||||
item.itemGliderWings.tooltip.detailed.line1=Mejora para la pechera de Acero Oscuro.
|
||||
@@ -981,6 +983,7 @@ enderio.category.darksteelarmor=Armadura de Acero Oscuro
|
||||
enderio.category.tools=EnderIO - Herramientas
|
||||
enderio.keybind.glidertoggle=Activar/Desactivar Planeador
|
||||
enderio.keybind.gogglesofrevealing=Gafas de Revelación
|
||||
enderio.keybind.trackmansgoggles=Gafas de Ferroviario
|
||||
enderio.keybind.nightvision=Visión Nocturna
|
||||
enderio.keybind.soundlocator=Localizador de Sonidos
|
||||
enderio.keybind.speed=Velocidad
|
||||
|
||||
@@ -660,6 +660,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protecci
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Zapatos del Apicultor
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protección contra abejas.
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Gafas de Ferroviario
|
||||
|
||||
item.itemGliderWing.name=Ala de Planeador
|
||||
item.itemGliderWings.name=Alas de Planeador
|
||||
item.itemGliderWings.tooltip.detailed.line1=Mejora para la pechera de Acero Oscuro.
|
||||
@@ -979,6 +981,7 @@ enderio.category.darksteelarmor=Armadura de Acero Oscuro
|
||||
enderio.category.tools=EnderIO - Herramientas
|
||||
enderio.keybind.glidertoggle=Activar/Desactivar Planeador
|
||||
enderio.keybind.gogglesofrevealing=Gafas de Revelación
|
||||
enderio.keybind.trackmansgoggles=Gafas de Ferroviario
|
||||
enderio.keybind.nightvision=Visión Nocturna
|
||||
enderio.keybind.soundlocator=Localizador de Sonidos
|
||||
enderio.keybind.speed=Velocidad
|
||||
|
||||
@@ -660,6 +660,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protecci
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Zapatos del Apicultor
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protección contra abejas.
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Gafas de Ferroviario
|
||||
|
||||
item.itemGliderWing.name=Ala de Planeador
|
||||
item.itemGliderWings.name=Alas de Planeador
|
||||
item.itemGliderWings.tooltip.detailed.line1=Mejora para la pechera de Acero Oscuro.
|
||||
@@ -979,6 +981,7 @@ enderio.category.darksteelarmor=Armadura de Acero Oscuro
|
||||
enderio.category.tools=EnderIO - Herramientas
|
||||
enderio.keybind.glidertoggle=Activar/Desactivar Planeador
|
||||
enderio.keybind.gogglesofrevealing=Gafas de Revelación
|
||||
enderio.keybind.trackmansgoggles=Gafas de Ferroviario
|
||||
enderio.keybind.nightvision=Visión Nocturna
|
||||
enderio.keybind.soundlocator=Localizador de Sonidos
|
||||
enderio.keybind.speed=Velocidad
|
||||
|
||||
@@ -979,6 +979,8 @@ enderio.category.darksteelarmor=Armadura de Acero Oscuro
|
||||
enderio.category.tools=EnderIO - Herramientas
|
||||
enderio.keybind.glidertoggle=Activar/Desactivar Planeador
|
||||
enderio.keybind.gogglesofrevealing=Gafas de Revelación
|
||||
enderio.keybind.trackmansgoggles=Gafas de Ferroviario
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Gafas de Ferroviario
|
||||
enderio.keybind.nightvision=Visión Nocturna
|
||||
enderio.keybind.soundlocator=Localizador de Sonidos
|
||||
enderio.keybind.speed=Velocidad
|
||||
|
||||
@@ -683,6 +683,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Protecti
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Chaussures d'Apiculteur
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Protection contre les abeilles
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Lunettes de l'agent de voie
|
||||
|
||||
item.itemGliderWing.name=Aile de Planeur
|
||||
item.itemGliderWings.name=Ailes de Planeur
|
||||
item.itemGliderWings.tooltip.detailed.line1=Amélioration pour
|
||||
@@ -996,6 +998,7 @@ enderio.category.darksteelarmor=Armure d'Acier Sombre
|
||||
enderio.category.tools=EnderIO - Outils
|
||||
enderio.keybind.glidertoggle=Mode Planeur
|
||||
enderio.keybind.gogglesofrevealing=Lunettes de Révélation
|
||||
enderio.keybind.trackmansgoggles=Lunettes de l'agent de voie
|
||||
enderio.keybind.nightvision=Vision Nocturne
|
||||
enderio.keybind.soundlocator=Détecteur de Sons
|
||||
enderio.keybind.speed=Vitesse
|
||||
|
||||
@@ -949,6 +949,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=Защи
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=Обувь пчеловода
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=Защита от пчёл
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=Очки обходчика путей
|
||||
|
||||
item.itemGliderWing.name=Крыло планёра
|
||||
item.itemGliderWings.name=Крылья планёра
|
||||
item.itemGliderWings.tooltip.detailed.line1=Улучшается кирасой
|
||||
@@ -1292,6 +1294,7 @@ enderio.category.darksteelarmor=Броня из тёмной стали
|
||||
enderio.category.tools=EnderIO - Инструменты
|
||||
enderio.keybind.glidertoggle=Переключить планер
|
||||
enderio.keybind.gogglesofrevealing=Очки откровения
|
||||
enderio.keybind.trackmansgoggles=Очки обходчика путей
|
||||
enderio.keybind.nightvision=Ночное зрение
|
||||
enderio.keybind.soundlocator=Звуколокатор
|
||||
enderio.keybind.speed=Скорость
|
||||
|
||||
@@ -949,6 +949,8 @@ enderio.darksteel.upgrade.apiaristArmor.leggings.tooltip.detailed.line1=提供
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.name=养蜂员之鞋
|
||||
enderio.darksteel.upgrade.apiaristArmor.boots.tooltip.detailed.line1=提供保护以减少蜜蜂的伤害
|
||||
|
||||
enderio.darksteel.upgrade.trackmansGoggles.name=铁路工护目镜
|
||||
|
||||
item.itemGliderWing.name=滑翔翼
|
||||
item.itemGliderWings.name=滑翔翼
|
||||
item.itemGliderWings.tooltip.detailed.line1=用于升级
|
||||
@@ -1372,6 +1374,7 @@ enderio.category.darksteelarmor=玄铁护甲
|
||||
enderio.category.tools=EnderIO - 工具
|
||||
enderio.keybind.glidertoggle=滑翔开关
|
||||
enderio.keybind.gogglesofrevealing=揭示护目镜
|
||||
enderio.keybind.trackmansgoggles=铁路工护目镜
|
||||
enderio.keybind.nightvision=夜视
|
||||
enderio.keybind.soundlocator=声波定位
|
||||
enderio.keybind.speed=速度
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 731 B |
Binary file not shown.
|
Before Width: | Height: | Size: 298 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
Reference in new issue
Block a user