Jump to content

SoBiohazardous

Members
  • Posts

    44
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Michigan, USA

Recent Profile Visitors

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

SoBiohazardous's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Hello there, So I have multiple mods in a single workspace that require a few dependencies. If I don't try and package in the dependencies, the mod compiles fine. However, when I uncomment the from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } line for packing in the dependencies, I get a ton of compile errors that are all complaining of minecraft packages that don't exist. Here is the build.gradle: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.7.2-2.1.3" group= "" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Minestrappolation" sourceSets.main.java{srcDirs project.projectDir.getPath() include("sobiohazardous/**")} sourceSets.main.resources{srcDirs project.projectDir.getPath() include("assets/**")} sourceCompatibility = 1.7 targetCompatibility = 1.7 minecraft { version = "1.7.2-10.12.1.1061" if(file('../run').exists()) { assetDir = "../run/assets/" } else { assetDir = "eclipse/assets" } } dependencies { compile fileTree(dir:'dependencies',include:'*.zip') } processResources { // copy everything else, thats not mcmod.info from(project.sourceSets.main.resources.srcDirs) { include("*.png", "*.lang") } } task unJar(type:Copy, dependsOn:'build') unJar{ from zipTree(jar.archivePath) into 'build/unjar' } jar { //Keep the jar as clean as possible includeEmptyDirs = false //package dependencies in. from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } task buildAPI(type:Jar, dependsOn:'unJar') buildAPI{ archiveName = "MAPI" + "-" + minecraft.version + "-" + "1.3.1" +"." + extension from 'build/unjar' include('assets/**', 'sobiohazardous/minestrappolation/api/**') from('api_info'){ include('mcmod.info') // replace version and mcversion expand([version:version, mcversion:minecraft.version]) } } task buildEO(type:Jar, dependsOn:'unJar') buildEO{ archiveName = "Extrapolated Ores" + "-" + minecraft.version + "-" + "1.5.1" +"." + extension from 'build/unjar' include('assets/**', 'sobiohazardous/minestrappolation/extraores/**') from('eo_info'){ include('mcmod.info') // replace version and mcversion expand([version:version, mcversion:minecraft.version]) } } task buildED(type:Jar, dependsOn:'unJar') buildED{ archiveName = "Extrapolated Decor" + "-" + minecraft.version + "-" + "1.4.2" +"." + extension from 'build/unjar' include('assets/**', 'sobiohazardous/minestrappolation/extradecor/**') from('ed_info'){ include('mcmod.info') // replace version and mcversion expand([version:version, mcversion:minecraft.version]) } } task buildEMD(type:Jar, dependsOn:'unJar') buildEMD{ archiveName = "Extrapolated Mob Drops" + "-" + minecraft.version + "-" + "1.0" +"." + extension from 'build/unjar' include('assets/**', 'sobiohazardous/minestrappolation/extramobdrops/**') from('emd_info'){ include('mcmod.info') // replace version and mcversion expand([version:version, mcversion:minecraft.version]) } } task buildEE(type:Jar, dependsOn:'unJar') buildEE{ archiveName = "Extrapolated Enviroments Ores" + "-" + minecraft.version + "-" + "1.0" +"." + extension from 'build/unjar' include('assets/**', 'sobiohazardous/minestrappolation/extraenviroments/**') from('ee_info'){ include('mcmod.info') // replace version and mcversion expand([version:version, mcversion:minecraft.version]) } } task buildPack(dependsOn:['buildAPI','buildEO','buildED']) task buildAll(dependsOn:['buildAPI','buildEO','buildED', 'buildEMD', 'buildEE'])
  2. I'm a bit confused, I'm not sure how this applies to my code. Also, It might work in the eclipse environment, but come build time and run it in your minecraft and it won't work.
  3. Nope, that only returns the end part of it View my post above, as i edited it.
  4. Hello all, I need to get the direct location of a mods assets folder on the user's computer. I know that Minecraft.getMinecraft().mcDataDir will get where minecraft is located, however i'm not sure to get the assets of mod as well. Any help would be appreciated, thanks. Here is my method that needs it, in case you where wondering. It is supposed to return all the textures in a folder. /** * Returns all of the textures with the material prefix and the type in an array. used for metadata material blocks * @param matPrefix * @param type * @return */ public static String[] getMaterialStringArray(String id, String matPrefix, String type) { List<String> textures = new ArrayList<>(); try { String path = new ResourceLocation("extradecor:/textures/blocks/stoneCutter/").getResourcePath(); File textureDir = new File(path); for(int i = 0; i < textureDir.list().length; i++) { if(textureDir.list()[i].startsWith(matPrefix + "_" + type)) { textures.add(id + ":/stoneCutter/" + textureDir.list()[i].replaceAll(".png", "")); } } } catch(Exception e) { } //convert the list to an array String[] result = new String[textures.size()]; for(int i = 0; i < textures.size(); i++) { result[i] = textures.get(i); } return result; }
  5. Hello, My source contains some code used by java compiler 1.7, and i am getting errors at build time. I was wondering if I could change the java compliance to 1.7? thanks.
  6. Hello all, So i have a gui that opens when you press a keybind, and it's supposed to close when you hit the keybind again. However, the GUI never closes. Here is my code: KeyHandler package sobiohazardous.dashboard.handler; import org.lwjgl.input.Keyboard; import sobiohazardous.dashboard.client.gui.GuiOverlay; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.settings.KeyBinding; public class DKeyHandler { /** Key index for easy handling */ public static final int CUSTOM_INV = 0; /** Key descriptions; use a language file to localize the description later */ private static final String[] desc = { "key.tut_inventory.desc" }; /** Default key values */ private static final int[] keyValues = { Keyboard.KEY_Y }; private final KeyBinding[] keys; public boolean isOn = false; public DKeyHandler() { keys = new KeyBinding[desc.length]; for (int i = 0; i < desc.length; ++i) { keys[i] = new KeyBinding(desc[i], keyValues[i], "key.tutorial.category"); ClientRegistry.registerKeyBinding(keys[i]); } } /** * KeyInputEvent is in the FML package, so we must register to the FML event * bus */ @SubscribeEvent public void onKeyInput(KeyInputEvent event) { // FMLClientHandler.instance().getClient().inGameHasFocus if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) { if (keys[CUSTOM_INV].isPressed() && !isOn) { //TutorialMain.packetPipeline.sendToServer(new OpenGuiPacket(TutorialMain.GUI_CUSTOM_INV)); isOn = true; } else if(keys[CUSTOM_INV].isPressed() && isOn) { isOn = false; } else { isOn = false; } } } } OverlayHandler (Basically an FML Event handler) package sobiohazardous.dashboard.handler; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.lwjgl.opengl.GL11; import sobiohazardous.dashboard.Dashboard; import sobiohazardous.dashboard.client.gui.GuiOverlay; import sobiohazardous.dashboard.lib.DReference; import sobiohazardous.dashboard.util.DUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class DashboardOverlayHandler { private Minecraft mc; public DashboardOverlayHandler(Minecraft mc) { this.mc = mc; } @SubscribeEvent public void renderGameOverlay(RenderGameOverlayEvent.Pre event) { if(Dashboard.keyHandler.isOn && !FMLClientHandler.instance().isGUIOpen(GuiScreen.class)) { mc.displayGuiScreen(new GuiOverlay()); } if(!Dashboard.keyHandler.isOn && FMLClientHandler.instance().isGUIOpen(GuiOverlay.class)) { mc.displayGuiScreen((GuiScreen)null); } System.out.println(Dashboard.keyHandler.isOn); } } Thanks in advance.
  7. So, i'm trying to render something above the players head. Here is my render code in my tick method: if(player.inventory.getCurrentItem() != EMDItemManager.hangGlider.getContainerItem(null)) { GL11.glPushMatrix(); ModelHangGlider m = new ModelHangGlider(); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(MAssetManager.getEMDTexture("textures/misc/hangGlider.png"))); int tick = 0; tick++; float rotateYaw = EMDEventHandler.interpolateRotation(player.prevRotationYaw, player.rotationYaw, tick); GL11.glRotatef(rotateYaw, 0, -1, 0); GL11.glRotatef(180F, 0, 0, 1); GL11.glTranslatef(0, 0, -0.5F); m.render(0.0625F); GL11.glPopMatrix(); } This is my crash: java.lang.RuntimeException: No OpenGL context found in the current thread. at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glPushMatrix(GL11.java:2582) at sobiohazardous.minestrappolation.extramobdrops.handler.EMDPlayerTickHandler.playerUpdate(EMDPlayerTickHandler.java:52) at cpw.mods.fml.common.eventhandler.ASMEventHandler_10_EMDPlayerTickHandler_playerUpdate_PlayerTickEvent.invoke(.dynamic) at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) at cpw.mods.fml.common.FMLCommonHandler.onPlayerPreTick(FMLCommonHandler.java:327) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:244) at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:321) at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:310) at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:137) at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java: at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:211) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:173) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:681) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:569) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:454) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:706) The line number points to GL11.glPushMatrix(); I'm not sure why I am getting this crash, considering this worked in 1.6.4. Please note that my tick method is using PlayerTickEvent. Any help would be greatly appreciated
  8. Hello, So I have rendered a hanglider model of the player. However, I want to raise (or rotate) the player arms upward to look like the player would be holding the hang glider. Is there any way to this without editing base classes? Thanks in advance.
  9. There is no way as of yet, but feel free to make an API
  10. I'm assuming you have a object that inherits Potion, correct? When you instiantate it, simply .setIconIndex(x, y) x and y are the coords of where the icon is located on inventory.png.
×
×
  • Create New...

Important Information

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