Jump to content

Leaderboard

Popular Content

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

  1. It's pretty much up to you. There are a couple different approaches to take. Either you could have another gui class and offload more functions from the main window into the popup one, or you could create something yourself to handle the instructions from the main window that wouldn't be as complicated or sophisticated as a new gui (for example, something that simply drew an image when told to, held its x & y, etc). After doing either of those things, you could have the popup window be contained and controlled by the primary window, which would just involve having them as fields within that class and doing whatever needs to be done to them through that class. Or you could keep the handling of the popup window external, doing things to it alongside the main window. That would leak a little more gui handling into the outside world though.
    1 point
  2. So, just a few things (but not related to your issue, just code style problems): This is copy-pasted decompiled code. There's no reason to use Boolean.valueOf There's no reason for a cast here. You are passed a hand in this function, you should query based on the hand given to you. If the purpose of this code is to continuously set the block above to be fire, there's a better way to do this. Make your block infinitely burnable (like netherack) and set the fire once in onBlockActivated. Then you don't need the tick method or the LIT property at all.
    1 point
  3. You'll want to use the RenderWorldLastEvent. Ask the client player's world for all the entities within an area. Then ask for the items. Retrieve the IModel/BakedModel from the model registry for that Item/ItemStack. Then trace the textured quad.
    1 point
  4. Ok, i've made some mistake ... now it work without cheat mode enabled ( should work too in MP ) : package com.kporal.lau.events; import com.kporal.lau.init.ItemsInit; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class OnPlayerInteract { @SubscribeEvent ( priority = EventPriority.HIGH ) public void onPlayerRightClick( PlayerInteractEvent.RightClickBlock e ) { EntityPlayer p = e.getEntityPlayer(); if( p.getHeldItemMainhand().getItem() == ItemsInit.windstaff ) { p.setSpawnPoint( e.getPos(), true ); p.sendStatusMessage( new TextComponentString( TextFormatting.RED + "#LAU:" + TextFormatting.WHITE + " Teleport point set at " + e.getPos() ), true ); } } @SubscribeEvent ( priority = EventPriority.HIGH ) public void onPlayerLeftClick( PlayerInteractEvent.LeftClickEmpty e ) { EntityPlayer p = e.getEntityPlayer(); if( p.getHeldItemMainhand().getItem() == ItemsInit.windstaff ) { BlockPos c = p.getBedLocation( p.dimension ); double px = c.getX() + 0.5; double py = c.getY() + 1; double pz = c.getZ() + 0.5; MinecraftServer s = FMLCommonHandler.instance().getMinecraftServerInstance(); s.getCommandManager().executeCommand( s, "/tp " + p.getName() + " " + px + " " + py + " " + pz ); p.sendStatusMessage( new TextComponentString( TextFormatting.RED + "#LAU:" + TextFormatting.WHITE + " Telporting to " + c ), true ); } } } Hope this can help someone else
    1 point
  5. The channel name of your SimpleNetworkWrapper (usually your mod ID) can't be more than 20 characters long.
    1 point
×
×
  • Create New...

Important Information

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