-
Posts
265 -
Joined
-
Last visited
-
Days Won
2
Everything posted by blinky000
-
I.m notr sure this is the right way, the original problem is the BlockBehaviour.Properties.strength(1.5F,6.0F) of my blocks is working the same as minecraft blocks of the same strength
-
In my src/main/resources i would add "data.minecraft.tags.blocks.minable.<my pickaxe.json>"?
-
I made a public final static Properties M_STONE = BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).requiresCorrectToolForDrops().strength(1.5F, 6.0F); which is the same a Blocks.STONE i even tried Blocks.STONE = public final static Properties M_STONE = BlockBehaviour.Properties.copy(Blocks.STONE); but in game the block using my setting takes ALOT longer the the minecraft version
-
1.18 create a block that emits light?
-
for horizontal i use: public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; what do i use if i what all 6 directions?
-
ty
-
When i click a box in game the setPlacedBy() method is called. if i use an item and use setBlock() , the setPlaceBy in the new block never gets called
-
This is how I fixed it not sure this is the correct way, but it works boolean flag = fluidstate.getType() != Fluids.EMPTY; boolean flag = fluidstate.getType() != Fluids.EMPTY; Added this method @Override public boolean canPlaceLiquid(BlockGetter p_54325_, BlockPos p_54326_, BlockState p_54327_, Fluid p_54328_) { return false; }
-
When i attempted to water-log a block , it has an "air" skin wrapped around the horizontal faces. public class WaterShape extends YabmBlock implements SimpleWaterloggedBlock { public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public WaterShape(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any().setValue(WATERLOGGED, Boolean.valueOf(false))); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> p_48725_) { p_48725_.add(WATERLOGGED); } @Override @Nullable public BlockState getStateForPlacement(BlockPlaceContext context) { FluidState fluidstate = context.getLevel().getFluidState(context.getClickedPos()); boolean flag = fluidstate.getType() == Fluids.WATER; //return super.getStateForPlacement(context).with(WATERLOGGED, Boolean.valueOf(flag)).with(FACING, context.getPlacementHorizontalFacing()); return super.getStateForPlacement(context).setValue(WATERLOGGED, Boolean.valueOf(flag)); } public FluidState getFluidState(BlockState p_56131_) { return p_56131_.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(p_56131_); } }
-
ty
-
I look at the eclipse dependencies and it finds securejarhandler-1.0.1.jar. The only thing i change was run a "gradlew build" from the command line earlier. the eclipse is messed up
-
well not getting involved with changing MC code, and can't change a block behavior from a resoucepack. Kills that idea. How could i change trees to use a custom block instead of minecrafts?
-
I creatde round trees using .obj, and added it to my resoucepack. Looks good , except: since it is a model file it has to have the property noOcclusion() , otherwise any other block it touches is see through. any way to do this?
-
ok, thanks for you help
-
public final class ModItemTabs extends CreativeModeTab{ // public ItemStack iconItemStack; public ModItemTabs(int p_40773_, String p_40774_) { super(p_40773_, p_40774_); } public static final CreativeModeTab TAB_SHAPES = new CreativeModeTab("shapes") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.CHEST); } }; public static final CreativeModeTab TAB_MODBLOCK= new CreativeModeTab("mbLocks") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.TNT); } }; public static final CreativeModeTab TAB_SLOPES = new CreativeModeTab("slopes") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.PEONY); } }; @Override public ItemStack makeIcon() { return null; } // class to sort the Itemstack public static final class SortByReg implements Comparator<ItemStack> { @Override public int compare(ItemStack o1, ItemStack o2) { return o1.getItem().getRegistryName().compareTo(o2.getItem().getRegistryName()); } } /* @Override public ItemStack getIconItem() { if (this.iconItemStack.isEmpty()) { this.iconItemStack = this.makeIcon(); } return this.iconItemStack; } */ // public void fillItemList(NonNullList<ItemStack> p_40778_) { // for(Item item : Registry.ITEM) { // item.fillItemCategory(this, p_40778_); // } // } @Override public void fillItemList(NonNullList<ItemStack> items) { for(Item item : Registry.ITEM) { item.fillItemCategory(this, items); } Collections.sort(items, new SortByReg()); } }
-
package com.stevet.yabm7.Init; import net.minecraft.core.NonNullList; import net.minecraft.core.Registry; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; public class ModCreativeModeTab { public static final CreativeModeTab SHAPE_TAB = new CreativeModeTab("shapes") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.CHEST); } }; public static final CreativeModeTab SLOPES_TAB = new CreativeModeTab("slopes") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.PEONY); } }; public static final CreativeModeTab MODBLOCK_TAB = new CreativeModeTab("mbLocks") { @Override public ItemStack makeIcon() { return new ItemStack(Blocks.TNT); } }; @Override public void fillItemList(NonNullList<ItemStack> p_40778_) { for(Item item : Registry.ITEM) { item.fillItemCategory(this, p_40778_); } } //@Override //public void fillItemList(NonNullList<ItemStack> items) { // copy items //NonNullList<ItemStack> tmpItems = items; // fill the tmpItems //for(Item it : Registry.ITEM) { // it.fillItemCategory(this, tmpItems); //} // sort the tmpItems //Collections.sort(tmpItems, new SortByReg()); // fill the items // items = tmpItems; //} } first problem is fillItemList() errors on the @Override , but is an exact copy of the CreativeModeTab.class
-
I have tried extending the CerativeModTab and Overriding fillItemList() but that didn't work, any ideas?
-
1.17 when a Block is placed , create another Block
blinky000 replied to blinky000's topic in Modder Support
Thank you for you help, as i was getting ready to show my code, i found i had a bad registration -
1.17 when a Block is placed , create another Block
blinky000 replied to blinky000's topic in Modder Support
I find in both BlockBed and BlockDoor , i only find one method in commen that use SetBlock() (which i assme? is how you set a block) setPlacedBy() when i override setPlacedBy() in my custom_block, it never gets called. the custom_block does extend three classes(that don't have setPlacedBy() ) before Block class, but that wasn't a problem in 1.16 I hope im making sense -
In 1.16 i used onBlockAdded() to create the other blocks. So far in 1.17 i cannot find the equivalent. Something i read makes me think i have to create and register a event
-
sorry found the error
-
Is there a way so it does not pass light?
-
I Can't believe i missed that, ty
-
Is there a way to make eclipse run my mod in a different resolution?