- 382
- 2
- 24
ldtteam/Animatrix для 1.12.2. Для 1.7.10 есть? Можно перегнать? В аниматриксе есть классы,которых нет в 1.7.10?
там дофига классов. Потратить 1 час, чтобы только понять что это не для 1.7.10?Ля, да скачай себе исходники и проверь, неужели так трудно!?
Там только в одном из классов был импорт какой-то - org.jetbrains.annotations.NotNull; - это вообще откуда и на что его заменитьХоспаде... У меня просто нет слов.
Правильно, зачем тратить свое время, пусть лучше какой-то лох за тебя разбирается, а потом тебе даст результат)
По теме: там нечего переносить, заменить везде GlStateManager на GL обычным, остальное по мелочи.
Удали везде упоминание этой аннотации.
package com.ldtteam.animatrix.handler;
import com.ldtteam.animatrix.entity.IEntityAnimatrix;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ClientTickEventHandler
{
@SubscribeEvent
public void onTickClientTick(final TickEvent.ClientTickEvent event)
{
if (Minecraft.getMinecraft().world == null)
return;
Minecraft.getMinecraft()
.world
.getEntities(Entity.class, IEntityAnimatrix.class::isInstance)
.forEach(e -> {
((IEntityAnimatrix)e)
.getAnimatrixModel()
.getAnimator()
.onUpdate();
}
);
}
}
package com.ldtteam.animatrix.loader.model;
import com.ldtteam.animatrix.loader.data.AnimatedModelData;
import com.ldtteam.animatrix.loader.data.JointData;
import com.ldtteam.animatrix.loader.data.MeshData;
import com.ldtteam.animatrix.model.AnimatrixModel;
import com.ldtteam.animatrix.model.IModel;
import com.ldtteam.animatrix.model.skeleton.AnimatrixJoint;
import com.ldtteam.animatrix.model.skeleton.AnimatrixSkeleton;
import com.ldtteam.animatrix.model.skeleton.IJoint;
import com.ldtteam.animatrix.model.skeleton.ISkeleton;
import com.ldtteam.animatrix.model.skin.AnimatrixSkin;
import com.ldtteam.animatrix.model.skin.ISkin;
import io.netty.util.internal.ConcurrentSet;
import net.minecraft.client.model.ModelOcelot;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Collection;
import java.util.stream.Collectors;
@SideOnly(Side.CLIENT)
public class ModelLoaderManager implements IModelLoaderManager
{
private final ConcurrentSet<IModelLoader> loaders = new ConcurrentSet<>();
@Override
public IModel loadModel(final ResourceLocation location, final ResourceLocation texture)
{
final AnimatedModelData data = loaders.stream().filter(l -> l.canLoadModel(location)).findFirst().orElseThrow(() -> new IllegalArgumentException("Not supported model file: " + location)).loadModel(location);
final ISkin skin = new AnimatrixSkin(createVAO(data.getMeshData()), texture);
final ISkeleton skeleton = new AnimatrixSkeleton(createJoints(data.getJointsData().getHeadJoint()));
return new AnimatrixModel(skeleton, skin);
}
/**
* Constructs the joint-hierarchy skeleton from the data extracted from the
* collada file.
*
* @param data
* - the joints data from the collada file for the head joint.
* @return The created joint, with all its descendants added.
*/
private static IJoint createJoints(final JointData data) {
final Collection<IJoint> childJoints = data.getChildren().stream().map(ModelLoaderManager::createJoints).collect(Collectors.toList());
return new AnimatrixJoint(data.getIndex(), data.getNameId(), data.getBindLocalTransform(), childJoints);
}
/**
* Stores the mesh data in a VAO.
*
* @param data
* - all the data about the mesh that needs to be stored in the
* VAO.
* @return The VAO containing all the mesh data for the model.
*/
private static VAO createVAO(final MeshData data) {
final VAO meshVao = GPUMemoryManager.getInstance().createVAO();
meshVao.bind();
meshVao.createIndexBuffer(data.getIndices());
meshVao.createAttribute(0, data.getVertices(), 3);
meshVao.createAttribute(1, data.getTextureCoords(), 2);
meshVao.createIntAttribute(2, data.getJointIds(), 3);
meshVao.createAttribute(3, data.getVertexWeights(), 3);
meshVao.unbind();
return meshVao;
}
@Override
public void registerLoader(final IModelLoader loader)
{
loaders.add(loader);
}
}
на какой именно, там GL 11, GL 12 и так далее (около 10 GL)заменить везде GlStateManager на GL обычным
хорошо, только скажи про import com.ldtteam.graphicsexpanded.gpu.VAO; - вообще понятия не имеюЧувак, я не буду за тебя портировать мод. Разбирайся сам. Хоть немного начни головой думать.
Здрасте-приехали... А импортнуть его никак? Заходишь в идею - file-project structure-libraries, добавляешь Maven и в поле прописываешь org.jetbrains:annotations:16.0.2Удали везде упоминание этой аннотации.