Jump to content

DJKnarnia

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by DJKnarnia

  1. I am on the most recent version of the mod. I removed it and the issue has been resolved. I will report the issue to the mod author. Thanks.
  2. Sorry about that. I re-read the EAQ and realized there was a second section. https://gist.github.com/DJKnarnia/6a2ba90ef7c4c4eb812439332f57c779
  3. I have been working on a custom modpack, and am now working on getting the server setup. The server immediately crashes whenever a player right clicks on a block. I have included the crash log below. From my research, this error indicates that a client-side mod is in the server mod folder. I've gone through the mods and removed a few client-side mods that I found. However, I am still crashing with the same error. Have I missed a client-side mod, or is there something else going on here? Thanks in advance. Crash Log
  4. I actually appear to have solved the problem. The issue was the material I had set on the block when registering them. I copied over the properties of the torch block directly and the block began behaving properly. BlockList.flare = (FlareBlock) new FlareBlock(TorchBlock.Properties.from(Blocks.TORCH)).setRegistryName(location("flare")),
  5. I have built a custom torch type by extending the vanilla TorchBlock class (I am aware I will also need to handle the WallTorchBlock class at some point), The issue I am quite literally running into is that the torch blocks are solid. They are not full blocks, rather their hitbox matches their model. I am just confused why the blocks seem to have taken on a new property when I haven't made any changes to their base class as far as I can tell. Is there an additional step I am not seeing here? I pulled the getCollisonBoundingBoxFromPool() method from an old forum post here, but I doubt it is still viable given the age of that post. package djknarnia.abyssal.block; import net.minecraft.block.TorchBlock; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; public class FlareBlock extends TorchBlock { public FlareBlock(Properties properties) { super(properties); } /* public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int wx, int wy, int wz) { return null; } */ } https://github.com/DJKnarnia/Abyssal-Minecraft-Mod
  6. You're right, after looking at those files, it was really easy. I've got it working now. Sorry, bad habits die hard. My Java's pretty rusty, to say the least, and I've always had a bad habit of learning by reverse engineering examples rather than actually understanding what I was doing. Thanks.
  7. I am working my way through getting a custom fire block working. Thus far, I have completed most of the basic parts of the block's behavior, spread, extinguish, damaging entities, destroying items, etc. The one thing I am missing however, is I would like the fire block to play a sound when it is destroyed, namely the vanilla fizz sound. From the docs I got the playSound() method. Specifically, I am attempting to use the playSound(double x, double y, double z, SoundEvent, SoundCategory, volume, pitch, distanceDelay) method. Most of the variables in this method make sense to me. The two that I can't seem to wrap my head around are SoundEvent and SoundCategory. Could someone provide an example of how this method would be used to call to a vanilla sound? I am aware that the below code will not compile, I just wanted to give some context to what I am doing. package djknarnia.abyssal.events; import djknarnia.abyssal.abyssal; import lists.BlockList; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.event.sound.SoundEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = abyssal.modid, bus = Bus.FORGE) public class LeftClickEvent { @SubscribeEvent public static void leftClickEvent(PlayerInteractEvent.EntityInteract.LeftClickBlock event) { World world = event.getWorld(); Block clickedBlock = event.getWorld().getBlockState(event.getPos().offset(event.getFace())).getBlock(); abyssal.logger.info("player left clicked " + event.getPos()); if(clickedBlock == BlockList.flare_fire) { world.setBlockState(event.getPos().offset(event.getFace()), Blocks.AIR.getDefaultState()); double x = event.getPos().getX(); double y = event.getPos().getY(); double z = event.getPos().getZ(); ResourceLocation resourceLocation = new ResourceLocation("minecraft", "random.fizz"); world.playSound(x, y, z, soundIn, category, 1.0f, 1.0f, false); } } }
  8. Thank you, that was it. I don't know how I overlooked that... Anyway, thanks for the fast reply, have a good one.
  9. I am attempting to add a few items to the game as a learning exercise to get myself accustomed to modding. The issue I am running into appears to be that my textures are not properly linked to my items, I know that the models are linking properly, as they are the flat missing texture model vs the missing texture cube. What confuses me is that this issue only seems to show up with the tool Item classes. (AxeItem, SwordItem, ShovelItem, etc.) My understanding was that the the registry name informed the game where to look for the necessary resources. Am I misunderstanding how this works? I've included a snippet here, as well as a link to the project on GitHub. event.getRegistry().registerAll( /*Items*/ ItemList.prismarine_quartz_shard = new Item(new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_quartz_shard")), /*Tools*/ ItemList.prismarine_and_steel = new PrismarineAndSteel(new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_and_steel")), ItemList.prismarine_axe = new AxeItem(ToolMaterialList.prismarine, -1.0f, 6.0f, new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_axe")), ItemList.prismarine_pickaxe = new PickaxeItem(ToolMaterialList.prismarine, -2, 6.0f, new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_pickaxe")), ItemList.prismarine_shovel = new ShovelItem(ToolMaterialList.prismarine, -1.0f, 6.0f, new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_shovel")), ItemList.prismarine_sword = new SwordItem(ToolMaterialList.prismarine, 1, 6.0f, new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_sword")), ItemList.prismarine_hoe = new HoeItem(ToolMaterialList.prismarine, 6.0f, new Item.Properties().group(abyssal)).setRegistryName(location("prismarine_hoe")), /*Block Items*/ ItemList.prismarine_quartz_block = new BlockItem(BlockList.prismarine_quartz_block, new Item.Properties().group(abyssal)).setRegistryName(BlockList.prismarine_quartz_block.getRegistryName()) ); https://github.com/DJKnarnia/Abyssal-Minecraft-Mod
×
×
  • Create New...

Important Information

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