Skip to content

Commit

Permalink
Removed coin.wav
Browse files Browse the repository at this point in the history
Traps only show examine tip when owned
  • Loading branch information
Kenneth Dignam committed Aug 20, 2013
1 parent 797b62f commit 094825a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
19 changes: 14 additions & 5 deletions assets/fyresmodjam/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.common.MinecraftForge;
Expand All @@ -20,7 +22,7 @@

public class ClientProxy extends CommonProxy {

public static String[] sounds = {"pillarActivated", "coin"};
public static String[] sounds = {"pillarActivated"/*, "coin"*/};

@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
Expand All @@ -32,10 +34,17 @@ public void guiRenderEvent(RenderGameOverlayEvent.Post event) {
if(event.type == RenderGameOverlayEvent.ElementType.HOTBAR) {
MovingObjectPosition mouse = Minecraft.getMinecraft().objectMouseOver;

if(mouse != null && Minecraft.getMinecraft().theWorld != null && mouse.typeOfHit == EnumMovingObjectType.TILE && (Minecraft.getMinecraft().theWorld.getBlockId(mouse.blockX, mouse.blockY, mouse.blockZ) == ModjamMod.blockPillar.blockID || Minecraft.getMinecraft().theWorld.getBlockId(mouse.blockX, mouse.blockY, mouse.blockZ) == ModjamMod.blockTrap.blockID)) {
String key = Keyboard.getKeyName(FyresKeyHandler.examine.keyCode);
String string = "Press " + key + " to Examine";
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(string, (event.resolution.getScaledWidth() / 2) - (Minecraft.getMinecraft().fontRenderer.getStringWidth(string) / 2), event.resolution.getScaledHeight() / 2 + 16, Color.WHITE.getRGB());
World world = Minecraft.getMinecraft().theWorld;

if(mouse != null && world != null && mouse.typeOfHit == EnumMovingObjectType.TILE) {
TileEntity te = world.getBlockTileEntity(mouse.blockX, mouse.blockY, mouse.blockZ);
int id = world.getBlockId(mouse.blockX, mouse.blockY, mouse.blockZ);

if(id == ModjamMod.blockPillar.blockID || (id == ModjamMod.blockTrap.blockID && te != null && te instanceof TileEntityTrap && ((TileEntityTrap) te).placedBy != null)) {
String key = Keyboard.getKeyName(FyresKeyHandler.examine.keyCode);
String string = "Press " + key + " to Examine";
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(string, (event.resolution.getScaledWidth() / 2) - (Minecraft.getMinecraft().fontRenderer.getStringWidth(string) / 2), event.resolution.getScaledHeight() / 2 + 16, Color.WHITE.getRGB());
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions assets/fyresmodjam/ModjamMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;

@Mod(modid = "fyresmodjam", name = "Fyres ModJam Mod", version = "0.0.1g")
@Mod(modid = "fyresmodjam", name = "Fyres ModJam Mod", version = "0.0.2a")
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"FyresModJamMod"}, packetHandler = PacketHandler.class)
public class ModjamMod extends CommandHandler implements IPlayerTracker {

Expand Down Expand Up @@ -89,8 +89,8 @@ public class ModjamMod extends CommandHandler implements IPlayerTracker {
public static Achievement whoops;
public static AchievementPage page;

public static String version = "v0.0.1g";
public static String foundVersion = "v0.0.1g";
public static String version = "v0.0.2a";
public static String foundVersion = "v0.0.2a";

public static void loadProperties() {
Properties prop = new Properties();
Expand Down
Binary file removed assets/fyresmodjam/sound/coin.wav
Binary file not shown.

0 comments on commit 094825a

Please sign in to comment.