chore: update auracore and fix some random shit

This commit is contained in:
LordMZTE 2023-05-25 22:16:12 +02:00
parent c9c4544429
commit 8da2d5551f
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
11 changed files with 37 additions and 51 deletions

View file

@ -38,7 +38,7 @@ repositories {
dependencies { dependencies {
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf" implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
implementation "dev.tilera:auracore:1.8.9:deobf" implementation "dev.tilera:auracore:1.9.0:deobf"
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2" implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
} }

View file

@ -2,10 +2,10 @@ package net.anvilcraft.thaummach;
import dev.tilera.auracore.api.machine.IConnection; import dev.tilera.auracore.api.machine.IConnection;
import dev.tilera.auracore.aura.AuraManager; import dev.tilera.auracore.aura.AuraManager;
import net.anvilcraft.thaummach.particles.FXWisp;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import thaumcraft.client.fx.particles.FXWisp;
public class AuraUtils { public class AuraUtils {
public static void taintExplosion(World w, int x, int y, int z) { public static void taintExplosion(World w, int x, int y, int z) {

View file

@ -2,6 +2,7 @@ package net.anvilcraft.thaummach.blocks;
import java.util.Random; import java.util.Random;
import net.anvilcraft.thaummach.AuraUtils;
import net.anvilcraft.thaummach.GuiID; import net.anvilcraft.thaummach.GuiID;
import net.anvilcraft.thaummach.ITileGui; import net.anvilcraft.thaummach.ITileGui;
import net.anvilcraft.thaummach.TMTab; import net.anvilcraft.thaummach.TMTab;
@ -124,6 +125,9 @@ public abstract class BlockApparatus extends BlockContainer {
} }
} }
} }
AuraUtils.spillTaint(world, x, y, z);
super.breakBlock(world, x, y, z, block, meta); super.breakBlock(world, x, y, z, block, meta);
} }

View file

@ -388,17 +388,6 @@ public class BlockApparatusFragile extends BlockApparatus {
} }
} }
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta_) {
// TODO: not sure if param 6 is meta
MetaVals meta = MetaVals.get(meta_);
if (meta != MetaVals.CONDUIT_PUMP) {
AuraUtils.spillTaint(world, x, y, z);
}
super.breakBlock(world, x, y, z, block, meta_);
}
@Override @Override
public int getRenderType() { public int getRenderType() {
return BlockApparatusRenderer.RI; return BlockApparatusRenderer.RI;

View file

@ -720,16 +720,12 @@ public class BlockApparatusMetal extends BlockApparatus {
@Override @Override
public void breakBlock(World world, int i, int j, int k, Block block, int meta_) { public void breakBlock(World world, int i, int j, int k, Block block, int meta_) {
MetaVals meta = MetaVals.get(meta_); MetaVals meta = MetaVals.get(meta_);
if (meta.isCrucible() || meta == MetaVals.TANK) {
AuraUtils.spillTaint(world, i, j, k);
}
if (meta == MetaVals.VOID_INTERFACE) { if (meta == MetaVals.VOID_INTERFACE) {
TileVoidInterface ts = (TileVoidInterface) world.getTileEntity(i, j, k); TileVoidInterface ts = (TileVoidInterface) world.getTileEntity(i, j, k);
if (ts != null) { if (ts != null) {
ts.invalidateLinks(); ts.invalidateLinks();
} }
} else { } else {
super.breakBlock(world, i, j, k, block, meta_); super.breakBlock(world, i, j, k, block, meta_);
} }

View file

@ -28,8 +28,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockApparatusWood extends BlockApparatus { public class BlockApparatusWood extends BlockApparatus {
public IIcon iconCondenserPart1; public IIcon iconCondenserPart;
public IIcon iconCondenserPart2;
public IIcon iconCondenserSide; public IIcon iconCondenserSide;
public IIcon iconCondenserSpeedUpgrade; public IIcon iconCondenserSpeedUpgrade;
public IIcon iconCondenserTop; public IIcon iconCondenserTop;
@ -62,8 +61,7 @@ public class BlockApparatusWood extends BlockApparatus {
public void registerBlockIcons(IIconRegister register) { public void registerBlockIcons(IIconRegister register) {
Function<String, IIcon> reg = (s) -> register.registerIcon("thaummach:" + s); Function<String, IIcon> reg = (s) -> register.registerIcon("thaummach:" + s);
this.iconCondenserPart1 = reg.apply("condenser_part_1"); this.iconCondenserPart = reg.apply("condenser_part");
this.iconCondenserPart2 = reg.apply("condenser_part_2");
this.iconCondenserSide = reg.apply("condenser_side"); this.iconCondenserSide = reg.apply("condenser_side");
this.iconCondenserSpeedUpgrade = reg.apply("condenser_speed_upgrade"); this.iconCondenserSpeedUpgrade = reg.apply("condenser_speed_upgrade");
this.iconCondenserTop = reg.apply("condenser_top"); this.iconCondenserTop = reg.apply("condenser_top");

View file

@ -51,9 +51,9 @@ public class ItemCrystallineBell extends Item implements IRepairable {
ItemStack itemstack, ItemStack itemstack,
EntityPlayer player, EntityPlayer player,
World world, World world,
int i, int x,
int j, int y,
int k, int z,
int l, int l,
// useless parameters // useless parameters
float alec1, float alec1,
@ -63,15 +63,16 @@ public class ItemCrystallineBell extends Item implements IRepairable {
if (itemstack.stackSize == 0) if (itemstack.stackSize == 0)
return false; return false;
int meta = world.getBlockMetadata(i, j, k); int meta = world.getBlockMetadata(x, y, z);
TileEntity te = world.getTileEntity(i, j, k); TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof ICrystal) { if (te != null && te instanceof ICrystal) {
if (((ICrystal) te).getCrystalCount(meta) == 1) if (!((ICrystal) te).canHarvest(player))
return false; return false;
world.playSoundEffect( world.playSoundEffect(
(double) ((float) i + 0.5F), (double) ((float) x + 0.5F),
(double) ((float) j + 0.5F), (double) ((float) y + 0.5F),
(double) ((float) k + 0.5F), (double) ((float) z + 0.5F),
"random.orb", "random.orb",
0.5F, 0.5F,
0.8F + (float) ((ICrystal) te).getCrystalCount(meta) * 0.1F 0.8F + (float) ((ICrystal) te).getCrystalCount(meta) * 0.1F
@ -80,10 +81,10 @@ public class ItemCrystallineBell extends Item implements IRepairable {
((ICrystal) te).harvestShard(player); ((ICrystal) te).harvestShard(player);
itemstack.damageItem(1, player); itemstack.damageItem(1, player);
world.markBlockForUpdate(i, j, k); world.markBlockForUpdate(x, y, z);
return true; return true;
} }
return super.onItemUse(itemstack, player, world, i, j, k, l, alec1, alec2, alec3); return super.onItemUse(itemstack, player, world, x, y, z, l, alec1, alec2, alec3);
} }
// TODO: WTF // TODO: WTF

View file

@ -63,11 +63,11 @@ public class CondenserApparatusRenderer implements IApparatusRenderer {
rb.renderStandardBlock(block, i, j, k); rb.renderStandardBlock(block, i, j, k);
} }
rb.overrideBlockTexture = block.iconCondenserPart1; rb.overrideBlockTexture = block.iconCondenserPart;
rb.setRenderBounds(0.5F - w2, w2, 0.0F, 0.5F + w2, 1.0F - w2, 1.0F); rb.setRenderBounds(0.5F - w2, w2, 0.0F, 0.5F + w2, 1.0F - w2, 1.0F);
if (inv) { if (inv) {
ApparatusRenderingHelper.drawFaces( ApparatusRenderingHelper.drawFaces(
rb, block, block.iconCondenserPart1, false rb, block, block.iconCondenserPart, false
); );
} else { } else {
rb.renderStandardBlock(block, i, j, k); rb.renderStandardBlock(block, i, j, k);
@ -76,7 +76,7 @@ public class CondenserApparatusRenderer implements IApparatusRenderer {
rb.setRenderBounds(0.0F, w2, 0.5F - w2, 1.0F, 1.0F - w2, 0.5F + w2); rb.setRenderBounds(0.0F, w2, 0.5F - w2, 1.0F, 1.0F - w2, 0.5F + w2);
if (inv) { if (inv) {
ApparatusRenderingHelper.drawFaces( ApparatusRenderingHelper.drawFaces(
rb, block, block.iconCondenserPart1, false rb, block, block.iconCondenserPart, false
); );
} else { } else {
rb.renderStandardBlock(block, i, j, k); rb.renderStandardBlock(block, i, j, k);
@ -85,7 +85,7 @@ public class CondenserApparatusRenderer implements IApparatusRenderer {
rb.setRenderBounds(0.5F - w2, w2, 0.0F, 0.5F + w2, 1.0F - w2, 1.0F); rb.setRenderBounds(0.5F - w2, w2, 0.0F, 0.5F + w2, 1.0F - w2, 1.0F);
if (inv) { if (inv) {
ApparatusRenderingHelper.drawFaces( ApparatusRenderingHelper.drawFaces(
rb, block, block.iconCondenserPart1, false rb, block, block.iconCondenserPart, false
); );
} else { } else {
rb.renderStandardBlock(block, i, j, k); rb.renderStandardBlock(block, i, j, k);
@ -94,7 +94,7 @@ public class CondenserApparatusRenderer implements IApparatusRenderer {
rb.setRenderBounds(0.0F, w2, 0.5F - w2, 1.0F, 1.0F - w2, 0.5F + w2); rb.setRenderBounds(0.0F, w2, 0.5F - w2, 1.0F, 1.0F - w2, 0.5F + w2);
if (inv) { if (inv) {
ApparatusRenderingHelper.drawFaces( ApparatusRenderingHelper.drawFaces(
rb, block, block.iconCondenserPart1, false rb, block, block.iconCondenserPart, false
); );
} else { } else {
rb.renderStandardBlock(block, i, j, k); rb.renderStandardBlock(block, i, j, k);

View file

@ -87,20 +87,18 @@ public class TileCondenser
); );
if (nodeID >= 0) { if (nodeID >= 0) {
AuraNode node = AuraManager.getNode(nodeID); AuraNode node = AuraManager.getNode(nodeID);
if (this.currentType != 9) { if (this.currentType != 9 && node.level > 0) {
if (node.level > 0) { AuraManager.queueNodeChanges(
AuraManager.queueNodeChanges( nodeID, -1, 0, false, null, 0, 0, 0
nodeID, -1, 0, false, null, 0, 0, 0 );
); this.progress = 0.0f;
this.progress = 0.0f; ++this.currentVis;
++this.currentVis; } else if (this.hasUpgrade((byte) 3) && node.taint > 0) {
} else if (this.hasUpgrade((byte) 3) && node.taint > 0) { AuraManager.queueNodeChanges(
AuraManager.queueNodeChanges( nodeID, 0, 0, -1, false, null, 0, 0, 0
nodeID, 0, 0, -1, false, null, 0, 0, 0 );
); this.progress = 0.0f;
this.progress = 0.0f; ++this.currentTaint;
++this.currentTaint;
}
} }
this.worldObj.markBlockForUpdate( this.worldObj.markBlockForUpdate(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B