Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited


  • Gender
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

twixthehero's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. I have a simple POC mod which includes some external dependencies into it. When I run the `shadowJar` task, I see the appropriate dependencies are relocated and packaged into the output at `build/libs/classloadtest-1.15.2-0.0.1-shadow.jar`. However, when I run the `jar` task, the dependencies are not included in the output jar. I searched around a bit and found [1.14.4] Jar-In-Jar Dependency Extraction Not Working [SOLVED] which I didn't really see any big differences besides Minecraft version. Did I mess up something with my configuration? Here's my `build.gradle`: buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } google() jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } plugins { id 'com.github.johnrengelman.shadow' version '4.0.4' id 'idea' id 'java' id 'maven-publish' id 'org.jetbrains.kotlin.jvm' version '1.3.72' } apply plugin: 'net.minecraftforge.gradle' repositories { maven { url = 'https://files.minecraftforge.net/maven' } google() jcenter() mavenCentral() } ... configurations { shadow compile.extendsFrom shadow } def kotlinVersion = plugins.findPlugin('org.jetbrains.kotlin.jvm').kotlinPluginVersion def exposedVersion = '0.25.1' dependencies { shadow "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}" shadow 'com.h2database:h2:1.4.200' shadow "org.jetbrains.exposed:exposed-core:${exposedVersion}" shadow "org.jetbrains.exposed:exposed-dao:${exposedVersion}" shadow "org.jetbrains.exposed:exposed-jdbc:${exposedVersion}" shadow "org.jetbrains.exposed:exposed-java-time:${exposedVersion}" minecraft 'net.minecraftforge:forge:1.15.2-31.2.9' } jar { manifest { attributes([ 'Specification-Title' : 'Krythera Classload Test', 'Specification-Vendor' : 'krythera', 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.version, 'Implementation-Vendor' : 'krythera', 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } shadowJar { classifier 'shadow' project.configurations.shadow.setTransitive(true) configurations = [project.configurations.shadow] relocate 'kotlin', 'com.krythera.shadow.kotlin' relocate 'kotlinx', 'com.krythera.shadow.kotlinx' relocate 'org.h2', 'com.krythera.shadow.org.h2' relocate 'org.intellij', 'com.krythera.shadow.org.intellij' relocate 'org.jetbrains', 'com.krythera.shadow.org.jetbrains' relocate 'org.slf4j', 'com.krythera.shadow.org.slf4j' } reobf { shadowJar {} } jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') artifacts { archives shadowJar }
  2. Hello all - How would I go about randomly spawning experience near the player? I thought about using ITickHandler to do it every so many ticks, but there's no way to get access to each player... Any thoughts? EDIT: Found a solution to get the player through ITickHandler: http://www.minecraftforge.net/forum/index.php?topic=4139.0
  3. You don't have the @ForgeSubscribe annotation anywhere, so even if you register your overlay class with Forge, it's not going to find any methods that it needs to call back. @ForgeSubscribe(priority=EventPriority.NORMAL) Also, I believe that you should be extending Gui, not GuiIngameForge.
  4. It looks like those classes have invalid sides attached to them. "@SideOnly(Side.SERVER)" Have you modified those two classes at all?
  5. Hello all! - I've been working on creating a new experience called "XM." The problem is that once you "pick it up (collide with it)," it doesn't go away, but instead keeps floating by your head. I use LivingDeathEvent to spawn in the XM. It seems like the "setDead()" function is not working...Any idea why this is happening? EntityXMOrb.java package twixthehero.ingress.entity; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import twixthehero.ingress.Ingress; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.world.World; public class EntityXMOrb extends EntityXPOrb { public EntityXMOrb(World world, double x, double y, double z, int value) { super(world, x, y, z, value); } @Override public void onCollideWithPlayer(EntityPlayer player) { if (!this.worldObj.isRemote) { if (this.field_70532_c == 0 && player.xpCooldown == 0) { player.xpCooldown = 2; this.playSound("random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); player.onItemPickup(this, 1); updatePlayer(player); informPlayer(player); this.setDead(); } } } private void updatePlayer(EntityPlayer player) { NBTTagCompound tag = player.getEntityData(); NBTBase modeTag = tag.getTag("XM"); int currentXM = ((NBTTagInt)modeTag).data; tag.setInteger("XM", currentXM + this.getXpValue()); } private void informPlayer(EntityPlayer player) { ByteArrayOutputStream os = new ByteArrayOutputStream(; DataOutputStream dos = new DataOutputStream(os); try { dos.writeInt(Ingress.XM_PICKUP_PACKET); dos.writeInt(this.getXpValue()); } catch (IOException e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "IngressXM"; packet.data = os.toByteArray(); packet.length = os.size(); PacketDispatcher.sendPacketToPlayer(packet, (Player)player); } } IngressEventHandler.java package twixthehero.ingress; import twixthehero.ingress.entity.EntityXMOrb; import net.minecraft.entity.Entity; import net.minecraftforge.event.EventPriority; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDeathEvent; public class IngressEventHandler { @ForgeSubscribe(priority=EventPriority.HIGH) public void entityUpdate(LivingDeathEvent event) { Entity e = event.entity; int i = 125; while (i > 0) { int j = EntityXMOrb.getXPSplit(i); i -= j; e.worldObj.spawnEntityInWorld(new EntityXMOrb(e.worldObj, e.posX, e.posY, e.posZ, j)); } } }
  6. Thanks everyone! I decided to use a packet (since I hadn't used them before, and I figured it was a good time to learn). In my IPlayerTracker, I use: ByteArrayOutputStream os = new ByteArrayOutputStream(4); DataOutputStream dos = new DataOutputStream(os); try { dos.writeInt(Ingress.OPEN_TEAM_SELECT_PACKET); } catch (IOException e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "IngressGUI"; packet.data = os.toByteArray(); packet.length = os.size(); PacketDispatcher.sendPacketToPlayer(packet, (Player)player); Then in my PacketHandler: @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { if (packet.channel.equals("IngressGUI")) { handleGUIPacket(player); } } private void handleGUIPacket(Player player) { if (player instanceof EntityClientPlayerMP) { EntityClientPlayerMP p = (EntityClientPlayerMP)player; p.openGui(Ingress.instance, Ingress.GUI_TEAM_SELECT, p.worldObj, 0, 0, 0); } } Then from there, my getClientGuiElement() handles it.
  7. Just for clarification, when you place an item into a slot, it appears in two slots, right? And what do you mean by not updated?
  8. You said you copied all the methods in Container and Inventory. Why not just extend Container like in this tutorial: http://www.minecraftforge.net/wiki/Containers_and_GUIs Is there something that you can't do by overriding the methods in that class?
  9. I'm trying to use a GuiScreen because I don't need to store any items inside it. Containers are for storing items inside, right? Why would this GUI need a container?
  10. I do have the GUIHandler and it is registered correctly. The problem is that within my IPlayerTracker, when I call player.openGui(), player is an instance of EntityPlayerMP so it doesn't open the GUI because it's looking for a container. IPlayerTracker: package twixthehero.ingress.server; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagString; import twixthehero.ingress.Ingress; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.IPlayerTracker; /* * TODO * Use this to check the server for player's selected team... */ public class IngressPlayerTracker implements IPlayerTracker { @Override public void onPlayerLogin(EntityPlayer player) { player.sendChatToPlayer("Welcome to Ingress!"); NBTTagCompound tag = player.getEntityData(); NBTBase modeTag = tag.getTag("Team"); if (modeTag != null) { player.sendChatToPlayer("Welcome back to the fight for the " + ((NBTTagString) modeTag).data + "!"); } else { player.sendChatToPlayer("Please select your team."); // FMLClientHandler.instance().displayGuiScreen(player, new // GUITeamSelect(player)); player.openGui(Ingress.instance, Ingress.GUI_TEAM_SELECT, player.worldObj, 0, 0, 0); //<-----------------Here } } GUIHandler: package twixthehero.ingress; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import twixthehero.ingress.gui.GUIPortal; import twixthehero.ingress.gui.GUITeamSelect; import twixthehero.ingress.gui.PortalContainer; import twixthehero.ingress.tileentity.PortalTileEntity; import cpw.mods.fml.common.network.IGuiHandler; public class IngressGUIHandler implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if (id == Ingress.GUI_TEAM_SELECT) { player.sendChatToPlayer("opening team select gui"); return new GUITeamSelect(player); } TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity != null) switch (id) { case Ingress.GUI_PORTAL: return new GUIPortal(player.inventory, (PortalTileEntity) tileEntity); } return null; } }
  11. Hello - What I'm trying to do is open a GUI for the player when they login to the server. I implement IPlayerTracker so that I can get the callback for onPlayerLogin(EntityPlayer player). In this function, I have attempted to use player.openGui(...) but no GUI ever opens. I "Ctrl+clicked" openGui in Eclipse and onward until I got to FMLNetworkHandler.openGui(). At the bottom of this method, it says: if (player instanceof EntityPlayerMP) { NetworkRegistry.instance().openRemoteGui(mc, (EntityPlayerMP) player, modGuiId, world, x, y, z); } else { NetworkRegistry.instance().openLocalGui(mc, player, modGuiId, world, x, y, z); } Now, I put debug statements in both conditions to see which one was getting called, and it turned out to be .openRemoveGui(). This calls the getServerGuiElement(). I don't have a Container (my GUI extends GuiScreen), so I want getClientGuiElement() to be called instead. Any ideas how to do this? Here's how I attempt to open the GUI from my IPlayerTracker: player.openGui(Ingress.instance, Ingress.GUI_TEAM_SELECT, player.worldObj, 0, 0, 0); Thanks
  12. I GOT IT TO RENDER! (sorry for caps, very exciting!) I just changed my block to extend BlockContainer instead of Block, and it works! Thank you so much! Please write the wiki page too, because I'm sure there are lots of people still trying to get this correct for the new versions.
  13. Thanks. I went and looked at your code. I changed some of what I had to more closely match yours and I still just get an empty bounding box. I even tried using your model and got nothing.
  14. Hello - How did you get you model to start rendering? Using the code on the wiki doesn't work, and I've tried many, many threads that I've discovered on the internet through searching (all to no avail).
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.