forked from KryptonCaptain/Et-Futurum
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Soul lantern, soul torch, fix boatInfo error
Mangrove and cherry boats had wrong plank meta
- Loading branch information
1 parent
847fb6c
commit 9b2c785
Showing
27 changed files
with
201 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/ganymedes01/etfuturum/blocks/BlockSoulTorch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package ganymedes01.etfuturum.blocks; | ||
|
||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import ganymedes01.etfuturum.EtFuturum; | ||
import ganymedes01.etfuturum.client.particle.CustomParticles; | ||
import ganymedes01.etfuturum.core.utils.Utils; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockTorch; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.Random; | ||
|
||
public class BlockSoulTorch extends BlockTorch { | ||
|
||
public BlockSoulTorch() { | ||
super(); | ||
setStepSound(Block.soundTypeWood); | ||
setLightLevel(0.666F); | ||
setBlockName(Utils.getUnlocalisedName("soul_torch")); | ||
setBlockTextureName("soul_torch"); | ||
setCreativeTab(EtFuturum.creativeTabBlocks); | ||
} | ||
|
||
/** | ||
* A randomly called display update to be able to add particles or other items for display | ||
*/ | ||
@SideOnly(Side.CLIENT) | ||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) { | ||
int l = world.getBlockMetadata(x, y, z); | ||
double d0 = (float) x + 0.5F; | ||
double d1 = (float) y + 0.7F; | ||
double d2 = (float) z + 0.5F; | ||
double d3 = 0.2199999988079071D; | ||
double d4 = 0.27000001072883606D; | ||
|
||
switch (l) { | ||
case 1: | ||
world.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); | ||
CustomParticles.spawnSoulFlame(world, d0 - d4, d1 + d3, d2); | ||
break; | ||
case 2: | ||
world.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); | ||
CustomParticles.spawnSoulFlame(world, d0 + d4, d1 + d3, d2); | ||
break; | ||
case 3: | ||
world.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); | ||
CustomParticles.spawnSoulFlame(world, d0, d1 + d3, d2 - d4); | ||
break; | ||
case 4: | ||
world.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); | ||
CustomParticles.spawnSoulFlame(world, d0, d1 + d3, d2 + d4); | ||
break; | ||
default: | ||
world.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); | ||
CustomParticles.spawnSoulFlame(world, d0, d1, d2); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
src/main/java/ganymedes01/etfuturum/client/particle/SoulFlameFX.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package ganymedes01.etfuturum.client.particle; | ||
|
||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.world.World; | ||
|
||
public class SoulFlameFX extends EtFuturumFXParticle { | ||
/** | ||
* the scale of the flame FX | ||
*/ | ||
private final float flameScale; | ||
|
||
public SoulFlameFX(World world, double x, double y, double z, double mX, double mY, double mZ) { | ||
super(world, x, y, z, mX, mY, mZ, (int) (8.0D / (Math.random() * 0.8D + 0.2D)) + 4, (particleRand.nextFloat() * 0.5F + 0.5F) * 2.0F, 0xFFFFFFFF, | ||
"textures/particle/soul_fire_flame.png", 1); | ||
this.motionX = this.motionX * 0.009999999776482582D + mX; | ||
this.motionY = this.motionY * 0.009999999776482582D + mY; | ||
this.motionZ = this.motionZ * 0.009999999776482582D + mZ; | ||
this.flameScale = this.particleScale; | ||
this.particleRed = this.particleGreen = this.particleBlue = 1.0F; | ||
this.particleMaxAge = (int) (8.0D / (Math.random() * 0.8D + 0.2D)) + 4; | ||
this.noClip = true; | ||
} | ||
|
||
public SoulFlameFX(World world, double x, double y, double z) { | ||
this(world, x, y, z, 0, 0, 0); | ||
} | ||
|
||
@Override | ||
public void renderParticle(Tessellator tessellator, float partialTicks, float rx, float rxz, float rz, | ||
float ryz, float rxy) { | ||
float f6 = ((float) this.particleAge + partialTicks) / (float) this.particleMaxAge; | ||
this.particleScale = this.flameScale * (1.0F - f6 * f6 * 0.5F); | ||
super.renderParticle(tessellator, partialTicks, rx, rxz, rz, ryz, rxy); | ||
} | ||
|
||
public int getBrightnessForRender(float p_70070_1_) { | ||
float f1 = ((float) this.particleAge + p_70070_1_) / (float) this.particleMaxAge; | ||
|
||
if (f1 < 0.0F) { | ||
f1 = 0.0F; | ||
} | ||
|
||
if (f1 > 1.0F) { | ||
f1 = 1.0F; | ||
} | ||
|
||
int i = super.getBrightnessForRender(p_70070_1_); | ||
int j = i & 255; | ||
int k = i >> 16 & 255; | ||
j += (int) (f1 * 15.0F * 16.0F); | ||
|
||
if (j > 240) { | ||
j = 240; | ||
} | ||
|
||
return j | k << 16; | ||
} | ||
|
||
/** | ||
* Gets how bright this entity is. | ||
*/ | ||
public float getBrightness(float p_70013_1_) { | ||
float f1 = ((float) this.particleAge + p_70013_1_) / (float) this.particleMaxAge; | ||
|
||
if (f1 < 0.0F) { | ||
f1 = 0.0F; | ||
} | ||
|
||
if (f1 > 1.0F) { | ||
f1 = 1.0F; | ||
} | ||
|
||
float f2 = super.getBrightness(p_70013_1_); | ||
return f2 * f1 + (1.0F - f1); | ||
} | ||
|
||
/** | ||
* Called to update the entity's position/logic. | ||
*/ | ||
public void onUpdate() { | ||
this.prevPosX = this.posX; | ||
this.prevPosY = this.posY; | ||
this.prevPosZ = this.posZ; | ||
|
||
if (this.particleAge++ >= this.particleMaxAge) { | ||
this.setDead(); | ||
} | ||
|
||
this.moveEntity(this.motionX, this.motionY, this.motionZ); | ||
this.motionX *= 0.9599999785423279D; | ||
this.motionY *= 0.9599999785423279D; | ||
this.motionZ *= 0.9599999785423279D; | ||
|
||
if (this.onGround) { | ||
this.motionX *= 0.699999988079071D; | ||
this.motionZ *= 0.699999988079071D; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+264 Bytes
src/main/resources/assets/minecraft/textures/blocks/soul_lantern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/minecraft/textures/blocks/soul_lantern.png.mcmeta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"animation": { | ||
"frametime": 8 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+160 Bytes
src/main/resources/assets/minecraft/textures/items/soul_lantern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+127 Bytes
src/main/resources/assets/minecraft/textures/particle/soul_fire_flame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.