mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0272517b10 | ||
|
|
8782f7c6a7 | ||
|
|
58676ab46d | ||
|
|
2127d30d16 |
No files matched your search
+6
-6
@@ -3,23 +3,23 @@
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.1.15-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-688-GTNH:api')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-690-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.4.14:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
||||
exclude module: 'Baubles'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.12.25-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.0-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.22:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.26:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.7.7:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.14:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.13.54-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.9.0:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.0-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.6.8:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.7:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.19-GTNH:api') {transitive=false}
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api') {transitive=false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.459:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.02:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
|
||||
@@ -147,9 +147,10 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
boolean on = (meta & 8) != 0;
|
||||
|
||||
if (power && !on) {
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 8, 4);
|
||||
} else if (!power && on) par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
|
||||
} else if (!power && on) {
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,16 +158,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile instanceof TileAnimationTablet tablet) {
|
||||
if (tablet.redstone && tablet.isIdle()) {
|
||||
tablet.initiateSwing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
|
||||
@@ -16,10 +16,14 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemRedstone;
|
||||
import net.minecraft.item.ItemReed;
|
||||
import net.minecraft.item.ItemSeeds;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -157,15 +161,22 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
worldManager.tryHarvestBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
}
|
||||
}
|
||||
|
||||
if (isIdle() && hit != null && (!redstone || isBreaking)) {
|
||||
if (isIdle() && hit != null) {
|
||||
if (redstone && !isBreaking) {
|
||||
boolean power = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)
|
||||
|| worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord + 1, zCoord);
|
||||
if (!power) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Block block = worldObj.getBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if (hit.typeOfHit == MovingObjectPosition.MovingObjectType.MISS
|
||||
&& (leftClick || !canPlaceItem(stack))) {
|
||||
&& (leftClick || !canUseItem(stack, block))) {
|
||||
return;
|
||||
}
|
||||
initiateSwing();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
List<EntityPlayer> list = worldObj.getEntitiesWithinAABB(
|
||||
EntityPlayer.class,
|
||||
@@ -183,9 +194,15 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canPlaceItem(ItemStack stack) {
|
||||
private boolean canUseItem(ItemStack stack, Block block) {
|
||||
final Item item = stack.getItem();
|
||||
return item instanceof ItemBlock || item instanceof ItemReed;
|
||||
if (item instanceof ItemBlock || item instanceof ItemReed || item instanceof ItemSeeds) {
|
||||
return true;
|
||||
}
|
||||
if (item instanceof ItemRedstone) {
|
||||
return true;
|
||||
}
|
||||
return item instanceof ItemHoe && (block == Blocks.dirt || block == Blocks.grass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -327,8 +344,8 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
position.yCoord = yCoord + 0.5f;
|
||||
position.zCoord = zCoord + 0.5f;
|
||||
if (!worldObj.isAirBlock(x, y, z)) {
|
||||
AxisAlignedBB aabb = block.getCollisionBoundingBoxFromPool(worldObj, x, y, z);
|
||||
if (aabb != null) {
|
||||
AxisAlignedBB aabb = getBlockBoundingBox(block, x, y, z);
|
||||
if (block.canCollideCheck(worldObj.getBlockMetadata(x, y, z), false)) {
|
||||
hit = block.collisionRayTrace(worldObj, x, y, z, position, getMiddleOfAABB(aabb));
|
||||
}
|
||||
}
|
||||
@@ -373,8 +390,9 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
// Use the block beneath
|
||||
y--;
|
||||
if (!worldObj.isAirBlock(x, y, z)) {
|
||||
AxisAlignedBB aabb = block.getCollisionBoundingBoxFromPool(worldObj, x, y, z);
|
||||
if (aabb != null) {
|
||||
block = worldObj.getBlock(x, y, z);
|
||||
if (block.canCollideCheck(worldObj.getBlockMetadata(x, y, z), false)) {
|
||||
AxisAlignedBB aabb = getBlockBoundingBox(block, x, y, z);
|
||||
Vec3 vec = getMiddleOfAABB(aabb);
|
||||
vec.yCoord = (aabb.maxY - y);
|
||||
hit = new MovingObjectPosition(x, y, z, ForgeDirection.UP.ordinal(), vec, false);
|
||||
@@ -385,6 +403,16 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
return hit;
|
||||
}
|
||||
|
||||
private AxisAlignedBB getBlockBoundingBox(Block block, int x, int y, int z) {
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + block.getBlockBoundsMinX(),
|
||||
y + block.getBlockBoundsMinY(),
|
||||
z + block.getBlockBoundsMinZ(),
|
||||
x + block.getBlockBoundsMaxX(),
|
||||
y + block.getBlockBoundsMaxY(),
|
||||
z + block.getBlockBoundsMaxZ());
|
||||
}
|
||||
|
||||
private Vec3 getMiddleOfAABB(AxisAlignedBB aabb) {
|
||||
tempVec.xCoord = (aabb.minX + aabb.maxX) / 2f;
|
||||
tempVec.yCoord = (aabb.minY + aabb.maxY) / 2f;
|
||||
|
||||
@@ -292,4 +292,12 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
|
||||
public String getItemName() {
|
||||
return LibItemNames.CLEANSING_TALISMAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack talisman, ItemStack material) {
|
||||
if (material != null
|
||||
&& material.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class))
|
||||
return true;
|
||||
return super.getIsRepairable(talisman, material);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user