Jump to content

Recommended Posts

Posted

What else would I mean with overriding?

I thought you ment if I was using an @Override annotation, but... My head is dumb some times

 

The annotation doesn't compile into anything, you are still overriding a method.  If you are overriding a method, mark it with the annotation as it will detect user error in the method signature.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Not easily, no. You'd have to subscribe to the PlayerTickEvent (or EntityLivingTickEvent) and search the 3x4x3 volume around the entity for your fire block.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I have this:

	@SubscribeEvent
public void playerTick(TickEvent.PlayerTickEvent event) {
	EntityPlayer player = event.player;
	World world = player.world;
	BlockPos pos = player.getPosition();
	Random random = new Random();
	if (world.getBlockState(pos.west()).getBlock() == CheeseBlocks.CHEESE_FIRE
			|| world.getBlockState(pos.east()).getBlock() == CheeseBlocks.CHEESE_FIRE
			|| world.getBlockState(pos.north()).getBlock() == CheeseBlocks.CHEESE_FIRE
			|| world.getBlockState(pos.south()).getBlock() == CheeseBlocks.CHEESE_FIRE) {
		if(!world.isRemote && random.nextInt(20) == 0 && !player.isImmuneToFire() && !player.isCreative()) {
			player.setFire(random.nextInt(5) + 5);
		}
	}
}

And it seems to work, thanks

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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