More glyph work. Always glyph work.
This commit is contained in:
parent
c65214958a
commit
5a73736076
|
@ -36,14 +36,14 @@ public class AlchemyArray implements Comparable<AlchemyArray>
|
|||
}
|
||||
}
|
||||
|
||||
public void addGlyph(Glyph glyph)
|
||||
public boolean addGlyph(Glyph glyph)
|
||||
{
|
||||
if (glyph.getSize() > largestGlyphSize)
|
||||
{
|
||||
largestGlyphSize = glyph.getSize();
|
||||
}
|
||||
|
||||
glyphs.add(glyph);
|
||||
return glyphs.add(glyph);
|
||||
}
|
||||
|
||||
public void addGlyph(Glyph glyph, int size)
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.pahimar.ee3.reference.RenderIds;
|
|||
import com.pahimar.ee3.settings.ChalkSettings;
|
||||
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
|
||||
import com.pahimar.ee3.tileentity.TileEntityEE;
|
||||
import com.pahimar.ee3.util.CommonSoundHelper;
|
||||
import com.pahimar.ee3.util.EntityHelper;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -84,7 +85,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
// TODO: Set rotation
|
||||
int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && entityLiving instanceof EntityPlayer)
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
NBTTagCompound customEntityData = EntityHelper.getCustomEntityData(entityLiving);
|
||||
ChalkSettings chalkSettings = new ChalkSettings();
|
||||
|
@ -94,14 +95,14 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).addGlyphToAlchemyArray(new Glyph(glyphTexture, GlyphTextureRegistry.getInstance().getGlyphs().get(glyphTexture)), chalkSettings.getSize());
|
||||
|
||||
// TODO: Play a sound when a glyph is added
|
||||
CommonSoundHelper.playChalkSoundAt((EntityPlayer) entityLiving);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
if (entityPlayer.getCurrentEquippedItem() != null && entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemChalk)
|
||||
{
|
||||
|
@ -111,13 +112,13 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
|
||||
ResourceLocation glyphTexture = GlyphTextureRegistry.getInstance().getResourceLocation(chalkSettings.getIndex());
|
||||
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).addGlyphToAlchemyArray(new Glyph(glyphTexture, GlyphTextureRegistry.getInstance().getGlyphs().get(glyphTexture)), chalkSettings.getSize());
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.getTileEntity(x, y, z).markDirty();
|
||||
|
||||
// TODO: Play a sound when a glyph is added to an array
|
||||
|
||||
return true;
|
||||
if (((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).addGlyphToAlchemyArray(new Glyph(glyphTexture, GlyphTextureRegistry.getInstance().getGlyphs().get(glyphTexture)), chalkSettings.getSize()))
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.getTileEntity(x, y, z).markDirty();
|
||||
CommonSoundHelper.playChalkSoundAt(entityPlayer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public class HUDTickHandler
|
|||
hudOverlayX = (int) (sr.getScaledWidth() - 16 * overlayScale);
|
||||
hudOverlayY = (int) (sr.getScaledHeight() - 16 * overlayScale);
|
||||
|
||||
RenderUtils.renderItemIntoGUI(minecraft.fontRenderer, itemStack, hudOverlayX, hudOverlayY, overlayOpacity, overlayScale);
|
||||
RenderUtils.renderItemIntoGUI(minecraft.fontRenderer, itemStack, hudOverlayX, hudOverlayY, overlayOpacity, overlayScale, -90);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package com.pahimar.ee3.client.handler;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MouseEventHandler
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void onMouseEvent(MouseEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.pahimar.ee3.client.renderer.tileentity;
|
||||
|
||||
import com.pahimar.ee3.api.Glyph;
|
||||
import com.pahimar.ee3.client.util.RenderUtils;
|
||||
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
@ -24,11 +25,24 @@ public class TileEntityRendererAlchemyArray extends TileEntitySpecialRenderer
|
|||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
for (Glyph glyph : tileEntityAlchemyArray.getAlchemyArray().getGlyphs())
|
||||
{
|
||||
this.bindTexture(glyph.getTexture());
|
||||
renderSymbol(glyph, x, y, z, tileEntityAlchemyArray.getOrientation());
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5d, y + 0.5d, z + 0.5d);
|
||||
GL11.glScalef(1f, 1f, 1f);
|
||||
// TODO: Finish making this work in this much more intelligent way than the way we did in renderSymbol
|
||||
// GL11.glRotatef(rotationAngle, sideHit.offsetX, sideHit.offsetY, sideHit.offsetZ);
|
||||
// GL11.glRotatef(facingCorrectionAngle, sideHit.offsetX, sideHit.offsetY, sideHit.offsetZ);
|
||||
// GL11.glRotatef(90, xRotate, yRotate, zRotate);
|
||||
// GL11.glTranslated(0, 0, 0.5f * zCorrection);
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
RenderUtils.renderQuad(glyph.getTexture());
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.pahimar.ee3.client.util;
|
||||
|
||||
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -18,7 +17,7 @@ import org.lwjgl.opengl.GL12;
|
|||
|
||||
public class RenderUtils
|
||||
{
|
||||
public static void renderItemIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int x, int y, float opacity, float scale)
|
||||
public static void renderItemIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int x, int y, float opacity, float scale, int zLevel)
|
||||
{
|
||||
IIcon icon = itemStack.getIconIndex();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
@ -28,19 +27,14 @@ public class RenderUtils
|
|||
float green = (overlayColour >> 8 & 255) / 255.0F;
|
||||
float blue = (overlayColour & 255) / 255.0F;
|
||||
GL11.glColor4f(red, green, blue, opacity);
|
||||
drawTexturedQuad(x, y, icon, 16 * scale, 16 * scale, -90);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
public static void drawTexturedQuad(int x, int y, IIcon icon, float width, float height, double zLevel)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(x, y + height, zLevel, icon.getMinU(), icon.getMaxV());
|
||||
tessellator.addVertexWithUV(x + width, y + height, zLevel, icon.getMaxU(), icon.getMaxV());
|
||||
tessellator.addVertexWithUV(x + width, y, zLevel, icon.getMaxU(), icon.getMinV());
|
||||
tessellator.addVertexWithUV(x, y + 16 * scale, zLevel, icon.getMinU(), icon.getMaxV());
|
||||
tessellator.addVertexWithUV(x + 16 * scale, y + 16 * scale, zLevel, icon.getMaxU(), icon.getMaxV());
|
||||
tessellator.addVertexWithUV(x + 16 * scale, y, zLevel, icon.getMaxU(), icon.getMinV());
|
||||
tessellator.addVertexWithUV(x, y, zLevel, icon.getMinU(), icon.getMinV());
|
||||
tessellator.draw();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
public static void drawInWorldTransmutationOverlay(DrawBlockHighlightEvent event, ResourceLocation texture, int size, int rotation)
|
||||
|
@ -69,7 +63,6 @@ public class RenderUtils
|
|||
int chargeLevel = size;
|
||||
ForgeDirection sideHit = ForgeDirection.getOrientation(event.target.sideHit);
|
||||
TileEntity tileEntity = event.player.worldObj.getTileEntity(event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||
LogHelper.info(sideHit);
|
||||
switch (sideHit)
|
||||
{
|
||||
case UP:
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.pahimar.ee3.network.message.MessageChalkSettings;
|
|||
import com.pahimar.ee3.reference.Key;
|
||||
import com.pahimar.ee3.reference.Names;
|
||||
import com.pahimar.ee3.settings.ChalkSettings;
|
||||
import com.pahimar.ee3.util.CommonSoundHelper;
|
||||
import com.pahimar.ee3.util.EntityHelper;
|
||||
import com.pahimar.ee3.util.IKeyBound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -65,7 +66,8 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
int sideHit = ModBlocks.alchemyArray.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, itemStack.getItemDamage());
|
||||
if (placeBlockAt(itemStack, entityPlayer, world, x, y, z, side, hitX, hitY, hitZ, sideHit))
|
||||
{
|
||||
world.playSoundEffect(x + 0.5d, y + 0.5d, z + 0.5d, ModBlocks.alchemyArray.stepSound.func_150496_b(), (ModBlocks.alchemyArray.stepSound.getVolume() + 1.0F) / 2.0F, ModBlocks.alchemyArray.stepSound.getPitch() * 0.8F);
|
||||
// world.playSoundEffect(x + 0.5d, y + 0.5d, z + 0.5d, ModBlocks.alchemyArray.stepSound.func_150496_b(), (ModBlocks.alchemyArray.stepSound.getVolume() + 1.0F) / 2.0F, ModBlocks.alchemyArray.stepSound.getPitch() * 0.8F);
|
||||
CommonSoundHelper.playChalkSoundAt(entityPlayer);
|
||||
--itemStack.stackSize;
|
||||
}
|
||||
return true;
|
||||
|
@ -83,7 +85,6 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
*/
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
|
||||
if (!world.setBlock(x, y, z, ModBlocks.alchemyArray, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.pahimar.ee3.item;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.pahimar.ee3.reference.*;
|
||||
import com.pahimar.ee3.util.CommonSoundHelper;
|
||||
import com.pahimar.ee3.util.IChargeable;
|
||||
import com.pahimar.ee3.util.IKeyBound;
|
||||
import com.pahimar.ee3.util.NBTHelper;
|
||||
import com.pahimar.ee3.util.NetworkSoundHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -86,30 +86,30 @@ public class ItemDarkMatterAxe extends ItemToolModalEE implements IKeyBound, ICh
|
|||
{
|
||||
if (getChargeLevel(itemStack) == this.getMaxChargeLevel())
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
increaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getChargeLevel(itemStack) == 0)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
decreaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key == Key.EXTRA)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
changeToolMode(itemStack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,30 +124,30 @@ public class ItemDarkMatterHoe extends ItemHoe implements IKeyBound, IChargeable
|
|||
{
|
||||
if (getChargeLevel(itemStack) == this.getMaxChargeLevel())
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
increaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getChargeLevel(itemStack) == 0)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
decreaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key == Key.EXTRA)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
changeToolMode(itemStack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,30 +117,30 @@ public class ItemDarkMatterPickAxe extends ItemToolModalEE implements IKeyBound,
|
|||
{
|
||||
if (getChargeLevel(itemStack) == this.getMaxChargeLevel())
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
increaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getChargeLevel(itemStack) == 0)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
decreaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key == Key.EXTRA)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
changeToolMode(itemStack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.pahimar.ee3.item;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.pahimar.ee3.reference.*;
|
||||
import com.pahimar.ee3.util.CommonSoundHelper;
|
||||
import com.pahimar.ee3.util.IChargeable;
|
||||
import com.pahimar.ee3.util.IKeyBound;
|
||||
import com.pahimar.ee3.util.NBTHelper;
|
||||
import com.pahimar.ee3.util.NetworkSoundHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -86,30 +86,30 @@ public class ItemDarkMatterShovel extends ItemToolModalEE implements IKeyBound,
|
|||
{
|
||||
if (getChargeLevel(itemStack) == this.getMaxChargeLevel())
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
increaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getChargeLevel(itemStack) == 0)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.FAIL, 1.5f, 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
decreaseChargeLevel(itemStack);
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - 0.5F * (getChargeLevel(itemStack) * 1.0F / this.getMaxChargeLevel())));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key == Key.EXTRA)
|
||||
{
|
||||
NetworkSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
CommonSoundHelper.playSoundAt(entityPlayer, Sounds.TOCK, 0.5f, 1.5F);
|
||||
changeToolMode(itemStack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.pahimar.ee3.reference;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class Sounds
|
||||
{
|
||||
private static final Random random = new Random();
|
||||
|
||||
public static final String CHEST_OPEN = "random.chestopen";
|
||||
public static final String CHEST_CLOSE = "random.chestclosed";
|
||||
|
||||
|
@ -20,4 +24,15 @@ public class Sounds
|
|||
public static final String WALL = "wall";
|
||||
public static final String WATER_BALL = "waterball";
|
||||
public static final String WIND = "wind";
|
||||
|
||||
public static final class Chalk
|
||||
{
|
||||
private static final String CHALK_PREFIX = "chalk_";
|
||||
private static final int CHALK_SOUNDS_COUNT = 11;
|
||||
|
||||
public static final String getRandomChalkSound()
|
||||
{
|
||||
return String.format("%s%s", CHALK_PREFIX, random.nextInt(CHALK_SOUNDS_COUNT) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,14 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
return alchemyArray;
|
||||
}
|
||||
|
||||
public void addGlyphToAlchemyArray(Glyph glyph, int size)
|
||||
public boolean addGlyphToAlchemyArray(Glyph glyph)
|
||||
{
|
||||
alchemyArray.addGlyph(new Glyph(glyph, size));
|
||||
return alchemyArray.addGlyph(glyph);
|
||||
}
|
||||
|
||||
public boolean addGlyphToAlchemyArray(Glyph glyph, int size)
|
||||
{
|
||||
return addGlyphToAlchemyArray(new Glyph(glyph, size));
|
||||
}
|
||||
|
||||
public int getRotation()
|
||||
|
|
|
@ -2,10 +2,11 @@ package com.pahimar.ee3.util;
|
|||
|
||||
import com.pahimar.ee3.network.PacketHandler;
|
||||
import com.pahimar.ee3.network.message.MessageSoundEvent;
|
||||
import com.pahimar.ee3.reference.Sounds;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class NetworkSoundHelper
|
||||
public class CommonSoundHelper
|
||||
{
|
||||
public static void playSoundAt(EntityPlayer entityPlayer, String soundName, float volume, float pitch)
|
||||
{
|
||||
|
@ -16,4 +17,9 @@ public class NetworkSoundHelper
|
|||
{
|
||||
PacketHandler.INSTANCE.sendToAllAround(new MessageSoundEvent(entityPlayer, soundName, volume, pitch), new NetworkRegistry.TargetPoint(entityPlayer.worldObj.provider.dimensionId, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, range));
|
||||
}
|
||||
|
||||
public static void playChalkSoundAt(EntityPlayer entityPlayer)
|
||||
{
|
||||
playSoundAt(entityPlayer, Sounds.Chalk.getRandomChalkSound(), 1f, 1f);
|
||||
}
|
||||
}
|
|
@ -1,18 +1,130 @@
|
|||
{
|
||||
"chargeDown": {"category": "master","sounds": [{"name": "chargeDown", "stream": false}]},
|
||||
"chargeUp": {"category": "master","sounds": [{"name": "chargeUp", "stream": false}]},
|
||||
"destruct": {"category": "master","sounds": [{"name": "destruct", "stream": false}]},
|
||||
"fail": {"category": "master","sounds": [{"name": "fail", "stream": false}]},
|
||||
"gust": {"category": "master","sounds": [{"name": "gust", "stream": false}]},
|
||||
"heal": {"category": "master","sounds": [{"name": "heal", "stream": false}]},
|
||||
"kinesis": {"category": "master","sounds": [{"name": "kinesis", "stream": false}]},
|
||||
"launch": {"category": "master","sounds": [{"name": "launch", "stream": false}]},
|
||||
"nova": {"category": "master","sounds": [{"name": "nova", "stream": false}]},
|
||||
"philball": {"category": "master","sounds": [{"name": "philball", "stream": false}]},
|
||||
"tock": {"category": "master","sounds": [{"name": "tock", "stream": false}]},
|
||||
"transmute": {"category": "master","sounds": [{"name": "transmute", "stream": false}]},
|
||||
"wall": {"category": "master","sounds": [{"name": "wall", "stream": false}]},
|
||||
"waterball": {"category": "master","sounds": [{"name": "waterball", "stream": false}]},
|
||||
"chargeDown": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chargeDown",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chargeUp": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chargeUp",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"destruct": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "destruct",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"fail": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "fail",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"gust": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "gust",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"heal": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "heal",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"kinesis": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "kinesis",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"launch": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "launch",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"nova": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "nova",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"philball": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "philball",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"tock": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "tock",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"transmute": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "transmute",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"wall": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "wall",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"waterball": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "waterball",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"wind": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
|
@ -22,299 +134,101 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_1": {
|
||||
"chalk_1": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_1",
|
||||
"name": "chalk/chalk_1",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_2": {
|
||||
"chalk_2": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_2",
|
||||
"name": "chalk/chalk_2",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_3": {
|
||||
"chalk_3": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_3",
|
||||
"name": "chalk/chalk_3",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_4": {
|
||||
"chalk_4": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_4",
|
||||
"name": "chalk/chalk_4",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_5": {
|
||||
"chalk_5": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_5",
|
||||
"name": "chalk/chalk_5",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_6": {
|
||||
"chalk_6": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_6",
|
||||
"name": "chalk/chalk_6",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_7": {
|
||||
"chalk_7": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_7",
|
||||
"name": "chalk/chalk_7",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_8": {
|
||||
"chalk_8": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_8",
|
||||
"name": "chalk/chalk_8",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_9": {
|
||||
"chalk_9": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_9",
|
||||
"name": "chalk/chalk_9",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_10": {
|
||||
"chalk_10": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_10",
|
||||
"name": "chalk/chalk_10",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_short_11": {
|
||||
"chalk_11": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/short/chalk_short_11",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_1": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_1",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_2": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_2",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_3": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_3",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_4": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_4",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_5": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_5",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_6": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_6",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_7": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_7",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_8": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_8",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_9": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_9",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_10": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_10",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_medium_11": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/medium/chalk_medium_11",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_1": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_1",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_2": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_2",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_3": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_3",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_4": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_4",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_5": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_5",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_6": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_6",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_7": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_7",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_8": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_8",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_9": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_9",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_10": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_10",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"chalk_long_11": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "chalk/long/chalk_long_11",
|
||||
"name": "chalk/chalk_11",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue