2014-06-06 19:46:05 -08:00
|
|
|
package tconstruct.world;
|
|
|
|
|
|
2014-09-09 18:30:15 +10:00
|
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
|
|
|
import cpw.mods.fml.common.registry.VillagerRegistry;
|
2014-07-02 21:00:57 -08:00
|
|
|
import mantle.lib.client.MantleClientRegistry;
|
2014-06-06 19:46:05 -08:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
2014-07-02 21:00:57 -08:00
|
|
|
import net.minecraft.client.model.ModelSlime;
|
2014-09-09 18:30:15 +10:00
|
|
|
import net.minecraft.client.particle.*;
|
|
|
|
|
import net.minecraft.init.*;
|
2014-07-02 21:00:57 -08:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
|
import tconstruct.mechworks.model.CartRender;
|
|
|
|
|
import tconstruct.tools.TinkerTools;
|
2014-09-09 18:30:15 +10:00
|
|
|
import tconstruct.world.entity.*;
|
|
|
|
|
import tconstruct.world.model.*;
|
2014-06-06 19:46:05 -08:00
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
|
2014-07-02 21:00:57 -08:00
|
|
|
@Override
|
2022-09-22 19:51:23 +01:00
|
|
|
public void initialize() {
|
2014-07-02 21:00:57 -08:00
|
|
|
registerRenderer();
|
|
|
|
|
registerManualIcons();
|
|
|
|
|
registerManualRecipes();
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
void registerRenderer() {
|
2014-07-02 21:00:57 -08:00
|
|
|
RenderingRegistry.registerBlockHandler(new OreberryRender());
|
|
|
|
|
RenderingRegistry.registerBlockHandler(new BarricadeRender());
|
|
|
|
|
RenderingRegistry.registerBlockHandler(new RenderLandmine());
|
|
|
|
|
RenderingRegistry.registerBlockHandler(new PunjiRender());
|
|
|
|
|
RenderingRegistry.registerBlockHandler(new SlimeChannelRender());
|
|
|
|
|
RenderingRegistry.registerBlockHandler(new SlimePadRender());
|
|
|
|
|
|
|
|
|
|
// Entities
|
2014-11-29 23:02:23 +01:00
|
|
|
SlimeRender slimeRender = new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F);
|
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, slimeRender);
|
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(KingBlueSlime.class, slimeRender);
|
2014-07-02 21:00:57 -08:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender());
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
VillagerRegistry.instance()
|
|
|
|
|
.registerVillagerSkin(78943, new ResourceLocation("tinker", "textures/mob/villagertools.png"));
|
2014-07-02 21:00:57 -08:00
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
void registerManualIcons() {}
|
2014-09-09 18:30:15 +10:00
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
void registerManualRecipes() {
|
2014-07-02 21:00:57 -08:00
|
|
|
ItemStack netherrack = new ItemStack(Blocks.netherrack);
|
|
|
|
|
ItemStack coal = new ItemStack(Items.coal);
|
|
|
|
|
ItemStack log = new ItemStack(Blocks.log, 1, 0);
|
|
|
|
|
|
|
|
|
|
ItemStack graveyardsoil = new ItemStack(TinkerTools.craftedSoil, 1, 3);
|
|
|
|
|
ItemStack consecratedsoil = new ItemStack(TinkerTools.craftedSoil, 1, 4);
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
MantleClientRegistry.registerManualSmallRecipe(
|
|
|
|
|
"slimechannel",
|
|
|
|
|
new ItemStack(TinkerWorld.slimeChannel, 1, 0),
|
|
|
|
|
new ItemStack(TinkerWorld.slimeGel, 1, 0),
|
|
|
|
|
new ItemStack(Items.redstone),
|
|
|
|
|
null,
|
|
|
|
|
null);
|
|
|
|
|
MantleClientRegistry.registerManualSmallRecipe(
|
|
|
|
|
"bouncepad",
|
|
|
|
|
new ItemStack(TinkerWorld.slimePad, 1, 0),
|
|
|
|
|
new ItemStack(TinkerWorld.slimeChannel),
|
|
|
|
|
new ItemStack(Items.slime_ball),
|
|
|
|
|
null,
|
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
MantleClientRegistry.registerManualSmallRecipe(
|
|
|
|
|
"graveyardsoil",
|
|
|
|
|
graveyardsoil,
|
|
|
|
|
new ItemStack(Blocks.dirt),
|
|
|
|
|
new ItemStack(Items.rotten_flesh),
|
|
|
|
|
new ItemStack(Items.dye, 1, 15),
|
|
|
|
|
null);
|
2014-07-02 21:00:57 -08:00
|
|
|
MantleClientRegistry.registerManualFurnaceRecipe("consecratedsoil", consecratedsoil, graveyardsoil);
|
|
|
|
|
|
|
|
|
|
// Traps
|
2014-09-09 22:26:42 +02:00
|
|
|
ItemStack reed = new ItemStack(Items.reeds);
|
2022-09-22 19:51:23 +01:00
|
|
|
MantleClientRegistry.registerManualLargeRecipe(
|
|
|
|
|
"punji", new ItemStack(TinkerWorld.punji, 5), reed, null, reed, null, reed, null, reed, null, reed);
|
|
|
|
|
MantleClientRegistry.registerManualSmallRecipe(
|
|
|
|
|
"barricade", new ItemStack(TinkerWorld.barricadeOak), null, log, null, log);
|
2014-07-02 21:00:57 -08:00
|
|
|
}
|
|
|
|
|
|
2014-06-06 19:46:05 -08:00
|
|
|
Minecraft mc = Minecraft.getMinecraft();
|
|
|
|
|
|
|
|
|
|
@Override
|
2022-09-22 19:51:23 +01:00
|
|
|
public void spawnParticle(
|
|
|
|
|
String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) {
|
2014-06-06 19:46:05 -08:00
|
|
|
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
public EntityFX doSpawnParticle(
|
|
|
|
|
String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) {
|
|
|
|
|
if (this.mc == null) this.mc = Minecraft.getMinecraft();
|
2014-06-06 19:46:05 -08:00
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) {
|
2014-06-06 19:46:05 -08:00
|
|
|
int i = this.mc.gameSettings.particleSetting;
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0) {
|
2014-06-06 19:46:05 -08:00
|
|
|
i = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double d6 = this.mc.renderViewEntity.posX - par2;
|
|
|
|
|
double d7 = this.mc.renderViewEntity.posY - par4;
|
|
|
|
|
double d8 = this.mc.renderViewEntity.posZ - par6;
|
|
|
|
|
EntityFX entityfx = null;
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (par1Str.equals("hugeexplosion")) {
|
|
|
|
|
this.mc.effectRenderer.addEffect(
|
|
|
|
|
entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12));
|
|
|
|
|
} else if (par1Str.equals("largeexplode")) {
|
|
|
|
|
this.mc.effectRenderer.addEffect(
|
|
|
|
|
entityfx = new EntityLargeExplodeFX(
|
|
|
|
|
mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
|
|
|
|
|
} else if (par1Str.equals("fireworksSpark")) {
|
|
|
|
|
this.mc.effectRenderer.addEffect(
|
|
|
|
|
entityfx = new EntityFireworkSparkFX(
|
|
|
|
|
mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
|
2014-06-06 19:46:05 -08:00
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (entityfx != null) {
|
2014-06-06 19:46:05 -08:00
|
|
|
return (EntityFX) entityfx;
|
2022-09-22 19:51:23 +01:00
|
|
|
} else {
|
2014-06-06 19:46:05 -08:00
|
|
|
double d9 = 16.0D;
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9) {
|
2014-06-06 19:46:05 -08:00
|
|
|
return null;
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (i > 1) {
|
2014-06-06 19:46:05 -08:00
|
|
|
return null;
|
2022-09-22 19:51:23 +01:00
|
|
|
} else {
|
|
|
|
|
if (par1Str.equals("bubble")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("suspended")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("depthsuspend")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("townaura")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("crit")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("smoke")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("mobSpell")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
|
|
|
|
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("mobSpellAmbient")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
|
|
|
|
((EntityFX) entityfx).setAlphaF(0.15F);
|
|
|
|
|
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("spell")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("instantSpell")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
|
|
|
|
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("witchMagic")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
|
|
|
|
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
|
|
|
|
float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F;
|
|
|
|
|
((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("note")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("portal")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("enchantmenttable")) {
|
|
|
|
|
entityfx =
|
|
|
|
|
new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
|
|
|
|
} else if (par1Str.equals("explode")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("flame")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("lava")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("footstep")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("splash")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("largesmoke")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("cloud")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("reddust")) {
|
|
|
|
|
entityfx = new EntityReddustFX(
|
|
|
|
|
mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12);
|
|
|
|
|
} else if (par1Str.equals("snowballpoof")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Items.snowball);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("dripWater")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("dripLava")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("snowshovel")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("blueslime")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TinkerWorld.strangeFood);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("heart")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("angryVillager")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12);
|
|
|
|
|
((EntityFX) entityfx).setParticleTextureIndex(81);
|
|
|
|
|
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
2022-09-22 19:51:23 +01:00
|
|
|
} else if (par1Str.equals("happyVillager")) {
|
2014-06-06 19:46:05 -08:00
|
|
|
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
|
|
|
|
((EntityFX) entityfx).setParticleTextureIndex(82);
|
|
|
|
|
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-22 19:51:23 +01:00
|
|
|
if (entityfx != null) {
|
2014-06-06 19:46:05 -08:00
|
|
|
this.mc.effectRenderer.addEffect((EntityFX) entityfx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (EntityFX) entityfx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-22 19:51:23 +01:00
|
|
|
} else {
|
2014-06-06 19:46:05 -08:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|