Jump to content

DX12

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by DX12

  1. cheers for that info, much appreciated.
  2. hmm, thats unusual try setting it back as it seems to only accept 32M. im stumped for what could be wrong.
  3. try running as a gradle task directly as I get similar problems on intellij IDEA it even happens with run client
  4. -XX:G1HeapRegionSize= this may be the issue however im not sure. try increasing to a higher number but take note of the old one just in case
  5. how did you run this, did you use build runs task for gradle then run as a java application or directly from gradle
  6. Could you please do the following. Provide Your Machines RAM size total in GB open your launcher and goto installations, click edit then click on the dropdown that says "more options" you will see a line that says JVM arguments copy that line and paste it. It seems as if there may not be enough memory for it to run but im not 100% sure
  7. I have got the renderer and model for my entity but I noticed the EntityRenderers.register method is asking for a EntityRendererProvider. I have no experience with this and just need to know how to do it. the model is another arrow like item for something I'm working on the model was created by blockbench and everything has imported and the renderer class is also present with no errors. I just need to know how to add the Renderer into the game. If you need more info then I'm happy to provide it
  8. Nevermind I Used The Topic I Created For The 1.17.1 code and it works on 1.16.5 Topic I Used
  9. @diesieben07Thank you For this, one last question. do i need to register the ICondition and serializer if so what class do i need to use to register the condition and is it under a event that i need to call it at
  10. Is There Any documentation about that in the src files or any example I can use as Im pretty new to these topics. Thank you for the validation about dynamic registry
  11. As far as im aware you cannot disable or remove blocks from the registry if the config says false as the config loading is done after the blocks are registered. Please do correct me if im wrong. If you need more information then I'm happy to explain further
  12. My bad about the log spam, I was thinking about an older version however I didn't disable the block in registry but once the feature is disabled the blocks can no longer be placed and to prevent accidental crafting of a non usable block I need a conditional recipe to use that will disable if the config value says false
  13. a better explanation is like this some players don't want the decorative features to the mod so they can disable the feature in the toml however I need the recipe to disable aswell to avoid major log spam
  14. It is for a modular system I am creating within the mod itself
  15. Hi All Im Looking for any references for a conditional recipe that relies on a config value to either allow a recipe to be used or not. basically what I need is if config value = false then recipe doesn't work but if config value = true then recipe works. I have tried searching for an answer but I cannot find an answer. any links or basic code is much appreciated.
  16. package com.SkyWarsFun2019.moreblock.init; import java.util.function.Supplier; import com.SkyWarsFun2019.moreblock.RandomFhings; import com.SkyWarsFun2019.moreblock.blockentity.StorageBlockEntity; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModBlockEntity { public static DeferredRegister<BlockEntityType<?>> BLOCK_ENTITYS = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, RandomFhings.MOD_ID); public static RegistryObject<BlockEntityType<StorageBlockEntity>> CHEST = register("storage", StorageBlockEntity::new, () -> new Block[] {}); public static void register(IEventBus bus) { BLOCK_ENTITYS.register(bus); } private static <T extends BlockEntity> RegistryObject<BlockEntityType<T>> register(String name, BlockEntityType.BlockEntitySupplier<T> supplier, Supplier<Block[]> validBlocksSupplier) { return BLOCK_ENTITYS.register(name, () -> BlockEntityType.Builder.of(supplier, validBlocksSupplier.get()).build(null)); } } This is my registry class so far however the error reported is as follows. The type StorageBlockEntity does not define StorageBlockEntity(BlockPos, BlocState) that is applicable here package com.SkyWarsFun2019.moreblock.blockentity; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ChestMenu; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; public class StorageBlockEntity extends StorageBlockEntityBase { public StorageBlockEntity(BlockEntityType<?> pType, BlockPos pWorldPosition, BlockState pBlockState) { super(pType, pWorldPosition, pBlockState); } @Override public int getContainerSize() { return 27; } @Override protected Component getDefaultName() { return new TranslatableComponent("container.mbs.storage"); } @Override protected AbstractContainerMenu createMenu(int pContainerId, Inventory pInventory) { return new ChestMenu(MenuType.GENERIC_9x3, pContainerId, pInventory, pInventory, pContainerId); } } That is the BlockEntity Class that im trying to register however its super class is below package com.SkyWarsFun2019.moreblock.blockentity; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.ContainerHelper; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ChestMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; import net.minecraft.world.level.block.state.BlockState; public abstract class StorageBlockEntityBase extends RandomizableContainerBlockEntity { protected NonNullList<ItemStack> items; public StorageBlockEntityBase(BlockEntityType<?> pType, BlockPos pWorldPosition, BlockState pBlockState) { super(pType, pWorldPosition, pBlockState); this.items = NonNullList.withSize(getContainerSize(), ItemStack.EMPTY); } public boolean isMatchingContainerMenu(AbstractContainerMenu menu) { return menu instanceof ChestMenu chestMenu && chestMenu.getContainer() == this; } @Override public abstract int getContainerSize(); @Override protected NonNullList<ItemStack> getItems() { return items; } @Override protected void setItems(NonNullList<ItemStack> pItemStacks) { this.items = pItemStacks; } @Override protected abstract Component getDefaultName(); @Override protected abstract AbstractContainerMenu createMenu(int pContainerId, Inventory pInventory); @Override public boolean canPlaceItem(int pIndex, ItemStack pStack) { return true; } public boolean isFull() { for(ItemStack stack : this.items) { if(stack.isEmpty()) { return false; } } return true; } protected boolean addItem(ItemStack stack) { for(int i = 0; i < this.getContainerSize(); i++) { if(this.getItem(i).isEmpty()) { this.setItem(i, stack); return true; } } return false; } //NBT @Override public CompoundTag save(CompoundTag pCompound) { super.save(pCompound); if(!this.trySaveLootTable(pCompound)) { ContainerHelper.saveAllItems(pCompound, this.items); } return pCompound; } @Override public void load(CompoundTag pTag) { super.load(pTag); this.items = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY); if(!this.tryLoadLootTable(pTag)) { ContainerHelper.loadAllItems(pTag, this.items); } } } Any help is greatly appreciated.
  17. Yes it does work when the condition is removed
  18. I have tried this to no avail even when the test returns true the recipe is still absent
  19. Apologies for the late response, My computer had malfunctioned. To answer your question yes I do get the false and true when test is ran. however the issue im having is regardless of the value the recipe doesnt register. Also I have created A new topic to discuss this further. Here is the topic Topic
  20. I am trying to add a custom condition that checks whether item exists in registry. an easy example is holder items that provide no functionality. my exact needs are I am going to be making my mod a modular installation through the use of the config file. players can enable/disable parts of the mod. what I need help with is how to go about creating the class and how to register it.
  21. Here is the specific info you requested. I only included these lines
  22. would there be any reason why that code is not working
  23. Project ran successfully, thanks for the help diesieben07
×
×
  • Create New...

Important Information

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