mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
372c317077 | ||
|
|
44ee860a39 | ||
|
|
181d48ac60 |
No files matched your search
@@ -12,6 +12,7 @@ dependencies {
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.22:dev') {transitive = false}
|
||||
runtimeOnlyNonPublishable('com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.4:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-812-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.261:dev') {transitive = false}
|
||||
|
||||
@@ -122,12 +122,13 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
BlockCoord bc = new BlockCoord(x, y, z);
|
||||
HarvestResult res = new HarvestResult(null, bc);
|
||||
|
||||
for (int dx = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dx
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dx++) {
|
||||
for (int dy = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dy
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dy++) {
|
||||
for (int dz = -Config.darkSteelShearsBlockAreaBoostWhenPowered; dz
|
||||
<= Config.darkSteelShearsBlockAreaBoostWhenPowered; dz++) {
|
||||
int range = Config.darkSteelShearsBlockAreaBoostWhenPowered;
|
||||
for (int dx = -range; dx <= range; dx++) {
|
||||
for (int dy = -range; dy <= range; dy++) {
|
||||
for (int dz = -range; dz <= range; dz++) {
|
||||
// Skip center block, already added via HarvestResult constructor
|
||||
if (dx == 0 && dy == 0 && dz == 0) continue;
|
||||
|
||||
Block block2 = player.worldObj.getBlock(x + dx, y + dy, z + dz);
|
||||
if (block2 instanceof IShearable && ((IShearable) block2)
|
||||
.isShearable(itemstack, player.worldObj, x + dx, y + dy, z + dz)) {
|
||||
@@ -144,9 +145,12 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
int maxBlocks = Math.min(sortedTargets.size(), powerStored / Config.darkSteelShearsPowerUsePerDamagePoint);
|
||||
for (int i = 0; i < maxBlocks; i++) {
|
||||
BlockCoord bc2 = sortedTargets.get(i);
|
||||
super.onBlockStartBreak(itemstack, bc2.x, bc2.y, bc2.z, player);
|
||||
if (bc2 != bc) {
|
||||
player.worldObj.setBlockToAir(bc2.x, bc2.y, bc2.z);
|
||||
Block target = player.worldObj.getBlock(bc2.x, bc2.y, bc2.z);
|
||||
if (target instanceof IShearable
|
||||
&& ((IShearable) target).isShearable(itemstack, player.worldObj, bc2.x, bc2.y, bc2.z)) {
|
||||
if (!super.onBlockStartBreak(itemstack, bc2.x, bc2.y, bc2.z, player)) {
|
||||
player.worldObj.setBlockToAir(bc2.x, bc2.y, bc2.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class GuiInventoryPanel extends GuiMachineBase<TileInventoryPanel> {
|
||||
int sortMode = te.getGuiSortMode();
|
||||
int sortOrderIdx = sortMode >> 1;
|
||||
SortOrder[] orders = SortOrder.values();
|
||||
if (sortOrderIdx >= 0 && te.getGuiSortMode() < orders.length) {
|
||||
if (sortOrderIdx >= 0 && sortOrderIdx < orders.length) {
|
||||
view.setSortOrder(orders[sortOrderIdx], (sortMode & 1) != 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -66,7 +67,9 @@ import crazypants.enderio.teleport.packet.PacketDrainStaff;
|
||||
import crazypants.enderio.teleport.packet.PacketLongDistanceTravelEvent;
|
||||
import crazypants.enderio.teleport.packet.PacketOpenAuthGui;
|
||||
import crazypants.enderio.teleport.packet.PacketTravelEvent;
|
||||
import crazypants.util.BackhandUtil;
|
||||
import crazypants.util.BaublesUtil;
|
||||
import xonin.backhand.api.core.BackhandUtils;
|
||||
|
||||
public class TravelController {
|
||||
|
||||
@@ -538,6 +541,21 @@ public class TravelController {
|
||||
return action < 2;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private TravelSource getTravelSource(final EntityPlayer ep, final ItemStack stack) {
|
||||
final Item item = stack.getItem();
|
||||
if (item instanceof ItemTeleportStaff) {
|
||||
if (((ItemTeleportStaff) item).isActive(ep, stack)) {
|
||||
return TravelSource.TELEPORT_STAFF;
|
||||
}
|
||||
} else if (item instanceof IItemOfTravel) {
|
||||
if (((IItemOfTravel) item).isActive(ep, stack)) {
|
||||
return TravelSource.STAFF;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Returns null if no travel item is in inventory/baubles. */
|
||||
@Nullable
|
||||
public TravelSource getTravelItemTravelSource(EntityPlayer ep, boolean checkInventoryAndBaubles) {
|
||||
@@ -545,6 +563,16 @@ public class TravelController {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (BackhandUtil.backhandLoaded) {
|
||||
final ItemStack offhand = BackhandUtils.getOffhandItem(ep);
|
||||
if (offhand != null && offhand.getItem() != null) {
|
||||
final TravelSource source = getTravelSource(ep, offhand);
|
||||
if (source != null) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack equipped = ep.getCurrentEquippedItem();
|
||||
if (checkInventoryAndBaubles) {
|
||||
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)
|
||||
@@ -552,16 +580,9 @@ public class TravelController {
|
||||
equipped = findTravelItemInInventoryOrBaubles(ep);
|
||||
}
|
||||
}
|
||||
|
||||
if (equipped != null) {
|
||||
if (equipped.getItem() instanceof ItemTeleportStaff) {
|
||||
if (((ItemTeleportStaff) equipped.getItem()).isActive(ep, equipped)) {
|
||||
return TravelSource.TELEPORT_STAFF;
|
||||
}
|
||||
} else if (equipped.getItem() instanceof IItemOfTravel) {
|
||||
if (((IItemOfTravel) equipped.getItem()).isActive(ep, equipped)) {
|
||||
return TravelSource.STAFF;
|
||||
}
|
||||
}
|
||||
return getTravelSource(ep, equipped);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -634,6 +655,7 @@ public class TravelController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return travelItemSlot;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package crazypants.util;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class BackhandUtil {
|
||||
|
||||
public final static boolean backhandLoaded = Loader.isModLoaded("backhand");
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user