feat: implement eldritch stone

This commit is contained in:
LordMZTE 2023-05-31 16:53:22 +02:00
parent 650ec41d57
commit 23b2be9cc4
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
10 changed files with 681 additions and 145 deletions

90
gradlew.bat vendored
View File

@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -3,10 +3,12 @@ package net.anvilcraft.thaummach;
import cpw.mods.fml.common.registry.GameRegistry;
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
import net.anvilcraft.thaummach.blocks.BlockApparatusStone;
import net.anvilcraft.thaummach.blocks.BlockApparatusWood;
import net.anvilcraft.thaummach.blocks.BlockSeal;
import net.anvilcraft.thaummach.items.ItemBlockApparatusFragile;
import net.anvilcraft.thaummach.items.ItemBlockApparatusMetal;
import net.anvilcraft.thaummach.items.ItemBlockApparatusStone;
import net.anvilcraft.thaummach.items.ItemBlockApparatusWood;
import net.anvilcraft.thaummach.items.ItemSeal;
import net.minecraft.block.Block;
@ -14,24 +16,23 @@ import net.minecraft.block.Block;
public class TMBlocks {
public static Block apparatusFragile;
public static Block apparatusMetal;
public static Block apparatusStone;
public static Block apparatusWood;
public static Block seal;
public static void init() {
// clang-format off
apparatusFragile = new BlockApparatusFragile();
apparatusMetal = new BlockApparatusMetal();
apparatusStone = new BlockApparatusStone();
apparatusWood = new BlockApparatusWood();
seal = new BlockSeal();
GameRegistry.registerBlock(
apparatusFragile, ItemBlockApparatusFragile.class, "apparatus_fragile"
);
GameRegistry.registerBlock(
apparatusMetal, ItemBlockApparatusMetal.class, "apparatus_metal"
);
GameRegistry.registerBlock(
apparatusWood, ItemBlockApparatusWood.class, "apparatus_wood"
);
GameRegistry.registerBlock(apparatusFragile, ItemBlockApparatusFragile.class, "apparatus_fragile");
GameRegistry.registerBlock(apparatusMetal, ItemBlockApparatusMetal.class, "apparatus_metal");
GameRegistry.registerBlock(apparatusStone, ItemBlockApparatusStone.class, "apparatus_stone");
GameRegistry.registerBlock(apparatusWood, ItemBlockApparatusWood.class, "apparatus_wood");
GameRegistry.registerBlock(seal, ItemSeal.class, "seal");
// clang-format on
}
}

View File

@ -8,6 +8,7 @@ import dev.tilera.auracore.client.FXSparkle;
import net.anvilcraft.alec.jalec.factories.AlecUnexpectedRuntimeErrorExceptionFactory;
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.SimpleBlockApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.ArcaneFurnaceApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.BoreApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrucibleApparatusRenderer;
@ -15,7 +16,6 @@ import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrystallizerAppa
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.GeneratorApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.SoulBrazierApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.TankApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.VoidChestApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.VoidInterfaceApparatusRenderer;
import net.anvilcraft.thaummach.tiles.TileArcaneFurnace;
import net.anvilcraft.thaummach.tiles.TileBore;
@ -176,7 +176,7 @@ public class BlockApparatusMetal extends BlockApparatus {
return GeneratorApparatusRenderer.INSTANCE;
case VOID_CHEST:
return VoidChestApparatusRenderer.INSTANCE;
return SimpleBlockApparatusRenderer.INSTANCE;
case VOID_INTERFACE:
return VoidInterfaceApparatusRenderer.INSTANCE;

View File

@ -0,0 +1,599 @@
package net.anvilcraft.thaummach.blocks;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
import net.anvilcraft.alec.jalec.factories.AlecUnexpectedRuntimeErrorExceptionFactory;
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.SimpleBlockApparatusRenderer;
import net.anvilcraft.thaummach.tiles.TileSeal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockApparatusStone extends BlockApparatus {
public IIcon iconEldritchStone;
public BlockApparatusStone() {
super(Material.rock);
this.setHardness(2.0F);
this.setResistance(15.0F);
this.setStepSound(Block.soundTypeStone);
}
@Override
public void registerBlockIcons(IIconRegister register) {
Function<String, IIcon> reg = (s) -> register.registerIcon("thaummach:" + s);
this.iconEldritchStone = reg.apply("eldritch_stone");
}
@Override
public IApparatusRenderer getApparatusRenderer(int meta_) {
MetaVals meta = MetaVals.get(meta_);
switch (meta) {
case ELDRITCH_STONE:
return SimpleBlockApparatusRenderer.INSTANCE;
default:
return null;
}
}
@Override
public boolean onBlockActivated(
World world,
int i,
int j,
int k,
EntityPlayer entityplayer,
// useless parameters
int alec1,
float alec2,
float alec3,
float alec4
) {
TileEntity te = world.getTileEntity(i, j, k);
int meta = world.getBlockMetadata(i, j, k);
//if (meta == 8 && entityplayer.inventory.getCurrentItem() != null) {
// boolean filled = false;
// if (entityplayer.inventory.getCurrentItem().isItemEqual(new ItemStack(Items.bucket)
// )) {
// entityplayer.inventory.setInventorySlotContents(
// entityplayer.inventory.currentItem, new ItemStack(Items.water_bucket)
// );
// filled = true;
// } else if (entityplayer.inventory.getCurrentItem().isItemEqual(
// new ItemStack(Items.glass_bottle)
// )) {
// if (entityplayer.inventory.decrStackSize(entityplayer.inventory.currentItem, 1)
// == null) {
// entityplayer.inventory.setInventorySlotContents(
// entityplayer.inventory.currentItem, new ItemStack(Items.potionitem)
// );
// } else if (!entityplayer.inventory.addItemStackToInventory(new
// ItemStack(Item.potionitem
// ))) {
// entityplayer.dropPlayerItem(new ItemStack(Item.potion.shiftedIndex, 1, 0));
// }
// filled = true;
// } else {
// ItemStack filler = this.getOtherWaterContainer(entityplayer.inventory);
// if (filler != null) {
// entityplayer.inventory.decrStackSize(entityplayer.inventory.currentItem, 1);
// if (!entityplayer.inventory.addItemStackToInventory(
// new ItemStack(filler.getItem(), 1, filler.getItemDamage())
// )) {
// entityplayer.dropPlayerItem(
// new ItemStack(filler.getItem(), 1, filler.getItemDamage())
// );
// }
// filled = true;
// }
// }
// if (filled) {
// int auraX = i >> 4;
// int auraZ = k >> 4;
// SIAuraChunk ac = (SIAuraChunk) mod_ThaumCraft.AuraHM.get(
// Arrays.asList(auraX, auraZ, ThaumCraftCore.getDimension(world))
// );
// if (ac != null) {
// ++ac.badVibes;
// }
// return true;
// }
//}
return super.onBlockActivated(world, i, j, k, entityplayer, alec1, alec2, alec3, alec4);
}
// TODO: WTF
//private ItemStack getOtherWaterContainer(InventoryPlayer inventory) {
// if (ItemInterface.getItem("waxCapsule") != null
// && inventory.getCurrentItem().isItemEqual(ItemInterface.getItem("waxCapsule"))) {
// return ItemInterface.getItem("waxCapsuleWater");
// } else if (ItemInterface.getItem("refractoryEmpty") != null &&
// inventory.getCurrentItem().isItemEqual(ItemInterface.getItem("refractoryEmpty"))) {
// return ItemInterface.getItem("refractoryWater");
// } else if (ItemInterface.getItem("canEmpty") != null &&
// inventory.getCurrentItem().isItemEqual(ItemInterface.getItem("canEmpty"))) {
// return ItemInterface.getItem("canWater");
// } else {
// return Items.getItem("cell") != null
// && inventory.getCurrentItem().isItemEqual(Items.getItem("cell"))
// ? ItemInterface.getItem("waterCell")
// : null;
// }
//}
@Override
public float getBlockHardness(World world, int x, int y, int z) {
MetaVals meta = MetaVals.get(world.getBlockMetadata(x, y, z));
return meta == MetaVals.ELDRITCH_STONE ? 10.0f : super.getBlockHardness(world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(World world, int md) {
MetaVals meta = MetaVals.get(md);
switch (meta) {
case ELDRITCH_STONE:
return null;
default:
throw AlecUnexpectedRuntimeErrorExceptionFactory.PLAIN.createAlecException(
"Invalid meta!"
);
}
//if (md == 1) {
// return new TileInfuser();
//} else if (md == 2) {
// return new TileInfuserDark();
//} else if (md == 3) {
// return new TileEnchanter();
//} else if (md == 4) {
// return new TileResearcher();
//} else if (md == 6) {
// return new TileDarknessGenenerator();
//} else if (md == 7) {
// return new TileEnchanterAdvanced();
//} else {
// return (TileEntity) (md == 8 ? new TileUrn() : super.getBlockEntity(md));
//}
}
@Override
public int getRenderType() {
return BlockApparatusRenderer.RI;
}
// TODO: WTF
//public int getBlockTextureFromSide(int i) {
// return 31;
//}
@Override
public IIcon getIcon(int i, int j) {
MetaVals meta = MetaVals.get(j);
switch (meta) {
case ELDRITCH_STONE:
return this.iconEldritchStone;
default:
return null;
}
//if (j == 0) {
// return 46;
//} else if (j == 4) {
// return 93;
//} else if (j == 6) {
// return i < 2 ? 105 : 108;
//} else if (j == 8) {
// if (i == 0) {
// return 159;
// } else {
// return i == 1 ? 158 : 157;
// }
//} else {
// return super.getBlockTextureFromSideAndMetadata(i, j);
//}
}
@Override
public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int side) {
int meta = iblockaccess.getBlockMetadata(i, j, k);
//if (meta == 3) {
// if (side == 0) {
// return 162;
// } else {
// return side == 1 ? 161 : 160;
// }
//} else if (meta == 7) {
// if (side == 0) {
// return 162;
// } else {
// return side == 1 ? 164 : 163;
// }
//} else {
// TileInfuser ti;
// HelperLocation loc;
// TileEntity te;
// if (meta == 1) {
// if (side == 0) {
// return 53;
// } else if (side == 1) {
// return 54;
// } else {
// ti = (TileInfuser) iblockaccess.getBlockTileEntity(i, j, k);
// loc = new HelperLocation(ti);
// switch (side) {
// case 2:
// loc.facing = HelperFacing.NEGZ;
// break;
// case 3:
// loc.facing = HelperFacing.POSZ;
// break;
// case 4:
// loc.facing = HelperFacing.NEGX;
// break;
// case 5:
// loc.facing = HelperFacing.POSX;
// }
// if (!ti.getConnectable(loc.facing)) {
// return 55;
// } else {
// te = loc.getConnectableTile(iblockaccess);
// return te != null ? 56 : 55;
// }
// }
// } else if (meta == 2) {
// if (side == 0) {
// return 59;
// } else if (side == 1) {
// return 60;
// } else {
// ti = (TileInfuser) iblockaccess.getBlockTileEntity(i, j, k);
// loc = new HelperLocation(ti);
// switch (side) {
// case 2:
// loc.facing = HelperFacing.NEGZ;
// break;
// case 3:
// loc.facing = HelperFacing.POSZ;
// break;
// case 4:
// loc.facing = HelperFacing.NEGX;
// break;
// case 5:
// loc.facing = HelperFacing.POSX;
// }
// if (!ti.getConnectable(loc.facing)) {
// return 61;
// } else {
// te = loc.getConnectableTile(iblockaccess);
// return te != null ? 62 : 61;
// }
// }
// } else if (meta == 4) {
// if (side == 0) {
// return 93;
// } else {
// return side == 1 ? 91 : 92;
// }
// } else {
// return super.getBlockTexture(iblockaccess, i, j, k, side);
// }
//}
return this.getIcon(side, meta);
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(Item arg0, CreativeTabs arg1, List list) {
Arrays.stream(MetaVals.values())
.map((m) -> new ItemStack(this, 1, m.ordinal()))
.forEach(list::add);
}
@Override
public void addCollisionBoxesToList(
World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity entity
) {
int meta = world.getBlockMetadata(x, y, z);
if (meta == 0) {
TileEntity te = world.getTileEntity(x, y, z);
int l = 1;
if (te != null && te instanceof TileSeal) {
l = ((TileSeal) te).orientation;
}
float thickness = 0.0625F;
if (l == 0) {
this.setBlockBounds(0.3F, 1.0F - thickness, 0.3F, 0.7F, 1.0F, 0.7F);
}
if (l == 1) {
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, thickness, 0.7F);
}
if (l == 2) {
this.setBlockBounds(0.3F, 0.3F, 1.0F - thickness, 0.7F, 0.7F, 1.0F);
}
if (l == 3) {
this.setBlockBounds(0.3F, 0.3F, 0.0F, 0.7F, 0.7F, thickness);
}
if (l == 4) {
this.setBlockBounds(1.0F - thickness, 0.3F, 0.3F, 1.0F, 0.7F, 0.7F);
}
if (l == 5) {
this.setBlockBounds(0.0F, 0.3F, 0.3F, thickness, 0.7F, 0.7F);
}
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
} else if (meta == 3) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
} else if (meta == 4) {
this.setBlockBounds(0.0F, 0.375F, 0.0F, 1.0F, 0.625F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.375F, 0.8F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
} else if (meta != 1 && meta != 2) {
if (meta == 8) {
this.setBlockBounds(0.3125F, 0.5625F, 0.3125F, 0.6875F, 1.0F, 0.6875F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
this.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.5625F, 0.875F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
} else {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
this.setBlockBoundsForItemRender();
}
} else {
float w1 = 0.0625F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F - w1, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
}
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
int md = iblockaccess.getBlockMetadata(i, j, k);
if (md == 0) {
if (iblockaccess.getTileEntity(i, j, k) == null) {
return;
}
int l = ((TileSeal) ((TileSeal) iblockaccess.getTileEntity(i, j, k))).orientation;
float thickness = 0.0625F;
if (l == 0) {
this.setBlockBounds(0.3F, 1.0F - thickness, 0.3F, 0.7F, 1.0F, 0.7F);
}
if (l == 1) {
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, thickness, 0.7F);
}
if (l == 2) {
this.setBlockBounds(0.3F, 0.3F, 1.0F - thickness, 0.7F, 0.7F, 1.0F);
}
if (l == 3) {
this.setBlockBounds(0.3F, 0.3F, 0.0F, 0.7F, 0.7F, thickness);
}
if (l == 4) {
this.setBlockBounds(1.0F - thickness, 0.3F, 0.3F, 1.0F, 0.7F, 0.7F);
}
if (l == 5) {
this.setBlockBounds(0.0F, 0.3F, 0.3F, thickness, 0.7F, 0.7F);
}
} else if (md == 3) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
} else {
float w1;
if (md != 1 && md != 2) {
if (md == 6) {
w1 = 0.0625F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F - w1, 1.0F);
} else if (md == 4) {
this.setBlockBounds(0.0F, 0.375F, 0.0F, 1.0F, 0.625F, 1.0F);
} else if (md == 8) {
this.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.5625F, 0.875F);
} else {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
} else {
w1 = 0.0625F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F - w1, 1.0F);
}
}
}
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World w, int i, int j, int k) {
int md = w.getBlockMetadata(i, j, k);
if (md == 3) {
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 0.75, 1.0);
} else {
float w1;
if (md != 1 && md != 2) {
if (md == 4) {
AxisAlignedBB.getBoundingBox(0.0, 0.375, 0.0, 1.0, 0.625, 1.0);
} else if (md == 6) {
w1 = 0.0625F;
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, (double) (0.5F - w1), 1.0);
} else if (md == 8) {
AxisAlignedBB.getBoundingBox(0.3125, 0.5625, 0.3125, 0.6875, 1.0, 0.6875);
AxisAlignedBB.getBoundingBox(0.125, 0.0, 0.125, 0.875, 0.5625, 0.875);
} else {
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
}
} else {
w1 = 0.0625F;
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, (double) (1.0F - w1), 1.0);
}
}
return super.getSelectedBoundingBoxFromPool(w, i, j, k);
}
@Override
public void setBlockBoundsForItemRender() {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
@Override
public void randomDisplayTick(World w, int i, int j, int k, Random r) {
//int meta = w.getBlockMetadata(i, j, k);
//if ((meta == 3 || meta == 4 || meta == 7) && r.nextBoolean()) {
// for (int ll = i - 2; ll <= i + 2; ++ll) {
// for (int i1 = k - 2; i1 <= k + 2; ++i1) {
// if (ll > i - 2 && ll < i + 2 && i1 == k - 1) {
// i1 = k + 2;
// }
// for (int j1 = j; j1 <= j + 1; ++j1) {
// if ((w.getBlockId(ll, j1, i1) == Block.bookShelf.blockID
// || w.getBlockId(ll, j1, i1) == mod_ThaumCraft.blockAppFragile.blockID
// && w.getBlockMetadata(ll, j1, i1) == 4)
// && (w.getBlockId(ll, j1, i1) != Block.bookShelf.blockID
// || r.nextInt(16) == 0)
// && (w.getBlockId(ll, j1, i1) != mod_ThaumCraft.blockAppFragile.blockID
// || r.nextInt(8) == 0)) {
// if (!w.isAirBlock((ll - i) / 2 + i, j1, (i1 - k) / 2 + k)) {
// break;
// }
// w.spawnParticle(
// "enchantmenttable",
// (double) i + 0.5,
// (double) j + 2.0,
// (double) k + 0.5,
// (double) ((float) (ll - i) + r.nextFloat()) - 0.5,
// (double) ((float) (j1 - j) - r.nextFloat() - 1.0F),
// (double) ((float) (i1 - k) + r.nextFloat()) - 0.5
// );
// }
// }
// }
// }
//}
}
@Override
public boolean isBlockSolid(IBlockAccess world, int x, int y, int z, int side) {
MetaVals md = MetaVals.get(world.getBlockMetadata(x, y, z));
switch (md) {
case ENCHANTER:
case URN:
return false;
default:
return true;
}
}
//public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l) {
// if (l == 0 && world.isBlockSolidOnSide(i, j + 1, k, 0)) {
// return true;
// } else if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1)) {
// return true;
// } else if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2)) {
// return true;
// } else if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3)) {
// return true;
// } else if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4)) {
// return true;
// } else {
// return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
// }
//}
//public boolean canPlaceBlockAt(World world, int i, int j, int k) {
// if (world.isBlockSolidOnSide(i - 1, j, k, 5)) {
// return true;
// } else if (world.isBlockSolidOnSide(i + 1, j, k, 4)) {
// return true;
// } else if (world.isBlockSolidOnSide(i, j, k - 1, 3)) {
// return true;
// } else if (world.isBlockSolidOnSide(i, j, k + 1, 2)) {
// return true;
// } else {
// return world.isBlockSolidOnSide(i, j - 1, k, 1)
// ? true
// : world.isBlockSolidOnSide(i, j + 1, k, 0);
// }
//}
private boolean checkIfAttachedToBlock(World world, int i, int j, int k) {
if (!this.canPlaceBlockAt(world, i, j, k)) {
this.dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockToAir(i, j, k);
return false;
} else {
return true;
}
}
@Override
public int getLightValue(IBlockAccess iba, int i, int j, int k) {
MetaVals md = MetaVals.get(iba.getBlockMetadata(i, j, k));
return md == MetaVals.ELDRITCH_STONE ? 12 : super.getLightValue(iba, i, j, k);
}
@Override
public float getExplosionResistance(
Entity exploder, World world, int x, int y, int z, double srcX, double srcY, double srcZ
) {
MetaVals md = MetaVals.get(world.getBlockMetadata(x, y, z));
return md == MetaVals.ELDRITCH_STONE ? 100.0F : 15.0F;
}
public static enum MetaVals {
__SEAL, // 0
INFUSER, // 1
INFUSER_DARK, // 2
ENCHANTER, // 3
__RESEARCHER, // 4
ELDRITCH_STONE, // 5
DARKNESS_GENERATOR, // 6
ENCHANTER_ADVANCED, // 7
URN; // 8
public static MetaVals get(int meta) {
if (meta < 0 || meta >= MetaVals.values().length)
return null;
return MetaVals.values()[meta];
}
}
}

View File

@ -7,7 +7,6 @@ import java.util.stream.IntStream;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.anvilcraft.alec.jalec.factories.AlecUnexpectedRuntimeErrorExceptionFactory;
import net.anvilcraft.thaummach.particles.FXWisp;
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;

View File

@ -0,0 +1,30 @@
package net.anvilcraft.thaummach.items;
import net.anvilcraft.thaummach.blocks.BlockApparatusStone.MetaVals;
import net.minecraft.block.Block;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public class ItemBlockApparatusStone extends ItemBlockApparatus {
public ItemBlockApparatusStone(Block block) {
super(block);
}
@Override
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.uncommon;
}
@Override
public String getTypeString() {
return "stone";
}
@Override
public String getNameExtension(int meta_) {
MetaVals meta = MetaVals.get(meta_);
if (meta == null)
return null;
return meta.toString().toLowerCase();
}
}

View File

@ -0,0 +1,32 @@
package net.anvilcraft.thaummach.render.apparatus;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import thaumcraft.client.renderers.block.BlockRenderer;
public class SimpleBlockApparatusRenderer implements IApparatusRenderer {
public static final SimpleBlockApparatusRenderer INSTANCE = new SimpleBlockApparatusRenderer();
@Override
public void renderApparatus(
IBlockAccess w, RenderBlocks rb, int x, int y, int z, Block block, int meta, boolean inv
) {
if (inv) {
rb.setRenderBoundsFromBlock(block);
BlockRenderer.drawFaces(
rb,
block,
block.getIcon(0, meta),
block.getIcon(1, meta),
block.getIcon(2, meta),
block.getIcon(3, meta),
block.getIcon(4, meta),
block.getIcon(5, meta),
true
);
} else {
rb.renderStandardBlock(block, x, y, z);
}
}
}

View File

@ -1,43 +0,0 @@
package net.anvilcraft.thaummach.render.apparatus.apparati.metal;
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import thaumcraft.client.renderers.block.BlockRenderer;
public class VoidChestApparatusRenderer implements IApparatusRenderer {
public static final VoidChestApparatusRenderer INSTANCE
= new VoidChestApparatusRenderer();
@Override
public void renderApparatus(
IBlockAccess w,
RenderBlocks rb,
int x,
int y,
int z,
Block block_,
int meta,
boolean inv
) {
BlockApparatusMetal block = (BlockApparatusMetal) block_;
if (inv) {
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
BlockRenderer.drawFaces(
rb,
block,
block.iconVoidChestBottom,
block.iconVoidChestTop,
block.iconVoidChestSide,
block.iconVoidChestSide,
block.iconVoidChestSide,
block.iconVoidChestSide,
true
);
} else {
rb.renderStandardBlock(block, x, y, z);
}
}
}

View File

@ -25,6 +25,14 @@ tile.thaummach:apparatus_metal_void_interface.name=Void Interface
tile.thaummach:apparatus_metal_tank.name=Thaumium Reinforced Tank
tile.thaummach:apparatus_metal_soul_brazier.name=Soul Brazier
tile.thaummach:apparatus_stone_infuser.name=Thaumic Infuser
tile.thaummach:apparatus_stone_infuser_dark.name=Dark Infuser
tile.thaummach:apparatus_stone_enchanter.name=Thaumic Enchanter
tile.thaummach:apparatus_stone_eldritch_stone.name=Eldritch Stone
tile.thaummach:apparatus_stone_darkness_generator.name=Darkness Generator
tile.thaummach:apparatus_stone_enchanter_advanced.name=Occultic Enchanter
tile.thaummach:apparatus_stone_urn.name=Everfull Urn
tile.thaummach:apparatus_wood_condenser.name=Vis Condenser
tile.thaummach:apparatus_wood_duplicator.name=Thaumic Duplicator
tile.thaummach:apparatus_wood_repairer.name=Thaumic Restorer

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B