feat: render & generate monoliths

This commit is contained in:
LordMZTE 2023-06-02 19:17:02 +02:00
parent 7805180516
commit e4c8609b09
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
24 changed files with 1386 additions and 182 deletions

View File

@ -28,8 +28,8 @@ import net.anvilcraft.thaummach.render.tile.TileEnchanterRenderer;
import net.anvilcraft.thaummach.render.tile.TileGeneratorRenderer;
import net.anvilcraft.thaummach.render.tile.TileRepairerRenderer;
import net.anvilcraft.thaummach.render.tile.TileSealRenderer;
import net.anvilcraft.thaummach.render.tile.TileVoidChestRenderer;
import net.anvilcraft.thaummach.render.tile.TileVoidInterfaceRenderer;
import net.anvilcraft.thaummach.render.tile.TileVoidRenderer;
import net.anvilcraft.thaummach.tiles.TileArcaneFurnace;
import net.anvilcraft.thaummach.tiles.TileBore;
import net.anvilcraft.thaummach.tiles.TileCondenser;
@ -44,12 +44,15 @@ import net.anvilcraft.thaummach.tiles.TileDuplicator;
import net.anvilcraft.thaummach.tiles.TileEnchanter;
import net.anvilcraft.thaummach.tiles.TileFilter;
import net.anvilcraft.thaummach.tiles.TileGenerator;
import net.anvilcraft.thaummach.tiles.TileMonolith;
import net.anvilcraft.thaummach.tiles.TilePurifier;
import net.anvilcraft.thaummach.tiles.TileRepairer;
import net.anvilcraft.thaummach.tiles.TileSeal;
import net.anvilcraft.thaummach.tiles.TileSoulBrazier;
import net.anvilcraft.thaummach.tiles.TileVoidChest;
import net.anvilcraft.thaummach.tiles.TileVoidCube;
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
import net.anvilcraft.thaummach.tiles.TileVoidLock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -78,7 +81,7 @@ public class ClientProxy extends CommonProxy {
GameRegistry.registerTileEntity(TileCrucible.class, "crucible");
GameRegistry.registerTileEntity(TileFilter.class, "filter");
GameRegistry.registerTileEntity(TilePurifier.class, "purifier");
GameRegistry.registerTileEntity(TileSoulBrazier.class, "soulBrazier");
GameRegistry.registerTileEntity(TileSoulBrazier.class, "soul_brazier");
ClientRegistry.registerTileEntity(TileBore.class, "bore", new TileBoreRenderer());
ClientRegistry.registerTileEntity(TileCondenser.class, "condenser", new TileCondenserRenderer());
@ -87,10 +90,13 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.registerTileEntity(TileDuplicator.class, "duplicator", new TileDuplicatorRenderer());
ClientRegistry.registerTileEntity(TileEnchanter.class, "enchanter", new TileEnchanterRenderer());
ClientRegistry.registerTileEntity(TileGenerator.class, "generator", new TileGeneratorRenderer());
ClientRegistry.registerTileEntity(TileMonolith.class, "monolith", new TileVoidRenderer());
ClientRegistry.registerTileEntity(TileRepairer.class, "repairer", new TileRepairerRenderer());
ClientRegistry.registerTileEntity(TileSeal.class, "seal", new TileSealRenderer());
ClientRegistry.registerTileEntity(TileVoidChest.class, "voidChest", new TileVoidChestRenderer());
ClientRegistry.registerTileEntity(TileVoidInterface.class, "voidInterface", new TileVoidInterfaceRenderer());
ClientRegistry.registerTileEntity(TileVoidChest.class, "void_chest", new TileVoidRenderer());
ClientRegistry.registerTileEntity(TileVoidCube.class, "void_cube", new TileVoidRenderer());
ClientRegistry.registerTileEntity(TileVoidInterface.class, "void_interface", new TileVoidInterfaceRenderer());
ClientRegistry.registerTileEntity(TileVoidLock.class, "void_lock", new TileVoidRenderer());
// clang-format on
}

View File

@ -27,12 +27,15 @@ import net.anvilcraft.thaummach.tiles.TileDuplicator;
import net.anvilcraft.thaummach.tiles.TileEnchanter;
import net.anvilcraft.thaummach.tiles.TileFilter;
import net.anvilcraft.thaummach.tiles.TileGenerator;
import net.anvilcraft.thaummach.tiles.TileMonolith;
import net.anvilcraft.thaummach.tiles.TilePurifier;
import net.anvilcraft.thaummach.tiles.TileRepairer;
import net.anvilcraft.thaummach.tiles.TileSeal;
import net.anvilcraft.thaummach.tiles.TileSoulBrazier;
import net.anvilcraft.thaummach.tiles.TileVoidChest;
import net.anvilcraft.thaummach.tiles.TileVoidCube;
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
import net.anvilcraft.thaummach.tiles.TileVoidLock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
@ -59,12 +62,15 @@ public class CommonProxy implements IGuiHandler {
GameRegistry.registerTileEntity(TileEnchanter.class, "enchanter");
GameRegistry.registerTileEntity(TileFilter.class, "filter");
GameRegistry.registerTileEntity(TileGenerator.class, "generator");
GameRegistry.registerTileEntity(TileMonolith.class, "monolith");
GameRegistry.registerTileEntity(TilePurifier.class, "purifier");
GameRegistry.registerTileEntity(TileRepairer.class, "repairer");
GameRegistry.registerTileEntity(TileSeal.class, "seal");
GameRegistry.registerTileEntity(TileSoulBrazier.class, "soulBrazier");
GameRegistry.registerTileEntity(TileVoidChest.class, "voidChest");
GameRegistry.registerTileEntity(TileVoidInterface.class, "voidInterface");
GameRegistry.registerTileEntity(TileSoulBrazier.class, "soul_brazier");
GameRegistry.registerTileEntity(TileVoidChest.class, "void_chest");
GameRegistry.registerTileEntity(TileVoidCube.class, "void_cube");
GameRegistry.registerTileEntity(TileVoidInterface.class, "void_interface");
GameRegistry.registerTileEntity(TileVoidLock.class, "void_lock");
// clang-format on
}

View File

@ -5,6 +5,7 @@ import net.anvilcraft.thaummach.blocks.BlockApparatusFragile;
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
import net.anvilcraft.thaummach.blocks.BlockApparatusStone;
import net.anvilcraft.thaummach.blocks.BlockApparatusWood;
import net.anvilcraft.thaummach.blocks.BlockHidden;
import net.anvilcraft.thaummach.blocks.BlockSeal;
import net.anvilcraft.thaummach.items.ItemBlockApparatusFragile;
import net.anvilcraft.thaummach.items.ItemBlockApparatusMetal;
@ -18,21 +19,17 @@ public class TMBlocks {
public static Block apparatusMetal;
public static Block apparatusStone;
public static Block apparatusWood;
public static Block hidden;
public static Block seal;
public static void init() {
// clang-format off
apparatusFragile = new BlockApparatusFragile();
apparatusMetal = new BlockApparatusMetal();
apparatusStone = new BlockApparatusStone();
apparatusWood = new BlockApparatusWood();
seal = new BlockSeal();
GameRegistry.registerBlock(apparatusFragile, ItemBlockApparatusFragile.class, "apparatus_fragile");
GameRegistry.registerBlock(apparatusMetal, ItemBlockApparatusMetal.class, "apparatus_metal");
GameRegistry.registerBlock(apparatusStone, ItemBlockApparatusStone.class, "apparatus_stone");
GameRegistry.registerBlock(apparatusWood, ItemBlockApparatusWood.class, "apparatus_wood");
GameRegistry.registerBlock(seal, ItemSeal.class, "seal");
GameRegistry.registerBlock(apparatusFragile = new BlockApparatusFragile(), ItemBlockApparatusFragile.class, "apparatus_fragile");
GameRegistry.registerBlock(apparatusMetal = new BlockApparatusMetal(), ItemBlockApparatusMetal.class, "apparatus_metal");
GameRegistry.registerBlock(apparatusStone = new BlockApparatusStone(), ItemBlockApparatusStone.class, "apparatus_stone");
GameRegistry.registerBlock(apparatusWood = new BlockApparatusWood(), ItemBlockApparatusWood.class, "apparatus_wood");
GameRegistry.registerBlock(hidden = new BlockHidden(), "hidden");
GameRegistry.registerBlock(seal = new BlockSeal(), ItemSeal.class, "seal");
// clang-format on
}
}

View File

@ -26,44 +26,24 @@ public class TMItems {
public static Item voidBracelet;
public static void init() {
crystallineBell = new ItemCrystallineBell();
GameRegistry.registerItem(crystallineBell = new ItemCrystallineBell(), "crystalline_bell");
detector = new ItemDetector();
GameRegistry.registerItem(detector = new ItemDetector(), "detector");
focus0 = new ItemFocus(0);
focus1 = new ItemFocus(1);
focus2 = new ItemFocus(2);
focus3 = new ItemFocus(3);
focus4 = new ItemFocus(4);
GameRegistry.registerItem(focus0 = new ItemFocus(0), "focus0");
GameRegistry.registerItem(focus1 = new ItemFocus(1), "focus1");
GameRegistry.registerItem(focus2 = new ItemFocus(2), "focus2");
GameRegistry.registerItem(focus3 = new ItemFocus(3), "focus3");
GameRegistry.registerItem(focus4 = new ItemFocus(4), "focus4");
runicEssence = new ItemRunicEssence();
GameRegistry.registerItem(runicEssence = new ItemRunicEssence(), "runic_essence");
singularity = new ItemSingularity();
GameRegistry.registerItem(singularity = new ItemSingularity(), "singularity");
soulFragment = new ItemSoulFragment();
GameRegistry.registerItem(soulFragment = new ItemSoulFragment(), "soul_fragment");
upgrade = new ItemUpgrade();
GameRegistry.registerItem(upgrade = new ItemUpgrade(), "upgrade");
voidBracelet = new ItemVoidBracelet();
GameRegistry.registerItem(crystallineBell, "crystalline_bell");
GameRegistry.registerItem(detector, "detector");
GameRegistry.registerItem(focus0, "focus0");
GameRegistry.registerItem(focus1, "focus1");
GameRegistry.registerItem(focus2, "focus2");
GameRegistry.registerItem(focus3, "focus3");
GameRegistry.registerItem(focus4, "focus4");
GameRegistry.registerItem(runicEssence, "runic_essence");
GameRegistry.registerItem(singularity, "singularity");
GameRegistry.registerItem(soulFragment, "soul_fragment");
GameRegistry.registerItem(upgrade, "upgrade");
GameRegistry.registerItem(voidBracelet, "voidBracelet");
GameRegistry.registerItem(voidBracelet = new ItemVoidBracelet(), "voidBracelet");
}
}

View File

@ -9,6 +9,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import dev.tilera.auracore.api.HelperLocation;
import net.anvilcraft.thaummach.entities.EntitySingularity;
@ -22,6 +23,7 @@ import net.anvilcraft.thaummach.packets.PacketFXSparkle;
import net.anvilcraft.thaummach.packets.PacketFXWisp;
import net.anvilcraft.thaummach.tiles.TileSeal;
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
import net.anvilcraft.thaummach.worldgen.TMWorldGenerator;
import net.minecraft.world.World;
@Mod(modid = "thaummach")
@ -53,6 +55,8 @@ public class ThaumicMachinery {
// clang-format on
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
GameRegistry.registerWorldGenerator(new TMWorldGenerator(), 0);
proxy.registerTileEntities();
TMBlocks.init();
TMItems.init();

View File

@ -123,7 +123,7 @@ public class BlockApparatusMetal extends BlockApparatus {
this.iconSoulCrucibleTopInv = reg.registerIcon("thaummach:soul_crucible_top_inv");
this.iconTankBottom = reg.registerIcon("thaummach:reinforced_tank_bottom");
this.iconTankSide = reg.registerIcon("thaummach:reinforced_tank_side");
this.iconVoidChestBottom = reg.registerIcon("thaummach:void_chest_bottom");
this.iconVoidChestBottom = reg.registerIcon("thaummach:eldritch_stone");
this.iconVoidChestSide = reg.registerIcon("thaummach:void_chest_side");
this.iconVoidChestSideTransparent
= reg.registerIcon("thaummach:void_chest_side_transparent");

View File

@ -0,0 +1,375 @@
package net.anvilcraft.thaummach.blocks;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
import dev.tilera.auracore.aura.AuraManager;
import net.anvilcraft.thaummach.particles.FXWisp;
import net.anvilcraft.thaummach.tiles.TileMonolith;
import net.anvilcraft.thaummach.tiles.TileVoidCube;
import net.anvilcraft.thaummach.tiles.TileVoidLock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
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.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.client.fx.WRVector3;
import thaumcraft.client.fx.bolt.FXLightningBolt;
public class BlockHidden extends BlockContainer {
public IIcon iconDefault;
public IIcon iconEmpty;
public IIcon iconMonolithBottom;
public IIcon iconMonolithEnd;
public IIcon iconMonolithMiddle;
public IIcon iconMonolithTop;
public BlockHidden() {
super(Material.rock);
this.setBlockUnbreakable();
this.setResistance(6000000.0F);
this.setStepSound(Block.soundTypeStone);
this.setBlockName("tcbhidden");
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setTickRandomly(true);
}
@Override
public void registerBlockIcons(IIconRegister register) {
Function<String, IIcon> reg = (n) -> register.registerIcon("thaummach:" + n);
this.iconDefault = reg.apply("eldritch_stone");
this.iconEmpty = reg.apply("empty");
this.iconMonolithBottom = reg.apply("monolith_bottom");
this.iconMonolithEnd = reg.apply("monolith_end");
this.iconMonolithMiddle = reg.apply("monolith_middle");
this.iconMonolithTop = reg.apply("monolith_top");
}
@Override
public int getLightValue() {
return 1;
}
@Override
@SuppressWarnings("rawtypes")
public void getSubBlocks(Item arg0, CreativeTabs arg1, List arg2) {}
@Override
public float getBlockHardness(World w, int x, int y, int z) {
int meta = w.getBlockMetadata(x, y, z);
return meta == 4 ? 10.0F : super.getBlockHardness(w, x, y, z);
}
@Override
public TileEntity createNewTileEntity(World world, int md) {
switch (md) {
case 2:
return new TileMonolith();
case 3:
case 5:
return new TileVoidCube();
case 4:
return new TileVoidLock();
}
return null;
//if (md != 3 && md != 5) {
// if (md == 1) {
// return new TileVoidHole();
// } else if (md == 2) {
// return new TileMonolith();
// } else {
// return (TileEntity) (md == 4 ? new TileVoidLock() : super.getBlockEntity(md));
// }
//} else {
// return new TileVoidCube();
//}
}
@Override
public void breakBlock(
World world,
int x,
int y,
int z,
// useless parameters
Block alec1,
int alec2
) {
//if (md == 5) {
// SISpecialTile pd = new SISpecialTile(
// i,
// j,
// k,
// (byte) 0,
// (byte) ModLoader.getMinecraftInstance().thePlayer.dimension,
// (byte) 2
// );
// mod_ThaumCraft.DeleteSpecialTileFromList(pd);
//}
super.breakBlock(world, x, y, z, alec1, alec2);
}
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
switch (world.getBlockMetadata(x, y, z)) {
case 1:
case 2:
return false;
default:
return true;
}
}
@Override
public void onNeighborBlockChange(World world, int i, int j, int k, Block l) {
super.onNeighborBlockChange(world, i, j, k, l);
int md = world.getBlockMetadata(i, j, k);
if (md == 5) {
try {
TileVoidCube tvc = (TileVoidCube) world.getTileEntity(i, j, k);
boolean[] test = new boolean[] { false, false, false, false };
int a;
for (a = 0; a < 4; ++a) {
int xx = 0;
int zz = 0;
switch (a) {
case 0:
xx = 1;
break;
case 1:
xx = -1;
break;
case 2:
zz = 1;
break;
case 3:
zz = -1;
}
TileEntity tvc0 = world.getTileEntity(i + xx, j, k + zz);
if (tvc0 != null && ((TileVoidCube) tvc0).placed != -1
&& ((TileVoidCube) tvc0).placed != tvc.runes[a]) {
((TileVoidCube) tvc0).placed = -1;
world.newExplosion(
(Entity) null,
(double) ((float) tvc0.xCoord + 0.5F),
(double) ((float) tvc0.yCoord + 1.5F),
(double) ((float) tvc0.zCoord + 0.5F),
1.0F,
false,
false
);
} else if (tvc0 != null && ((TileVoidCube)tvc0).placed != -1 &&
((TileVoidCube)tvc0).placed == tvc.runes[a]) {
test[a] = true;
}
}
if (test[0] && test[1] && test[2] && test[3]) {
world.playSoundEffect(
(double) ((float) i + 0.5F),
(double) ((float) j + 0.5F),
(double) ((float) k + 0.5F),
"thaummach:rumble",
4.0F,
1.0F
);
for (a = 0; a < 50; ++a) {
FXWisp ef = new FXWisp(
world,
(double) ((float) i + world.rand.nextFloat()),
(double) ((float) j - world.rand.nextFloat() * 2.0F),
(double) ((float) k + world.rand.nextFloat()),
(double) ((float) i + world.rand.nextFloat()),
(double) ((float) j + world.rand.nextFloat() * 2.0F + 4.0F),
(double) ((float) k + world.rand.nextFloat()),
0.5F,
5
);
ef.shrink = true;
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
}
tvc.generate();
world.setBlockToAir(i, j, k);
}
} catch (Exception var13) {
var13.printStackTrace();
}
}
}
@Override
public void onBlockAdded(World world, int i, int j, int k) {
super.onBlockAdded(world, i, j, k);
int md = world.getBlockMetadata(i, j, k);
TileVoidCube tvc;
if (md == 3) {
try {
tvc = (TileVoidCube) world.getTileEntity(i, j, k);
tvc.runes[0] = (byte) world.rand.nextInt(6);
} catch (Exception var12) {}
}
if (md == 5) {
try {
tvc = (TileVoidCube) world.getTileEntity(i, j, k);
TileVoidCube tvc0 = (TileVoidCube) world.getTileEntity(i + 1, j, k);
TileVoidCube tvc1 = (TileVoidCube) world.getTileEntity(i - 1, j, k);
TileVoidCube tvc2 = (TileVoidCube) world.getTileEntity(i, j, k + 1);
TileVoidCube tvc3 = (TileVoidCube) world.getTileEntity(i, j, k - 1);
tvc.runes[0] = tvc0.runes[0];
tvc.runes[1] = tvc1.runes[0];
tvc.runes[2] = tvc2.runes[0];
tvc.runes[3] = tvc3.runes[0];
} catch (Exception var11) {}
}
}
@Override
public boolean onBlockActivated(
World world,
int i,
int j,
int k,
EntityPlayer entityplayer,
// useless parameters
int alec1,
float alec2,
float alec3,
float alec4
) {
return false;
}
@Override
public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int l) {
int md = iblockaccess.getBlockMetadata(i, j, k);
if (md == 0) {
return this.iconDefault;
} else if (md == 3 && l != 1) {
return this.iconDefault;
} else {
return md == 4 && l < 2 ? this.iconDefault : this.iconEmpty;
}
}
@Override
public IIcon getIcon(int side, int meta) {
if (meta == 0) {
return this.iconDefault;
} else if (meta == 3) {
return side != 1 ? this.iconDefault : this.iconEmpty;
} else if (meta == 4) {
return side < 2 ? this.iconDefault : this.iconEmpty;
} else {
return this.iconEmpty;
}
}
@Override
@SuppressWarnings("rawtypes")
public void addCollisionBoxesToList(
World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity alec
) {
int md = world.getBlockMetadata(x, y, z);
if (md != 1) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, alec);
}
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World w, int i, int j, int k) {
return AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
@Override
public void updateTick(World world, int x, int y, int z, Random random) {
if (!world.isRemote) {
int md = world.getBlockMetadata(x, y, z);
if (md == 1 || md == 2) {
AuraManager.addFluxToClosest(world, x, y, z, new AspectList().add(Aspect.TAINT, 1));
}
}
}
@Override
public void randomDisplayTick(World world, int i, int j, int k, Random random) {
int md = world.getBlockMetadata(i, j, k);
if (md == 2 && world.rand.nextInt(5) == 0) {
FXLightningBolt bolt;
if (world.getBlock(i, j - 1, k) != this) {
bolt = new FXLightningBolt(
world,
new WRVector3((double) i + 0.5, (double) j + 0.25, (double) k + 0.5),
new WRVector3(
(double) i + 0.5
+ (double) ((world.rand.nextFloat() - world.rand.nextFloat()) * 2.0F),
(double) (j - 2),
(double) k + 0.5
+ (double) ((world.rand.nextFloat() - world.rand.nextFloat()) * 2.0F)
),
world.rand.nextLong()
);
bolt.setMultiplier(4.0F);
bolt.defaultFractal();
bolt.setType(5);
bolt.finalizeBolt();
}
if (world.getBlock(i, j + 1, k) != this) {
bolt = new FXLightningBolt(
world,
new WRVector3((double) i + 0.5, (double) j + 0.75, (double) k + 0.5),
new WRVector3(
(double) i + 0.5
+ (double) ((world.rand.nextFloat() - world.rand.nextFloat()) * 2.0F),
(double) (j + 3),
(double) k + 0.5
+ (double) ((world.rand.nextFloat() - world.rand.nextFloat()) * 2.0F)
),
world.rand.nextLong()
);
bolt.setMultiplier(4.0F);
bolt.defaultFractal();
bolt.setType(5);
bolt.finalizeBolt();
}
}
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
}

View File

@ -4,16 +4,27 @@ import java.nio.FloatBuffer;
import java.util.Random;
import cpw.mods.fml.client.FMLClientHandler;
import net.anvilcraft.alec.jalec.factories.AlecUnexpectedRuntimeErrorExceptionFactory;
import net.anvilcraft.thaummach.TMBlocks;
import net.anvilcraft.thaummach.blocks.BlockHidden;
import net.anvilcraft.thaummach.tiles.TileMonolith;
import net.anvilcraft.thaummach.tiles.TileVoidChest;
import net.anvilcraft.thaummach.tiles.TileVoidCube;
import net.anvilcraft.thaummach.tiles.TileVoidLock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
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 TileVoidChestRenderer extends TileEntitySpecialRenderer {
public class TileVoidRenderer extends TileEntitySpecialRenderer {
FloatBuffer fBuffer = GLAllocation.createDirectFloatBuffer(16);
private FloatBuffer calcFloatBuffer(float f, float f1, float f2, float f3) {
@ -43,9 +54,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -93,9 +102,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-px, -pz, -py);
GL11.glTranslatef(
ActiveRenderInfo.objectX * f5 / f9,
ActiveRenderInfo.objectZ * f5 / f9,
-py
ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectZ * f5 / f9, -py
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -141,9 +148,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -191,9 +196,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-f1, -f3, -f2);
GL11.glTranslatef(
ActiveRenderInfo.objectX * f5 / f9,
ActiveRenderInfo.objectZ * f5 / f9,
-f2
ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectZ * f5 / f9, -f2
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -239,9 +242,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -289,9 +290,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-px, -py, -pz);
GL11.glTranslatef(
ActiveRenderInfo.objectX * f5 / f9,
ActiveRenderInfo.objectY * f5 / f9,
-pz
ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectY * f5 / f9, -pz
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -337,9 +336,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -387,9 +384,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-px, -py, -pz);
GL11.glTranslatef(
ActiveRenderInfo.objectX * f5 / f9,
ActiveRenderInfo.objectY * f5 / f9,
-pz
ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectY * f5 / f9, -pz
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -435,9 +430,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -485,9 +478,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-pz, -py, -px);
GL11.glTranslatef(
ActiveRenderInfo.objectZ * f5 / f9,
ActiveRenderInfo.objectY * f5 / f9,
-px
ActiveRenderInfo.objectZ * f5 / f9, ActiveRenderInfo.objectY * f5 / f9, -px
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -533,9 +524,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
float f6 = 0.0625F;
float f7 = 1.0F / (f5 + 1.0F);
if (i == 0) {
this.bindTexture(
new ResourceLocation("thaummach", "textures/misc/tunnel.png")
);
this.bindTexture(new ResourceLocation("thaummach", "textures/misc/tunnel.png"));
f7 = 0.1F;
f5 = 65.0F;
f6 = 0.125F;
@ -583,9 +572,7 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
GL11.glTranslatef(-pz, -py, -px);
GL11.glTranslatef(
ActiveRenderInfo.objectZ * f5 / f9,
ActiveRenderInfo.objectY * f5 / f9,
-px
ActiveRenderInfo.objectZ * f5 / f9, ActiveRenderInfo.objectY * f5 / f9, -px
);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@ -619,9 +606,72 @@ public class TileVoidChestRenderer extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
this.drawPlaneZNeg(x, y, z, f);
this.drawPlaneZPos(x, y, z, f);
this.drawPlaneXNeg(x, y, z, f);
this.drawPlaneXPos(x, y, z, f);
if (te instanceof TileVoidChest) {
this.drawPlaneZNeg(x, y, z, f);
this.drawPlaneZPos(x, y, z, f);
this.drawPlaneXNeg(x, y, z, f);
this.drawPlaneXPos(x, y, z, f);
} else if (te instanceof TileVoidCube || te instanceof TileVoidLock) {
this.drawPlaneYNeg(x, y, z, f);
this.drawPlaneYPos(x, y, z, f);
this.drawPlaneZNeg(x, y, z, f);
this.drawPlaneZPos(x, y, z, f);
this.drawPlaneXNeg(x, y, z, f);
this.drawPlaneXPos(x, y, z, f);
} else if (te instanceof TileMonolith) {
BlockHidden block = (BlockHidden) TMBlocks.hidden;
int b = Minecraft.getMinecraft().thePlayer.ticksExisted;
float bob = MathHelper.sin((float) b / 10.0F) * 0.1F + 0.1F;
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) (y + bob), (float) z);
RenderBlocks rb = RenderBlocks.getInstance();
rb.setRenderBounds(0, 0, 0, 1, 1, 1);
this.bindTexture(TextureMap.locationBlocksTexture);
if (!(te.getWorldObj().getTileEntity(te.xCoord, te.yCoord + 1, te.zCoord)
instanceof TileMonolith)) {
Tessellator.instance.startDrawingQuads();
rb.renderFaceYPos(block, 0, 0, 0, block.iconMonolithEnd);
rb.renderFaceXPos(block, 0, 0, 0, block.iconMonolithTop);
rb.renderFaceXNeg(block, 0, 0, 0, block.iconMonolithTop);
rb.renderFaceZPos(block, 0, 0, 0, block.iconMonolithTop);
rb.renderFaceZNeg(block, 0, 0, 0, block.iconMonolithTop);
Tessellator.instance.draw();
this.drawPlaneYPos(0, 0, 0, f);
this.drawPlaneXPos(0, 0, 0, f);
this.drawPlaneXNeg(0, 0, 0, f);
this.drawPlaneZPos(0, 0, 0, f);
this.drawPlaneZNeg(0, 0, 0, f);
} else if (!(te.getWorldObj().getTileEntity(te.xCoord, te.yCoord - 1, te.zCoord)
instanceof TileMonolith)) {
Tessellator.instance.startDrawingQuads();
rb.renderFaceYNeg(block, 0, 0, 0, block.iconMonolithEnd);
rb.renderFaceXPos(block, 0, 0, 0, block.iconMonolithBottom);
rb.renderFaceXNeg(block, 0, 0, 0, block.iconMonolithBottom);
rb.renderFaceZPos(block, 0, 0, 0, block.iconMonolithBottom);
rb.renderFaceZNeg(block, 0, 0, 0, block.iconMonolithBottom);
Tessellator.instance.draw();
this.drawPlaneYNeg(0, 0, 0, f);
this.drawPlaneXPos(0, 0, 0, f);
this.drawPlaneXNeg(0, 0, 0, f);
this.drawPlaneZPos(0, 0, 0, f);
this.drawPlaneZNeg(0, 0, 0, f);
} else {
Tessellator.instance.startDrawingQuads();
rb.renderFaceXPos(block, 0, 0, 0, block.iconMonolithMiddle);
rb.renderFaceXNeg(block, 0, 0, 0, block.iconMonolithMiddle);
rb.renderFaceZPos(block, 0, 0, 0, block.iconMonolithMiddle);
rb.renderFaceZNeg(block, 0, 0, 0, block.iconMonolithMiddle);
Tessellator.instance.draw();
this.drawPlaneXPos(0, 0, 0, f);
this.drawPlaneXNeg(0, 0, 0, f);
this.drawPlaneZPos(0, 0, 0, f);
this.drawPlaneZNeg(0, 0, 0, f);
}
GL11.glPopMatrix();
} else {
throw AlecUnexpectedRuntimeErrorExceptionFactory.PLAIN.createAlecException(
"Invalid TileEntity!"
);
}
}
}

View File

@ -0,0 +1,28 @@
package net.anvilcraft.thaummach.tiles;
import net.minecraft.tileentity.TileEntity;
public class TileMonolith extends TileEntity {
int soundDelay = 0;
public void updateEntity() {
super.updateEntity();
if (this.soundDelay > 0) {
--this.soundDelay;
}
if (this.soundDelay == 0
/* && super.worldObj.getBlockId(super.xCoord, super.yCoord - 1, super.zCoord)
!= mod_ThaumCraft.blockHidden.blockID */) {
super.worldObj.playSoundEffect(
(double) ((float) super.xCoord + 0.5F),
(double) ((float) super.yCoord + 0.5F),
(double) ((float) super.zCoord + 0.5F),
"thaummach:monolith",
0.4F,
1.0F
);
this.soundDelay = 450 + super.worldObj.rand.nextInt(150);
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,11 +2,11 @@ package net.anvilcraft.thaummach.utils;
import dev.tilera.auracore.client.FXSparkle;
import net.anvilcraft.thaummach.TMItems;
import net.anvilcraft.thaummach.particles.FXWisp;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World;
import thaumcraft.client.fx.particles.FXWisp;
public class UtilsFX {
public static void poof(World worldObj, float x, float y, float z) {
@ -48,6 +48,38 @@ public class UtilsFX {
}
}
public static void poofBad(World w, float x, float y, float z) {
poofBad(w, x, y, z, false);
}
public static void poofBad(World w, float x, float y, float z, boolean sound) {
int puffs = 10;
if (sound) {
w.playSoundEffect(
(double) (x + 0.5F),
(double) (y + 0.5F),
(double) (z + 0.5F),
"thaummach:roots",
0.05F,
1.1F + w.rand.nextFloat() * 0.2F
);
}
for (int a = 0; a < puffs; ++a) {
FXWisp ef = new FXWisp(
w,
(double) (x + 0.5F + w.rand.nextFloat() - w.rand.nextFloat()),
(double) (y + 0.5F + w.rand.nextFloat() - w.rand.nextFloat()),
(double) (z + 0.5F + w.rand.nextFloat() - w.rand.nextFloat()),
0.3F,
5
);
ef.tinkle = false;
Minecraft.getMinecraft().effectRenderer.addEffect(ef);
}
}
public static void sparkleDown(World w, int x, int y, int z, int color) {
int puffs = 16;
@ -117,32 +149,16 @@ public class UtilsFX {
tes.setBrightness(brightness);
tes.setNormal(0.0F, 0.0F, -1.0F);
tes.addVertexWithUV(
0.0D,
1.0D,
(double) (0.0F - p_78439_7_),
(double) p_78439_1_,
(double) p_78439_2_
0.0D, 1.0D, (double) (0.0F - p_78439_7_), (double) p_78439_1_, (double) p_78439_2_
);
tes.addVertexWithUV(
1.0D,
1.0D,
(double) (0.0F - p_78439_7_),
(double) p_78439_3_,
(double) p_78439_2_
1.0D, 1.0D, (double) (0.0F - p_78439_7_), (double) p_78439_3_, (double) p_78439_2_
);
tes.addVertexWithUV(
1.0D,
0.0D,
(double) (0.0F - p_78439_7_),
(double) p_78439_3_,
(double) p_78439_4_
1.0D, 0.0D, (double) (0.0F - p_78439_7_), (double) p_78439_3_, (double) p_78439_4_
);
tes.addVertexWithUV(
0.0D,
0.0D,
(double) (0.0F - p_78439_7_),
(double) p_78439_1_,
(double) p_78439_4_
0.0D, 0.0D, (double) (0.0F - p_78439_7_), (double) p_78439_1_, (double) p_78439_4_
);
tes.draw();
float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float) p_78439_5_;
@ -158,24 +174,12 @@ public class UtilsFX {
f7 = (float) k / (float) p_78439_5_;
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
tes.addVertexWithUV(
(double) f7,
0.0D,
(double) (0.0F - p_78439_7_),
(double) f8,
(double) p_78439_4_
(double) f7, 0.0D, (double) (0.0F - p_78439_7_), (double) f8, (double) p_78439_4_
);
tes.addVertexWithUV((double) f7, 0.0D, 0.0D, (double) f8, (double) p_78439_4_);
tes.addVertexWithUV((double) f7, 1.0D, 0.0D, (double) f8, (double) p_78439_2_);
tes.addVertexWithUV(
(double) f7, 0.0D, 0.0D, (double) f8, (double) p_78439_4_
);
tes.addVertexWithUV(
(double) f7, 1.0D, 0.0D, (double) f8, (double) p_78439_2_
);
tes.addVertexWithUV(
(double) f7,
1.0D,
(double) (0.0F - p_78439_7_),
(double) f8,
(double) p_78439_2_
(double) f7, 1.0D, (double) (0.0F - p_78439_7_), (double) f8, (double) p_78439_2_
);
}
@ -190,24 +194,12 @@ public class UtilsFX {
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
f9 = f7 + 1.0F / (float) p_78439_5_;
tes.addVertexWithUV(
(double) f9,
1.0D,
(double) (0.0F - p_78439_7_),
(double) f8,
(double) p_78439_2_
(double) f9, 1.0D, (double) (0.0F - p_78439_7_), (double) f8, (double) p_78439_2_
);
tes.addVertexWithUV((double) f9, 1.0D, 0.0D, (double) f8, (double) p_78439_2_);
tes.addVertexWithUV((double) f9, 0.0D, 0.0D, (double) f8, (double) p_78439_4_);
tes.addVertexWithUV(
(double) f9, 1.0D, 0.0D, (double) f8, (double) p_78439_2_
);
tes.addVertexWithUV(
(double) f9, 0.0D, 0.0D, (double) f8, (double) p_78439_4_
);
tes.addVertexWithUV(
(double) f9,
0.0D,
(double) (0.0F - p_78439_7_),
(double) f8,
(double) p_78439_4_
(double) f9, 0.0D, (double) (0.0F - p_78439_7_), (double) f8, (double) p_78439_4_
);
}
@ -220,25 +212,13 @@ public class UtilsFX {
f7 = (float) k / (float) p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
f9 = f7 + 1.0F / (float) p_78439_6_;
tes.addVertexWithUV(0.0D, (double) f9, 0.0D, (double) p_78439_1_, (double) f8);
tes.addVertexWithUV(1.0D, (double) f9, 0.0D, (double) p_78439_3_, (double) f8);
tes.addVertexWithUV(
0.0D, (double) f9, 0.0D, (double) p_78439_1_, (double) f8
1.0D, (double) f9, (double) (0.0F - p_78439_7_), (double) p_78439_3_, (double) f8
);
tes.addVertexWithUV(
1.0D, (double) f9, 0.0D, (double) p_78439_3_, (double) f8
);
tes.addVertexWithUV(
1.0D,
(double) f9,
(double) (0.0F - p_78439_7_),
(double) p_78439_3_,
(double) f8
);
tes.addVertexWithUV(
0.0D,
(double) f9,
(double) (0.0F - p_78439_7_),
(double) p_78439_1_,
(double) f8
0.0D, (double) f9, (double) (0.0F - p_78439_7_), (double) p_78439_1_, (double) f8
);
}
@ -250,25 +230,13 @@ public class UtilsFX {
for (k = 0; k < p_78439_6_; ++k) {
f7 = (float) k / (float) p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
tes.addVertexWithUV(1.0D, (double) f7, 0.0D, (double) p_78439_3_, (double) f8);
tes.addVertexWithUV(0.0D, (double) f7, 0.0D, (double) p_78439_1_, (double) f8);
tes.addVertexWithUV(
1.0D, (double) f7, 0.0D, (double) p_78439_3_, (double) f8
0.0D, (double) f7, (double) (0.0F - p_78439_7_), (double) p_78439_1_, (double) f8
);
tes.addVertexWithUV(
0.0D, (double) f7, 0.0D, (double) p_78439_1_, (double) f8
);
tes.addVertexWithUV(
0.0D,
(double) f7,
(double) (0.0F - p_78439_7_),
(double) p_78439_1_,
(double) f8
);
tes.addVertexWithUV(
1.0D,
(double) f7,
(double) (0.0F - p_78439_7_),
(double) p_78439_3_,
(double) f8
1.0D, (double) f7, (double) (0.0F - p_78439_7_), (double) p_78439_3_, (double) f8
);
}
@ -278,13 +246,10 @@ public class UtilsFX {
/**
* Draws an upgrade into the GuiContainer.
*/
public static void
renderUpgradeIntoGUI(Gui gui, int upgrade, int x, int y) {
public static void renderUpgradeIntoGUI(Gui gui, int upgrade, int x, int y) {
if (upgrade < 0)
return;
gui.drawTexturedModelRectFromIcon(
x, y, TMItems.upgrade.getIconFromDamage(upgrade), 16, 16
);
gui.drawTexturedModelRectFromIcon(x, y, TMItems.upgrade.getIconFromDamage(upgrade), 16, 16);
}
}

View File

@ -0,0 +1,34 @@
package net.anvilcraft.thaummach.worldgen;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class TMWorldGenerator implements IWorldGenerator {
@Override
public void generate(
Random rand,
int chunkX,
int chunkZ,
World world,
IChunkProvider chunkGenerator,
IChunkProvider chunkProvider
) {
// TODO: generate in other overworld-y dimensions
if (world.provider.dimensionId != 0)
return;
if (rand.nextInt(66) != 42)
return;
WorldGenMonolith wgm = new WorldGenMonolith();
int xPos = (chunkX << 4) + rand.nextInt(16);
int zPos = (chunkZ << 4) + rand.nextInt(16);
int yPos = world.getHeightValue(xPos, zPos);
wgm.generate(world, rand, xPos, yPos, zPos);
}
}

View File

@ -0,0 +1,295 @@
package net.anvilcraft.thaummach.worldgen;
import java.util.Random;
import dev.tilera.auracore.api.EnumNodeType;
import dev.tilera.auracore.aura.AuraManager;
import net.anvilcraft.alec.jalec.AlecLogger;
import net.anvilcraft.thaummach.TMBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenMonolith extends WorldGenerator {
private boolean isValidLocation(World world, int x, int y, int z) {
for (int a = -3; a <= 3; ++a) {
for (int c = -3; c <= 3; ++c) {
if (world.getBlock(x + a, y, z + c) != Blocks.dirt
&& world.getBlock(x + a, y, z + c) != Blocks.stone
&& world.getBlock(x + a, y, z + c) != Blocks.grass
&& world.getBlock(x + a, y, z + c) != Blocks.sand) {
return false;
}
}
}
return true;
}
@Override
public boolean generate(World world, Random random, int x, int y, int z) {
AlecLogger.FMT.alec("generate %d %d %d", x, y, z);
if (world.getBlock(x, y, z) == Blocks.tallgrass
|| world.getBlock(x, y, z) == Blocks.snow_layer) {
--y;
}
if (!this.isValidLocation(world, x, y, z)) {
AlecLogger.PLAIN.alec("invalid location");
return false;
}
int bio;
for (bio = 2; bio < 7; ++bio) {
world.setBlock(x, y + 1 + bio, z, TMBlocks.hidden, 2, 3);
}
bio = world.getWorldChunkManager().getBiomeGenAt(x, z).biomeID;
if (bio != BiomeGenBase.desert.biomeID && bio != BiomeGenBase.desertHills.biomeID
&& bio != BiomeGenBase.beach.biomeID) {
if (bio == BiomeGenBase.swampland.biomeID) {
this.genMossyStoneSurroundings(world, random, x, y, z);
} else {
this.genStoneSurroundings(world, random, x, y, z);
}
} else {
this.genSandStoneSurroundings(world, random, x, y, z);
}
int b;
int c;
for (int a = -1; a <= 1; ++a) {
for (b = y; b >= y - 1; --b) {
for (c = -1; c <= 1; ++c) {
if (Math.abs(a) != 1 && Math.abs(c) != 1 && b != y - 1) {
if (a == 0 && c == 0) {
world.setBlockToAir(x + a, b, z + c);
}
} else {
world.setBlock(x + a, b, z + c, TMBlocks.hidden, 0, 3);
}
}
}
}
world.setBlock(x + 1, y, z, TMBlocks.hidden, 3, 3);
world.setBlock(x - 1, y, z, TMBlocks.hidden, 0, 3);
world.setBlock(x, y, z + 1, TMBlocks.hidden, 0, 3);
world.setBlock(x, y, z - 1, TMBlocks.hidden, 0, 3);
world.setBlock(x, y, z, TMBlocks.hidden, 5, 3);
AuraManager.registerAuraNode(
world,
(short) (random.nextInt(300) + 500),
EnumNodeType.DARK,
world.provider.dimensionId,
x,
y,
z
);
return true;
}
private void genSandStoneSurroundings(World world, Random random, int x, int y, int z) {
int side;
for (side = 0; side < 75; ++side) {
world.setBlock(
x + random.nextInt(4) - random.nextInt(4),
y,
z + random.nextInt(4) - random.nextInt(4),
Blocks.sandstone
);
}
for (side = 0; side < 4; ++side) {
int mx = 0;
int mz = 0;
switch (side) {
case 0:
mz = 2;
mx = 2;
break;
case 1:
mx = 2;
mz = -2;
break;
case 2:
mz = -2;
mx = -2;
break;
case 3:
mx = -2;
mz = 2;
}
for (int a = 0; a < random.nextInt(5); ++a) {
int md = 0;
switch (a) {
case 1:
case 3:
md = 1;
break;
case 2:
case 4:
md = 2;
}
world.setBlock(x + mx, y + a + 1, z + mz, Blocks.sandstone, md, 3);
}
}
}
private void genStoneSurroundings(World world, Random random, int x, int y, int z) {
int bio = world.getWorldChunkManager().getBiomeGenAt(x, z).biomeID;
boolean vines = false;
if (bio == BiomeGenBase.jungle.biomeID || bio == BiomeGenBase.jungleHills.biomeID
|| bio == BiomeGenBase.forest.biomeID) {
vines = true;
}
int side;
for (side = 0; side < 75; ++side) {
world.setBlock(
x + random.nextInt(4) - random.nextInt(4),
y,
z + random.nextInt(4) - random.nextInt(4),
Blocks.stonebrick,
random.nextInt(3),
3
);
}
for (side = 0; side < 4; ++side) {
int mx = 0;
int mz = 0;
switch (side) {
case 0:
mz = 2;
mx = 2;
break;
case 1:
mx = 2;
mz = -2;
break;
case 2:
mz = -2;
mx = -2;
break;
case 3:
mx = -2;
mz = 2;
}
for (int a = 0; a < random.nextInt(5); ++a) {
world.setBlock(x + mx, y + a + 1, z + mz, Blocks.stonebrick, 3, 3);
if (a > 1) {
if (vines && random.nextBoolean()) {
world.setBlock(x + mx + 1, y + a + 1, z + mz, Blocks.vine, 2, 3);
}
if (vines && random.nextBoolean()) {
world.setBlock(x + mx - 1, y + a + 1, z + mz, Blocks.vine, 8, 3);
}
if (vines && random.nextBoolean()) {
world.setBlock(x + mx, y + a + 1, z + mz + 1, Blocks.vine, 4, 3);
}
if (vines && random.nextBoolean()) {
world.setBlock(x + mx, y + a + 1, z + mz - 1, Blocks.vine, 1, 3);
}
}
if (a == 3) {
if (random.nextBoolean()) {
world.setBlock(
x + mx + mx / 2 * -1, y + a + 1, z + mz, Blocks.stonebrick, 3, 3
);
}
if (random.nextBoolean()) {
world.setBlock(
x + mx, y + a + 1, z + mz + mz / 2 * -1, Blocks.stonebrick, 3, 3
);
}
}
}
}
}
private void genMossyStoneSurroundings(World world, Random random, int x, int y, int z) {
int side;
for (side = 0; side < 75; ++side) {
world.setBlock(
x + random.nextInt(4) - random.nextInt(4),
y,
z + random.nextInt(4) - random.nextInt(4),
Blocks.mossy_cobblestone
);
}
for (side = 0; side < 4; ++side) {
int mx = 0;
int mz = 0;
switch (side) {
case 0:
mz = 2;
mx = 2;
break;
case 1:
mx = 2;
mz = -2;
break;
case 2:
mz = -2;
mx = -2;
break;
case 3:
mx = -2;
mz = 2;
}
for (int a = 0; a < random.nextInt(5); ++a) {
if (a < 3) {
world.setBlock(x + mx, y + a + 1, z + mz, Blocks.mossy_cobblestone);
} else {
world.setBlock(x + mx, y + a + 1, z + mz, Blocks.stonebrick, 3, 3);
}
if (a > 1) {
if (random.nextBoolean()) {
world.setBlock(x + mx + 1, y + a + 1, z + mz, Blocks.vine, 2, 3);
}
if (random.nextBoolean()) {
world.setBlock(x + mx - 1, y + a + 1, z + mz, Blocks.vine, 8, 3);
}
if (random.nextBoolean()) {
world.setBlock(x + mx, y + a + 1, z + mz + 1, Blocks.vine, 4, 3);
}
if (random.nextBoolean()) {
world.setBlock(x + mx, y + a + 1, z + mz - 1, Blocks.vine, 1, 3);
}
}
if (a == 3) {
if (random.nextBoolean()) {
world.setBlock(
x + mx + mx / 2 * -1, y + a + 1, z + mz, Blocks.mossy_cobblestone
);
}
if (random.nextBoolean()) {
world.setBlock(
x + mx, y + a + 1, z + mz + mz / 2 * -1, Blocks.mossy_cobblestone
);
}
}
}
}
}
}

View File

@ -75,6 +75,24 @@
}
]
},
"monolith": {
"category": "block",
"sounds": [
{
"name": "monolith",
"stream": false
}
]
},
"rumble": {
"category": "block",
"sounds": [
{
"name": "rumble",
"stream": false
}
]
},
"upgrade": {
"category": "master",
"sounds": [

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B