Jump to content

Leaderboard

Popular Content

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

  1. How to be got at texturing in a Minecraft style: 1) find an existing Minecraft texture that's similar to what you want. Like the hay bale 2) extract it from the Minecraft jar file 3) open in GIMP 4) use the hue saturation brightness tool to make it a different color (brown) 5) yer an artist now, Harry
    2 points
  2. 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F Why is your pitch that complicated formula and not 1.0F for normal speed?
    2 points
  3. I'm brand new to modding and a noob programmer. I learned the old way to register blocks and items using GameRegistry.register() then I found out there is actually a new, better way to register blocks, items, and even models. The new way is to use RegistryEvents and I'm a sucker for new and better things so I tried to figure out how it works. My goal with this post is to see if anything I did can be done better and whether or not this is correct. Just because it works doesn't mean it's correct. I want to have a solid base before I build on it too much. Here is what I came up with: RegistryEventHandler.java @Mod.EventBusSubscriber public class RegistryEventHandler { @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(ModBlocks.BLOCKS); Utils.getLogger().info("Registered blocks"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS); for (Block block : ModBlocks.BLOCKS) { event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName())); } Utils.getLogger().info("Registered items"); } @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { for (Block block: ModBlocks.BLOCKS) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } for (Item item: ModItems.ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } Utils.getLogger().info("Registered models"); } } ModBlocks.java public class ModBlocks { public static final Block[] BLOCKS = { new BlockTinOre("tin_ore", Material.ROCK), new BlockTinBlock("tin_block", Material.ROCK) }; } ModItems.java public class ModItems { public static final Item[] ITEMS = { new ItemTinIngot("tin_ingot") }; } BlockTinOre.java public class BlockTinOre extends BlockBase { public BlockTinOre(String name, Material material) { super(name, material); } } BlockTinBlock.java public class BlockTinBlock extends BlockBase { public BlockTinBlock(String name, Material material) { super(name, material); } } BlockBase.java public class BlockBase extends Block { BlockBase(String name, Material material) { super(material); this.setRegistryName(Reference.MODID, name); this.setUnlocalizedName(this.getRegistryName().toString()); } } ItemTinIngot.java public class ItemTinIngot extends ItemBase { public ItemTinIngot(String name) { super(name); } } ItemBase.java public class ItemBase extends Item { ItemBase(String name) { this.setRegistryName(new ResourceLocation(Reference.MODID, name)); this.setUnlocalizedName(this.getRegistryName().toString()); } }
    1 point
  4. Thank you gys for good informaion. As for I am currently modefying WarpdriveMod to behave differently in the hyperspace dimmension. The admin on the server is also the creator of the modpack, so he has done some changes to the code that i would need to work with. The idea is that when a specific region of blocks enter a dimmension, there will be a timer that records the time spent in the dimm, wich will be translated to the coordinates that the region will be transported to in another dimm. How the cordinates change (+-x og +-z) depends on the "direction" the region of blocks/ship is facing inside the dimmension. (Watch stargate atlantis as refrence)
    1 point
  5. Do you have a pack.mcmeta file in src/main/resources with pack_format set to 3? If you don't, Forge will load your mod's resources using the LegacyV2Adapter IResourcePack wrapper. This means that your lang files will be loaded with the old mixed-case names (e.g. en_US.lang) rather than the new lower-case names (e.g. en_us.lang). If you do, your lang files should be loaded with lower-case names. Try refreshing your IDE project (i.e. click the "Refresh all Gradle projects" button in IDEA's Gradle window or re-run the eclipse Gradle task) and/or rebuilding it.
    1 point
  6. I did an override of the default methods that return an NBTBase. That seemed to handle the NBTTagCompounds just fine. Example: @Override public NBTBase writeNBT(Capability<ICapability> capability, ICapability instance, EnumFacing side) { NBTTagCompound tag = new NBTTagCompound(); <use tag.setBoolean, or tag.setDouble, etc., to write whatever data you need to the NBTTagCompound> return tag; }
    1 point
  7. That's what I have these for: https://github.com/Draco18s/ReasonableRealism/tree/master/src/main/java/com/draco18s/hardlib/api/internal Notice that they're in my API package, but inside another package called "internal." In some respects they do need to be exposed, but they shouldn't be utilized directly in most cases.
    1 point
  8. You could manually just add the class to API, or you could have the SomeClass implement an interface, then change the argument to the interface and only add the said interface into the API; this being the more typical means that APIs are done. so like [old]: You would have to have to add the Apple class to the API, public void fall(Apple a){ a.fall(); a.update();//I don't know, just making code up } public class Apple{ //what ever code } but instead, you should do this [new]: public void fall(IApple a){ a.fall(); a.update(); } public interface IApple{ void fall(); void update(); } This way you only add the simple interface into the API package, and it is up to the user to use. I would like to mention though, that you could also use and abstract class instead of an interface, if you wish to provide some bulk of data ahead of time, and leave it up to the user to implement (extend really).
    1 point
×
×
  • Create New...

Important Information

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