• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Im trying to create a block that faces the player when placed, if I get rid of the "facing" the block always faces north and with them there the texture errors:   Blockstate/not_block.json   { "variants": {         "": { "model": "minecraftedu:block/not_block"}         "facing=north": { "model": "minecraftedu:block/not_block"}         "facing=south": { "model": "minecraftedu:block/not_block", "y": 180 }         "facing=east": { "model": "minecraftedu:block/not_block", "y": 270 }         "facing=west": { "model": "minecraftedu:block/not_block", "y": 90 }            } }   not_block public class Not_Block extends Block {     public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;          public Not_Block(Properties properties) {         super(properties);         this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH));     }          //sets the block to always be placed facing the player     @Override     public BlockState getStateForPlacement(BlockItemUseContext context) {         return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite());     }          @Override     protected void fillStateContainer(Builder<Block, BlockState> builder) {         builder.add(FACING);     }  }        
    • https://stackoverflow.com/questions/11247793/why-do-some-folks-use-classmethod-instead-of-class-method-in-correspondence
    • Yeah...I'm trying to understand the concept of two sides in Minecraft. As I see it, ServerChatEvent should fire when a player chat on server. The code below is event loader. public class EventLoader { public EventLoader() { MinecraftForge.EVENT_BUS.register(this); } ResourceLocation location = new ResourceLocation("mytestmod", "mytestmod.test"); SoundEvent se = new SoundEvent(location); @SubscribeEvent public void onPlayerChat(ServerChatEvent event) { event.getPlayer().sendMessage(new TextComponentString("fired!")); System.out.println("fired!"); event.getPlayer().world.playSound(null, event.getPlayer().getPosition(),se, SoundCategory.PLAYERS, 1.0F, 1.0F); } }   And I initiate it in the main class. public void preInit(FMLPreInitializationEvent event) { new EventLoader(); }   The result when I test it on my remote server was nothing happen.
    • I'm working on a capability that should allow me to create rpg-like skills, and I need to save the data from those skills to the player.   This is my CapabilitySkills class, in case the problem is actually in there: package com.lk1905.gielinorcraft.capability.skill; import com.lk1905.gielinorcraft.api.capability.ISkillContainer; import com.lk1905.gielinorcraft.api.utils.CapabilityUtils; import com.lk1905.gielinorcraft.capability.CommonCapabilityProvider; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber public class CapabilitySkills { @CapabilityInject(ISkillContainer.class) private static Capability<ISkillContainer> skillContainerCapability; public static void register() { CapabilityManager.INSTANCE.register(ISkillContainer.class, new SkillStorage(), () -> new SkillContainer());//<---THIS LINE } @SubscribeEvent public static void attachCapability(AttachCapabilitiesEvent<Entity> e) { if(!(e.getObject() instanceof PlayerEntity)) { return; } SkillContainer newContainer = new SkillContainer(); e.addCapability(newContainer.getCapabilityID(), new CommonCapabilityProvider<>(skillContainerCapability, null, newContainer)); } @SubscribeEvent public static void onPlayerClone(final PlayerEvent.Clone e) { ISkillContainer oldCapability = (ISkillContainer) CapabilityUtils.getCapability(e.getOriginal(), skillContainerCapability); ISkillContainer newCapability = (ISkillContainer) CapabilityUtils.getCapability(e.getPlayer(), skillContainerCapability); newCapability.setAllSkills(oldCapability.getAllSkills()); } public static ISkillContainer getSkillContainer(ICapabilityProvider provider) { return (ISkillContainer) CapabilityUtils.getCapability(provider, skillContainerCapability); } public static Capability<ISkillContainer> getSkillCapability(){ return skillContainerCapability; } }  
  • Topics

  • Who's Online (See full list)