Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/17 in all areas

  1. First of all, Blocks are singletons. You should only ever have 1 instance of each block, and not call new TestBlock() each time you want an instance. Store a single instance in a static field somewhere to reference later. That alone will fix a lot of your issues if not all. Also, Reflection for Block registering? You'd be better of with the RegistryEvents (http://mcforge.readthedocs.io/en/latest/concepts/registries/).
    2 points
  2. You're right, I missed that. Looking into the code further, it appears that using a single version rather than one or more version ranges creates a VersionRange with a single Restriction (Restriction.EVERYTHING) that matches everything and completely ignores the version you passed it. In addition to this, NetworkModHolder.DefaultNetworkChecker (the default implementation used to check if the remote mod list is compatible with the local mods) allows the client to connect to a server without the mod installed. I'm not sure of the reason behind either of these. You can work around the latter by providing your own NetworkChecker, just annotate a method with @NetworkCheckHandler. See the doc comment for the required signature.
    1 point
  3. What happens if you put an @Override annotation on it?
    1 point
  4. Launch command promt and in it write: gradlew eclipse It can repair project file
    1 point
  5. You must be following old outdated tutorials, you do not want to be using getItemModelMesher. That may not be specifically the issue, but it won't help. You should probably find a tutorial/examples that are more for 1.11.2 instead of the old ones you're using (you should be creating/registering an ItemBlock for your Block rather than an Item, I'm guessing the old outdated tutorial you're following was having you do that. Check out this thread: http://www.minecraftforge.net/forum/topic/49497-1112-is-using-registryevent-this-way-ok/#comment-249433
    1 point
  6. When you use nested classes depends on your code style. There's not really a specific area where you need to use them, they mostly behave just like normal classes. One common use is nesting the IMessageHandler in the corresponding IMessage class to keep the message and its handler together.
    1 point
  7. No, that would also be wrong. ITileEntityProvider is also out of date (look, it even still uses metadata) Override the createTileEntity() and hasTileEntity() from the Block class
    1 point
  8. Here I'll show the final code that definitly works for me: //spawn structure if (!worldIn.isRemote) { WorldServer worldserver = (WorldServer) worldIn; MinecraftServer minecraftserver = worldIn.getMinecraftServer(); TemplateManager templatemanager = worldserver.getStructureTemplateManager(); ResourceLocation loc = new ResourceLocation(Reference.MOD_ID,"t1"); Template template = templatemanager.getTemplate(minecraftserver, loc); Utils.getLogger().info("=======0======="+template); if (template != null) { worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE) .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk((ChunkPos) null) .setReplacedBlock((Block) null).setIgnoreStructureBlock(false); Utils.getLogger().info("=======1======="+loc); template.addBlocksToWorld(worldIn, pos, placementsettings); Utils.getLogger().info("========2======="+pos); } }
    1 point
  9. Super duuuuper necro post, but for anyone who finds themselves here after trying the srgExtra line, it's been changed in newer versions of gradle (2.2-SNAPSHOT I know, but maybe even earlier). Now instead of doing: minecraft { ... srgExtra "PK: ..." } You have to do: reobf { jar { extraLine "PK: ..." } } Relevant XKCD: https://xkcd.com/979/
    1 point
×
×
  • Create New...

Important Information

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