Leaderboard
Popular Content
Showing content with the highest reputation on 07/18/17 in all areas
-
Probably because ModelLoader itself (while in a client package) isn't marked SideOnly, but its parent class is. This means the JVM can find ModelLoader and the server is fine. But! There's no guarantee that that won't change suddenly and unexpectedly in the future. You're safest assuming that client stuff only happens on the client than saying "works for me." Because at some point, it suddenly won't, and you won't know why.2 points
-
Minecraft 1.12: The newest version of Minecraft has been released. Forge has been updated to support this new version. However due to the way Mojang implemented the Recipe changes there are a lot of under the hood changes that we need to do. Most notably re-writing on of the largest/most intricate systems of Forge, The Registry system. This will take some time, so do not expect a recommended release quickly. However if you are a modder you can start using the current versions to build against. Some API's may change in the early days of Forge so be sure to be ready for that. I'm sorry, I usually try my best to maintain binary compatibility, but it's just what will need to happen. For users, you can use the current builds. But just be warned that things are actively being developed and we ask to please responsibly report issues on the forum. Once I finish the rewrite and get a stable recommended build of Forge out I will make a more detailed post listing all the major changes like I always do. New Policy on Coremods: Sadly core modding is still a thing. As always we request that you guys attempt to work with us to get changes into Forge instead of core modding it yourself. However, if you MUST we have decided to put forth to the community a few 'Best Practices' for core modding. The intention is that large communities such as FTB, Technic, and Curse work with us to promote these best practices. 1) Coremod must be the coremod only, and no extra library/features/apis/etc. There are far too many coremods in the community that package tons of classes that have nothing to do with the modifications they make to the game together so that people will be forced to use their coremod just because they want a utility. This is bad. So Coremods themselves should be limited to JUST the IFMLLoadingPlugin, and IClassTransformers, and as few utility methods needed to make those hooks run. 2) Coremod binaries must be signed. This is a very basic thing that just verifies the person/organization we think made the coremods actually did. It also verifies that the file that was downloaded has not been modified in any way. As it sits there will NOT be any central authority on the keys used to sign things. So Self-signing will be allowed as long as you provide the community your signature. Starting in 1.13, with the loading system rewrite, users will be prompted to accept signatures of coremods. It is our intention to work with people like FTB, Curse, and others to make these signatures easy to use and manage. For example a user would say they trust FTB, and wouldn't be prompted for every coremod that exists in a FTB modpack. For the technical side you can read more about Jar Signing here: https://docs.oracle.com/javase/tutorial/deployment/jar/signindex.html 3) Coremods should be visible source. This will be a controversial standard, but my thoughts on it is that if you're screwing with someone else's code (which is the only reason to ever write a coremod), then you should be willing to show what you are doing. It is stressed that this is VISIBLE SOURCE only. It is not a requirement that you allow others to use your code, or modify and distribute it. It's simply that we can see it. The signatures and visible source are NOT designed to be security measures. As there is nothing preventing malicious code from being signed and a user accepting it. This is just the risk you run with Minecraft modding as you're running compiled code from random people on the internet. This is however designed to make the community more open and try and stem the number of coremods out there that have no reason to be coremods. Major Policy change: I am happy to officially announce a new member of the Forge team. Everyone welcome Mezz. His official responsibilities are to be the Pull Request, and Issues manager. Basically, he's the guy you yell at if your PR/Issue is rotting on github. He's the guy who is tasked with reminding me that they exists. He will be the one responsible for filtering all the PRs/Issues before they get to me. So I don't have to deal with telling you guys to follow the standards like making a test mod, posting logs, etc.. In addition, he is also the one who decides if old versions will have PRs accepted. Yes this means there will be a limited development system for older versions. How far back that means is ENTIRELY up to Mezz. However the rules are that ANY pr adding features for a old version MUST be applied and accepted for the current version FIRST. Save for features that would have no place in the new version. Example being adding a new achievements hook when the new version removed achievements. It will still be our official stance on this forum to only provide support for the Current version, and the previous version. However, if the community wishes to have a few dedicated people step forward and become our Legacy support team them I am willing to work with them and see what we can set up. The main reason we do not provide support for old versions is simply we do not have the manpower. So start helping out! Response From Sponge:1 point
-
1 point
-
1 point
-
user action -> entity on server gets awake -> send packet -> packet handler sets the same value on the client entity -> renderer reads the data in the entity when rendering the model1 point
-
1 point
-
It seems that you are using an outdated way of registering items and their models. Try using registry events like this: @Mod.EventBusSubscriber(modid = %modid%) public class RegistryEventHandler { //This Registers the items to the games registry @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())); } } //This is the model registerer @SideOnly(Side.CLIENT) @SubscribeEvent public staic void registerModels(MOdelRegistryEvent event) { for(Item item: ModItems.ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0 , new ModelResourceLocation(item.getRegistryName(), "inventory")); } } } Similar to MrBendScrolls, we use RegistryEvents, you do not need to put this into the main java file. Make sure that no file in the assets file is capitolized, forge now enforces that rule.1 point
-
I think, my version is simplier to maintain and understand. Common RegistryHandler.java Client RegistryHandler.java Those are only classes that register items and models. I personally store everything in ModItems class (HashMaps as a test) and then taking them into register methods with for loops. Feel free to change everything. UPD. I might've missed @SideOnly annotation on the client class. I was told why it's needed here. I'm not sure if forge actually excludes this class from server jar just because of side param in @EventBusSubscriber (feel like not).1 point
-
Good news your Biome is generating. Bad news you are generating to many trees. 30 possible trees per chunk is a little to much.1 point
-
That has nothing to do with it. Pretend you are the JVM. When you load a class you need to check that the class contains valid code. Ie that every referenced class with its already loaded or can be found and loaded if it is needed. The JVM cannot predict whether or not a given method will execute, so it assumes that all of them will at some point. The JVM scans through your class, finds a reference to a ModelRegistryEvent, attempts to locate this class, and fails to do so.1 point
-
1 point
-
Hello everyone! I need a help with Block textures. On starting MC I get this message: https://pastebin.com/SBS88ELq This is my block class: BlockJar.java package ivansteklow.ishelper.blocks; import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; import net.minecraft.init.PotionTypes; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionUtils; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockJar extends Block { public BlockJar() { super(Material.ROCK); setSoundType(SoundType.STONE); setHardness(1.0f); setHarvestLevel("pickaxe", 1); setUnlocalizedName("waterjar"); } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack itemstack = playerIn.getHeldItem(hand); if (itemstack.isEmpty()) { return true; } else { Item item = heldItem.getItem(); if (item == Items.BUCKET) { itemstack.shrink(1); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, new ItemStack(Items.WATER_BUCKET)); } else if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.WATER_BUCKET))) { playerIn.dropItem(new ItemStack(Items.WATER_BUCKET), false); } return true; } else if (item == Items.GLASS_BOTTLE) { ItemStack itemstack1 = PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, itemstack1); } else if (!playerIn.inventory.addItemStackToInventory(itemstack1)) { playerIn.dropItem(itemstack1, false); } else if (playerIn instanceof EntityPlayerMP) { ((EntityPlayerMP) playerIn).sendContainerToPlayer(playerIn.inventoryContainer); } return true; } return false; } } } This is my Registering blocks class: ModBlocks.java package ivansteklow.ishelper.init; import ivansteklow.isdev.BlockRegisterer; import ivansteklow.ishelper.blocks.BlockJar; import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; public class ModBlocks { public static Block blockJar; public static void init() { blockJar = new BlockJar().setRegistryName(new ResourceLocation(Refs.MOD_ID, "waterjar")); BlockRegisterer.regBlock(blockJar); } public static void initRender() { BlockRegisterer.regRender(blockJar, Refs.MOD_ID); } } BlockRegisterer.java (My API) package ivansteklow.isdev; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class BlockRegisterer { public static void regRender(Block block, String modid) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } public static void regBlock(Block block){ GameRegistry.register(block); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } } I have some files: /assets/ishelper/blockstates/waterjar.json { "variants": { "normal": { "model": "ishelper:waterjar" } } } /assets/ishelper/models/block/waterjar.json { "parent": "block/cube_all", "textures": { "all": "ishelper:blocks/waterjar" } } /assets/ishelper/models/item/waterjar.json { "parent": "block/cube_all", "textures": { "all": "ishelper:blocks/waterjar" } } What's wrong?! HELP ME PLS!1 point
-
1 point
-
Try download another installer (last stable build) of Forge === I think this is a problems in MC Forge maven repo1 point
-
1 point
-
I have a command: /ish, but if I enter /ish I get information from public void execute and this string: How to fix it? My code: package ivansteklow.ishelper.init; import ivansteklow.isdev.Notifier; import ivansteklow.ishelper.Refs; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; public class MainCmd extends CommandBase{ @Override public String getName() { return "ish"; } @Override public String getUsage(ICommandSender sender) { return "To get more info: /ish help (?)"; } public int getRequiredPermissionLevel() { return 2; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { World world = sender.getEntityWorld(); if(world.isRemote){ Notifier.error("Not processing on server side!", Refs.NAME+"/Commands"); }else{ EntityPlayerMP player = getCommandSenderAsPlayer(sender); if(!(args.length >= 1)){ player.sendMessage(new TextComponentString("[ISH] Wrong usage! Usage:")); player.sendMessage(new TextComponentString("[ISH] /ish killa (killall) - kill all mobs and drops")); player.sendMessage(new TextComponentString("[ISH] /ish heal (healme) - heal player")); player.sendMessage(new TextComponentString("[ISH] /ish oheart (oneheart) - set minimal health and hunger")); } if(args[0].equals("killa") || args[0].equals("killall")){ server.commandManager.executeCommand(server.getServer(), "/kill @e[type=!Player]"); }else if(args[0].equals("heal") || args[0].equals("healme")){ player.setHealth(player.getMaxHealth()); player.getFoodStats().setFoodLevel(20); }else if(args[0].equals("oheart") || args[0].equals("oneheart")){ player.setHealth(1.0f); player.getFoodStats().setFoodLevel(1); }else if(args[0].equals("help") || args[0].equals("?")){ player.sendMessage(new TextComponentString("[ISH] Usage:")); player.sendMessage(new TextComponentString("[ISH] /ish killa (killall) - kill all mobs and drops")); player.sendMessage(new TextComponentString("[ISH] /ish heal (healme) - heal player")); player.sendMessage(new TextComponentString("[ISH] /ish oheart (oneheart) - set minimal health and hunger")); }else if(args[0].equals("out")){ if(args[1].equals("0")){ server.commandManager.executeCommand(server, "/gamerule commandBlockOutput false"); }else if(args[1].equals("1")){ server.commandManager.executeCommand(server, "/gamerule commandBlockOutput true"); } }else{ player.sendMessage(new TextComponentString("[ISH] Wrong usage! Usage:")); player.sendMessage(new TextComponentString("[ISH] /ish killa (killall) - kill all mobs and drops")); player.sendMessage(new TextComponentString("[ISH] /ish heal (healme) - heal player")); player.sendMessage(new TextComponentString("[ISH] /ish oheart (oneheart) - set minimal health and hunger")); } } } } HELP ME PLS!1 point
-
1 point
-
event.registerServerCommand(new MainCmd()); This is log: java.lang.ArrayIndexOutOfBoundsException: 0 at ivansteklow.ishelper.init.MainCmd.execute(MainCmd.java:47) ~[MainCmd.class:?] at net.minecraft.command.CommandHandler.tryExecute(CommandHandler.java:129) [CommandHandler.class:?] at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:101) [CommandHandler.class:?] at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:946) [NetHandlerPlayServer.class:?] at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:922) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:47) [CPacketChatMessage.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:8) [CPacketChatMessage.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101] at net.minecraft.util.Util.runTask(Util.java:29) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:754) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:699) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] This log shows me this string, but I can't see any error in code: if(args[0].equals("killa") || args[0].equals("killall")){1 point
-
I want to change Event Listener of glass bottle. This EL does glass bottle turn into exp bottle. I have already write code, but it isn't works. protected ItemStack turnBottleIntoItem(ItemStack originalstack, EntityPlayer player, ItemStack stack) { originalstack.shrink(1); if (p_185061_1_.isEmpty()) { return stack; } else { if (!player.inventory.addItemStackToInventory(stack)) { player.dropItem(stack, false); } return originalstack; } } @EventHandler public void onItemRightClick(PlayerInteractEvent.RightClickItem event){ Notifier.info("Event Called", "Bottle"); if(event.getItemStack() == new ItemStack(Items.GLASS_BOTTLE)){ if(event.getEntityPlayer().experienceLevel >= 1){ event.getEntityPlayer().removeExperienceLevel(1); event.getEntityPlayer().setHealth(event.getEntityPlayer().getHealth()-0.5f); turnBottleIntoItem(event.getItemStack(), event.getEntityPlayer(), new ItemStack(Items.EXPERIENCE_BOTTLE, 4)); }else{ event.getEntityPlayer().setHealth(event.getEntityPlayer().getHealth()-0.5f); } } } Please help me!1 point
-
1 point
-
I changed code, but it doesn't work EventListener.java public class EventListener { protected ItemStack turnBottleIntoItem(ItemStack originalstack, EntityPlayer player, ItemStack stack) { originalstack.shrink(1); if (originalstack.isEmpty()) { return stack; } else { if (!player.inventory.addItemStackToInventory(stack)) { player.dropItem(stack, false); } return originalstack; } } @SubscribeEvent public void onItemRightClick(PlayerInteractEvent.RightClickItem event){ Notifier.info("Event Called", "Bottle"); if(event.getItemStack().getItem() == Items.GLASS_BOTTLE){ if(event.getEntityPlayer().experienceLevel >= 1){ event.getEntityPlayer().removeExperienceLevel(1); event.getEntityPlayer().setHealth(event.getEntityPlayer().getHealth()-0.5f); turnBottleIntoItem(event.getItemStack(), event.getEntityPlayer(), new ItemStack(Items.EXPERIENCE_BOTTLE, 4)); }else{ event.getEntityPlayer().setHealth(event.getEntityPlayer().getHealth()-0.5f); event.getEntityPlayer().sendMessage(new TextComponentString("Not enough levels! Minimum: 1").setStyle(new Style().setColor(TextFormatting.YELLOW))); } } } } ModCore.java @EventHandler public void preInit(FMLPreInitializationEvent e){ Notifier.info("Pre Initialization event started successfully", Refs.NAME); MinecraftForge.EVENT_BUS.register(new EventListener().getClass()); } What's wrong?1 point