mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
usable train GUI
This commit is contained in:
parent
78cbce7a36
commit
e6bb2233fa
@ -1,8 +1,11 @@
|
||||
package com.hbm.extprop;
|
||||
|
||||
import com.hbm.entity.train.EntityRailCarBase;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -78,6 +81,16 @@ public class HbmPlayerProps implements IExtendedEntityProperties {
|
||||
else
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "HUD OFF", MainRegistry.proxy.ID_HUD);
|
||||
}
|
||||
|
||||
if(key == EnumKeybind.TRAIN) {
|
||||
|
||||
if(!this.player.worldObj.isRemote) {
|
||||
|
||||
if(player.ridingEntity != null && player.ridingEntity instanceof EntityRailCarBase && player.ridingEntity instanceof IGUIProvider) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, player.worldObj, player.ridingEntity.getEntityId(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keysPressed[key.ordinal()] = pressed;
|
||||
|
||||
@ -23,6 +23,7 @@ public class HbmKeybinds {
|
||||
public static KeyBinding hudKey = new KeyBinding(category + ".toggleHUD", Keyboard.KEY_V, category);
|
||||
public static KeyBinding reloadKey = new KeyBinding(category + ".reload", Keyboard.KEY_R, category);
|
||||
public static KeyBinding dashKey = new KeyBinding(category + ".dash", Keyboard.KEY_F, category);
|
||||
public static KeyBinding trainKey = new KeyBinding(category + ".trainInv", Keyboard.KEY_R, category);
|
||||
|
||||
public static KeyBinding craneUpKey = new KeyBinding(category + ".craneMoveUp", Keyboard.KEY_UP, category);
|
||||
public static KeyBinding craneDownKey = new KeyBinding(category + ".craneMoveDown", Keyboard.KEY_DOWN, category);
|
||||
@ -36,6 +37,7 @@ public class HbmKeybinds {
|
||||
ClientRegistry.registerKeyBinding(hudKey);
|
||||
ClientRegistry.registerKeyBinding(reloadKey);
|
||||
ClientRegistry.registerKeyBinding(dashKey);
|
||||
ClientRegistry.registerKeyBinding(trainKey);
|
||||
|
||||
ClientRegistry.registerKeyBinding(craneUpKey);
|
||||
ClientRegistry.registerKeyBinding(craneDownKey);
|
||||
@ -69,6 +71,7 @@ public class HbmKeybinds {
|
||||
TOGGLE_HEAD,
|
||||
RELOAD,
|
||||
DASH,
|
||||
TRAIN,
|
||||
CRANE_UP,
|
||||
CRANE_DOWN,
|
||||
CRANE_LEFT,
|
||||
|
||||
@ -190,13 +190,13 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
recipes.add(new ChemRecipe(55, "CONCRETE", 100)
|
||||
.inputItems(
|
||||
new ComparableStack(Blocks.gravel, 8),
|
||||
new ComparableStack(Blocks.sand, 8))
|
||||
new OreDictStack(KEY_SAND, 8))
|
||||
.inputFluids(new FluidStack(Fluids.WATER, 2000))
|
||||
.outputItems(new ItemStack(ModBlocks.concrete_smooth, 16)));
|
||||
recipes.add(new ChemRecipe(56, "CONCRETE_ASBESTOS", 100)
|
||||
.inputItems(
|
||||
new ComparableStack(Blocks.gravel, 2),
|
||||
new ComparableStack(Blocks.sand, 2),
|
||||
new OreDictStack(KEY_SAND, 2),
|
||||
(GeneralConfig.enableLBSM && GeneralConfig.enableLBSMSimpleChemsitry) ?
|
||||
new OreDictStack(ASBESTOS.ingot(), 1) :
|
||||
new OreDictStack(ASBESTOS.ingot(), 4))
|
||||
@ -204,7 +204,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
.outputItems(new ItemStack(ModBlocks.concrete_asbestos, 16)));
|
||||
recipes.add(new ChemRecipe(79, "DUCRETE", 150)
|
||||
.inputItems(
|
||||
new ComparableStack(Blocks.sand, 8),
|
||||
new OreDictStack(KEY_SAND, 8),
|
||||
new OreDictStack(U238.billet(), 2),
|
||||
new ComparableStack(Items.clay_ball, 4))
|
||||
.inputFluids(new FluidStack(Fluids.WATER, 2000))
|
||||
|
||||
@ -1908,6 +1908,7 @@ public class ClientProxy extends ServerProxy {
|
||||
case TOGGLE_HEAD: return HbmKeybinds.hudKey.getIsKeyPressed();
|
||||
case RELOAD: return HbmKeybinds.reloadKey.getIsKeyPressed();
|
||||
case DASH: return HbmKeybinds.dashKey.getIsKeyPressed();
|
||||
case TRAIN: return HbmKeybinds.trainKey.getIsKeyPressed();
|
||||
case CRANE_UP: return HbmKeybinds.craneUpKey.getIsKeyPressed();
|
||||
case CRANE_DOWN: return HbmKeybinds.craneDownKey.getIsKeyPressed();
|
||||
case CRANE_LEFT: return HbmKeybinds.craneLeftKey.getIsKeyPressed();
|
||||
|
||||
@ -95,6 +95,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
@ -124,6 +125,7 @@ import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
@ -1230,4 +1232,28 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOpenGUI(GuiOpenEvent event) {
|
||||
|
||||
if(event.gui instanceof GuiMainMenu) {
|
||||
GuiMainMenu main = (GuiMainMenu) event.gui;
|
||||
int rand = (int)(Math.random() * 150);
|
||||
|
||||
switch(rand) {
|
||||
case 0: main.splashText = "Floppenheimer!"; break;
|
||||
case 1: main.splashText = "i should dip my balls in sulfuic acid"; break;
|
||||
case 2: main.splashText = "All answers are popbob!"; break;
|
||||
case 3: main.splashText = "None shall enter The Orb!"; break;
|
||||
case 4: main.splashText = "Wacarb was here"; break;
|
||||
case 5: main.splashText = "SpongeBoy me Bob I am overdosing on keramine agagagagaga"; break;
|
||||
case 6: main.splashText = "I know where you live, " + System.getProperty("user.name"); break;
|
||||
case 7: main.splashText = "Nice toes, now hand them over."; break;
|
||||
case 8: main.splashText = "I smell burnt toast!"; break;
|
||||
case 9: main.splashText = "There are bugs under your skin!"; break;
|
||||
case 10: main.splashText = "Fentanyl!"; break;
|
||||
case 11: main.splashText = "Do drugs!"; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,3 +15,6 @@ public net.minecraft.client.settings.KeyBinding field_74514_b # ha
|
||||
public net.minecraft.client.settings.KeyBinding field_151473_c # keybindSet
|
||||
public net.minecraft.client.settings.KeyBinding field_74513_e # pressed
|
||||
public net.minecraft.client.settings.KeyBinding field_151474_i # pressTime
|
||||
|
||||
# GuiMainMenu
|
||||
public net.minecraft.client.gui.GuiMainMenu field_73975_c # splashText
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user