I should never have done this

This commit is contained in:
Ellpeck 2015-12-02 22:31:50 +01:00
parent 0acad26335
commit a86389d2b2
3 changed files with 23 additions and 1 deletions

View file

@ -20,7 +20,10 @@ import ellpeck.actuallyadditions.config.GuiConfiguration;
import ellpeck.actuallyadditions.proxy.ClientProxy; import ellpeck.actuallyadditions.proxy.ClientProxy;
import ellpeck.actuallyadditions.update.UpdateChecker; import ellpeck.actuallyadditions.update.UpdateChecker;
import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.playerdata.PersistentClientData; import ellpeck.actuallyadditions.util.playerdata.PersistentClientData;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -73,6 +76,9 @@ public class GuiBooklet extends GuiScreen{
private boolean tryOpenMainPage; private boolean tryOpenMainPage;
private boolean saveOnClose; private boolean saveOnClose;
private static final int[] AND_HIS_NAME_IS = new int[]{Keyboard.KEY_C, Keyboard.KEY_E, Keyboard.KEY_N, Keyboard.KEY_A};
private int hisNameIsAt;
public GuiBooklet(GuiScreen parentScreen, boolean tryOpenMainPage, boolean saveOnClose){ public GuiBooklet(GuiScreen parentScreen, boolean tryOpenMainPage, boolean saveOnClose){
this.xSize = 146; this.xSize = 146;
this.ySize = 180; this.ySize = 180;
@ -149,7 +155,20 @@ public class GuiBooklet extends GuiScreen{
BookletUtils.updateSearchBar(this); BookletUtils.updateSearchBar(this);
} }
else{ else{
super.keyTyped(theChar, key); if(AND_HIS_NAME_IS.length > this.hisNameIsAt && AND_HIS_NAME_IS[this.hisNameIsAt] == key){
if(this.hisNameIsAt+1 >= AND_HIS_NAME_IS.length){
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation(ModUtil.MOD_ID_LOWER, "duhDuhDuhDuuuh")));
ModUtil.LOGGER.info("AND HIS NAME IS JOHN CENA DUH DUH DUH DUUUH");
this.hisNameIsAt = 0;
}
else{
this.hisNameIsAt++;
}
}
else{
this.hisNameIsAt = 0;
super.keyTyped(theChar, key);
}
} }
} }

View file

@ -0,0 +1,3 @@
{
"duhDuhDuhDuuuh": { "category": "record", "sounds":["duhDuhDuhDuuuh"] }
}