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

than00ber1

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About than00ber1

  • Rank
    Tree Puncher
  1. I am trying to set my entity's EntitySize fixed. I can set the entity's size with EntityType.Builder::size(float, float) which this calls EntitySize::flexible(float, float) but the builder does not seem to have a method with EntitySize::fixed(float, float) for setting fixed entity sizes. I figured I could make my own entity builder but that seems overkill just for this. Is there a better way to set an entity's size as fixed?
  2. Alright it works now, heres what I did to make it work. On the entity's side I call open the container like this: @Override public ActionResultType processInitialInteract(PlayerEntity player, Hand hand) { if (!player.world.isRemote()) { NetworkHooks.openGui((ServerPlayerEntity) player, this, b -> b.writeInt(this.getEntityId())); } return ActionResultType.SUCCESS; } @Override public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player) { PacketBuffer buffer = new PacketBuffer(Unpooled.buffer())
  3. I am trying to pass down my cart entity instance down to my container. I've tried a few different things which worked but never with the correct constructor paramaters (with my entity class). Heres how register my container, public static final RegistryObject<ContainerType<ContainerModuleCartMiner>> MINER_CART_CONTAINER = CONTAINERS.register("miner_module_cart", () -> new ContainerType(ContainerModuleCartMiner::new)); and call it like this within my entity class: // Entity class implements `IInventory` and `INamedContainerProvider` // server
  4. I was able to solve the issue by rewriting all classes (must have gotten a class extending the wrong thing I think) but why shouldn't I use @OnlyIn on the renderers? Isn't it just client-side? Edit: Should I remove all @OnlyIn?
  5. I've been trying to register my cart entity to `RenderingRegistry`but I have been receiving errors I am having a hard time understanding. I register my entity renderer like this: public static void registerRenderers(final FMLClientSetupEvent event) { RenderingRegistry.registerEntityRenderingHandler(AllEntities.MINER_CART_ENTITY.get(), MinerModuleCartRenderer::new); } and this is my MinerModuleCartRenderer: @OnlyIn(Dist.CLIENT) public class MinerModuleCartRenderer<T extends AbstractMinecartEntity> extends EntityRenderer<T> { private static
  6. Ah I managed to do this. The problem was really dumb, I didn't register the actual item itself. For any in the future that want to know how to it, this how I did it: Create the item: public class MinerCartItem extends MinecartItem { public MinerCartItem() { super(AbstractMinecartEntity.Type.RIDEABLE, (new Item.Properties()).maxStackSize(1).group(ItemGroup.FOOD)); } } and then register it the same way you would do for other registries: public static final RegistryObject<Item> MINER_ITEM = ITEMS.register("miner_item", MinerCartItem::new);
  7. Where would I call this? NetworkHooks.getEntitySpawningPacket(this) In the constructor of the minecart class?
  8. I am trying to register a simple minecart entity but it does not seem to appear in-game. No errors are thrown either. Here is my Minecart entity class: public class MinerCartEntity extends AbstractMinecartEntity { public MinerCartEntity(EntityType<?> type, World worldIn) { super(type, worldIn); } @Override public Type getMinecartType() { return Type.CHEST; } } Here is how I register it, public class AllEntities { public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(Forge
  9. Yeah I am aware of that. Thanks for your respons, this helps a tone!
  10. I've recently fully finished my first mod for version 1.16.4 and was wondering what is the most efficient way of porting my mod to other game versions. I suppose you wouldn't create a new project repo to port from 1.16.4 to 1.16.5? Would I need to create a new repo to make the mod compatible with different but still relevant game versions like 1.12.2)? It's all a big mystery for me... PS: I am not sure if this is the correct thread to ask this question.
  11. Ok. I've tried this using ITextComponent instead: private static ITextComponent fromConfigKey(String key) { return ITextComponent.getTextComponentOrEmpty("config." + key); } This returns the key and not its translatation. I get the same result when calling getString or getUnformattedComponentText. Maybe this might help too. Heres how I try to register a config: public class Configs { ... public static ForgeConfigSpec.EnumValue<CarveType> CARVE_TYPE; public Configs(ForgeConfigSpec.Builder forgeConfigBuilder) { ConfigBuilder
  12. I've recently moved from 1.12.2 and I am having some trouble getting translations from the JSON lang files. Getting translations for items/blocks or enchantments work perfectly but not with custom keys. I am trying to create translatable components for configs: In the lang JSON file I created an entry like this, "config.<config_name>" : "Some english translation text..." and within the code I call it like this: private static String fromConfigKey(String key) { return new TranslationTextComponent("config." + key).getUnformatted
×
×
  • Create New...

Important Information

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