Compare commits

...
18 Commits
Author SHA1 Message Date
Martin Robertz 26ff69921f update 2024-12-29 00:18:41 +01:00
Pascal aa1ac50bd4 ensure TileLightNode instance at breakBlock (#181)
(cherry picked from commit 4558f194be)
2024-12-29 00:15:10 +01:00
Martin Robertz e12142890e update 2024-11-16 15:28:59 +01:00
Kogepan229andboubou19 e6ebb5dfec Fix Zombie Generator NPE (#180)
Co-authored-by: boubou19 <[email protected]>
2024-11-14 19:22:20 +00:00
54M44R 1d4f6831dd Prevent Silver Capacitor from being used as Upgrade (#178) 2024-11-14 13:32:38 +00:00
Dream Master 726ce46475 update 2024-11-12 12:15:49 +01:00
Noc d01de95e8e removed conduit subtype (#179) 2024-11-12 08:35:28 +01:00
Martin Robertz b15d357f1a update 2024-10-21 21:56:28 +02:00
Darren Eberly 0fbf6f05ba No more TESR on conduits (#176)
* Goodbye TESR, Hello ISBRH

* More fluid conduit rendering work

* more stuff

* spotless

* Add empty check to fluid conduit renderer
2024-10-21 20:08:58 +02:00
Martin Robertz bf9c2cd2c7 update 2024-10-02 15:16:09 +02:00
chochem 51b4c4e74c dont double apply oredicts (#175) 2024-10-01 20:16:52 +01:00
Dream Master cf6b678dd9 update 2024-07-15 23:45:30 +07:00
Under 6c205150b1 Travel Staff Blink Keybind fixes. (#163)
Fixes 2 separate bugs with the SoT keybind.
1. Staff of Teleportation in GTNH pack specifically didn't work due to reporting as having 0 power through the RF API. Fixed this by having it always report that it's full of power since it has infinite.
2. BlackSteelSword and EndSteelSword (The Ender and MKII) both were quite funky with keybind, causing no teleports to happen when they really should have.
Fixed this through tweaks to how this is handled in a number of places to allow for proper handling while not changing the default held/shift held behavior.

Tested in SP, Anchor behavior while holding staffs and Swords with travel thing on them work as expected. Keybind now works and is able to use swords with travel thing on them.
One quirk is that if you are holding a sword with travel upgrade, but NOT shifting, the sword itself stops counting as a valid travel item. So if ONLY using sword no separate SoT the keybind will not work unless you hold shift. If you have another SoT in your inventory it will identify and use that and still blink you upon hitting keybind.
This quirk doesn't really matter in most cases, just something worth noting I guess.
2024-07-15 23:43:39 +07:00
Zoltán Szepesi e39a1e1eb6 Fix LiquidConduit not attempting to pull fluids from all directions if one of external tanks are empty (#174) 2024-07-15 19:09:16 +07:00
glowredman 4a94c1ba90 Remove isModLoaded check for GTNH Lib (#172) 2024-07-11 08:44:35 -05:00
Jason Mitchell 0fc382dd13 Update dependencies.gradle (#170)
Fix server test
2024-07-11 03:31:46 -05:00
Jason Mitchell 04964e15e4 hard dep on gtnhlib 2024-07-10 14:09:43 -07:00
Jason Mitchell 085ccc9d21 Try a CasList, since the Collections.synchronizedList actually needed the reads to be synchronized... 2024-07-10 13:40:46 -07:00
25 changed files with 137 additions and 188 deletions

No files matched your search

+11 -11
View File
@@ -2,21 +2,21 @@
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.3.2:dev")
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.20:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.53-GTNH:dev')
api("com.github.GTNewHorizons:GTNHLib:0.5.23:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
compileOnly('com.github.GTNewHorizons:waila:1.8.1:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-405-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.8.2:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-483-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.68:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.15.1-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.112:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.16:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.0.5-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.15.4-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.28-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 +24,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-alpha52:api') {transitive = false}
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta28:api') {transitive = false}
}
+12 -1
View File
@@ -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, Modrinth, 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.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+4 -1
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -84,7 +86,8 @@ 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
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Vendored
+2
View File
@@ -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
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.23'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
}
@@ -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;
@@ -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());
@@ -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,);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 {
@@ -2,7 +2,6 @@ package crazypants.enderio.conduit;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
@@ -26,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;
@@ -67,7 +67,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
public static final short NBT_VERSION = 1;
private final List<IConduit> conduits = Collections.synchronizedList(new ArrayList<>());
private final List<IConduit> conduits = new CasList<>();
private Block facadeId = null;
private int facadeMeta = 0;
@@ -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,7 +1,6 @@
package crazypants.enderio.conduit.liquid;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -57,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);
@@ -68,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);
}
}
}
}
@@ -243,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) {
@@ -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();
@@ -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;
}
}
@@ -154,7 +154,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);
}
@@ -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();
@@ -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);
}
@@ -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() {
@@ -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();
}
}
@@ -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;
}
@@ -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");
@@ -106,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) {
@@ -46,7 +46,6 @@ 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;
@@ -163,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);
}
}
@@ -548,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);
}
}
@@ -577,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;
}
@@ -588,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;
}
@@ -612,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;
}
@@ -623,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;
}
@@ -1188,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);
}
}
}