Jump to content

KidKoderMod033109

Members
  • Posts

    106
  • Joined

  • Last visited

Posts posted by KidKoderMod033109

  1. Hi!

    I've used `RenderTypeLookup` to set my block to translucent, but I still appears to be rendered as a full block. I've tried using the 3 translucent type and 2 cutout types.

    Here is my code:

    private void doClientStuff(final FMLClientSetupEvent event) {
            RenderTypeLookup.setRenderLayer( BlockInit.ALTAR_BLOCK, RenderType.translucent());
    }

    And my model:

    Spoiler
    Quote

     

    
    {
    	"credit": "Made with Blockbench",
    	"textures": {
    		"0": "block/anvil",
    		"1": "misc/underwater",
    		"2": "block/spruce_planks",
    		"3": "block/gold_block",
    		"particle": "block/anvil"
    	},
    	"elements": [
    		{
    			"from": [7, 10, 6],
    			"to": [10, 11, 9],
    			"faces": {
    				"north": {"uv": [0, 0, 3, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 3, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 3, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 3, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
    				"down": {"uv": [0, 0, 3, 3], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [6, 11, 5],
    			"to": [7, 12, 9],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 4], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 4], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [6, 11, 9],
    			"to": [10, 12, 10],
    			"faces": {
    				"north": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 4, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [7, 11, 5],
    			"to": [11, 12, 6],
    			"faces": {
    				"north": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 4, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [10, 11, 6],
    			"to": [11, 12, 10],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 4, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 4], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 4], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [5, 12, 4],
    			"to": [6, 13, 11],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 7, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 7, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 7], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 7], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [6, 12, 10],
    			"to": [12, 13, 11],
    			"faces": {
    				"north": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 6, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [6, 12, 4],
    			"to": [12, 13, 5],
    			"faces": {
    				"north": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 6, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 6, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [11, 12, 5],
    			"to": [12, 13, 10],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 5, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 5, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 5], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 5], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [12, 13, 3],
    			"to": [13, 14, 11],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 8], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 8], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [4, 13, 4],
    			"to": [5, 14, 12],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 1, 8], "texture": "#0"},
    				"down": {"uv": [0, 0, 1, 8], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [5, 13, 11],
    			"to": [13, 14, 12],
    			"faces": {
    				"north": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 8, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [4, 13, 3],
    			"to": [12, 14, 4],
    			"faces": {
    				"north": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"east": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"south": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"west": {"uv": [0, 0, 1, 1], "texture": "#0"},
    				"up": {"uv": [0, 0, 8, 1], "texture": "#0"},
    				"down": {"uv": [0, 0, 8, 1], "texture": "#0"}
    			}
    		},
    		{
    			"name": "Side",
    			"from": [6, 12, 5],
    			"to": [11, 13, 10],
    			"faces": {
    				"north": {"uv": [0, 0, 5, 1], "texture": "#missing"},
    				"east": {"uv": [0, 0, 5, 1], "texture": "#missing"},
    				"south": {"uv": [0, 0, 5, 1], "texture": "#missing"},
    				"west": {"uv": [0, 0, 5, 1], "texture": "#missing"},
    				"up": {"uv": [0, 0, 4, 4], "texture": "#1"},
    				"down": {"uv": [0, 0, 5, 5], "texture": "#missing"}
    			}
    		},
    		{
    			"from": [7, 0, 6],
    			"to": [10, 10, 9],
    			"faces": {
    				"north": {"uv": [0, 0, 3, 10], "texture": "#2"},
    				"east": {"uv": [0, 0, 3, 10], "texture": "#2"},
    				"south": {"uv": [0, 0, 3, 10], "texture": "#2"},
    				"west": {"uv": [0, 0, 3, 10], "texture": "#2"},
    				"up": {"uv": [0, 0, 3, 3], "texture": "#2"},
    				"down": {"uv": [0, 0, 3, 3], "texture": "#2"}
    			}
    		},
    		{
    			"from": [4, 0, 6],
    			"to": [5, 13, 9],
    			"faces": {
    				"north": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"east": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"south": {"uv": [0, 0, 16, 16], "texture": "#3"},
    				"west": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"up": {"uv": [0, 0, 1, 3], "texture": "#3"},
    				"down": {"uv": [0, 0, 1, 3], "texture": "#3"}
    			}
    		},
    		{
    			"from": [12, 0, 6],
    			"to": [13, 13, 9],
    			"rotation": {"angle": 0, "axis": "x", "origin": [4, 0, 0]},
    			"faces": {
    				"north": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"east": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"south": {"uv": [0, 0, 3, 9], "texture": "#3"},
    				"west": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"up": {"uv": [0, 0, 1, 3], "texture": "#3"},
    				"down": {"uv": [0, 0, 1, 3], "texture": "#3"}
    			}
    		},
    		{
    			"from": [7, 0, 11],
    			"to": [10, 13, 12],
    			"rotation": {"angle": 0, "axis": "x", "origin": [4, 0, 0]},
    			"faces": {
    				"north": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"east": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"south": {"uv": [0, 0, 3, 11], "texture": "#3"},
    				"west": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"up": {"uv": [0, 0, 3, 1], "texture": "#3"},
    				"down": {"uv": [0, 0, 3, 1], "texture": "#3"}
    			}
    		},
    		{
    			"from": [7, 0, 3],
    			"to": [10, 13, 4],
    			"rotation": {"angle": 0, "axis": "x", "origin": [4, 0, 0]},
    			"faces": {
    				"north": {"uv": [0, 0, 3, 13], "texture": "#3"},
    				"east": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"south": {"uv": [12, 8, 16, 16], "texture": "#3"},
    				"west": {"uv": [0, 0, 1, 13], "texture": "#3"},
    				"up": {"uv": [0, 0, 3, 1], "texture": "#3"},
    				"down": {"uv": [0, 0, 3, 1], "texture": "#3"}
    			}
    		}
    	],
    	"display": {
    		"head": {
    			"rotation": [0, 0, -180],
    			"translation": [0.25, 30.5, 0.25],
    			"scale": [1, 4, 1]
    		}
    	},
    	"groups": [
    		{
    			"name": "Bowl",
    			"origin": [0, 0, 0],
    			"color": 0,
    			"children": [0,
    				{
    					"name": "Layer 1",
    					"origin": [0, 0, 0],
    					"color": 0,
    					"children": [1, 2, 3, 4]
    				},
    				{
    					"name": "Layer 2",
    					"origin": [0, 0, 0],
    					"color": 0,
    					"children": [5, 6, 7, 8]
    				},
    				{
    					"name": "Layer 3",
    					"origin": [0, 0, 0],
    					"color": 0,
    					"children": [9, 10, 11, 12]
    				},
    				{
    					"name": "Water",
    					"origin": [8, 8, 8],
    					"color": 0,
    					"children": [13]
    				}
    			]
    		}, 14, 15, 16, 17, 18]
    }

     

     Translucent Moving Block and Translucent No Crumbling don't render the block, so I'm sure that the code works, just it's not making the block transparent. Anyway to fix this?

  2. Hi,

    I'm working on a battery to store power in my mod and would like to the power to be displayed in a tooltip. I'm using this code to change the tooltip:

        @OnlyIn(Dist.CLIENT)
        @Override
        public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
            super.addInformation(stack, worldIn, tooltip, flagIn);
            tooltip.add(new StringTextComponent("Power" + power));
        }

    How can I make it so that the tooltip is different for every item in the inventory?

    Eg. in slot 1 the battery has 10 power and in slot 2 the battery has 5 power. Then when a battery is destroyed all power is lot

    Thank in advance

  3. Hi,

    I was working on making a TE. But, when I place it down, the game crashes.

    Here is the crash log:

    https://gist.github.com/KidKoder09923/2d0ac3ddfd76360d2b825a315615fe4c

    EDIT: Here is line 23-25:

    public TileEntity createTileEntity(BlockState state, IBlockReader world) {
        final TileEntity tileEntity = ModTileEntityTypes.COPPER_CORE.get().create();
        return tileEntity;
    }

    Thank in advance

  4. Hi,

    I working on making my Tile Entity store data, but when I tried to override the read function, there was no such thing. Here is my code:

    public class CopperCoreTileEntity extends TileEntity implements ITickableTileEntity {
        public int x, y, z;
        private int power = 0;
        private int tick;
        private boolean inited;
    
        public CopperCoreTileEntity(TileEntityType<?> tileEntityTypeIn) {
            super(tileEntityTypeIn);
        }
        public CopperCoreTileEntity() {
            this(ModTileEntityTypes.COPPER_CORE.get());
        }
    
        public void tick() {
            if(!inited) init();
            tick++;
            if(tick==6000 && power > 0) {
                power--;
            }
        }
    
        private void init() {
            inited  = true;
            x = this.pos.getX() - 1;
            y = this.pos.getY() - 1;
            z = this.pos.getZ() - 1;
            tick = 0;
        }
    
        @Override
        public CompoundNBT write(CompoundNBT compound) {
            compound.put("initvalue", NBTHelper.toNBT(this));
            return  super.write(compound);
        }
    
    }

    How do I override the read function?

    Thanks in advance,

    Kid Koder

  5. Hi,

    So, I'm trying to register a Tile Entity to the game, and I'm using this code:

    TILE_ENTITY_TYPES

        public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, "simplycopper");
        public static final RegistryObject<TileEntityType<CopperCoreTileEntity>> COPPER_CORE = TILE_ENTITY_TYPES.register("copper_core", () -> TileEntityType.Builder.create(CopperCoreTileEntity::new, BlockInit.COPPER_CORE).build(null)));

    And I get the error: 

    Cannot resolve method 'create(<method reference>, net.minecraft.block.Block)'

    I have no clue how to fix this.

    Here is my CopperCoreTileEntityClass:

    Quote
    
    public class CopperCoreTileEntity extends TileEntity {
        public CopperCoreTileEntity(TileEntityType<?> tileEntityTypeIn) {
            super(tileEntityTypeIn);
        }
    }

     

    Thanks in advance,

    Kid Koder

  6. Hi,

    I'm trying to add copper ore and I wanted to have it generate in the Overworld. I'm using the latest version of Forge MDK. I am trying to use this function:

        private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) {
            CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max);
            OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size);
            ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range);
            biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config));
       }

    too add it, but the class CountRangeConfig doesn't exist. In addition to that the COUNT_RANGE variable doesn't exist and the function addFeature doesn't exist.

    I have no clue what is going on.
    Is there any way to fix this in IntelliJ IDEA
    Thanks,
    Kid Koder

×
×
  • Create New...

Important Information

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