Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TheThorneCorporation

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by TheThorneCorporation

  1. debug.logBumping because I can't figure out how to register the Recipe/RecipeSerializer. I have this class to store the advanced crafting recipe type: public interface IThorneRecipeType<T extends IRecipe<?>> extends IRecipeType<T> { IRecipeType<IAdvancedCraftingRecipe> ADVANCED_CRAFTING = register("advanced_crafting"); static <T extends IRecipe<?>> IThorneRecipeType<T> register(final String key) { return Registry.register(Registry.RECIPE_TYPE, new ResourceLocation(key), new IThorneRecipeType<T>() { public String toString() { return key; } }); } default <C extends IInventory> Optional<T> matches(IRecipe<C> recipe, World worldIn, C inv) { return recipe.matches(inv, worldIn) ? Optional.of((T)recipe) : Optional.empty(); } } which should have registered the recipe type. (I'm doing both shapeless and shaped advanced crafting recipes.) I also have this class which should have registered the advanced recipe type serializers: public interface IThorneRecipeSerializer<T extends IRecipe<?>> extends IRecipeSerializer<T> { IRecipeSerializer<ShapelessAdvancedRecipe> ADVANCED_CRAFTING_SHAPELESS = register("advanced_crafting_shapeless", new ShapelessAdvancedRecipe.Serializer()); IRecipeSerializer<ShapedAdvancedRecipe> ADVANCED_CRAFTING_SHAPED = register("advanced_crafting_shaped", new ShapedAdvancedRecipe.Serializer()); static <S extends IRecipeSerializer<T>, T extends IRecipe<?>> S register(String key, S recipeSerializer) { return IRecipeSerializer.register(key, recipeSerializer); } } The recipe still isn't registering, though. Am I supposed to use a RegistryEvent or something?
  2. It seems that either fluids or lambdas will be my number one enemy in my modding journey. In my class BlockList, I have my DeferredRegister<Block> named BLOCKS, and I'm trying to register the Sap block with this expression: public static final RegistryObject<Block> SAP = BLOCKS.register("sap", () -> new FlowingFluidBlock(() -> (FlowingFluid)FluidList.SAP.get(), Block.Properties.create(Material.WATER).doesNotBlockMovement().noDrops())); but it's not working, saying that the "Constructor FlowingFluidBlock(() -> {}, Block.Properties) is undefined" even though I checked and there is a constructor that takes a Supplier<? extends FlowingFluid> and a Block.Properties. (SAP is a RegistryObject<Fluid> in FluidList, that returns an instance of my FluidSap.Source fluid source block class when get() is called on it.) I have tried casting SAP.get() to a Fluid. I have tried casting it to a FluidSap. I have tried using a return statement in a block instead of just putting the return value. I have trued so many things and cannot for the life of me figure out what is going on with the supplier. Could someone please help me? Edit: Right after posting this, I tried casting it to a FluidSap.Source and it worked. Well, that was embarrassing...
  3. With that hint, you have catapulted me into the depths of knowledge which I needed but did not even know was there. Thank you so much.
  4. It's me again. I got the custom crafting table to work – it appears in the world, I can open it, and it doesn't close right away, which is always a plus. However, it doesn't seem my new recipe type has registered. Here is a picture of my directory to see which classes I copied over. How am I supposed to register a new recipe type?
  5. Vinyarion doesn't actually mean "make a method called shouldRemove(EffectInstance e) that returns a boolean". the shouldRemove(object) expression is a stand in for whatever expression you want to use to determine if an object should be removed.
  6. okay... what do you mean by "updating the way of handling containers," though?
  7. Okay, so close Minecraft completely. Then open the Minecraft launcher and go to the Installations tab. Click on the "New" button and click on the "Version" bar to open the dropdown to select a version. If you scroll allllll the way down, you should find a version named "release-[mcversion]-Forge-[forgeversion]-[mcversion]", where [mcversion] is the version of Minecraft you're playing on and [forgeversion] is the version of Forge you're using. Select it in the dropdown, then give your profile a name and click, "Create." The reason for doing this is that Forge adds something that essentially functions like a new version of Minecraft, but with all the Forge capabilities. This is done to allow you to play on vanilla even if you have Forge installed (most servers are vanilla and will not accept a connection to anything running Forge, and you might also want to play regular Minecraft). So you'll need to create a new launcher profile with the Forge "version" of Minecraft to play with your mods loaded.
  8. I want to create an alternate crafting table for my mod that's identical to the vanilla one, but accesses different recipes (the recipe type might be thorneislearningmods:upgraded_crafting_[shapeless/shaped]). I looked at the vanilla code, but it's indecipherable. Could someone please explain to me how I might handle this?
  9. Cheating in Minecraft multiplayer is deplorable. Giving yourself an unfair advantage ruins the fun for everyone, and I am not doing it nor do I intend to do it. That being said, it might be useful to use certain "cheats" to debug your mod. (I'm thinking X-ray to test ore generation – while you can go into spectator and use /fill to clear out large swaths of stone, /fill has a limit on the blocks that can be removed and getting the coordinates is tedious.) Does anyone know of anything that might allow me to do that on the Forge debug Minecraft launcher?
  10. The typo is on this line: public static final SurfaceBuilderConfig CORASE_DIRT_DIRT_GRAVEL_CONFIG = new SurfaceBuilderConfig(COARSE_DIRT, DIRT, GRAVEL); COARSE_DIRT is misspelled as CORASE_DIRT.
  11. I don't know about the Minecraft code specifics, but assuming handIn is a valid Hand object and OFF_HAND is actually in the Hand enum class, then you're trying to use a Hand object as an if condition. All if conditions must be booleans. You might be able to do it like this, if Hand is an enum: if(handIn == OFF_HAND) or if Hand isn't an enum, but overrides equals(): if(handIn.equals(OFF_HAND)
  12. I want to make my FluidSap slow down player movement, but I don't know how. Invoking doesNotBlockMovement on the Block.Properties() objects in the fluid block declarations doesn't do it for me. Here's my repo, so you can see what's going on: ...wait a minute. There's nothing here! Where are all my project files? I tried pushing to the origin in Eclipse, pushing to master, all of it! Yet nothing's happening. Could someone please help me with that, too? And for now, my Sap code: public abstract class FluidSap extends FlowingFluid{ @Override public Fluid getStillFluid() { //get sap source block return FluidList.sap; } @Override public Fluid getFlowingFluid() { //get flowing sap fluid return FluidList.flowing_sap; } @Override protected boolean canSourcesMultiply() { //you cannot make an infinite sap source return false; } @Override protected void beforeReplacingBlock(IWorld worldIn, BlockPos pos, BlockState state) { // TODO I don't know how to use this yet } @Override protected int getSlopeFindDistance(IWorldReader worldIn) { // TODO it flows the same slope as water return 8; } @Override protected int getLevelDecreasePerBlock(IWorldReader worldIn) { // TODO Auto-generated method stub return 2; } @Override public Item getFilledBucket() { // TODO Auto-generated method stub return ItemList.sap_bucket; } @Override protected boolean func_215665_a(IFluidState state, IBlockReader world, BlockPos pos, Fluid fluid, Direction direction) { // TODO Auto-generated method stub return direction == Direction.DOWN && !fluid.isIn(FluidList.Tags.SAP); } @Override public int getTickRate(IWorldReader p_205569_1_) { // TODO Auto-generated method stub return 20; } @Override protected float getExplosionResistance() { // TODO Auto-generated method stub return 100.0f; } @Override protected BlockState getBlockState(IFluidState state) { // TODO Auto-generated method stub return BlockList.sap.getDefaultState().with(FlowingFluidBlock.LEVEL, Integer.valueOf(getLevelFromState(state))); } @Override public boolean isEquivalentTo(Fluid fluidIn) { return fluidIn == FluidList.sap || fluidIn == FluidList.flowing_sap; } @Override protected FluidAttributes createAttributes() { return FluidAttributes .builder(RegistryEvents.location("blocks/sap_still"), RegistryEvents.location("blocks/sap_flow")) .translationKey("block.thorneislearningmods.sap") .build(this); } public static class Source extends FluidSap { @Override public boolean isSource(IFluidState state) { // TODO Auto-generated method stub return true; } @Override public int getLevel(IFluidState state) { // TODO Auto-generated method stub return 8; } } public static class Flowing extends FluidSap { @Override protected void fillStateContainer(Builder<Fluid, IFluidState> builder) { super.fillStateContainer(builder); builder.add(LEVEL_1_8); } @Override public boolean isSource(IFluidState state) { return false; } @Override public int getLevel(IFluidState state) { // TODO Auto-generated method stub return state.get(FluidSap.LEVEL_1_8); } } } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll ( BlockList.mod_gem_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(3)).setRegistryName(location("mod_gem_block")), BlockList.sap = new FlowingFluidBlock(() -> FluidList.sap, Block.Properties.create(Material.WATER).doesNotBlockMovement().noDrops()).setRegistryName(location("sap")) ); } @SubscribeEvent public static void registerFluids(final RegistryEvent.Register<Fluid> event) { event.getRegistry().registerAll ( FluidList.sap = (Source) new FluidSap.Source().setRegistryName(location("sap")), FluidList.flowing_sap = (Flowing) new FluidSap.Flowing().setRegistryName(location("flowing_sap")) ); }
  13. Okay, so I changed my textures for my fluid and made a Git repo for my project... and can no longer start runClient. The red bar fills up, shows me a pause screen over the dirt background with 0000000000 on every button, and then the bar starts loading again. Forever, and ever, and ever. Here's a log: https://github.com/TheThorneCorporation/ThorneCraft/blob/master/2020-04-24-1.log
  14. ...I don't know how to set up a git repo. Could you please tell me?
  15. Okay, here's the log: https://github.com/TheThorneCorporation/ThorneCraft/blob/master/2020-04-22-4.log
  16. How do you initialize a Git repo in the build.gradle-holding file?
  17. I finished implementing my Sap in a way that's functional, but the fluid is opaque, which I don't want. How do I not make it opaque? My registry line for sap block: BlockList.sap = new FlowingFluidBlock(() -> FluidList.sap, Block.Properties.create(Material.WATER).doesNotBlockMovement().noDrops()).setRegistryName(location("sap")) and the fluid: FluidList.sap = (Source) new FluidSap.Source().setRegistryName(location("sap")), FluidList.flowing_sap = (Flowing) new FluidSap.Flowing().setRegistryName(location("flowing_sap")) (On another note, how do I create a Git repo from an Eclipse project?)
  18. Hey all, So, I have added shapeless crafting recipes for a Mod Gem Block as well as recipes for a set of trusty Mod Gem tools. Problem is, none of the shaped crafting recipes are loading in Minecraft when I run it, only the shapeless one. I can't see the shaped recipes in the recipe book, nor can they be crafted. Any idea why this is? My recipes are all .json files, located in src/main/resources/data.thorneislearningmods.recipes.
  19. ...does anyone know of any good programs for creating textures for Minecraft mods? I tried using GIMP, but their brush tools are just too unintuitive for me to work with. At the extremely small (16 pixel by 16 pixel) scales item textures operate on, any amount of blurriness and unpredictability is too much. Sketchbook by Autodesk doesn't work, either, because when I try to zoom in, it blurs the pixels of the asset I'm working on, because it doesn't recognize the context of a game asset. I need something that allows me to pick a color and, when I click on a pixel, it becomes that color. No fancy mixing, no partial transformations, no alpha channel shenanigans (well, an option for alpha channel shenanigans, but not by default). Just pure control. And if anyone knows of an automatic generator for model JSON files, that'd also be nice.
  20. So, I was following Mr. Pineapple's Fluids tutorial, and he said to create a new method in my FluidSap.Flowing class: fillStateContainer(Builder<Fluid, IFluidState> builder). Problem is, I don't know which Builder class to import, and Eclipse is giving me a lot of options for its Quick Fix. For context, here's an image of the Quick Fix menu after I right-click on the Builder error: Help would be appreciated in picking out the right one.
  21. Alright, found the problem. I didn't realize I had to import java.util.function.Supplier. ...it's still saying that the constructors for BucketItem(lambda expression here, Item.Properties) and FlowingFluidBlock(() -> {}, Block.Properties) are undefined. It looks like both the constructors take suppliers. Wait, no, now it's working. I don't know why. Maybe it's because I imported the relevant classes? Oh well, at least I learned about lambdas. Thank you!
  22. ItemList.sap_bucket = new BucketItem(() -> FluidList.sap, new Item.Properties().group(ItemGroup.MISC).maxStackSize(1)).setRegistryName("sap_bucket") and the block: BlockList.sap = new FlowingFluidBlock(() -> FluidList.sap, Block.Properties.create(Material.WATER).doesNotBlockMovement().noDrops()).setRegistryName(location("sap")) Also, should I be using Java 12 or 8?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.