X66Herobrine66X
Members-
Posts
26 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
X66Herobrine66X's Achievements
Tree Puncher (2/8)
1
Reputation
-
How to get world save folder name as string?
X66Herobrine66X replied to X66Herobrine66X's topic in Modder Support
"We don't support MCreator here. Learn Java completely first. Without doing so, you'll likely be confused on most explanations given on this forum since we assume a decent level of Java knowledge is known by modders." Not what I asked, but ok. "Why do you want this? You should not need to do anything in the world folder." Why does it matter? "Since this is a backport, do you have permission to backport this mod from the author (or at least have it from a permissible license)?" It's not a backport that's just the directory of the java file I'm writing in. I just opened whatever random project I had open to write the code in. And, once again, it's not what I asked. -
I need a very simple procedure that will return the name of the world folder in windows explorer as a string. I don't know much about coding Minecraft mods as I use MCreator but I'm learning Java in college and have a technical aptitude. I tried this but it just returned the world name. package com.angelofcreation.creativebackport; import net.minecraft.world.level.LevelAccessor; public class GetWorldName { public static String execute(LevelAccessor world) { return world.getServer().getWorldData().getLevelName(); } }
-
"Cannot invoke "net.minecraft.nbt.CompoundNBT.getDouble(String)" because "nbt" is null" Ah yes, plain English. Think I'm running low on "net.minecraft.nbt.CompoundNBT.getDouble(String)", better run to the store and get some.
-
Does this look right? It's crashing my game when I click on the tab: package net.angelofcreation.randomshit; import com.google.common.collect.Ordering; import net.minecraft.core.NonNullList; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.CreativeModeTab; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; public class CreativechangesModTabs { static Comparator<ItemStack> tabSorter; public static CreativeModeTab TAB_BUILDING_BLOCKS; public static void load() { TAB_BUILDING_BLOCKS = new CreativeModeTab("tabbuilding_blocks") { @Override public void fillItemList(NonNullList<ItemStack> list) { // Create list of itemstacks List<ItemStack> itemList = new ArrayList<ItemStack>(); // Add itemstacks to list itemList.add(new ItemStack(Items.OAK_LOG)); itemList.add(new ItemStack(Items.OAK_WOOD)); itemList.add(new ItemStack(Items.STRIPPED_OAK_LOG)); itemList.add(new ItemStack(Items.STRIPPED_OAK_WOOD)); // set list to itemList list = (NonNullList<ItemStack>) itemList; // sort list List<Item> order = Arrays.asList(Items.OAK_LOG.asItem(), Items.OAK_WOOD.asItem(), Items.STRIPPED_OAK_LOG.asItem(), Items.STRIPPED_OAK_WOOD.asItem()); tabSorter = Ordering.explicit(order).onResultOf(ItemStack::getItem); list.sort(tabSorter); // add list to super super.fillItemList(list); } @Override public ItemStack makeIcon() { return new ItemStack(Blocks.BRICKS); } }; } }
-
Thank you. This is the code that I've come up with: package net.angelofcreation.randomshit; import com.google.common.collect.Ordering; import net.minecraft.core.NonNullList; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.CreativeModeTab; import java.util.Arrays; import java.util.Comparator; import java.util.List; public class CreativechangesModTabs { static Comparator<ItemStack> tabSorter; public static CreativeModeTab TAB_BUILDING_BLOCKS; public static void load() { TAB_BUILDING_BLOCKS = new CreativeModeTab("tabbuilding_blocks") { @Override public void fillItemList(NonNullList<ItemStack> list) { List<Item> order = Arrays.asList(Items.OAK_LOG, Items.OAK_WOOD, Items.STRIPPED_OAK_LOG, Items.STRIPPED_OAK_WOOD); tabSorter = Ordering.explicit(order).onResultOf(ItemStack::getItem); super.fillItemList(list); list.sort(tabSorter); } @Override public ItemStack makeIcon() { return new ItemStack(Blocks.BRICKS); } }; } } Unfortunately, the creative tab does not have any of the 4 items I specified. Do you know why this is and how I can fix it?
-
Ok that's worked so far, but I'm trying to add specific blocks in a specific order. This is my code so far: package net.angelofcreation.randomshit.item; import com.google.common.collect.Ordering; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; import net.minecraftforge.common.Tags; import java.util.Arrays; import java.util.Comparator; import java.util.List; public class ModCreativeModeTab { static Comparator<ItemStack> tabSorter; public static final CreativeModeTab BUILDING_BLOCKS = new CreativeModeTab("building_block") { @Override public void fillItemList(NonNullList<ItemStack> list) { // Default processing super.fillItemList(list); // Manipulate the list, e.g. sort by reverse order of rarity list.sort(Comparator.comparing(ItemStack::getRarity).reversed()); } @Override public ItemStack makeIcon() { return new ItemStack(Blocks.BRICKS); } void preInit() { List<Item> order = Arrays.asList(); tabSorter = Ordering.explicit(order).onResultOf(ItemStack::getItem); } }; } The problem I'm now running into is what to put in Arrays.asList. The link I'm going off of for this section says "List<Item> order = Arrays.asList(myItemA, myItemB, Item.getItemFromBlock(myBlockA), ...);" What would 'myItemA' be? What if it's a vanilla item I want to add?
-
Trying to recreate the 1.19.3 creative changes in my mod. I know the basics of Java but I usually code with MCreator so if you could walk me through it that'd be great. I found this link in an old thread, but it looks like it's outdated. Also I don't really understand whether I would have added that code to my existing creative tab class or have it as it's own separate class. Either way I had difficulties figuring out what each thing was.
-
I removed enderio, that seemed to be causing lag. Erm, would this have anything to do with why I'm lagging? https://gyazo.com/63995e94cd7db433bd9de5940cbdcdb4 I don't know why it says I only have 118 gb, I have a 1 TB harddrive. Also, I installed java 64 bit a few days ago and it was all good. Now my apps and features says I have 64 bit installed, command prompts java -version doesn't say 32 or 64 bit, and the Java folder is in Program Files instead of Program Files (x86). The java folder used to be in the x86 folder. What version do I even have?
-
Those are the mods I had installed ages ago. I have since removed them all and added the modpack to my .minecrafts mods folder. Iirc, 1.jar was a mod that was having some rendering issues so I renamed it 1.jar to force it to load first. When is the debug.log file supposed to update? Everytime I load up minecraft? It appears the debug.log file never updated. Edit: Minecraft is now running so slow that as soon as I get in the world I can barely move my camera around. The main menu is lag free but as soon as I load up a world it slows down massively.
-
debug Heres the debug file. My processor is the AMD Ryzen 5 2400G Processor. Attached is an image of the alt + f3 window. I already had java 211 installed but when I tried switching the java version to 211 is just crashed the launcher instantly when I clicked play, a java pop up appeared. I tried adding all that crap to the additional arguments box and nothing changed.