Jump to content

yolp900

Forge Modder
  • Posts

    52
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Its Just a Modder!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

yolp900's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. I have a few questions about the crafting system, advancement system and tag system: 1. The crafting system: I'm using ShapedRecipeBuilder and ShapelessRecipeBuilder. Say I want to have two different crafting recipes for the same item - How would one do so? Is there an example in vanilla which I missed? 2. About the advancement system: I'm using .addCriterion with InventoryChangeTrigger.Instance.forItems to add a list of items which are needed for the craft. However this only allows a list of items. Is there a way to use tags? i.e. whenever the player has items from the relevant tags - the crafting recipe will be exposed (as opposed to specific items). 3. The new tag system: Is there a convention about adding tags - Which tags are common (other than the given tags in forge), how tags are supposed to be added (I'm extending BlockTagsProvider and ItemTagsProvider from vanilla, is there a way to do so from Forge which I haven't found?). For example, I expected there would be a tag for paper. If I were to add a paper equivalent and wanted recipes to use it too, what should I do? I think theses are general questions which don't need code samples, but just in case here is an example of how I register a recipe: ShapedRecipeBuilder.shapedRecipe(ModItems.SPELL_PARCHMENT) .patternLine(" B ") .patternLine("PPP") .patternLine(" B ") .key('B', ModItemTagsProvider.BINDING_REAGENT) .key('P', Items.PAPER) .setGroup(Spellies.MOD_ID + "." + SpellParchment.REGISTRY_NAME) .addCriterion(SpellParchment.REGISTRY_NAME, InventoryChangeTrigger.Instance.forItems(ModItems.LIGHT_BINDING_REAGENT, Items.PAPER, ModItems.DARK_BINDING_REAGENT)) .build(consumer);
  2. That was it! fixed both of my problems! thank you very much!
  3. I thought that my self. added a logger.info("Called") line and it's not called on the client when I enter the world but only when I hit the block (It is called by the server, but the boolean isn't saved anywhere and it doesn't update until I left click the block). I really don't know what's going on. This isn't the first tile entity I've made but it's the most odd...
  4. The tile entity's constructor isn't called until I hit the block. How can I update the tile without needing to hit the block? The boolean "inverted" isn't saved as well, and I don't know why that is either.
  5. okay, but the problem I have is not that the data isn't changing, but it is that the method "update" isn't being called until one hits the block and causes it to update on the client or something like that. My logger isn't called until I hit the block, and I don't understand why. Unless it's the same thing and I don't understand the connection, I don't think calling this would change anything.
  6. I have tried putting these methods in the tile entitie's constructor, but there was no difference. Every time I enter a world which have one of my tile entities, I need to update it manually by hitting it so it'll start to work. Anybody knows of a solution to this problem or maybe has a different update method than what I use which works?
  7. Do I have to call these methods whenever I call a new TileEntity with data? I mean, The tile entity works great but whenever I re-enter the world it needs to be hit to function. The only thing I can think which would solve this is to somehow update the tile entity on the constructor, which sounds horrible preformance-wise... Is there something else I can do?
  8. I updated to the latest Forge and this seems to be fixed. I'm not sure why, didn't see anything in the changelogs but that's good! However, a new problem has appeared now, the tile entity starts updating (the update method is only called) after the player hits and updates the block (not updates as in redstone update or block update, but updating the visuals, starting to break the block by left clicking on it). I thought the methods in ModTileEntity: would prevent this from happenning, nut apparently I don't understand the way this "update()" method is called.
  9. This is my entire TileEntityLevitator: This is ModTileEntity (no real need for it but I find it useful not having to copy paste this code over and over) This is my tile entity registry which is being called from the server-side proxy: This is the block which provides the tile entity. I don't think this is related, but it might help: Anything else I can post which might help this situation?
  10. I checked if it's running on the server by adding this line to the beginning of the method: Charming.logger.info("Is this method called by the server? " + !world.isRemote); And this is the output I got is the following: [19:24:23] [Client thread/INFO]: Is this method called by the server? false Repeated every tick. No Server thread calling... Am I doing something wrong...?
  11. I changed the code in the method "update". However it is only called on the client side. Is there any way to tell the server to move an entity from the client side? (I know about packets, just don't know how to pass an entity from the client to the server, so it would know which entity to move). The new code:
  12. Never mind. I didn't found out that this method is only called on the client. I'll use packets for changing the motion on the server. I just need to figure out how to read and write an entity with a ByteBuf or how to get an entity from it's NBT...
  13. I am trying to make a levitator for entities (entities, itementities and players). I created a ticking tile entity which checks the entities above it and adds to their motionY value. Also, if a player sneaks while above the levitator he should float down (without fall damage) and land on the levitator. Here I have two problems: 1. The player always takes fall damage, even after I callentity.fallDistance = 0;. Is there any way to remove fall damage which isn't an event (since I already have a ticking tile entity, I'd like to use it for this purpose as well). 2. Items which go on the levitator and have horisontal velocity kind of "rubber band" when they are supposed to go off the levitator. Whenever the item leaves the AxisAllignedBoundingBox of the checking of the levitator, it goes back to it's position and doesn't fall off. Since I'm working on a server (if (world.isRemote()) return; at the beginning), I don't understand why this is happening. I hope someone knows how to figure it out... my tile entity's code, a little bit oddly copied but I hope it's understandable: @Override public void update() { if (world == null || world.isRemote) return; List<Entity> entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(getPos().getX(), getPos().getY() + 1, getPos().getZ(), getPos().getX() + 1, getPos().getY() + 1 + ModConfig.LEVITATOR_RANGE.getValue(), getPos().getZ() + 1)); if (entities.size() > 0) { for (Entity entity : entities) { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; player.fallDistance = 0; if (player.isSneaking()) { if (player.motionY > 0) { player.motionY -= 0.1; } else { if (player.motionY < -0.35) { player.motionY = -0.35; } } } else { if (!player.capabilities.isCreativeMode) { if (player.motionY < 0.35) { player.motionY += 0.1; } entity.fallDistance = 0; } } } else if (entity.canBePushed()) { if (entity.motionY < 0.35) { entity.motionY += 0.1; } } else if (entity instanceof EntityItem) { if (entity.motionY < 0.35) { entity.motionY += 0.1; } } } } }
  14. Wow I feel stupid for not seeing that. Well, not it works! Thank you very much!!
×
×
  • Create New...

Important Information

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