Everything posted by juanitodelavega
-
IItemHandler capability restrict slot access like ISidedInventory
Ok its working thanks.
-
IItemHandler capability restrict slot access like ISidedInventory
How do i restrict access to certain slot with the new IItemHandler capability Before you would have @Override public int[] getSlotsForFace(EnumFacing side) { return new int[]{0,1,2,3,4}; } to allow hopper or other blocks accessing only certain slots and still be able to access all of them as a player with the gui and container. Now with IItemHandler i can restrict some slot but it restrict them for player and blocks.
-
[1.10.2] TESR makes texture dark.
To render dynamic fluid level
-
[1.10.2] TESR makes texture dark.
Just found a solution : int li = t.getWorld().getCombinedLight(t.getPos(), 15728640); int i1 = li % 65536; int j1 = li / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) i1, (float) j1); With the opaque set to true so it doesnt let the light pass through
-
[1.10.2] TESR makes texture dark.
The problem is with isOpaqueCube in the block class. When you set it to true it make the things you render in theTESR dark. Its linked to ambient occlusion. Setting it to false make the TESR fine but the problem is that i want my block to be opaque for it to not let light pass through.
-
[1.10.2] TESR makes texture dark.
allready tried with GlStateManager.disableLighting() or GL11.glDisable(GL11.GL_LIGHTING), it make the quad rendered a bit less dark but still really dark.
-
[1.10.2] TESR makes texture dark.
I have the same issues do you have any new clue about the issue?
-
[1.10.12] Disable swappinp hand (F key) on item
Yeah but its not a safe state solution . I just watched in the minecraft code there is no event fired or function called maybe forge guys should add a hook.
-
[1.10.12] Disable swappinp hand (F key) on item
Is there a function or an event to handle the swapp of an item when you press f ? I have an item that you sould not be able to swapp between hand depending on nbt data.
-
[1.10] Rendering model variant Gui transformation
I have a block with this block state { "forge_marker": 1, "defaults": { "transform":{ "gui":{ "rotation": { "x":120 }, "translation": [ 0, 0.2, 0], "scale": 1.2 } }, "textures":{ "#inductor-base": "sfartifacts:blocks/inductor-base", "#inductor-staff": "sfartifacts:blocks/inductor-staff" }, "model": "sfartifacts:inductor-base.obj" }, "variants": { "normal": [{ "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } } }], "inventory": [{ "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } } }], "type_tech": { "basic": { "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } }, "textures": { "#inductor-staff": "sfartifacts:blocks/inductor-staff" } }, "advanced": { "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } }, "textures": { "#inductor-staff": "sfartifacts:blocks/inductor-staff1" } }, "basicenergized": { "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } }, "textures": { "#inductor-staff": "sfartifacts:blocks/inductor-staff2" } }, "advancedenergized": { "submodel": { "staff": { "model": "sfartifacts:inductor-staff.obj" } }, "textures": { "#inductor-staff": "sfartifacts:blocks/inductor-staff3" } } }, "all_facing": { "down": {"x":90}, "up": {"x":270}, "north": {}, "south": {"y":180}, "west": {"y":270}, "east": {"y":90} } } } The issue is the gui in inventory rendering. I try two method to register the 4 differents variants (basic , advanced, basicenergyzed, advancedenergyzed). First one : Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 0, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 1, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 2, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 3, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory")); This method register 4 item with the gui transformation right but they are all with the same textures Second one Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 0, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=basic")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 1, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=advanced")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 2, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=basicenergyzed")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 3, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=advancedenergyzed")); This method register 4 item with the right textures but the gui transformation are not take into acocunt. Am i doing something wrong or is there a way that i dont know to have all you desired variant with the textures you want and the right gui transformation ?
-
[1.8.9] rotation submodel in TESR or other solutions?
Woops literaly just found it 10sec after posting https://gist.github.com/RainWarrior/964ed4692f4da1fd4964 lol.
-
[1.8.9] rotation submodel in TESR or other solutions?
Do you have any link or any ideas on how the formating of the parameters section works? "parameters": { "world_to_cycle": [ "/", "#cycle_length" ], "round_cycle": [ "compose", [ "R", "#cycle_length" ] , "#click_time" ], "end_cycle": [ "-", "#round_cycle" ] } im guessing that "round_cycle" is a cycle where it apply a rotation of "#cycle_length" during "#click_time" on the model, iam maybe totaly wrong that is why i need a documentation.
-
[1.8.9] rotation submodel in TESR or other solutions?
i have a this model.json : { "forge_marker": 1, "defaults": { "textures":{ "#t-base": "mymodid:blocks/t-base", "#t-staff": "mymodid:blocks/t-staff" } }, "variants": { "all_facing=up": [{ "model": "mymodid:t-base.obj", "submodel": { "staff": { "forge_marker": 1, "model": "mymodid:t-staff.obj" } }, "x":270 }], .... } } This model is attach to a block with a tile entity. I want the submodel staff to rotate depending on a value stored in my tile entity so i use a TESR, but i dont know how to select only the quads from the staff submodel or maybe there is another way than using TESR to do that?
-
[1.8.9] variants rotations on OBJ model
thanks it works perfectly!
-
[1.8.9] variants rotations on OBJ model
I have a block with facing state and cutom OBJ model, i cannot figure how to rotate the different variants, i tried to put "y"=angle everywhere and its not working, btw my block is not a tile entity. { "forge_marker": 1, "defaults": { "textures": { "#None": "mymodid:blocks/controlpanel" }, "model": "mymodid:controlpanel.obj" }, "variants": { "facing=north": [{"y":180}], "facing=south": [{"y":90}], "facing=east": [{"y":0}], "facing=west": [{"y":270}], "facing=up": [{}], "facing=down": [{}], "normal": [{}], "inventory": [{ "transform": { "translation": [ 0, 0, 0], "scale": 1.0 } }] } } I don t know if there is another method to specify variants rotation ?
-
Making mobs move toward their block mob spawner
Here is where i update my spawner and where i try to add Ai task or try to set the entity spawned path when it spawn an entity public void updateSpawner() { if (isActivated()) { double d2; if (this.getSpawnerWorld().isRemote) { //particles } else { if (this.spawnDelay == -1) { this.resetTimer(); } if(this.spawnDelay==0){ if(!spawnConditions()){ this.resetTimer(); return; } } if (this.spawnDelay > 0) { --this.spawnDelay; return; } boolean flag = false; for (int i = 0; i < this.spawnCount; ++i) { Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); if (entity == null) { return; } entity.getEntityData().setIntArray(SpawnerBlock.KEY_SPAWN, new int[]{this.getSpawnerX(),this.getSpawnerY(),this.getSpawnerZ()}); int j = this.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); if (j >= this.maxNearbyEntities) { this.resetTimer(); return; } d2 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; double d3 = (double)(this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1); double d4 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; entity.setLocationAndAngles(d2, d3, d4, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); if (( entityliving == null || (entityliving.getCanSpawnHere() || !followVanillaSpawnRules) ) && getSpawnerWorld().getBlock((int)d2, (int)d3, (int)d4) == Blocks.air ) { //entityliving.getNavigator().tryMoveToXYZ(this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 1.0D); //entityliving.getMoveHelper().setMoveTo(this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 1.0D); //entityliving.tasks.addTask(0, new EntityAIMoveToBlock(entityliving,this.getSpawnerX(),this.getSpawnerY(),this.getSpawnerZ())); this.spawnEntity(entity); this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); if (entityliving != null) { entityliving.spawnExplosionParticle(); } flag = true; } } if (flag) { this.resetTimer(); } /*for(EntityLiving ecr :this.listEToRemove){ this.listE.remove(ecr); } this.listEToRemove.clear();*/ } } public Entity spawnEntity(Entity par1Entity) { if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null) { ((EntityLiving)par1Entity).func_110163_bv(); this.getSpawnerWorld().spawnEntityInWorld(par1Entity); } return par1Entity; } Here my AI task public class EntityAIMoveToBlock extends EntityAIBase{ EntityLiving entitySpawn; int xBlock; int yBlock; int zBlock; public EntityAIMoveToBlock(EntityLiving entity, int x, int y, int z){ this.entitySpawn = entity; this.xBlock = x; this.yBlock = y; this.zBlock = z; setMutexBits(7); } @Override public boolean shouldExecute() { if (entitySpawn == null){ return false; } else if (!entitySpawn.isEntityAlive()){ return false; } else{ return true; } } public boolean continueExecuting(){ return entitySpawn.isEntityAlive() && !entitySpawn.getNavigator().noPath() && entitySpawn.getDistanceSq(xBlock, yBlock, zBlock)>2.0*2.0; } public void startExecuting(){ entitySpawn.getNavigator().tryMoveToXYZ(this.xBlock, this.yBlock, this.zBlock, 2.0); } public void resetTask(){ entitySpawn = null; } } Im applying that task to any entity spawned by the spawner even vanilla ones not only my custom ones so there is no list of tasks.addTask() , i know about Mutexbits but what is CanBeInterrupted ?
-
Making mobs move toward their block mob spawner
I have a custom creature spawner who can spawn any entityliving (mobs and creatures ) from vanilla and other mods . I want those creatures to move to the spawner they just have been spawned from . Right after spawning them to the world with : this.getSpawnerWorld().spawnEntityInWorld(par1Entity); I tried to set their path to the spawner: entityliving.getNavigator().tryMoveToXYZ(this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 1.0D); I tried to tell them where to move : entityliving.getMoveHelper().setMoveTo(this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 1.0D); I tried to add a custom AI task which set their path to the spawner: entityliving.tasks.addTask(0, new EntityAIMoveToBlock(entityliving,this.getSpawnerX(),this.getSpawnerY(),this.getSpawnerZ())) But it looks like the task is ignored by the creature. None of those methods works i dont know if there is another way to tell any kind of creature to move to a said location; or if there is a way to add AI task after a creature has been created ?
-
Item Renderer with sublblocks (metadata)
Ok i did this : List n = new LinkedList(); ModBlocks.myBlock.getSubBlocks(Item.getItemFromBlock(ModBlocks.blockPillarLightningRod), SFArtifacts.sfTabs, n); But how do i get a block from an itemStack now?
-
Item Renderer with sublblocks (metadata)
I have a block wich have a custom render model with 4 subblocks. The 4 subblocks have 4 differents textures associated, i register them with their specific tile entity it works as intended : TileEntitySpecialRenderer render = new RenderBlockMyBlock(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMyBlock1.class, render); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMyBlock2.class, render); ... Here the problem i need to register 4 differents Item Renderer, 1 for each subblock but i cant find a way to get the subblocks of a block to use it with this : MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(*ModBlocks.myBlock.subblock1*), new RenderItemMyBlock(renderMyBlock, new TileEntityMyBlock1())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(*ModBlocks.myBlock.subblock2*), new RenderItemMyBlock(renderMyBlock, new TileEntityMyBlock2())); ...
IPS spam blocked by CleanTalk.