Jump to content

Kaneka

Members
  • Posts

    110
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

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

Kaneka's Achievements

Creeper Killer

Creeper Killer (4/8)

2

Reputation

  1. Hello everybody, for my mod i need to store multiple "knowledges" to the player. These knowledges are only floats. I implemented one knowledge as a capability with interface IKnowledge , implementation KnowledgeEnder, IStorage KnowledgeStorage, ICapabilitySerializable<NBTBase> KnowledgeEnderProvider and capabilityhandler. It works fine. Now I need to know, how to add more knowledges right. I am not sure how to do it propably. Just create the 6 classes mentioned above for each knowledge? Or just some of them? Or do it completly different with only one capability? These knowledges will be used together sometimes and sometimes seperated from each other. Thanks for every answer, Kaneka
  2. I was thinking of using capabilities for the levels and experience, but are they good for making the skills?
  3. Hello everybody, I am planning to make a mod that has a skill system as a main feature and i am not sure how to add this properly. I don´t want to mess around and just make it work, but not perfekt, it should be well done and not using forge features incorrectly. There will be a new kind of level and exp for the player additional with skillpoints and a skilltree. Are there any tips, hints, words for me or tutorials you would recommend? Thanks for every answer, Kaneka
  4. or rewrite the BlockCrops class, than I definatly can prevent this. Thanks for all the answers!
  5. my problem is that my mod add a doubling ore way by creating ore plants, these plants dont drop any seed, because then you have endless ingots and thats not what i want to. The right click mods(simple harvest, gentle harvest and so on) bypassed this and direktly replant them without checking if there is a seed or not. I have contacted some right click mod authors and they add the seedcheck. But these simple harvest mods are "easy" and because of that so many authors copy that idea and try to make their own. Now there are so much right click mod I can´t contact every author.... So dependency wont work because I cant take any mod in my code
  6. I am talking about a block. here is a example of the mods interactiong with my mod, how do I prevent them doing this? Source: https://github.com/sblectric/OpenHarvest/blob/master/src/main/java/sblectric/openharvest/events/HarvestEvents.java public class HarvestEvents { /** Harvest crops on this event */ @SubscribeEvent public void onHarvestCrops(PlayerInteractEvent.RightClickBlock event) { World world = event.getWorld(); if(world.isRemote) return; // do nothing on client thread BlockPos pos = event.getPos(); IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); EntityPlayerMP ply = (EntityPlayerMP)event.getEntityPlayer(); // make sure the off-hand is active and right-clicking a crop block if(event.getHand() == EnumHand.OFF_HAND && block instanceof BlockCrops) { // make sure the block isn't blacklisted ResourceLocation name = block.getRegistryName(); String modid = name.getResourceDomain(); if(!HarvestConfig.modBlacklist.contains(modid) && !HarvestConfig.blockBlacklist.contains(name.toString())) { // get the age type PropertyInteger age = null; int maxAge = -1; for(IProperty prop : state.getPropertyNames()) { if(prop instanceof PropertyInteger && prop.getName().equals("age")) { age = (PropertyInteger)prop; maxAge = HarvestUtils.max(age.getAllowedValues()); break; } } // make sure the age property is valid if(age != null && maxAge > -1) { if(state.getValue(age) == maxAge) { for(ItemStack s : block.getDrops(world, pos, state, 0)) { ply.inventory.addItemStackToInventory(s); } world.setBlockState(pos, block.getDefaultState()); } } } } } }
  7. Hi everyone, is there any way to prevent other mods from interacting with some of my blocks? In my situation i need to prevent the right clicking mods because they cause a abuse of a modfeature. I suscribed at already at the event to cancel it, with highest priority, but the right clicking mod do this too...And then my suscribed event only works when my event is fired befor the other mods. Is there any better way doing this? thanks for every answer, Kaneka
  8. Now I get it and it works fine, thanks a lot!
  9. its my own block, it is a TESR and it drow over all type of blocks
  10. ok, just some unnecessary math, but this would fix my rendering problem
  11. Because I render more than 1 Block and I need to set their position referenced to the TE
  12. public class MultiAssemblerTESR extends TileEntitySpecialRenderer<TileEntityMultiAssembler> { @Override public void renderTileEntityAt(TileEntityMultiAssembler te, double x, double y, double z, float partialTicks, int destroyStage) { int teposX = te.getPos().getX(); int teposY = te.getPos().getY(); int teposZ = te.getPos().getZ(); Map list = te.getBlocksWithMarkersList(); Entity entity = this.rendererDispatcher.entity; double distance = te.getDistanceSq(entity.posX, entity.posY, entity.posZ); if (distance < 100.0 && !list.isEmpty()) { Iterator iterator = list.entrySet().iterator(); Entry entry; do { entry = (Entry)iterator.next(); BlockPos actualpos = (BlockPos) entry.getKey(); drawCubeWithCrossesAtPos(x, y, z, actualpos.getX() - teposX, actualpos.getY() - teposY, actualpos.getZ() - teposZ); } while (iterator.hasNext()); } } public static void drawCubeWithCrossesAtPos(double x, double y, double z, int addx, int addy, int addz) { GL11.glPushMatrix(); GlStateManager.color(1F, 0F, 0F); GlStateManager.glLineWidth(10F); GL11.glTranslated(x + addx, y + addy, z + addz); Tessellator tessellator = Tessellator.getInstance(); VertexBuffer worldRenderer = tessellator.getBuffer(); int rendertype = GL11.GL_LINE_STRIP; //CrossNorth worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(0, 0, -0.001).endVertex(); worldRenderer.pos(1, 1, -0.001).endVertex(); worldRenderer.pos(1, 0, -0.001).endVertex(); worldRenderer.pos(0, 1, -0.001).endVertex(); tessellator.draw(); //CrossWest worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(-0.001, 0, 1).endVertex(); worldRenderer.pos(-0.001, 1, 0).endVertex(); worldRenderer.pos(-0.001, 0, 0).endVertex(); worldRenderer.pos(-0.001, 1, 1).endVertex(); tessellator.draw(); //CrossSouth worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1, 0, 1.001).endVertex(); worldRenderer.pos(0, 1, 1.001).endVertex(); worldRenderer.pos(0, 0, 1.001).endVertex(); worldRenderer.pos(1, 1, 1.001).endVertex(); tessellator.draw(); //CrossEast worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1.001, 0, 0).endVertex(); worldRenderer.pos(1.001, 1, 1).endVertex(); worldRenderer.pos(1.001, 0, 1).endVertex(); worldRenderer.pos(1.001, 1, 0).endVertex(); tessellator.draw(); //CrossUp worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1, 1.001, 1).endVertex(); worldRenderer.pos(0, 1.001, 0).endVertex(); worldRenderer.pos(0, 1.001, 1).endVertex(); worldRenderer.pos(1, 1.001, 0).endVertex(); tessellator.draw(); //CrossDown worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1, -0.001, 1).endVertex(); worldRenderer.pos(0, -0.001, 0).endVertex(); worldRenderer.pos(0, -0.001, 1).endVertex(); worldRenderer.pos(1, -0.001, 0).endVertex(); tessellator.draw(); //RestUp worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1, 1.001, 1).endVertex(); worldRenderer.pos(1, 1.001, 0).endVertex(); worldRenderer.pos(0, 1.001, 0).endVertex(); worldRenderer.pos(0, 1.001, 1).endVertex(); worldRenderer.pos(1, 1.001, 1).endVertex(); tessellator.draw(); //RestDown worldRenderer.begin(rendertype, DefaultVertexFormats.POSITION); worldRenderer.pos(1, -0.001, 1).endVertex(); worldRenderer.pos(1, -0.001, 0).endVertex(); worldRenderer.pos(0, -0.001, 0).endVertex(); worldRenderer.pos(0, -0.001, 1).endVertex(); worldRenderer.pos(1, -0.001, 1).endVertex(); tessellator.draw(); GL11.glPopMatrix(); } }
  13. Hopefully the last Question in this Topic: Actually I get almost everything running, just the lines act strange depending on the direktion the player looking. Thats not what I want This is what I want Does anybody know how to fix this?
×
×
  • Create New...

Important Information

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