Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

KaboomRoads

Members
  • Posts

    32
  • Joined

  • Last visited

KaboomRoads's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. youre running java 7 but 1.16.5 needs a minimum of java 8 and can run until java 16
  2. i also found a class called LightPredicate but i dont know how to do something like that package net.minecraft.advancements.critereon; import com.google.gson.JsonElement; import com.google.gson.JsonNull; import com.google.gson.JsonObject; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.GsonHelper; public class LightPredicate { public static final LightPredicate ANY = new LightPredicate(MinMaxBounds.Ints.ANY); private final MinMaxBounds.Ints composite; LightPredicate(MinMaxBounds.Ints pComposite) { this.composite = pComposite; } public boolean matches(ServerLevel pLevel, BlockPos pPos) { if (this == ANY) { return true; } else if (!pLevel.isLoaded(pPos)) { return false; } else { return this.composite.matches(pLevel.getMaxLocalRawBrightness(pPos)); } } public JsonElement serializeToJson() { if (this == ANY) { return JsonNull.INSTANCE; } else { JsonObject jsonobject = new JsonObject(); jsonobject.add("light", this.composite.serializeToJson()); return jsonobject; } } public static LightPredicate fromJson(@Nullable JsonElement pJson) { if (pJson != null && !pJson.isJsonNull()) { JsonObject jsonobject = GsonHelper.convertToJsonObject(pJson, "light"); MinMaxBounds.Ints minmaxbounds$ints = MinMaxBounds.Ints.fromJson(jsonobject.get("light")); return new LightPredicate(minmaxbounds$ints); } else { return ANY; } } public static class Builder { private MinMaxBounds.Ints composite = MinMaxBounds.Ints.ANY; public static LightPredicate.Builder light() { return new LightPredicate.Builder(); } public LightPredicate.Builder setComposite(MinMaxBounds.Ints pComposite) { this.composite = pComposite; return this; } public LightPredicate build() { return new LightPredicate(this.composite); } } }
  3. i have a block that is very similar to the light block, i need the texture to change depending on the light level the block has i already have the light block thing functional but the only problem is changing the texture. this is the main json for the item. { "parent": "item/generated", "textures": { "layer0": "mrmod:item/darkness" }, "overrides": [ { "predicate": { "level": 0.0000 }, "model": "mrmod:item/darkness_00" }, { "predicate": { "level": 0.0625 }, "model": "mrmod:item/darkness_01" }, { "predicate": { "level": 0.1250 }, "model": "mrmod:item/darkness_02" }, { "predicate": { "level": 0.1875 }, "model": "mrmod:item/darkness_03" }, { "predicate": { "level": 0.2500 }, "model": "mrmod:item/darkness_04" }, { "predicate": { "level": 0.3125 }, "model": "mrmod:item/darkness_05" }, { "predicate": { "level": 0.3750 }, "model": "mrmod:item/darkness_06" }, { "predicate": { "level": 0.4375 }, "model": "mrmod:item/darkness_07" }, { "predicate": { "level": 0.5000 }, "model": "mrmod:item/darkness_08" }, { "predicate": { "level": 0.5625 }, "model": "mrmod:item/darkness_09" }, { "predicate": { "level": 0.6250 }, "model": "mrmod:item/darkness_10" }, { "predicate": { "level": 0.6875 }, "model": "mrmod:item/darkness_11" }, { "predicate": { "level": 0.7500 }, "model": "mrmod:item/darkness_12" }, { "predicate": { "level": 0.8125 }, "model": "mrmod:item/darkness_13" }, { "predicate": { "level": 0.8750 }, "model": "mrmod:item/darkness_14" }, { "predicate": { "level": 0.9375 }, "model": "mrmod:item/darkness_15" }, { "predicate": { "level": -0.0625 }, "model": "mrmod:item/darkness_01" }, { "predicate": { "level": -0.1250 }, "model": "mrmod:item/darkness_02" }, { "predicate": { "level": -0.1875 }, "model": "mrmod:item/darkness_03" }, { "predicate": { "level": -0.2500 }, "model": "mrmod:item/darkness_04" }, { "predicate": { "level": -0.3125 }, "model": "mrmod:item/darkness_05" }, { "predicate": { "level": -0.3750 }, "model": "mrmod:item/darkness_06" }, { "predicate": { "level": -0.4375 }, "model": "mrmod:item/darkness_07" }, { "predicate": { "level": -0.5000 }, "model": "mrmod:item/darkness_08" }, { "predicate": { "level": -0.5625 }, "model": "mrmod:item/darkness_09" }, { "predicate": { "level": -0.6250 }, "model": "mrmod:item/darkness_10" }, { "predicate": { "level": -0.6875 }, "model": "mrmod:item/darkness_11" }, { "predicate": { "level": -0.7500 }, "model": "mrmod:item/darkness_12" }, { "predicate": { "level": -0.8125 }, "model": "mrmod:item/darkness_13" }, { "predicate": { "level": -0.8750 }, "model": "mrmod:item/darkness_14" }, { "predicate": { "level": -0.9375 }, "model": "mrmod:item/darkness_15" } ] } i think the problem is getting the predicate to work
  4. i fixed it now. there was a different never boolean somewhere in the blocks class private static Boolean never(BlockState p_50779_, BlockGetter p_50780_, BlockPos p_50781_, EntityType<?> p_50782_) { return (boolean) false; }
  5. i only need isValidSpawn isRedstoneConductor isSuffocating isViewBlocking i already did the lightLevel but its not working
  6. it does i copied it from the blocks class private static boolean never(BlockState p_50806_, BlockGetter p_50807_, BlockPos p_50808_) { return false; } and then i changed Blocks::never to ModBlocks::never
  7. by my own class i mean my custom blocks class where i register all my blocks the problem is that Blocks cannot be resolved when i put Blocks::never into the params of the methods
  8. lightLevel truns the block into a light source. i realized that having the light level at 15 would not look great for what i need, i found out that .isValidSpawn(Blocks::never).isRedstoneConductor(Blocks::never).isSuffocating(Blocks::never).isViewBlocking(Blocks::never)) gives the block behavior similar to glass which is what my block is supposed to be like but the methods listed above dont seem to work in my own class
  9. I have a custom block that i want always to be lit up and ignore all lighting. How can i do that?
  10. i tried looking through most of the existing block classes and also model json files and i cant find anything that solves this problem there
  11. the only thing i could do so far is change the voxel shape to a slab shape or anything that isnt a full block but then the block outline is smaller and i need it to be a full block shape as long as the block shape is a full block it occludes everything but if its only a full block side on one side it doesnt
  12. how can i only cull one particular face when my block is next to another block in this case i want only the top of the block below my block to be cullable and by that i mean i only want the bottom of my block to occlude i want it to occlude similarly to slabs my block culls the faces that are next to a block fine but if its next to itself it doesnt work because it has noOcclusion also because it has noOcclusion it doesnt occlude the block beneath it but if i remove noOcclusion it culls all faces next to it causing xray the voxel shape causes this but i need the foxel shape to stay the same so that the block outline is a full block but the block collision is a half block
  13. i have 2 voxel shapes but only getShape affects the occlusion. i need it to stay a full 16 by 16 by 16 cube though but that makes it occlude every side @Override public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { return SHAPE; } @Override public VoxelShape getCollisionShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { return COLLISION_SHAPE; }
  14. how can i make a block only cull the face of the block below it instead of either culling all faces or no faces similarly to the culling an enchanting table but i cant find anything in the existing classes
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.