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

raziel23x

Members
  • Posts

    48
  • Joined

  • Last visited

Posts posted by raziel23x

  1. Well now i have the placed item working i am still having issues with the held item

     

    package raziel23x.projectskyblock.events;
    
    import net.minecraft.block.BlockState;
    import net.minecraft.client.renderer.color.BlockColors;
    import net.minecraft.client.renderer.color.ItemColors;
    import net.minecraft.item.BlockItem;
    import net.minecraft.world.biome.BiomeColors;
    import net.minecraftforge.api.distmarker.Dist;
    import net.minecraftforge.client.event.ColorHandlerEvent;
    import net.minecraftforge.eventbus.api.SubscribeEvent;
    import net.minecraftforge.fml.common.Mod;
    import raziel23x.projectskyblock.ProjectSkyblock;
    import raziel23x.projectskyblock.utils.RegistryHandler;
    
    
    
    @Mod.EventBusSubscriber(modid = ProjectSkyblock.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
    public class ClientEvents {
    
    
        @SubscribeEvent
        public static void registerBlockColors(ColorHandlerEvent.Block event) {
    
            BlockColors blockcolors = event.getBlockColors();
    
            blockcolors.register((state, reader, pos, color) -> reader != null && pos != null ? BiomeColors.getWaterColor(reader, pos) : -1, RegistryHandler.WATER_GENERATOR_BLOCK.get());
    
        }
    
        @SubscribeEvent
        public static void registerItemColors(ColorHandlerEvent.Item event) {
    
            ItemColors itemcolors = event.getItemColors();
            BlockColors blockcolors = event.getBlockColors();
    
            itemcolors.register((stack, i) -> {
                BlockState state = ((BlockItem)stack.getItem()).getBlock().getDefaultState();
                return blockcolors.getColor(state, null, null, i);
            }, RegistryHandler.WATER_GENERATOR_BLOCK_ITEM.get());
        }
    }

     

  2. Well i tried it this way and when i run the code it crashes so i am scratching my head on this one

     

    package raziel23x.projectskyblock.events;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.color.BlockColors;
    import net.minecraft.world.biome.BiomeColors;
    import net.minecraftforge.api.distmarker.Dist;
    import net.minecraftforge.client.event.ColorHandlerEvent;
    import net.minecraftforge.eventbus.api.SubscribeEvent;
    import net.minecraftforge.fml.common.Mod;
    import raziel23x.projectskyblock.ProjectSkyblock;
    import raziel23x.projectskyblock.utils.RegistryHandler;
    
    @Mod.EventBusSubscriber(modid = ProjectSkyblock.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
    public class ClientEvents {
        @SubscribeEvent
        public static void registerBlockColors(ColorHandlerEvent.Block event) {
            BlockColors blockcolors = Minecraft.getInstance().getBlockColors();
    
            blockcolors.register((state, reader, pos, color) -> reader != null && pos != null ? BiomeColors.getWaterColor(reader, pos) : -1, RegistryHandler.WATER_GENERATOR_BLOCK.get());
        }
    }

     

  3. I am currently trying to make the fake watersource block in the center of this model https://gist.github.com/raziel23x/af84f9d7b10f8e8e7974b5d8ac14d4ce to visually look like a minture water still source block but i am unable to figure out in code how to have the color of the texture to change to the correct color of the current biome its placed in and share the same color proteries of the actual water source block i am unsure how to make the calls to biome color in my block https://gist.github.com/raziel23x/63a79110599abcedadb9eab0fbddcbe8 to do so

     

     

  4. I was trying to find some information and documentation about making a lava or water generator like i would do with ItemStack but with Fluids but unable to find much i been following tutorials in making basic items/tools/armor and excited i was able to figure but i started the process but got stuck after getting this far

    RegistryHandler.java

    package raziel23x.projectskyblock.utils;
    
    import net.minecraft.block.Block;
    import net.minecraft.item.Item;
    import net.minecraft.tileentity.TileEntityType;
    import net.minecraftforge.fml.RegistryObject;
    import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
    import net.minecraftforge.registries.DeferredRegister;
    import net.minecraftforge.registries.ForgeRegistries;
    import raziel23x.projectskyblock.ProjectSkyblock;
    import raziel23x.projectskyblock.blocks.*;
    
    public class RegistryHandler {
    
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ProjectSkyblock.MOD_ID);
        public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ProjectSkyblock.MOD_ID);
        private static final DeferredRegister<TileEntityType<?>> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ProjectSkyblock.MOD_ID);
      
      public static final RegistryObject<Block> LAVA_GENERATOR_BLOCK  = BLOCKS.register("lava_generator_block", LavaGeneratorBlock::new);
       public static final RegistryObject<Item> LAVA_GENERATOR_BLOCK_ITEM = ITEMS.register("lava_generator_block", () -> new BlockItemBaseLavaGenerator(LAVA_GENERATOR_BLOCK.get()));
      public static final RegistryObject<TileEntityType<LavaGeneratorTile>> LAVAGENERATOR_TILE = TILES.register("lava_generator_block", () -> TileEntityType.Builder.create(LavaGeneratorTile::new, LAVA_GENERATOR_BLOCK.get()).build(null));
      public static void init() {
            ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
            BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
            TILES.register(FMLJavaModLoadingContext.get().getModEventBus());
        }
    
    }
    
      

     

    LavaGeneratorBlock.java

    package raziel23x.projectskyblock.blocks;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockState;
    import net.minecraft.block.SoundType;
    import net.minecraft.block.material.Material;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.world.IBlockReader;
    
    import javax.annotation.Nullable;
    
    public class LavaGeneratorBlock extends Block {
        public LavaGeneratorBlock(){
            super(Properties.create(Material.ROCK)
                    .sound(SoundType.STONE)
                    .hardnessAndResistance(2.0f)
            );
    
        }
    
        @Override
        public boolean hasTileEntity(BlockState state) {
            return true;
        }
    
        @Nullable
        @Override
        public TileEntity createTileEntity(BlockState state, IBlockReader world) {
            return new LavaGeneratorTile();
        }
    }

     

    LavaGeneratorTile.java

    package raziel23x.projectskyblock.blocks;
    
    import net.minecraft.fluid.Fluids;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.tileentity.ITickableTileEntity;
    import net.minecraft.util.Direction;
    import net.minecraftforge.common.capabilities.Capability;
    import net.minecraftforge.common.util.LazyOptional;
    import net.minecraftforge.fluids.FluidAttributes;
    import net.minecraftforge.fluids.FluidStack;
    import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
    import net.minecraftforge.fluids.capability.templates.FluidTank;
    
    import javax.annotation.Nonnull;
    import javax.annotation.Nullable;
    
    import static raziel23x.projectskyblock.utils.RegistryHandler.LAVAGENERATOR_TILE;
    
    public class LavaGeneratorTile extends TileEntity implements ITickableTileEntity {
        private int tick;
        public LavaGeneratorTile() {
            super(LAVAGENERATOR_TILE.get());
        }
    
        @Override
        public void tick() {
            tick++;
            if (tick == 10) {
                tick = 0;
                FluidStack stack = new FluidStack(Fluids.LAVA, Integer.MAX_VALUE);
             // CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
    
            }
        }
    
        public LazyOptional<FluidTank> fluidHandler = LazyOptional.of(this::createFluidHandler);
    
        public FluidTank getFluidHandler() {
            return fluidHandler.orElseThrow(RuntimeException::new);
        }
    
        @Nonnull
        @Override
        public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
            if (!this.removed) {
                if (cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
                    return this.fluidHandler.cast();
                }
            }
            return super.getCapability(cap, side);
        }
    
        private FluidTank createFluidHandler() {
            return new FluidTank(FluidAttributes.BUCKET_VOLUME * 8) {
                @Override
                protected void onContentsChanged() {
                    markDirty();
                }
            };
        }
    }
    

     

    BlockItemBaseLavaGenerator.java

    package raziel23x.projectskyblock.blocks;
    
    import net.minecraft.block.Block;
    import net.minecraft.client.util.ITooltipFlag;
    import net.minecraft.item.BlockItem;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.text.ITextComponent;
    import net.minecraft.util.text.TextFormatting;
    import net.minecraft.util.text.TranslationTextComponent;
    import net.minecraft.world.World;
    import net.minecraftforge.api.distmarker.Dist;
    import net.minecraftforge.api.distmarker.OnlyIn;
    import raziel23x.projectskyblock.ProjectSkyblock;
    
    import java.util.List;
    
    
    public class BlockItemBaseLavaGenerator extends BlockItem {
        public BlockItemBaseLavaGenerator(Block block) {
            super(block, new Properties().group(ProjectSkyblock.TAB).maxStackSize(1));
        }
        @OnlyIn(Dist.CLIENT)
        @Override
        public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
            tooltip.add((new TranslationTextComponent("tip."+ProjectSkyblock.MOD_ID+".LavaGeneratorline1").mergeStyle(TextFormatting.GREEN)));
            tooltip.add((new TranslationTextComponent("tip."+ProjectSkyblock.MOD_ID+".LavaGeneratorline2").mergeStyle(TextFormatting.YELLOW)));
            super.addInformation(stack, worldIn, tooltip, flagIn);
        }
    
    
    }

     

    out on my own about a simple cobblegen and though i would try my hand at doing one for water and lava just to see if i can pull it off but cant seem to find much information

     

    i am just lost and maybe someone could point me in the right direction

  5. https://github.com/MinecraftForge/MinecraftForge/issues/5907

     

    debug is generated but no matter what its always just https://paste.dimdev.org/zaraholobo.sql never any info just the same line over and over again with crashed ones as well as fully functional games with no crashes the debug always reads these lines even if i delete the debug log and rerun forge

     

    you can even compare this debug log to the original one that i sent to you after telling you the debug log was useless and not needed and you can see that even this newly generated debug log i just posted as a example which was deleted and freshly created today is a exact copy of the debug log from oct 27th

  6. I fixed the issue by changing forge versions and it has both fixed the crash and debug working yet debug just does this

     

    C:\fakepath(49,8-56): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
    C:\fakepath(55,8-26): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them 

     

    over and over again with just

    C:\fakepath(49,8-56):

    C:\fakepath(55,8-26): 

    the (xx,xx) has differnt numbers

     

  7. the debug file has stopped working like 5 forge versions ago and the last known version of forge where the debug forge file was working is not compatible with most mods anymore so if you want one i will have to downgrade about 40 different mods and then the issue will not be present anymore so again that file will again be not valid and this is a known issue with the debug file and being worked on if you are following the issue tracker on github,,,,,,

  8. like i said no further information is there even in the the log you keep referring to that file i uploaded is a few days old so this log you want is invalid  i think i know what information is relevant to post so telling me to look at your signature every time is pointless when i know what a time stamp is and posted all timed stamped items of the date and time the issue happened

  9. I have updated my modpack to the latest forge 28.1.70 and cannot get the modpack to even get past the forge loader

    Crash Log- https://paste.dimdev.org/zomezuhuyo.mccrash

    Debug Log https://paste.dimdev.org/juxeneliwi.sql (this was added because some idiot said it was needed even though it was created and modified almost a week ago when i had my last crash when i added a new mod that i removed and fixed the issue i had last time)

  10. @Animefan8888 @LexManos

     

    found this in  LycanitesMobs

    https://gitlab.com/Lycanite/LycanitesMobs/blob/master/src/main/java/com/lycanitesmobs/GameEventListener.java#L180-205

    // ==================================================
        //                 Attack Target Event
        // ==================================================
    	@SubscribeEvent(priority = EventPriority.HIGHEST)
    	public void onAttackTarget(LivingSetAttackTargetEvent event) {
    		Entity targetEntity = event.getTarget();
    		if(event.getEntityLiving() == null || targetEntity == null) {
    			return;
    		}
    
    		// Better Invisibility:
    		if(!event.getEntityLiving().isPotionActive(Effects.INVISIBILITY)) {
    			if(targetEntity.isInvisible()) {
    				if(event.isCancelable())
    					event.setCanceled(true);
    				event.getEntityLiving().setRevengeTarget(null);
    				return;
    			}
    		}
    
    		// Can Be Targeted:
    		if(event.getEntityLiving() instanceof MobEntity && targetEntity instanceof BaseCreatureEntity) {
    			if(!((BaseCreatureEntity)targetEntity).canBeTargetedBy(event.getEntityLiving())) {
    				event.getEntityLiving().setRevengeTarget(null);
    				if(event.isCancelable())
    					event.setCanceled(true);
    				((MobEntity)event.getEntityLiving()).setAttackTarget(null);
    			}
    		}
    	}
    
    
  11. https://gitlab.com/Lycanite/LycanitesMobs/issues/582#note_223146060 he saying its a issue with forge not his mod but........

    @Animefan8888

    Example modpack with just the mods listed
    Testing invisible crash-1.0.0.zip

     

    I have started testing this mod with just lycanitesmobs while did not crash so i added EverlastingAbilities and CyclopsCore no crash but the second i add Apotheosis and Placebo and run the same test that is when the crash happens I looked at the code and see that Apotheosis has some custom code for invisibility so i think i narrowed it down to that since the test modpack above just has all the mods we though it was but it did not go crash until Apotheosis  as added into the mix

×
×
  • Create New...

Important Information

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