<commit_before>package com.creativemd.littletiles.common.utils.rotation;

import javax.vecmath.Matrix3f;

import com.creativemd.creativecore.common.utils.Rotation;
import com.creativemd.creativecore.common.utils.RotationUtils;
import com.creativemd.littletiles.common.entity.EntityAnimation;
import com.creativemd.littletiles.common.entity.EntityDoorAnimation;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.AxisAlignedBB;

public class OrdinaryDoorTransformation extends DoorTransformation{
	
	public Rotation rotation;
	
	public OrdinaryDoorTransformation() {
		
	}
	
	public OrdinaryDoorTransformation(Rotation rotation) {
		this.rotation = rotation;
	}

	@Override
	public void performTransformation(EntityDoorAnimation animation, double progress) {
		switch(rotation)
		{
		case X_CLOCKWISE:
			animation.worldRotX = (1-progress)*90;
			break;
		case X_COUNTER_CLOCKWISE:
			animation.worldRotX = -90+progress*90;
			break;
		case Y_CLOCKWISE:
			animation.worldRotY = -90+progress*90;
			break;
		case Y_COUNTER_CLOCKWISE:
			animation.worldRotY = (1-progress)*90;
			break;
		case Z_CLOCKWISE:
			animation.worldRotZ = -90+progress*90;
			break;
		case Z_COUNTER_CLOCKWISE:
			animation.worldRotZ = (1-progress)*90;
			break;	
		}
	}

	@Override
	protected void writeToNBTExtra(NBTTagCompound nbt) {
		nbt.setInteger("rot", rotation.ordinal());
	}

	@Override
	protected void readFromNBT(NBTTagCompound nbt) {
		rotation = Rotation.values()[nbt.getInteger("rot")];
	}

	@Override<commit_msg>Fixed animation rotation of doors<commit_after>package com.creativemd.littletiles.common.utils.rotation;

import javax.vecmath.Matrix3f;

import com.creativemd.creativecore.common.utils.Rotation;
import com.creativemd.creativecore.common.utils.RotationUtils;
import com.creativemd.littletiles.common.entity.EntityAnimation;
import com.creativemd.littletiles.common.entity.EntityDoorAnimation;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.AxisAlignedBB;

public class OrdinaryDoorTransformation extends DoorTransformation{
	
	public Rotation rotation;
	
	public OrdinaryDoorTransformation() {
		
	}
	
	public OrdinaryDoorTransformation(Rotation rotation) {
		this.rotation = rotation;
	}

	@Override
	public void performTransformation(EntityDoorAnimation animation, double progress) {
		switch(rotation)
		{
		case X_CLOCKWISE:
			animation.worldRotX = -90+progress*90;
			break;
		case X_COUNTER_CLOCKWISE:
			animation.worldRotX = (1-progress)*90;
			break;
		case Y_CLOCKWISE:
			animation.worldRotY = (1-progress)*90;
			break;
		case Y_COUNTER_CLOCKWISE:
			animation.worldRotY = -90+progress*90;
			break;
		case Z_CLOCKWISE:
			animation.worldRotZ = -90+progress*90;
			break;
		case Z_COUNTER_CLOCKWISE:
			animation.worldRotZ = (1-progress)*90;
			break;	
		}
	}

	@Override
	protected void writeToNBTExtra(NBTTagCompound nbt) {
		nbt.setInteger("rot", rotation.ordinal());
	}

	@Override
	protected void readFromNBT(NBTTagCompound nbt) {
		rotation = Rotation.values()[nbt.getInteger("rot")];
	}

	@Override
{'fraction_non_alphanumeric': 0.09908735332464146, 'fraction_numerical': 0.014341590612777053, 'mean_word_length': 5.150300601202405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '835537', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1032, 'n_words': 171}