Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/29/18 in all areas

  1. public static void register() { gui = new KeyBinding("key.gui", Keyboard.KEY_U, "key.categories.mhq"); ClientRegistry.registerKeyBinding(gui); Keybinds.register(); MinecraftForge.EVENT_BUS.register(new KeyInputHandler()); } Are you... calling the register method from inside of the register method? The fact that you do not have a StackOverflow on your hands means that you are not calling register from anywhere in the first place.
    2 points
  2. The weather in the game is globalized, meaning if it's raining - it's raining everywhere in the world at once. And "raining" in this case means that the weather isn't "clear" so to speak. So you can absolutely keep this method: However when it comes to snow it's a bit different. You see, if it's supposed to be snowing in the biome instead of raining then the World#isRainingAt will return false. It will also return false if you go high enough so the rain becomes snow. So you need to account for these too. Basically I would have separate checks to determine the weather at the current spot: public enum EnumWeather { CLEAR, SNOW, RAIN, DRY } public static EnumWeather getWeatherAt(EntityPlayer player) { World world = player.world; BlockPos pos = player.getPosition(); if (!world.isRaining()) { // If it isn't raining at all in the world it means that the weather is clear everywhere in the world. return EnumWeather.CLEAR; } Biome biome = world.getBiome(pos); if (!biome.isSnowyBiome() && !biome.canRain()) { // If the biome can't have rain nor snow then it's a dry biome like a desert where it never rains. return EnumWeather.DRY; } boolean isSnowingAtHeight = world.getBiomeProvider().getTemperatureAtHeight(biome.getTemperature(pos), pos.getY()) < 0.15F; if (isSnowingAtHeight) { // If the adjusted temperature is less than 0.15 then it is snowing here. // And before you tell me about Biome#isSnowyBiome - all the logic is taken from EntityRenderer#renderRainSnow. It doesn't care whether the biome is a "snowy" one to render the snow effects - it only cares about the temperature at a given location. return EnumWeather.SNOW; } // If all other options are out then it must be raining return EnumWeather.RAIN; } Any particular reason you are using a forge version that is soon to be a year old? You should update.
    1 point
  3. So, I have same problem with particles. Try to make cycle of particle spawn with random position or try to see how furnace/torch/lava particle generator works.
    1 point
  4. Hello Modders! Sorry for my bad English I have Tile Entity that have working time and I have GUI with Progress Bar that need this working time. And I don't know how to do it. Pls help Block: *CLICK* Tile Entity: *CLICK* Container: *CLICK* GUI: *CLICK*
    1 point
  5. So, I tried. Crash: Packet Handler: *CLICK* What's wrong. Yeah, I don't like packets and never work with it
    1 point
  6. So, I try to get 'TIME' from NBT, but I don't know why it didn't working. So, writeToNBT in my Tile Entity class looks like that: @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setInteger("time", this.time); compound.setInteger("maxTime", METAL_REFINERY_WORKTIME); compound.setTag("items", this.itemStackHandler.serializeNBT()); return compound; } And my GUI Screen Updater looks like that: @Override public void updateScreen() { NBTTagCompound compound = new NBTTagCompound(); compound = this.te.writeToNBT(compound); this.time = compound.getInteger("time"); this.maxTime = compound.getInteger("maxTime"); Core.logger.info(compound); super.updateScreen(); } What's wrong? Full code: Block: *CLICK* Tile Entity: *CLICK* Container: *CLICK* GUI: *CLICK*
    1 point
  7. 1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.