feat: initial (very borked) port
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
AccessModifierOffset: 0
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AlignArrayOfStructures: None
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignConsecutiveMacros: None
|
||||
AlignConsecutiveBitFields: None
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AlignOperands: DontAlign
|
||||
AlignTrailingComments: false
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
AttributeMacros: []
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BitFieldColonSpacing: After
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakAfterJavaFieldAnnotations: true
|
||||
#BreakArrays: false
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeConceptDeclarations: true
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakInheritanceList: AfterColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 90
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DeriveLineEnding: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false # wtf
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: Always
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: false
|
||||
ForEachMacros: ["BOOST_FOREACH"]
|
||||
IfMacros: []
|
||||
IncludeBlocks: Regroup
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseBlocks: false
|
||||
IndentCaseLabels: true
|
||||
IndentExternBlock: Indent
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: BeforeHash
|
||||
#IndentRequiresClause: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
#InsertBraces: false
|
||||
InsertTrailingCommas: Wrapped
|
||||
JavaImportGroups: ["java"]
|
||||
JavaScriptQuotes: Double
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
LambdaBodyIndentation: OuterScope
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
PackConstructorInitializers: NextLine
|
||||
PointerAlignment: Left
|
||||
QualifierAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
ReflowComments: true
|
||||
#RemoveSemicolon: true
|
||||
#RequiresClausePosition: OwnLine
|
||||
#RequiresExpressionIndentation: OuterScope
|
||||
SeparateDefinitionBlocks: Always
|
||||
SortIncludes: CaseInsensitive
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceAroundPointerQualifiers: After
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: false
|
||||
SpaceBeforeInheritanceColon: false
|
||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInAngles: Never
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 0
|
||||
Maximum: -1
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: c++20
|
||||
StatementAttributeLikeMacros: []
|
||||
StatementMacros: []
|
||||
TabWidth: 4
|
||||
TypenameMacros: []
|
||||
UseCRLF: false # wtf
|
||||
UseTab: Never
|
||||
WhitespaceSensitiveMacros: ["BOOST_PP_STRINGSIZE"]
|
|
@ -1,5 +1,8 @@
|
|||
.project
|
||||
.classpath
|
||||
bin
|
||||
.settings
|
||||
.gradle
|
||||
.idea
|
||||
build
|
||||
run
|
||||
bin
|
|
@ -0,0 +1,4 @@
|
|||
- apparati don't render in some chunks and some Y-levels (WTF)
|
||||
- models of all sorts of stuff look borked in hand (see arcane furnace)
|
||||
- filter looks borked in world (see bottom side of top surface)
|
||||
- you can sometimes walk through tanks
|
|
@ -1,28 +1,79 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
|
||||
public class AuraUtils {
|
||||
public static void taintExplosion(World w, int x, int y, int z) {
|
||||
w.createExplosion(
|
||||
null,
|
||||
(double) ((float) x + 0.5F),
|
||||
(double) ((float) y + 0.5F),
|
||||
(double) ((float) z + 0.5F),
|
||||
1.0F,
|
||||
false
|
||||
);
|
||||
|
||||
public static void taintExplosion(World w, int x, int y, int z) {
|
||||
w.createExplosion(null, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), 1.0F, false);
|
||||
|
||||
int xx;
|
||||
for(xx = x - 2; xx <= x + 2; ++xx) {
|
||||
for(int yy = y - 2; yy <= y + 2; ++yy) {
|
||||
for(int zz = z - 2; zz <= z + 2; ++zz) {
|
||||
//increaseTaintedPlants(w, xx, yy, zz);
|
||||
}
|
||||
}
|
||||
for (xx = x - 2; xx <= x + 2; ++xx) {
|
||||
for (int yy = y - 2; yy <= y + 2; ++yy) {
|
||||
for (int zz = z - 2; zz <= z + 2; ++zz) {
|
||||
// increaseTaintedPlants(w, xx, yy, zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*for(xx = 0; xx < 100; ++xx) {
|
||||
FXWisp ef = new FXWisp(w, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), (double)((float)x + 0.5F + (w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), (double)((float)y + 0.5F + (w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), (double)((float)z + 0.5F + (w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), 1.0F, 5);
|
||||
FXWisp ef = new FXWisp(w, (double)((float)x + 0.5F), (double)((float)y +
|
||||
0.5F), (double)((float)z + 0.5F), (double)((float)x + 0.5F +
|
||||
(w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), (double)((float)y + 0.5F
|
||||
+ (w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), (double)((float)z +
|
||||
0.5F + (w.rand.nextFloat() - w.rand.nextFloat()) * 2.0F), 1.0F, 5);
|
||||
ef.setGravity(0.02F);
|
||||
ef.shrink = true;
|
||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(ef);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void spillTaint(World world, int x, int y, int z) {
|
||||
TileEntity tc = world.getTileEntity(x, y, z);
|
||||
if (tc != null && tc instanceof IConnection) {
|
||||
IConnection ic = (IConnection) tc;
|
||||
if (ic.getTaintedVis() > 0.0F) {
|
||||
int at = (int) ic.getTaintedVis();
|
||||
AuraManager.addTaintToClosest(world, x, y, z, at);
|
||||
world.playSoundEffect(
|
||||
(double) x,
|
||||
(double) y,
|
||||
(double) z,
|
||||
"random.fizz",
|
||||
0.2F,
|
||||
2.0F + world.rand.nextFloat() * 0.4F
|
||||
);
|
||||
|
||||
for (int a = 0; a < Math.min(at, 50); ++a) {
|
||||
float x1 = (float) x + world.rand.nextFloat();
|
||||
float y1 = (float) y + world.rand.nextFloat();
|
||||
float z1 = (float) z + world.rand.nextFloat();
|
||||
FXWisp ef = new FXWisp(
|
||||
world,
|
||||
(double) x1,
|
||||
(double) y1,
|
||||
(double) z1,
|
||||
(double) x1,
|
||||
(double) (y1 + 1.0F),
|
||||
(double) z1,
|
||||
0.5F,
|
||||
5
|
||||
);
|
||||
ef.tinkle = false;
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileConduitPumpRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValve;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.anvilcraft.thaummach.tiles.TileFilter;
|
||||
import net.anvilcraft.thaummach.tiles.TilePurifier;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
BlockApparatusRenderer.RI = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new BlockApparatusRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTileEntities() {
|
||||
GameRegistry.registerTileEntity(TileConduit.class, "conduit");
|
||||
GameRegistry.registerTileEntity(TileConduitTank.class, "conduit_tank");
|
||||
GameRegistry.registerTileEntity(TileConduitValve.class, "conduit_valve");
|
||||
GameRegistry.registerTileEntity(
|
||||
TileConduitValveAdvanced.class, "conduit_valve_advanced"
|
||||
);
|
||||
GameRegistry.registerTileEntity(TileCrucible.class, "crucible");
|
||||
GameRegistry.registerTileEntity(TileCrystallizer.class, "crystallizer");
|
||||
GameRegistry.registerTileEntity(TileFilter.class, "filter");
|
||||
GameRegistry.registerTileEntity(TilePurifier.class, "purifier");
|
||||
|
||||
ClientRegistry.registerTileEntity(
|
||||
TileConduitPump.class, "conduit_pump", new TileConduitPumpRenderer()
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValve;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.anvilcraft.thaummach.tiles.TileFilter;
|
||||
import net.anvilcraft.thaummach.tiles.TilePurifier;
|
||||
|
||||
public class CommonProxy {
|
||||
public void preInit() {}
|
||||
|
||||
public void registerTileEntities() {
|
||||
GameRegistry.registerTileEntity(TileConduit.class, "conduit");
|
||||
GameRegistry.registerTileEntity(TileConduitPump.class, "conduit_pump");
|
||||
GameRegistry.registerTileEntity(TileConduitTank.class, "conduit_tank");
|
||||
GameRegistry.registerTileEntity(TileConduitValve.class, "conduit_valve");
|
||||
GameRegistry.registerTileEntity(
|
||||
TileConduitValveAdvanced.class, "conduit_valve_advanced"
|
||||
);
|
||||
GameRegistry.registerTileEntity(TileCrucible.class, "crucible");
|
||||
GameRegistry.registerTileEntity(TileCrystallizer.class, "crystallizer");
|
||||
GameRegistry.registerTileEntity(TileFilter.class, "filter");
|
||||
GameRegistry.registerTileEntity(TilePurifier.class, "purifier");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
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.items.ItemBlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.items.ItemBlockApparatusMetal;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class TMBlocks {
|
||||
public static Block apparatusFragile;
|
||||
public static Block apparatusMetal;
|
||||
|
||||
public static void init() {
|
||||
apparatusFragile = new BlockApparatusFragile();
|
||||
apparatusMetal = new BlockApparatusMetal();
|
||||
|
||||
GameRegistry.registerBlock(apparatusFragile, ItemBlockApparatusFragile.class, "apparatus_fragile");
|
||||
GameRegistry.registerBlock(apparatusMetal, ItemBlockApparatusMetal.class, "apparatus_metal");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class TMTab extends CreativeTabs {
|
||||
public TMTab() {
|
||||
super("thaummach");
|
||||
}
|
||||
|
||||
public static TMTab INSTANCE = new TMTab();
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(TMBlocks.apparatusFragile);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,22 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = "thaummach")
|
||||
public class ThaumicMachinery {
|
||||
|
||||
@SidedProxy(
|
||||
modId = "thaummach",
|
||||
serverSide = "net.anvilcraft.thaummach.CommonProxy",
|
||||
clientSide = "net.anvilcraft.thaummach.ClientProxy"
|
||||
)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent ev) {
|
||||
proxy.preInit();
|
||||
proxy.registerTileEntities();
|
||||
TMBlocks.init();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,142 @@
|
|||
package net.anvilcraft.thaummach.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.anvilcraft.thaummach.TMTab;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockApparatus extends BlockContainer {
|
||||
protected int currentPass;
|
||||
public IIcon iconTcubeanim;
|
||||
|
||||
public BlockApparatus(Material m) {
|
||||
super(m);
|
||||
// TODO: WTF
|
||||
//this.setRequiresSelfNotify();
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.currentPass = 1;
|
||||
this.setTickRandomly(true);
|
||||
this.setCreativeTab(TMTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.iconTcubeanim = reg.registerIcon("thaummach:tcubeanim");
|
||||
}
|
||||
|
||||
public abstract IApparatusRenderer getApparatusRenderer(int meta);
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
EntityPlayer entityplayer,
|
||||
// useless parameters
|
||||
int alec1,
|
||||
float alec2,
|
||||
float alec3,
|
||||
float alec4
|
||||
) {
|
||||
if (!world.isRemote && !entityplayer.isSneaking()) {
|
||||
// TODO: WTF
|
||||
//TileEntity te = world.getTileEntity(i, j, k);
|
||||
//if (te != null && te instanceof ITileGui) {
|
||||
// ModLoader.openGUI(entityplayer, ((ITileGui) te).getGui(entityplayer));
|
||||
// return true;
|
||||
//} else {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof IInventory) {
|
||||
for (int l = 0; l < ((IInventory) te).getSizeInventory(); ++l) {
|
||||
ItemStack itemstack = ((IInventory) te).getStackInSlot(l);
|
||||
if (itemstack != null) {
|
||||
float f = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0) {
|
||||
int i1 = world.rand.nextInt(21) + 10;
|
||||
if (i1 > itemstack.stackSize) {
|
||||
i1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= i1;
|
||||
EntityItem entityitem = new EntityItem(
|
||||
world,
|
||||
(double) ((float) x + f),
|
||||
(double) ((float) y + f1),
|
||||
(double) ((float) z + f2),
|
||||
new ItemStack(
|
||||
itemstack.getItem(), i1, itemstack.getItemDamage()
|
||||
)
|
||||
);
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX
|
||||
= (double) ((float) world.rand.nextGaussian() * f3);
|
||||
entityitem.motionY
|
||||
= (double) ((float) world.rand.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ
|
||||
= (double) ((float) world.rand.nextGaussian() * f3);
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int n) {
|
||||
this.currentPass = n;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return this.currentPass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostBlockPlaced(World world, int x, int y, int z, int meta) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 3);
|
||||
super.onPostBlockPlaced(world, x, y, z, meta);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,609 @@
|
|||
package net.anvilcraft.thaummach.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import net.anvilcraft.thaummach.AuraUtils;
|
||||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.ConduitApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.ConduitPumpApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.ConduitTankApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.ConduitValveAdvancedApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.ConduitValveApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.FilterApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.fragile.PurifierApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValve;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
||||
import net.anvilcraft.thaummach.tiles.TileFilter;
|
||||
import net.anvilcraft.thaummach.tiles.TilePurifier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
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.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
|
||||
public class BlockApparatusFragile extends BlockApparatus {
|
||||
public IIcon iconConduit;
|
||||
public IIcon iconConduitConnection;
|
||||
public IIcon iconConduitExtension;
|
||||
public IIcon iconConduitInventory;
|
||||
public IIcon iconConduitPumpSide;
|
||||
public IIcon iconConduitPumpTop;
|
||||
public IIcon iconFilterBottom;
|
||||
public IIcon iconFilterFront;
|
||||
public IIcon iconFilterSide;
|
||||
public IIcon iconPurifierFront;
|
||||
public IIcon iconPurifierSide;
|
||||
public IIcon iconPurifierTop;
|
||||
public IIcon iconTankBottom;
|
||||
public IIcon iconTankSide;
|
||||
public IIcon iconTcubeanim;
|
||||
public IIcon iconValveAdvancedOff;
|
||||
public IIcon iconValveAdvancedOnTaint;
|
||||
public IIcon iconValveAdvancedOnVis;
|
||||
public IIcon iconValveOff;
|
||||
public IIcon iconValveOn;
|
||||
|
||||
public BlockApparatusFragile() {
|
||||
super(Material.wood);
|
||||
this.setHardness(1.0F);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.blockIcon = reg.registerIcon("thaummach:apparatus");
|
||||
|
||||
this.iconConduit = reg.registerIcon("thaummach:conduit");
|
||||
this.iconConduitConnection = reg.registerIcon("thaummach:conduit_connection");
|
||||
this.iconConduitExtension = reg.registerIcon("thaummach:conduit_extension");
|
||||
this.iconConduitInventory = reg.registerIcon("thaummach:conduit_inventory");
|
||||
this.iconConduitPumpSide = reg.registerIcon("thaummach:conduit_pump_side");
|
||||
this.iconConduitPumpTop = reg.registerIcon("thaummach:conduit_pump_top");
|
||||
this.iconFilterBottom = reg.registerIcon("thaummach:filter_bottom");
|
||||
this.iconFilterFront = reg.registerIcon("thaummach:filter_front");
|
||||
this.iconFilterSide = reg.registerIcon("thaummach:filter_side");
|
||||
this.iconPurifierFront = reg.registerIcon("thaummach:purifier_front");
|
||||
this.iconPurifierSide = reg.registerIcon("thaummach:purifier_side");
|
||||
this.iconPurifierTop = reg.registerIcon("thaummach:purifier_top");
|
||||
this.iconTankBottom = reg.registerIcon("thaummach:tank_bottom");
|
||||
this.iconTankSide = reg.registerIcon("thaummach:tank_side");
|
||||
this.iconTcubeanim = reg.registerIcon("thaummach:tcubeanim");
|
||||
this.iconValveAdvancedOff
|
||||
= reg.registerIcon("thaummach:conduit_valve_advanced_off");
|
||||
this.iconValveAdvancedOnTaint
|
||||
= reg.registerIcon("thaummach:conduit_valve_advanced_on_taint");
|
||||
this.iconValveAdvancedOnVis
|
||||
= reg.registerIcon("thaummach:conduit_valve_advanced_on_vis");
|
||||
this.iconValveOff = reg.registerIcon("thaummach:conduit_valve_off");
|
||||
this.iconValveOn = reg.registerIcon("thaummach:conduit_valve_on");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IApparatusRenderer getApparatusRenderer(int meta) {
|
||||
switch (MetaVals.get(meta)) {
|
||||
case CONDUIT:
|
||||
return ConduitApparatusRenderer.INSTANCE;
|
||||
|
||||
case FILTER:
|
||||
return FilterApparatusRenderer.INSTANCE;
|
||||
|
||||
case CONDUIT_TANK:
|
||||
return ConduitTankApparatusRenderer.INSTANCE;
|
||||
|
||||
case CONDUIT_VALVE:
|
||||
return ConduitValveApparatusRenderer.INSTANCE;
|
||||
|
||||
case PURIFIER:
|
||||
return PurifierApparatusRenderer.INSTANCE;
|
||||
|
||||
case CONDUIT_VALVE_ADVANCED:
|
||||
return ConduitValveAdvancedApparatusRenderer.INSTANCE;
|
||||
|
||||
case CONDUIT_PUMP:
|
||||
return ConduitPumpApparatusRenderer.INSTANCE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
MetaVals meta = MetaVals.get(world.getBlockMetadata(x, y, z));
|
||||
|
||||
if (meta != MetaVals.CONDUIT && meta != MetaVals.CONDUIT_VALVE
|
||||
&& meta != MetaVals.CONDUIT_VALVE_ADVANCED) {
|
||||
return meta == null ? 0.0F : super.getBlockHardness(world, x, y, z);
|
||||
} else {
|
||||
return 0.25F;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List itemList) {
|
||||
for (MetaVals meta : MetaVals.values()) {
|
||||
itemList.add(new ItemStack(this, 1, meta.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta_) {
|
||||
MetaVals meta = MetaVals.get(meta_);
|
||||
|
||||
switch (meta) {
|
||||
case CONDUIT:
|
||||
return new TileConduit();
|
||||
|
||||
case FILTER:
|
||||
return new TileFilter();
|
||||
|
||||
case CONDUIT_TANK:
|
||||
return new TileConduitTank();
|
||||
|
||||
case CONDUIT_VALVE:
|
||||
return new TileConduitValve();
|
||||
|
||||
case PURIFIER:
|
||||
return new TilePurifier();
|
||||
|
||||
case CONDUIT_VALVE_ADVANCED:
|
||||
return new TileConduitValveAdvanced();
|
||||
|
||||
case CONDUIT_PUMP:
|
||||
return new TileConduitPump();
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
MetaVals md = MetaVals.get(iblockaccess.getBlockMetadata(i, j, k));
|
||||
float w1;
|
||||
if (md != MetaVals.CONDUIT && md != MetaVals.CONDUIT_VALVE
|
||||
&& md != MetaVals.CONDUIT_VALVE_ADVANCED) {
|
||||
if (md != MetaVals.FILTER) {
|
||||
if (md == MetaVals.CONDUIT_VALVE) {
|
||||
w1 = 0.0625F;
|
||||
this.setBlockBounds(w1, 0.0F, w1, 1.0F - w1, 1.0F, 1.0F - w1);
|
||||
} else if (md == null) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
|
||||
} else {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
} else {
|
||||
w1 = 0.125F;
|
||||
this.setBlockBounds(w1, 0.0F, w1, 1.0F - w1, 1.0F, 1.0F - w1);
|
||||
}
|
||||
} else {
|
||||
w1 = 0.25F;
|
||||
this.setBlockBounds(w1, w1, w1, 1.0F - w1, 1.0F - w1, 1.0F - w1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World w, int i, int j, int k) {
|
||||
MetaVals md = MetaVals.get(w.getBlockMetadata(i, j, k));
|
||||
float w1;
|
||||
if (md != MetaVals.CONDUIT && md != MetaVals.CONDUIT_VALVE
|
||||
&& md != MetaVals.CONDUIT_VALVE_ADVANCED) {
|
||||
if (md != MetaVals.FILTER) {
|
||||
if (md == MetaVals.CONDUIT_TANK) {
|
||||
w1 = 0.0625F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) w1,
|
||||
0.0,
|
||||
(double) w1,
|
||||
(double) (1.0F - w1),
|
||||
1.0,
|
||||
(double) (1.0F - w1)
|
||||
);
|
||||
} else {
|
||||
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
} else {
|
||||
w1 = 0.125F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) w1,
|
||||
0.0,
|
||||
(double) w1,
|
||||
(double) (1.0F - w1),
|
||||
1.0,
|
||||
(double) (1.0F - w1)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
w1 = 0.25F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) w1,
|
||||
(double) w1,
|
||||
(double) w1,
|
||||
(double) (1.0F - w1),
|
||||
(double) (1.0F - w1),
|
||||
(double) (1.0F - w1)
|
||||
);
|
||||
}
|
||||
|
||||
return super.getSelectedBoundingBoxFromPool(w, i, j, k);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(
|
||||
World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack is
|
||||
) {
|
||||
MetaVals md = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
int l = MathHelper.floor_double(
|
||||
(double) (entityliving.rotationYaw * 4.0F / 360.0F) + 0.5
|
||||
)
|
||||
& 3;
|
||||
if (md == MetaVals.PURIFIER) {
|
||||
TilePurifier tp = (TilePurifier) world.getTileEntity(i, j, k);
|
||||
tp.orientation = l;
|
||||
world.markBlockForUpdate(tp.xCoord, tp.yCoord, tp.zCoord);
|
||||
}
|
||||
|
||||
if (md == MetaVals.CONDUIT_PUMP) {
|
||||
TileConduitPump tb = (TileConduitPump) world.getTileEntity(i, j, k);
|
||||
if (MathHelper.abs((float) entityliving.posX - (float) i) < 1.0F
|
||||
&& MathHelper.abs((float) entityliving.posZ - (float) k) < 1.0F) {
|
||||
double d = entityliving.posY + 1.82 - (double) entityliving.yOffset;
|
||||
if (d - (double) j > 2.0) {
|
||||
tb.orientation = 1;
|
||||
}
|
||||
|
||||
if ((double) j - d > 0.0) {
|
||||
tb.orientation = 0;
|
||||
}
|
||||
} else {
|
||||
if (l == 0) {
|
||||
tb.orientation = 2;
|
||||
}
|
||||
|
||||
if (l == 1) {
|
||||
tb.orientation = 5;
|
||||
}
|
||||
|
||||
if (l == 2) {
|
||||
tb.orientation = 3;
|
||||
}
|
||||
|
||||
if (l == 3) {
|
||||
tb.orientation = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
EntityPlayer entityplayer,
|
||||
|
||||
// useless parameters
|
||||
int alec1,
|
||||
float alec2,
|
||||
float alec3,
|
||||
float alec4
|
||||
) {
|
||||
if (!entityplayer.isSneaking()) {
|
||||
MetaVals meta = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
if (meta == MetaVals.CONDUIT_VALVE) {
|
||||
if (entityplayer.isSneaking()) {
|
||||
return false;
|
||||
} else {
|
||||
if (world.isRemote)
|
||||
return true;
|
||||
|
||||
TileConduitValve tileentity
|
||||
= (TileConduitValve) world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
tileentity.open = !tileentity.open;
|
||||
world.markBlockForUpdate(
|
||||
tileentity.xCoord, tileentity.yCoord, tileentity.zCoord
|
||||
);
|
||||
world.playSoundEffect(
|
||||
(double) i + 0.5,
|
||||
(double) j + 0.5,
|
||||
(double) k + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
tileentity.open ? 0.6F : 0.5F
|
||||
);
|
||||
world.notifyBlocksOfNeighborChange(i, j, k, this);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else if (meta == MetaVals.CONDUIT_VALVE_ADVANCED) {
|
||||
if (entityplayer.isSneaking()) {
|
||||
return false;
|
||||
} else {
|
||||
TileConduitValveAdvanced tileentity
|
||||
= (TileConduitValveAdvanced) world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
++tileentity.setting;
|
||||
if (tileentity.setting > 2) {
|
||||
tileentity.setting = 0;
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(
|
||||
tileentity.xCoord, tileentity.yCoord, tileentity.zCoord
|
||||
);
|
||||
world.playSoundEffect(
|
||||
(double) i + 0.5,
|
||||
(double) j + 0.5,
|
||||
(double) k + 0.5,
|
||||
"random.click",
|
||||
0.3F,
|
||||
0.5F
|
||||
);
|
||||
world.notifyBlocksOfNeighborChange(i, j, k, this);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return super.onBlockActivated(
|
||||
world, i, j, k, entityplayer, alec1, alec2, alec3, alec4
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@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
|
||||
public int getRenderType() {
|
||||
return BlockApparatusRenderer.RI;
|
||||
}
|
||||
|
||||
//public int getBlockTextureFromSide(int i) {
|
||||
// return 15;
|
||||
//}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int l) {
|
||||
MetaVals md = MetaVals.get(iblockaccess.getBlockMetadata(i, j, k));
|
||||
if (md == MetaVals.FILTER) {
|
||||
if (l <= 1) {
|
||||
return this.iconFilterBottom;
|
||||
} else {
|
||||
TileConduit tf = (TileFilter) iblockaccess.getTileEntity(i, j, k);
|
||||
HelperLocation loc = new HelperLocation(tf);
|
||||
switch (l) {
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
}
|
||||
|
||||
if (!tf.getConnectable(loc.facing)) {
|
||||
return this.iconFilterSide;
|
||||
} else {
|
||||
TileEntity te = loc.getConnectableTile(iblockaccess);
|
||||
return te != null ? this.iconFilterFront : this.iconFilterSide;
|
||||
}
|
||||
}
|
||||
} else if (md == MetaVals.CONDUIT_TANK) {
|
||||
return l <= 1 ? this.iconTankBottom : this.iconTankSide;
|
||||
} else if (md == MetaVals.PURIFIER) {
|
||||
TileEntity te = iblockaccess.getTileEntity(i, j, k);
|
||||
if (te != null && te instanceof TilePurifier) {
|
||||
TilePurifier tp = (TilePurifier) te;
|
||||
if (tp.orientation != 0 && tp.orientation != 2) {
|
||||
return l > 3 ? this.iconPurifierFront : this.iconPurifierSide;
|
||||
} else if (l <= 1) {
|
||||
return this.iconPurifierTop;
|
||||
} else {
|
||||
return l <= 3 ? this.iconPurifierFront : this.iconPurifierSide;
|
||||
}
|
||||
} else {
|
||||
return this.iconPurifierFront;
|
||||
}
|
||||
}
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockSolid(IBlockAccess world, int i, int j, int k, int side) {
|
||||
MetaVals md = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
//return md > 2 && md != 4;
|
||||
return md != MetaVals.CONDUIT && md != MetaVals.FILTER;
|
||||
}
|
||||
|
||||
//public int idDropped(int i, Random random, int j) {
|
||||
// return i == 10 ? mod_ThaumCraft.itemComponents.shiftedIndex
|
||||
// : super.idDropped(i, random, j);
|
||||
//}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
public int getLightValue(IBlockAccess iba, int i, int j, int k) {
|
||||
int md = iba.getBlockMetadata(i, j, k);
|
||||
if (md != 0 && md != 1 && md != 3) {
|
||||
if (md == 4) {
|
||||
return 8;
|
||||
} else {
|
||||
return md == 10 ? 14 : super.getLightValue(iba, i, j, k);
|
||||
}
|
||||
} else {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
//public boolean renderAppFragileBlock(
|
||||
// World w,
|
||||
// RenderBlocks renderblocks,
|
||||
// int i,
|
||||
// int j,
|
||||
// int k,
|
||||
// Block block,
|
||||
// boolean inv,
|
||||
// int md
|
||||
//) {
|
||||
// if (md == -9) {
|
||||
// md = w.getBlockMetadata(i, j, k);
|
||||
// }
|
||||
|
||||
// if (md == 0) {
|
||||
// return ThaumCraftRenderer.renderBlockConduit(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 1) {
|
||||
// return ThaumCraftRenderer.renderBlockFilter(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 2) {
|
||||
// return ThaumCraftRenderer.renderBlockBellows(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 3) {
|
||||
// return ThaumCraftRenderer.renderBlockTank(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 4) {
|
||||
// return ThaumCraftRenderer.renderBlockBrain(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 5) {
|
||||
// return ThaumCraftRenderer.renderBlockValve(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 6) {
|
||||
// return ThaumCraftRenderer.renderBlockPurifier(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 7) {
|
||||
// return ThaumCraftRenderer.renderTrunk(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else if (md == 8) {
|
||||
// return ThaumCraftRenderer.renderBlockValveAdvanced(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// );
|
||||
// } else {
|
||||
// return md == 9 ? ThaumCraftRenderer.renderBlockPump(
|
||||
// w, renderblocks, i, j, k, block, md, inv
|
||||
// )
|
||||
// : false;
|
||||
// }
|
||||
//}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World w, int i, int j, int k, Random r) {
|
||||
int md = w.getBlockMetadata(i, j, k);
|
||||
if (md == 10) {
|
||||
FXSparkle ef2 = new FXSparkle(
|
||||
w,
|
||||
(double) ((float) i + 0.5F),
|
||||
(double) ((float) j + 0.5F),
|
||||
(double) ((float) k + 0.5F),
|
||||
(double) ((float) i + 0.5F + (r.nextFloat() - r.nextFloat()) / 3.0F),
|
||||
(double) ((float) j + 0.5F + (r.nextFloat() - r.nextFloat()) / 3.0F),
|
||||
(double) ((float) k + 0.5F + (r.nextFloat() - r.nextFloat()) / 3.0F),
|
||||
1.0F,
|
||||
6,
|
||||
3
|
||||
);
|
||||
ef2.setGravity(0.05F);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef2);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTick(World w, int i, int j, int k, Random r) {
|
||||
int md = w.getBlockMetadata(i, j, k);
|
||||
if (md == 10) {
|
||||
w.scheduleBlockUpdate(i, j, k, this, 5 + r.nextInt(3));
|
||||
FXWisp ef = new FXWisp(
|
||||
w,
|
||||
(double) ((float) i + 0.5F),
|
||||
(double) ((float) j + 0.5F),
|
||||
(double) ((float) k + 0.5F),
|
||||
0.5F,
|
||||
4
|
||||
);
|
||||
ef.shrink = true;
|
||||
ef.setGravity(-0.03F);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
ef = new FXWisp(
|
||||
w,
|
||||
(double) ((float) i + 0.5F),
|
||||
(double) ((float) j + 0.5F),
|
||||
(double) ((float) k + 0.5F),
|
||||
0.25F,
|
||||
1
|
||||
);
|
||||
ef.setGravity(-0.01F);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
}
|
||||
|
||||
super.updateTick(w, i, j, k, r);
|
||||
}
|
||||
|
||||
public static enum MetaVals {
|
||||
// original metas in comments
|
||||
CONDUIT, // 0
|
||||
FILTER, // 1
|
||||
CONDUIT_TANK, // 3
|
||||
CONDUIT_VALVE, // 5
|
||||
PURIFIER, // 6
|
||||
CONDUIT_VALVE_ADVANCED, // 8
|
||||
CONDUIT_PUMP; // 9
|
||||
|
||||
public static MetaVals get(int meta) {
|
||||
if (meta >= 0 && meta < MetaVals.values().length)
|
||||
return MetaVals.values()[meta];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,973 @@
|
|||
package net.anvilcraft.thaummach.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import net.anvilcraft.thaummach.AuraUtils;
|
||||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.ArcaneFurnaceApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrucibleApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrystallizerApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileArcaneFurnace;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.common.entities.monster.EntityThaumicSlime;
|
||||
import thaumcraft.common.tiles.TileBellows;
|
||||
|
||||
public class BlockApparatusMetal extends BlockApparatus {
|
||||
private int delay = 0;
|
||||
|
||||
public IIcon iconArcaneFurnaceBottom;
|
||||
public IIcon iconArcaneFurnaceInside;
|
||||
public IIcon iconArcaneFurnaceSide;
|
||||
public IIcon iconArcaneFurnaceTop;
|
||||
public IIcon iconCrystallizerBottom;
|
||||
public IIcon iconCrystallizerSide;
|
||||
public IIcon iconCrystallizerTop;
|
||||
public IIcon iconGenerator1;
|
||||
public IIcon iconGenerator2;
|
||||
public IIcon iconGenerator3;
|
||||
public IIcon iconSoulBrazierBottom;
|
||||
public IIcon iconSoulBrazierSide;
|
||||
public IIcon iconSoulCrucibleBottom;
|
||||
public IIcon iconSoulCrucibleFace0;
|
||||
public IIcon iconSoulCrucibleFace1;
|
||||
public IIcon iconSoulCrucibleFace2;
|
||||
public IIcon iconSoulCrucibleFace3;
|
||||
public IIcon iconSoulCrucibleTop;
|
||||
public IIcon iconSoulCrucibleTopInv;
|
||||
public IIcon iconVoidChestBottom;
|
||||
public IIcon iconVoidChestSide;
|
||||
public IIcon iconVoidChestSideTransparent;
|
||||
public IIcon iconVoidChestTop;
|
||||
public IIcon iconVoidInterfaceBottom;
|
||||
public IIcon iconVoidInterfaceSide;
|
||||
|
||||
public IIcon[] iconsEyesCrucible;
|
||||
public IIcon[] iconsNormalCrucible;
|
||||
public IIcon[] iconsThaumiumCrucible;
|
||||
|
||||
public BlockApparatusMetal() {
|
||||
super(Material.rock);
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(17.0F);
|
||||
this.setStepSound(Block.soundTypeMetal);
|
||||
this.setBlockName("tcbappmetal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
|
||||
this.iconArcaneFurnaceBottom
|
||||
= reg.registerIcon("thaummach:arcane_furnace_bottom");
|
||||
this.iconArcaneFurnaceInside
|
||||
= reg.registerIcon("thaummach:arcane_furnace_inside");
|
||||
this.iconArcaneFurnaceSide = reg.registerIcon("thaummach:arcane_furnace_side");
|
||||
this.iconArcaneFurnaceTop = reg.registerIcon("thaummach:arcane_furnace_top");
|
||||
this.iconCrystallizerBottom = reg.registerIcon("thaummach:crystallizer_bottom");
|
||||
this.iconCrystallizerSide = reg.registerIcon("thaummach:crystallizer_side");
|
||||
this.iconCrystallizerTop = reg.registerIcon("thaummach:crystallizer_top");
|
||||
this.iconGenerator1 = reg.registerIcon("thaummach:generator_1");
|
||||
this.iconGenerator2 = reg.registerIcon("thaummach:generator_2");
|
||||
this.iconGenerator3 = reg.registerIcon("thaummach:generator_3");
|
||||
this.iconSoulBrazierBottom = reg.registerIcon("thaummach:soul_brazier_bottom");
|
||||
this.iconSoulBrazierSide = reg.registerIcon("thaummach:soul_brazier_side");
|
||||
this.iconSoulCrucibleBottom = reg.registerIcon("thaummach:soul_crucible_bottom");
|
||||
this.iconSoulCrucibleFace0 = reg.registerIcon("thaummach:soul_crucible_face_0");
|
||||
this.iconSoulCrucibleFace1 = reg.registerIcon("thaummach:soul_crucible_face_1");
|
||||
this.iconSoulCrucibleFace2 = reg.registerIcon("thaummach:soul_crucible_face_2");
|
||||
this.iconSoulCrucibleFace3 = reg.registerIcon("thaummach:soul_crucible_face_3");
|
||||
this.iconSoulCrucibleTop = reg.registerIcon("thaummach:soul_crucible_top");
|
||||
this.iconSoulCrucibleTopInv = reg.registerIcon("thaummach:soul_crucible_top_inv");
|
||||
this.iconVoidChestBottom = reg.registerIcon("thaummach:void_chest_bottom");
|
||||
this.iconVoidChestSide = reg.registerIcon("thaummach:void_chest_side");
|
||||
this.iconVoidChestSideTransparent
|
||||
= reg.registerIcon("thaummach:void_chest_side_transparent");
|
||||
this.iconVoidChestTop = reg.registerIcon("thaummach:void_chest_top");
|
||||
this.iconVoidInterfaceBottom
|
||||
= reg.registerIcon("thaummach:void_interface_bottom");
|
||||
this.iconVoidInterfaceSide = reg.registerIcon("thaummach:void_interface_side");
|
||||
|
||||
this.iconsEyesCrucible
|
||||
= IntStream.rangeClosed(1, 7)
|
||||
.mapToObj(i -> reg.registerIcon("thaummach:eyes_crucible_" + i))
|
||||
.toArray(IIcon[] ::new);
|
||||
|
||||
this.iconsNormalCrucible
|
||||
= IntStream.rangeClosed(1, 7)
|
||||
.mapToObj(
|
||||
i
|
||||
-> i == 5 ? null
|
||||
: reg.registerIcon("thaummach:normal_crucible_" + i)
|
||||
)
|
||||
.toArray(IIcon[] ::new);
|
||||
|
||||
this.iconsThaumiumCrucible
|
||||
= IntStream.rangeClosed(1, 7)
|
||||
.mapToObj(i -> reg.registerIcon("thaummach:thaumium_crucible_" + i))
|
||||
.toArray(IIcon[] ::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IApparatusRenderer getApparatusRenderer(int md) {
|
||||
MetaVals meta = MetaVals.get(md);
|
||||
|
||||
switch (meta) {
|
||||
case NORMAL_CRUCIBLE:
|
||||
case EYES_CRUCIBLE:
|
||||
case THAUMIUM_CRUCIBLE:
|
||||
case SOUL_CRUCIBLE:
|
||||
return CrucibleApparatusRenderer.INSTANCE;
|
||||
|
||||
case ARCANE_FURNACE:
|
||||
return ArcaneFurnaceApparatusRenderer.INSTANCE;
|
||||
|
||||
case CRYSTALLIZER:
|
||||
return CrystallizerApparatusRenderer.INSTANCE;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
MetaVals md = MetaVals.get(meta);
|
||||
if (md.isCrucible()) {
|
||||
TileCrucible tc = new TileCrucible();
|
||||
tc.setTier((short) (md.ordinal() + 1));
|
||||
return tc;
|
||||
} else if (md == MetaVals.ARCANE_FURNACE) {
|
||||
//return new TileArcaneFurnace();
|
||||
} else if (md == MetaVals.GENERATOR) {
|
||||
//return new TileGenerator();
|
||||
} else if (md == MetaVals.CRYSTALLIZER) {
|
||||
return new TileCrystallizer();
|
||||
} else if (md == MetaVals.BORE) {
|
||||
//return new TileBore();
|
||||
} else if (md == MetaVals.VOID_CHEST) {
|
||||
//return new TileVoidChest();
|
||||
} else if (md == MetaVals.VOID_INTERFACE) {
|
||||
//return new TileVoidInterface();
|
||||
} else if (md == MetaVals.TANK) {
|
||||
return new TileConduitTank();
|
||||
} else if (md == MetaVals.SOUL_BRAZIER) {
|
||||
//return new TileSoulBrazier();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (MetaVals meta : MetaVals.values()) {
|
||||
list.add(new ItemStack(this, 1, meta.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) {
|
||||
MetaVals md = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
if (md == MetaVals.NORMAL_CRUCIBLE || md == MetaVals.EYES_CRUCIBLE
|
||||
|| md == MetaVals.THAUMIUM_CRUCIBLE) {
|
||||
if (entity instanceof EntityItem && entity.posY <= (double) j + 0.7) {
|
||||
entity.motionX += (double
|
||||
) ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.05F);
|
||||
entity.motionY += (double) (world.rand.nextFloat() * 0.1F);
|
||||
entity.motionZ += (double
|
||||
) ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.05F);
|
||||
((EntityItem) entity).delayBeforeCanPickup = 10;
|
||||
((EntityItem) entity).age = 0;
|
||||
}
|
||||
|
||||
++this.delay;
|
||||
if (this.delay >= 5) {
|
||||
this.delay = 0;
|
||||
if (entity instanceof EntityLiving
|
||||
&& !(entity instanceof EntityThaumicSlime)) {
|
||||
entity.attackEntityFrom(DamageSource.magic, 1);
|
||||
world.playSoundEffect(
|
||||
(double) i,
|
||||
(double) j,
|
||||
(double) k,
|
||||
"random.fizz",
|
||||
0.4F,
|
||||
2.0F + world.rand.nextFloat() * 0.4F
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return BlockApparatusRenderer.RI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int i, int j) {
|
||||
MetaVals meta = MetaVals.get(j);
|
||||
if (meta == MetaVals.GENERATOR) {
|
||||
return this.iconGenerator2;
|
||||
} else if (meta == MetaVals.VOID_CHEST) {
|
||||
if (i == 0) {
|
||||
return this.iconVoidChestBottom;
|
||||
} else {
|
||||
return i == 1 ? this.iconVoidChestTop : this.iconVoidChestSide;
|
||||
}
|
||||
} else if (meta == MetaVals.VOID_INTERFACE) {
|
||||
return i <= 1 ? this.iconVoidInterfaceBottom : this.iconVoidInterfaceSide;
|
||||
} else if (meta == MetaVals.SOUL_BRAZIER) {
|
||||
return i <= 1 ? this.iconSoulBrazierBottom : this.iconSoulBrazierSide;
|
||||
} else {
|
||||
return super.getIcon(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int side) {
|
||||
MetaVals meta = MetaVals.get(iblockaccess.getBlockMetadata(i, j, k));
|
||||
TileCrucible tc;
|
||||
if (meta == MetaVals.NORMAL_CRUCIBLE || meta == MetaVals.EYES_CRUCIBLE
|
||||
|| meta == MetaVals.THAUMIUM_CRUCIBLE) {
|
||||
if (side == 1) {
|
||||
return CrucibleApparatusRenderer.getIcons(this, meta)[0];
|
||||
} else if (side == 0) {
|
||||
return CrucibleApparatusRenderer.getIcons(this, meta)[3];
|
||||
} else {
|
||||
tc = (TileCrucible) iblockaccess.getTileEntity(i, j, k);
|
||||
return meta != MetaVals.NORMAL_CRUCIBLE && tc != null && tc.isPowering
|
||||
? CrucibleApparatusRenderer.getIcons(this, meta)[3]
|
||||
: CrucibleApparatusRenderer.getIcons(this, meta)[5];
|
||||
}
|
||||
} else if (meta == MetaVals.SOUL_CRUCIBLE) {
|
||||
if (side == 1) {
|
||||
return this.iconSoulCrucibleTop;
|
||||
} else if (side == 0) {
|
||||
return this.iconSoulCrucibleBottom;
|
||||
} else {
|
||||
tc = (TileCrucible) iblockaccess.getTileEntity(i, j, k);
|
||||
switch (tc == null ? 3 : tc.face) {
|
||||
case 0:
|
||||
return this.iconSoulCrucibleFace0;
|
||||
|
||||
case 1:
|
||||
return this.iconSoulCrucibleFace1;
|
||||
|
||||
case 2:
|
||||
return this.iconSoulCrucibleFace2;
|
||||
|
||||
default:
|
||||
return this.iconSoulCrucibleFace3;
|
||||
}
|
||||
}
|
||||
} else if (meta == MetaVals.ARCANE_FURNACE) {
|
||||
if (side == 1) {
|
||||
return this.iconArcaneFurnaceTop;
|
||||
} else if (side == 0) {
|
||||
return this.iconArcaneFurnaceBottom;
|
||||
} else {
|
||||
return this.iconArcaneFurnaceSide;
|
||||
}
|
||||
}
|
||||
//else if (meta == 5) {
|
||||
// return 144;
|
||||
//}
|
||||
else if (meta == MetaVals.CRYSTALLIZER) {
|
||||
if (side == 1) {
|
||||
return this.iconCrystallizerTop;
|
||||
} else if (side == 0) {
|
||||
return this.iconCrystallizerBottom;
|
||||
} else {
|
||||
return this.iconCrystallizerSide;
|
||||
}
|
||||
}
|
||||
//else if (meta == 8) {
|
||||
// if (side == 0) {
|
||||
// return 104;
|
||||
// } else {
|
||||
// return side == 1 ? 97 : 255;
|
||||
// }
|
||||
//} else if (meta == 10) {
|
||||
// return side <= 1 ? 78 : 79;
|
||||
//} else {
|
||||
// return super.getBlockTexture(iblockaccess, i, j, k, side);
|
||||
//}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(
|
||||
World world,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
AxisAlignedBB axisalignedbb,
|
||||
List arraylist,
|
||||
Entity entity
|
||||
) {
|
||||
MetaVals meta = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
float t4;
|
||||
if (meta == MetaVals.NORMAL_CRUCIBLE || meta == MetaVals.EYES_CRUCIBLE
|
||||
|| meta == MetaVals.THAUMIUM_CRUCIBLE) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
t4 = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, t4, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, t4);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
this.setBlockBounds(1.0F - t4, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - t4, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
this.setBlockBoundsForItemRender();
|
||||
} else if (meta != MetaVals.GENERATOR && meta != MetaVals.BORE) {
|
||||
if (meta == MetaVals.VOID_INTERFACE) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.4375F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
} else if (meta == MetaVals.TANK) {
|
||||
t4 = 0.0625F;
|
||||
this.setBlockBounds(t4, 0.0F, t4, 1.0F - t4, 1.0F, 1.0F - t4);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
} else if (meta == MetaVals.SOUL_BRAZIER) {
|
||||
t4 = 0.25F;
|
||||
this.setBlockBounds(t4, 0.0F, t4, 1.0F - t4, 0.75F, 1.0F - t4);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
} else {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
this.setBlockBoundsForItemRender();
|
||||
}
|
||||
} else {
|
||||
t4 = 0.125F;
|
||||
this.setBlockBounds(t4, t4, t4, 1.0F - t4, 1.0F - t4, 1.0F - t4);
|
||||
super.addCollisionBoxesToList(
|
||||
world, i, j, k, axisalignedbb, arraylist, entity
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
MetaVals md = MetaVals.get(iblockaccess.getBlockMetadata(i, j, k));
|
||||
float t4;
|
||||
if (md != MetaVals.GENERATOR && md != MetaVals.BORE) {
|
||||
if (md == MetaVals.TANK) {
|
||||
t4 = 0.0625F;
|
||||
this.setBlockBounds(t4, 0.0F, t4, 1.0F - t4, 1.0F, 1.0F - t4);
|
||||
} else if (md == MetaVals.SOUL_BRAZIER) {
|
||||
t4 = 0.25F;
|
||||
this.setBlockBounds(t4, 0.0F, t4, 1.0F - t4, 0.75F, 1.0F - t4);
|
||||
} else if (md == MetaVals.VOID_INTERFACE) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.4375F, 1.0F);
|
||||
} else {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
} else {
|
||||
t4 = 0.125F;
|
||||
this.setBlockBounds(t4, t4, t4, 1.0F - t4, 1.0F - t4, 1.0F - t4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World w, int i, int j, int k) {
|
||||
MetaVals md = MetaVals.get(w.getBlockMetadata(i, j, k));
|
||||
float t4;
|
||||
if (md != MetaVals.GENERATOR && md != MetaVals.BORE) {
|
||||
if (md == MetaVals.VOID_INTERFACE) {
|
||||
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 0.4375, 1.0);
|
||||
} else if (md == MetaVals.TANK) {
|
||||
t4 = 0.0625F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) t4,
|
||||
0.0,
|
||||
(double) t4,
|
||||
(double) (1.0F - t4),
|
||||
1.0,
|
||||
(double) (1.0F - t4)
|
||||
);
|
||||
} else if (md == MetaVals.SOUL_BRAZIER) {
|
||||
t4 = 0.25F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) t4,
|
||||
0.0,
|
||||
(double) t4,
|
||||
(double) (1.0F - t4),
|
||||
0.75,
|
||||
(double) (1.0F - t4)
|
||||
);
|
||||
} else {
|
||||
AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
} else {
|
||||
t4 = 0.125F;
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) t4,
|
||||
(double) t4,
|
||||
(double) t4,
|
||||
(double) (1.0F - t4),
|
||||
(double) (1.0F - t4),
|
||||
(double) (1.0F - t4)
|
||||
);
|
||||
}
|
||||
|
||||
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) {
|
||||
MetaVals meta = MetaVals.get(w.getBlockMetadata(i, j, k));
|
||||
if (meta.isCrucible()) {
|
||||
try {
|
||||
//TileCrucible data = (TileCrucible) w.getTileEntity(i, j, k);
|
||||
} catch (Exception var15) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: FX
|
||||
//ThaumCraftCore.createGreenFlameFX(
|
||||
// w,
|
||||
// (float) i + 0.2F + r.nextFloat() * 0.6F,
|
||||
// (float) j + 0.1F,
|
||||
// (float) k + 0.2F + r.nextFloat() * 0.6F
|
||||
//);
|
||||
}
|
||||
|
||||
int arcs;
|
||||
if (meta == MetaVals.ARCANE_FURNACE) {
|
||||
TileArcaneFurnace data;
|
||||
try {
|
||||
data = (TileArcaneFurnace) w.getTileEntity(i, j, k);
|
||||
} catch (Exception var14) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.isWorking()) {
|
||||
return;
|
||||
}
|
||||
|
||||
float f1;
|
||||
float f2;
|
||||
float f3;
|
||||
for (arcs = 0; arcs < 3; ++arcs) {
|
||||
f1 = r.nextFloat() * 0.6F;
|
||||
f2 = r.nextFloat() * 0.5F;
|
||||
f3 = r.nextFloat() * 0.6F;
|
||||
w.spawnParticle(
|
||||
"smoke",
|
||||
(double) ((float) i + f1 + 0.2F),
|
||||
(double) ((float) j + 0.1F + f2),
|
||||
(double) ((float) k + f3 + 0.2F),
|
||||
0.0,
|
||||
0.06,
|
||||
0.0
|
||||
);
|
||||
w.spawnParticle(
|
||||
"flame",
|
||||
(double) ((float) i + f1 + 0.2F),
|
||||
(double) ((float) j + 0.1F + f2),
|
||||
(double) ((float) k + f3 + 0.2F),
|
||||
0.0,
|
||||
0.06,
|
||||
0.0
|
||||
);
|
||||
}
|
||||
|
||||
float f = (float) i + 0.5F;
|
||||
f1 = (float) j + 0.3F + r.nextFloat() * 0.4F;
|
||||
f2 = (float) k + 0.5F;
|
||||
f3 = 0.45F;
|
||||
float f4 = r.nextFloat() * 0.6F - 0.3F;
|
||||
|
||||
for (int a = 0; a < 4; ++a) {
|
||||
if (a == 0 && !w.getBlock(i - 1, j, k).isOpaqueCube()) {
|
||||
w.spawnParticle(
|
||||
"smoke",
|
||||
(double) (f - f3),
|
||||
(double) f1,
|
||||
(double) (f2 + f4),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
w.spawnParticle(
|
||||
"flame",
|
||||
(double) (f - f3),
|
||||
(double) f1,
|
||||
(double) (f2 + f4),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
} else if (a == 1 && !w.getBlock(i + 1, j, k).isOpaqueCube()) {
|
||||
w.spawnParticle(
|
||||
"smoke",
|
||||
(double) (f + f3),
|
||||
(double) f1,
|
||||
(double) (f2 + f4),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
w.spawnParticle(
|
||||
"flame",
|
||||
(double) (f + f3),
|
||||
(double) f1,
|
||||
(double) (f2 + f4),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
} else if (a == 2 && !w.getBlock(i, j, k - 1).isOpaqueCube()) {
|
||||
w.spawnParticle(
|
||||
"smoke",
|
||||
(double) (f + f4),
|
||||
(double) f1,
|
||||
(double) (f2 - f3),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
w.spawnParticle(
|
||||
"flame",
|
||||
(double) (f + f4),
|
||||
(double) f1,
|
||||
(double) (f2 - f3),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
} else if (a == 3 && !w.getBlock(i, j, k + 1).isOpaqueCube()) {
|
||||
w.spawnParticle(
|
||||
"smoke",
|
||||
(double) (f + f4),
|
||||
(double) f1,
|
||||
(double) (f2 + f3),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
w.spawnParticle(
|
||||
"flame",
|
||||
(double) (f + f4),
|
||||
(double) f1,
|
||||
(double) (f2 + f3),
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == MetaVals.GENERATOR) {
|
||||
// TODO: generator
|
||||
//TileGenerator tg = (TileGenerator) w.getTileEntity(i, j, k);
|
||||
//int arcs = 20;
|
||||
//if (!ModLoader.getMinecraftInstance().gameSettings.fancyGraphics
|
||||
// || Config.lowGfx) {
|
||||
// arcs = 10;
|
||||
//}
|
||||
|
||||
//arcs = arcs * tg.storedEnergy / tg.energyMax;
|
||||
//if (w.rand.nextInt(20) < arcs) {
|
||||
// LightningBolt bolt = new LightningBolt(
|
||||
// w,
|
||||
// (double) i + 0.5,
|
||||
// (double) j + 0.5,
|
||||
// (double) k + 0.5,
|
||||
// (double) i + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// (double) j + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// (double) k + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// w.rand.nextLong(),
|
||||
// 6,
|
||||
// 9.0F
|
||||
// );
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(0);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
//}
|
||||
}
|
||||
|
||||
if (meta == MetaVals.CRYSTALLIZER) {
|
||||
FXSparkle ef2 = new FXSparkle(
|
||||
w,
|
||||
(double) ((float) i + 0.1F + w.rand.nextFloat() * 0.8F),
|
||||
(double) ((float) j + 0.6F + w.rand.nextFloat() * 0.6F),
|
||||
(double) ((float) k + 0.1F + w.rand.nextFloat() * 0.8F),
|
||||
1.0F,
|
||||
w.rand.nextInt(5),
|
||||
3
|
||||
);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef2);
|
||||
}
|
||||
|
||||
if (meta == MetaVals.VOID_INTERFACE) {
|
||||
// TODO: void interface
|
||||
//TileVoidInterface tvi = (TileVoidInterface) w.getTileEntity(i, j, k);
|
||||
//if (tvi != null && tvi.linked && w.rand.nextInt(10) == 0) {
|
||||
// LightningBolt bolt = new LightningBolt(
|
||||
// w,
|
||||
// new WRVector3((double) i + 0.5, (double) j + 0.75, (double) k +
|
||||
// 0.5), new WRVector3(
|
||||
// (double) i + 0.5 + (double) w.rand.nextFloat()
|
||||
// - (double) w.rand.nextFloat(),
|
||||
// (double) (j + 2),
|
||||
// (double) k + 0.5 + (double) w.rand.nextFloat()
|
||||
// - (double) w.rand.nextFloat()
|
||||
// ),
|
||||
// w.rand.nextLong()
|
||||
// );
|
||||
// bolt.setMultiplier(4.0F);
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(5);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int i, int j, int k, Block block, int meta_) {
|
||||
MetaVals meta = MetaVals.get(meta_);
|
||||
if (meta.isCrucible() || meta == MetaVals.TANK) {
|
||||
AuraUtils.spillTaint(world, i, j, k);
|
||||
}
|
||||
|
||||
if (meta == MetaVals.VOID_INTERFACE) {
|
||||
// TODO: void interface
|
||||
//TileVoidInterface ts = (TileVoidInterface) world.getTileEntity(i, j,
|
||||
//k); if (ts != null) {
|
||||
// ts.invalidateLinks();
|
||||
// SISpecialTile pd = new SISpecialTile(
|
||||
// i,
|
||||
// j,
|
||||
// k,
|
||||
// ts.network,
|
||||
// (byte) ModLoader.getMinecraftInstance().thePlayer.dimension,
|
||||
// (byte) 1
|
||||
// );
|
||||
// mod_ThaumCraft.DeleteSpecialTileFromList(pd);
|
||||
//}
|
||||
|
||||
} else {
|
||||
super.breakBlock(world, i, j, k, block, meta_);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean
|
||||
isSideSolid(IBlockAccess world, int i, int j, int k, ForgeDirection side) {
|
||||
MetaVals md = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
return md != MetaVals.VOID_CHEST && md != MetaVals.VOID_INTERFACE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(
|
||||
World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack is
|
||||
) {
|
||||
MetaVals md = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
if (md == MetaVals.VOID_INTERFACE) {
|
||||
// TODO: void interface
|
||||
//if (world.getBlock(i, j - 1, k) == this
|
||||
// && world.getBlockMetadata(i, j - 1, k) == 8) {
|
||||
// TileVoidInterface tvi
|
||||
// = (TileVoidInterface) world.getTileEntity(i, j, k);
|
||||
// if (tvi != null) {
|
||||
// tvi.network = (byte) world.rand.nextInt(6);
|
||||
// SISpecialTile pd = new SISpecialTile(
|
||||
// i,
|
||||
// j,
|
||||
// k,
|
||||
// tvi.network,
|
||||
// (byte) ModLoader.getMinecraftInstance().thePlayer.dimension,
|
||||
// (byte) 1
|
||||
// );
|
||||
// mod_ThaumCraft.AddSpecialTileToList(pd);
|
||||
// tvi.invalidateLinks();
|
||||
// tvi.establishLinks();
|
||||
// }
|
||||
//} else {
|
||||
// this.dropBlockAsItem(world, i, j, k, md, 0);
|
||||
// world.setBlock(i, j, k, 0);
|
||||
//}
|
||||
} else if (md == MetaVals.BORE) {
|
||||
// TODO: bore
|
||||
//TileBore tb = (TileBore) world.getTileEntity(i, j, k);
|
||||
//if (MathHelper.abs((float) entityliving.posX - (float) i) < 1.0F
|
||||
// && MathHelper.abs((float) entityliving.posZ - (float) k) < 1.0F) {
|
||||
// double d = entityliving.posY + 1.82 - (double) entityliving.yOffset;
|
||||
// if (d - (double) j > 2.0) {
|
||||
// tb.orientation = 1;
|
||||
// }
|
||||
|
||||
// if ((double) j - d > 0.0) {
|
||||
// tb.orientation = 0;
|
||||
// }
|
||||
//} else {
|
||||
// int l = MathHelper.floor_double(
|
||||
// (double) (entityliving.rotationYaw * 4.0F / 360.0F) + 0.5
|
||||
// )
|
||||
// & 3;
|
||||
// if (l == 0) {
|
||||
// tb.orientation = 2;
|
||||
// }
|
||||
|
||||
// if (l == 1) {
|
||||
// tb.orientation = 5;
|
||||
// }
|
||||
|
||||
// if (l == 2) {
|
||||
// tb.orientation = 3;
|
||||
// }
|
||||
|
||||
// if (l == 3) {
|
||||
// tb.orientation = 4;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
super.onBlockPlacedBy(world, i, j, k, entityliving, is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int
|
||||
isProvidingStrongPower(IBlockAccess iblockaccess, int i, int j, int k, int l) {
|
||||
MetaVals meta = MetaVals.get(iblockaccess.getBlockMetadata(i, j, k));
|
||||
if (meta == MetaVals.EYES_CRUCIBLE || meta == MetaVals.THAUMIUM_CRUCIBLE) {
|
||||
// TODO: crucibles
|
||||
//TileCrucible data = (TileCrucible) iblockaccess.getTileEntity(i, j, k);
|
||||
//if (l == 1) {
|
||||
// TileEntity below = iblockaccess.getTileEntity(i, j - 1, k);
|
||||
// if (below != null && below instanceof TileArcaneFurnace) {
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
||||
|
||||
//if (data.isPowering) {
|
||||
// return 15;
|
||||
//}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) {
|
||||
return this.isProvidingStrongPower(world, i, j, k, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int i, int j, int k, Block l) {
|
||||
super.onNeighborBlockChange(world, i, j, k, l);
|
||||
MetaVals meta = MetaVals.get(world.getBlockMetadata(i, j, k));
|
||||
int bellows = 0;
|
||||
if (world.getTileEntity(i + 1, j, k) instanceof TileBellows) {
|
||||
++bellows;
|
||||
}
|
||||
|
||||
if (world.getTileEntity(i - 1, j, k) instanceof TileBellows) {
|
||||
++bellows;
|
||||
}
|
||||
|
||||
if (world.getTileEntity(i, j, k + 1) instanceof TileBellows) {
|
||||
++bellows;
|
||||
}
|
||||
|
||||
if (world.getTileEntity(i, j, k - 1) instanceof TileBellows) {
|
||||
++bellows;
|
||||
}
|
||||
|
||||
if (meta.isCrucible()) {
|
||||
// TODO: crucibles
|
||||
//TileCrucible data = (TileCrucible) world.getTileEntity(i, j, k);
|
||||
//data.bellows = bellows;
|
||||
} else if (meta == MetaVals.ARCANE_FURNACE) {
|
||||
// TODO: arcane furnace
|
||||
//TileArcaneFurnace data
|
||||
// = (TileArcaneFurnace) world.getTileEntity(i, j, k);
|
||||
//data.bellows = bellows;
|
||||
} else {
|
||||
if (meta == MetaVals.VOID_INTERFACE
|
||||
&& (world.getBlock(i, j - 1, k) != this
|
||||
|| MetaVals.get(world.getBlockMetadata(i, j - 1, k))
|
||||
!= MetaVals.VOID_CHEST)) {
|
||||
this.dropBlockAsItem(world, i, j, k, meta.ordinal(), 0);
|
||||
world.setBlockToAir(i, j, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess iba, int i, int j, int k) {
|
||||
MetaVals md = MetaVals.get(iba.getBlockMetadata(i, j, k));
|
||||
if (md.isCrucible()) {
|
||||
return 5;
|
||||
} else {
|
||||
TileEntity tsb;
|
||||
if (md == MetaVals.ARCANE_FURNACE) {
|
||||
// TODO: arcane furnace
|
||||
//tsb = iba.getTileEntity(i, j, k);
|
||||
//return tsb != null && tsb instanceof TileArcaneFurnace
|
||||
// && ((TileArcaneFurnace) tsb).isWorking()
|
||||
// ? 13
|
||||
// : 0;
|
||||
} else if (md == MetaVals.SOUL_BRAZIER) {
|
||||
// TODO: soul brazier
|
||||
//tsb = iba.getTileEntity(i, j, k);
|
||||
//return tsb != null && tsb instanceof TileSoulBrazier
|
||||
// && ((TileSoulBrazier) tsb).isWorking()
|
||||
// ? 15
|
||||
// : 0;
|
||||
} else {
|
||||
return super.getLightValue(iba, i, j, k);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//@Override
|
||||
//public boolean renderAppMetalBlock(
|
||||
// World w, RenderBlocks rb, int i, int j, int k, Block block, boolean inv, int md
|
||||
//) {
|
||||
// if (md == -9) {
|
||||
// md = w.getBlockMetadata(i, j, k);
|
||||
// }
|
||||
|
||||
// switch (md) {
|
||||
// case 0:
|
||||
// case 1:
|
||||
// case 2:
|
||||
// case 3:
|
||||
// ThaumCraftRenderer.renderBlockCrucible(w, rb, i, j, k, block, md, inv);
|
||||
// return true;
|
||||
// case 4:
|
||||
// ThaumCraftRenderer.renderBlockArcaneFurnace(
|
||||
// w, rb, i, j, k, block, md, inv
|
||||
// );
|
||||
// return true;
|
||||
// case 5:
|
||||
// ThaumCraftRenderer.renderBlockGenerator(w, rb, i, j, k, block, md, inv);
|
||||
// return true;
|
||||
// case 6:
|
||||
// ThaumCraftRenderer.renderBlockCrystalizer(w, rb, i, j, k, block, md,
|
||||
// inv); return true;
|
||||
// case 7:
|
||||
// ThaumCraftRenderer.renderBlockBore(w, rb, i, j, k, block, md, inv);
|
||||
// return true;
|
||||
// case 8:
|
||||
// block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
// if (block.getRenderBlockPass() == 0 && !inv) {
|
||||
// rb.renderStandardBlock(block, i, j, k);
|
||||
// } else if (inv) {
|
||||
// ThaumCraftRenderer.DrawFaces(
|
||||
// rb, block, 97, 104, 103, 103, 103, 103, false
|
||||
// );
|
||||
// }
|
||||
|
||||
// return true;
|
||||
// case 9:
|
||||
// ThaumCraftRenderer.renderBlockVoidInterface(
|
||||
// w, rb, i, j, k, block, md, inv
|
||||
// );
|
||||
// return true;
|
||||
// case 10:
|
||||
// ThaumCraftRenderer.renderBlockTank(w, rb, i, j, k, block, md, inv);
|
||||
// return true;
|
||||
// case 11:
|
||||
// ThaumCraftRenderer.renderBlockSoulBrazier(w, rb, i, j, k, block, md,
|
||||
// inv); return true;
|
||||
// default:
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
||||
public static enum MetaVals {
|
||||
NORMAL_CRUCIBLE, // 0
|
||||
EYES_CRUCIBLE, // 1
|
||||
THAUMIUM_CRUCIBLE, // 2
|
||||
SOUL_CRUCIBLE, // 3
|
||||
ARCANE_FURNACE, // 4
|
||||
GENERATOR, // 5
|
||||
CRYSTALLIZER, // 6
|
||||
BORE, // 7
|
||||
VOID_CHEST, // 8
|
||||
VOID_INTERFACE, // 9
|
||||
TANK, // 10
|
||||
SOUL_BRAZIER; // 11
|
||||
|
||||
public static MetaVals get(int meta) {
|
||||
if (meta >= 0 && meta < MetaVals.values().length) {
|
||||
return MetaVals.values()[meta];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isCrucible() {
|
||||
return this == NORMAL_CRUCIBLE || this == EYES_CRUCIBLE
|
||||
|| this == THAUMIUM_CRUCIBLE || this == SOUL_CRUCIBLE;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package net.anvilcraft.thaummach.items;
|
||||
|
||||
import net.anvilcraft.thaummach.TMTab;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class ItemBlockApparatus extends ItemBlock {
|
||||
public ItemBlockApparatus(Block block) {
|
||||
super(block);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setCreativeTab(TMTab.INSTANCE);
|
||||
}
|
||||
|
||||
public abstract String getTypeString();
|
||||
public abstract String getNameExtension(int meta);
|
||||
|
||||
@Override
|
||||
public int getMetadata(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is) {
|
||||
String metaExt = this.getNameExtension(is.getItemDamage());
|
||||
if (metaExt == null)
|
||||
return "tile.thaummach:alec";
|
||||
return "tile.thaummach:apparatus_" + this.getTypeString() + "_" + metaExt;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package net.anvilcraft.thaummach.items;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile.MetaVals;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ItemBlockApparatusFragile extends ItemBlockApparatus {
|
||||
public ItemBlockApparatusFragile(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeString() {
|
||||
return "fragile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameExtension(int meta_) {
|
||||
MetaVals meta = MetaVals.get(meta_);
|
||||
if (meta == null)
|
||||
return null;
|
||||
return meta.toString().toLowerCase();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package net.anvilcraft.thaummach.items;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal.MetaVals;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ItemBlockApparatusMetal extends ItemBlockApparatus {
|
||||
public ItemBlockApparatusMetal(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeString() {
|
||||
return "metal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameExtension(int meta_) {
|
||||
MetaVals meta = MetaVals.get(meta_);
|
||||
if (meta == null)
|
||||
return null;
|
||||
return meta.toString().toLowerCase();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package net.anvilcraft.thaummach.render;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatus;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockApparatusRenderer implements ISimpleBlockRenderingHandler {
|
||||
public static int RI;
|
||||
|
||||
@Override
|
||||
public void
|
||||
renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
if (block instanceof BlockApparatus) {
|
||||
IApparatusRenderer ren
|
||||
= ((BlockApparatus) block).getApparatusRenderer(metadata);
|
||||
if (ren != null)
|
||||
ren.renderApparatus(null, renderer, 0, 0, 0, block, metadata, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block,
|
||||
int modelId,
|
||||
RenderBlocks renderer
|
||||
) {
|
||||
if (block instanceof BlockApparatus) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
IApparatusRenderer ren
|
||||
= ((BlockApparatus) block).getApparatusRenderer(meta);
|
||||
if (ren != null)
|
||||
ren.renderApparatus(world, renderer, x, y, z, block, meta, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return RI;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ApparatusRenderingHelper {
|
||||
public static void
|
||||
drawFaces(RenderBlocks renderblocks, Block block, IIcon i, boolean st) {
|
||||
drawFaces(renderblocks, block, i, i, i, i, i, i, st);
|
||||
}
|
||||
|
||||
public static void drawFaces(
|
||||
RenderBlocks renderblocks,
|
||||
Block block,
|
||||
IIcon i1,
|
||||
IIcon i2,
|
||||
IIcon i3,
|
||||
IIcon i4,
|
||||
IIcon i5,
|
||||
IIcon i6,
|
||||
boolean solidtop
|
||||
) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0, 0.0, 0.0, i1);
|
||||
tessellator.draw();
|
||||
if (solidtop) {
|
||||
GL11.glDisable(3008);
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0, 0.0, 0.0, i2);
|
||||
tessellator.draw();
|
||||
if (solidtop) {
|
||||
GL11.glEnable(3008);
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0, 0.0, 0.0, i3);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0, 0.0, 0.0, i4);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0, 0.0, 0.0, i5);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0, 0.0, 0.0, i6);
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
* IApparatusRenderer is an interface that provides an interface for rendering an
|
||||
* apparatus block.
|
||||
*
|
||||
* It is an attempt to debullshit azanor's rendering code.
|
||||
*/
|
||||
public interface IApparatusRenderer {
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block,
|
||||
int meta,
|
||||
boolean inv
|
||||
);
|
||||
}
|
|
@ -0,0 +1,320 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConduitApparatusRenderer implements IApparatusRenderer {
|
||||
public static ConduitApparatusRenderer INSTANCE = new ConduitApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w4 = 0.25F;
|
||||
float w6 = 0.375F;
|
||||
float wq = 0.38125F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (!inv) {
|
||||
TileConduit tc = (TileConduit) w.getTileEntity(x, y, z);
|
||||
float b = 0.0F;
|
||||
float total = 0.0F;
|
||||
float hfill = 0.0F;
|
||||
boolean visible = false;
|
||||
total = Math.min(tc.pureVis + tc.taintedVis, tc.maxVis);
|
||||
hfill = (1.0F - wq * 2.0F) * (total / tc.maxVis);
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
rb.overrideBlockTexture = block.iconConduit;
|
||||
rb.setRenderBounds(w6, w6, w6, w6 + w4, w6 + w4, w6 + w4);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
visible = tc.pureVis + tc.taintedVis >= 0.1F;
|
||||
if (visible) {
|
||||
b = Math.min(1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis));
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
rb.setRenderBounds(wq, wq, wq, 1.0F - wq, wq + hfill, 1.0F - wq);
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) x, (double) y, (double) z, block.iconTcubeanim
|
||||
);
|
||||
if (/*!Config.lowGfx && Config.pipedrips && */ Minecraft
|
||||
.getMinecraft()
|
||||
.theWorld.rand.nextInt(50)
|
||||
== 1
|
||||
&& w.isAirBlock(x, y - 1, z)
|
||||
&& tc.pureVis + tc.taintedVis > 3.5F) {
|
||||
// TODO: FXDrip
|
||||
//FXDrip obj = new FXDrip(
|
||||
// w,
|
||||
// (double) ((float) x + w6 + w.rand.nextFloat() * w4),
|
||||
// (double) ((float) y + w6 - 0.05F),
|
||||
// (double) ((float) z + w6 + w.rand.nextFloat() * w4)
|
||||
//);
|
||||
//obj.func_40097_b(
|
||||
// (0.4F + w.rand.nextFloat() * 0.2F) * (b + 0.1F),
|
||||
// 0.0F,
|
||||
// (0.8F + w.rand.nextFloat() * 0.2F) * (b + 0.1F)
|
||||
//);
|
||||
//ModLoader.getMinecraftInstance().effectRenderer.addEffect(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = block.iconConduitExtension;
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.getOrientation(dir);
|
||||
|
||||
TileEntity te = loc.getConnectableTile(w);
|
||||
if (te != null) {
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
switch (loc.facing.getOpposite().ordinal()) {
|
||||
case 0:
|
||||
rb.setRenderBounds(
|
||||
w6, w6 + w4, w6, w6 + w4, 1.0F, w6 + w4
|
||||
);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 1:
|
||||
rb.setRenderBounds(w6, 0.0F, w6, w6 + w4, w6, w6 + w4);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 2:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, w6 + w4, w6 + w4, w6 + w4, 1.0F
|
||||
);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 3:
|
||||
rb.setRenderBounds(w6, w6, 0.0F, w6 + w4, w6 + w4, w6);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 4:
|
||||
rb.setRenderBounds(
|
||||
w6 + w4, w6, w6, 1.0F, w6 + w4, w6 + w4
|
||||
);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 5:
|
||||
rb.setRenderBounds(0.0F, w6, w6, w6, w6 + w4, w6 + w4);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if (visible || !((IConnection) te).isVisConduit()) {
|
||||
rb.overrideBlockTexture = null;
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
renderConduitVis(
|
||||
w,
|
||||
rb,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
block,
|
||||
loc.facing.getOpposite().ordinal(),
|
||||
hfill
|
||||
);
|
||||
rb.overrideBlockTexture = block.iconConduitExtension;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rb.setRenderBounds(w6, 0.0F, w6, w6 + w4, 1.0F, w6 + w4);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, block.iconConduitInventory, false
|
||||
);
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static void renderConduitVis(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
BlockApparatusFragile block,
|
||||
int dir,
|
||||
float hfill
|
||||
) {
|
||||
float wq = 0.38125F;
|
||||
switch (dir) {
|
||||
case 0:
|
||||
rb.setRenderBounds(
|
||||
0.5F - hfill / 2.0F,
|
||||
wq + hfill,
|
||||
0.5F - hfill / 2.0F,
|
||||
0.5F + hfill / 2.0F,
|
||||
1.0F,
|
||||
0.5F + hfill / 2.0F
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
case 1:
|
||||
rb.setRenderBounds(
|
||||
0.5F - hfill / 2.0F,
|
||||
0.0F,
|
||||
0.5F - hfill / 2.0F,
|
||||
0.5F + hfill / 2.0F,
|
||||
wq,
|
||||
0.5F + hfill / 2.0F
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
rb.setRenderBounds(wq, wq, 1.0F - wq, 1.0F - wq, wq + hfill, 1.0F);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
rb.setRenderBounds(wq, wq, 0.0F, 1.0F - wq, wq + hfill, wq);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
case 4:
|
||||
rb.setRenderBounds(1.0F - wq, wq, wq, 1.0F, wq + hfill, 1.0F - wq);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
case 5:
|
||||
rb.setRenderBounds(0.0F, wq, wq, wq, wq + hfill, 1.0F - wq);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class ConduitPumpApparatusRenderer implements IApparatusRenderer {
|
||||
public static ConduitPumpApparatusRenderer INSTANCE
|
||||
= new ConduitPumpApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w4 = 0.25F;
|
||||
float w3 = 0.1875F;
|
||||
float w2 = 0.125F;
|
||||
if (inv) {
|
||||
rb.setRenderBounds(w2, 0.0F, w2, 1.0F - w2, w2, 1.0F - w2);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
false
|
||||
);
|
||||
rb.setRenderBounds(w3, w2, w3, 1.0F - w3, w4, 1.0F - w3);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
false
|
||||
);
|
||||
rb.setRenderBounds(0.0F, w4, 0.0F, 1.0F, 0.5F + w2, 1.0F);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
false
|
||||
);
|
||||
rb.setRenderBounds(w2, 0.5F + w2, w2, 1.0F - w2, 1.0F, 1.0F - w2);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpTop,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
block.iconConduitPumpSide,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConduitTankApparatusRenderer implements IApparatusRenderer {
|
||||
public static final ConduitTankApparatusRenderer INSTANCE
|
||||
= new ConduitTankApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int md,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w1;
|
||||
float w2;
|
||||
if (block.getRenderBlockPass() == 0 || inv) {
|
||||
w1 = 0.0625F;
|
||||
w2 = 0.125F;
|
||||
IIcon t1 = block.iconTankBottom;
|
||||
IIcon t2 = block.iconTankSide;
|
||||
// TODO: WTF
|
||||
//if (md != 3) {
|
||||
// t1 = 78;
|
||||
// t2 = 79;
|
||||
//}
|
||||
|
||||
rb.setRenderBounds(w1, 0.0F, w1, 1.0F - w1, 1.0F, 1.0F - w1);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, t1, t1, t2, t2, t2, t2, false
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
|
||||
if (!inv) {
|
||||
rb.overrideBlockTexture = block.iconTankBottom;
|
||||
TileConduitTank tc = (TileConduitTank) w.getTileEntity(i, j, k);
|
||||
HelperLocation loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
TileEntity te = loc.getConnectableTile(w);
|
||||
if (te != null && tc.getConnectable(loc.facing)
|
||||
&& !(te instanceof TileConduitTank)) {
|
||||
rb.setRenderBounds(
|
||||
0.0F, 0.5F - w2, 0.5F - w2, w1, 0.5F + w2, 0.5F + w2
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
|
||||
loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
te = loc.getConnectableTile(w);
|
||||
if (te != null && tc.getConnectable(loc.facing)
|
||||
&& !(te instanceof TileConduitTank)) {
|
||||
rb.setRenderBounds(
|
||||
1.0F - w1, 0.5F - w2, 0.5F - w2, 1.0F, 0.5F + w2, 0.5F + w2
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
|
||||
loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
te = loc.getConnectableTile(w);
|
||||
if (te != null && tc.getConnectable(loc.facing)
|
||||
&& !(te instanceof TileConduitTank)) {
|
||||
rb.setRenderBounds(
|
||||
0.5F - w2, 0.5F - w2, 0.0F, 0.5F + w2, 0.5F + w2, w1
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
|
||||
loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
te = loc.getConnectableTile(w);
|
||||
if (te != null && tc.getConnectable(loc.facing)
|
||||
&& !(te instanceof TileConduitTank)) {
|
||||
rb.setRenderBounds(
|
||||
0.5F - w2, 0.5F - w2, 1.0F - w1, 0.5F + w2, 0.5F + w2, 1.0F
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
|
||||
if (block.getRenderBlockPass() == 0 && !inv) {
|
||||
w1 = 0.003F;
|
||||
w2 = 0.0625F;
|
||||
TileConduitTank tc = (TileConduitTank) w.getTileEntity(i, j, k);
|
||||
if (tc != null && tc.pureVis + tc.taintedVis > 0.1F) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float hfill = (1.0F - w1 * 2.0F)
|
||||
* ((tc.pureVis + tc.taintedVis) / tc.getMaxVis());
|
||||
float b = Math.min(1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis));
|
||||
rb.setRenderBounds(
|
||||
w1 + w2, w1, w1 + w2, 1.0F - w1 - w2, w1 + hfill, 1.0F - w1 - w2
|
||||
);
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) j, (double) k, block.iconTcubeanim
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConduitValveAdvancedApparatusRenderer implements IApparatusRenderer {
|
||||
public static final ConduitValveAdvancedApparatusRenderer INSTANCE
|
||||
= new ConduitValveAdvancedApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w4 = 0.25F;
|
||||
float wq = 0.38125F;
|
||||
float w6 = 0.375F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (!inv) {
|
||||
TileConduitValveAdvanced tc
|
||||
= (TileConduitValveAdvanced) w.getTileEntity(i, j, k);
|
||||
float b = 0.0F;
|
||||
float total = 0.0F;
|
||||
float hfill = 0.0F;
|
||||
boolean visible = false;
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
switch (tc.setting) {
|
||||
case 0:
|
||||
rb.overrideBlockTexture = block.iconValveAdvancedOff;
|
||||
break;
|
||||
case 1:
|
||||
rb.overrideBlockTexture = block.iconValveAdvancedOnVis;
|
||||
break;
|
||||
case 2:
|
||||
rb.overrideBlockTexture = block.iconValveAdvancedOnTaint;
|
||||
}
|
||||
|
||||
rb.setRenderBounds(w4, w4, w4, 1.0F - w4, 1.0F - w4, 1.0F - w4);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
rb.overrideBlockTexture = block.iconConduitExtension;
|
||||
} else {
|
||||
visible = tc.pureVis + tc.taintedVis >= 0.1F;
|
||||
if (visible) {
|
||||
b = Math.min(
|
||||
1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis)
|
||||
);
|
||||
total = Math.min(tc.pureVis + tc.taintedVis, tc.maxVis);
|
||||
hfill = (1.0F - wq * 2.0F) * (total / tc.maxVis);
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
if (Minecraft.getMinecraft().theWorld.rand.nextInt(50) == 1
|
||||
&& w.isAirBlock(i, j - 1, k)
|
||||
&& tc.pureVis + tc.taintedVis > 3.5F) {
|
||||
// TODO: WTF
|
||||
//FXDrip obj = new FXDrip(
|
||||
// w,
|
||||
// (double) ((float) i + w4 + w.rand.nextFloat() * w6),
|
||||
// (double) ((float) j + w4 - 0.05F),
|
||||
// (double) ((float) k + w4 + w.rand.nextFloat() * w6)
|
||||
//);
|
||||
//obj.func_40097_b(
|
||||
// (0.4F + w.rand.nextFloat() * 0.2F) * (b + 0.1F),
|
||||
// 0.0F,
|
||||
// (0.8F + w.rand.nextFloat() * 0.2F) * (b + 0.1F)
|
||||
//);
|
||||
//ModLoader.getMinecraftInstance().effectRenderer.addEffect(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(tc);
|
||||
loc.facing = ForgeDirection.getOrientation(dir).getOpposite();
|
||||
|
||||
TileEntity te = loc.getConnectableTile(w);
|
||||
if (te != null) {
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
switch (dir) {
|
||||
case 0:
|
||||
rb.setRenderBounds(
|
||||
w6, 1.0F - w4, w6, 1.0F - w6, 1.0F, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 1:
|
||||
rb.setRenderBounds(
|
||||
w6, 0.0F, w6, 1.0F - w6, w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 2:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, 1.0F - w4, 1.0F - w6, 1.0F - w6, 1.0F
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 3:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, 0.0F, 1.0F - w6, 1.0F - w6, w4
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 4:
|
||||
rb.setRenderBounds(
|
||||
1.0F - w4, w6, w6, 1.0F, 1.0F - w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 5:
|
||||
rb.setRenderBounds(
|
||||
0.0F, w6, w6, w4, 1.0F - w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
} else if (visible && (((IConnection)te).getPureVis() + ((IConnection)te).getTaintedVis() > 0.1F || !((IConnection)te).isVisConduit())) {
|
||||
ConduitApparatusRenderer.renderConduitVis(
|
||||
w, rb, i, j, k, block, dir, hfill
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rb.setRenderBounds(w6, 0.0F, w6, 1.0F - w6, 1.0F, 1.0F - w6);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, block.iconConduitInventory, false
|
||||
);
|
||||
rb.setRenderBounds(w4, w4, w4, 1.0F - w4, 1.0F - w4, 1.0F - w4);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, block.iconValveAdvancedOff, false
|
||||
);
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitValve;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConduitValveApparatusRenderer implements IApparatusRenderer {
|
||||
public static final ConduitValveApparatusRenderer INSTANCE
|
||||
= new ConduitValveApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w4 = 0.25F;
|
||||
float wq = 0.38125F;
|
||||
float w6 = 0.375F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (!inv) {
|
||||
TileConduitValve tc = (TileConduitValve) w.getTileEntity(i, j, k);
|
||||
float b = Math.min(1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis));
|
||||
float total = 0.0F;
|
||||
float hfill = 0.0F;
|
||||
boolean visible = tc.pureVis + tc.taintedVis >= 0.1F;
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
if (tc.open) {
|
||||
rb.overrideBlockTexture = block.iconValveOn;
|
||||
} else {
|
||||
rb.overrideBlockTexture = block.iconValveOff;
|
||||
}
|
||||
|
||||
rb.setRenderBounds(w4, w4, w4, 1.0F - w4, 1.0F - w4, 1.0F - w4);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
rb.overrideBlockTexture = block.iconConduitExtension;
|
||||
} else {
|
||||
if (visible) {
|
||||
total = Math.min(tc.pureVis + tc.taintedVis, tc.maxVis);
|
||||
hfill = (1.0F - wq * 2.0F) * (total / tc.maxVis);
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
if (Minecraft.getMinecraft().theWorld.rand.nextInt(50) == 1
|
||||
&& w.isAirBlock(i, j - 1, k)
|
||||
&& tc.pureVis + tc.taintedVis > 3.5F) {
|
||||
// TODO: FXDrip
|
||||
//FXDrip obj = new FXDrip(
|
||||
// w,
|
||||
// (double) ((float) i + w4 + w.rand.nextFloat() * w6),
|
||||
// (double) ((float) j + w4 - 0.05F),
|
||||
// (double) ((float) k + w4 + w.rand.nextFloat() * w6)
|
||||
//);
|
||||
//obj.func_40097_b(
|
||||
// (0.4F + w.rand.nextFloat() * 0.2F) * (b + 0.1F),
|
||||
// 0.0F,
|
||||
// (0.8F + w.rand.nextFloat() * 0.2F) * (b + 0.1F)
|
||||
//);
|
||||
//ModLoader.getMinecraftInstance().effectRenderer.addEffect(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(tc);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
TileEntity te = loc.getConnectableTile(w);
|
||||
if (te != null) {
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
switch (dir) {
|
||||
case 0:
|
||||
rb.setRenderBounds(
|
||||
w6, 1.0F - w4, w6, 1.0F - w6, 1.0F, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 1:
|
||||
rb.setRenderBounds(
|
||||
w6, 0.0F, w6, 1.0F - w6, w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 2:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, 1.0F - w4, 1.0F - w6, 1.0F - w6, 1.0F
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 3:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, 0.0F, 1.0F - w6, 1.0F - w6, w4
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 4:
|
||||
rb.setRenderBounds(
|
||||
1.0F - w4, w6, w6, 1.0F, 1.0F - w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
break;
|
||||
case 5:
|
||||
rb.setRenderBounds(
|
||||
0.0F, w6, w6, w4, 1.0F - w6, 1.0F - w6
|
||||
);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
if (visible) {
|
||||
rb.overrideBlockTexture = null;
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
ConduitApparatusRenderer.renderConduitVis(
|
||||
w, rb, i, j, k, block, dir, hfill
|
||||
);
|
||||
rb.overrideBlockTexture = block.iconConduitExtension;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rb.setRenderBounds(w6, 0.0F, w6, 1.0F - w6, 1.0F, 1.0F - w6);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, block.iconConduitInventory, false
|
||||
);
|
||||
rb.setRenderBounds(w4, w4, w4, 1.0F - w4, 1.0F - w4, 1.0F - w4);
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconValveOn, false);
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduit;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FilterApparatusRenderer implements IApparatusRenderer {
|
||||
public static final FilterApparatusRenderer INSTANCE = new FilterApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
float w4 = 0.25F;
|
||||
float w3 = 0.1875F;
|
||||
float w2 = 0.125F;
|
||||
if (block.getRenderBlockPass() == 0 || inv) {
|
||||
rb.setRenderBounds(w2, 0.0F, w2, 1.0F - w2, w3, 1.0F - w2);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(w2, 1.0F - w3, w2, 1.0F - w2, 1.0F, 1.0F - w2);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(w3, w3, w3, 1.0F - w3, 1.0F - w3, 1.0F - w3);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterBottom,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
block.iconFilterSide,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (!inv) {
|
||||
float w6 = 0.375F;
|
||||
float wq = 0.38125F;
|
||||
TileConduit tc = (TileConduit) w.getTileEntity(x, y, z);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float b = 0.0F;
|
||||
float total = 0.0F;
|
||||
float hfill = 0.0F;
|
||||
boolean visible = false;
|
||||
if (block.getRenderBlockPass() != 0) {
|
||||
visible = tc.pureVis + tc.taintedVis >= 0.1F;
|
||||
if (visible) {
|
||||
b = Math.min(
|
||||
1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis)
|
||||
);
|
||||
total = Math.min(tc.pureVis + tc.taintedVis, tc.maxVis);
|
||||
hfill = (1.0F - wq * 2.0F) * (total / tc.maxVis);
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
for (int dir = 2; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(tc);
|
||||
switch (dir) {
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
TileEntity te = loc.getConnectableTile(w);
|
||||
if (te != null && tc.getConnectable(loc.facing)) {
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
rb.overrideBlockTexture = block.iconConduitConnection;
|
||||
switch (dir) {
|
||||
case 2:
|
||||
rb.setRenderBounds(
|
||||
w6, w6, 1.0F - w3, w6 + w4, w6 + w4, 1.0F
|
||||
);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 3:
|
||||
rb.setRenderBounds(w6, w6, 0.0F, w6 + w4, w6 + w4, w3);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 4:
|
||||
rb.setRenderBounds(
|
||||
1.0F - w3, w6, w6, 1.0F, w6 + w4, w6 + w4
|
||||
);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
break;
|
||||
case 5:
|
||||
rb.setRenderBounds(0.0F, w6, w6, w3, w6 + w4, w6 + w4);
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
} else if (visible && (((IConnection)te).getPureVis() + ((IConnection)te).getTaintedVis() > 0.1F || !((IConnection)te).isVisConduit())) {
|
||||
ConduitApparatusRenderer.renderConduitVis(
|
||||
w, rb, x, y, z, block, dir, hfill
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.fragile;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class PurifierApparatusRenderer implements IApparatusRenderer {
|
||||
public static PurifierApparatusRenderer INSTANCE = new PurifierApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusFragile block = (BlockApparatusFragile) block_;
|
||||
if (block.getRenderBlockPass() == 0 || inv) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconPurifierTop,
|
||||
block.iconPurifierTop,
|
||||
block.iconPurifierFront,
|
||||
block.iconPurifierFront,
|
||||
block.iconPurifierSide,
|
||||
block.iconPurifierSide,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.metal;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class ArcaneFurnaceApparatusRenderer implements IApparatusRenderer {
|
||||
public static ArcaneFurnaceApparatusRenderer INSTANCE
|
||||
= new ArcaneFurnaceApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusMetal block = (BlockApparatusMetal) block_;
|
||||
if (block.getRenderBlockPass() == 0 && !inv) {
|
||||
float w3 = 0.1875F;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
rb.renderFaceYPos(
|
||||
block,
|
||||
(double) i,
|
||||
(double) ((float) j - 1.0F + w3),
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceXPos(
|
||||
block,
|
||||
(double) ((float) (i - 1) + w3),
|
||||
(double) j,
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block,
|
||||
(double) ((float) (i + 1) - w3),
|
||||
(double) j,
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block,
|
||||
(double) i,
|
||||
(double) j,
|
||||
(double) ((float) (k - 1) + w3),
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block,
|
||||
(double) i,
|
||||
(double) j,
|
||||
(double) ((float) (k + 1) - w3),
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
} else if (inv) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconArcaneFurnaceBottom,
|
||||
block.iconArcaneFurnaceTop,
|
||||
block.iconArcaneFurnaceSide,
|
||||
block.iconArcaneFurnaceSide,
|
||||
block.iconArcaneFurnaceSide,
|
||||
block.iconArcaneFurnaceSide,
|
||||
true
|
||||
);
|
||||
rb.setRenderBounds(0.1F, 0.1F, 0.1F, 0.9F, 0.99F, 0.9F);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb, block, block.iconArcaneFurnaceInside, false
|
||||
);
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,186 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.metal;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal.MetaVals;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class CrucibleApparatusRenderer implements IApparatusRenderer {
|
||||
public static CrucibleApparatusRenderer INSTANCE = new CrucibleApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusMetal block = (BlockApparatusMetal) block_;
|
||||
MetaVals md = MetaVals.get(meta);
|
||||
IIcon[] icons = getIcons(block, md);
|
||||
if (block.getRenderBlockPass() == 0 && !inv) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
} else if (inv &&
|
||||
(md == MetaVals.NORMAL_CRUCIBLE
|
||||
|| md == MetaVals.EYES_CRUCIBLE
|
||||
|| md == MetaVals.THAUMIUM_CRUCIBLE)
|
||||
) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
icons[3],
|
||||
icons[6],
|
||||
icons[5],
|
||||
icons[5],
|
||||
icons[5],
|
||||
icons[5],
|
||||
true
|
||||
);
|
||||
} else if (inv && md == MetaVals.SOUL_CRUCIBLE) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconSoulCrucibleBottom,
|
||||
block.iconSoulCrucibleTopInv,
|
||||
block.iconSoulCrucibleFace3,
|
||||
block.iconSoulCrucibleFace3,
|
||||
block.iconSoulCrucibleFace3,
|
||||
block.iconSoulCrucibleFace3,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (!inv)
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(w, i, j, k));
|
||||
float f = 1.0F;
|
||||
int l = block.colorMultiplier(w, i, j, k);
|
||||
float f1 = (float) (l >> 16 & 255) / 255.0F;
|
||||
float f2 = (float) (l >> 8 & 255) / 255.0F;
|
||||
float f3 = (float) (l & 255) / 255.0F;
|
||||
float f5;
|
||||
if (EntityRenderer.anaglyphEnable) {
|
||||
float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
|
||||
float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
|
||||
f5 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
|
||||
f1 = f6;
|
||||
f2 = f4;
|
||||
f3 = f5;
|
||||
}
|
||||
|
||||
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
|
||||
IIcon c = md != MetaVals.SOUL_CRUCIBLE ? icons[2] : block.iconSoulCrucibleFace3;
|
||||
IIcon c1 = md != MetaVals.SOUL_CRUCIBLE ? icons[1] : block.iconSoulCrucibleBottom;
|
||||
|
||||
f5 = 0.123F;
|
||||
if (!inv) {
|
||||
if (block.getRenderBlockPass() == 0) {
|
||||
rb.renderFaceXPos(
|
||||
block, (double) ((float) i - 1.0F + f5), (double) j, (double) k, c
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block, (double) ((float) i + 1.0F - f5), (double) j, (double) k, c
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block, (double) i, (double) j, (double) ((float) k - 1.0F + f5), c
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block, (double) i, (double) j, (double) ((float) k + 1.0F - f5), c
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block, (double) i, (double) ((float) j - 1.0F + 0.25F), (double) k,
|
||||
c1
|
||||
);
|
||||
rb.renderFaceYNeg(
|
||||
block, (double) i, (double) ((float) j + 1.0F - 0.75F), (double) k,
|
||||
c1
|
||||
);
|
||||
|
||||
} else if (block.getRenderBlockPass() == 1) {
|
||||
TileCrucible tc = (TileCrucible) w.getTileEntity(i, j, k);
|
||||
float tvis = tc.pureVis + tc.taintedVis;
|
||||
if (tvis > 0.1F) {
|
||||
float h = Math.min(tvis, tc.maxVis);
|
||||
float level = 0.75F * (h / tc.maxVis);
|
||||
if (tc.maxVis == tvis) {
|
||||
level = (float) ((double) level - 0.001);
|
||||
}
|
||||
|
||||
float b = Math.min(1.0F, tc.pureVis / (tc.taintedVis + tc.pureVis));
|
||||
tessellator.setBrightness(20 + (int) (b * 210.0F));
|
||||
rb.renderFaceYPos(
|
||||
block,
|
||||
(double) i,
|
||||
(double) ((float) j + 0.25F + level - 1.0F),
|
||||
(double) k,
|
||||
block.iconTcubeanim
|
||||
);
|
||||
if (tvis > tc.maxVis) {
|
||||
// TODO: WTF
|
||||
//rb.renderSouthFace(
|
||||
// block,
|
||||
// (double) i,
|
||||
// (double) j,
|
||||
// (double) k,
|
||||
// mod_ThaumCraft.visDripFX
|
||||
//);
|
||||
//rb.renderNorthFace(
|
||||
// block,
|
||||
// (double) i,
|
||||
// (double) j,
|
||||
// (double) k,
|
||||
// mod_ThaumCraft.visDripFX
|
||||
//);
|
||||
//rb.renderWestFace(
|
||||
// block,
|
||||
// (double) i,
|
||||
// (double) j,
|
||||
// (double) k,
|
||||
// mod_ThaumCraft.visDripFX
|
||||
//);
|
||||
//rb.renderEastFace(
|
||||
// block,
|
||||
// (double) i,
|
||||
// (double) j,
|
||||
// (double) k,
|
||||
// mod_ThaumCraft.visDripFX
|
||||
//);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static IIcon[] getIcons(BlockApparatusMetal block, MetaVals meta) {
|
||||
switch (meta) {
|
||||
case NORMAL_CRUCIBLE:
|
||||
return block.iconsNormalCrucible;
|
||||
|
||||
case EYES_CRUCIBLE:
|
||||
return block.iconsEyesCrucible;
|
||||
|
||||
case THAUMIUM_CRUCIBLE:
|
||||
return block.iconsThaumiumCrucible;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.metal;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class CrystallizerApparatusRenderer implements IApparatusRenderer {
|
||||
public static CrystallizerApparatusRenderer INSTANCE
|
||||
= new CrystallizerApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int i,
|
||||
int j,
|
||||
int k,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusMetal block = (BlockApparatusMetal) block_;
|
||||
float w2 = 0.125F;
|
||||
if (block.getRenderBlockPass() == 0 || inv) {
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F + w2, 1.0F);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(
|
||||
rb,
|
||||
block,
|
||||
block.iconCrystallizerBottom,
|
||||
block.iconCrystallizerTop,
|
||||
block.iconCrystallizerSide,
|
||||
block.iconCrystallizerSide,
|
||||
block.iconCrystallizerSide,
|
||||
block.iconCrystallizerSide,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, i, j, k);
|
||||
}
|
||||
|
||||
if (!inv) {
|
||||
float w3 = 0.1875F;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F + w2, 1.0F);
|
||||
rb.renderFaceXPos(
|
||||
block,
|
||||
(double) ((float) (i - 1) + w3),
|
||||
(double) j,
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceXNeg(
|
||||
block,
|
||||
(double) ((float) (i + 1) - w3),
|
||||
(double) j,
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceZPos(
|
||||
block,
|
||||
(double) i,
|
||||
(double) j,
|
||||
(double) ((float) (k - 1) + w3),
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceZNeg(
|
||||
block,
|
||||
(double) i,
|
||||
(double) j,
|
||||
(double) ((float) (k + 1) - w3),
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
rb.renderFaceYPos(
|
||||
block,
|
||||
(double) i,
|
||||
(double) ((float) j - 0.49F),
|
||||
(double) k,
|
||||
block.iconArcaneFurnaceInside
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package net.anvilcraft.thaummach.render.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelPump extends ModelBase {
|
||||
public ModelRenderer front;
|
||||
public ModelRenderer moveBase;
|
||||
public ModelRenderer moveFrill;
|
||||
public ModelRenderer center;
|
||||
public ModelRenderer back;
|
||||
|
||||
public ModelPump() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 64;
|
||||
this.front = new ModelRenderer(this, 0, 0);
|
||||
this.front.addBox(0.0F, 0.0F, 0.0F, 12, 6, 12);
|
||||
this.front.setRotationPoint(-6.0F, 18.0F, -6.0F);
|
||||
this.front.setTextureSize(128, 64);
|
||||
this.front.mirror = true;
|
||||
this.setRotation(this.front, 0.0F, 0.0F, 0.0F);
|
||||
this.moveBase = new ModelRenderer(this, 0, 18);
|
||||
this.moveBase.addBox(0.0F, 0.0F, 0.0F, 12, 2, 12);
|
||||
this.moveBase.setRotationPoint(-6.0F, 8.0F, -6.0F);
|
||||
this.moveBase.setTextureSize(128, 64);
|
||||
this.moveBase.mirror = true;
|
||||
this.setRotation(this.moveBase, 0.0F, 0.0F, 0.0F);
|
||||
this.moveFrill = new ModelRenderer(this, 0, 32);
|
||||
this.moveFrill.addBox(0.0F, 0.0F, 0.0F, 10, 4, 10);
|
||||
this.moveFrill.setRotationPoint(-5.0F, 10.0F, -5.0F);
|
||||
this.moveFrill.setTextureSize(128, 64);
|
||||
this.moveFrill.mirror = true;
|
||||
this.setRotation(this.moveFrill, 0.0F, 0.0F, 0.0F);
|
||||
this.center = new ModelRenderer(this, 48, 0);
|
||||
this.center.addBox(0.0F, 0.0F, 0.0F, 16, 4, 16);
|
||||
this.center.setRotationPoint(-8.0F, 14.0F, -8.0F);
|
||||
this.center.setTextureSize(128, 64);
|
||||
this.center.mirror = true;
|
||||
this.setRotation(this.center, 0.0F, 0.0F, 0.0F);
|
||||
this.back = new ModelRenderer(this, 0, 46);
|
||||
this.back.addBox(0.0F, 0.0F, 0.0F, 6, 6, 6);
|
||||
this.back.setRotationPoint(-3.0F, 8.0F, -3.0F);
|
||||
this.back.setTextureSize(128, 64);
|
||||
this.back.mirror = true;
|
||||
this.setRotation(this.back, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.front.render(f5);
|
||||
this.moveBase.render(f5);
|
||||
this.moveFrill.render(f5);
|
||||
this.center.render(f5);
|
||||
this.back.render(f5);
|
||||
}
|
||||
|
||||
public void render() {
|
||||
this.front.render(0.0625F);
|
||||
this.center.render(0.0625F);
|
||||
this.back.render(0.0625F);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package net.anvilcraft.thaummach.render.tile;
|
||||
|
||||
import net.anvilcraft.thaummach.render.model.ModelPump;
|
||||
import net.anvilcraft.thaummach.tiles.TileConduitPump;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TileConduitPumpRenderer extends TileEntitySpecialRenderer {
|
||||
private ModelPump model = new ModelPump();
|
||||
|
||||
private void translateFromOrientation(double x, double y, double z, int orientation) {
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
|
||||
if (orientation != 0) {
|
||||
if (orientation == 1) {
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
} else if (orientation == 2) {
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
} else if (orientation == 3) {
|
||||
GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
|
||||
} else if (orientation == 4) {
|
||||
GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
|
||||
} else if (orientation == 5) {
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void
|
||||
renderEntityAt(TileConduitPump pump, double x, double y, double z, float fq) {
|
||||
int count = Minecraft.getMinecraft().thePlayer.ticksExisted;
|
||||
float bob = 1.0F;
|
||||
if (!pump.gettingPower()) {
|
||||
bob = Math.abs(MathHelper.sin((float) count / 10.0F) * 1.0F);
|
||||
}
|
||||
|
||||
this.bindTexture(
|
||||
new ResourceLocation("thaummach", "textures/models/conduit_pump.png")
|
||||
);
|
||||
GL11.glEnable(2977);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(32826);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.translateFromOrientation(
|
||||
(double) ((float) x),
|
||||
(double) ((float) y),
|
||||
(double) ((float) z),
|
||||
pump.orientation
|
||||
);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 0.251F - bob / 4.0F, 0.0F);
|
||||
this.model.moveBase.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glTranslatef(0.0F, 0.875F, 0.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.0F, bob, 1.0F);
|
||||
this.model.moveFrill.setRotationPoint(-5.0F, 0.0F, -5.0F);
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
this.model.moveFrill.render(0.0625F);
|
||||
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
this.model.render();
|
||||
GL11.glDisable(32826);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(3042);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public void
|
||||
renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) {
|
||||
this.renderEntityAt((TileConduitPump) tileentity, d, d1, d2, f);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,490 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import dev.tilera.auracore.api.machine.TileVisUser;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class TileArcaneFurnace extends TileVisUser implements ISidedInventory {
|
||||
private ItemStack[] furnaceItemStacks = new ItemStack[19];
|
||||
public int furnaceBurnTime = 0;
|
||||
public int currentItemBurnTime = 0;
|
||||
public int furnaceCookTime = 0;
|
||||
public int furnaceMaxCookTime = 180;
|
||||
public int bellows = 0;
|
||||
public float vis;
|
||||
public boolean boost;
|
||||
|
||||
// TODO: GUIs
|
||||
//public GuiScreen getGui(EntityPlayer player) {
|
||||
// return new GuiArcaneFurnace(player.inventory, this);
|
||||
//}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return this.furnaceItemStacks.length;
|
||||
}
|
||||
|
||||
//@Override
|
||||
//public int getStartInventorySide(int side) {
|
||||
// if (side == 0) {
|
||||
// return 18;
|
||||
// } else {
|
||||
// return side == 1 ? 0 : 9;
|
||||
// }
|
||||
//}
|
||||
|
||||
//@Override
|
||||
//public int getSizeInventorySide(int side) {
|
||||
// return side == 0 ? 1 : 9;
|
||||
//}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return this.furnaceItemStacks[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (this.furnaceItemStacks[i] != null) {
|
||||
ItemStack itemstack1;
|
||||
if (this.furnaceItemStacks[i].stackSize <= j) {
|
||||
itemstack1 = this.furnaceItemStacks[i];
|
||||
this.furnaceItemStacks[i] = null;
|
||||
return itemstack1;
|
||||
} else {
|
||||
itemstack1 = this.furnaceItemStacks[i].splitStack(j);
|
||||
if (this.furnaceItemStacks[i].stackSize == 0) {
|
||||
this.furnaceItemStacks[i] = null;
|
||||
}
|
||||
|
||||
return itemstack1;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
this.furnaceItemStacks[i] = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) {
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10);
|
||||
this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1
|
||||
= (NBTTagCompound) nbttaglist.getCompoundTagAt(i);
|
||||
byte byte0 = nbttagcompound1.getByte("Slot");
|
||||
if (byte0 >= 0 && byte0 < this.furnaceItemStacks.length) {
|
||||
this.furnaceItemStacks[byte0]
|
||||
= ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.furnaceBurnTime = nbttagcompound.getShort("BurnTime");
|
||||
this.currentItemBurnTime = nbttagcompound.getShort("MaxBurnTime");
|
||||
this.furnaceCookTime = nbttagcompound.getShort("CookTime");
|
||||
this.furnaceMaxCookTime = nbttagcompound.getShort("MaxCookTime");
|
||||
this.bellows = nbttagcompound.getShort("bellows");
|
||||
this.boost = nbttagcompound.getBoolean("boost");
|
||||
this.vis = nbttagcompound.getFloat("vis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("BurnTime", (short) this.furnaceBurnTime);
|
||||
nbttagcompound.setShort("CookTime", (short) this.furnaceCookTime);
|
||||
nbttagcompound.setShort("MaxBurnTime", (short) this.currentItemBurnTime);
|
||||
nbttagcompound.setShort("MaxCookTime", (short) this.furnaceMaxCookTime);
|
||||
nbttagcompound.setShort("bellows", (short) this.bellows);
|
||||
nbttagcompound.setBoolean("boost", this.boost);
|
||||
nbttagcompound.setFloat("vis", this.vis);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.furnaceItemStacks.length; ++i) {
|
||||
if (this.furnaceItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.furnaceItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
nbttagcompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
public int getCookProgressScaled(int i) {
|
||||
return this.furnaceCookTime * i / this.furnaceMaxCookTime;
|
||||
}
|
||||
|
||||
public int getBurnTimeRemainingScaled(int i) {
|
||||
int bt = this.currentItemBurnTime;
|
||||
if (bt == 0) {
|
||||
bt = 200;
|
||||
}
|
||||
|
||||
return this.furnaceBurnTime * i / bt;
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.furnaceBurnTime > 0
|
||||
//&& !super.worldObj.isBlockGettingPowered(
|
||||
// super.xCoord, super.yCoord, super.zCoord
|
||||
//)
|
||||
&& !super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
public boolean isWorking() {
|
||||
return this.furnaceBurnTime > 0
|
||||
&& (this.furnaceCookTime > 0 || this.belowHeatableTile())
|
||||
//&& !super.worldObj.isBlockGettingPowered(
|
||||
// super.xCoord, super.yCoord, super.zCoord
|
||||
//)
|
||||
&& !super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
public boolean belowHeatableTile() {
|
||||
TileEntity te
|
||||
= super.worldObj.getTileEntity(super.xCoord, super.yCoord + 1, super.zCoord);
|
||||
return te != null && te instanceof TileCrucible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
boolean flag = this.furnaceBurnTime > 0;
|
||||
boolean flag1 = false;
|
||||
this.setSuction(0);
|
||||
if (!super.worldObj.isRemote && this.vis < this.getMaxVis()) {
|
||||
this.vis += this.getAvailablePureVis(this.getMaxVis() - this.vis);
|
||||
}
|
||||
|
||||
if (!super.worldObj.isRemote
|
||||
//&& !super.worldObj.isBlockGettingPowered(
|
||||
// super.xCoord, super.yCoord, super.zCoord
|
||||
//)
|
||||
&& !super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
)) {
|
||||
if (this.furnaceBurnTime > 0
|
||||
&& (this.furnaceCookTime > 0 || this.belowHeatableTile())) {
|
||||
--this.furnaceBurnTime;
|
||||
}
|
||||
|
||||
if (this.furnaceBurnTime <= 0
|
||||
&& (this.canSmelt() || this.belowHeatableTile())) {
|
||||
this.currentItemBurnTime = this.furnaceBurnTime
|
||||
= getItemBurnTime(this.furnaceItemStacks[18]);
|
||||
if (this.furnaceBurnTime > 0) {
|
||||
if (this.vis >= (float) this.currentItemBurnTime / 1600.0F) {
|
||||
this.vis -= (float) this.currentItemBurnTime / 1600.0F;
|
||||
this.currentItemBurnTime
|
||||
= (int) ((float) this.currentItemBurnTime * 1.25F);
|
||||
this.furnaceBurnTime
|
||||
= (int) ((float) this.furnaceBurnTime * 1.25F);
|
||||
}
|
||||
|
||||
flag1 = true;
|
||||
if (this.furnaceItemStacks[18] != null) {
|
||||
if (this.vis >= 0.25F) {
|
||||
this.vis -= 0.25F;
|
||||
this.furnaceMaxCookTime = 100;
|
||||
this.boost = true;
|
||||
} else {
|
||||
this.furnaceMaxCookTime = 180;
|
||||
this.boost = false;
|
||||
}
|
||||
|
||||
this.furnaceMaxCookTime = (int
|
||||
) ((float) this.furnaceMaxCookTime
|
||||
* (1.0F - (float) this.bellows * 0.1F));
|
||||
this.worldObj.markBlockForUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
super.worldObj.updateLightByType(
|
||||
EnumSkyBlock.Block, super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
// TODO: WTF
|
||||
//if (this.furnaceItemStacks[18].getItem().func_46056_k()) {
|
||||
// this.furnaceItemStacks[18] = new ItemStack(
|
||||
// this.furnaceItemStacks[18].getItem().setFull3D()
|
||||
// );
|
||||
//} else {
|
||||
--this.furnaceItemStacks[18].stackSize;
|
||||
//}
|
||||
|
||||
if (this.furnaceItemStacks[18].stackSize == 0) {
|
||||
this.furnaceItemStacks[18] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isBurning() && this.canSmelt()) {
|
||||
++this.furnaceCookTime;
|
||||
if (this.furnaceCookTime >= this.furnaceMaxCookTime) {
|
||||
this.furnaceCookTime = 0;
|
||||
if (this.vis >= 0.25F) {
|
||||
this.vis -= 0.25F;
|
||||
this.furnaceMaxCookTime = 100;
|
||||
this.boost = true;
|
||||
} else {
|
||||
this.furnaceMaxCookTime = 180;
|
||||
this.boost = false;
|
||||
}
|
||||
|
||||
this.furnaceMaxCookTime = (int
|
||||
) ((float) this.furnaceMaxCookTime
|
||||
* (1.0F - (float) this.bellows * 0.2F));
|
||||
this.smeltItem();
|
||||
this.worldObj.markBlockForUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
super.worldObj.updateLightByType(
|
||||
EnumSkyBlock.Block, super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
flag1 = true;
|
||||
}
|
||||
} else {
|
||||
this.furnaceCookTime = 0;
|
||||
}
|
||||
|
||||
if (flag != this.furnaceBurnTime > 0) {
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1) {
|
||||
// TODO: WTF
|
||||
//this.onInventoryChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canSmelt(int slotIn, int slotOut) {
|
||||
if (this.furnaceItemStacks[slotIn] == null) {
|
||||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(
|
||||
this.furnaceItemStacks[slotIn]
|
||||
);
|
||||
if (itemstack == null) {
|
||||
return false;
|
||||
} else if (this.furnaceItemStacks[slotOut] == null) {
|
||||
return true;
|
||||
} else if (!this.furnaceItemStacks[slotOut].isItemEqual(itemstack)) {
|
||||
return false;
|
||||
} else {
|
||||
int result
|
||||
= this.furnaceItemStacks[slotOut].stackSize + itemstack.stackSize;
|
||||
return result <= this.getInventoryStackLimit()
|
||||
&& result <= itemstack.getMaxStackSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canSmelt() {
|
||||
for (int input = 9; input < 18; ++input) {
|
||||
for (int output = 0; output < 9; ++output) {
|
||||
if (this.canSmelt(input, output)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void smeltItem() {
|
||||
for (int input = 9; input < 18; ++input) {
|
||||
for (int output = 0; output < 9; ++output) {
|
||||
boolean smelted = false;
|
||||
|
||||
boolean tryAgain;
|
||||
do {
|
||||
tryAgain = false;
|
||||
if (this.canSmelt(input, output)) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(
|
||||
this.furnaceItemStacks[input]
|
||||
);
|
||||
if (this.furnaceItemStacks[output] != null
|
||||
&& this.furnaceItemStacks[output].isItemEqual(itemstack)
|
||||
&& this.furnaceItemStacks[output].getItemDamage()
|
||||
== itemstack.getItemDamage()) {
|
||||
ItemStack var10000 = this.furnaceItemStacks[output];
|
||||
var10000.stackSize += itemstack.stackSize;
|
||||
smelted = true;
|
||||
} else if (this.furnaceItemStacks[output] == null) {
|
||||
this.furnaceItemStacks[output] = itemstack.copy();
|
||||
smelted = true;
|
||||
}
|
||||
|
||||
if (smelted
|
||||
&& super.worldObj.rand.nextInt(90) < 5 + this.bellows * 7
|
||||
&& this.vis >= 0.5F) {
|
||||
this.vis -= 0.5F;
|
||||
tryAgain = true;
|
||||
AuraManager.addFluxToClosest(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new AspectList().add(Aspect.FIRE, 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
} while (tryAgain);
|
||||
|
||||
if (smelted) {
|
||||
// TODO: WTF
|
||||
//if (this.furnaceItemStacks[input].getItem().func_46056_k()) {
|
||||
// this.furnaceItemStacks[input] = new ItemStack(
|
||||
// this.furnaceItemStacks[input].getItem().setFull3D()
|
||||
// );
|
||||
//} else {
|
||||
--this.furnaceItemStacks[input].stackSize;
|
||||
//}
|
||||
|
||||
if (this.furnaceItemStacks[input].stackSize <= 0) {
|
||||
this.furnaceItemStacks[input] = null;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getItemBurnTime(ItemStack par1ItemStack) {
|
||||
return TileEntityFurnace.getItemBurnTime(par1ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
if (super.worldObj.getTileEntity(super.xCoord, super.yCoord, super.zCoord)
|
||||
!= this) {
|
||||
return false;
|
||||
} else {
|
||||
return entityplayer.getDistanceSq(
|
||||
(double) super.xCoord + 0.5,
|
||||
(double) super.yCoord + 0.5,
|
||||
(double) super.zCoord + 0.5
|
||||
)
|
||||
<= 64.0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
switch (face) {
|
||||
case DOWN:
|
||||
case EAST:
|
||||
case SOUTH:
|
||||
case WEST:
|
||||
case NORTH:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int var1) {
|
||||
if (this.furnaceItemStacks[var1] != null) {
|
||||
ItemStack var2 = this.furnaceItemStacks[var1];
|
||||
this.furnaceItemStacks[var1] = null;
|
||||
return var2;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPureVis() {
|
||||
return this.vis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxVis() {
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "thaummach:arcane_furnace";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack is) {
|
||||
if (slot >= 9 && slot <= 17)
|
||||
return false;
|
||||
|
||||
if (slot == 18)
|
||||
return getItemBurnTime(is) > 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
if (side == 0)
|
||||
return new int[] { 18 };
|
||||
|
||||
if (side == 1)
|
||||
return IntStream.rangeClosed(0, 8).toArray();
|
||||
|
||||
return IntStream.rangeClosed(9, 17).toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean
|
||||
canInsertItem(int slot, ItemStack is, int side) {
|
||||
return this.isItemValidForSlot(slot, is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean
|
||||
canExtractItem(int slot, ItemStack is, int side) {
|
||||
return slot >= 9 && slot <= 17;
|
||||
}
|
||||
}
|
|
@ -3,250 +3,280 @@ package net.anvilcraft.thaummach.tiles;
|
|||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileConduit extends TileEntity implements IConnection {
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
public float maxVis = 4.0F;
|
||||
float fillAmount = 4.0F;
|
||||
public float displayPure;
|
||||
public float displayTaint;
|
||||
public float prevdisplayPure;
|
||||
public float prevdisplayTaint;
|
||||
public int visSuction = 0;
|
||||
public int taintSuction = 0;
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
public float maxVis = 4.0F;
|
||||
float fillAmount = 4.0F;
|
||||
public float prevPure;
|
||||
public float prevTaint;
|
||||
public int visSuction = 0;
|
||||
public int taintSuction = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (this.prevdisplayPure != this.displayPure || this.prevdisplayTaint != this.displayTaint) {
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
this.prevdisplayPure = this.displayPure;
|
||||
this.prevdisplayTaint = this.displayTaint;
|
||||
}
|
||||
|
||||
this.calculateSuction();
|
||||
if (this.getSuction((HelperLocation)null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
this.displayTaint = Math.max(this.displayTaint, MathHelper.clamp_float(this.taintedVis, 0.0F, this.maxVis));
|
||||
this.displayPure = Math.max(this.displayPure, MathHelper.clamp_float(this.pureVis, 0.0F, this.maxVis));
|
||||
if (this.displayTaint + this.displayPure < 0.1F) {
|
||||
this.displayTaint = 0.0F;
|
||||
this.displayPure = 0.0F;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void calculateSuction() {
|
||||
this.setSuction(0);
|
||||
|
||||
for(int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ic = (IConnection)te;
|
||||
if (this.getVisSuction((HelperLocation)null) < ic.getVisSuction(new HelperLocation(this)) - 1) {
|
||||
this.setVisSuction(ic.getVisSuction(new HelperLocation(this)) - 1);
|
||||
}
|
||||
|
||||
if (this.getTaintSuction((HelperLocation)null) < ic.getTaintSuction(new HelperLocation(this)) - 1) {
|
||||
this.setTaintSuction(ic.getTaintSuction(new HelperLocation(this)) - 1);
|
||||
}
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
this.calculateSuction();
|
||||
if (this.getSuction(null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void equalizeWithNeighbours() {
|
||||
for(int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ent = (IConnection)te;
|
||||
if (this.pureVis + this.taintedVis < this.maxVis && (this.getVisSuction((HelperLocation)null) > ent.getVisSuction(new HelperLocation(this)) || this.getTaintSuction((HelperLocation)null) > ent.getTaintSuction(new HelperLocation(this)))) {
|
||||
float qq = Math.min((ent.getPureVis() + ent.getTaintedVis()) / 4.0F, this.fillAmount);
|
||||
float[] results = ent.subtractVis(Math.min(qq, this.maxVis - (this.pureVis + this.taintedVis)));
|
||||
if (this.getVisSuction((HelperLocation)null) > ent.getVisSuction(new HelperLocation(this))) {
|
||||
this.pureVis += results[0];
|
||||
} else {
|
||||
ent.setPureVis(results[0] + ent.getPureVis());
|
||||
}
|
||||
|
||||
if (this.getTaintSuction((HelperLocation)null) > ent.getTaintSuction(new HelperLocation(this))) {
|
||||
this.taintedVis += results[1];
|
||||
} else {
|
||||
ent.setTaintedVis(results[1] + ent.getTaintedVis());
|
||||
}
|
||||
}
|
||||
if (this.prevPure != this.pureVis || this.prevTaint != this.taintedVis) {
|
||||
super.worldObj.markBlockForUpdate(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
this.prevPure = this.pureVis;
|
||||
this.prevTaint = this.taintedVis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.pureVis = MathHelper.clamp_float(this.pureVis, 0.0F, this.maxVis);
|
||||
this.taintedVis = MathHelper.clamp_float(this.taintedVis, 0.0F, this.maxVis);
|
||||
}
|
||||
protected void calculateSuction() {
|
||||
this.setSuction(0);
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
}
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
}
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ic = (IConnection) te;
|
||||
if (this.getVisSuction((HelperLocation) null)
|
||||
< ic.getVisSuction(new HelperLocation(this)) - 1) {
|
||||
this.setVisSuction(
|
||||
ic.getVisSuction(new HelperLocation(this)) - 1
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
if (this.getTaintSuction((HelperLocation) null)
|
||||
< ic.getTaintSuction(new HelperLocation(this)) - 1) {
|
||||
this.setTaintSuction(
|
||||
ic.getTaintSuction(new HelperLocation(this)) - 1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisSource() {
|
||||
return false;
|
||||
}
|
||||
protected void equalizeWithNeighbours() {
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisConduit() {
|
||||
return true;
|
||||
}
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ent = (IConnection) te;
|
||||
if (this.pureVis + this.taintedVis < this.maxVis
|
||||
&& (this.getVisSuction((HelperLocation) null)
|
||||
> ent.getVisSuction(new HelperLocation(this))
|
||||
|| this.getTaintSuction((HelperLocation) null)
|
||||
> ent.getTaintSuction(new HelperLocation(this)))) {
|
||||
float qq = Math.min(
|
||||
(ent.getPureVis() + ent.getTaintedVis()) / 4.0F,
|
||||
this.fillAmount
|
||||
);
|
||||
float[] results = ent.subtractVis(
|
||||
Math.min(qq, this.maxVis - (this.pureVis + this.taintedVis))
|
||||
);
|
||||
if (this.getVisSuction((HelperLocation) null)
|
||||
> ent.getVisSuction(new HelperLocation(this))) {
|
||||
this.pureVis += results[0];
|
||||
} else {
|
||||
ent.setPureVis(results[0] + ent.getPureVis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
if (this.getTaintSuction((HelperLocation) null)
|
||||
> ent.getTaintSuction(new HelperLocation(this))) {
|
||||
this.taintedVis += results[1];
|
||||
} else {
|
||||
ent.setTaintedVis(results[1] + ent.getTaintedVis());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
this.pureVis = MathHelper.clamp_float(this.pureVis, 0.0F, this.maxVis);
|
||||
this.taintedVis = MathHelper.clamp_float(this.taintedVis, 0.0F, this.maxVis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxVis() {
|
||||
return this.maxVis;
|
||||
}
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
@Override
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[]{0.0F, 0.0F};
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
nbt.setFloat("pureVis", this.pureVis);
|
||||
nbt.setFloat("taintedVis", this.taintedVis);
|
||||
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
this.pureVis = nbt.getFloat("pureVis");
|
||||
this.taintedVis = nbt.getFloat("taintedVis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return this.visSuction;
|
||||
}
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
}
|
||||
@Override
|
||||
public boolean isVisSource() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return this.taintSuction;
|
||||
}
|
||||
@Override
|
||||
public boolean isVisConduit() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintSuction(int suction) {
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
@Override
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
@Override
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuction(HelperLocation loc) {
|
||||
return Math.max(this.visSuction, this.taintSuction);
|
||||
}
|
||||
@Override
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxVis() {
|
||||
return this.maxVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[] { 0.0F, 0.0F };
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return this.visSuction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return this.taintSuction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintSuction(int suction) {
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuction(HelperLocation loc) {
|
||||
return Math.max(this.visSuction, this.taintSuction);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,209 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.common.tiles.TileBellows;
|
||||
|
||||
public class TileConduitPump extends TileEntity implements IConnection {
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
public float maxVis = 4.0F;
|
||||
float fillAmount = 1.0F;
|
||||
public int orientation = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (!this.gettingPower()) {
|
||||
if (this.pureVis + this.taintedVis < this.maxVis) {
|
||||
HelperLocation me = new HelperLocation(this, this.orientation);
|
||||
TileEntity te = me.getConnectableTile(super.worldObj);
|
||||
if (te != null
|
||||
&& (((IConnection) te).isVisConduit()
|
||||
|| ((IConnection) te).isVisSource())) {
|
||||
float suckamount = Math.min(
|
||||
this.fillAmount,
|
||||
this.maxVis - (this.pureVis + this.taintedVis)
|
||||
);
|
||||
float[] yum = ((IConnection) te).subtractVis(suckamount);
|
||||
this.pureVis += yum[0];
|
||||
this.taintedVis += yum[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
this.orientation = nbttagcompound.getShort("orientation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
nbttagcompound.setShort("orientation", (short) this.orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
if (this.orientation != 4 && this.orientation != 5
|
||||
|| face != ForgeDirection.EAST && face != ForgeDirection.WEST) {
|
||||
if (this.orientation != 2 && this.orientation != 3
|
||||
|| face != ForgeDirection.SOUTH && face != ForgeDirection.NORTH) {
|
||||
return (this.orientation == 0 || this.orientation == 1)
|
||||
&& (face == ForgeDirection.UP || face == ForgeDirection.DOWN);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisConduit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxVis() {
|
||||
return this.maxVis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[] { 0.0F, 0.0F };
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return this.getSuction(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisSuction(int suction) {}
|
||||
|
||||
@Override
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return this.getSuction(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaintSuction(int suction) {}
|
||||
|
||||
@Override
|
||||
public void setSuction(int suction) {}
|
||||
|
||||
@Override
|
||||
public int getSuction(HelperLocation loc) {
|
||||
if (loc == null) {
|
||||
loc = new HelperLocation(this, this.orientation);
|
||||
loc.moveForwards(1.0);
|
||||
}
|
||||
|
||||
if (this.gettingPower()) {
|
||||
return 0;
|
||||
} else {
|
||||
int bellows = 0;
|
||||
|
||||
TileBellows.getBellows(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new ForgeDirection[] { ForgeDirection.NORTH,
|
||||
ForgeDirection.EAST,
|
||||
ForgeDirection.SOUTH,
|
||||
ForgeDirection.WEST }
|
||||
);
|
||||
|
||||
HelperLocation me = new HelperLocation(this, this.orientation);
|
||||
me.moveForwards(1.0);
|
||||
if (loc.equals(me)) {
|
||||
return 20 + bellows * 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: IRotatable?
|
||||
//@Override
|
||||
public boolean rotate() {
|
||||
++this.orientation;
|
||||
if (this.orientation > 5) {
|
||||
this.orientation -= 6;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean gettingPower() {
|
||||
return /*super.worldObj.isBlockGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
)
|
||||
|| */
|
||||
super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
}
|
||||
}
|
|
@ -5,251 +5,324 @@ import dev.tilera.auracore.api.machine.IConnection;
|
|||
import net.anvilcraft.thaummach.AuraUtils;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.common.tiles.TileBellows;
|
||||
|
||||
public class TileConduitTank extends TileEntity implements IConnection {
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
float fillAmount = 1.0F;
|
||||
int wait;
|
||||
public float displayPure;
|
||||
public float displayTaint;
|
||||
public float prevdisplayPure;
|
||||
public float prevdisplayTaint;
|
||||
public int visSuction = 10;
|
||||
public int taintSuction = 10;
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
float fillAmount = 1.0F;
|
||||
int wait;
|
||||
public float displayPure;
|
||||
public float displayTaint;
|
||||
public float prevdisplayPure;
|
||||
public float prevdisplayTaint;
|
||||
public int visSuction = 10;
|
||||
public int taintSuction = 10;
|
||||
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
--this.wait;
|
||||
if (this.wait <= 0) {
|
||||
if (this.prevdisplayPure != this.displayPure || this.prevdisplayTaint != this.displayTaint) {
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
this.prevdisplayPure = this.displayPure;
|
||||
this.prevdisplayTaint = this.displayTaint;
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
--this.wait;
|
||||
if (this.wait <= 0) {
|
||||
if (this.prevdisplayPure != this.displayPure
|
||||
|| this.prevdisplayTaint != this.displayTaint) {
|
||||
super.worldObj.markBlockForUpdate(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
this.prevdisplayPure = this.displayPure;
|
||||
this.prevdisplayTaint = this.displayTaint;
|
||||
}
|
||||
|
||||
this.wait = 10;
|
||||
this.calculateSuction();
|
||||
int breakchance = 999;
|
||||
if (this.getBlockMetadata() != 3) {
|
||||
breakchance = 3333;
|
||||
}
|
||||
|
||||
if (this.taintedVis > this.getMaxVis() * 0.9F) {
|
||||
if (this.getBlockMetadata() == 3
|
||||
&& super.worldObj.rand.nextInt(breakchance) == 123) {
|
||||
AuraUtils.taintExplosion(
|
||||
super.worldObj, super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
super.worldObj.setBlock(
|
||||
super.xCoord, super.yCoord, super.zCoord, Blocks.air, 0, 3
|
||||
);
|
||||
} else if (super.worldObj.rand.nextInt(breakchance / 8) == 42) {
|
||||
super.worldObj.playSoundEffect(
|
||||
(double) ((float) super.xCoord + 0.5F),
|
||||
(double) ((float) super.yCoord + 0.5F),
|
||||
(double) ((float) super.zCoord + 0.5F),
|
||||
"thaumcraft.creaking",
|
||||
0.75F,
|
||||
1.0F
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.wait = 10;
|
||||
this.calculateSuction();
|
||||
int breakchance = 999;
|
||||
if (this.getBlockMetadata() != 3) {
|
||||
breakchance = 3333;
|
||||
this.equalizeWithNeighbours();
|
||||
this.displayTaint = Math.max(
|
||||
this.displayTaint,
|
||||
MathHelper.clamp_float(this.taintedVis, 0.0F, this.getMaxVis())
|
||||
);
|
||||
this.displayPure = Math.max(
|
||||
this.displayPure,
|
||||
MathHelper.clamp_float(this.pureVis, 0.0F, this.getMaxVis())
|
||||
);
|
||||
if (this.displayTaint + this.displayPure < 0.1F) {
|
||||
this.displayTaint = 0.0F;
|
||||
this.displayPure = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void calculateSuction() {
|
||||
this.setSuction(10);
|
||||
|
||||
int bellows = TileBellows.getBellows(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new ForgeDirection[] { ForgeDirection.NORTH,
|
||||
ForgeDirection.SOUTH,
|
||||
ForgeDirection.WEST,
|
||||
ForgeDirection.EAST }
|
||||
);
|
||||
if (bellows > 0)
|
||||
this.setSuction(this.getSuction((HelperLocation) null) + (10 * bellows));
|
||||
}
|
||||
|
||||
protected void equalizeWithNeighbours() {
|
||||
float stackpureVis = this.pureVis;
|
||||
float stacktaintedVis = this.taintedVis;
|
||||
float stackmaxVis = this.getMaxVis();
|
||||
|
||||
TileEntity ts;
|
||||
int count;
|
||||
for (count = 1; (ts = super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord + count, super.zCoord
|
||||
)) instanceof TileConduitTank;
|
||||
++count) {
|
||||
stackpureVis += ((TileConduitTank) ts).pureVis;
|
||||
stacktaintedVis += ((TileConduitTank) ts).taintedVis;
|
||||
stackmaxVis += ((TileConduitTank) ts).getMaxVis();
|
||||
}
|
||||
|
||||
for (int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
if (this.taintedVis > this.getMaxVis() * 0.9F) {
|
||||
if (this.getBlockMetadata() == 3 && super.worldObj.rand.nextInt(breakchance) == 123) {
|
||||
AuraUtils.taintExplosion(super.worldObj, super.xCoord, super.yCoord, super.zCoord);
|
||||
super.worldObj.setBlock(super.xCoord, super.yCoord, super.zCoord, Blocks.air, 0, 3);
|
||||
} else if (super.worldObj.rand.nextInt(breakchance / 8) == 42) {
|
||||
super.worldObj.playSoundEffect((double)((float)super.xCoord + 0.5F), (double)((float)super.yCoord + 0.5F), (double)((float)super.zCoord + 0.5F), "thaumcraft.creaking", 0.75F, 1.0F);
|
||||
}
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ent = (IConnection) te;
|
||||
if (!(te instanceof TileConduitTank)
|
||||
&& stackpureVis + stacktaintedVis < stackmaxVis
|
||||
&& (this.getVisSuction((HelperLocation) null)
|
||||
> ent.getVisSuction(new HelperLocation(this))
|
||||
|| this.getTaintSuction((HelperLocation) null)
|
||||
> ent.getTaintSuction(new HelperLocation(this)))) {
|
||||
float[] results = ent.subtractVis(Math.min(
|
||||
this.fillAmount,
|
||||
stackmaxVis - (stackpureVis + stacktaintedVis)
|
||||
));
|
||||
if (this.getVisSuction((HelperLocation) null)
|
||||
> ent.getVisSuction(new HelperLocation(this))) {
|
||||
stackpureVis += results[0];
|
||||
} else {
|
||||
ent.setPureVis(results[0] + ent.getPureVis());
|
||||
}
|
||||
|
||||
if (this.getTaintSuction((HelperLocation) null)
|
||||
> ent.getTaintSuction(new HelperLocation(this))) {
|
||||
stacktaintedVis += results[1];
|
||||
} else {
|
||||
ent.setTaintedVis(results[1] + ent.getTaintedVis());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.equalizeWithNeighbours();
|
||||
this.displayTaint = Math.max(this.displayTaint, MathHelper.clamp_float(this.taintedVis, 0.0F, this.getMaxVis()));
|
||||
this.displayPure = Math.max(this.displayPure, MathHelper.clamp_float(this.pureVis, 0.0F, this.getMaxVis()));
|
||||
if (this.displayTaint + this.displayPure < 0.1F) {
|
||||
this.displayTaint = 0.0F;
|
||||
this.displayPure = 0.0F;
|
||||
}
|
||||
float total = stackpureVis + stacktaintedVis;
|
||||
if ((float) Math.round(total) >= stackmaxVis) {
|
||||
this.setSuction(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
float pratio = stackpureVis / total;
|
||||
float tratio = stacktaintedVis / total;
|
||||
count = 0;
|
||||
|
||||
public void calculateSuction() {
|
||||
this.setSuction(10);
|
||||
|
||||
int bellows = TileBellows.getBellows(this.worldObj, this.xCoord, this.yCoord, this.zCoord, new ForgeDirection[] {ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.WEST, ForgeDirection.EAST});
|
||||
if (bellows > 0)
|
||||
this.setSuction(this.getSuction((HelperLocation)null) + (10 * bellows));
|
||||
|
||||
}
|
||||
|
||||
protected void equalizeWithNeighbours() {
|
||||
float stackpureVis = this.pureVis;
|
||||
float stacktaintedVis = this.taintedVis;
|
||||
float stackmaxVis = this.getMaxVis();
|
||||
|
||||
TileEntity ts;
|
||||
int count;
|
||||
for(count = 1; (ts = super.worldObj.getTileEntity(super.xCoord, super.yCoord + count, super.zCoord)) instanceof TileConduitTank; ++count) {
|
||||
stackpureVis += ((TileConduitTank)ts).pureVis;
|
||||
stacktaintedVis += ((TileConduitTank)ts).taintedVis;
|
||||
stackmaxVis += ((TileConduitTank)ts).getMaxVis();
|
||||
}
|
||||
|
||||
for(int dir = 0; dir < 6; ++dir) {
|
||||
HelperLocation loc = new HelperLocation(this);
|
||||
switch (dir) {
|
||||
case 0:
|
||||
loc.facing = ForgeDirection.UP;
|
||||
break;
|
||||
case 1:
|
||||
loc.facing = ForgeDirection.DOWN;
|
||||
break;
|
||||
case 2:
|
||||
loc.facing = ForgeDirection.SOUTH;
|
||||
break;
|
||||
case 3:
|
||||
loc.facing = ForgeDirection.NORTH;
|
||||
break;
|
||||
case 4:
|
||||
loc.facing = ForgeDirection.EAST;
|
||||
break;
|
||||
case 5:
|
||||
loc.facing = ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
if (this.getConnectable(loc.facing)) {
|
||||
TileEntity te = loc.getConnectableTile(super.worldObj);
|
||||
if (te != null && te instanceof IConnection) {
|
||||
IConnection ent = (IConnection)te;
|
||||
if (!(te instanceof TileConduitTank) && stackpureVis + stacktaintedVis < stackmaxVis && (this.getVisSuction((HelperLocation)null) > ent.getVisSuction(new HelperLocation(this)) || this.getTaintSuction((HelperLocation)null) > ent.getTaintSuction(new HelperLocation(this)))) {
|
||||
float[] results = ent.subtractVis(Math.min(this.fillAmount, stackmaxVis - (stackpureVis + stacktaintedVis)));
|
||||
if (this.getVisSuction((HelperLocation)null) > ent.getVisSuction(new HelperLocation(this))) {
|
||||
stackpureVis += results[0];
|
||||
} else {
|
||||
ent.setPureVis(results[0] + ent.getPureVis());
|
||||
}
|
||||
|
||||
if (this.getTaintSuction((HelperLocation)null) > ent.getTaintSuction(new HelperLocation(this))) {
|
||||
stacktaintedVis += results[1];
|
||||
} else {
|
||||
ent.setTaintedVis(results[1] + ent.getTaintedVis());
|
||||
}
|
||||
}
|
||||
for (boolean clearrest = false;
|
||||
(ts = super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord + count, super.zCoord
|
||||
)) instanceof TileConduitTank;
|
||||
++count) {
|
||||
if (clearrest) {
|
||||
((TileConduitTank) ts).pureVis = 0.0F;
|
||||
((TileConduitTank) ts).taintedVis = 0.0F;
|
||||
} else if (total <= ((TileConduitTank) ts).getMaxVis()) {
|
||||
((TileConduitTank) ts).pureVis = stackpureVis;
|
||||
((TileConduitTank) ts).taintedVis = stacktaintedVis;
|
||||
clearrest = true;
|
||||
} else {
|
||||
((TileConduitTank) ts).pureVis
|
||||
= ((TileConduitTank) ts).getMaxVis() * pratio;
|
||||
((TileConduitTank) ts).taintedVis
|
||||
= ((TileConduitTank) ts).getMaxVis() * tratio;
|
||||
stackpureVis -= ((TileConduitTank) ts).pureVis;
|
||||
stacktaintedVis -= ((TileConduitTank) ts).taintedVis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float total = stackpureVis + stacktaintedVis;
|
||||
if ((float)Math.round(total) >= stackmaxVis) {
|
||||
this.setSuction(0);
|
||||
}
|
||||
total = stackpureVis + stacktaintedVis;
|
||||
}
|
||||
}
|
||||
|
||||
float pratio = stackpureVis / total;
|
||||
float tratio = stacktaintedVis / total;
|
||||
count = 0;
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
}
|
||||
|
||||
for(boolean clearrest = false; (ts = super.worldObj.getTileEntity(super.xCoord, super.yCoord + count, super.zCoord)) instanceof TileConduitTank; ++count) {
|
||||
if (clearrest) {
|
||||
((TileConduitTank)ts).pureVis = 0.0F;
|
||||
((TileConduitTank)ts).taintedVis = 0.0F;
|
||||
} else if (total <= ((TileConduitTank)ts).getMaxVis()) {
|
||||
((TileConduitTank)ts).pureVis = stackpureVis;
|
||||
((TileConduitTank)ts).taintedVis = stacktaintedVis;
|
||||
clearrest = true;
|
||||
} else {
|
||||
((TileConduitTank)ts).pureVis = ((TileConduitTank)ts).getMaxVis() * pratio;
|
||||
((TileConduitTank)ts).taintedVis = ((TileConduitTank)ts).getMaxVis() * tratio;
|
||||
stackpureVis -= ((TileConduitTank)ts).pureVis;
|
||||
stacktaintedVis -= ((TileConduitTank)ts).taintedVis;
|
||||
}
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
}
|
||||
|
||||
total = stackpureVis + stacktaintedVis;
|
||||
}
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
}
|
||||
nbt.setFloat("pureVis", this.pureVis);
|
||||
nbt.setFloat("taintedVis", this.taintedVis);
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
}
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
}
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
this.pureVis = nbt.getFloat("pureVis");
|
||||
this.taintedVis = nbt.getFloat("taintedVis");
|
||||
|
||||
public boolean isVisSource() {
|
||||
return true;
|
||||
}
|
||||
this.worldObj.markBlockRangeForRenderUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
public boolean isVisConduit() {
|
||||
return false;
|
||||
}
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
public boolean isVisSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
public boolean isVisConduit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
|
||||
public float getMaxVis() {
|
||||
return this.getBlockMetadata() != 3 ? 1000.0F : 500.0F;
|
||||
}
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[]{0.0F, 0.0F};
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
public float getMaxVis() {
|
||||
return this.getBlockMetadata() != 3 ? 1000.0F : 500.0F;
|
||||
}
|
||||
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[] { 0.0F, 0.0F };
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return this.visSuction;
|
||||
}
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
|
||||
public void setVisSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
}
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return this.taintSuction;
|
||||
}
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return this.visSuction;
|
||||
}
|
||||
|
||||
public void setTaintSuction(int suction) {
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
public void setVisSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
}
|
||||
|
||||
public void setSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return this.taintSuction;
|
||||
}
|
||||
|
||||
public int getSuction(HelperLocation loc) {
|
||||
return Math.max(this.visSuction, this.taintSuction);
|
||||
}
|
||||
public void setTaintSuction(int suction) {
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
|
||||
public void setSuction(int suction) {
|
||||
this.visSuction = suction;
|
||||
this.taintSuction = suction;
|
||||
}
|
||||
|
||||
public int getSuction(HelperLocation loc) {
|
||||
return Math.max(this.visSuction, this.taintSuction);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
|
||||
public class TileConduitValve extends TileConduit {
|
||||
public boolean open = false;
|
||||
private boolean prevPower;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
this.calculateSuction();
|
||||
if (!this.open) {
|
||||
this.setSuction(0);
|
||||
}
|
||||
|
||||
if (this.getSuction((HelperLocation) null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
if (super.prevPure != super.pureVis || super.prevTaint != super.taintedVis) {
|
||||
super.worldObj.markBlockForUpdate(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
super.prevPure = super.pureVis;
|
||||
super.prevTaint = super.taintedVis;
|
||||
}
|
||||
|
||||
if (this.gettingPower()) {
|
||||
this.prevPower = true;
|
||||
this.open = false;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
super.worldObj.notifyBlocksOfNeighborChange(
|
||||
super.xCoord, super.yCoord, super.zCoord, this.getBlockType()
|
||||
);
|
||||
}
|
||||
|
||||
if (!this.gettingPower() && this.prevPower) {
|
||||
this.open = true;
|
||||
this.prevPower = false;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
super.worldObj.notifyBlocksOfNeighborChange(
|
||||
super.xCoord, super.yCoord, super.zCoord, this.getBlockType()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean gettingPower() {
|
||||
return super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
)
|
||||
|| super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord + 1, super.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.open = nbttagcompound.getBoolean("open");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setBoolean("open", this.open);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setBoolean("open", this.open);
|
||||
nbt.setFloat("pureVis", this.pureVis);
|
||||
nbt.setFloat("taintedVis", this.taintedVis);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.open = nbt.getBoolean("open");
|
||||
this.pureVis = nbt.getFloat("pureVis");
|
||||
this.taintedVis = nbt.getFloat("taintedVis");
|
||||
|
||||
System.out.println(this.pureVis + this.taintedVis);
|
||||
|
||||
this.worldObj.markBlockRangeForRenderUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
|
||||
public class TileConduitValveAdvanced extends TileConduit {
|
||||
public int setting = 0;
|
||||
public int prevsetting = 0;
|
||||
private boolean prevPower;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (super.prevPure != super.pureVis
|
||||
|| super.prevTaint != super.taintedVis) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
super.prevPure = super.pureVis;
|
||||
super.prevTaint = super.taintedVis;
|
||||
}
|
||||
|
||||
this.calculateSuction();
|
||||
if (this.setting == 0) {
|
||||
this.setSuction(0);
|
||||
}
|
||||
|
||||
if (this.setting == 1) {
|
||||
this.setTaintSuction(0);
|
||||
}
|
||||
|
||||
if (this.setting == 2) {
|
||||
this.setVisSuction(0);
|
||||
}
|
||||
|
||||
if (this.getSuction(null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
if (this.gettingPower()) {
|
||||
if (!this.prevPower) {
|
||||
this.prevsetting = this.setting;
|
||||
}
|
||||
|
||||
this.prevPower = true;
|
||||
this.setting = 0;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
super.worldObj.notifyBlocksOfNeighborChange(
|
||||
super.xCoord, super.yCoord, super.zCoord, this.getBlockType()
|
||||
);
|
||||
}
|
||||
|
||||
if (!this.gettingPower() && this.prevPower) {
|
||||
this.setting = this.prevsetting;
|
||||
this.prevPower = false;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
super.worldObj.notifyBlocksOfNeighborChange(
|
||||
super.xCoord, super.yCoord, super.zCoord, this.getBlockType()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean gettingPower() {
|
||||
return super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
)
|
||||
|| super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord + 1, super.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.setting = nbttagcompound.getInteger("setting");
|
||||
this.prevsetting = nbttagcompound.getInteger("prevsetting");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setInteger("setting", this.setting);
|
||||
nbttagcompound.setInteger("prevsetting", this.prevsetting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setInteger("setting", this.setting);
|
||||
nbt.setInteger("prevsetting", this.prevsetting);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.setting = nbt.getInteger("setting");
|
||||
this.prevsetting = nbt.getInteger("prevsetting");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,599 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.entities.golems.EntityTravelingTrunk;
|
||||
|
||||
public class TileCrucible extends TileEntity implements IConnection {
|
||||
public int smeltDelay;
|
||||
public float pureVis = 0.0F;
|
||||
public float taintedVis = 0.0F;
|
||||
public float maxVis;
|
||||
public int face = 3;
|
||||
private short type;
|
||||
private float conversion;
|
||||
private float speed;
|
||||
public int bellows = 0;
|
||||
private int soundDelay = 25;
|
||||
float pPure;
|
||||
float pTaint;
|
||||
int wait;
|
||||
boolean updateNextPeriod;
|
||||
public boolean isPowering = false;
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.pureVis = nbttagcompound.getFloat("pureVis");
|
||||
this.taintedVis = nbttagcompound.getFloat("taintedVis");
|
||||
this.type = nbttagcompound.getShort("type");
|
||||
this.setTier(this.type);
|
||||
this.bellows = nbttagcompound.getShort("bellows");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("pureVis", this.pureVis);
|
||||
nbttagcompound.setFloat("taintedVis", this.taintedVis);
|
||||
nbttagcompound.setShort("type", this.type);
|
||||
nbttagcompound.setShort("bellows", (short) this.bellows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setFloat("pureVis", this.pureVis);
|
||||
nbt.setFloat("taintedVis", this.taintedVis);
|
||||
nbt.setShort("type", this.type);
|
||||
nbt.setInteger("bellows", this.bellows);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.pureVis = nbt.getFloat("pureVis");
|
||||
this.taintedVis = nbt.getFloat("taintedVis");
|
||||
this.type = nbt.getShort("type");
|
||||
this.bellows = nbt.getInteger("bellows");
|
||||
}
|
||||
|
||||
public void setTier(short t) {
|
||||
switch (t) {
|
||||
case 1:
|
||||
this.maxVis = 500.0F;
|
||||
this.conversion = 0.5F;
|
||||
this.speed = 0.25F;
|
||||
this.type = 1;
|
||||
break;
|
||||
case 2:
|
||||
this.maxVis = 600.0F;
|
||||
this.conversion = 0.6F;
|
||||
this.speed = 0.5F;
|
||||
this.type = 2;
|
||||
break;
|
||||
case 3:
|
||||
this.maxVis = 750.0F;
|
||||
this.conversion = 0.7F;
|
||||
this.speed = 0.75F;
|
||||
this.type = 3;
|
||||
break;
|
||||
case 4:
|
||||
this.maxVis = 750.0F;
|
||||
this.conversion = 0.4F;
|
||||
this.speed = 0.75F;
|
||||
this.type = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if (this.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
float totalVis = this.pureVis + this.taintedVis;
|
||||
--this.smeltDelay;
|
||||
--this.wait;
|
||||
if (this.pPure != this.pureVis || this.pTaint != this.taintedVis) {
|
||||
this.pTaint = this.taintedVis;
|
||||
this.pPure = this.pureVis;
|
||||
this.updateNextPeriod = true;
|
||||
}
|
||||
|
||||
if (this.wait <= 0 && this.updateNextPeriod) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.updateNextPeriod = false;
|
||||
this.wait = 10;
|
||||
}
|
||||
|
||||
--this.soundDelay;
|
||||
if (this.soundDelay <= 0) {
|
||||
this.soundDelay = 15 + super.worldObj.rand.nextInt(15);
|
||||
}
|
||||
|
||||
if (totalVis > this.maxVis) {
|
||||
float overflowSplit
|
||||
= Math.min((this.pureVis + this.taintedVis - this.maxVis) / 2.0F, 1.0F);
|
||||
if (this.pureVis >= overflowSplit) {
|
||||
this.pureVis -= overflowSplit;
|
||||
}
|
||||
|
||||
if (overflowSplit >= 1.0F) {
|
||||
if (this.taintedVis >= 1.0F) {
|
||||
AuraManager.addTaintToClosest(
|
||||
this.worldObj, this.xCoord, this.yCoord, this.zCoord, 1
|
||||
);
|
||||
--this.taintedVis;
|
||||
FXWisp ef = new FXWisp(
|
||||
super.worldObj,
|
||||
(double) ((float) super.xCoord + super.worldObj.rand.nextFloat()),
|
||||
(double) ((float) super.yCoord + 0.8F),
|
||||
(double) ((float) super.zCoord + super.worldObj.rand.nextFloat()),
|
||||
(double
|
||||
) ((float) super.xCoord + 0.5F
|
||||
+ (super.worldObj.rand.nextFloat()
|
||||
- super.worldObj.rand.nextFloat())),
|
||||
(double
|
||||
) ((float) super.yCoord + 3.0F + super.worldObj.rand.nextFloat()),
|
||||
(double
|
||||
) ((float) super.zCoord + 0.5F
|
||||
+ (super.worldObj.rand.nextFloat()
|
||||
- super.worldObj.rand.nextFloat())),
|
||||
0.5F,
|
||||
5
|
||||
);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
}
|
||||
}
|
||||
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
if (this.getBlockMetadata() == 1 || this.getBlockMetadata() == 2) {
|
||||
boolean oldPower = this.isPowering;
|
||||
if ((double) totalVis >= (double) this.maxVis * 0.9) {
|
||||
this.isPowering = true;
|
||||
} else {
|
||||
this.isPowering = false;
|
||||
}
|
||||
|
||||
if (oldPower != this.isPowering) {
|
||||
for (int a = -1; a < 2; ++a) {
|
||||
for (int b = -1; b < 2; ++b) {
|
||||
for (int c = -1; c < 2; ++c) {
|
||||
this.worldObj.markBlockForUpdate(
|
||||
this.xCoord + a, this.yCoord + b, this.zCoord + c
|
||||
);
|
||||
this.worldObj.notifyBlocksOfNeighborChange(
|
||||
this.xCoord + a,
|
||||
this.yCoord + b,
|
||||
this.zCoord + c,
|
||||
Blocks.air
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float tconv = 0.0f;
|
||||
float sa;
|
||||
float pureCook;
|
||||
float taintCook;
|
||||
boolean aboveFurnace;
|
||||
boolean aboveBoostedFurnace;
|
||||
if (this.smeltDelay <= 0 && this.getBlockMetadata() != 3) {
|
||||
this.smeltDelay = 5;
|
||||
List<EntityItem> list = this.getContents();
|
||||
if (list.size() > 0) {
|
||||
EntityItem entity
|
||||
= (EntityItem) list.get(super.worldObj.rand.nextInt(list.size()));
|
||||
ItemStack item = entity.getEntityItem();
|
||||
if (this.canCook(item)) {
|
||||
aboveFurnace = false;
|
||||
aboveBoostedFurnace = false;
|
||||
if (super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
) instanceof TileArcaneFurnace
|
||||
&& ((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.isBurning()) {
|
||||
aboveFurnace = true;
|
||||
if (((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.boost) {
|
||||
aboveBoostedFurnace = true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: recipes
|
||||
//tconv
|
||||
// = RecipesCrucible.smelting().getSmeltingResult(item, true,
|
||||
// false);
|
||||
sa = this.conversion;
|
||||
if (aboveFurnace) {
|
||||
sa += 0.1F
|
||||
+ (float) ((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.bellows
|
||||
* 0.025F;
|
||||
if (aboveBoostedFurnace) {
|
||||
sa += 0.1F;
|
||||
}
|
||||
|
||||
sa = Math.min(sa, 1.0F);
|
||||
}
|
||||
|
||||
pureCook = tconv * sa;
|
||||
taintCook = tconv - pureCook;
|
||||
if (this.getBlockMetadata() != 2
|
||||
|| !(totalVis + tconv > this.maxVis)) {
|
||||
this.pureVis += pureCook;
|
||||
this.taintedVis += taintCook;
|
||||
float tspeed = this.speed + (float) this.bellows * 0.1F;
|
||||
this.smeltDelay = 10 + Math.round(tconv / 5.0F / tspeed);
|
||||
if (aboveFurnace) {
|
||||
this.smeltDelay = (int
|
||||
) ((float) this.smeltDelay
|
||||
* (0.8F
|
||||
- (float
|
||||
) ((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.bellows
|
||||
* 0.05F));
|
||||
}
|
||||
|
||||
AuraManager.addFluxToClosest(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new AspectList().add(Aspect.TAINT, (int) (tconv / 10.0))
|
||||
);
|
||||
|
||||
--item.stackSize;
|
||||
if (item.stackSize <= 0) {
|
||||
entity.setDead();
|
||||
}
|
||||
|
||||
this.worldObj.markBlockForUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
super.worldObj.spawnParticle(
|
||||
"largesmoke",
|
||||
entity.posX,
|
||||
entity.posY,
|
||||
entity.posZ,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
);
|
||||
super.worldObj.playSoundEffect(
|
||||
(double) ((float) super.xCoord + 0.5F),
|
||||
(double) ((float) super.yCoord + 0.5F),
|
||||
(double) ((float) super.zCoord + 0.5F),
|
||||
"thaumcraft.bubbling",
|
||||
0.25F,
|
||||
0.9F + super.worldObj.rand.nextFloat() * 0.2F
|
||||
);
|
||||
}
|
||||
} else {
|
||||
entity.motionX = (double
|
||||
) ((super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat())
|
||||
* 0.2F);
|
||||
entity.motionY
|
||||
= (double) (0.2F + super.worldObj.rand.nextFloat() * 0.3F);
|
||||
entity.motionZ = (double
|
||||
) ((super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat())
|
||||
* 0.2F);
|
||||
super.worldObj.playSoundAtEntity(
|
||||
entity,
|
||||
"random.pop",
|
||||
0.5F,
|
||||
2.0F + super.worldObj.rand.nextFloat() * 0.45F
|
||||
);
|
||||
entity.delayBeforeCanPickup = 10;
|
||||
entity.age = 0;
|
||||
}
|
||||
}
|
||||
} else if (this.smeltDelay <= 0 && this.getBlockMetadata() == 3 && (float) Math.round(totalVis + 1.0F) <= this.maxVis) {
|
||||
this.smeltDelay = 20 - this.bellows * 2;
|
||||
List<EntityLivingBase> list = super.worldObj.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) (super.xCoord - 4),
|
||||
(double) (super.yCoord - 4),
|
||||
(double) (super.zCoord - 4),
|
||||
(double) (super.xCoord + 5),
|
||||
(double) (super.yCoord + 5),
|
||||
(double) (super.zCoord + 5)
|
||||
)
|
||||
);
|
||||
boolean sucked = false;
|
||||
|
||||
for (int a = 0; a < list.size(); ++a) {
|
||||
if (!(list.get(a) instanceof EntityPlayer)
|
||||
&& !(list.get(a) instanceof EntityTameable)
|
||||
&& !(list.get(a) instanceof EntityTravelingTrunk)
|
||||
&& ((EntityLiving) list.get(a)).hurtTime <= 0
|
||||
&& ((EntityLiving) list.get(a)).deathTime <= 0) {
|
||||
if (list.get(a) instanceof EntitySnowman) {
|
||||
((EntityLiving) list.get(a)).spawnExplosionParticle();
|
||||
((EntityLiving) list.get(a)).setDead();
|
||||
}
|
||||
|
||||
aboveFurnace = false;
|
||||
aboveBoostedFurnace = false;
|
||||
if (super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
) instanceof TileArcaneFurnace
|
||||
&& ((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.isBurning()) {
|
||||
aboveFurnace = true;
|
||||
if (((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.boost) {
|
||||
aboveBoostedFurnace = true;
|
||||
}
|
||||
}
|
||||
|
||||
tconv = this.conversion;
|
||||
if (aboveFurnace) {
|
||||
tconv += 0.1F
|
||||
+ (float) ((TileArcaneFurnace) super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
))
|
||||
.bellows
|
||||
* 0.025F;
|
||||
if (aboveBoostedFurnace) {
|
||||
tconv += 0.1F;
|
||||
}
|
||||
|
||||
tconv = Math.min(tconv, 1.0F);
|
||||
}
|
||||
|
||||
sa = 1.0F;
|
||||
if (((EntityLiving) list.get(a)).isEntityUndead()) {
|
||||
sa = 0.5F;
|
||||
}
|
||||
|
||||
pureCook = sa * tconv;
|
||||
taintCook = sa - pureCook;
|
||||
this.pureVis += pureCook;
|
||||
this.taintedVis += taintCook;
|
||||
((EntityLiving) list.get(a))
|
||||
.attackEntityFrom(DamageSource.generic, 1);
|
||||
((EntityLiving) list.get(a))
|
||||
.addPotionEffect(new PotionEffect(Potion.hunger.id, 3000, 0));
|
||||
sucked = true;
|
||||
|
||||
for (int b = 0; b < 3; ++b) {
|
||||
//FXWisp ef = new FXWisp(
|
||||
// super.worldObj,
|
||||
// ((EntityLiving) list.get(a)).posX
|
||||
// + (double) super.worldObj.rand.nextFloat()
|
||||
// - (double) super.worldObj.rand.nextFloat(),
|
||||
// ((EntityLiving) list.get(a)).posY
|
||||
// + (double) (((EntityLiving) list.get(a)).height / 2.0F)
|
||||
// + (double) super.worldObj.rand.nextFloat()
|
||||
// - (double) super.worldObj.rand.nextFloat(),
|
||||
// ((EntityLiving) list.get(a)).posZ
|
||||
// + (double) super.worldObj.rand.nextFloat()
|
||||
// - (double) super.worldObj.rand.nextFloat(),
|
||||
// (double) ((float) super.xCoord + 0.5F),
|
||||
// (double) ((float) super.yCoord + 0.25F),
|
||||
// (double) ((float) super.zCoord + 0.5F),
|
||||
// 0.3F,
|
||||
// 5
|
||||
//);
|
||||
//Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sucked) {
|
||||
AuraManager.addFluxToClosest(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new AspectList().add(Aspect.SOUL, 1)
|
||||
);
|
||||
|
||||
this.face = 0;
|
||||
super.worldObj.playSoundEffect(
|
||||
(double) super.xCoord,
|
||||
(double) super.yCoord,
|
||||
(double) super.zCoord,
|
||||
"thaumcraft:suck",
|
||||
0.1F,
|
||||
0.8F + super.worldObj.rand.nextFloat() * 0.3F
|
||||
);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
} else if (this.face < 3) {
|
||||
++this.face;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<EntityItem> getContents() {
|
||||
float t2x = 0.0F;
|
||||
List<EntityItem> list = super.worldObj.getEntitiesWithinAABB(
|
||||
EntityItem.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) super.xCoord,
|
||||
(double) ((float) super.yCoord + t2x),
|
||||
(double) super.zCoord,
|
||||
(double) super.xCoord + 1.0,
|
||||
(double) super.yCoord + 1.0 - (double) t2x,
|
||||
(double) super.zCoord + 1.0
|
||||
)
|
||||
);
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean ejectContents(EntityPlayer player) {
|
||||
boolean ret = false;
|
||||
List<EntityItem> list = this.getContents();
|
||||
|
||||
for (int a = 0; a < list.size(); ++a) {
|
||||
((EntityItem) list.get(a)).noClip = true;
|
||||
((EntityItem) list.get(a)).delayBeforeCanPickup = 0;
|
||||
((EntityItem) list.get(a)).motionX
|
||||
= (player.posX - ((EntityItem) list.get(a)).posX) * 0.20000000298023224;
|
||||
((EntityItem) list.get(a)).motionY
|
||||
= (player.posY - ((EntityItem) list.get(a)).posY) * 0.20000000298023224;
|
||||
((EntityItem) list.get(a)).motionZ
|
||||
= (player.posZ - ((EntityItem) list.get(a)).posZ) * 0.20000000298023224;
|
||||
((EntityItem) list.get(a))
|
||||
.moveEntity(
|
||||
((EntityItem) list.get(a)).motionX,
|
||||
((EntityItem) list.get(a)).motionY,
|
||||
((EntityItem) list.get(a)).motionZ
|
||||
);
|
||||
((EntityItem) list.get(a)).noClip = false;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private boolean canCook(ItemStack items) {
|
||||
// TODO: recipes
|
||||
//if (items == null) {
|
||||
// return false;
|
||||
//} else {
|
||||
// float cookvalue
|
||||
// = RecipesCrucible.smelting().getSmeltingResult(items, true, false);
|
||||
// return cookvalue != 0.0F;
|
||||
//}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
switch (face) {
|
||||
case EAST:
|
||||
case SOUTH:
|
||||
case WEST:
|
||||
case NORTH:
|
||||
case DOWN:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isVisSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isVisConduit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public float getPureVis() {
|
||||
return this.pureVis;
|
||||
}
|
||||
|
||||
public void setPureVis(float amount) {
|
||||
this.pureVis = amount;
|
||||
}
|
||||
|
||||
public float getTaintedVis() {
|
||||
return this.taintedVis;
|
||||
}
|
||||
|
||||
public void setTaintedVis(float amount) {
|
||||
this.taintedVis = amount;
|
||||
}
|
||||
|
||||
public float getMaxVis() {
|
||||
return this.maxVis;
|
||||
}
|
||||
|
||||
public float[] subtractVis(float amount) {
|
||||
float pureAmount = amount / 2.0F;
|
||||
float taintAmount = amount / 2.0F;
|
||||
float[] result = new float[] { 0.0F, 0.0F };
|
||||
if (amount < 0.001F) {
|
||||
return result;
|
||||
} else {
|
||||
if (this.pureVis < pureAmount) {
|
||||
pureAmount = this.pureVis;
|
||||
}
|
||||
|
||||
if (this.taintedVis < taintAmount) {
|
||||
taintAmount = this.taintedVis;
|
||||
}
|
||||
|
||||
if (pureAmount < amount / 2.0F && taintAmount == amount / 2.0F) {
|
||||
taintAmount = Math.min(amount - pureAmount, this.taintedVis);
|
||||
} else if (taintAmount < amount / 2.0F && pureAmount == amount / 2.0F) {
|
||||
pureAmount = Math.min(amount - taintAmount, this.pureVis);
|
||||
}
|
||||
|
||||
this.pureVis -= pureAmount;
|
||||
this.taintedVis -= taintAmount;
|
||||
result[0] = pureAmount;
|
||||
result[1] = taintAmount;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public int getVisSuction(HelperLocation loc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setVisSuction(int suction) {}
|
||||
|
||||
public int getTaintSuction(HelperLocation loc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setTaintSuction(int suction) {}
|
||||
|
||||
public void setSuction(int suction) {}
|
||||
|
||||
public int getSuction(HelperLocation loc) {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,361 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import dev.tilera.auracore.api.machine.IUpgradable;
|
||||
import dev.tilera.auracore.api.machine.TileVisUser;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class TileCrystallizer
|
||||
extends TileVisUser implements ISidedInventory, IUpgradable {
|
||||
private ItemStack[] crystalizerItemStacks = new ItemStack[10];
|
||||
public float crystalTime = 0.0F;
|
||||
public float maxTime = 30.0F;
|
||||
public float sucked = 0.0F;
|
||||
public int boost = 0;
|
||||
private byte[] upgrades = new byte[] { -1 };
|
||||
int boostDelay = 20;
|
||||
|
||||
// TODO: GUIs
|
||||
//public GuiScreen getGui(EntityPlayer player) {
|
||||
// return new GuiCrystalizer(player.inventory, this);
|
||||
//}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return this.crystalizerItemStacks.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return this.crystalizerItemStacks[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (this.crystalizerItemStacks[i] != null) {
|
||||
ItemStack itemstack1;
|
||||
if (this.crystalizerItemStacks[i].stackSize <= j) {
|
||||
itemstack1 = this.crystalizerItemStacks[i];
|
||||
this.crystalizerItemStacks[i] = null;
|
||||
return itemstack1;
|
||||
} else {
|
||||
itemstack1 = this.crystalizerItemStacks[i].splitStack(j);
|
||||
if (this.crystalizerItemStacks[i].stackSize == 0) {
|
||||
this.crystalizerItemStacks[i] = null;
|
||||
}
|
||||
|
||||
return itemstack1;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
this.crystalizerItemStacks[i] = itemstack;
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) {
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
NBTTagList nbttaglist = nbttagcompound.getTagList("Items", 10);
|
||||
this.crystalizerItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1
|
||||
= (NBTTagCompound) nbttaglist.getCompoundTagAt(i);
|
||||
byte byte0 = nbttagcompound1.getByte("SlotCrystalizer");
|
||||
if (byte0 >= 0 && byte0 < this.crystalizerItemStacks.length) {
|
||||
this.crystalizerItemStacks[byte0]
|
||||
= ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.crystalTime = nbttagcompound.getFloat("Time");
|
||||
this.upgrades = nbttagcompound.getByteArray("upgrades");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setFloat("Time", this.crystalTime);
|
||||
nbttagcompound.setByteArray("upgrades", this.upgrades);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.crystalizerItemStacks.length; ++i) {
|
||||
if (this.crystalizerItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("SlotCrystalizer", (byte) i);
|
||||
this.crystalizerItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
nbttagcompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
public int getCookProgressScaled(int i) {
|
||||
return Math.round(this.crystalTime / this.maxTime * (float) i);
|
||||
}
|
||||
|
||||
public int getBoostScaled() {
|
||||
return Math.round(0.1F + (float) this.boost / 2.0F) * 6;
|
||||
}
|
||||
|
||||
public boolean isCooking() {
|
||||
return this.crystalTime > 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!super.worldObj.isRemote) {
|
||||
this.maxTime = this.hasUpgrade((byte) 1) ? 25.0F : 30.0F;
|
||||
if (this.crystalTime > 0.0F
|
||||
&& !super.worldObj.isBlockIndirectlyGettingPowered(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
)) {
|
||||
float sa = 0.025F + 0.0025F * (float) this.boost
|
||||
+ (this.hasUpgrade((byte) 0) ? 0.025F : 0.0F);
|
||||
this.sucked = this.getAvailablePureVis(sa);
|
||||
this.crystalTime -= this.sucked;
|
||||
} else {
|
||||
this.sucked = 0.0F;
|
||||
}
|
||||
|
||||
if (this.crystalTime > 0.0F
|
||||
&& (this.crystalizerItemStacks[6] == null
|
||||
|| this.crystalizerItemStacks[6].getItem() != ConfigItems.itemShard
|
||||
)) {
|
||||
super.worldObj.playSoundEffect(
|
||||
(double) super.xCoord + 0.5,
|
||||
(double) super.yCoord + 0.5,
|
||||
(double) super.zCoord + 0.5,
|
||||
"random.fizz",
|
||||
1.0F,
|
||||
1.6F
|
||||
);
|
||||
this.crystalTime = 0.0F;
|
||||
}
|
||||
|
||||
if (this.crystalTime < 0.0F && this.crystalizerItemStacks[6] != null
|
||||
&& this.crystalizerItemStacks[6].getItem() == ConfigItems.itemShard) {
|
||||
// TODO: WTF
|
||||
//this.addCrystal(ThaumCraftCore.getCrystalByBiome(
|
||||
// super.worldObj,
|
||||
// super.xCoord,
|
||||
// super.zCoord,
|
||||
// this.hasUpgrade((byte) 3) ? 3 : 0
|
||||
//));
|
||||
this.crystalTime = 0.0F;
|
||||
AuraManager.addFluxToClosest(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new AspectList().add(Aspect.CRYSTAL, 5)
|
||||
);
|
||||
}
|
||||
|
||||
if (this.crystalTime == 0.0F && this.crystalizerItemStacks[6] != null
|
||||
&& this.crystalizerItemStacks[6].getItem() == ConfigItems.itemShard) {
|
||||
if (this.crystalizerItemStacks[6].isItemEqual(
|
||||
// TODO: definetely wrong meta
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6)
|
||||
)) {
|
||||
this.crystalTime = this.maxTime;
|
||||
} else {
|
||||
this.crystalTime = this.maxTime * 2.0F / 3.0F;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.boostDelay <= 0 || this.boostDelay == 10) {
|
||||
// TODO: magic boost
|
||||
//ac = (SIAuraChunk) mod_ThaumCraft.AuraHM.get(Arrays.asList(
|
||||
// auraX, auraZ, ThaumCraftCore.getDimension(super.worldObj)
|
||||
//));
|
||||
//if (ac != null && this.boost < 10 && ac.boost > 0) {
|
||||
// ++this.boost;
|
||||
// --ac.boost;
|
||||
//}
|
||||
}
|
||||
|
||||
if (this.boostDelay <= 0) {
|
||||
if (this.boost > 0) {
|
||||
--this.boost;
|
||||
}
|
||||
|
||||
this.boostDelay = 20;
|
||||
} else {
|
||||
--this.boostDelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addCrystal(int type) {
|
||||
ItemStack itemstack = new ItemStack(ConfigItems.itemShard, 1, type);
|
||||
if (this.crystalizerItemStacks[type] == null) {
|
||||
this.crystalizerItemStacks[type] = itemstack.copy();
|
||||
} else if (this.crystalizerItemStacks[type].isItemEqual(itemstack) && this.crystalizerItemStacks[type].stackSize < itemstack.getMaxStackSize()) {
|
||||
ItemStack var10000 = this.crystalizerItemStacks[type];
|
||||
var10000.stackSize += itemstack.stackSize;
|
||||
}
|
||||
|
||||
--this.crystalizerItemStacks[6].stackSize;
|
||||
if (this.crystalizerItemStacks[6].stackSize <= 0) {
|
||||
this.crystalizerItemStacks[6] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
if (super.worldObj.getTileEntity(super.xCoord, super.yCoord, super.zCoord)
|
||||
!= this) {
|
||||
return false;
|
||||
} else {
|
||||
return entityplayer.getDistanceSq(
|
||||
(double) super.xCoord + 0.5,
|
||||
(double) super.yCoord + 0.5,
|
||||
(double) super.zCoord + 0.5
|
||||
)
|
||||
<= 64.0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return face != ForgeDirection.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptUpgrade(byte upgrade) {
|
||||
if (upgrade != 0 && upgrade != 1 && upgrade != 3) {
|
||||
return false;
|
||||
} else {
|
||||
return !this.hasUpgrade(upgrade);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUpgradeLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getUpgrades() {
|
||||
return this.upgrades;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUpgrade(byte upgrade) {
|
||||
if (this.upgrades.length < 1) {
|
||||
return false;
|
||||
} else {
|
||||
for (int a = 0; a < this.getUpgradeLimit(); ++a) {
|
||||
if (this.upgrades[a] == upgrade) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setUpgrade(byte upgrade) {
|
||||
for (int a = 0; a < this.getUpgradeLimit(); ++a) {
|
||||
if (this.upgrades[a] < 0 && this.canAcceptUpgrade(upgrade)) {
|
||||
this.upgrades[a] = upgrade;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean clearUpgrade(int index) {
|
||||
if (this.upgrades[index] >= 0) {
|
||||
this.upgrades[index] = -1;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int var1) {
|
||||
if (this.crystalizerItemStacks[var1] != null) {
|
||||
ItemStack var2 = this.crystalizerItemStacks[var1];
|
||||
this.crystalizerItemStacks[var1] = null;
|
||||
return var2;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "thaummach:crystallizer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
// TODO: WTF
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
if (side != 0 && side != 1) {
|
||||
return IntStream.rangeClosed(0, 5).toArray();
|
||||
} else {
|
||||
return new int[] { 6 };
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return this.isItemValidForSlot(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
// TODO: WTF
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,90 +1,133 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import dev.tilera.auracore.api.machine.IConnection;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
|
||||
import net.anvilcraft.thaummach.TMBlocks;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
|
||||
public class TileFilter extends TileConduit implements IConnection {
|
||||
public short taintedStore;
|
||||
public short stack;
|
||||
public class TileFilter extends TileConduit {
|
||||
public short taintedStore;
|
||||
public short stack;
|
||||
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (Math.round(super.prevdisplayPure) != Math.round(super.displayPure) || Math.round(super.prevdisplayTaint) != Math.round(super.displayTaint)) {
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
super.prevdisplayPure = super.displayPure;
|
||||
super.prevdisplayTaint = super.displayTaint;
|
||||
}
|
||||
|
||||
this.calculateSuction();
|
||||
if (super.taintSuction < 15) {
|
||||
this.setTaintSuction(15);
|
||||
}
|
||||
|
||||
if (this.getSuction((HelperLocation)null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
super.displayTaint = Math.max(super.displayTaint, MathHelper.clamp_float(super.taintedVis, 0.0F, super.maxVis));
|
||||
super.displayPure = Math.max(super.displayPure, MathHelper.clamp_float(super.pureVis, 0.0F, super.maxVis));
|
||||
if (super.displayTaint + super.displayPure < 0.1F) {
|
||||
super.displayTaint = 0.0F;
|
||||
super.displayPure = 0.0F;
|
||||
}
|
||||
|
||||
if (this.taintedStore < 40 + this.stack * 4 && super.taintedVis >= 0.025F) {
|
||||
++this.taintedStore;
|
||||
super.taintedVis -= 0.025F;
|
||||
this.stack = 0;
|
||||
|
||||
for(TileEntity te = super.worldObj.getTileEntity(super.xCoord, super.yCoord + 1, super.zCoord); te != null && te instanceof TileFilter && super.yCoord + 1 + this.stack < super.worldObj.getHeight(); te = super.worldObj.getTileEntity(super.xCoord, super.yCoord + 1 + this.stack, super.zCoord)) {
|
||||
++this.stack;
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (super.prevPure != super.pureVis
|
||||
|| super.prevTaint != super.taintedVis) {
|
||||
super.worldObj.markBlockForUpdate(
|
||||
super.xCoord, super.yCoord, super.zCoord
|
||||
);
|
||||
super.prevPure = super.pureVis;
|
||||
super.prevTaint = super.taintedVis;
|
||||
}
|
||||
|
||||
if (this.taintedStore % 16 == 0) {
|
||||
FXWisp ef = new FXWisp(super.worldObj, (double)((float)super.xCoord + 0.5F), (double)((float)super.yCoord + 0.8F + (float)this.stack), (double)((float)super.zCoord + 0.5F), (double)((float)super.xCoord + 0.5F + (super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat())), (double)((float)super.yCoord + 3.0F + (float)this.stack + super.worldObj.rand.nextFloat()), (double)((float)super.zCoord + 0.5F + (super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat())), 0.5F, 5);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
this.calculateSuction();
|
||||
if (super.taintSuction < 15) {
|
||||
this.setTaintSuction(15);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.taintedStore >= 40 + this.stack * 4) {
|
||||
int auraX = super.xCoord >> 4;
|
||||
int auraZ = super.zCoord >> 4;
|
||||
AuraManager.addTaintToClosest(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 1);
|
||||
this.taintedStore = 0;
|
||||
}
|
||||
if (this.getSuction((HelperLocation) null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (this.taintedStore < 40 + this.stack * 4 && super.taintedVis >= 0.025F) {
|
||||
++this.taintedStore;
|
||||
super.taintedVis -= 0.025F;
|
||||
this.stack = 0;
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.taintedStore = nbttagcompound.getShort("taintedStore");
|
||||
}
|
||||
for (TileEntity te = super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord + 1, super.zCoord
|
||||
);
|
||||
te != null && te instanceof TileFilter
|
||||
&& super.yCoord + 1 + this.stack < super.worldObj.getHeight();
|
||||
te = super.worldObj.getTileEntity(
|
||||
super.xCoord, super.yCoord + 1 + this.stack, super.zCoord
|
||||
)) {
|
||||
++this.stack;
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("taintedStore", this.taintedStore);
|
||||
}
|
||||
if (this.taintedStore % 16 == 0) {
|
||||
FXWisp ef = new FXWisp(
|
||||
super.worldObj,
|
||||
(double) ((float) super.xCoord + 0.5F),
|
||||
(double) ((float) super.yCoord + 0.8F + (float) this.stack),
|
||||
(double) ((float) super.zCoord + 0.5F),
|
||||
(double
|
||||
) ((float) super.xCoord + 0.5F
|
||||
+ (super.worldObj.rand.nextFloat()
|
||||
- super.worldObj.rand.nextFloat())),
|
||||
(double
|
||||
) ((float) super.yCoord + 3.0F + (float) this.stack
|
||||
+ super.worldObj.rand.nextFloat()),
|
||||
(double
|
||||
) ((float) super.zCoord + 0.5F
|
||||
+ (super.worldObj.rand.nextFloat()
|
||||
- super.worldObj.rand.nextFloat())),
|
||||
0.5F,
|
||||
5
|
||||
);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getConnectable(ForgeDirection face) { //TODO: BLOCK
|
||||
if (super.worldObj.getBlock(super.xCoord, super.yCoord - 1, super.zCoord) == new BlockApparatusFragile() && super.worldObj.getBlockMetadata(super.xCoord, super.yCoord - 1, super.zCoord) == this.getBlockMetadata()) {
|
||||
return false;
|
||||
} else {
|
||||
switch (face) {
|
||||
case UP:
|
||||
case UNKNOWN:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.taintedStore >= 40 + this.stack * 4) {
|
||||
AuraManager.addTaintToClosest(
|
||||
this.worldObj, this.xCoord, this.yCoord, this.zCoord, 1
|
||||
);
|
||||
this.taintedStore = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.taintedStore = nbttagcompound.getShort("taintedStore");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("taintedStore", this.taintedStore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setShort("taintedStore", this.taintedStore);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.taintedStore = nbt.getShort("taintedStore");
|
||||
}
|
||||
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
if (super.worldObj.getBlock(super.xCoord, super.yCoord - 1, super.zCoord)
|
||||
== TMBlocks.apparatusFragile
|
||||
&& super.worldObj.getBlockMetadata(
|
||||
super.xCoord, super.yCoord - 1, super.zCoord
|
||||
) == this.getBlockMetadata()) {
|
||||
return false;
|
||||
} else {
|
||||
switch (face) {
|
||||
case UP:
|
||||
case UNKNOWN:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import dev.tilera.auracore.api.HelperLocation;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TilePurifier extends TileConduit {
|
||||
public int orientation = 0;
|
||||
|
||||
public TilePurifier() {
|
||||
super.pureVis = 0.0F;
|
||||
super.taintedVis = 0.0F;
|
||||
this.orientation = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
this.calculateSuction();
|
||||
if (super.taintSuction < 5) {
|
||||
this.setTaintSuction(5);
|
||||
}
|
||||
|
||||
if (this.getSuction((HelperLocation) null) > 0) {
|
||||
this.equalizeWithNeighbours();
|
||||
}
|
||||
|
||||
if ((double) super.taintedVis > 0.01) {
|
||||
super.taintedVis -= 0.01F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.orientation = nbttagcompound.getShort("orientation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("orientation", (short) this.orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setShort("orientation", (short) this.orientation);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.orientation = nbt.getShort("orientation");
|
||||
this.worldObj.markBlockRangeForRenderUpdate(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
if (this.orientation != 1 && this.orientation != 3
|
||||
|| face != ForgeDirection.EAST && face != ForgeDirection.WEST) {
|
||||
return (this.orientation == 0 || this.orientation == 2)
|
||||
&& (face == ForgeDirection.SOUTH || face == ForgeDirection.NORTH);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean rotate() {
|
||||
++this.orientation;
|
||||
if (this.orientation > 3) {
|
||||
this.orientation -= 4;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
itemGroup.thaummach=Thaumic Machinery
|
||||
|
||||
# ---- BLOCKS ----
|
||||
|
||||
tile.thaummach:apparatus_fragile_conduit.name=Vis Conduit
|
||||
tile.thaummach:apparatus_fragile_conduit_pump.name=Vis Pump
|
||||
tile.thaummach:apparatus_fragile_conduit_tank.name=Vis Tank
|
||||
tile.thaummach:apparatus_fragile_conduit_valve.name=Vis Valve
|
||||
tile.thaummach:apparatus_fragile_conduit_valve_advanced.name=Advanced Vis Valve
|
||||
tile.thaummach:apparatus_fragile_filter.name=Vis Filter
|
||||
tile.thaummach:apparatus_fragile_purifier.name=Vis Purifier
|
||||
|
||||
tile.thaummach:apparatus_metal_normal_crucible.name=Crucible
|
||||
tile.thaummach:apparatus_metal_eyes_crucible.name=Crucible of Eyes
|
||||
tile.thaummach:apparatus_metal_thaumium_crucible.name=Thaumium Crucible
|
||||
tile.thaummach:apparatus_metal_soul_crucible.name=Soul Crucible
|
||||
tile.thaummach:apparatus_metal_arcane_furnace.name=Arcane Furnace
|
||||
tile.thaummach:apparatus_metal_generator.name=Thaumic Generator
|
||||
tile.thaummach:apparatus_metal_crystallizer.name=Thaumic Crystallizer
|
||||
tile.thaummach:apparatus_metal_bore.name=Arcane Bore
|
||||
tile.thaummach:apparatus_metal_void_chest.name=Void Chest
|
||||
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
|
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 467 B |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 517 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 198 B |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 555 B |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 678 B |
After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 322 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 580 B |
After Width: | Height: | Size: 597 B |
After Width: | Height: | Size: 616 B |
After Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 387 B |
After Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 448 B |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 523 B |
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 682 B |
After Width: | Height: | Size: 693 B |
After Width: | Height: | Size: 349 B |
After Width: | Height: | Size: 364 B |
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 174 B |
After Width: | Height: | Size: 491 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 793 B |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 695 B |
After Width: | Height: | Size: 378 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 513 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 488 B |
After Width: | Height: | Size: 606 B |
After Width: | Height: | Size: 563 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 64 KiB |
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"animation": {
|
||||
"width": 1,
|
||||
"height": 51,
|
||||
"frametime": 1,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
46,
|
||||
47,
|
||||
48,
|
||||
49,
|
||||
50
|
||||
]
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 474 B |
After Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 583 B |