mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Start of voidstone
This commit is contained in:
1 parent
82cdb7d11a
commit
b6d7faf2da
6 files changed
+104
-2
No files matched your search
@@ -47,7 +47,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
|
||||
|
||||
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = "2.0", guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
|
||||
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = "2.0.0.1", guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
|
||||
public class Chisel
|
||||
{
|
||||
public static final String MOD_ID = "chisel";
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package info.jbcs.minecraft.chisel.block.tileentity;
|
||||
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
import info.jbcs.minecraft.chisel.utils.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockVoidstone extends Block {
|
||||
|
||||
public static IIcon iconParticle;
|
||||
|
||||
protected BlockVoidstone() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(General.rand.nextInt(4) == 0 && world.isRemote)
|
||||
GeneralChiselClient.spawnVoidstoneFX(world, this, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import info.jbcs.minecraft.chisel.Configurations;
|
||||
import info.jbcs.minecraft.chisel.block.BlockHolystone;
|
||||
import info.jbcs.minecraft.chisel.block.BlockLavastone;
|
||||
import info.jbcs.minecraft.chisel.block.BlockSnakestoneObsidian;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.BlockVoidstone;
|
||||
import info.jbcs.minecraft.chisel.entity.fx.EntityBallOMossFX;
|
||||
import info.jbcs.minecraft.chisel.entity.fx.EntityHolystoneFX;
|
||||
import info.jbcs.minecraft.chisel.entity.fx.EntitySnakestoneObsidianFX;
|
||||
@@ -16,6 +17,7 @@ import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.particle.EntityLavaFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
import sun.security.krb5.Config;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -128,6 +130,12 @@ public class GeneralChiselClient
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnVoidstoneFX(World world, BlockVoidstone blockVoidstone, int x, int y, int z){
|
||||
if(Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnBallOMossFX(World world, double x, double y, double z)
|
||||
{
|
||||
if(Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0)
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package info.jbcs.minecraft.chisel.entity.fx;
|
||||
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.BlockVoidstone;
|
||||
import info.jbcs.minecraft.chisel.utils.General;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityVoidstoneFX extends EntityFX {
|
||||
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20F;
|
||||
|
||||
public EntityVoidstoneFX(World world, BlockVoidstone blockVoidstone, double x, double y, double z){
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
initialScale = 1.0F + 1.0F * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
noClip = true;
|
||||
|
||||
setParticleIcon(blockVoidstone.iconParticle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tesselator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY){
|
||||
particleScale = 0.25F + initialScale * (float) Math.sin(particleAge + angleOffset) / 180.0F;
|
||||
|
||||
if(particleAge < fadetime){
|
||||
particleAlpha = particleAge / fadetime;
|
||||
} else if(particleAge + fadetime >= particleMaxAge){
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
} else {
|
||||
particleAlpha = 1.0F;
|
||||
}
|
||||
|
||||
super.renderParticle(tesselator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
if(particleAge++ >= particleMaxAge){
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.Configurations;
|
||||
import info.jbcs.minecraft.chisel.block.*;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.BlockVoidstone;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.carving.Carving;
|
||||
@@ -67,6 +68,8 @@ public class ModBlocks {
|
||||
public static BlockCarvable laboratory;
|
||||
public static BlockCarvable pumpkin;
|
||||
public static BlockCarvable jackOLantern;
|
||||
public static BlockCarvable voidstone;
|
||||
public static BlockVoidstone voidstonePillar;
|
||||
public static Block autoChisel;
|
||||
public static BlockSnakestone snakestone;
|
||||
public static BlockSnakestone sandSnakestone;
|
||||
@@ -1260,6 +1263,13 @@ public class ModBlocks {
|
||||
//pumpkin.carverHelper.addVariation("chisel.title.pumpkin.1.desc", 1, "pumpkin/1");
|
||||
}
|
||||
|
||||
if(Configurations.featureEnabled("voidstone")){
|
||||
voidstone = (BlockCarvable) new BlockCarvable().setHardness(2.0F).setResistance(5F).setStepSound(Block.soundTypeStone);
|
||||
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("chisel.tile.voidstone.0.desc"), 0, "voidstone/metalborder");
|
||||
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("chisel.tile.voidstone.1.desc"), 1, "voidstone/pillar-side");
|
||||
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("chisel.tile.voidstone.2.desc"), 2, voidstonePillar, 0);
|
||||
}
|
||||
|
||||
Blocks.stone.setHarvestLevel("chisel", 0, 0);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user