Jump to content

SoBiohazardous

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by SoBiohazardous

  1. Anyone? I know, this an unusual problem
  2. 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'])
  3. 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.
  4. Nope, that only returns the end part of it View my post above, as i edited it.
  5. 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; }
  6. 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.
  7. Works great, thanks!
  8. 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.
  9. Thanks, it no longer crashes.
  10. 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
  11. 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.
  12. Yep, i suspected so. thanks.
  13. There is no way as of yet, but feel free to make an API
  14. 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.
  15. Hello all, so the other day i learned that in PotionHelper, each effect is represented by a string. The first 3 numbers represent the Id in binary, then converted to hexadecimal. However, if you count each combination, that means there is only 15 potion ingredient slots....12 of which are used. My real question is...can this be expanded? and if so, how? Any help is appreciated, thanks.
  16. All of them in the jars folder. also you need to change your launch configuration, it can found in the new mcp.
  17. Remove those and change it too @EventHandler above ALL three methods. for a full list of changes, click https://docs.google.com/spreadsheet/ccc?key=0AhdLhUzgJSx2dFdsMk1SbDdQRTdQMXVuenBEcmpHbmc#gid=0
  18. I am having the EXACT same problem, so I will bump you
  19. Why not just compile it with the mods installed and then pull out only the modpack classfiles? Just a thought... Thanks, didn't think of that, I'll probably try it. Here is the coding explanation though. http://www.minecraftforum.net/topic/1864223-adding-recipes-between-mods/#entry23059219
  20. Actually, I have been experimenting with Reflection API. I tried using this to get my Block field in the other class. Class eoReflect = Class.forName("sobiohazardous.minestrappolation.extraores.ExtraOres"); Field sunstone = eoReflect.getField("Sunstone"); However the recipe method won't accept the sunstone variable because it is a Field. sunstone.set(object, object) doesn't work because it is a static method. I can always resort to trying and making the API's, however I think(and hope) it is not necessary. Any ideas?
  21. Hello, So I have a question. I am currently making a mod that is sort of like a mod pack. It consist of multiple mods. I need to be able to add a recipe in one mod, and use items from the other mod. That will obviously give you errors, so I made a check to see if the mod existed. However the compiler still gave me errors when i compiled the mod by itself, which makes sense. Here is the BridgeRecipes class: I am assuming I need some sort of way checking the block without actually calling the mod class. Not sure how to do that though. Any help and ideas would be appreciated.
  22. Not sure if anyone fixed this ^^, but I am curious, so I will bump
  23. Try adding this into preinit: EntityRegistry.registerModEntity(EntityGrenade.class, "Grenade", 4, this, 350, 5, false);
  24. Hello all, So I have a ItemFoodSpoilable class that waits a certain amount of time, and sets the food spoiled. It displays when the food will spoil. However, the problem is that It is universal throughout the game. by that i mean that the each instance of the item has the same amount of spoil days. So i was wondering, how can i get them to start counting down when created, and have the amount of time until spoiled specific to that instance of the item. Here is my item code: package sobiohazardous.crazyfoods.item; import java.util.List; import sobiohazardous.crazyfoods.CrazyFoods; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; public class ItemCFFoodSpoilable extends ItemFood { private int daysPassed; private int daysFresh; private ItemStack spoiledItem; private String texture; private boolean frozen = false; public ItemCFFoodSpoilable(int id, String texture, int healAmount, float saturation, boolean wolffood, int daysFresh, ItemStack spoiledItem) { super(id, healAmount, saturation, wolffood); this.setCreativeTab(CrazyFoods.tabFoods); this.daysFresh = daysFresh; this.spoiledItem = spoiledItem; this.texture = "crazyfoods:" + texture; } public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer)par3Entity; if(par5 = true) { if(par2World.getWorldTime() == 12500) { this.daysPassed += 1; } if(this.daysPassed >= daysFresh && !this.frozen) { //spoiled? player.inventory.addItemStackToInventory(spoiledItem); player.inventory.consumeInventoryItem(par1ItemStack.itemID); } } } public void registerIcons(IconRegister iconRegister) { itemIcon = iconRegister.registerIcon(texture); } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(EnumChatFormatting.RED + "Spoils in: " + Integer.toString(daysFresh - this.daysPassed)); } public void setFrozen() { this.frozen = true; } } For example, if a player where to have multiple of the item in their inventory, they would all have the same spoil properties, no matter what. I don't want that. I want the each to have separate properties. Any tips or help would be greatly appreciated.
×
×
  • Create New...

Important Information

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