Compare commits

...
5 Commits
Author SHA1 Message Date
Martin Robertz 8ff5a8cf52 update
(cherry picked from commit fa6c242780)
2025-10-04 02:22:47 +02:00
koolkrafter5 b9e61335e3 Fix boots losing their speed when enchanted and Thaumic Boots is not installed (#76) 2025-10-04 01:38:53 +02:00
Martin Robertz 0272517b10 update 2025-10-01 18:21:40 +02:00
koolkrafter5 8782f7c6a7 Merge #74 to master (#75) 2025-09-29 20:17:30 +02:00
sisyphussy 58676ab46d Fix certain block interactions + redstone mode (#72) 2025-09-25 19:34:14 +02:00
5 changed files with 58 additions and 34 deletions

No files matched your search

+9 -9
View File
@@ -1,25 +1,25 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles-Expanded:2.1.15-GTNH:dev')
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.0-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-702-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:EnderCore:0.4.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.22:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Botania:1.13.1-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.0: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.2-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('com.github.GTNewHorizons:OpenComputers:1.12.0-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.10: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,10 +161,17 @@ 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();
@@ -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,9 +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)) {
block.setBlockBoundsBasedOnState(worldObj, 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));
}
}
@@ -375,9 +391,8 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
y--;
if (!worldObj.isAirBlock(x, y, z)) {
block = worldObj.getBlock(x, y, z);
block.setBlockBoundsBasedOnState(worldObj, x, y, z);
AxisAlignedBB aabb = block.getCollisionBoundingBoxFromPool(worldObj, x, y, z);
if (aabb != null) {
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);
@@ -388,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);
}
}
@@ -185,14 +185,14 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv implements IBoots {
// Avoid NSM Exception when ThaumicBoots is not present.
public double getSpeedModifier(ItemStack stack) {
if (stack.stackTagCompound != null) {
if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("speed")) {
return stack.stackTagCompound.getDouble("speed");
}
return 1.0;
}
public double getJumpModifier(ItemStack stack) {
if (stack.stackTagCompound != null) {
if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("jump")) {
return stack.stackTagCompound.getDouble("jump");
}
return 1.0;