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

Meldexun

Members
  • Content Count

    184
  • Joined

  • Last visited

Everything posted by Meldexun

  1. Yes I don't need to save the data. But how can I stop it from saving NBT data. This is my provider class: public class StructureDataProvider implements ICapabilitySerializable<NBTBase> { @CapabilityInject(IStructureData.class) public static final Capability<IStructureData> STRUCTURE_DATA = null; private IStructureData instance = STRUCTURE_DATA.getDefaultInstance(); @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { return capability == STRUCTURE_DATA; } @Override public <T> T getCapability(Capability<T>
  2. I just need to save the 2 BlockPos on server side temporarily. But is this really the only/best way?
  3. When registering an instance of your event handler with MinecraftForge.EVENT_BUS.register() then you have to use non static events handlers. Or you can pass the complete event handler class. You can also automatically register your event handler by annotating your event handler class with @Mod.EventBusSubscriber. You can read more about it here: https://mcforge.readthedocs.io/en/latest/events/intro/
  4. You could make a for loop and check for every entity in the targetList if it is an ally or a player and then add it to your friendlyList.
  5. Hi there, I want to save 2 BlockPos for a player. They don't need to be saved when leaving and reentering the world. I thought of adding a Capability to the player but then i have to save something as NBT. Is there an easier way to save 2 BlockPos for a player? Thanks for the help.
  6. I just meant for the model and rotation part
  7. It's just a testing mod. I just wanted to see if my model works.
  8. Yes and i thought i got everything right. I looked a bit in the web and now i also overwrite this method: @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing()); } and it seems to work fine. Feel free to correct me if I'm making trash
  9. Hello there, I created a block and i want that it rotates when you place it in the world. Like the stairs in Minecraft. But my block isn't rotating in the direction i look. So here is my block class: public class BaseBlock extends BlockHorizontal { public BaseBlock(String name) { super(Material.ROCK); setUnlocalizedName(name); setRegistryName(CrystalicVoid.modid, name); setCreativeTab(CrystalicVoid.tabCrystalicVoid); setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); } @Override public boolean isOpaqueCube(IBlockState state) {
  10. I'm sorry but I lost some files. So I can't send you any example.
  11. So here are my full classes. @EventBusSubscriber public class InitBiome { public static Biome kelpForest; @SubscribeEvent public static void registerBiome(RegistryEvent.Register<Biome> event) { kelpForest = new KelpForest().setRegistryName(BetterDiving.modid, "Kelp Forest"); event.getRegistry().register(kelpForest); BiomeDictionary.addTypes(kelpForest, Type.OCEAN, Type.WATER); BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 10)); } } And my Biome class public class KelpForest extends Biome { public KelpForest() { super(new BiomePrope
  12. Ok. I will post my code tomorrow. It's to late for me now.
  13. I'm registering my biome correctly. So it is spawning as a ocean biome with water and so on. But Minecraft generates Biome Types (warm,...) and if i use this: BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20)); When a warm biome type generates my biome has a chance to appear. But I want my biome to spawn when a ocean biome is generated and not when a warm biome is generated.
  14. Ok i found out that minecraft spawns Biome Types (Warm, Cold, Icy or Desert). So with this when minecraft is spawning a Warm biome my biome has a chance to be generated. BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20)); But there is no Biome Type Ocean. Does nobody know how I can register and generate it as a Ocean biome?
  15. I was also thinking of adding a check if my mod is loaded on the server too. But a hacker could more easily write his own mod than hack into mine.
  16. My mod changes vanilla movement under water so you don't sink automatically and you swim in the looking direction. But since movement is always handeled client side I noticed that my mod can easily be used to cheat on a PVP server, because the mod has only to be installed on client. Can I change something so that it can't be used as a cheat engine? Also it seems very, very simple to create a speed enhancing mod which only makes the player 1-2% faster. That would be hard to track from a server be still gives you an advantage.
  17. Yes I'm using @EventBusSubscriber. But I didn't know that I can specify a Side there. Will do that right know. Thank you
  18. I heard that I shouldn't use @SideOnly. So that was my way to register the item models: @SideOnly(Side.CLIENT) @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { registerRender(item1, 0); //... } private static void registerRenderMeta(Item item, int meta) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory")); } I changed it and now I have this: @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { BetterDiving.proxy.registerItemRender(item1, 0);
  19. I'm not totally sure but I think you should annotate your onModelRegister with @SideOnly(Side.CLIENT). (I'm wrong. Stick with the post of diesieben07) But I know another thing. Your oxygen mask has a custom model and to use it you are overriding the getArmorModel method in your class. But you are creating a new model every tick inside this method with: ModelOxygenMask model1 = new ModelOxygenMask(); You should create your model in your client proxy.
  20. I have created a new Biome and now I want to make it spawn with a ocean biome around it. Or at least next to my biome should be a ocean biome. So this is what I'm doing when registering my biome: @SubscribeEvent public static void registerBiome(RegistryEvent.Register<Biome> event) { event.getRegistry().register(kelpForest); BiomeDictionary.addTypes(kelpForest, Type.OCEAN); BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20)); BiomeManager.addSpawnBiome(kelpForest); } But it seems that it just randomly spawns.
  21. I think you have to create a capability which is added to your itemStack. Documentation
  22. I created a custom armor and a custom model. To show my model I'm overwriting the getArmorModel() method in my custom armor class. But where should I create the object of my custom model which is returned by the getArmorModel() method? Currently I'm creating it in my ClientProxy: public class ClientProxy implements IProxy { public static CustomModel model1; @Override public void init() { model1 = new CustomModel(1.0f); } }
  23. So I just create a method in my Client proxy which is than called by the MessageHandler. @Override public IMessage onMessage(MessageCapabilitySync messageCapabilitySync, MessageContext ctx) { ClientProxy.message1(messageCapabilitySync, ctx); return null; }
  24. I now check in my MessageHandler if the message is recieved client side and it seems to work. @Override public IMessage onMessage(MessageCapabilitySync messageCapabilitySync, MessageContext ctx) { if (ctx.side.isClient()) { //do some stuff } return null; } I tried that before but then it was crashing all the time. Thats why I used the proxy to register my message. I also noticed that most people name it IProxy. Maybe I will change it too.
  25. Ok. That makes sense. I will try to do that. It's just the name of the interface. I have just followed a tutorial for modding beginning and there it was named common proxy. I'm not doing something in this interface.
×
×
  • Create New...

Important Information

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