Jump to content

jabelar

Members
  • Posts

    3266
  • Joined

  • Last visited

  • Days Won

    39

Everything posted by jabelar

  1. I think a tile entity with an inventory should also have a Container class and that should help do the syncing. There should be a Container instance that is associated with the TileEntity instance, so any movement of the block by pistons or falling and such shouldn't cause trouble.
  2. Guys, the original question is really simple -- it isn't actually a problem at all. In Eclipse there are two ways of displaying the packages. There is a little down arrow in the top of the package pane that brings up a menu and in that there is Package Presentation. There are two options "Flat" and "Hierarchical". If you choose flat it will show the full package names "com.ejer.first" and if you choose hierarchical it will only show the full name if there are no other sibling packages. For example, in hierarchical if you start by creating a package called "com.ejer.first" then it will show it that way, but as soon as you create another package called "com.examplemod" it will then show them both in a directory tree "com > ejer.first" and "com > examplemod". In other words, your package is still properly com.ejer.first, it just displays as a folder explorer. So basically there was nothing wrong in the first post. That is the way hierarchical view looks.
  3. You never seem to set any actual attack AI. The targeting AI just sets the target but doesn't do any movement or attack. You need something like EntityAIAttackMelee() also added to the tasks list. In other words, the targeting and the actual attack are meant to be separate AI and if you want the entity to move towards the target you need to add that AI as well.
  4. I think he probably means that from the message class, how do you figure out the world and thus the entities instances available to match against. I'm not entirely sure it is the best way, but I used to do the following in a mod. Note that getting entity by ID might have changed in more recent versions. In the message from server to client, in the onMessage() method I would get the player from the context then the world from that as follows: EntityPlayer thePlayer = MainMod.proxy.getPlayerEntityFromContext(ctx); Entity theEntity = thePlayer.world.getEntityByID(message.entityId); Where in my proxy I had the getPlayerEntityFromContext() method as follows for client proxy: public EntityPlayer getPlayerEntityFromContext(MessageContext ctx) { return (ctx.side.isClient() ? Minecraft.getMinecraft().player : super.getPlayerEntityFromContext(ctx)); } And in my common proxy had: public EntityPlayer getPlayerEntityFromContext(MessageContext ctx) { return ctx.getServerHandler().player; }
  5. Well, in the player tick event you could check for collisions with entities.
  6. If you look at the renderLeash() method in the RenderLiving class you'll see that it picks essentially the X, Y, and Z location of the entity and it would be hard to change that. However, you might be able to adjust it a bit. The method also uses the getEyeHeight() method from your entity and adjusts the height of the leash that way. So in your entity you should return a value for getEyeHeight() that works best (note though that it should also be set to work for other things that eye height is used for -- eye height is essentially used as the entity's head position for things like drowning in water). Additionally, depending on how "crazy" your entity model is you might want to consider adjusting the offsets of the entity's model.
  7. The general principles that diesieben07 is mentioning are: 1) If you want do to something in modding, start by looking at the closest things in vanilla minecraft and see how they accomplish it. 2) The approach you take often depends on whether you're making your entirely new thing (block, item, entity) or trying to change an existing one. For your own thing, you can often just extend classes, implement interfaces and override methods as you wish. For vanilla things you need to look for "hooks" such as: a) Many classes have publicly accessible fields and methods. For example, entity AI is public so you can totally replace it if you wanted. b) Forge has provided a lot of hooks, especially events but also registries and ore dictiionary, that allow you to intercept and replace vanilla behavior. c) If you really don't have either of the above, you can use Java reflection to change the access scope of the vanilla fields and methods.
  8. The reason you missed it when you were testing is because you probably tested in single player mode. You MUST test your mods by running a separate server and client. Within Eclipse you can simply run both the client and server configurations at same time and connect to the local host 127.0.0.1. This happens because when running in single player there is only one Java VM running both sides to it actually sees the classes that are loaded on the other sides. But if you run a dedicated server run configuration you will have two separate Java VMs each loading only their own classes. The isRemote is for an entirely different thing. This problem is related to classes and how they are loaded, not just how they are executed.
  9. They're in the process of transitioning over, so the deprecated stuff might work for now, but probably good to move over since you're already actively working on registration code.
  10. There are two types of debug. First you can use the debug mode of Eclipse (along with breakpoints as mentioned). The problem with this method is that anything that takes a long time or takes specific gameplay can be difficult to capture because if the breakpoint happens every tick you won't be able to play the game. So the alternative is to simply use console (or logger) print statements. In each of your functions put a print statement that (a) proves which code path is executing (b) prints out any important field values. Both of these methods essentially "trace" the code execution. Since computers are purely logical, by careful tracing you can always debug easily. You should see right away whether it is generating different ores than you expect, you should be able to trace that back to what biome it thinks it is in, and so forth. The key point is that programmers don't really debug by reading code (especially other people's code), rather they trace the execution and also create alternative versions of the code to help isolate the problem. It will really help your modding (and general programming) ability to get used to tracing your code.
  11. I do it when I'm also planning to save / load the information. I know I can also do that in a raw file sort of way, but kinda nice to have one format that contains mixed data types that has helper classes for both packet and file serializers.
  12. Okay, I waited for a while until the web page started responding and re-ran the genPatches which now works.
  13. If I try the http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml url directly it also doesn't load. So I guess it is a hosting problem?
  14. So I have been "happily" submitting commits to a couple of my PRs and all of a sudden the Travis builds are failing. Also the genPatches fails with similar error report (Could not resolve all dependencies for configuration ':classpath'. Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.) I haven't been changing the build.gradle file or anything. Since the travis build is run by github and the genPatches is run on my computer I'm thinking it is some 3rd party problem like gradle host site not working? Here is the full error for the Travis build: Worker information hostname: e365b401-93ab-4bf2-93e1-367cb0849502@1.production-5-worker-org-a-3-gce version: v3.1.0 https://github.com/travis-ci/worker/tree/5b106cb773802277034d07b0a865af58d67bb1d2 instance: testing-gce-5e166a66-1093-4096-8dfd-d602f29f2b22:travis-ci-garnet-trusty-1503972833 (via amqp) startup: 21.361899441s system_info Build system information Build language: java Build group: stable Build dist: trusty Build id: 291284091 Job id: 291284092 Runtime kernel version: 4.4.0-93-generic travis-build version: 3fd6c3fda Build image provisioning date and time Tue Aug 29 02:48:34 UTC 2017 Operating System Details Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty Cookbooks Version 4642454 https://github.com/travis-ci/travis-cookbooks/tree/4642454 git version git version 2.14.1 bash version GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) gcc version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. docker version Client: Version: 17.03.1-ce API version: 1.27 Go version: go1.7.5 Git commit: c6d412e Built: Mon Mar 27 17:10:36 2017 OS/Arch: linux/amd64 Server: Version: 17.03.1-ce API version: 1.27 (minimum version 1.12) Go version: go1.7.5 Git commit: c6d412e Built: Mon Mar 27 17:10:36 2017 OS/Arch: linux/amd64 Experimental: false clang version clang version 3.9.0 (tags/RELEASE_390/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/clang-3.9.0/bin jq version jq-1.5 bats version Bats 0.4.0 shellcheck version 0.4.6 shfmt version v1.3.1 ccache version ccache version 3.1.9 Copyright (C) 2002-2007 Andrew Tridgell Copyright (C) 2009-2011 Joel Rosdahl This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. cmake version cmake version 3.2.2 CMake suite maintained and supported by Kitware (kitware.com/cmake). heroku version heroku-cli/6.13.19-6cd27b3 (linux-x64) node-v8.3.0 imagemagick version Version: ImageMagick 6.7.7-10 2017-07-31 Q16 http://www.imagemagick.org md5deep version 4.2 mercurial version Mercurial Distributed SCM (version 4.2.2) (see https://mercurial-scm.org for more information) Copyright (C) 2005-2017 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. mysql version mysql Ver 14.14 Distrib 5.6.33, for debian-linux-gnu (x86_64) using EditLine wrapper openssl version OpenSSL 1.0.1f 6 Jan 2014 packer version Packer v1.0.2 Your version of Packer is out of date! The latest version is 1.0.4. You can update by downloading from www.packer.io postgresql client version psql (PostgreSQL) 9.6.4 ragel version Ragel State Machine Compiler version 6.8 Feb 2013 Copyright (c) 2001-2009 by Adrian Thurston subversion version svn, version 1.8.8 (r1568071) compiled Aug 10 2017, 17:20:39 on x86_64-pc-linux-gnu Copyright (C) 2013 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ The following repository access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.3 - handles 'http' scheme - handles 'https' scheme sudo version Sudo version 1.8.9p5 Configure options: --prefix=/usr -v --with-all-insults --with-pam --with-fqdn --with-logging=syslog --with-logfac=authpriv --with-env-editor --with-editor=/usr/bin/editor --with-timeout=15 --with-password-timeout=0 --with-passprompt=[sudo] password for %p: --without-lecture --with-tty-tickets --disable-root-mailer --enable-admin-flag --with-sendmail=/usr/sbin/sendmail --with-timedir=/var/lib/sudo --mandir=/usr/share/man --libexecdir=/usr/lib/sudo --with-sssd --with-sssd-lib=/usr/lib/x86_64-linux-gnu --with-selinux Sudoers policy plugin version 1.8.9p5 Sudoers file grammar version 43 Sudoers path: /etc/sudoers Authentication methods: 'pam' Syslog facility if syslog is being used for logging: authpriv Syslog priority to use when user authenticates successfully: notice Syslog priority to use when user authenticates unsuccessfully: alert Send mail if the user is not in sudoers Use a separate timestamp for each user/tty combo Lecture user the first time they run sudo Root may run sudo Allow some information gathering to give useful error messages Require fully-qualified hostnames in the sudoers file Visudo will honor the EDITOR environment variable Set the LOGNAME and USER environment variables Length at which to wrap log file lines (0 for no wrap): 80 Authentication timestamp timeout: 15.0 minutes Password prompt timeout: 0.0 minutes Number of tries to enter a password: 3 Umask to use or 0777 to use user's: 022 Path to mail program: /usr/sbin/sendmail Flags for mail program: -t Address to send mail to: root Subject line for mail messages: *** SECURITY information for %h *** Incorrect password message: Sorry, try again. Path to authentication timestamp dir: /var/lib/sudo Default password prompt: [sudo] password for %p: Default user to run commands as: root Value to override user's $PATH with: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin Path to the editor for use by visudo: /usr/bin/editor When to require a password for 'list' pseudocommand: any When to require a password for 'verify' pseudocommand: all File descriptors >= 3 will be closed before executing a command Environment variables to check for sanity: TZ TERM LINGUAS LC_* LANGUAGE LANG COLORTERM Environment variables to remove: RUBYOPT RUBYLIB PYTHONUSERBASE PYTHONINSPECT PYTHONPATH PYTHONHOME TMPPREFIX ZDOTDIR READNULLCMD NULLCMD FPATH PERL5DB PERL5OPT PERL5LIB PERLLIB PERLIO_DEBUG JAVA_TOOL_OPTIONS SHELLOPTS GLOBIGNORE PS4 BASH_ENV ENV TERMCAP TERMPATH TERMINFO_DIRS TERMINFO _RLD* LD_* PATH_LOCALE NLSPATH HOSTALIASES RES_OPTIONS LOCALDOMAIN CDPATH IFS Environment variables to preserve: JAVA_HOME TRAVIS CI DEBIAN_FRONTEND XAUTHORIZATION XAUTHORITY PS2 PS1 PATH LS_COLORS KRB5CCNAME HOSTNAME HOME DISPLAY COLORS Locale to use while parsing sudoers: C Directory in which to store input/output logs: /var/log/sudo-io File in which to store the input/output log: %{seq} Add an entry to the utmp/utmpx file when allocating a pty PAM service name to use PAM service name to use for login shells Create a new PAM session for the command to run in Maximum I/O log sequence number: 0 Local IP address and netmask pairs: 10.240.0.10/255.255.255.255 172.17.0.1/255.255.0.0 Sudoers I/O plugin version 1.8.9p5 gzip version gzip 1.6 Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. Copyright (C) 1993 Jean-loup Gailly. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. Written by Jean-loup Gailly. zip version Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license. This is Zip 3.0 (July 5th 2008), by Info-ZIP. Currently maintained by E. Gordon. Please send bug reports to the authors using the web page at www.info-zip.org; see README for details. Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip, as of above date; see http://www.info-zip.org/ for other sites. Compiled with gcc 4.8.2 for Unix (Linux ELF) on Oct 21 2013. Zip special compilation options: USE_EF_UT_TIME (store Universal Time) BZIP2_SUPPORT (bzip2 library version 1.0.6, 6-Sept-2010) bzip2 code and library copyright (c) Julian R Seward (See the bzip2 license for terms of use) SYMLINK_SUPPORT (symbolic links supported) LARGE_FILE_SUPPORT (can read and write large files on file system) ZIP64_SUPPORT (use Zip64 to store large files in archives) UNICODE_SUPPORT (store and read UTF-8 Unicode paths) STORE_UNIX_UIDs_GIDs (store UID/GID sizes/values using new extra field) UIDGID_NOT_16BIT (old Unix 16-bit UID/GID extra field not used) [encryption, version 2.91 of 05 Jan 2007] (modified for Zip 3) Encryption notice: The encryption code of this program is not copyrighted and is put in the public domain. It was originally written in Europe and, to the best of our knowledge, can be freely distributed in both source and object forms from any country, including the USA under License Exception TSU of the U.S. Export Administration Regulations (section 740.13(e)) of 6 June 2002. Zip environment options: ZIP: [none] ZIPOPT: [none] vim version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:43:18) Included patches: 1-52 Extra patches: 8.0.0056 Modified by [email protected] Compiled by buildd@ Huge version without GUI. Features included (+) or not (-): +acl +farsi +mouse_netterm +syntax +arabic +file_in_path +mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static -balloon_eval +float +mouse_urxvt -tag_any_white -browse +folding +mouse_xterm -tcl ++builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent +gettext -mzscheme +textobjects -clientserver -hangul_input +netbeans_intg +title -clipboard +iconv +path_extra -toolbar +cmdline_compl +insert_expand -perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info +keymap +postscript +virtualedit +comments +langmap +printer +visual +conceal +libcall +profile +visualextra +cryptv +linebreak +python +viminfo +cscope +lispindent -python3 +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con -lua +rightleft +windows +diff +menu -ruby +writebackup +digraphs +mksession +scrollbind -X11 -dnd +modify_fname +signs -xfontset -ebcdic +mouse +smartindent -xim +emacs_tags -mouseshape -sniff -xsmp +eval +mouse_dec +startuptime -xterm_clipboard +ex_extra +mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop -xpm system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions iptables version iptables v1.4.21 curl version curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3 wget version GNU Wget 1.15 built on linux-gnu. rsync version rsync version 3.1.0 protocol version 31 gimme version v1.2.0 nvm version 0.33.2 perlbrew version /home/travis/perl5/perlbrew/bin/perlbrew - App::perlbrew/0.80 phpenv version rbenv 1.1.1-4-g4ebd1bd rvm version rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/] default ruby version ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] CouchDB version couchdb 1.6.1 ElasticSearch version 5.5.0 Installed Firefox version firefox 55.0.2 MongoDB version MongoDB 3.2.16 Pre-installed PostgreSQL versions 9.2.22 9.3.18 9.4.13 9.5.8 9.6.4 RabbitMQ Version 3.6.11 Redis version redis-server 4.0.1 riak version 2.2.3 Pre-installed Go versions 1.7.4 ant version Apache Ant(TM) version 1.9.3 compiled on April 8 2014 mvn version Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T19:39:06Z) Maven home: /usr/local/maven-3.5.0 Java version: 1.8.0_144, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-81-generic", arch: "amd64", family: "unix" gradle version ------------------------------------------------------------ Gradle 4.0.1 ------------------------------------------------------------ Build time: 2017-07-07 14:02:41 UTC Revision: 38e5dc0f772daecca1d2681885d3d85414eb6826 Groovy: 2.4.11 Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015 JVM: 1.8.0_144 (Oracle Corporation 25.144-b01) OS: Linux 4.4.0-81-generic amd64 lein version WARNING: You're currently running as root; probably by accident. Press control-C to abort or Enter to continue as root. Set LEIN_ROOT to disable this warning. Leiningen 2.7.1 on Java 1.8.0_144 Java HotSpot(TM) 64-Bit Server VM Pre-installed Node.js versions v4.8.4 v6.11.2 v6.9.4 v7.4.0 v8.4 phpenv versions system 5.6 * 5.6.31 (set by /home/travis/.phpenv/version) 7.0 7.0.22 hhvm hhvm-stable composer --version Composer version 1.4.2 2017-05-17 08:17:52 Pre-installed Ruby versions ruby-2.2.7 ruby-2.3.4 ruby-2.4.1 removed ‘/etc/apt/sources.list.d/basho_riak.list’ W: http://dl.hhvm.com/ubuntu/dists/trusty/InRelease: Signature by key 36AEF64D0207E7EEE352D4875A16E7281BE7A449 uses weak digest algorithm (SHA1) W: GPG error: http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release: The following signatures were invalid: KEYEXPIRED 1507497109 W: The repository 'http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release' is not signed. W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1) Executing: /tmp/tmp.FfeKptcP5l/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 gpg: requesting key EA312927 from hkp server keyserver.ubuntu.com gpg: key EA312927: "MongoDB 3.2 Release Signing Key <[email protected]>" 1 new signature gpg: Total number processed: 1 gpg: new signatures: 1 $ jdk_switcher use oraclejdk8 Switching to Oracle JDK8 (java-8-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-8-oracle git.checkout 1.25s$ git clone --depth=50 https://github.com/MinecraftForge/MinecraftForge.git MinecraftForge/MinecraftForge Cloning into 'MinecraftForge/MinecraftForge'... remote: Counting objects: 2563, done. remote: Compressing objects: 100% (1810/1810), done. remote: Total 2563 (delta 803), reused 1368 (delta 460), pack-reused 0 Receiving objects: 100% (2563/2563), 1.91 MiB | 11.01 MiB/s, done. Resolving deltas: 100% (803/803), done. $ cd MinecraftForge/MinecraftForge 0.63s$ git fetch origin +refs/pull/4478/merge: remote: Counting objects: 305, done. remote: Compressing objects: 100% (125/125), done. remote: Total 305 (delta 151), reused 277 (delta 134), pack-reused 0 Receiving objects: 100% (305/305), 119.34 KiB | 11.93 MiB/s, done. Resolving deltas: 100% (151/151), completed with 47 local objects. From https://github.com/MinecraftForge/MinecraftForge * branch refs/pull/4478/merge -> FETCH_HEAD $ git checkout -qf FETCH_HEAD Setting environment variables from .travis.yml $ export BUILD_NUMBER=9999 $ export TERM=dumb Disabling Gradle daemon 0.00s$ mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties $ export PATH=$JAVA_HOME/bin:$PATH cache.1 Setting up build cache $ export CASHER_DIR=$HOME/.casher 0.16s$ Installing caching utilities 0.00s 7.28sattempting to download cache archive fetching PR.4478/cache-linux-trusty-075817feb87ddb8db1ab29b413bc89af99fb912e01fbc555080b5fb6c6167697--jdk-oraclejdk8.tgz found cache 0.00s 14.99sadding /home/travis/.gradle/caches to cache creating directory /home/travis/.gradle/caches adding /home/travis/.gradle/wrapper to cache creating directory /home/travis/.gradle/wrapper adding /home/travis/build/MinecraftForge/MinecraftForge/build/localCache/Forge to cache creating directory /home/travis/build/MinecraftForge/MinecraftForge/build/localCache/Forge $ java -Xmx32m -version java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode) $ javac -J-Xmx32m -version javac 1.8.0_144 before_install 0.01s$ chmod +x gradlew 141.13s$ ./gradlew --refresh-dependencies FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'forge'. > Could not resolve all dependencies for configuration ':classpath'. > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT. Required by: :forge:unspecified > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT. > Unable to load Maven meta-data from http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml. > Could not GET 'http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'. > Connect to files.minecraftforge.net:80 [files.minecraftforge.net/158.69.55.219] failed: Connection timed out (Connection timed out) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 2 mins 20.743 secs The command "./gradlew --refresh-dependencies" failed and exited with 1 during . Your build has been stopped.
  15. You might want to contact TheGreyGhost. He does a fair bit with GL. Otherwise, you need to debug the old fashioned way. You are already right to be suspicious of the translate to zero method. So maybe print out the values and get a sense of what is happening. I expect it is something wrong with the math that will become obvious. For example one thing may be that by the time the render happens the current position and the last tick position may be equal to each other (since at some point in the tick the last tick position must copy the current position and the current position will get updated later). That's my guess.
  16. If you're coming from a professional coding environment, yes both Minecraft code itself and Forge's API are pretty "crazy". This is because Minecraft wasn't originally developed by professional programmers and furthermore was developed incrementally so there is a lot of inconsistency and a lot of stuff that would be frowned upon by software or engineering organizations. For example, the scope of fields and methods is really inconsistent with no proper encapsulation -- so you can reach into the code and change key values without any validation or synchronization. There are also often two methods which might do the same things. There is also abandoned code, code which does the same thing in multiple places (especially since without encapsulation the data validation is sprinkled throughout the code) and such. Forge is done by good quality programmers, but it has been an incremental effort with lots of different contributors. It is also limited in that it tries to minimize the patching of vanilla Minecraft. Because it is incremental, every now and then the API gets entirely overhauled (for example the move to JSON format to control a number of features, the new registry event system, and so forth). Because there are lots of different contributors there are inconsistencies in style, for example the use of functional programming is creeping into the code but isn't consistently used throughout. And because they're trying to minimize the patching it is really constraining -- for example I'm trying to submit my first contribution related to custom fluids acting more like water but because Material.WATER is hard-coded throughout the vanilla code it is somewhat dubious to try to take this on as it creates a lot of patches. I do find it wearing that the APIs change constantly -- keeping old mods up to date is a full time job and the modding community is getting fractured (you'll see on Minecraft Forum that majority of modders have stayed with 1.7.10 or 1.8.9). However, it is also the interesting part of the modding hobby and frankly has made me a much better coder by trying to keep up as it teaches a lot about the benefits of different approaches. Sorry for the long essay, but I understand the surprise you might feel when you hear an API is constantly changing...
  17. I discuss priority a bit in my event handling tutorial: http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html I believe if they have same priority they will fire in same order as the mods are loaded, but I haven't tested that. The idea of priority is also related to the cancellation of the events because the first mod that cancels the event I believe will prevent all later mods from getting the event. However, you can actually undo that by setting receive cancelled to true... So it really depends on what you're doing in the event. I personally tend to be "selfish" and set the priority to HIGHEST to make sure I get the event, but that is when I'm not doing anything that is likely to interfere with other mods and also not if I'm going to cancel it. If I'm going to cancel it, I'll go last but also set receive cancelled to true, since I believe most mods are intending to cancel the vanilla behavior when they cancel the event. In the end, events are definitely a place where mod conflicts can occur and if you have multiple mods and your event isn't firing like it normally does then you need to look at the priority and cancellation policies of your event and possibly work with the other mod's author to make them play nicely together.
  18. @Draco18s I know how to generate the patches. But that is generated by comparing the edits I made to Forge net.minecraft files with the Clean net.minecraft files. What I need is to track changes over multiple edits of Forge net.minecraft files. Like I want to commit changes (just for private tracking) as I work on them but only generate the patches when I'm done. I guess I can just generate patches each time, but I thought that might be a bit weird to be generating multiple patches a day. But is that the recommended way? @quadraxis Good point. I wasn't planning to share access, but I suppose technically even syncing a private repository on github could be seen as an infraction. The problem is I work across multiple machines so having a fully local repository would be very limiting for me, although I guess I can do it the old-fashioned way -- dragging files between machines through remote access.
  19. So I'm just learning to contribute to Forge. My first PRs only changed Forge code, but now I'm working on one that will require patch to Minecraft code. In my development environment I have the Forge code, the Forge Minecraft code, and the "Clean" Minecraft code. However, I noticed that my github fork only manages changes to the Forge code. If I change the Forge Minecraft code git doesn't see it as changes. I can generate patches which get managed by git, but I know that as I get feedback on the PR I'll have to manage changes and would like to track them with Git. In other words, the Forge net.minecraftforge stuff is managed but the Forge net.minecraft stuff is not. Is there a trick to getting the net.minecraft changes tracked? Should I just set up a separate github repository that just tracks that, separate from the fork?
  20. Wow, that's interesting. You should probably file an issue with forge repository on github.
  21. When using the nbt share tag, I am sometimes nervous about whether it is synced right away because I think the share nbt is mostly updated on an inventory change -- like if you pick something up, switch item in your hands and such. So for good measure, assuming the item in question is the one being held I usually have the server send the held item update packet:
  22. So? Just handle null parameter then. By them saying they obtain it using a null facing presumably means they call some methods and or look at block state files with null as a parameter. You can handle null how you want -- pass back information from whatever you consider the main side, or whatever you consider the current side, etc.
  23. What have you tried so far? Although your question isn't entirely clear, i think what you want to do can be done by creating an EntityItem that has the model you want, copying the code for something like an XP Orb that can be picked up by player, and then when it is picked up add the item to the armor slot inventory of the player.
  24. @DifferentiationWell, the thing with Minecraft is that it was developed over several years by programmers who were not really professional programmers. That is actually part of its charm. However, from programming practice point of view they do a lot of "bad habits" -- in this case there is a lack of "encapsulation". Your question highlights the problem with lack of encapsulation. Basically, the scope of fields and availability of setter and getter functions is very inconsistent. "Properly" speaking, motionX, Y and Z and other fields shouldn't be publicly accessible. Rather there should be setters and arguably probably just vector type ones. It is a lot "safer" to have setters because then you can add data validation, and also it allows control over if and when changes can be made. You'll often find weird code in the Minecraft source that is due to lack of encapsulation. In particular you'll see all sorts of data validation sprinkled around. You'll also find other things like methods and fields that have essentially been abandoned -- not used in any meaningful way. Anyway, it is just part of the charm of modding. However, I do have one warning -- when calling vanilla methods or accessing vanilla fields always check carefully how they are used in the rest of the Minecraft code. You'll frequently find that a method that you think does something doesn't really do what you think, and you'll also get ideas about what sort of data validation might be needed when you use the method.
  25. You can set up Eclipse to help you with the formatting too. The Forge style formatting is here: https://github.com/ForgeEssentials/ForgeEssentials/blob/develop/misc/eclipseformatter.xml You can take that file and in the setting for Java | Code Style | Formatter you can add it as an option.
×
×
  • Create New...

Important Information

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