Jump to content

Ahndrek Li'Cyri

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by Ahndrek Li'Cyri

  1. I'm using the built in ForgeEnergy system and the issue is that it only allows power as a int. So i'm trying to make it so power is added smoothly over time rather then all at once.
  2. Hello all! So i have a bit of a odd question. I have a Power generator that works all fine, but the power being all added in at the end of the burn time is not exactly what I want to do. Let's say i want to add... 2500 power units over 1600 ticks. How would i go about doing that when the power system only accepts Integers to add? I have tried int power = 2500 / 1600; addPower(power); but obviously this won't work because it rounds the result to a Integer, only generating 1600 and not 2500 power units. Any help on this would be great, thank you!
  3. Hello there! I tried searching and looking around for some help or the answer to this, but it either doesn't seem to exist, or is too old and no longer applies, so that's why i am asking this now and here: I am trying to implement a GUI menu popup when you tap on a block. How would i go about doing this? I understand the general idea behind this (using the onBlockActivated function on a Block type, using the createMenu function on a TileEntity type, using a Container type, ect.) but am unsure how exactly I am suppose to do it, I cannot figure this out. Here is the current code I have: Any help would be appreciated, and sorry if this is asked a ton and i just missed it or something!
  4. Okay so, it works, but it doesn't seem to actually apply the TileEntity to the block? The tile Entity does exist, and I can see that in the logs, but for some reason, when I place the block, it doesn't seem to place as a tile entity. TileEntity code: package ahndreklicyri.highgentech.common.tileentities; import ahndreklicyri.highgentech.highgentech; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; public class FurnGenTin_TE extends TileEntity implements ITickableTileEntity { public int tickCount = 0; public FurnGenTin_TE() { super(ModTileEntity.FURN_GEN_TIN_TE.get()); } // Required by ITickableTileEntity @Override public void tick() { tickCount++; if(tickCount == 60){ highgentech.LOGGER.debug("Ticker working!"); tickCount = 0; } } } DeferredRegistry file code: package ahndreklicyri.highgentech.common.tileentities; import ahndreklicyri.highgentech.common.blocks.ModBlocks; import ahndreklicyri.highgentech.highgentech; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModTileEntity { public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = new DeferredRegister<TileEntityType<?>>(ForgeRegistries.TILE_ENTITIES,highgentech.MOD_ID); public static final RegistryObject<TileEntityType<FurnGenTin_TE>> FURN_GEN_TIN_TE = TILE_ENTITIES.register("tile_entity_furnace_gen_tin",()->TileEntityType.Builder.create(FurnGenTin_TE::new, ModBlocks.TIN_FURN_GEN.get()).build(null)); } Main file code: @Mod(MOD_ID) public class highgentech { // Set the MOD_ID here to use it in multiple places. public static final String MOD_ID = "highgentech"; public static IEventBus EventBus; public static final Logger LOGGER = LogManager.getLogger(); public highgentech(){ // Get the FML EventBus the mod is on for easier use. EventBus = FMLJavaModLoadingContext.get().getModEventBus(); // Setup a listener for the Setup event. EventBus.addListener(this::setup); // Register our self and all the stuff we are interested in. MinecraftForge.EVENT_BUS.register(this); ModBlocks.BLOCKS.register(EventBus); ModItems.ITEMS.register(EventBus); ModTileEntity.TILE_ENTITIES.register(EventBus); } private void setup(final FMLCommonSetupEvent event){ // Pre-init code here LOGGER.info("Hello Minecraft!"); } } Some help would be nice. I feel like it's something simple I'm just missing but i can't tell.
  5. Thank you guys so much i very much appreciate it! I was able to get it working.
  6. Hello there! So i am just starting to dabble my toes into Tile entities seeing as how I need to make some things for my mod. I have been using Deferred Registry for my registering of items and blocks like so: So i thought i could do something similar for Tile Entities. I made a new file, ModTileEntity, and before i could even finish typing the Deferred Registry line, i hit a snag. Apparently it cannot be done like this: public class ModTileEntity { public static final DeferredRegister<TileEntity> TILE_ENTITIES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, highgentech.MOD_ID); } and throws up a error about "Type not being within bounds", but doing it like this works fine: public class ModTileEntity { public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, highgentech.MOD_ID); } So that is my first question. Do I use <TileEntity> and I was just using it wrong, or do I use <TileEntityType<?>>? If it is TileEntityType, then here's my entire code so far: package ahndreklicyri.highgentech.common.tileentities; import ahndreklicyri.highgentech.highgentech; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModTileEntity { public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, highgentech.MOD_ID); // v This is the issue public static final RegistryObject<TileEntityType<?>> EXAMPLE_ENTITY = TILE_ENTITIES.register("example_entity", ()->new TileEntityType<>()); } It is asking for three arguments in the TileEntityType<>() function but i don't quite know what i am suppose to put there. It is asking for a Supplier, a Set<Block>, and a Type<?> but i am unsure as to what these are suppose to be. Any help on this would be appreciated, thank you!
  7. Ah thanks, that also fixed that issue. Can't believe i forgot to do that. Heh.
  8. That fixed it, thanks! I couldn't accurately see what each field was because InteliJ was only showing each as "p_xXXXXXX_X_" instead of the correct names. Anyways, thanks for the help!
  9. Hello there. I was trying to work on some custom tools, for starters a pickaxe, and i stumbled upon a... strange issue. Hovering over it in my inventory shows a Attack Value of 76, and a Use Speed of 4. Here's the code i'm using currently: ModToolPickaxe.java ItemStore.java Some help figuring out why it has a attack value of 76 would be nice, also how to set up the getRepairMaterial() part as well. Unrelated issue, when held in the hand, it renders as normal item (see attached screenshot). In the Model JSON, is there a "item/pickaxe" or something?
  10. Hey there, I have a real quick question. Is it possible to use the anvil as a sort of "crafting" station of sorts? For example, the player has a pickax and a iron ore, and when they put them in, it outputs say... a iron ingot. The pick and the anvil would get minor damaged by this, and the ore would be removed. Is this possible to do?
  11. ISSUE SOLVED Somewhere along the way my json file's extension was capitalized as .JSON and not .json Minecraft apparently cares VERY MUCH about the extension case. Whoops, I'm a huge idiot.
  12. OK so, it seems like Minecraft or forge just isn't seeing the json file at all, or is trying to read from a file that doesn't exist (in that case, my file is in the wrong place/mis-named?). I purposely malformed the JSON loot table file i have, and no errors were thrown at all. It's like it doesn't even exist at all. I'm now just very confused at what the issue is now.
  13. Yeah, and that's what i'm trying to work around. Blocks use the loot table system now instead of the getDrops system. And like i said, everything seems to be set up right, but still doesn't seem to work.
  14. ISSUE SOLVED Somewhere along the way my json file's extension was capitalized as .JSON and not .json Minecraft apparently cares VERY MUCH about the extension case. Whoops, I'm a huge idiot. OK so, first post. Sorry if i mess something up. Anyways, I've been trying to get my custom block to drop the item version of itself for like a good few hours now, but nothing seems to work. I've searched here a few times and it still doesn't seem to work right, even with other people's solutions. not sure if i did something horrendously wrong, or just missed something minor. Here's what i have: The block's Registry name is copper_ore. There is both the Block and the ItemBlock for it (bsm:copper_ore, block.bsm.copper_ore) and both work perfectly fine. Block class: ahndreklicyri/bsm/blocks/ModOreBlock.java ItemBlock Class: ahndreklicyri/bsm/items/ModItemBlock.java Loot Table: /resources/data/bsm/loot_tables/blocks/copper_ore.json I setup a quick print to see what the loot table was set as and it comes up as Block Block{bsm:copper_ore} has loot table bsm:blocks/copper_ore Am i just doing something minor wrong or did i mess something major up? Any help would be appreciated. Thanks.
×
×
  • Create New...

Important Information

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